From d4595c41e4f3411fbd3c6976aa6a79766c973af3 Mon Sep 17 00:00:00 2001 From: skaphan Date: Fri, 6 Mar 2026 17:53:16 -0500 Subject: [PATCH 01/31] Gitignore scripts/reset-db.sh to keep it local-only Co-Authored-By: Claude Opus 4.6 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ab1ce312..6159c8fa 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ staticfiles/ !.elasticbeanstalk/*.global.yml **/**/dist/ +scripts/reset-db.sh From 08b3f6995d217da81fe766b4c8d2819891eec6d2 Mon Sep 17 00:00:00 2001 From: skaphan Date: Tue, 24 Feb 2026 13:32:27 -0500 Subject: [PATCH 02/31] Add pie chart visualization template Add embedded pie chart web component, templates, static assets, and pie_chart_no_cache setting. Store raw JSON on graph for pie chart data access. --- common/cloudflare.py | 5 +- common/viewUtils.py | 1 + rcvis/settings.py | 9 + static/pie/pie-chart.es.js | 5607 ++++++++++++++++++ static/pie/pie.css | 5 + static/share/share.js | 3 +- static/visualizer/tabicons/pie.png | Bin 0 -> 2319 bytes templates/pie/pie-nonblocking.html | 54 + templates/pie/pie.html | 9 + templates/visualizer/visualize-embedded.html | 4 + templates/visualizer/visualize.html | 29 +- visualizer/graph/readRCVRCJSON.py | 1 + visualizer/serializers.py | 2 + visualizer/tests/testLiveBrowserHeadless.py | 4 +- 14 files changed, 5721 insertions(+), 12 deletions(-) create mode 100644 static/pie/pie-chart.es.js create mode 100644 static/pie/pie.css create mode 100644 static/visualizer/tabicons/pie.png create mode 100644 templates/pie/pie-nonblocking.html create mode 100644 templates/pie/pie.html diff --git a/common/cloudflare.py b/common/cloudflare.py index 33c2a7f9..8fbba373 100644 --- a/common/cloudflare.py +++ b/common/cloudflare.py @@ -40,6 +40,7 @@ def purge_vis_cache(cls, slug): reverse('visualizeEmbedly', args=(slug, 'barchart-interactive')), reverse('visualizeEmbedly', args=(slug, 'sankey')), reverse('visualizeEmbedly', args=(slug, 'table')), + reverse('visualizeEmbedly', args=(slug, 'pie')), reverse('visualizeBallotpedia', args=(slug,)), reverse('visualizeEmbedded', args=(slug,)) + '?vistype=barchart-interactive', reverse('visualizeEmbedded', args=(slug,)) + '?vistype=barchart-fixed', @@ -47,7 +48,9 @@ def purge_vis_cache(cls, slug): reverse('visualizeEmbedded', args=(slug,)) + '?vistype=tabular-by-round', reverse('visualizeEmbedded', args=(slug,)) + '?vistype=tabular-by-round-interactive', reverse('visualizeEmbedded', args=(slug,)) + '?vistype=candidate-by-round', - reverse('visualizeEmbedded', args=(slug,)) + '?vistype=sankey' + reverse('visualizeEmbedded', args=(slug,)) + '?vistype=sankey', + reverse('visualizeEmbedded', args=(slug,)) + '?vistype=pie' + ] cls.purge_paths_cache(paths) diff --git a/common/viewUtils.py b/common/viewUtils.py index 8c5f48c7..49c13ce5 100644 --- a/common/viewUtils.py +++ b/common/viewUtils.py @@ -68,6 +68,7 @@ def get_data_for_graph(graph, config): 'tabularByRound': tabularByRound, 'tabularByRoundInteractive': tabularByRoundInteractive, 'graph': graph, + 'rawData': graph._raw_JSON, 'textForWinner': as_caption(config).lower(), } roundDescriberData = get_data_for_round_describer(graph, config) diff --git a/rcvis/settings.py b/rcvis/settings.py index 8c9ae643..e288d61f 100644 --- a/rcvis/settings.py +++ b/rcvis/settings.py @@ -192,6 +192,15 @@ } } + +def pie_chart_no_cache(headers, path, url): + """Ensure browsers revalidate the pie chart component on every load.""" + if url.endswith('pie-chart.es.js'): + headers['Cache-Control'] = 'no-cache' + + +WHITENOISE_ADD_HEADERS_FUNCTION = pie_chart_no_cache + NODE_PACKAGE_JSON = './package.json' NODE_MODULES_ROOT = './node_modules' NODE_PACKAGE_MANAGER_EXECUTABLE = os.environ.get('NODE_PACKAGE_MANAGER_EXECUTABLE', '/usr/bin/npm') diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js new file mode 100644 index 00000000..a70b1317 --- /dev/null +++ b/static/pie/pie-chart.es.js @@ -0,0 +1,5607 @@ +var ol = Object.defineProperty; +var ks = (t) => { + throw TypeError(t); +}; +var ll = (t, e, n) => e in t ? ol(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var ot = (t, e, n) => ll(t, typeof e != "symbol" ? e + "" : e, n), Ti = (t, e, n) => e.has(t) || ks("Cannot " + n); +var d = (t, e, n) => (Ti(t, e, "read from private field"), n ? n.call(t) : e.get(t)), L = (t, e, n) => e.has(t) ? ks("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), O = (t, e, n, r) => (Ti(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), pt = (t, e, n) => (Ti(t, e, "access private method"), n); +var ua; +typeof window < "u" && ((ua = window.__svelte ?? (window.__svelte = {})).v ?? (ua.v = /* @__PURE__ */ new Set())).add("5"); +const ul = 1, fl = 2, cl = 16, hl = 1, dl = 4, pl = 8, vl = 16, gl = 2, is = "[", fi = "[!", ss = "]", Bn = {}, _t = Symbol(), _l = "http://www.w3.org/1999/xhtml", Di = !1; +var ha = Array.isArray, ml = Array.prototype.indexOf, Un = Array.prototype.includes, ci = Array.from, Zr = Object.keys, Jr = Object.defineProperty, mn = Object.getOwnPropertyDescriptor, yl = Object.prototype, wl = Array.prototype, xl = Object.getPrototypeOf, Ms = Object.isExtensible; +const bl = () => { +}; +function $l(t) { + for (var e = 0; e < t.length; e++) + t[e](); +} +function da() { + var t, e, n = new Promise((r, i) => { + t = r, e = i; + }); + return { promise: n, resolve: t, reject: e }; +} +function Al(t, e) { + if (Array.isArray(t)) + return t; + if (!(Symbol.iterator in t)) + return Array.from(t); + const n = []; + for (const r of t) + if (n.push(r), n.length === e) break; + return n; +} +const wt = 2, vr = 4, hi = 8, pa = 1 << 24, Ue = 16, pe = 32, en = 64, va = 128, Jt = 512, vt = 1024, xt = 2048, de = 4096, Lt = 8192, He = 16384, Qn = 32768, Xn = 65536, Ps = 1 << 17, ga = 1 << 18, Nn = 1 << 19, El = 1 << 20, Ze = 1 << 25, $n = 65536, Ii = 1 << 21, as = 1 << 22, Je = 1 << 23, hr = Symbol("$state"), _a = Symbol("legacy props"), on = new class extends Error { + constructor() { + super(...arguments); + ot(this, "name", "StaleReactionError"); + ot(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + } +}(), Rr = 3, tr = 8; +function Rl(t) { + throw new Error("https://svelte.dev/e/lifecycle_outside_component"); +} +function Tl() { + throw new Error("https://svelte.dev/e/async_derived_orphan"); +} +function Cl(t, e, n) { + throw new Error("https://svelte.dev/e/each_key_duplicate"); +} +function Nl(t) { + throw new Error("https://svelte.dev/e/effect_in_teardown"); +} +function Sl() { + throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); +} +function kl(t) { + throw new Error("https://svelte.dev/e/effect_orphan"); +} +function Ml() { + throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); +} +function Pl() { + throw new Error("https://svelte.dev/e/hydration_failed"); +} +function Ol(t) { + throw new Error("https://svelte.dev/e/props_invalid_value"); +} +function Dl() { + throw new Error("https://svelte.dev/e/state_descriptors_fixed"); +} +function Il() { + throw new Error("https://svelte.dev/e/state_prototype_fixed"); +} +function Fl() { + throw new Error("https://svelte.dev/e/state_unsafe_mutation"); +} +function Ll() { + throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); +} +function di(t) { + console.warn("https://svelte.dev/e/hydration_mismatch"); +} +function ql() { + console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); +} +let Z = !1; +function ze(t) { + Z = t; +} +let H; +function Pt(t) { + if (t === null) + throw di(), Bn; + return H = t; +} +function pi() { + return Pt(/* @__PURE__ */ ke(H)); +} +function Ut(t) { + if (Z) { + if (/* @__PURE__ */ ke(H) !== null) + throw di(), Bn; + H = t; + } +} +function Fi(t = 1) { + if (Z) { + for (var e = t, n = H; e--; ) + n = /** @type {TemplateNode} */ + /* @__PURE__ */ ke(n); + H = n; + } +} +function Qr(t = !0) { + for (var e = 0, n = H; ; ) { + if (n.nodeType === tr) { + var r = ( + /** @type {Comment} */ + n.data + ); + if (r === ss) { + if (e === 0) return n; + e -= 1; + } else (r === is || r === fi || // "[1", "[2", etc. for if blocks + r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); + } + var i = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ ke(n) + ); + t && n.remove(), n = i; + } +} +function ma(t) { + if (!t || t.nodeType !== tr) + throw di(), Bn; + return ( + /** @type {Comment} */ + t.data + ); +} +function ya(t) { + return t === this.v; +} +function Vl(t, e) { + return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; +} +function wa(t) { + return !Vl(t, this.v); +} +let zl = !1, qt = null; +function Gn(t) { + qt = t; +} +function os(t, e = !1, n) { + qt = { + p: qt, + i: !1, + c: null, + e: null, + s: t, + x: null, + l: null + }; +} +function ls(t) { + var e = ( + /** @type {ComponentContext} */ + qt + ), n = e.e; + if (n !== null) { + e.e = null; + for (var r of n) + Ua(r); + } + return t !== void 0 && (e.x = t), e.i = !0, qt = e.p, t ?? /** @type {T} */ + {}; +} +function xa() { + return !0; +} +let ln = []; +function ba() { + var t = ln; + ln = [], $l(t); +} +function yn(t) { + if (ln.length === 0 && !dr) { + var e = ln; + queueMicrotask(() => { + e === ln && ba(); + }); + } + ln.push(t); +} +function Hl() { + for (; ln.length > 0; ) + ba(); +} +function $a(t) { + var e = X; + if (e === null) + return z.f |= Je, t; + if ((e.f & Qn) === 0 && (e.f & vr) === 0) + throw t; + Kn(t, e); +} +function Kn(t, e) { + for (; e !== null; ) { + if ((e.f & va) !== 0) { + if ((e.f & Qn) === 0) + throw t; + try { + e.b.error(t); + return; + } catch (n) { + t = n; + } + } + e = e.parent; + } + throw t; +} +const Yl = -7169; +function lt(t, e) { + t.f = t.f & Yl | e; +} +function us(t) { + (t.f & Jt) !== 0 || t.deps === null ? lt(t, vt) : lt(t, de); +} +function Aa(t) { + if (t !== null) + for (const e of t) + (e.f & wt) === 0 || (e.f & $n) === 0 || (e.f ^= $n, Aa( + /** @type {Derived} */ + e.deps + )); +} +function Ea(t, e, n) { + (t.f & xt) !== 0 ? e.add(t) : (t.f & de) !== 0 && n.add(t), Aa(t.deps), lt(t, vt); +} +const Mr = /* @__PURE__ */ new Set(); +let Y = null, yt = null, St = [], vi = null, Li = !1, dr = !1; +var Fn, Ln, hn, qn, xr, br, dn, Ie, Vn, Se, qi, Vi, Ra; +const Es = class Es { + constructor() { + L(this, Se); + ot(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} + */ + ot(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} + */ + ot(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>} + */ + L(this, Fn, /* @__PURE__ */ new Set()); + /** + * If a fork is discarded, we need to destroy any effects that are no longer needed + * @type {Set<(batch: Batch) => void>} + */ + L(this, Ln, /* @__PURE__ */ new Set()); + /** + * The number of async effects that are currently in flight + */ + L(this, hn, 0); + /** + * The number of async effects that are currently in flight, _not_ inside a pending boundary + */ + L(this, qn, 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} + */ + L(this, xr, null); + /** + * Deferred effects (which run after async work has completed) that are DIRTY + * @type {Set} + */ + L(this, br, /* @__PURE__ */ new Set()); + /** + * Deferred effects that are MAYBE_DIRTY + * @type {Set} + */ + L(this, dn, /* @__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`. + * The value contains child effects that were dirty/maybe_dirty before being reset, + * so they can be rescheduled if the branch survives. + * @type {Map} + */ + L(this, Ie, /* @__PURE__ */ new Map()); + ot(this, "is_fork", !1); + L(this, Vn, !1); + } + is_deferred() { + return this.is_fork || d(this, qn) > 0; + } + /** + * Add an effect to the #skipped_branches map and reset its children + * @param {Effect} effect + */ + skip_effect(e) { + d(this, Ie).has(e) || d(this, Ie).set(e, { d: [], m: [] }); + } + /** + * Remove an effect from the #skipped_branches map and reschedule + * any tracked dirty/maybe_dirty child effects + * @param {Effect} effect + */ + unskip_effect(e) { + var n = d(this, Ie).get(e); + if (n) { + d(this, Ie).delete(e); + for (var r of n.d) + lt(r, xt), ce(r); + for (r of n.m) + lt(r, de), ce(r); + } + } + /** + * + * @param {Effect[]} root_effects + */ + process(e) { + var i; + St = [], this.apply(); + var n = [], r = []; + for (const s of e) + pt(this, Se, qi).call(this, s, n, r); + if (this.is_deferred()) { + pt(this, Se, Vi).call(this, r), pt(this, Se, Vi).call(this, n); + for (const [s, a] of d(this, Ie)) + Sa(s, a); + } else { + for (const s of d(this, Fn)) s(); + d(this, Fn).clear(), d(this, hn) === 0 && pt(this, Se, Ra).call(this), Y = null, Os(r), Os(n), (i = d(this, xr)) == null || i.resolve(); + } + yt = null; + } + /** + * Associate a change to a given source with the current + * batch, noting its previous and current values + * @param {Source} source + * @param {any} value + */ + capture(e, n) { + n !== _t && !this.previous.has(e) && this.previous.set(e, n), (e.f & Je) === 0 && (this.current.set(e, e.v), yt == null || yt.set(e, e.v)); + } + activate() { + Y = this, this.apply(); + } + deactivate() { + Y === this && (Y = null, yt = null); + } + flush() { + if (this.activate(), St.length > 0) { + if (Ta(), Y !== null && Y !== this) + return; + } else d(this, hn) === 0 && this.process([]); + this.deactivate(); + } + discard() { + for (const e of d(this, Ln)) e(this); + d(this, Ln).clear(); + } + /** + * + * @param {boolean} blocking + */ + increment(e) { + O(this, hn, d(this, hn) + 1), e && O(this, qn, d(this, qn) + 1); + } + /** + * + * @param {boolean} blocking + */ + decrement(e) { + O(this, hn, d(this, hn) - 1), e && O(this, qn, d(this, qn) - 1), !d(this, Vn) && (O(this, Vn, !0), yn(() => { + O(this, Vn, !1), this.is_deferred() ? St.length > 0 && this.flush() : this.revive(); + })); + } + revive() { + for (const e of d(this, br)) + d(this, dn).delete(e), lt(e, xt), ce(e); + for (const e of d(this, dn)) + lt(e, de), ce(e); + this.flush(); + } + /** @param {() => void} fn */ + oncommit(e) { + d(this, Fn).add(e); + } + /** @param {(batch: Batch) => void} fn */ + ondiscard(e) { + d(this, Ln).add(e); + } + settled() { + return (d(this, xr) ?? O(this, xr, da())).promise; + } + static ensure() { + if (Y === null) { + const e = Y = new Es(); + Mr.add(Y), dr || yn(() => { + Y === e && e.flush(); + }); + } + return Y; + } + apply() { + } +}; +Fn = new WeakMap(), Ln = new WeakMap(), hn = new WeakMap(), qn = new WeakMap(), xr = new WeakMap(), br = new WeakMap(), dn = new WeakMap(), Ie = new WeakMap(), Vn = new WeakMap(), Se = new WeakSet(), /** + * Traverse the effect tree, executing effects or stashing + * them for later execution as appropriate + * @param {Effect} root + * @param {Effect[]} effects + * @param {Effect[]} render_effects + */ +qi = function(e, n, r) { + e.f ^= vt; + for (var i = e.first, s = null; i !== null; ) { + var a = i.f, o = (a & (pe | en)) !== 0, l = o && (a & vt) !== 0, u = l || (a & Lt) !== 0 || d(this, Ie).has(i); + if (!u && i.fn !== null) { + o ? i.f ^= vt : s !== null && (a & (vr | hi | pa)) !== 0 ? s.b.defer_effect(i) : (a & vr) !== 0 ? n.push(i) : Tr(i) && ((a & Ue) !== 0 && d(this, dn).add(i), jn(i)); + var f = i.first; + if (f !== null) { + i = f; + continue; + } + } + var h = i.parent; + for (i = i.next; i === null && h !== null; ) + h === s && (s = null), i = h.next, h = h.parent; + } +}, /** + * @param {Effect[]} effects + */ +Vi = function(e) { + for (var n = 0; n < e.length; n += 1) + Ea(e[n], d(this, br), d(this, dn)); +}, Ra = function() { + var i; + if (Mr.size > 1) { + this.previous.clear(); + var e = yt, n = !0; + for (const s of Mr) { + if (s === this) { + n = !1; + continue; + } + const a = []; + for (const [l, u] of this.current) { + if (s.current.has(l)) + if (n && u !== s.current.get(l)) + s.current.set(l, u); + else + continue; + a.push(l); + } + if (a.length === 0) + continue; + const o = [...s.current.keys()].filter((l) => !this.current.has(l)); + if (o.length > 0) { + var r = St; + St = []; + const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); + for (const f of a) + Ca(f, o, l, u); + if (St.length > 0) { + Y = s, s.apply(); + for (const f of St) + pt(i = s, Se, qi).call(i, f, [], []); + s.deactivate(); + } + St = r; + } + } + Y = null, yt = e; + } + this.committed = !0, Mr.delete(this); +}; +let Ye = Es; +function jt(t) { + var e = dr; + dr = !0; + try { + for (var n; ; ) { + if (Hl(), St.length === 0 && (Y == null || Y.flush(), St.length === 0)) + return vi = null, /** @type {T} */ + n; + Ta(); + } + } finally { + dr = e; + } +} +function Ta() { + Li = !0; + var t = null; + try { + for (var e = 0; St.length > 0; ) { + var n = Ye.ensure(); + if (e++ > 1e3) { + var r, i; + Bl(); + } + n.process(St), Qe.clear(); + } + } finally { + St = [], Li = !1, vi = null; + } +} +function Bl() { + try { + Ml(); + } catch (t) { + Kn(t, vi); + } +} +let oe = null; +function Os(t) { + var e = t.length; + if (e !== 0) { + for (var n = 0; n < e; ) { + var r = t[n++]; + if ((r.f & (He | Lt)) === 0 && Tr(r) && (oe = /* @__PURE__ */ new Set(), jn(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Ka(r), (oe == null ? void 0 : oe.size) > 0)) { + Qe.clear(); + for (const i of oe) { + if ((i.f & (He | Lt)) !== 0) continue; + const s = [i]; + let a = i.parent; + for (; a !== null; ) + oe.has(a) && (oe.delete(a), s.push(a)), a = a.parent; + for (let o = s.length - 1; o >= 0; o--) { + const l = s[o]; + (l.f & (He | Lt)) === 0 && jn(l); + } + } + oe.clear(); + } + } + oe = null; + } +} +function Ca(t, e, n, r) { + if (!n.has(t) && (n.add(t), t.reactions !== null)) + for (const i of t.reactions) { + const s = i.f; + (s & wt) !== 0 ? Ca( + /** @type {Derived} */ + i, + e, + n, + r + ) : (s & (as | Ue)) !== 0 && (s & xt) === 0 && Na(i, e, r) && (lt(i, xt), ce( + /** @type {Effect} */ + i + )); + } +} +function Na(t, e, n) { + const r = n.get(t); + if (r !== void 0) return r; + if (t.deps !== null) + for (const i of t.deps) { + if (Un.call(e, i)) + return !0; + if ((i.f & wt) !== 0 && Na( + /** @type {Derived} */ + i, + e, + n + )) + return n.set( + /** @type {Derived} */ + i, + !0 + ), !0; + } + return n.set(t, !1), !1; +} +function ce(t) { + for (var e = vi = t; e.parent !== null; ) { + e = e.parent; + var n = e.f; + if (Li && e === X && (n & Ue) !== 0 && (n & ga) === 0) + return; + if ((n & (en | pe)) !== 0) { + if ((n & vt) === 0) return; + e.f ^= vt; + } + } + St.push(e); +} +function Sa(t, e) { + if (!((t.f & pe) !== 0 && (t.f & vt) !== 0)) { + (t.f & xt) !== 0 ? e.d.push(t) : (t.f & de) !== 0 && e.m.push(t), lt(t, vt); + for (var n = t.first; n !== null; ) + Sa(n, e), n = n.next; + } +} +function Ul(t) { + let e = 0, n = An(0), r; + return () => { + hs() && (w(n), ps(() => (e === 0 && (r = mi(() => t(() => pr(n)))), e += 1, () => { + yn(() => { + e -= 1, e === 0 && (r == null || r(), r = void 0, pr(n)); + }); + }))); + }; +} +var Xl = Xn | Nn | va; +function Gl(t, e, n) { + new Kl(t, e, n); +} +var It, $r, $e, pn, Ae, Kt, Nt, Ee, Fe, je, vn, Le, zn, gn, Hn, Yn, qe, li, ht, ka, Ma, zi, zr, Hr, Hi; +class Kl { + /** + * @param {TemplateNode} node + * @param {BoundaryProps} props + * @param {((anchor: Node) => void)} children + */ + constructor(e, n, r) { + L(this, ht); + /** @type {Boundary | null} */ + ot(this, "parent"); + ot(this, "is_pending", !1); + /** @type {TemplateNode} */ + L(this, It); + /** @type {TemplateNode | null} */ + L(this, $r, Z ? H : null); + /** @type {BoundaryProps} */ + L(this, $e); + /** @type {((anchor: Node) => void)} */ + L(this, pn); + /** @type {Effect} */ + L(this, Ae); + /** @type {Effect | null} */ + L(this, Kt, null); + /** @type {Effect | null} */ + L(this, Nt, null); + /** @type {Effect | null} */ + L(this, Ee, null); + /** @type {DocumentFragment | null} */ + L(this, Fe, null); + /** @type {TemplateNode | null} */ + L(this, je, null); + L(this, vn, 0); + L(this, Le, 0); + L(this, zn, !1); + L(this, gn, !1); + /** @type {Set} */ + L(this, Hn, /* @__PURE__ */ new Set()); + /** @type {Set} */ + L(this, Yn, /* @__PURE__ */ new Set()); + /** + * A source containing the number of pending async deriveds/expressions. + * Only created if `$effect.pending()` is used inside the boundary, + * otherwise updating the source results in needless `Batch.ensure()` + * calls followed by no-op flushes + * @type {Source | null} + */ + L(this, qe, null); + L(this, li, Ul(() => (O(this, qe, An(d(this, vn))), () => { + O(this, qe, null); + }))); + O(this, It, e), O(this, $e, n), O(this, pn, r), this.parent = /** @type {Effect} */ + X.b, this.is_pending = !!d(this, $e).pending, O(this, Ae, vs(() => { + if (X.b = this, Z) { + const s = d(this, $r); + pi(), /** @type {Comment} */ + s.nodeType === tr && /** @type {Comment} */ + s.data === fi ? pt(this, ht, Ma).call(this) : (pt(this, ht, ka).call(this), d(this, Le) === 0 && (this.is_pending = !1)); + } else { + var i = pt(this, ht, zi).call(this); + try { + O(this, Kt, Zt(() => r(i))); + } catch (s) { + this.error(s); + } + d(this, Le) > 0 ? pt(this, ht, Hr).call(this) : this.is_pending = !1; + } + return () => { + var s; + (s = d(this, je)) == null || s.remove(); + }; + }, Xl)), Z && O(this, It, H); + } + /** + * Defer an effect inside a pending boundary until the boundary resolves + * @param {Effect} effect + */ + defer_effect(e) { + Ea(e, d(this, Hn), d(this, Yn)); + } + /** + * Returns `false` if the effect exists inside a boundary whose pending snippet is shown + * @returns {boolean} + */ + is_rendered() { + return !this.is_pending && (!this.parent || this.parent.is_rendered()); + } + has_pending_snippet() { + return !!d(this, $e).pending; + } + /** + * Update the source that powers `$effect.pending()` inside this boundary, + * and controls when the current `pending` snippet (if any) is removed. + * Do not call from inside the class + * @param {1 | -1} d + */ + update_pending_count(e) { + pt(this, ht, Hi).call(this, e), O(this, vn, d(this, vn) + e), !(!d(this, qe) || d(this, zn)) && (O(this, zn, !0), yn(() => { + O(this, zn, !1), d(this, qe) && Wn(d(this, qe), d(this, vn)); + })); + } + get_effect_pending() { + return d(this, li).call(this), w( + /** @type {Source} */ + d(this, qe) + ); + } + /** @param {unknown} error */ + error(e) { + var n = d(this, $e).onerror; + let r = d(this, $e).failed; + if (d(this, gn) || !n && !r) + throw e; + d(this, Kt) && (Rt(d(this, Kt)), O(this, Kt, null)), d(this, Nt) && (Rt(d(this, Nt)), O(this, Nt, null)), d(this, Ee) && (Rt(d(this, Ee)), O(this, Ee, null)), Z && (Pt( + /** @type {TemplateNode} */ + d(this, $r) + ), Fi(), Pt(Qr())); + var i = !1, s = !1; + const a = () => { + if (i) { + ql(); + return; + } + i = !0, s && Ll(), Ye.ensure(), O(this, vn, 0), d(this, Ee) !== null && wn(d(this, Ee), () => { + O(this, Ee, null); + }), this.is_pending = this.has_pending_snippet(), O(this, Kt, pt(this, ht, zr).call(this, () => (O(this, gn, !1), Zt(() => d(this, pn).call(this, d(this, It)))))), d(this, Le) > 0 ? pt(this, ht, Hr).call(this) : this.is_pending = !1; + }; + yn(() => { + try { + s = !0, n == null || n(e, a), s = !1; + } catch (o) { + Kn(o, d(this, Ae) && d(this, Ae).parent); + } + r && O(this, Ee, pt(this, ht, zr).call(this, () => { + Ye.ensure(), O(this, gn, !0); + try { + return Zt(() => { + r( + d(this, It), + () => e, + () => a + ); + }); + } catch (o) { + return Kn( + o, + /** @type {Effect} */ + d(this, Ae).parent + ), null; + } finally { + O(this, gn, !1); + } + })); + }); + } +} +It = new WeakMap(), $r = new WeakMap(), $e = new WeakMap(), pn = new WeakMap(), Ae = new WeakMap(), Kt = new WeakMap(), Nt = new WeakMap(), Ee = new WeakMap(), Fe = new WeakMap(), je = new WeakMap(), vn = new WeakMap(), Le = new WeakMap(), zn = new WeakMap(), gn = new WeakMap(), Hn = new WeakMap(), Yn = new WeakMap(), qe = new WeakMap(), li = new WeakMap(), ht = new WeakSet(), ka = function() { + try { + O(this, Kt, Zt(() => d(this, pn).call(this, d(this, It)))); + } catch (e) { + this.error(e); + } +}, Ma = function() { + const e = d(this, $e).pending; + e && (O(this, Nt, Zt(() => e(d(this, It)))), yn(() => { + var n = pt(this, ht, zi).call(this); + O(this, Kt, pt(this, ht, zr).call(this, () => (Ye.ensure(), Zt(() => d(this, pn).call(this, n))))), d(this, Le) > 0 ? pt(this, ht, Hr).call(this) : (wn( + /** @type {Effect} */ + d(this, Nt), + () => { + O(this, Nt, null); + } + ), this.is_pending = !1); + })); +}, zi = function() { + var e = d(this, It); + return this.is_pending && (O(this, je, te()), d(this, It).before(d(this, je)), e = d(this, je)), e; +}, /** + * @param {() => Effect | null} fn + */ +zr = function(e) { + var n = X, r = z, i = qt; + Ne(d(this, Ae)), ee(d(this, Ae)), Gn(d(this, Ae).ctx); + try { + return e(); + } catch (s) { + return $a(s), null; + } finally { + Ne(n), ee(r), Gn(i); + } +}, Hr = function() { + const e = ( + /** @type {(anchor: Node) => void} */ + d(this, $e).pending + ); + d(this, Kt) !== null && (O(this, Fe, document.createDocumentFragment()), d(this, Fe).append( + /** @type {TemplateNode} */ + d(this, je) + ), Za(d(this, Kt), d(this, Fe))), d(this, Nt) === null && O(this, Nt, Zt(() => e(d(this, It)))); +}, /** + * 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 + * @param {1 | -1} d + */ +Hi = function(e) { + var n; + if (!this.has_pending_snippet()) { + this.parent && pt(n = this.parent, ht, Hi).call(n, e); + return; + } + if (O(this, Le, d(this, Le) + e), d(this, Le) === 0) { + this.is_pending = !1; + for (const r of d(this, Hn)) + lt(r, xt), ce(r); + for (const r of d(this, Yn)) + lt(r, de), ce(r); + d(this, Hn).clear(), d(this, Yn).clear(), d(this, Nt) && wn(d(this, Nt), () => { + O(this, Nt, null); + }), d(this, Fe) && (d(this, It).before(d(this, Fe)), O(this, Fe, null)); + } +}; +function Wl(t, e, n, r) { + const i = gi; + var s = t.filter((c) => !c.settled); + if (n.length === 0 && s.length === 0) { + r(e.map(i)); + return; + } + var a = Y, o = ( + /** @type {Effect} */ + X + ), l = jl(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + function f(c) { + l(); + try { + r(c); + } catch (v) { + (o.f & He) === 0 && Kn(v, o); + } + a == null || a.deactivate(), Yi(); + } + if (n.length === 0) { + u.then(() => f(e.map(i))); + return; + } + function h() { + l(), Promise.all(n.map((c) => /* @__PURE__ */ Zl(c))).then((c) => f([...e.map(i), ...c])).catch((c) => Kn(c, o)); + } + u ? u.then(h) : h(); +} +function jl() { + var t = X, e = z, n = qt, r = Y; + return function(s = !0) { + Ne(t), ee(e), Gn(n), s && (r == null || r.activate()); + }; +} +function Yi() { + Ne(null), ee(null), Gn(null); +} +// @__NO_SIDE_EFFECTS__ +function gi(t) { + var e = wt | xt, n = z !== null && (z.f & wt) !== 0 ? ( + /** @type {Derived} */ + z + ) : null; + return X !== null && (X.f |= Nn), { + ctx: qt, + deps: null, + effects: null, + equals: ya, + f: e, + fn: t, + reactions: null, + rv: 0, + v: ( + /** @type {V} */ + _t + ), + wv: 0, + parent: n ?? X, + ac: null + }; +} +// @__NO_SIDE_EFFECTS__ +function Zl(t, e, n) { + let r = ( + /** @type {Effect | null} */ + X + ); + r === null && Tl(); + var i = ( + /** @type {Boundary} */ + r.b + ), s = ( + /** @type {Promise} */ + /** @type {unknown} */ + void 0 + ), a = An( + /** @type {V} */ + _t + ), o = !z, l = /* @__PURE__ */ new Map(); + return ou(() => { + var v; + var u = da(); + s = u.promise; + try { + Promise.resolve(t()).then(u.resolve, u.reject).then(() => { + f === Y && f.committed && f.deactivate(), Yi(); + }); + } catch (g) { + u.reject(g), Yi(); + } + var f = ( + /** @type {Batch} */ + Y + ); + if (o) { + var h = i.is_rendered(); + i.update_pending_count(1), f.increment(h), (v = l.get(f)) == null || v.reject(on), l.delete(f), l.set(f, u); + } + const c = (g, m = void 0) => { + if (f.activate(), m) + m !== on && (a.f |= Je, Wn(a, m)); + else { + (a.f & Je) !== 0 && (a.f ^= Je), Wn(a, g); + for (const [b, A] of l) { + if (l.delete(b), b === f) break; + A.reject(on); + } + } + o && (i.update_pending_count(-1), f.decrement(h)); + }; + u.promise.then(c, (g) => c(null, g || "unknown")); + }), iu(() => { + for (const u of l.values()) + u.reject(on); + }), new Promise((u) => { + function f(h) { + function c() { + h === s ? u(a) : f(s); + } + h.then(c, c); + } + f(s); + }); +} +// @__NO_SIDE_EFFECTS__ +function sr(t) { + const e = /* @__PURE__ */ gi(t); + return Ja(e), e; +} +// @__NO_SIDE_EFFECTS__ +function Pa(t) { + const e = /* @__PURE__ */ gi(t); + return e.equals = wa, e; +} +function Jl(t) { + var e = t.effects; + if (e !== null) { + t.effects = null; + for (var n = 0; n < e.length; n += 1) + Rt( + /** @type {Effect} */ + e[n] + ); + } +} +function Ql(t) { + for (var e = t.parent; e !== null; ) { + if ((e.f & wt) === 0) + return (e.f & He) === 0 ? ( + /** @type {Effect} */ + e + ) : null; + e = e.parent; + } + return null; +} +function fs(t) { + var e, n = X; + Ne(Ql(t)); + try { + t.f &= ~$n, Jl(t), e = no(t); + } finally { + Ne(n); + } + return e; +} +function Oa(t) { + var e = fs(t); + if (!t.equals(e) && (t.wv = to(), (!(Y != null && Y.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { + lt(t, vt); + return; + } + tn || (yt !== null ? (hs() || Y != null && Y.is_fork) && yt.set(t, e) : us(t)); +} +function tu(t) { + var e, n; + if (t.effects !== null) + for (const r of t.effects) + (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(on), r.teardown = bl, r.ac = null, gr(r, 0), gs(r)); +} +function Da(t) { + if (t.effects !== null) + for (const e of t.effects) + e.teardown && jn(e); +} +let Bi = /* @__PURE__ */ new Set(); +const Qe = /* @__PURE__ */ new Map(); +let Ia = !1; +function An(t, e) { + var n = { + f: 0, + // TODO ideally we could skip this altogether, but it causes type errors + v: t, + reactions: null, + equals: ya, + rv: 0, + wv: 0 + }; + return n; +} +// @__NO_SIDE_EFFECTS__ +function mt(t, e) { + const n = An(t); + return Ja(n), n; +} +// @__NO_SIDE_EFFECTS__ +function Fa(t, e = !1, n = !0) { + const r = An(t); + return e || (r.equals = wa), r; +} +function J(t, e, n = !1) { + z !== 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 + (!he || (z.f & Ps) !== 0) && xa() && (z.f & (wt | Ue | as | Ps)) !== 0 && (Qt === null || !Un.call(Qt, t)) && Fl(); + let r = n ? un(e) : e; + return Wn(t, r); +} +function Wn(t, e) { + if (!t.equals(e)) { + var n = t.v; + tn ? Qe.set(t, e) : Qe.set(t, n), t.v = e; + var r = Ye.ensure(); + if (r.capture(t, n), (t.f & wt) !== 0) { + const i = ( + /** @type {Derived} */ + t + ); + (t.f & xt) !== 0 && fs(i), us(i); + } + t.wv = to(), La(t, xt), X !== null && (X.f & vt) !== 0 && (X.f & (pe | en)) === 0 && (Gt === null ? fu([t]) : Gt.push(t)), !r.is_fork && Bi.size > 0 && !Ia && eu(); + } + return e; +} +function eu() { + Ia = !1; + for (const t of Bi) + (t.f & vt) !== 0 && lt(t, de), Tr(t) && jn(t); + Bi.clear(); +} +function pr(t) { + J(t, t.v + 1); +} +function La(t, e) { + var n = t.reactions; + if (n !== null) + for (var r = n.length, i = 0; i < r; i++) { + var s = n[i], a = s.f, o = (a & xt) === 0; + if (o && lt(s, e), (a & wt) !== 0) { + var l = ( + /** @type {Derived} */ + s + ); + yt == null || yt.delete(l), (a & $n) === 0 && (a & Jt && (s.f |= $n), La(l, de)); + } else o && ((a & Ue) !== 0 && oe !== null && oe.add( + /** @type {Effect} */ + s + ), ce( + /** @type {Effect} */ + s + )); + } +} +function un(t) { + if (typeof t != "object" || t === null || hr in t) + return t; + const e = xl(t); + if (e !== yl && e !== wl) + return t; + var n = /* @__PURE__ */ new Map(), r = ha(t), i = /* @__PURE__ */ mt(0), s = xn, a = (o) => { + if (xn === s) + return o(); + var l = z, u = xn; + ee(null), Fs(s); + var f = o(); + return ee(l), Fs(u), f; + }; + return r && n.set("length", /* @__PURE__ */ mt( + /** @type {any[]} */ + t.length + )), new Proxy( + /** @type {any} */ + t, + { + defineProperty(o, l, u) { + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Dl(); + var f = n.get(l); + return f === void 0 ? a(() => { + var h = /* @__PURE__ */ mt(u.value); + return n.set(l, h), h; + }) : J(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__ */ mt(_t)); + n.set(l, f), pr(i); + } + } else + J(u, _t), pr(i); + return !0; + }, + get(o, l, u) { + var v; + if (l === hr) + return t; + var f = n.get(l), h = l in o; + if (f === void 0 && (!h || (v = mn(o, l)) != null && v.writable) && (f = a(() => { + var g = un(h ? o[l] : _t), m = /* @__PURE__ */ mt(g); + return m; + }), n.set(l, f)), f !== void 0) { + var c = w(f); + return c === _t ? void 0 : c; + } + return Reflect.get(o, l, u); + }, + getOwnPropertyDescriptor(o, l) { + var u = Reflect.getOwnPropertyDescriptor(o, l); + if (u && "value" in u) { + var f = n.get(l); + f && (u.value = w(f)); + } else if (u === void 0) { + var h = n.get(l), c = h == null ? void 0 : h.v; + if (h !== void 0 && c !== _t) + return { + enumerable: !0, + configurable: !0, + value: c, + writable: !0 + }; + } + return u; + }, + has(o, l) { + var c; + if (l === hr) + return !0; + var u = n.get(l), f = u !== void 0 && u.v !== _t || Reflect.has(o, l); + if (u !== void 0 || X !== null && (!f || (c = mn(o, l)) != null && c.writable)) { + u === void 0 && (u = a(() => { + var v = f ? un(o[l]) : _t, g = /* @__PURE__ */ mt(v); + return g; + }), n.set(l, u)); + var h = w(u); + if (h === _t) + return !1; + } + return f; + }, + set(o, l, u, f) { + var T; + var h = n.get(l), c = l in o; + if (r && l === "length") + for (var v = u; v < /** @type {Source} */ + h.v; v += 1) { + var g = n.get(v + ""); + g !== void 0 ? J(g, _t) : v in o && (g = a(() => /* @__PURE__ */ mt(_t)), n.set(v + "", g)); + } + if (h === void 0) + (!c || (T = mn(o, l)) != null && T.writable) && (h = a(() => /* @__PURE__ */ mt(void 0)), J(h, un(u)), n.set(l, h)); + else { + c = h.v !== _t; + var m = a(() => un(u)); + J(h, m); + } + var b = Reflect.getOwnPropertyDescriptor(o, l); + if (b != null && b.set && b.set.call(f, u), !c) { + if (r && typeof l == "string") { + var A = ( + /** @type {Source} */ + n.get("length") + ), S = Number(l); + Number.isInteger(S) && S >= A.v && J(A, S + 1); + } + pr(i); + } + return !0; + }, + ownKeys(o) { + w(i); + var l = Reflect.ownKeys(o).filter((h) => { + var c = n.get(h); + return c === void 0 || c.v !== _t; + }); + for (var [u, f] of n) + f.v !== _t && !(u in o) && l.push(u); + return l; + }, + setPrototypeOf() { + Il(); + } + } + ); +} +var Ds, qa, Va, za; +function Ui() { + if (Ds === void 0) { + Ds = window, qa = /Firefox/.test(navigator.userAgent); + var t = Element.prototype, e = Node.prototype, n = Text.prototype; + Va = mn(e, "firstChild").get, za = mn(e, "nextSibling").get, Ms(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Ms(n) && (n.__t = void 0); + } +} +function te(t = "") { + return document.createTextNode(t); +} +// @__NO_SIDE_EFFECTS__ +function En(t) { + return ( + /** @type {TemplateNode | null} */ + Va.call(t) + ); +} +// @__NO_SIDE_EFFECTS__ +function ke(t) { + return ( + /** @type {TemplateNode | null} */ + za.call(t) + ); +} +function Xt(t, e) { + if (!Z) + return /* @__PURE__ */ En(t); + var n = /* @__PURE__ */ En(H); + if (n === null) + n = H.appendChild(te()); + else if (e && n.nodeType !== Rr) { + var r = te(); + return n == null || n.before(r), Pt(r), r; + } + return e && _i( + /** @type {Text} */ + n + ), Pt(n), n; +} +function Mn(t, e = !1) { + if (!Z) { + var n = /* @__PURE__ */ En(t); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ke(n) : n; + } + if (e) { + if ((H == null ? void 0 : H.nodeType) !== Rr) { + var r = te(); + return H == null || H.before(r), Pt(r), r; + } + _i( + /** @type {Text} */ + H + ); + } + return H; +} +function ae(t, e = 1, n = !1) { + let r = Z ? H : t; + for (var i; e--; ) + i = r, r = /** @type {TemplateNode} */ + /* @__PURE__ */ ke(r); + if (!Z) + return r; + if (n) { + if ((r == null ? void 0 : r.nodeType) !== Rr) { + var s = te(); + return r === null ? i == null || i.after(s) : r.before(s), Pt(s), s; + } + _i( + /** @type {Text} */ + r + ); + } + return Pt(r), r; +} +function Ha(t) { + t.textContent = ""; +} +function Ya() { + return !1; +} +function cs(t, e, n) { + return ( + /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ + document.createElementNS(_l, t, void 0) + ); +} +function _i(t) { + if ( + /** @type {string} */ + t.nodeValue.length < 65536 + ) + return; + let e = t.nextSibling; + for (; e !== null && e.nodeType === Rr; ) + e.remove(), t.nodeValue += /** @type {string} */ + e.nodeValue, e = t.nextSibling; +} +function Ba(t) { + var e = z, n = X; + ee(null), Ne(null); + try { + return t(); + } finally { + ee(e), Ne(n); + } +} +function nu(t) { + X === null && (z === null && kl(), Sl()), tn && Nl(); +} +function ru(t, e) { + var n = e.last; + n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); +} +function Me(t, e, n) { + var r = X; + r !== null && (r.f & Lt) !== 0 && (t |= Lt); + var i = { + ctx: qt, + deps: null, + nodes: null, + f: t | xt | Jt, + first: null, + fn: e, + last: null, + next: null, + parent: r, + b: r && r.b, + prev: null, + teardown: null, + wv: 0, + ac: null + }; + if (n) + try { + jn(i); + } catch (o) { + throw Rt(i), o; + } + else e !== null && ce(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 & Nn) === 0 && (s = s.first, (t & Ue) !== 0 && (t & Xn) !== 0 && s !== null && (s.f |= Xn)), s !== null && (s.parent = r, r !== null && ru(s, r), z !== null && (z.f & wt) !== 0 && (t & en) === 0)) { + var a = ( + /** @type {Derived} */ + z + ); + (a.effects ?? (a.effects = [])).push(s); + } + return i; +} +function hs() { + return z !== null && !he; +} +function iu(t) { + const e = Me(hi, null, !1); + return lt(e, vt), e.teardown = t, e; +} +function ds(t) { + nu(); + var e = ( + /** @type {Effect} */ + X.f + ), n = !z && (e & pe) !== 0 && (e & Qn) === 0; + if (n) { + var r = ( + /** @type {ComponentContext} */ + qt + ); + (r.e ?? (r.e = [])).push(t); + } else + return Ua(t); +} +function Ua(t) { + return Me(vr | El, t, !1); +} +function su(t) { + Ye.ensure(); + const e = Me(en | Nn, t, !0); + return () => { + Rt(e); + }; +} +function au(t) { + Ye.ensure(); + const e = Me(en | Nn, t, !0); + return (n = {}) => new Promise((r) => { + n.outro ? wn(e, () => { + Rt(e), r(void 0); + }) : (Rt(e), r(void 0)); + }); +} +function Xa(t) { + return Me(vr, t, !1); +} +function ou(t) { + return Me(as | Nn, t, !0); +} +function ps(t, e = 0) { + return Me(hi | e, t, !0); +} +function Pr(t, e = [], n = [], r = []) { + Wl(r, e, n, (i) => { + Me(hi, () => t(...i.map(w)), !0); + }); +} +function vs(t, e = 0) { + var n = Me(Ue | e, t, !0); + return n; +} +function Zt(t) { + return Me(pe | Nn, t, !0); +} +function Ga(t) { + var e = t.teardown; + if (e !== null) { + const n = tn, r = z; + Is(!0), ee(null); + try { + e.call(null); + } finally { + Is(n), ee(r); + } + } +} +function gs(t, e = !1) { + var n = t.first; + for (t.first = t.last = null; n !== null; ) { + const i = n.ac; + i !== null && Ba(() => { + i.abort(on); + }); + var r = n.next; + (n.f & en) !== 0 ? n.parent = null : Rt(n, e), n = r; + } +} +function lu(t) { + for (var e = t.first; e !== null; ) { + var n = e.next; + (e.f & pe) === 0 && Rt(e), e = n; + } +} +function Rt(t, e = !0) { + var n = !1; + (e || (t.f & ga) !== 0) && t.nodes !== null && t.nodes.end !== null && (uu( + t.nodes.start, + /** @type {TemplateNode} */ + t.nodes.end + ), n = !0), gs(t, e && !n), gr(t, 0), lt(t, He); + var r = t.nodes && t.nodes.t; + if (r !== null) + for (const s of r) + s.stop(); + Ga(t); + var i = t.parent; + i !== null && i.first !== null && Ka(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; +} +function uu(t, e) { + for (; t !== null; ) { + var n = t === e ? null : /* @__PURE__ */ ke(t); + t.remove(), t = n; + } +} +function Ka(t) { + var e = t.parent, n = t.prev, r = t.next; + n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); +} +function wn(t, e, n = !0) { + var r = []; + Wa(t, r, !0); + var i = () => { + n && Rt(t), e && e(); + }, s = r.length; + if (s > 0) { + var a = () => --s || i(); + for (var o of r) + o.out(a); + } else + i(); +} +function Wa(t, e, n) { + if ((t.f & Lt) === 0) { + t.f ^= Lt; + var r = t.nodes && t.nodes.t; + if (r !== null) + for (const o of r) + (o.is_global || n) && e.push(o); + for (var i = t.first; i !== null; ) { + var s = i.next, a = (i.f & Xn) !== 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 & pe) !== 0 && (t.f & Ue) !== 0; + Wa(i, e, a ? n : !1), i = s; + } + } +} +function _s(t) { + ja(t, !0); +} +function ja(t, e) { + if ((t.f & Lt) !== 0) { + t.f ^= Lt, (t.f & vt) === 0 && (lt(t, xt), ce(t)); + for (var n = t.first; n !== null; ) { + var r = n.next, i = (n.f & Xn) !== 0 || (n.f & pe) !== 0; + ja(n, i ? e : !1), n = r; + } + var s = t.nodes && t.nodes.t; + if (s !== null) + for (const a of s) + (a.is_global || e) && a.in(); + } +} +function Za(t, e) { + if (t.nodes) + for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { + var i = n === r ? null : /* @__PURE__ */ ke(n); + e.append(n), n = i; + } +} +let Yr = !1, tn = !1; +function Is(t) { + tn = t; +} +let z = null, he = !1; +function ee(t) { + z = t; +} +let X = null; +function Ne(t) { + X = t; +} +let Qt = null; +function Ja(t) { + z !== null && (Qt === null ? Qt = [t] : Qt.push(t)); +} +let kt = null, Dt = 0, Gt = null; +function fu(t) { + Gt = t; +} +let Qa = 1, fn = 0, xn = fn; +function Fs(t) { + xn = t; +} +function to() { + return ++Qa; +} +function Tr(t) { + var e = t.f; + if ((e & xt) !== 0) + return !0; + if (e & wt && (t.f &= ~$n), (e & de) !== 0) { + for (var n = ( + /** @type {Value[]} */ + t.deps + ), r = n.length, i = 0; i < r; i++) { + var s = n[i]; + if (Tr( + /** @type {Derived} */ + s + ) && Oa( + /** @type {Derived} */ + s + ), s.wv > t.wv) + return !0; + } + (e & Jt) !== 0 && // During time traveling we don't want to reset the status so that + // traversal of the graph in the other batches still happens + yt === null && lt(t, vt); + } + return !1; +} +function eo(t, e, n = !0) { + var r = t.reactions; + if (r !== null && !(Qt !== null && Un.call(Qt, t))) + for (var i = 0; i < r.length; i++) { + var s = r[i]; + (s.f & wt) !== 0 ? eo( + /** @type {Derived} */ + s, + e, + !1 + ) : e === s && (n ? lt(s, xt) : (s.f & vt) !== 0 && lt(s, de), ce( + /** @type {Effect} */ + s + )); + } +} +function no(t) { + var m; + var e = kt, n = Dt, r = Gt, i = z, s = Qt, a = qt, o = he, l = xn, u = t.f; + kt = /** @type {null | Value[]} */ + null, Dt = 0, Gt = null, z = (u & (pe | en)) === 0 ? t : null, Qt = null, Gn(t.ctx), he = !1, xn = ++fn, t.ac !== null && (Ba(() => { + t.ac.abort(on); + }), t.ac = null); + try { + t.f |= Ii; + var f = ( + /** @type {Function} */ + t.fn + ), h = f(); + t.f |= Qn; + var c = t.deps, v = Y == null ? void 0 : Y.is_fork; + if (kt !== null) { + var g; + if (v || gr(t, Dt), c !== null && Dt > 0) + for (c.length = Dt + kt.length, g = 0; g < kt.length; g++) + c[Dt + g] = kt[g]; + else + t.deps = c = kt; + if (hs() && (t.f & Jt) !== 0) + for (g = Dt; g < c.length; g++) + ((m = c[g]).reactions ?? (m.reactions = [])).push(t); + } else !v && c !== null && Dt < c.length && (gr(t, Dt), c.length = Dt); + if (xa() && Gt !== null && !he && c !== null && (t.f & (wt | de | xt)) === 0) + for (g = 0; g < /** @type {Source[]} */ + Gt.length; g++) + eo( + Gt[g], + /** @type {Effect} */ + t + ); + if (i !== null && i !== t) { + if (fn++, i.deps !== null) + for (let b = 0; b < n; b += 1) + i.deps[b].rv = fn; + if (e !== null) + for (const b of e) + b.rv = fn; + Gt !== null && (r === null ? r = Gt : r.push(.../** @type {Source[]} */ + Gt)); + } + return (t.f & Je) !== 0 && (t.f ^= Je), h; + } catch (b) { + return $a(b); + } finally { + t.f ^= Ii, kt = e, Dt = n, Gt = r, z = i, Qt = s, Gn(a), he = o, xn = l; + } +} +function cu(t, e) { + let n = e.reactions; + if (n !== null) { + var r = ml.call(n, t); + if (r !== -1) { + var i = n.length - 1; + i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); + } + } + if (n === null && (e.f & wt) !== 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 + (kt === null || !Un.call(kt, e))) { + var s = ( + /** @type {Derived} */ + e + ); + (s.f & Jt) !== 0 && (s.f ^= Jt, s.f &= ~$n), us(s), tu(s), gr(s, 0); + } +} +function gr(t, e) { + var n = t.deps; + if (n !== null) + for (var r = e; r < n.length; r++) + cu(t, n[r]); +} +function jn(t) { + var e = t.f; + if ((e & He) === 0) { + lt(t, vt); + var n = X, r = Yr; + X = t, Yr = !0; + try { + (e & (Ue | pa)) !== 0 ? lu(t) : gs(t), Ga(t); + var i = no(t); + t.teardown = typeof i == "function" ? i : null, t.wv = Qa; + var s; + Di && zl && (t.f & xt) !== 0 && t.deps; + } finally { + Yr = r, X = n; + } + } +} +function w(t) { + var e = t.f, n = (e & wt) !== 0; + if (z !== null && !he) { + var r = X !== null && (X.f & He) !== 0; + if (!r && (Qt === null || !Un.call(Qt, t))) { + var i = z.deps; + if ((z.f & Ii) !== 0) + t.rv < fn && (t.rv = fn, kt === null && i !== null && i[Dt] === t ? Dt++ : kt === null ? kt = [t] : kt.push(t)); + else { + (z.deps ?? (z.deps = [])).push(t); + var s = t.reactions; + s === null ? t.reactions = [z] : Un.call(s, z) || s.push(z); + } + } + } + if (tn && Qe.has(t)) + return Qe.get(t); + if (n) { + var a = ( + /** @type {Derived} */ + t + ); + if (tn) { + var o = a.v; + return ((a.f & vt) === 0 && a.reactions !== null || io(a)) && (o = fs(a)), Qe.set(a, o), o; + } + var l = (a.f & Jt) === 0 && !he && z !== null && (Yr || (z.f & Jt) !== 0), u = (a.f & Qn) === 0; + Tr(a) && (l && (a.f |= Jt), Oa(a)), l && !u && (Da(a), ro(a)); + } + if (yt != null && yt.has(t)) + return yt.get(t); + if ((t.f & Je) !== 0) + throw t.v; + return t.v; +} +function ro(t) { + if (t.f |= Jt, t.deps !== null) + for (const e of t.deps) + (e.reactions ?? (e.reactions = [])).push(t), (e.f & wt) !== 0 && (e.f & Jt) === 0 && (Da( + /** @type {Derived} */ + e + ), ro( + /** @type {Derived} */ + e + )); +} +function io(t) { + if (t.v === _t) return !0; + if (t.deps === null) return !1; + for (const e of t.deps) + if (Qe.has(e) || (e.f & wt) !== 0 && io( + /** @type {Derived} */ + e + )) + return !0; + return !1; +} +function mi(t) { + var e = he; + try { + return he = !0, t(); + } finally { + he = e; + } +} +const so = /* @__PURE__ */ new Set(), Xi = /* @__PURE__ */ new Set(); +function hu(t) { + for (var e = 0; e < t.length; e++) + so.add(t[e]); + for (var n of Xi) + n(t); +} +let Ls = null; +function qs(t) { + var b; + var e = this, n = ( + /** @type {Node} */ + e.ownerDocument + ), r = t.type, i = ((b = t.composedPath) == null ? void 0 : b.call(t)) || [], s = ( + /** @type {null | Element} */ + i[0] || t.target + ); + Ls = t; + var a = 0, o = Ls === t && t.__root; + if (o) { + var l = i.indexOf(o); + if (l !== -1 && (e === document || e === /** @type {any} */ + window)) { + t.__root = e; + return; + } + var u = i.indexOf(e); + if (u === -1) + return; + l <= u && (a = l); + } + if (s = /** @type {Element} */ + i[a] || t.target, s !== e) { + Jr(t, "currentTarget", { + configurable: !0, + get() { + return s || n; + } + }); + var f = z, h = X; + ee(null), Ne(null); + try { + for (var c, v = []; s !== null; ) { + var g = s.assignedSlot || s.parentNode || /** @type {any} */ + s.host || null; + try { + var m = s["__" + r]; + m != 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 + t.target === s) && m.call(s, t); + } catch (A) { + c ? v.push(A) : c = A; + } + if (t.cancelBubble || g === e || g === null) + break; + s = g; + } + if (c) { + for (let A of v) + queueMicrotask(() => { + throw A; + }); + throw c; + } + } finally { + t.__root = e, delete t.currentTarget, ee(f), Ne(h); + } + } +} +var fa, ca; +const Ci = (ca = (fa = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : fa.trustedTypes) == null ? void 0 : /* @__PURE__ */ ca.createPolicy( + "svelte-trusted-html", + { + /** @param {string} html */ + createHTML: (t) => t + } +); +function du(t) { + return ( + /** @type {string} */ + (Ci == null ? void 0 : Ci.createHTML(t)) ?? t + ); +} +function ao(t, e = !1) { + var n = cs("template"); + return t = t.replaceAll("", ""), n.innerHTML = e ? du(t) : t, n.content; +} +function Rn(t, e) { + var n = ( + /** @type {Effect} */ + X + ); + n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); +} +// @__NO_SIDE_EFFECTS__ +function er(t, e) { + var n = (e & gl) !== 0, r, i = !t.startsWith(""); + return () => { + if (Z) + return Rn(H, null), H; + r === void 0 && (r = ao(i ? t : "" + t, !0)); + var s = ( + /** @type {TemplateNode} */ + n || qa ? document.importNode(r, !0) : r.cloneNode(!0) + ); + { + var a = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ En(s) + ), o = ( + /** @type {TemplateNode} */ + s.lastChild + ); + Rn(a, o); + } + return s; + }; +} +// @__NO_SIDE_EFFECTS__ +function pu(t, e, n = "svg") { + var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; + return () => { + if (Z) + return Rn(H, null), H; + if (!s) { + var a = ( + /** @type {DocumentFragment} */ + ao(i, !0) + ), o = ( + /** @type {Element} */ + /* @__PURE__ */ En(a) + ); + s = /** @type {Element} */ + /* @__PURE__ */ En(o); + } + var l = ( + /** @type {TemplateNode} */ + s.cloneNode(!0) + ); + return Rn(l, l), l; + }; +} +// @__NO_SIDE_EFFECTS__ +function vu(t, e) { + return /* @__PURE__ */ pu(t, e, "svg"); +} +function Vs(t = "") { + if (!Z) { + var e = te(t + ""); + return Rn(e, e), e; + } + var n = H; + return n.nodeType !== Rr ? (n.before(n = te()), Pt(n)) : _i( + /** @type {Text} */ + n + ), Rn(n, n), n; +} +function be(t, e) { + if (Z) { + var n = ( + /** @type {Effect & { nodes: EffectNodes }} */ + X + ); + ((n.f & Qn) === 0 || n.nodes.end === null) && (n.nodes.end = H), pi(); + return; + } + t !== null && t.before( + /** @type {Node} */ + e + ); +} +const gu = ["touchstart", "touchmove"]; +function _u(t) { + return gu.includes(t); +} +function Pn(t, e) { + var n = e == null ? "" : typeof e == "object" ? e + "" : e; + n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); +} +function oo(t, e) { + return lo(t, e); +} +function mu(t, e) { + Ui(), e.intro = e.intro ?? !1; + const n = e.target, r = Z, i = H; + try { + for (var s = /* @__PURE__ */ En(n); s && (s.nodeType !== tr || /** @type {Comment} */ + s.data !== is); ) + s = /* @__PURE__ */ ke(s); + if (!s) + throw Bn; + ze(!0), Pt( + /** @type {Comment} */ + s + ); + const a = lo(t, { ...e, anchor: s }); + return ze(!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 !== Bn && console.warn("Failed to hydrate: ", a), e.recover === !1 && Pl(), Ui(), Ha(n), ze(!1), oo(t, e); + } finally { + ze(r), Pt(i); + } +} +const Or = /* @__PURE__ */ new Map(); +function lo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + Ui(); + var o = /* @__PURE__ */ new Set(), l = (h) => { + for (var c = 0; c < h.length; c++) { + var v = h[c]; + if (!o.has(v)) { + o.add(v); + var g = _u(v); + for (const A of [e, document]) { + var m = Or.get(A); + m === void 0 && (m = /* @__PURE__ */ new Map(), Or.set(A, m)); + var b = m.get(v); + b === void 0 ? (A.addEventListener(v, qs, { passive: g }), m.set(v, 1)) : m.set(v, b + 1); + } + } + } + }; + l(ci(so)), Xi.add(l); + var u = void 0, f = au(() => { + var h = n ?? e.appendChild(te()); + return Gl( + /** @type {TemplateNode} */ + h, + { + pending: () => { + } + }, + (c) => { + os({}); + var v = ( + /** @type {ComponentContext} */ + qt + ); + if (s && (v.c = s), i && (r.$$events = i), Z && Rn( + /** @type {TemplateNode} */ + c, + null + ), u = t(c, r) || {}, Z && (X.nodes.end = H, H === null || H.nodeType !== tr || /** @type {Comment} */ + H.data !== ss)) + throw di(), Bn; + ls(); + } + ), () => { + var m; + for (var c of o) + for (const b of [e, document]) { + var v = ( + /** @type {Map} */ + Or.get(b) + ), g = ( + /** @type {number} */ + v.get(c) + ); + --g == 0 ? (b.removeEventListener(c, qs), v.delete(c), v.size === 0 && Or.delete(b)) : v.set(c, g); + } + Xi.delete(l), h !== n && ((m = h.parentNode) == null || m.removeChild(h)); + }; + }); + return Gi.set(u, f), u; +} +let Gi = /* @__PURE__ */ new WeakMap(); +function yu(t, e) { + const n = Gi.get(t); + return n ? (Gi.delete(t), n(e)) : Promise.resolve(); +} +var le, Re, Ft, _n, Ar, Er, ui; +class wu { + /** + * @param {TemplateNode} anchor + * @param {boolean} transition + */ + constructor(e, n = !0) { + /** @type {TemplateNode} */ + ot(this, "anchor"); + /** @type {Map} */ + L(this, le, /* @__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. + * Example: + * ``` + * {#if condition} + * foo + * {:else} + * bar + * {/if} + * ``` + * Can result in the entries `true->Effect` and `false->Effect` + * @type {Map} + */ + L(this, Re, /* @__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} + */ + L(this, Ft, /* @__PURE__ */ new Map()); + /** + * Keys of effects that are currently outroing + * @type {Set} + */ + L(this, _n, /* @__PURE__ */ new Set()); + /** + * Whether to pause (i.e. outro) on change, or destroy immediately. + * This is necessary for `` + */ + L(this, Ar, !0); + L(this, Er, () => { + var e = ( + /** @type {Batch} */ + Y + ); + if (d(this, le).has(e)) { + var n = ( + /** @type {Key} */ + d(this, le).get(e) + ), r = d(this, Re).get(n); + if (r) + _s(r), d(this, _n).delete(n); + else { + var i = d(this, Ft).get(n); + i && (d(this, Re).set(n, i.effect), d(this, Ft).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + } + for (const [s, a] of d(this, le)) { + if (d(this, le).delete(s), s === e) + break; + const o = d(this, Ft).get(a); + o && (Rt(o.effect), d(this, Ft).delete(a)); + } + for (const [s, a] of d(this, Re)) { + if (s === n || d(this, _n).has(s)) continue; + const o = () => { + if (Array.from(d(this, le).values()).includes(s)) { + var u = document.createDocumentFragment(); + Za(a, u), u.append(te()), d(this, Ft).set(s, { effect: a, fragment: u }); + } else + Rt(a); + d(this, _n).delete(s), d(this, Re).delete(s); + }; + d(this, Ar) || !r ? (d(this, _n).add(s), wn(a, o, !1)) : o(); + } + } + }); + /** + * @param {Batch} batch + */ + L(this, ui, (e) => { + d(this, le).delete(e); + const n = Array.from(d(this, le).values()); + for (const [r, i] of d(this, Ft)) + n.includes(r) || (Rt(i.effect), d(this, Ft).delete(r)); + }); + this.anchor = e, O(this, Ar, n); + } + /** + * + * @param {any} key + * @param {null | ((target: TemplateNode) => void)} fn + */ + ensure(e, n) { + var r = ( + /** @type {Batch} */ + Y + ), i = Ya(); + if (n && !d(this, Re).has(e) && !d(this, Ft).has(e)) + if (i) { + var s = document.createDocumentFragment(), a = te(); + s.append(a), d(this, Ft).set(e, { + effect: Zt(() => n(a)), + fragment: s + }); + } else + d(this, Re).set( + e, + Zt(() => n(this.anchor)) + ); + if (d(this, le).set(r, e), i) { + for (const [o, l] of d(this, Re)) + o === e ? r.unskip_effect(l) : r.skip_effect(l); + for (const [o, l] of d(this, Ft)) + o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); + r.oncommit(d(this, Er)), r.ondiscard(d(this, ui)); + } else + Z && (this.anchor = H), d(this, Er).call(this); + } +} +le = new WeakMap(), Re = new WeakMap(), Ft = new WeakMap(), _n = new WeakMap(), Ar = new WeakMap(), Er = new WeakMap(), ui = new WeakMap(); +function xu(t) { + qt === null && Rl(), ds(() => { + const e = mi(t); + if (typeof e == "function") return ( + /** @type {() => void} */ + e + ); + }); +} +function Dr(t, e, n = !1) { + Z && pi(); + var r = new wu(t), i = n ? Xn : 0; + function s(a, o) { + if (Z) { + const f = ma(t); + var l; + if (f === is ? l = 0 : f === fi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = Qr(); + Pt(u), r.anchor = u, ze(!1), r.ensure(a, o), ze(!0); + return; + } + } + r.ensure(a, o); + } + vs(() => { + var a = !1; + e((o, l = 0) => { + a = !0, s(l, o); + }), a || s(!1, null); + }, i); +} +function Ni(t, e) { + return e; +} +function bu(t, e, n) { + for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { + let h = e[o]; + wn( + h, + () => { + if (s) { + if (s.pending.delete(h), s.done.add(h), s.pending.size === 0) { + var c = ( + /** @type {Set} */ + t.outrogroups + ); + Ki(ci(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); + } + } else + a -= 1; + }, + !1 + ); + } + if (a === 0) { + var l = r.length === 0 && n !== null; + if (l) { + var u = ( + /** @type {Element} */ + n + ), f = ( + /** @type {Element} */ + u.parentNode + ); + Ha(f), f.append(u), t.items.clear(); + } + Ki(e, !l); + } else + s = { + pending: new Set(e), + done: /* @__PURE__ */ new Set() + }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); +} +function Ki(t, e = !0) { + for (var n = 0; n < t.length; n++) + Rt(t[n], e); +} +var zs; +function Si(t, e, n, r, i, s = null) { + var a = t, o = /* @__PURE__ */ new Map(); + Z && pi(); + var l = null, u = /* @__PURE__ */ Pa(() => { + var m = n(); + return ha(m) ? m : m == null ? [] : ci(m); + }), f, h = !0; + function c() { + g.fallback = l, $u(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & Ze) === 0 ? _s(l) : (l.f ^= Ze, lr(l, null, a)) : wn(l, () => { + l = null; + })); + } + var v = vs(() => { + f = /** @type {V[]} */ + w(u); + var m = f.length; + let b = !1; + if (Z) { + var A = ma(a) === fi; + A !== (m === 0) && (a = Qr(), Pt(a), ze(!1), b = !0); + } + for (var S = /* @__PURE__ */ new Set(), T = ( + /** @type {Batch} */ + Y + ), D = Ya(), E = 0; E < m; E += 1) { + Z && H.nodeType === tr && /** @type {Comment} */ + H.data === ss && (a = /** @type {Comment} */ + H, b = !0, ze(!1)); + var j = f[E], it = r(j, E), W = h ? null : o.get(it); + W ? (W.v && Wn(W.v, j), W.i && Wn(W.i, E), D && T.unskip_effect(W.e)) : (W = Au( + o, + h ? a : zs ?? (zs = te()), + j, + it, + E, + i, + e, + n + ), h || (W.e.f |= Ze), o.set(it, W)), S.add(it); + } + if (m === 0 && s && !l && (h ? l = Zt(() => s(a)) : (l = Zt(() => s(zs ?? (zs = te()))), l.f |= Ze)), m > S.size && Cl(), Z && m > 0 && Pt(Qr()), !h) + if (D) { + for (const [nt, ut] of o) + S.has(nt) || T.skip_effect(ut.e); + T.oncommit(c), T.ondiscard(() => { + }); + } else + c(); + b && ze(!0), w(u); + }), g = { effect: v, items: o, outrogroups: null, fallback: l }; + h = !1, Z && (a = H); +} +function ar(t) { + for (; t !== null && (t.f & pe) === 0; ) + t = t.next; + return t; +} +function $u(t, e, n, r, i) { + var W; + var s = e.length, a = t.items, o = ar(t.effect.first), l, u = null, f = [], h = [], c, v, g, m; + for (m = 0; m < s; m += 1) { + if (c = e[m], v = i(c, m), g = /** @type {EachItem} */ + a.get(v).e, t.outrogroups !== null) + for (const nt of t.outrogroups) + nt.pending.delete(g), nt.done.delete(g); + if ((g.f & Ze) !== 0) + if (g.f ^= Ze, g === o) + lr(g, null, n); + else { + var b = u ? u.next : o; + g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), We(t, u, g), We(t, g, b), lr(g, b, n), u = g, f = [], h = [], o = ar(u.next); + continue; + } + if ((g.f & Lt) !== 0 && _s(g), g !== o) { + if (l !== void 0 && l.has(g)) { + if (f.length < h.length) { + var A = h[0], S; + u = A.prev; + var T = f[0], D = f[f.length - 1]; + for (S = 0; S < f.length; S += 1) + lr(f[S], A, n); + for (S = 0; S < h.length; S += 1) + l.delete(h[S]); + We(t, T.prev, D.next), We(t, u, T), We(t, D, A), o = A, u = D, m -= 1, f = [], h = []; + } else + l.delete(g), lr(g, o, n), We(t, g.prev, g.next), We(t, g, u === null ? t.effect.first : u.next), We(t, u, g), u = g; + continue; + } + for (f = [], h = []; o !== null && o !== g; ) + (l ?? (l = /* @__PURE__ */ new Set())).add(o), h.push(o), o = ar(o.next); + if (o === null) + continue; + } + (g.f & Ze) === 0 && f.push(g), u = g, o = ar(g.next); + } + if (t.outrogroups !== null) { + for (const nt of t.outrogroups) + nt.pending.size === 0 && (Ki(ci(nt.done)), (W = t.outrogroups) == null || W.delete(nt)); + t.outrogroups.size === 0 && (t.outrogroups = null); + } + if (o !== null || l !== void 0) { + var E = []; + if (l !== void 0) + for (g of l) + (g.f & Lt) === 0 && E.push(g); + for (; o !== null; ) + (o.f & Lt) === 0 && o !== t.fallback && E.push(o), o = ar(o.next); + var j = E.length; + if (j > 0) { + var it = null; + bu(t, E, it); + } + } +} +function Au(t, e, n, r, i, s, a, o) { + var l = (a & ul) !== 0 ? (a & cl) === 0 ? /* @__PURE__ */ Fa(n, !1, !1) : An(n) : null, u = (a & fl) !== 0 ? An(i) : null; + return { + v: l, + i: u, + e: Zt(() => (s(e, l ?? n, u ?? i, o), () => { + t.delete(r); + })) + }; +} +function lr(t, e, n) { + if (t.nodes) + for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & Ze) === 0 ? ( + /** @type {EffectNodes} */ + e.nodes.start + ) : n; r !== null; ) { + var a = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ ke(r) + ); + if (s.before(r), r === i) + return; + r = a; + } +} +function We(t, e, n) { + e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; +} +function uo(t, e) { + Xa(() => { + var n = t.getRootNode(), r = ( + /** @type {ShadowRoot} */ + n.host ? ( + /** @type {ShadowRoot} */ + n + ) : ( + /** @type {Document} */ + n.head ?? /** @type {Document} */ + n.ownerDocument.head + ) + ); + if (!r.querySelector("#" + e.hash)) { + const i = cs("style"); + i.id = e.hash, i.textContent = e.code, r.appendChild(i); + } + }); +} +function Hs(t, e = !1) { + var n = e ? " !important;" : ";", r = ""; + for (var i in t) { + var s = t[i]; + s != null && s !== "" && (r += " " + i + ": " + s + n); + } + return r; +} +function Eu(t, e) { + if (e) { + var n = "", r, i; + return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += Hs(r)), i && (n += Hs(i, !0)), n = n.trim(), n === "" ? null : n; + } + return String(t); +} +function ki(t, e = {}, n, r) { + for (var i in n) { + var s = n[i]; + e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); + } +} +function Ys(t, e, n, r) { + var i = t.__style; + if (Z || i !== e) { + var s = Eu(e, r); + (!Z || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; + } else r && (Array.isArray(r) ? (ki(t, n == null ? void 0 : n[0], r[0]), ki(t, n == null ? void 0 : n[1], r[1], "important")) : ki(t, n, r)); + return r; +} +function Bs(t, e) { + return t === e || (t == null ? void 0 : t[hr]) === e; +} +function Br(t = {}, e, n, r) { + return Xa(() => { + var i, s; + return ps(() => { + i = s, s = [], mi(() => { + t !== n(...s) && (e(t, ...s), i && Bs(n(...i), t) && e(null, ...i)); + }); + }), () => { + yn(() => { + s && Bs(n(...s), t) && e(null, ...s); + }); + }; + }), t; +} +let Ir = !1; +function Ru(t) { + var e = Ir; + try { + return Ir = !1, [t(), Ir]; + } finally { + Ir = e; + } +} +function ue(t, e, n, r) { + var S; + var i = (n & pl) !== 0, s = (n & vl) !== 0, a = ( + /** @type {V} */ + r + ), o = !0, l = () => (o && (o = !1, a = s ? mi( + /** @type {() => V} */ + r + ) : ( + /** @type {V} */ + r + )), a), u; + if (i) { + var f = hr in t || _a in t; + u = ((S = mn(t, e)) == null ? void 0 : S.set) ?? (f && e in t ? (T) => t[e] = T : void 0); + } + var h, c = !1; + i ? [h, c] = Ru(() => ( + /** @type {V} */ + t[e] + )) : h = /** @type {V} */ + t[e], h === void 0 && r !== void 0 && (h = l(), u && (Ol(), u(h))); + var v; + if (v = () => { + var T = ( + /** @type {V} */ + t[e] + ); + return T === void 0 ? l() : (o = !0, T); + }, (n & dl) === 0) + return v; + if (u) { + var g = t.$$legacy; + return ( + /** @type {() => V} */ + (function(T, D) { + return arguments.length > 0 ? ((!D || g || c) && u(D ? v() : T), T) : v(); + }) + ); + } + var m = !1, b = ((n & hl) !== 0 ? gi : Pa)(() => (m = !1, v())); + i && w(b); + var A = ( + /** @type {Effect} */ + X + ); + return ( + /** @type {() => V} */ + (function(T, D) { + if (arguments.length > 0) { + const E = D ? w(b) : i ? un(T) : T; + return J(b, E), m = !0, a !== void 0 && (a = E), T; + } + return tn && m || (A.f & He) !== 0 ? b.v : w(b); + }) + ); +} +function Tu(t) { + return new Cu(t); +} +var Ve, Wt; +class Cu { + /** + * @param {ComponentConstructorOptions & { + * component: any; + * }} options + */ + constructor(e) { + /** @type {any} */ + L(this, Ve); + /** @type {Record} */ + L(this, Wt); + var s; + var n = /* @__PURE__ */ new Map(), r = (a, o) => { + var l = /* @__PURE__ */ Fa(o, !1, !1); + return n.set(a, l), l; + }; + const i = new Proxy( + { ...e.props || {}, $$events: {} }, + { + get(a, o) { + return w(n.get(o) ?? r(o, Reflect.get(a, o))); + }, + has(a, o) { + return o === _a ? !0 : (w(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + }, + set(a, o, l) { + return J(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + } + } + ); + O(this, Wt, (e.hydrate ? mu : oo)(e.component, { + target: e.target, + anchor: e.anchor, + props: i, + context: e.context, + intro: e.intro ?? !1, + recover: e.recover + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && jt(), O(this, Ve, i.$$events); + for (const a of Object.keys(d(this, Wt))) + a === "$set" || a === "$destroy" || a === "$on" || Jr(this, a, { + get() { + return d(this, Wt)[a]; + }, + /** @param {any} value */ + set(o) { + d(this, Wt)[a] = o; + }, + enumerable: !0 + }); + d(this, Wt).$set = /** @param {Record} next */ + (a) => { + Object.assign(i, a); + }, d(this, Wt).$destroy = () => { + yu(d(this, Wt)); + }; + } + /** @param {Record} props */ + $set(e) { + d(this, Wt).$set(e); + } + /** + * @param {string} event + * @param {(...args: any[]) => any} callback + * @returns {any} + */ + $on(e, n) { + d(this, Ve)[e] = d(this, Ve)[e] || []; + const r = (...i) => n.call(this, ...i); + return d(this, Ve)[e].push(r), () => { + d(this, Ve)[e] = d(this, Ve)[e].filter( + /** @param {any} fn */ + (i) => i !== r + ); + }; + } + $destroy() { + d(this, Wt).$destroy(); + } +} +Ve = new WeakMap(), Wt = new WeakMap(); +let fo; +typeof HTMLElement == "function" && (fo = class extends HTMLElement { + /** + * @param {*} $$componentCtor + * @param {*} $$slots + * @param {ShadowRootInit | undefined} shadow_root_init + */ + constructor(e, n, r) { + super(); + /** The Svelte component constructor */ + ot(this, "$$ctor"); + /** Slots */ + ot(this, "$$s"); + /** @type {any} The Svelte component instance */ + ot(this, "$$c"); + /** Whether or not the custom element is connected */ + ot(this, "$$cn", !1); + /** @type {Record} Component props data */ + ot(this, "$$d", {}); + /** `true` if currently in the process of reflecting component props back to attributes */ + ot(this, "$$r", !1); + /** @type {Record} Props definition (name, reflected, type etc) */ + ot(this, "$$p_d", {}); + /** @type {Record} Event listeners */ + ot(this, "$$l", {}); + /** @type {Map} Event listener unsubscribe functions */ + ot(this, "$$l_u", /* @__PURE__ */ new Map()); + /** @type {any} The managed render effect for reflecting attributes */ + ot(this, "$$me"); + /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ + ot(this, "$$shadowRoot", null); + this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); + } + /** + * @param {string} type + * @param {EventListenerOrEventListenerObject} listener + * @param {boolean | AddEventListenerOptions} [options] + */ + addEventListener(e, n, r) { + if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) { + const i = this.$$c.$on(e, n); + this.$$l_u.set(n, i); + } + super.addEventListener(e, n, r); + } + /** + * @param {string} type + * @param {EventListenerOrEventListenerObject} listener + * @param {boolean | AddEventListenerOptions} [options] + */ + removeEventListener(e, n, r) { + if (super.removeEventListener(e, n, r), this.$$c) { + const i = this.$$l_u.get(n); + i && (i(), this.$$l_u.delete(n)); + } + } + async connectedCallback() { + if (this.$$cn = !0, !this.$$c) { + let n = function(s) { + return (a) => { + const o = cs("slot"); + s !== "default" && (o.name = s), be(a, o); + }; + }; + var e = n; + if (await Promise.resolve(), !this.$$cn || this.$$c) + return; + const r = {}, i = Nu(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] = Ur(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 = Tu({ + component: this.$$ctor, + target: this.$$shadowRoot || this, + props: { + ...this.$$d, + $$slots: r, + $$host: this + } + }), this.$$me = su(() => { + ps(() => { + var s; + this.$$r = !0; + for (const a of Zr(this.$$c)) { + if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; + this.$$d[a] = this.$$c[a]; + const o = Ur( + a, + this.$$d[a], + this.$$p_d, + "toAttribute" + ); + o == null ? this.removeAttribute(this.$$p_d[a].attribute || a) : this.setAttribute(this.$$p_d[a].attribute || a, o); + } + this.$$r = !1; + }); + }); + for (const s in this.$$l) + for (const a of this.$$l[s]) { + const o = this.$$c.$on(s, a); + this.$$l_u.set(a, o); + } + this.$$l = {}; + } + } + // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte + // and setting attributes through setAttribute etc, this is helpful + /** + * @param {string} attr + * @param {string} _oldValue + * @param {string} newValue + */ + attributeChangedCallback(e, n, r) { + var i; + this.$$r || (e = this.$$g_p(e), this.$$d[e] = Ur(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + } + disconnectedCallback() { + this.$$cn = !1, Promise.resolve().then(() => { + !this.$$cn && this.$$c && (this.$$c.$destroy(), this.$$me(), this.$$c = void 0); + }); + } + /** + * @param {string} attribute_name + */ + $$g_p(e) { + return Zr(this.$$p_d).find( + (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e + ) || e; + } +}); +function Ur(t, e, n, r) { + var s; + const i = (s = n[t]) == null ? void 0 : s.type; + if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) + return e; + if (r === "toAttribute") + switch (i) { + case "Object": + case "Array": + return e == null ? null : JSON.stringify(e); + case "Boolean": + return e ? "" : null; + case "Number": + return e ?? null; + default: + return e; + } + else + switch (i) { + case "Object": + case "Array": + return e && JSON.parse(e); + case "Boolean": + return e; + // conversion already handled above + case "Number": + return e != null ? +e : e; + default: + return e; + } +} +function Nu(t) { + const e = {}; + return t.childNodes.forEach((n) => { + e[ + /** @type {Element} node */ + n.slot || "default" + ] = !0; + }), e; +} +function co(t, e, n, r, i, s) { + let a = class extends fo { + constructor() { + super(t, n, i), this.$$p_d = e; + } + static get observedAttributes() { + return Zr(e).map( + (o) => (e[o].attribute || o).toLowerCase() + ); + } + }; + return Zr(e).forEach((o) => { + Jr(a.prototype, o, { + get() { + return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; + }, + set(l) { + var h; + l = Ur(o, l, e), this.$$d[o] = l; + var u = this.$$c; + if (u) { + var f = (h = mn(u, o)) == null ? void 0 : h.get; + f ? u[o] = l : u.$set({ [o]: l }); + } + } + }); + }), r.forEach((o) => { + Jr(a.prototype, o, { + get() { + var l; + return (l = this.$$c) == null ? void 0 : l[o]; + } + }); + }), t.element = /** @type {any} */ + a, a; +} +var Su = { value: () => { +} }; +function ho() { + for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { + if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); + n[r] = []; + } + return new Xr(n); +} +function Xr(t) { + this._ = t; +} +function ku(t, e) { + return t.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 && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n); + return { type: n, name: r }; + }); +} +Xr.prototype = ho.prototype = { + constructor: Xr, + on: function(t, e) { + var n = this._, r = ku(t + "", n), i, s = -1, a = r.length; + if (arguments.length < 2) { + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Mu(n[i], t.name))) return i; + return; + } + if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); + for (; ++s < a; ) + if (i = (t = r[s]).type) n[i] = Us(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = Us(n[i], t.name, null); + return this; + }, + copy: function() { + var t = {}, e = this._; + for (var n in e) t[n] = e[n].slice(); + return new Xr(t); + }, + call: function(t, e) { + if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; + if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); + for (s = this._[t], r = 0, i = s.length; r < i; ++r) s[r].value.apply(e, n); + }, + apply: function(t, e, n) { + if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); + for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); + } +}; +function Mu(t, e) { + for (var n = 0, r = t.length, i; n < r; ++n) + if ((i = t[n]).name === e) + return i.value; +} +function Us(t, e, n) { + for (var r = 0, i = t.length; r < i; ++r) + if (t[r].name === e) { + t[r] = Su, t = t.slice(0, r).concat(t.slice(r + 1)); + break; + } + return n != null && t.push({ name: e, value: n }), t; +} +var Wi = "http://www.w3.org/1999/xhtml"; +const Xs = { + svg: "http://www.w3.org/2000/svg", + xhtml: Wi, + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" +}; +function yi(t) { + var e = t += "", n = e.indexOf(":"); + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Xs.hasOwnProperty(e) ? { space: Xs[e], local: t } : t; +} +function Pu(t) { + return function() { + var e = this.ownerDocument, n = this.namespaceURI; + return n === Wi && e.documentElement.namespaceURI === Wi ? e.createElement(t) : e.createElementNS(n, t); + }; +} +function Ou(t) { + return function() { + return this.ownerDocument.createElementNS(t.space, t.local); + }; +} +function po(t) { + var e = yi(t); + return (e.local ? Ou : Pu)(e); +} +function Du() { +} +function ms(t) { + return t == null ? Du : function() { + return this.querySelector(t); + }; +} +function Iu(t) { + typeof t != "function" && (t = ms(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) + (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); + return new Vt(r, this._parents); +} +function Fu(t) { + return t == null ? [] : Array.isArray(t) ? t : Array.from(t); +} +function Lu() { + return []; +} +function vo(t) { + return t == null ? Lu : function() { + return this.querySelectorAll(t); + }; +} +function qu(t) { + return function() { + return Fu(t.apply(this, arguments)); + }; +} +function Vu(t) { + typeof t == "function" ? t = qu(t) : t = vo(t); + for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) + for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) + (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); + return new Vt(r, i); +} +function go(t) { + return function() { + return this.matches(t); + }; +} +function _o(t) { + return function(e) { + return e.matches(t); + }; +} +var zu = Array.prototype.find; +function Hu(t) { + return function() { + return zu.call(this.children, t); + }; +} +function Yu() { + return this.firstElementChild; +} +function Bu(t) { + return this.select(t == null ? Yu : Hu(typeof t == "function" ? t : _o(t))); +} +var Uu = Array.prototype.filter; +function Xu() { + return Array.from(this.children); +} +function Gu(t) { + return function() { + return Uu.call(this.children, t); + }; +} +function Ku(t) { + return this.selectAll(t == null ? Xu : Gu(typeof t == "function" ? t : _o(t))); +} +function Wu(t) { + typeof t != "function" && (t = go(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); + return new Vt(r, this._parents); +} +function mo(t) { + return new Array(t.length); +} +function ju() { + return new Vt(this._enter || this._groups.map(mo), this._parents); +} +function ti(t, e) { + this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; +} +ti.prototype = { + constructor: ti, + appendChild: function(t) { + return this._parent.insertBefore(t, this._next); + }, + insertBefore: function(t, e) { + return this._parent.insertBefore(t, e); + }, + querySelector: function(t) { + return this._parent.querySelector(t); + }, + querySelectorAll: function(t) { + return this._parent.querySelectorAll(t); + } +}; +function Zu(t) { + return function() { + return t; + }; +} +function Ju(t, e, n, r, i, s) { + for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new ti(t, s[a]); + for (; a < l; ++a) + (o = e[a]) && (i[a] = o); +} +function Qu(t, e, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = e.length, h = s.length, c = new Array(f), v; + for (o = 0; o < f; ++o) + (l = e[o]) && (c[o] = v = a.call(l, l.__data__, o, e) + "", u.has(v) ? i[o] = l : u.set(v, l)); + for (o = 0; o < h; ++o) + v = a.call(t, s[o], o, s) + "", (l = u.get(v)) ? (r[o] = l, l.__data__ = s[o], u.delete(v)) : n[o] = new ti(t, s[o]); + for (o = 0; o < f; ++o) + (l = e[o]) && u.get(c[o]) === l && (i[o] = l); +} +function tf(t) { + return t.__data__; +} +function ef(t, e) { + if (!arguments.length) return Array.from(this, tf); + var n = e ? Qu : Ju, r = this._parents, i = this._groups; + typeof t != "function" && (t = Zu(t)); + 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], h = i[u], c = h.length, v = nf(t.call(f, f && f.__data__, u, r)), g = v.length, m = o[u] = new Array(g), b = a[u] = new Array(g), A = l[u] = new Array(c); + n(f, h, m, b, A, v, e); + for (var S = 0, T = 0, D, E; S < g; ++S) + if (D = m[S]) { + for (S >= T && (T = S + 1); !(E = b[T]) && ++T < g; ) ; + D._next = E || null; + } + } + return a = new Vt(a, r), a._enter = o, a._exit = l, a; +} +function nf(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); +} +function rf() { + return new Vt(this._exit || this._groups.map(mo), this._parents); +} +function sf(t, e, n) { + var r = this.enter(), i = this, s = this.exit(); + return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; +} +function af(t) { + for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._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], h = u.length, c = o[l] = new Array(h), v, g = 0; g < h; ++g) + (v = u[g] || f[g]) && (c[g] = v); + for (; l < i; ++l) + o[l] = n[l]; + return new Vt(o, this._parents); +} +function of() { + for (var t = this._groups, e = -1, n = t.length; ++e < n; ) + for (var r = t[e], 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 lf(t) { + t || (t = uf); + function e(h, c) { + return h && c ? t(h.__data__, c.__data__) : !h - !c; + } + 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(e); + } + return new Vt(i, this._parents).order(); +} +function uf(t, e) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; +} +function ff() { + var t = arguments[0]; + return arguments[0] = this, t.apply(null, arguments), this; +} +function cf() { + return Array.from(this); +} +function hf() { + for (var t = this._groups, e = 0, n = t.length; e < n; ++e) + for (var r = t[e], i = 0, s = r.length; i < s; ++i) { + var a = r[i]; + if (a) return a; + } + return null; +} +function df() { + let t = 0; + for (const e of this) ++t; + return t; +} +function pf() { + return !this.node(); +} +function vf(t) { + for (var e = this._groups, n = 0, r = e.length; n < r; ++n) + for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) + (o = i[s]) && t.call(o, o.__data__, s, i); + return this; +} +function gf(t) { + return function() { + this.removeAttribute(t); + }; +} +function _f(t) { + return function() { + this.removeAttributeNS(t.space, t.local); + }; +} +function mf(t, e) { + return function() { + this.setAttribute(t, e); + }; +} +function yf(t, e) { + return function() { + this.setAttributeNS(t.space, t.local, e); + }; +} +function wf(t, e) { + return function() { + var n = e.apply(this, arguments); + n == null ? this.removeAttribute(t) : this.setAttribute(t, n); + }; +} +function xf(t, e) { + return function() { + var n = e.apply(this, arguments); + n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); + }; +} +function bf(t, e) { + var n = yi(t); + if (arguments.length < 2) { + var r = this.node(); + return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); + } + return this.each((e == null ? n.local ? _f : gf : typeof e == "function" ? n.local ? xf : wf : n.local ? yf : mf)(n, e)); +} +function yo(t) { + return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; +} +function $f(t) { + return function() { + this.style.removeProperty(t); + }; +} +function Af(t, e, n) { + return function() { + this.style.setProperty(t, e, n); + }; +} +function Ef(t, e, n) { + return function() { + var r = e.apply(this, arguments); + r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); + }; +} +function Rf(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? $f : typeof e == "function" ? Ef : Af)(t, e, n ?? "")) : Zn(this.node(), t); +} +function Zn(t, e) { + return t.style.getPropertyValue(e) || yo(t).getComputedStyle(t, null).getPropertyValue(e); +} +function Tf(t) { + return function() { + delete this[t]; + }; +} +function Cf(t, e) { + return function() { + this[t] = e; + }; +} +function Nf(t, e) { + return function() { + var n = e.apply(this, arguments); + n == null ? delete this[t] : this[t] = n; + }; +} +function Sf(t, e) { + return arguments.length > 1 ? this.each((e == null ? Tf : typeof e == "function" ? Nf : Cf)(t, e)) : this.node()[t]; +} +function wo(t) { + return t.trim().split(/^|\s+/); +} +function ys(t) { + return t.classList || new xo(t); +} +function xo(t) { + this._node = t, this._names = wo(t.getAttribute("class") || ""); +} +xo.prototype = { + add: function(t) { + var e = this._names.indexOf(t); + e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); + }, + remove: function(t) { + var e = this._names.indexOf(t); + e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" "))); + }, + contains: function(t) { + return this._names.indexOf(t) >= 0; + } +}; +function bo(t, e) { + for (var n = ys(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +} +function $o(t, e) { + for (var n = ys(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +} +function kf(t) { + return function() { + bo(this, t); + }; +} +function Mf(t) { + return function() { + $o(this, t); + }; +} +function Pf(t, e) { + return function() { + (e.apply(this, arguments) ? bo : $o)(this, t); + }; +} +function Of(t, e) { + var n = wo(t + ""); + if (arguments.length < 2) { + for (var r = ys(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + return !0; + } + return this.each((typeof e == "function" ? Pf : e ? kf : Mf)(n, e)); +} +function Df() { + this.textContent = ""; +} +function If(t) { + return function() { + this.textContent = t; + }; +} +function Ff(t) { + return function() { + var e = t.apply(this, arguments); + this.textContent = e ?? ""; + }; +} +function Lf(t) { + return arguments.length ? this.each(t == null ? Df : (typeof t == "function" ? Ff : If)(t)) : this.node().textContent; +} +function qf() { + this.innerHTML = ""; +} +function Vf(t) { + return function() { + this.innerHTML = t; + }; +} +function zf(t) { + return function() { + var e = t.apply(this, arguments); + this.innerHTML = e ?? ""; + }; +} +function Hf(t) { + return arguments.length ? this.each(t == null ? qf : (typeof t == "function" ? zf : Vf)(t)) : this.node().innerHTML; +} +function Yf() { + this.nextSibling && this.parentNode.appendChild(this); +} +function Bf() { + return this.each(Yf); +} +function Uf() { + this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); +} +function Xf() { + return this.each(Uf); +} +function Gf(t) { + var e = typeof t == "function" ? t : po(t); + return this.select(function() { + return this.appendChild(e.apply(this, arguments)); + }); +} +function Kf() { + return null; +} +function Wf(t, e) { + var n = typeof t == "function" ? t : po(t), r = e == null ? Kf : typeof e == "function" ? e : ms(e); + return this.select(function() { + return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); + }); +} +function jf() { + var t = this.parentNode; + t && t.removeChild(this); +} +function Zf() { + return this.each(jf); +} +function Jf() { + var t = this.cloneNode(!1), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; +} +function Qf() { + var t = this.cloneNode(!0), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; +} +function tc(t) { + return this.select(t ? Qf : Jf); +} +function ec(t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; +} +function nc(t) { + return function(e) { + t.call(this, e, this.__data__); + }; +} +function rc(t) { + return t.trim().split(/^|\s+/).map(function(e) { + var n = "", r = e.indexOf("."); + return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n }; + }); +} +function ic(t) { + return function() { + var e = this.__on; + if (e) { + for (var n = 0, r = -1, i = e.length, s; n < i; ++n) + s = e[n], (!t.type || s.type === t.type) && s.name === t.name ? this.removeEventListener(s.type, s.listener, s.options) : e[++r] = s; + ++r ? e.length = r : delete this.__on; + } + }; +} +function sc(t, e, n) { + return function() { + var r = this.__on, i, s = nc(e); + if (r) { + for (var a = 0, o = r.length; a < o; ++a) + if ((i = r[a]).type === t.type && i.name === t.name) { + this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = e; + return; + } + } + this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; + }; +} +function ac(t, e, n) { + var r = rc(t + ""), i, s = r.length, a; + if (arguments.length < 2) { + var o = this.node().__on; + if (o) { + for (var l = 0, u = o.length, f; l < u; ++l) + for (i = 0, f = o[l]; i < s; ++i) + if ((a = r[i]).type === f.type && a.name === f.name) + return f.value; + } + return; + } + for (o = e ? sc : ic, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + return this; +} +function Ao(t, e, n) { + var r = yo(t), i = r.CustomEvent; + typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); +} +function oc(t, e) { + return function() { + return Ao(this, t, e); + }; +} +function lc(t, e) { + return function() { + return Ao(this, t, e.apply(this, arguments)); + }; +} +function uc(t, e) { + return this.each((typeof e == "function" ? lc : oc)(t, e)); +} +function* fc() { + for (var t = this._groups, e = 0, n = t.length; e < n; ++e) + for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) + (a = r[i]) && (yield a); +} +var Eo = [null]; +function Vt(t, e) { + this._groups = t, this._parents = e; +} +function nr() { + return new Vt([[document.documentElement]], Eo); +} +function cc() { + return this; +} +Vt.prototype = nr.prototype = { + constructor: Vt, + select: Iu, + selectAll: Vu, + selectChild: Bu, + selectChildren: Ku, + filter: Wu, + data: ef, + enter: ju, + exit: rf, + join: sf, + merge: af, + selection: cc, + order: of, + sort: lf, + call: ff, + nodes: cf, + node: hf, + size: df, + empty: pf, + each: vf, + attr: bf, + style: Rf, + property: Sf, + classed: Of, + text: Lf, + html: Hf, + raise: Bf, + lower: Xf, + append: Gf, + insert: Wf, + remove: Zf, + clone: tc, + datum: ec, + on: ac, + dispatch: uc, + [Symbol.iterator]: fc +}; +function gt(t) { + return typeof t == "string" ? new Vt([[document.querySelector(t)]], [document.documentElement]) : new Vt([[t]], Eo); +} +function ws(t, e, n) { + t.prototype = e.prototype = n, n.constructor = t; +} +function Ro(t, e) { + var n = Object.create(t.prototype); + for (var r in e) n[r] = e[r]; + return n; +} +function Cr() { +} +var _r = 0.7, ei = 1 / _r, In = "\\s*([+-]?\\d+)\\s*", mr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Ce = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", hc = /^#([0-9a-f]{3,8})$/, dc = new RegExp(`^rgb\\(${In},${In},${In}\\)$`), pc = new RegExp(`^rgb\\(${Ce},${Ce},${Ce}\\)$`), vc = new RegExp(`^rgba\\(${In},${In},${In},${mr}\\)$`), gc = new RegExp(`^rgba\\(${Ce},${Ce},${Ce},${mr}\\)$`), _c = new RegExp(`^hsl\\(${mr},${Ce},${Ce}\\)$`), mc = new RegExp(`^hsla\\(${mr},${Ce},${Ce},${mr}\\)$`), Gs = { + aliceblue: 15792383, + antiquewhite: 16444375, + aqua: 65535, + aquamarine: 8388564, + azure: 15794175, + beige: 16119260, + bisque: 16770244, + black: 0, + blanchedalmond: 16772045, + blue: 255, + blueviolet: 9055202, + brown: 10824234, + burlywood: 14596231, + cadetblue: 6266528, + chartreuse: 8388352, + chocolate: 13789470, + coral: 16744272, + cornflowerblue: 6591981, + cornsilk: 16775388, + crimson: 14423100, + cyan: 65535, + darkblue: 139, + darkcyan: 35723, + darkgoldenrod: 12092939, + darkgray: 11119017, + darkgreen: 25600, + darkgrey: 11119017, + darkkhaki: 12433259, + darkmagenta: 9109643, + darkolivegreen: 5597999, + darkorange: 16747520, + darkorchid: 10040012, + darkred: 9109504, + darksalmon: 15308410, + darkseagreen: 9419919, + darkslateblue: 4734347, + darkslategray: 3100495, + darkslategrey: 3100495, + darkturquoise: 52945, + darkviolet: 9699539, + deeppink: 16716947, + deepskyblue: 49151, + dimgray: 6908265, + dimgrey: 6908265, + dodgerblue: 2003199, + firebrick: 11674146, + floralwhite: 16775920, + forestgreen: 2263842, + fuchsia: 16711935, + gainsboro: 14474460, + ghostwhite: 16316671, + gold: 16766720, + goldenrod: 14329120, + gray: 8421504, + green: 32768, + greenyellow: 11403055, + grey: 8421504, + honeydew: 15794160, + hotpink: 16738740, + indianred: 13458524, + indigo: 4915330, + ivory: 16777200, + khaki: 15787660, + lavender: 15132410, + lavenderblush: 16773365, + lawngreen: 8190976, + lemonchiffon: 16775885, + lightblue: 11393254, + lightcoral: 15761536, + lightcyan: 14745599, + lightgoldenrodyellow: 16448210, + lightgray: 13882323, + lightgreen: 9498256, + lightgrey: 13882323, + lightpink: 16758465, + lightsalmon: 16752762, + lightseagreen: 2142890, + lightskyblue: 8900346, + lightslategray: 7833753, + lightslategrey: 7833753, + lightsteelblue: 11584734, + lightyellow: 16777184, + lime: 65280, + limegreen: 3329330, + linen: 16445670, + magenta: 16711935, + maroon: 8388608, + mediumaquamarine: 6737322, + mediumblue: 205, + mediumorchid: 12211667, + mediumpurple: 9662683, + mediumseagreen: 3978097, + mediumslateblue: 8087790, + mediumspringgreen: 64154, + mediumturquoise: 4772300, + mediumvioletred: 13047173, + midnightblue: 1644912, + mintcream: 16121850, + mistyrose: 16770273, + moccasin: 16770229, + navajowhite: 16768685, + navy: 128, + oldlace: 16643558, + olive: 8421376, + olivedrab: 7048739, + orange: 16753920, + orangered: 16729344, + orchid: 14315734, + palegoldenrod: 15657130, + palegreen: 10025880, + paleturquoise: 11529966, + palevioletred: 14381203, + papayawhip: 16773077, + peachpuff: 16767673, + peru: 13468991, + pink: 16761035, + plum: 14524637, + powderblue: 11591910, + purple: 8388736, + rebeccapurple: 6697881, + red: 16711680, + rosybrown: 12357519, + royalblue: 4286945, + saddlebrown: 9127187, + salmon: 16416882, + sandybrown: 16032864, + seagreen: 3050327, + seashell: 16774638, + sienna: 10506797, + silver: 12632256, + skyblue: 8900331, + slateblue: 6970061, + slategray: 7372944, + slategrey: 7372944, + snow: 16775930, + springgreen: 65407, + steelblue: 4620980, + tan: 13808780, + teal: 32896, + thistle: 14204888, + tomato: 16737095, + turquoise: 4251856, + violet: 15631086, + wheat: 16113331, + white: 16777215, + whitesmoke: 16119285, + yellow: 16776960, + yellowgreen: 10145074 +}; +ws(Cr, Tn, { + copy(t) { + return Object.assign(new this.constructor(), this, t); + }, + displayable() { + return this.rgb().displayable(); + }, + hex: Ks, + // Deprecated! Use color.formatHex. + formatHex: Ks, + formatHex8: yc, + formatHsl: wc, + formatRgb: Ws, + toString: Ws +}); +function Ks() { + return this.rgb().formatHex(); +} +function yc() { + return this.rgb().formatHex8(); +} +function wc() { + return To(this).formatHsl(); +} +function Ws() { + return this.rgb().formatRgb(); +} +function Tn(t) { + var e, n; + return t = (t + "").trim().toLowerCase(), (e = hc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? js(e) : n === 3 ? new Mt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Fr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Fr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = dc.exec(t)) ? new Mt(e[1], e[2], e[3], 1) : (e = pc.exec(t)) ? new Mt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = vc.exec(t)) ? Fr(e[1], e[2], e[3], e[4]) : (e = gc.exec(t)) ? Fr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = _c.exec(t)) ? Qs(e[1], e[2] / 100, e[3] / 100, 1) : (e = mc.exec(t)) ? Qs(e[1], e[2] / 100, e[3] / 100, e[4]) : Gs.hasOwnProperty(t) ? js(Gs[t]) : t === "transparent" ? new Mt(NaN, NaN, NaN, 0) : null; +} +function js(t) { + return new Mt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +} +function Fr(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new Mt(t, e, n, r); +} +function xc(t) { + return t instanceof Cr || (t = Tn(t)), t ? (t = t.rgb(), new Mt(t.r, t.g, t.b, t.opacity)) : new Mt(); +} +function ji(t, e, n, r) { + return arguments.length === 1 ? xc(t) : new Mt(t, e, n, r ?? 1); +} +function Mt(t, e, n, r) { + this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; +} +ws(Mt, ji, Ro(Cr, { + brighter(t) { + return t = t == null ? ei : Math.pow(ei, t), new Mt(this.r * t, this.g * t, this.b * t, this.opacity); + }, + darker(t) { + return t = t == null ? _r : Math.pow(_r, t), new Mt(this.r * t, this.g * t, this.b * t, this.opacity); + }, + rgb() { + return this; + }, + clamp() { + return new Mt(bn(this.r), bn(this.g), bn(this.b), ni(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: Zs, + // Deprecated! Use color.formatHex. + formatHex: Zs, + formatHex8: bc, + formatRgb: Js, + toString: Js +})); +function Zs() { + return `#${cn(this.r)}${cn(this.g)}${cn(this.b)}`; +} +function bc() { + return `#${cn(this.r)}${cn(this.g)}${cn(this.b)}${cn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +} +function Js() { + const t = ni(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${bn(this.r)}, ${bn(this.g)}, ${bn(this.b)}${t === 1 ? ")" : `, ${t})`}`; +} +function ni(t) { + return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); +} +function bn(t) { + return Math.max(0, Math.min(255, Math.round(t) || 0)); +} +function cn(t) { + return t = bn(t), (t < 16 ? "0" : "") + t.toString(16); +} +function Qs(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new fe(t, e, n, r); +} +function To(t) { + if (t instanceof fe) return new fe(t.h, t.s, t.l, t.opacity); + if (t instanceof Cr || (t = Tn(t)), !t) return new fe(); + if (t instanceof fe) return t; + t = t.rgb(); + var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; + return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new fe(a, o, l, t.opacity); +} +function $c(t, e, n, r) { + return arguments.length === 1 ? To(t) : new fe(t, e, n, r ?? 1); +} +function fe(t, e, n, r) { + this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; +} +ws(fe, $c, Ro(Cr, { + brighter(t) { + return t = t == null ? ei : Math.pow(ei, t), new fe(this.h, this.s, this.l * t, this.opacity); + }, + darker(t) { + return t = t == null ? _r : Math.pow(_r, t), new fe(this.h, this.s, this.l * t, this.opacity); + }, + rgb() { + var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; + return new Mt( + Mi(t >= 240 ? t - 240 : t + 120, i, r), + Mi(t, i, r), + Mi(t < 120 ? t + 240 : t - 120, i, r), + this.opacity + ); + }, + clamp() { + return new fe(ta(this.h), Lr(this.s), Lr(this.l), ni(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 t = ni(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${ta(this.h)}, ${Lr(this.s) * 100}%, ${Lr(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + } +})); +function ta(t) { + return t = (t || 0) % 360, t < 0 ? t + 360 : t; +} +function Lr(t) { + return Math.max(0, Math.min(1, t || 0)); +} +function Mi(t, e, n) { + return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; +} +const xs = (t) => () => t; +function Ac(t, e) { + return function(n) { + return t + n * e; + }; +} +function Ec(t, e, n) { + return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) { + return Math.pow(t + r * e, n); + }; +} +function Rc(t) { + return (t = +t) == 1 ? Co : function(e, n) { + return n - e ? Ec(e, n, t) : xs(isNaN(e) ? n : e); + }; +} +function Co(t, e) { + var n = e - t; + return n ? Ac(t, n) : xs(isNaN(t) ? e : t); +} +const ri = (function t(e) { + var n = Rc(e); + function r(i, s) { + var a = n((i = ji(i)).r, (s = ji(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Co(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 = t, r; +})(1); +function Tc(t, e) { + e || (e = []); + var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; + return function(s) { + for (i = 0; i < n; ++i) r[i] = t[i] * (1 - s) + e[i] * s; + return r; + }; +} +function Cc(t) { + return ArrayBuffer.isView(t) && !(t instanceof DataView); +} +function Nc(t, e) { + var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; + for (a = 0; a < r; ++a) i[a] = On(t[a], e[a]); + for (; a < n; ++a) s[a] = e[a]; + return function(o) { + for (a = 0; a < r; ++a) s[a] = i[a](o); + return s; + }; +} +function Sc(t, e) { + var n = /* @__PURE__ */ new Date(); + return t = +t, e = +e, function(r) { + return n.setTime(t * (1 - r) + e * r), n; + }; +} +function Te(t, e) { + return t = +t, e = +e, function(n) { + return t * (1 - n) + e * n; + }; +} +function kc(t, e) { + var n = {}, r = {}, i; + (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); + for (i in e) + i in t ? n[i] = On(t[i], e[i]) : r[i] = e[i]; + return function(s) { + for (i in n) r[i] = n[i](s); + return r; + }; +} +var Zi = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Pi = new RegExp(Zi.source, "g"); +function Mc(t) { + return function() { + return t; + }; +} +function Pc(t) { + return function(e) { + return t(e) + ""; + }; +} +function No(t, e) { + var n = Zi.lastIndex = Pi.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (t = t + "", e = e + ""; (r = Zi.exec(t)) && (i = Pi.exec(e)); ) + (s = i.index) > n && (s = e.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: Te(r, i) })), n = Pi.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Pc(l[0].x) : Mc(e) : (e = l.length, function(u) { + for (var f = 0, h; f < e; ++f) o[(h = l[f]).i] = h.x(u); + return o.join(""); + }); +} +function On(t, e) { + var n = typeof e, r; + return e == null || n === "boolean" ? xs(e) : (n === "number" ? Te : n === "string" ? (r = Tn(e)) ? (e = r, ri) : No : e instanceof Tn ? ri : e instanceof Date ? Sc : Cc(e) ? Tc : Array.isArray(e) ? Nc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? kc : Te)(t, e); +} +var ea = 180 / Math.PI, Ji = { + translateX: 0, + translateY: 0, + rotate: 0, + skewX: 0, + scaleX: 1, + scaleY: 1 +}; +function So(t, e, n, r, i, s) { + var a, o, l; + return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { + translateX: i, + translateY: s, + rotate: Math.atan2(e, t) * ea, + skewX: Math.atan(l) * ea, + scaleX: a, + scaleY: o + }; +} +var qr; +function Oc(t) { + const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); + return e.isIdentity ? Ji : So(e.a, e.b, e.c, e.d, e.e, e.f); +} +function Dc(t) { + return t == null || (qr || (qr = document.createElementNS("http://www.w3.org/2000/svg", "g")), qr.setAttribute("transform", t), !(t = qr.transform.baseVal.consolidate())) ? Ji : (t = t.matrix, So(t.a, t.b, t.c, t.d, t.e, t.f)); +} +function ko(t, e, n, r) { + function i(u) { + return u.length ? u.pop() + " " : ""; + } + function s(u, f, h, c, v, g) { + if (u !== h || f !== c) { + var m = v.push("translate(", null, e, null, n); + g.push({ i: m - 4, x: Te(u, h) }, { i: m - 2, x: Te(f, c) }); + } else (h || c) && v.push("translate(" + h + e + c + n); + } + function a(u, f, h, c) { + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Te(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); + } + function o(u, f, h, c) { + u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Te(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); + } + function l(u, f, h, c, v, g) { + if (u !== h || f !== c) { + var m = v.push(i(v) + "scale(", null, ",", null, ")"); + g.push({ i: m - 4, x: Te(u, h) }, { i: m - 2, x: Te(f, c) }); + } else (h !== 1 || c !== 1) && v.push(i(v) + "scale(" + h + "," + c + ")"); + } + return function(u, f) { + var h = [], c = []; + return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, h, c), a(u.rotate, f.rotate, h, c), o(u.skewX, f.skewX, h, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, h, c), u = f = null, function(v) { + for (var g = -1, m = c.length, b; ++g < m; ) h[(b = c[g]).i] = b.x(v); + return h.join(""); + }; + }; +} +var Ic = ko(Oc, "px, ", "px)", "deg)"), Fc = ko(Dc, ", ", ")", ")"), Jn = 0, ur = 0, or = 0, Mo = 1e3, ii, fr, si = 0, Cn = 0, wi = 0, yr = typeof performance == "object" && performance.now ? performance : Date, Po = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { + setTimeout(t, 17); +}; +function bs() { + return Cn || (Po(Lc), Cn = yr.now() + wi); +} +function Lc() { + Cn = 0; +} +function ai() { + this._call = this._time = this._next = null; +} +ai.prototype = Oo.prototype = { + constructor: ai, + restart: function(t, e, n) { + if (typeof t != "function") throw new TypeError("callback is not a function"); + n = (n == null ? bs() : +n) + (e == null ? 0 : +e), !this._next && fr !== this && (fr ? fr._next = this : ii = this, fr = this), this._call = t, this._time = n, Qi(); + }, + stop: function() { + this._call && (this._call = null, this._time = 1 / 0, Qi()); + } +}; +function Oo(t, e, n) { + var r = new ai(); + return r.restart(t, e, n), r; +} +function qc() { + bs(), ++Jn; + for (var t = ii, e; t; ) + (e = Cn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --Jn; +} +function na() { + Cn = (si = yr.now()) + wi, Jn = ur = 0; + try { + qc(); + } finally { + Jn = 0, zc(), Cn = 0; + } +} +function Vc() { + var t = yr.now(), e = t - si; + e > Mo && (wi -= e, si = t); +} +function zc() { + for (var t, e = ii, n, r = 1 / 0; e; ) + e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : ii = n); + fr = t, Qi(r); +} +function Qi(t) { + if (!Jn) { + ur && (ur = clearTimeout(ur)); + var e = t - Cn; + e > 24 ? (t < 1 / 0 && (ur = setTimeout(na, t - yr.now() - wi)), or && (or = clearInterval(or))) : (or || (si = yr.now(), or = setInterval(Vc, Mo)), Jn = 1, Po(na)); + } +} +function ra(t, e, n) { + var r = new ai(); + return e = e == null ? 0 : +e, r.restart((i) => { + r.stop(), t(i + e); + }, e, n), r; +} +var Hc = ho("start", "end", "cancel", "interrupt"), Yc = [], Do = 0, ia = 1, ts = 2, Gr = 3, sa = 4, es = 5, Kr = 6; +function xi(t, e, n, r, i, s) { + var a = t.__transition; + if (!a) t.__transition = {}; + else if (n in a) return; + Bc(t, n, { + name: e, + index: r, + // For context during callback. + group: i, + // For context during callback. + on: Hc, + tween: Yc, + time: s.time, + delay: s.delay, + duration: s.duration, + ease: s.ease, + timer: null, + state: Do + }); +} +function $s(t, e) { + var n = ve(t, e); + if (n.state > Do) throw new Error("too late; already scheduled"); + return n; +} +function Pe(t, e) { + var n = ve(t, e); + if (n.state > Gr) throw new Error("too late; already running"); + return n; +} +function ve(t, e) { + var n = t.__transition; + if (!n || !(n = n[e])) throw new Error("transition not found"); + return n; +} +function Bc(t, e, n) { + var r = t.__transition, i; + r[e] = n, n.timer = Oo(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); + } + function a(u) { + var f, h, c, v; + if (n.state !== ia) return l(); + for (f in r) + if (v = r[f], v.name === n.name) { + if (v.state === Gr) return ra(a); + v.state === sa ? (v.state = Kr, v.timer.stop(), v.on.call("interrupt", t, t.__data__, v.index, v.group), delete r[f]) : +f < e && (v.state = Kr, v.timer.stop(), v.on.call("cancel", t, t.__data__, v.index, v.group), delete r[f]); + } + if (ra(function() { + n.state === Gr && (n.state = sa, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = ts, n.on.call("start", t, t.__data__, n.index, n.group), n.state === ts) { + for (n.state = Gr, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) + (v = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = v); + i.length = h + 1; + } + } + function o(u) { + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = es, 1), h = -1, c = i.length; ++h < c; ) + i[h].call(t, f); + n.state === es && (n.on.call("end", t, t.__data__, n.index, n.group), l()); + } + function l() { + n.state = Kr, n.timer.stop(), delete r[e]; + for (var u in r) return; + delete t.__transition; + } +} +function Uc(t, e) { + var n = t.__transition, r, i, s = !0, a; + if (n) { + e = e == null ? null : e + ""; + for (a in n) { + if ((r = n[a]).name !== e) { + s = !1; + continue; + } + i = r.state > ts && r.state < es, r.state = Kr, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + } + s && delete t.__transition; + } +} +function Xc(t) { + return this.each(function() { + Uc(this, t); + }); +} +function Gc(t, e) { + var n, r; + return function() { + var i = Pe(this, t), s = i.tween; + if (s !== n) { + r = n = s; + for (var a = 0, o = r.length; a < o; ++a) + if (r[a].name === e) { + r = r.slice(), r.splice(a, 1); + break; + } + } + i.tween = r; + }; +} +function Kc(t, e, n) { + var r, i; + if (typeof n != "function") throw new Error(); + return function() { + var s = Pe(this, t), a = s.tween; + if (a !== r) { + i = (r = a).slice(); + for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) + if (i[l].name === e) { + i[l] = o; + break; + } + l === u && i.push(o); + } + s.tween = i; + }; +} +function Wc(t, e) { + var n = this._id; + if (t += "", arguments.length < 2) { + for (var r = ve(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + if ((a = r[i]).name === t) + return a.value; + return null; + } + return this.each((e == null ? Gc : Kc)(n, t, e)); +} +function As(t, e, n) { + var r = t._id; + return t.each(function() { + var i = Pe(this, r); + (i.value || (i.value = {}))[e] = n.apply(this, arguments); + }), function(i) { + return ve(i, r).value[e]; + }; +} +function Io(t, e) { + var n; + return (typeof e == "number" ? Te : e instanceof Tn ? ri : (n = Tn(e)) ? (e = n, ri) : No)(t, e); +} +function jc(t) { + return function() { + this.removeAttribute(t); + }; +} +function Zc(t) { + return function() { + this.removeAttributeNS(t.space, t.local); + }; +} +function Jc(t, e, n) { + var r, i = n + "", s; + return function() { + var a = this.getAttribute(t); + return a === i ? null : a === r ? s : s = e(r = a, n); + }; +} +function Qc(t, e, n) { + var r, i = n + "", s; + return function() { + var a = this.getAttributeNS(t.space, t.local); + return a === i ? null : a === r ? s : s = e(r = a, n); + }; +} +function th(t, e, n) { + var r, i, s; + return function() { + var a, o = n(this), l; + return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); + }; +} +function eh(t, e, n) { + var r, i, s; + return function() { + var a, o = n(this), l; + return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); + }; +} +function nh(t, e) { + var n = yi(t), r = n === "transform" ? Fc : Io; + return this.attrTween(t, typeof e == "function" ? (n.local ? eh : th)(n, r, As(this, "attr." + t, e)) : e == null ? (n.local ? Zc : jc)(n) : (n.local ? Qc : Jc)(n, r, e)); +} +function rh(t, e) { + return function(n) { + this.setAttribute(t, e.call(this, n)); + }; +} +function ih(t, e) { + return function(n) { + this.setAttributeNS(t.space, t.local, e.call(this, n)); + }; +} +function sh(t, e) { + var n, r; + function i() { + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && ih(t, s)), n; + } + return i._value = e, i; +} +function ah(t, e) { + var n, r; + function i() { + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && rh(t, s)), n; + } + return i._value = e, i; +} +function oh(t, e) { + var n = "attr." + t; + if (arguments.length < 2) return (n = this.tween(n)) && n._value; + if (e == null) return this.tween(n, null); + if (typeof e != "function") throw new Error(); + var r = yi(t); + return this.tween(n, (r.local ? sh : ah)(r, e)); +} +function lh(t, e) { + return function() { + $s(this, t).delay = +e.apply(this, arguments); + }; +} +function uh(t, e) { + return e = +e, function() { + $s(this, t).delay = e; + }; +} +function fh(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? lh : uh)(e, t)) : ve(this.node(), e).delay; +} +function ch(t, e) { + return function() { + Pe(this, t).duration = +e.apply(this, arguments); + }; +} +function hh(t, e) { + return e = +e, function() { + Pe(this, t).duration = e; + }; +} +function dh(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? ch : hh)(e, t)) : ve(this.node(), e).duration; +} +function ph(t, e) { + if (typeof e != "function") throw new Error(); + return function() { + Pe(this, t).ease = e; + }; +} +function vh(t) { + var e = this._id; + return arguments.length ? this.each(ph(e, t)) : ve(this.node(), e).ease; +} +function gh(t, e) { + return function() { + var n = e.apply(this, arguments); + if (typeof n != "function") throw new Error(); + Pe(this, t).ease = n; + }; +} +function _h(t) { + if (typeof t != "function") throw new Error(); + return this.each(gh(this._id, t)); +} +function mh(t) { + typeof t != "function" && (t = go(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); + return new Be(r, this._parents, this._name, this._id); +} +function yh(t) { + if (t._id !== this._id) throw new Error(); + for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) + for (var l = e[o], u = n[o], f = l.length, h = a[o] = new Array(f), c, v = 0; v < f; ++v) + (c = l[v] || u[v]) && (h[v] = c); + for (; o < r; ++o) + a[o] = e[o]; + return new Be(a, this._parents, this._name, this._id); +} +function wh(t) { + return (t + "").trim().split(/^|\s+/).every(function(e) { + var n = e.indexOf("."); + return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; + }); +} +function xh(t, e, n) { + var r, i, s = wh(e) ? $s : Pe; + return function() { + var a = s(this, t), o = a.on; + o !== r && (i = (r = o).copy()).on(e, n), a.on = i; + }; +} +function bh(t, e) { + var n = this._id; + return arguments.length < 2 ? ve(this.node(), n).on.on(t) : this.each(xh(n, t, e)); +} +function $h(t) { + return function() { + var e = this.parentNode; + for (var n in this.__transition) if (+n !== t) return; + e && e.removeChild(this); + }; +} +function Ah() { + return this.on("end.remove", $h(this._id)); +} +function Eh(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = ms(t)); + 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, h, c = 0; c < l; ++c) + (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, xi(u[c], e, n, c, u, ve(f, n))); + return new Be(s, this._parents, e, n); +} +function Rh(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = vo(t)); + for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) + for (var l = r[o], u = l.length, f, h = 0; h < u; ++h) + if (f = l[h]) { + for (var c = t.call(f, f.__data__, h, l), v, g = ve(f, n), m = 0, b = c.length; m < b; ++m) + (v = c[m]) && xi(v, e, n, m, c, g); + s.push(c), a.push(f); + } + return new Be(s, a, e, n); +} +var Th = nr.prototype.constructor; +function Ch() { + return new Th(this._groups, this._parents); +} +function Nh(t, e) { + var n, r, i; + return function() { + var s = Zn(this, t), a = (this.style.removeProperty(t), Zn(this, t)); + return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); + }; +} +function Fo(t) { + return function() { + this.style.removeProperty(t); + }; +} +function Sh(t, e, n) { + var r, i = n + "", s; + return function() { + var a = Zn(this, t); + return a === i ? null : a === r ? s : s = e(r = a, n); + }; +} +function kh(t, e, n) { + var r, i, s; + return function() { + var a = Zn(this, t), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(t), Zn(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + }; +} +function Mh(t, e) { + var n, r, i, s = "style." + e, a = "end." + s, o; + return function() { + var l = Pe(this, t), u = l.on, f = l.value[s] == null ? o || (o = Fo(e)) : void 0; + (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; + }; +} +function Ph(t, e, n) { + var r = (t += "") == "transform" ? Ic : Io; + return e == null ? this.styleTween(t, Nh(t, r)).on("end.style." + t, Fo(t)) : typeof e == "function" ? this.styleTween(t, kh(t, r, As(this, "style." + t, e))).each(Mh(this._id, t)) : this.styleTween(t, Sh(t, r, e), n).on("end.style." + t, null); +} +function Oh(t, e, n) { + return function(r) { + this.style.setProperty(t, e.call(this, r), n); + }; +} +function Dh(t, e, n) { + var r, i; + function s() { + var a = e.apply(this, arguments); + return a !== i && (r = (i = a) && Oh(t, a, n)), r; + } + return s._value = e, s; +} +function Ih(t, e, n) { + var r = "style." + (t += ""); + if (arguments.length < 2) return (r = this.tween(r)) && r._value; + if (e == null) return this.tween(r, null); + if (typeof e != "function") throw new Error(); + return this.tween(r, Dh(t, e, n ?? "")); +} +function Fh(t) { + return function() { + this.textContent = t; + }; +} +function Lh(t) { + return function() { + var e = t(this); + this.textContent = e ?? ""; + }; +} +function qh(t) { + return this.tween("text", typeof t == "function" ? Lh(As(this, "text", t)) : Fh(t == null ? "" : t + "")); +} +function Vh(t) { + return function(e) { + this.textContent = t.call(this, e); + }; +} +function zh(t) { + var e, n; + function r() { + var i = t.apply(this, arguments); + return i !== n && (e = (n = i) && Vh(i)), e; + } + return r._value = t, r; +} +function Hh(t) { + var e = "text"; + if (arguments.length < 1) return (e = this.tween(e)) && e._value; + if (t == null) return this.tween(e, null); + if (typeof t != "function") throw new Error(); + return this.tween(e, zh(t)); +} +function Yh() { + for (var t = this._name, e = this._id, n = Lo(), 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 = ve(l, e); + xi(l, t, n, u, a, { + time: f.time + f.delay + f.duration, + delay: 0, + duration: f.duration, + ease: f.ease + }); + } + return new Be(r, this._parents, t, n); +} +function Bh() { + var t, e, 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 = Pe(this, r), f = u.on; + f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; + }), i === 0 && s(); + }); +} +var Uh = 0; +function Be(t, e, n, r) { + this._groups = t, this._parents = e, this._name = n, this._id = r; +} +function Wr(t) { + return nr().transition(t); +} +function Lo() { + return ++Uh; +} +var Oe = nr.prototype; +Be.prototype = Wr.prototype = { + constructor: Be, + select: Eh, + selectAll: Rh, + selectChild: Oe.selectChild, + selectChildren: Oe.selectChildren, + filter: mh, + merge: yh, + selection: Ch, + transition: Yh, + call: Oe.call, + nodes: Oe.nodes, + node: Oe.node, + size: Oe.size, + empty: Oe.empty, + each: Oe.each, + on: bh, + attr: nh, + attrTween: oh, + style: Ph, + styleTween: Ih, + text: qh, + textTween: Hh, + remove: Ah, + tween: Wc, + delay: fh, + duration: dh, + ease: vh, + easeVarying: _h, + end: Bh, + [Symbol.iterator]: Oe[Symbol.iterator] +}; +function Xh(t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +} +var Gh = { + time: null, + // Set on use. + delay: 0, + duration: 250, + ease: Xh +}; +function Kh(t, e) { + for (var n; !(n = t.__transition) || !(n = n[e]); ) + if (!(t = t.parentNode)) + throw new Error(`transition ${e} not found`); + return n; +} +function Wh(t) { + var e, n; + t instanceof Be ? (e = t._id, t = t._name) : (e = Lo(), (n = Gh).time = bs(), t = t == null ? null : t + ""); + 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]) && xi(l, t, e, u, a, n || Kh(l, e)); + return new Be(r, this._parents, t, e); +} +nr.prototype.interrupt = Xc; +nr.prototype.transition = Wh; +const ns = Math.PI, rs = 2 * ns, an = 1e-6, jh = rs - an; +function qo(t) { + this._ += t[0]; + for (let e = 1, n = t.length; e < n; ++e) + this._ += arguments[e] + t[e]; +} +function Zh(t) { + let e = Math.floor(t); + if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); + if (e > 15) return qo; + const n = 10 ** e; + return function(r) { + this._ += r[0]; + for (let i = 1, s = r.length; i < s; ++i) + this._ += Math.round(arguments[i] * n) / n + r[i]; + }; +} +class Jh { + constructor(e) { + this._x0 = this._y0 = // start of current subpath + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? qo : Zh(e); + } + moveTo(e, n) { + this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; + } + closePath() { + this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`); + } + lineTo(e, n) { + this._append`L${this._x1 = +e},${this._y1 = +n}`; + } + quadraticCurveTo(e, n, r, i) { + this._append`Q${+e},${+n},${this._x1 = +r},${this._y1 = +i}`; + } + bezierCurveTo(e, n, r, i, s, a) { + this._append`C${+e},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; + } + arcTo(e, n, r, i, s) { + if (e = +e, 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 - e, u = i - n, f = a - e, h = o - n, c = f * f + h * h; + if (this._x1 === null) + this._append`M${this._x1 = e},${this._y1 = n}`; + else if (c > an) if (!(Math.abs(h * l - u * f) > an) || !s) + this._append`L${this._x1 = e},${this._y1 = n}`; + else { + let v = r - a, g = i - o, m = l * l + u * u, b = v * v + g * g, A = Math.sqrt(m), S = Math.sqrt(c), T = s * Math.tan((ns - Math.acos((m + c - b) / (2 * A * S))) / 2), D = T / S, E = T / A; + Math.abs(D - 1) > an && this._append`L${e + D * f},${n + D * h}`, this._append`A${s},${s},0,0,${+(h * v > f * g)},${this._x1 = e + E * l},${this._y1 = n + E * u}`; + } + } + arc(e, n, r, i, s, a) { + if (e = +e, 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 = e + o, f = n + l, h = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > an || Math.abs(this._y1 - f) > an) && this._append`L${u},${f}`, r && (c < 0 && (c = c % rs + rs), c > jh ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > an && this._append`A${r},${r},0,${+(c >= ns)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + } + rect(e, n, r, i) { + this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; + } + toString() { + return this._; + } +} +function Qh(t) { + for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); + return n; +} +const td = Qh("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Et(t) { + return function() { + return t; + }; +} +const aa = Math.abs, $t = Math.atan2, sn = Math.cos, ed = Math.max, Oi = Math.min, xe = Math.sin, Dn = Math.sqrt, Ct = 1e-12, wr = Math.PI, oi = wr / 2, jr = 2 * wr; +function nd(t) { + return t > 1 ? 0 : t < -1 ? wr : Math.acos(t); +} +function oa(t) { + return t >= 1 ? oi : t <= -1 ? -oi : Math.asin(t); +} +function rd(t) { + let e = 3; + return t.digits = function(n) { + if (!arguments.length) return e; + if (n == null) + e = null; + else { + const r = Math.floor(n); + if (!(r >= 0)) throw new RangeError(`invalid digits: ${n}`); + e = r; + } + return t; + }, () => new Jh(e); +} +function id(t) { + return t.innerRadius; +} +function sd(t) { + return t.outerRadius; +} +function ad(t) { + return t.startAngle; +} +function od(t) { + return t.endAngle; +} +function ld(t) { + return t && t.padAngle; +} +function ud(t, e, n, r, i, s, a, o) { + var l = n - t, u = r - e, f = a - i, h = o - s, c = h * l - f * u; + if (!(c * c < Ct)) + return c = (f * (e - s) - h * (t - i)) / c, [t + c * l, e + c * u]; +} +function Vr(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / Dn(o * o + l * l), f = u * l, h = -u * o, c = t + f, v = e + h, g = n + f, m = r + h, b = (c + g) / 2, A = (v + m) / 2, S = g - c, T = m - v, D = S * S + T * T, E = i - s, j = c * m - g * v, it = (T < 0 ? -1 : 1) * Dn(ed(0, E * E * D - j * j)), W = (j * T - S * it) / D, nt = (-j * S - T * it) / D, ut = (j * T + S * it) / D, ft = (-j * S + T * it) / D, G = W - b, x = nt - A, P = ut - b, zt = ft - A; + return G * G + x * x > P * P + zt * zt && (W = ut, nt = ft), { + cx: W, + cy: nt, + x01: -f, + y01: -h, + x11: W * (i / E - 1), + y11: nt * (i / E - 1) + }; +} +function De() { + var t = id, e = sd, n = Et(0), r = null, i = ad, s = od, a = ld, o = null, l = rd(u); + function u() { + var f, h, c = +t.apply(this, arguments), v = +e.apply(this, arguments), g = i.apply(this, arguments) - oi, m = s.apply(this, arguments) - oi, b = aa(m - g), A = m > g; + if (o || (o = f = l()), v < c && (h = v, v = c, c = h), !(v > Ct)) o.moveTo(0, 0); + else if (b > jr - Ct) + o.moveTo(v * sn(g), v * xe(g)), o.arc(0, 0, v, g, m, !A), c > Ct && (o.moveTo(c * sn(m), c * xe(m)), o.arc(0, 0, c, m, g, A)); + else { + var S = g, T = m, D = g, E = m, j = b, it = b, W = a.apply(this, arguments) / 2, nt = W > Ct && (r ? +r.apply(this, arguments) : Dn(c * c + v * v)), ut = Oi(aa(v - c) / 2, +n.apply(this, arguments)), ft = ut, G = ut, x, P; + if (nt > Ct) { + var zt = oa(nt / c * xe(W)), tt = oa(nt / v * xe(W)); + (j -= zt * 2) > Ct ? (zt *= A ? 1 : -1, D += zt, E -= zt) : (j = 0, D = E = (g + m) / 2), (it -= tt * 2) > Ct ? (tt *= A ? 1 : -1, S += tt, T -= tt) : (it = 0, S = T = (g + m) / 2); + } + var Ht = v * sn(S), Yt = v * xe(S), ne = c * sn(E), ge = c * xe(E); + if (ut > Ct) { + var Tt = v * sn(T), _e = v * xe(T), me = c * sn(D), Xe = c * xe(D), Ot; + if (b < wr) + if (Ot = ud(Ht, Yt, me, Xe, Tt, _e, ne, ge)) { + var nn = Ht - Ot[0], rn = Yt - Ot[1], Ge = Tt - Ot[0], Bt = _e - Ot[1], ye = 1 / xe(nd((nn * Ge + rn * Bt) / (Dn(nn * nn + rn * rn) * Dn(Ge * Ge + Bt * Bt))) / 2), Sn = Dn(Ot[0] * Ot[0] + Ot[1] * Ot[1]); + ft = Oi(ut, (c - Sn) / (ye - 1)), G = Oi(ut, (v - Sn) / (ye + 1)); + } else + ft = G = 0; + } + it > Ct ? G > Ct ? (x = Vr(me, Xe, Ht, Yt, v, G, A), P = Vr(Tt, _e, ne, ge, v, G, A), o.moveTo(x.cx + x.x01, x.cy + x.y01), G < ut ? o.arc(x.cx, x.cy, G, $t(x.y01, x.x01), $t(P.y01, P.x01), !A) : (o.arc(x.cx, x.cy, G, $t(x.y01, x.x01), $t(x.y11, x.x11), !A), o.arc(0, 0, v, $t(x.cy + x.y11, x.cx + x.x11), $t(P.cy + P.y11, P.cx + P.x11), !A), o.arc(P.cx, P.cy, G, $t(P.y11, P.x11), $t(P.y01, P.x01), !A))) : (o.moveTo(Ht, Yt), o.arc(0, 0, v, S, T, !A)) : o.moveTo(Ht, Yt), !(c > Ct) || !(j > Ct) ? o.lineTo(ne, ge) : ft > Ct ? (x = Vr(ne, ge, Tt, _e, c, -ft, A), P = Vr(Ht, Yt, me, Xe, c, -ft, A), o.lineTo(x.cx + x.x01, x.cy + x.y01), ft < ut ? o.arc(x.cx, x.cy, ft, $t(x.y01, x.x01), $t(P.y01, P.x01), !A) : (o.arc(x.cx, x.cy, ft, $t(x.y01, x.x01), $t(x.y11, x.x11), !A), o.arc(0, 0, c, $t(x.cy + x.y11, x.cx + x.x11), $t(P.cy + P.y11, P.cx + P.x11), A), o.arc(P.cx, P.cy, ft, $t(P.y11, P.x11), $t(P.y01, P.x01), !A))) : o.arc(0, 0, c, E, D, A); + } + if (o.closePath(), f) return o = null, f + "" || null; + } + return u.centroid = function() { + var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - wr / 2; + return [sn(h) * f, xe(h) * f]; + }, u.innerRadius = function(f) { + return arguments.length ? (t = typeof f == "function" ? f : Et(+f), u) : t; + }, u.outerRadius = function(f) { + return arguments.length ? (e = typeof f == "function" ? f : Et(+f), u) : e; + }, u.cornerRadius = function(f) { + return arguments.length ? (n = typeof f == "function" ? f : Et(+f), u) : n; + }, u.padRadius = function(f) { + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Et(+f), u) : r; + }, u.startAngle = function(f) { + return arguments.length ? (i = typeof f == "function" ? f : Et(+f), u) : i; + }, u.endAngle = function(f) { + return arguments.length ? (s = typeof f == "function" ? f : Et(+f), u) : s; + }, u.padAngle = function(f) { + return arguments.length ? (a = typeof f == "function" ? f : Et(+f), u) : a; + }, u.context = function(f) { + return arguments.length ? (o = f ?? null, u) : o; + }, u; +} +function fd(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); +} +function cd(t, e) { + return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; +} +function hd(t) { + return t; +} +function la() { + var t = hd, e = cd, n = null, r = Et(0), i = Et(jr), s = Et(0); + function a(o) { + var l, u = (o = fd(o)).length, f, h, c = 0, v = new Array(u), g = new Array(u), m = +r.apply(this, arguments), b = Math.min(jr, Math.max(-jr, i.apply(this, arguments) - m)), A, S = Math.min(Math.abs(b) / u, s.apply(this, arguments)), T = S * (b < 0 ? -1 : 1), D; + for (l = 0; l < u; ++l) + (D = g[v[l] = l] = +t(o[l], l, o)) > 0 && (c += D); + for (e != null ? v.sort(function(E, j) { + return e(g[E], g[j]); + }) : n != null && v.sort(function(E, j) { + return n(o[E], o[j]); + }), l = 0, h = c ? (b - u * T) / c : 0; l < u; ++l, m = A) + f = v[l], D = g[f], A = m + (D > 0 ? D * h : 0) + T, g[f] = { + data: o[f], + index: l, + value: D, + startAngle: m, + endAngle: A, + padAngle: S + }; + return g; + } + return a.value = function(o) { + return arguments.length ? (t = typeof o == "function" ? o : Et(+o), a) : t; + }, a.sortValues = function(o) { + return arguments.length ? (e = o, n = null, a) : e; + }, a.sort = function(o) { + return arguments.length ? (n = o, e = null, a) : n; + }, a.startAngle = function(o) { + return arguments.length ? (r = typeof o == "function" ? o : Et(+o), a) : r; + }, a.endAngle = function(o) { + return arguments.length ? (i = typeof o == "function" ? o : Et(+o), a) : i; + }, a.padAngle = function(o) { + return arguments.length ? (s = typeof o == "function" ? o : Et(+o), a) : s; + }, a; +} +function cr(t, e, n) { + this.k = t, this.x = e, this.y = n; +} +cr.prototype = { + constructor: cr, + scale: function(t) { + return t === 1 ? this : new cr(this.k * t, this.x, this.y); + }, + translate: function(t, e) { + return t === 0 & e === 0 ? this : new cr(this.k, this.x + this.k * t, this.y + this.k * e); + }, + apply: function(t) { + return [t[0] * this.k + this.x, t[1] * this.k + this.y]; + }, + applyX: function(t) { + return t * this.k + this.x; + }, + applyY: function(t) { + return t * this.k + this.y; + }, + invert: function(t) { + return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k]; + }, + invertX: function(t) { + return (t - this.x) / this.k; + }, + invertY: function(t) { + return (t - this.y) / this.k; + }, + rescaleX: function(t) { + return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t)); + }, + rescaleY: function(t) { + return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t)); + }, + toString: function() { + return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; + } +}; +cr.prototype; +var dd = /* @__PURE__ */ vu(''); +const pd = { + 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 Vo(t, e) { + os(e, !0), uo(t, pd); + let n = ue(e, "jsonData", 7), r = ue(e, "currentRound", 7, 1), i = ue(e, "mouseEventType", 15), s = ue(e, "mouseData", 15), a = ue(e, "mouseY", 15), o = ue(e, "requestRoundChange", 7, (p) => { + }), l = ue(e, "candidateColors", 23, () => []); + function u(p) { + return p.isTransfer ? `${p.label}__transfer` : p.transferIndex != null ? `${p.label}__${p.transferIndex}` : p.label; + } + const f = 800, h = 800, c = Math.min(f, h) * 0.3, v = f / 2, g = h / 2, m = "Pie", b = "Donut", A = "TextLayer", S = "url(#cross-hatch)", T = 1.15, D = 0.1, E = 750, j = 800; + function it(p) { + return "hatch-" + p.replace(/[^a-zA-Z0-9]/g, "-"); + } + let W = [], nt = [], ut = [], ft = 0, G = /* @__PURE__ */ mt( + 0 + // $state just to make it inspectable + ), x = 0; + const P = {}, zt = "No Further Rankings"; + let tt = /* @__PURE__ */ mt(null); + function Ht() { + const p = gt(w(tt)); + p.select("#" + m).remove(), p.select("#" + b).remove(), p.select("#" + A).remove(); + } + function Yt(p) { + o() && (st = p, o()(p)); + } + function ne(p) { + Ht(), ut = ge(p), W = jo(p, m, ut, v, g, 0, Tt()); + } + xu(() => { + rr(), setTimeout( + () => { + ne(r()); + }, + 0 + ); + }); + function ge(p) { + const _ = Nr(p); + return ft = rn(p), _; + } + function Tt() { + return c; + } + function _e() { + return Tt() * 1.41; + } + function me(p) { + let _ = 0; + for (let y = 1; y < p; y++) { + const M = n().results[y - 1].tallyResults; + for (let R = 0; R < M.length; R++) { + const C = M[R].transfers; + if (C) { + const k = C.exhausted; + k && (_ += Number(k)); + } + } + } + return _; + } + function Xe(p, _) { + if (p === "exhausted") return me(_); + { + const y = n().results[_ - 1].tally; + return Number(y[p]); + } + } + function Ot(p, _) { + return Xe(p, _).toLocaleString("en-US"); + } + function nn(p, _) { + return (Xe(p, _) / ft).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + } + function rn(p) { + const _ = n().results[p - 1].tally; + let y = 0; + for (let [M, R] of Object.entries(_)) + y += Number(R); + return y; + } + function Ge(p, _) { + if (!p || p < 1 || p > n().results.length) + return console.warn("In chsoenCandidates: round ${round} is out of range."), []; + const y = n().results[p - 1].tallyResults, M = []; + for (let R = 0; R < y.length; R++) { + const C = y[R][_]; + C != null && M.push(C); + } + return M; + } + function Bt(p) { + return Ge(p, "eliminated"); + } + function ye(p) { + let _ = []; + for (let y = 1; y <= p; y++) _ = _.concat(Ge(y, "elected")); + return _; + } + function Sn(p, _) { + const y = n().results[_ - 1].tallyResults; + let M = 0; + const R = y.findIndex((C) => (C == null ? void 0 : C.elected) && p == C.elected); + if (R >= 0) { + const C = y[R].transfers; + if (C) + for (let [k, I] of Object.entries(C)) M += Number(I); + } else + return 0; + return M; + } + function Nr(p) { + const _ = n().results; + let y = _[Math.max(0, p - 2)].tally; + const M = [], R = []; + for (let [k, I] of Object.entries(y)) + M.push({ label: k, value: 0 }); + y = _[p - 1].tally; + for (let k of M) { + const I = Number(y[k.label]), q = Sn(k.label, p); + q > 0 ? (R.push({ + label: k.label, + value: q, + isTransfer: !0 + }), k.value = I - q, R.push(k)) : (k.value = I, R.push(k)); + } + const C = me(p); + return R.push({ label: "exhausted", value: C }), R; + } + function rr() { + const p = gt(w(tt)).select("defs").select("#cross-hatch"); + let _ = 0; + for (let [y, M] of Object.entries(n().results[0].tally)) { + !l() || l().length === 0 ? _ < 10 ? P[y] = td[_] : P[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : P[y] = l()[_ % l().length], _++; + { + const R = p.clone(!0); + R.attr("id", it(y)).select("rect").attr("fill", P[y]), R.selectAll("circle").attr("fill", "#383838"); + } + } + P.exhausted = S, P["Inactive Ballots"] = S; + } + function bi() { + gt(w(tt)).select("#" + b).remove(); + } + function $(p, _) { + const y = Wr("global").duration(j); + _ && y.on("end", _), bi(), Yo(p), Zo(), Qo(0, Tt()), kr(); + } + function V(p, _) { + const y = Wr("global").duration(j); + _ && y.on("end", _), Bo(p); + } + function et(p, _) { + const y = Wr("global").duration(j); + _ && y.on("end", _), zo(p), Ho(Tt()); + } + let K = !1, rt = []; + function Q() { + kr(), K = !1, At(); + } + function At() { + if (rt.length === 0) { + st !== r() && (r() === st + 1 && st > 0 && r() <= n().results.length ? (st = r(), dt(r())) : r() >= 1 && r() <= n().results.length && (st = r(), J(G, 0), ne(r()))); + return; + } + const p = rt.shift(); + switch (p.type) { + case "round": { + const _ = p.round; + _ === st + 1 && st > 0 && _ <= n().results.length ? (st = _, dt(_)) : (_ !== st && _ >= 1 && _ <= n().results.length && (st = _, J(G, 0), ne(_)), At()); + break; + } + case "step": + kn(); + break; + } + } + function dt(p) { + if (p <= 1 || p > n().results.length) { + At(); + return; + } + K = !0, x = p, J(G, 0), $(x - 1, () => { + V(x - 1, () => { + et(x, Q); + }); + }); + } + function re() { + K || (K = !0, x = r(), ie()); + } + function ie() { + if (J( + G, + 0 + // if in the middle of "one small step" animation, reset to 0. + ), rt.length > 0) { + Q(); + return; + } + const p = x < n().results.length - 1 ? ie : Q; + $(x, () => { + V(x, () => { + x++, Yt(x), et(x, p); + }); + }); + } + ds(() => { + Ke(); + }); + let st = 0; + function Ke() { + if (st != r()) { + if (K) { + rt.push({ type: "round", round: r() }); + return; + } + st == r() - 1 && st > 0 ? bt() : se(r()), st = r(); + } + } + function se(p) { + if (K) { + rt.push({ type: "round", round: p }); + return; + } + J(G, 0), ne(p); + } + function bt() { + if (K) { + rt.push({ type: "round", round: r() }); + return; + } + if (r() <= 1) { + console.warn(`animateOneRoundFn: can't animate to round ${r()}`); + return; + } + if (x = r(), x > n().results.length) { + kr(), K = !1; + return; + } + K = !0, w(G) === 0 ? $(x - 1, () => { + V(x - 1, () => { + et(x, Q); + }); + }) : w(G) === 1 ? V(x - 1, () => { + et(x, Q); + }) : w(G) === 2 && et(x, Q), J(G, 0); + } + function kn() { + if (r() > n().results.length) { + kr(), K = !1; + return; + } + if (K) { + rt.push({ type: "step" }); + return; + } + K = !0, J(G, (w(G) + 1) % 3), x = r(), w(G) === 1 ? $(x, Q) : w(G) === 2 ? V(x, Q) : w(G) === 0 ? (x++, Yt(x), et(x, Q)) : (K = !1, console.warn("displayPhase out of range at ", w(G))); + } + function zo(p) { + ut = Nr(p), W = tl(p, m, ut, 0, Tt(), !0); + } + function Ho(p, _) { + const y = gt(w(tt)).select("#" + b), M = De().outerRadius(p).innerRadius(p - 1), R = y.selectAll(".slice"); + let C = R.size(); + function k() { + C--, C === 0 && Jo(); + } + R.select("path").transition("global").duration(E).attr("d", (I) => M(I)).on("end", (I) => k()); + } + function Yo(p) { + const _ = Xo(p, W); + nt = Ts(p, b, _, v, g, Tt(), _e(), !1, !0); + } + function Bo(p) { + const _ = Ko(p, nt, W); + nt = Cs(p, b, _, Tt(), _e(), !1); + } + function Sr(p) { + return P[p.data.label]; + } + function Uo(p) { + const _ = {}, y = n().results[p - 1].tallyResults; + for (let M = 0; M < y.length; M++) { + let R = y[M].eliminated; + if (R === void 0 && (R = y[M].elected), R === void 0) { + console.warn("getTransferVotes: Eliminated and Elected undefined..."); + continue; + } + const C = y[M].transfers; + if (C === void 0) { + console.warn("getTransferVotes: transfers undefined..."); + continue; + } + for (let [k, I] of Object.entries(C)) + _[k] === void 0 ? _[k] = Number(I) : _[k] += Number(I); + } + return _; + } + function Xo(p, _) { + const y = [], M = ft, R = n().results[p - 1].tallyResults; + for (let C = 0; C < R.length; C++) { + let k = R[C].eliminated; + if (k === void 0 && (k = R[C].elected), k === void 0) { + console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); + continue; + } + const I = R[C].transfers; + if (I === void 0) { + console.warn("makeDonutInfo: transfers undefined..."); + continue; + } + let q = _.find((F) => F.data.label == k && F.data.isTransfer); + q === void 0 && (q = _.find((F) => F.data.label == k && !F.data.isTransfer)); + let B = 0; + if (q) B = q.startAngle; + else { + console.warn("makeDonutInfo: No transfers"); + continue; + } + for (let [F, U] of Object.entries(I)) { + let at; + const we = _.find((ct) => ct.data.label == F); + if (we) + at = structuredClone(we); + else if (F == "exhausted") + at = { + data: { label: F, value: Number(U) }, + value: 0, + index: 0, + startAngle: 0, + endAngle: 0, + padAngle: 0 + }; + else if (F == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", U); + continue; + } else { + console.warn("makeDonutInfo: unrecognized name in transfers ", F); + continue; + } + const N = Number(U) / M * 2 * Math.PI; + at.startAngle = B, B = at.endAngle = B + N, at.index = C, at.data.transferIndex = C, y.push(at); + } + } + return y; + } + function Go(p, _, y) { + const M = {}; + for (let [R, C] of Object.entries(p)) { + const k = y.find((B) => R == B.data.label); + if (k === void 0) { + console.warn("getTransferStartAngles: mainPieObj not found for ", R); + continue; + } + const I = (k.startAngle + k.endAngle) / 2, q = p[k.data.label] / _ * 2 * Math.PI; + M[k.data.label] = I - q / 2; + } + return M; + } + function Ko(p, _, y) { + const M = [], R = ft, C = Uo(p), k = Go(C, R, y); + for (let [I, q] of _.entries()) { + const B = structuredClone(q), F = q.endAngle - q.startAngle, U = y.find((at) => q.data.label === at.data.label && !at.data.isTransfer); + if (U) { + const at = U.data.label; + B.startAngle = k[at], k[at] += F, B.endAngle = B.startAngle + F; + } else if (q.data.label === "exhausted") + B.startAngle = q.startAngle, B.endAngle = q.endAngle; + else { + console.warn("updateDonutInfo: unrecognized slice name ", q.data.label); + continue; + } + B.index = I, M.push(B); + } + return M; + } + function Rs(p, _, y, M, R, C) { + const I = gt(w(tt)).append("g").attr("id", A).attr("transform", `translate(${y}, ${M})`), q = De().innerRadius(R * T).outerRadius(R * T); + I.selectAll("text").data(_).enter().each(function(B) { + B.endAngle - B.startAngle < D || B.data.isTransfer || gt(this).append("g").attr("id", (F) => u(F.data)).classed("eliminated", (F) => C.includes(F.data.label) || F.data.isTransfer === !0).each(function(F, U) { + F.data.label === "exhausted" && gt(this).on("mouseenter", (at, we) => el(at)).on("mouseleave", (at, we) => nl()); + }).append("text").attr("transform", (F) => `translate(${q.centroid(F)})`).attr("text-anchor", (F) => $i(F.startAngle, F.endAngle)).text((F) => F.data.label === "exhausted" ? zt : F.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((F) => Ot(F.data.label, p) + " (" + nn(F.data.label, p) + ")"); + }); + } + function Wo(p, _, y, M) { + const C = gt(w(tt)).select("#" + A), k = C.selectAll("tspan"), I = C.selectAll("g").data(_, (U) => u(U.data)).classed("eliminated", (U) => M.includes(U.data.label) || U.data.isTransfer === !0), q = De().innerRadius(y * T).outerRadius(y * T + 1); + k.transition("global").duration(E).attr("transform", (U) => `translate(${q.centroid(U)})`).attr("text-anchor", (U) => $i(U.startAngle, U.endAngle)), I.select("text").transition("global").duration(E).attr("transform", (U) => `translate(${q.centroid(U)})`).attr("text-anchor", (U) => $i(U.startAngle, U.endAngle)).on("end", (U) => F()); + let B = I.size(); + function F(U) { + B--, B === 0 && (C.remove(), Rs(p, _, v, g, y, M)); + } + } + function jo(p, _, y, M, R, C, k, I = !0, q = !1) { + const F = la().sort(null).value((U) => U.value)(y); + return Ts(p, _, F, M, R, C, k, I, q), F; + } + function kr() { + gt(w(tt)).select("#" + m).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); + } + function Ts(p, _, y, M, R, C, k, I, q) { + const B = Bt(p), F = ye(p), we = gt(w(tt)).attr("viewBox", `0 0 ${f} ${h}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${M}, ${R})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (N) => B.includes(N.data.label) || N.data.isTransfer === !0).classed("elected", (N) => F.includes(N.data.label) && !N.data.isTransfer).attr("id", (N) => u(N.data)).on("mouseenter", (N, ct) => Ei(N, ct)).on("mouseleave", (N, ct) => Ri(N, ct)), ir = De().outerRadius(k).innerRadius(C); + if (q) { + const N = De().outerRadius(C + 1).innerRadius(C); + we.append("path").attr("d", N).transition("global").duration(E).attr("d", (ct) => ir(ct)).attr("fill", (ct) => Sr(ct)).on("end", (ct) => Ai()); + } else + we.append("path").attr("d", (N) => ir(N)).attr("fill", (N) => Sr(N)), Ai(); + return I && Rs(p, y, M, R, k, B), y; + } + function Zo() { + const y = gt(w(tt)).select("#" + A).selectAll(".eliminated"); + y.size() > 0 && y.classed("finished", !0); + } + function Jo() { + const y = gt(w(tt)).select("#" + A).selectAll(".finished"); + y.size() > 0 && y.remove(); + } + function Qo(p, _) { + const R = gt(w(tt)).select("#" + m).selectAll(".eliminated"), C = De().innerRadius(p), k = De().outerRadius(_); + R.classed("finished", !0).select("path").transition("global").duration(E).attrTween("d", function(I) { + const q = On(_, p); + return function(B) { + return k.innerRadius(q(B)), k(I); + }; + }).attr("fill", (I) => `url(#${it(I.data.label)})`), R.clone(!0).classed("finished", !0).select("path").transition("global").duration(E).attrTween("d", function(I) { + const q = On(_, p); + return function(B) { + return C.outerRadius(q(B)), C(I); + }; + }).attr("fill", (I) => Sr(I)); + } + function $i(p, _) { + const y = (p + _) / 2; + return y > Math.PI * 11 / 6 || y < Math.PI * 1 / 6 || y > Math.PI * 5 / 6 && y < Math.PI * 7 / 6 ? "middle" : y < Math.PI ? "start" : "end"; + } + function Ai() { + gt(w( + tt + // force redisplay of text labels + )).select("#" + A).raise().append("g").remove(); + } + function tl(p, _, y, M, R, C) { + const I = la().sort(null).value((q) => q.value)(y); + return Cs(p, _, I, M, R, C), I; + } + function Cs(p, _, y, M, R, C) { + const k = Bt(p), I = ye(p), q = De().outerRadius(R).innerRadius(M).startAngle((N) => N.startAngle).endAngle((N) => N.endAngle), B = De().outerRadius(R).innerRadius(M), U = gt(w(tt)).select("#" + _); + U.selectAll(".slice").attr("prevStart", (N) => N.startAngle).attr("prevEnd", (N) => N.endAngle); + const at = U.selectAll(".slice").data(y, (N) => u(N.data)); + at.enter().append("g").attr("class", "slice").attr("id", (N) => u(N.data)).classed("eliminated", !0).on("mouseenter", (N, ct) => Ei(N, ct)).on("mouseleave", (N, ct) => Ri(N, ct)).append("path").attr("d", (N) => B(N)).attr("fill", (N) => Sr(N)), at.classed("eliminated", (N) => k.includes(N.data.label)).classed("elected", (N) => I.includes(N.data.label)).on("mouseenter", (N, ct) => Ei(N, ct)).on("mouseleave", (N, ct) => Ri(N, ct)); + let we = at.size(); + function ir() { + we--, we <= 0 && (Ai(), U.selectAll(".finished").remove()); + } + return at.select("path").transition("global").duration(E).attrTween("d", function(N) { + const ct = Number(gt(this.parentNode).attr("prevStart")), il = Number(gt(this.parentNode).attr("prevEnd")), sl = On(ct, N.startAngle), al = On(il, N.endAngle); + return (Ss) => (q.startAngle(sl(Ss)).endAngle(al(Ss)), q(N)); + }).on("end", ir), C && Wo(p, y, R, k), y; + } + function Ei(p, _) { + s(_.data.label), i("enter"), a(p.clientY); + } + function Ri(p, _) { + s(_.data.label), i("leave"); + } + function el(p, _) { + i("show-exhausted"), a(p.clientY); + } + function nl(p, _) { + i("hide-exhausted"); + } + var rl = { + pieColors: P, + exhaustedLabel: zt, + countExhaustedVotes: me, + getEliminatedCandidates: Bt, + getElectedCandidates: ye, + runFullAnimationFn: re, + animateOnePhaseFn: kn, + get jsonData() { + return n(); + }, + set jsonData(p) { + n(p), jt(); + }, + get currentRound() { + return r(); + }, + set currentRound(p = 1) { + r(p), jt(); + }, + get mouseEventType() { + return i(); + }, + set mouseEventType(p) { + i(p), jt(); + }, + get mouseData() { + return s(); + }, + set mouseData(p) { + s(p), jt(); + }, + get mouseY() { + return a(); + }, + set mouseY(p) { + a(p), jt(); + }, + get requestRoundChange() { + return o(); + }, + set requestRoundChange(p = (_) => { + }) { + o(p), jt(); + }, + get candidateColors() { + return l(); + }, + set candidateColors(p = []) { + l(p), jt(); + } + }, Ns = dd(); + return Br(Ns, (p) => J(tt, p), () => w(tt)), be(t, Ns), ls(rl); +} +co( + Vo, + { + jsonData: {}, + currentRound: {}, + mouseEventType: {}, + mouseData: {}, + mouseY: {}, + requestRoundChange: {}, + candidateColors: {} + }, + [], + [ + "pieColors", + "exhaustedLabel", + "countExhaustedVotes", + "getEliminatedCandidates", + "getElectedCandidates", + "runFullAnimationFn", + "animateOnePhaseFn" + ], + { mode: "open" } +); +var vd = /* @__PURE__ */ er(" ", 1), gd = /* @__PURE__ */ er("About to eliminate: ", 1), _d = /* @__PURE__ */ er(" ", 1), md = /* @__PURE__ */ er("Elected: ", 1), yd = /* @__PURE__ */ er("
", 1), wd = /* @__PURE__ */ er('


these ballots have already been eliminated.
', 1); +const xd = { + 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:absolute;width:max-content;text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;left:50%;transform:translate(-50%);font-weight:normal;opacity:0;}.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: 90%; */ + /* min-width: 800px; /* Larger minimum size */width:100%; /* Change from 90% to 100% */min-width:auto; /* Remove the 800px minimum */flex-grow:0; /* Don't grow beyond specified width */margin:0 auto;margin-right:40px; /* Add extra space on right */margin-top:-3vh;}.visualizations-container.svelte-1r6y5gl {display:flex;justify-content:space-between;width:100%;padding:0 20px; + /* gap: 80px; */gap:20px; /* Reduce from 80px */} + + +/*** It looks like it is always OK to use justify-content: space-between even with no bubble viz display + +.visualizations-container { + justify-content: space-between; +} + ***/ + + + +/* width: 25%; /* Smaller percentage */ +/* flex-grow: 0; /* Don't grow beyond specified width */ +/* margin-left: 40px; /* Add extra space on left */ + +/*** Omit this if we are not using the bubble-visualization +.bubble-visualization-container { + width: 25%; + flex-grow: 0; + align-self: center; + margin: 0 auto; + margin-top: 30px; + margin-left: 40px; +} +***/ + + +/* Media query for smaller screens */ +@media (max-width: 1300px) {.visualizations-container.svelte-1r6y5gl {flex-direction:column;align-items:center;} +} + +@media (max-width: 768px) {.page-container.svelte-1r6y5gl {padding:0 10px; /* Reduce padding on smaller screens */}.visualizations-container.svelte-1r6y5gl {padding:0; /* Remove padding on small screens */} +}h3.svelte-1r6y5gl, h4.svelte-1r6y5gl {margin:0.5rem;} + +@media (max-width: 768px) {.common-header.svelte-1r6y5gl {margin-bottom:0.5rem;}h3.svelte-1r6y5gl, h4.svelte-1r6y5gl {margin:0.3rem 0;font-size:0.9rem;} + +}` +}; +function bd(t, e) { + os(e, !0), uo(t, xd); + const n = 0.85; + let r = ue(e, "electionSummary", 7), i = ue(e, "currentRound", 7, 1), s = ue(e, "requestRoundChange", 7, ($) => { + }), a = ue(e, "candidateColors", 23, () => []), o = /* @__PURE__ */ mt(null), l = /* @__PURE__ */ mt(null), u = /* @__PURE__ */ mt(""), f = /* @__PURE__ */ mt(un([])), h = /* @__PURE__ */ mt(""), c = /* @__PURE__ */ mt(""), v = /* @__PURE__ */ mt(0), g = /* @__PURE__ */ sr(() => m(r())); + function m($) { + if (typeof $ == "string") + try { + $ = JSON.parse($); + } catch (V) { + return console.error("Failed to parse JSON string:", V), {}; + } + return $ || {}; + } + function b($) { + s() ? s()($) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); + } + function A() { + switch (w(h)) { + case "enter": + (($) => { + var V = Al($, 2); + J(f, V[0], !0), J(u, V[1], !0); + })(T(w(c), i())), w(o) && (w(o).style.top = String(w(v) || 20) + "px", w(o).style.opacity = String(n)); + break; + case "leave": + w(o) && (w(o).style.opacity = "0"), J(f, [], !0), J(u, ""); + break; + case "show-exhausted": + w(l) && (w(l).style.top = String(w(v) || 20) + "px", w(l).style.opacity = String(n)); + break; + case "hide-exhausted": + w(l) && (w(l).style.opacity = "0"); + break; + default: + console.log("Unknown mouse event: ", w(h)); + break; + } + } + ds(() => A()); + function S($, V) { + return $ == 1 ? V ? "vote was" : "vote will be" : V ? "votes were" : "votes will be"; + } + function T($, V) { + const et = [], K = $ === "exhausted" ? ut() : $; + let rt; + $ == "exhausted" ? rt = W(1) : rt = w(g).results[0].tally[$], et.push(`${K} started with ${rt} votes.`); + for (let Q = 1; Q <= V; Q++) { + Q === V && ($ == "exhausted" ? rt = W(V) : rt = w(g).results[V - 1].tally[$], et.push(`${K} has ${rt} votes at round ${V}.`)); + const At = w(g).results[Q - 1].tallyResults; + for (let dt = 0; dt < At.length; dt++) { + const re = At[dt].transfers, ie = At[dt].eliminated, st = At[dt].elected; + if (ie) + ie === $ && et.push(`${K} will be eliminated on round ${Q}.`); + else if ($ === st && (et.push(`${K} was elected on round ${Q}.`), re)) + for (let [se, bt] of Object.entries(re)) + et.push(`${bt} ${S(Number(bt), Q < V)} transferred to ${se} on round ${Q}.`); + const Ke = ie || st; + if (Ke) { + const se = Number(re[$]); + se && et.push(`${se} ${S(se, Q < V)} transferred from ${Ke} on round ${Q}.`); + } + } + } + return [et, K]; + } + function D() { + let $ = 0; + for (let V = 1; V <= w(g).results.length; V++) { + const et = w(g).results[V - 1].tallyResults; + for (let K = 0; K < et.length; K++) + et[K].elected && $++; + } + return $; + } + let E; + function j($) { + return E ? E.getEliminatedCandidates($) : []; + } + function it($) { + return E ? E.getElectedCandidates($) : []; + } + function W($) { + return E ? E.countExhaustedVotes($) : 0; + } + function nt() { + E && E.animateOnePhaseFn && E.animateOnePhaseFn(); + } + function ut() { + return E ? E.exhaustedLabel : ""; + } + function ft() { + return E ? E.pieColors : {}; + } + var G = { + get electionSummary() { + return r(); + }, + set electionSummary($) { + r($), jt(); + }, + get currentRound() { + return i(); + }, + set currentRound($ = 1) { + i($), jt(); + }, + get requestRoundChange() { + return s(); + }, + set requestRoundChange($ = (V) => { + }) { + s($), jt(); + }, + get candidateColors() { + return a(); + }, + set candidateColors($ = []) { + a($), jt(); + } + }, x = wd(), P = Mn(x), zt = Xt(P); + zt.__click = nt, Ut(P); + var tt = ae(P, 4), Ht = Xt(tt), Yt = Xt(Ht), ne = Xt(Yt); + Br( + Vo(ne, { + get jsonData() { + return w(g); + }, + get currentRound() { + return i(); + }, + requestRoundChange: b, + get candidateColors() { + return a(); + }, + get mouseEventType() { + return w(h); + }, + set mouseEventType($) { + J(h, $, !0); + }, + get mouseData() { + return w(c); + }, + set mouseData($) { + J(c, $, !0); + }, + get mouseY() { + return w(v); + }, + set mouseY($) { + J(v, $, !0); + } + }), + ($) => E = $, + () => E + ), Ut(Yt), Ut(Ht); + var ge = ae(Ht, 2), Tt = Xt(ge); + Ut(ge); + var _e = ae(ge, 2), me = Xt(_e); + { + var Xe = ($) => { + var V = gd(), et = ae(Mn(V)); + Si(et, 17, () => j(i()), Ni, (K, rt, Q) => { + var At = vd(), dt = Mn(At); + let re; + var ie = Xt(dt, !0); + Ut(dt); + var st = ae(dt, 2); + { + var Ke = (bt) => { + var kn = Vs(", "); + be(bt, kn); + }, se = /* @__PURE__ */ sr(() => Q < j(i()).length - 1); + Dr(st, (bt) => { + w(se) && bt(Ke); + }); + } + Pr( + (bt) => { + re = Ys(dt, "", re, bt), Pn(ie, w(rt)); + }, + [() => ({ color: ft()[w(rt)] })] + ), be(K, At); + }), be($, V); + }, Ot = /* @__PURE__ */ sr(() => j(i()).length > 0); + Dr(me, ($) => { + w(Ot) && $(Xe); + }); + } + var nn = ae(me, 2); + { + var rn = ($) => { + var V = md(), et = ae(Mn(V)); + Si(et, 17, () => it(i()), Ni, (K, rt, Q) => { + var At = _d(), dt = Mn(At); + let re; + var ie = Xt(dt, !0); + Ut(dt); + var st = ae(dt, 2); + { + var Ke = (bt) => { + var kn = Vs(", "); + be(bt, kn); + }, se = /* @__PURE__ */ sr(() => Q < it(i()).length - 1); + Dr(st, (bt) => { + w(se) && bt(Ke); + }); + } + Pr( + (bt) => { + re = Ys(dt, "", re, bt), Pn(ie, w(rt)); + }, + [() => ({ color: ft()[w(rt)] })] + ), be(K, At); + }), be($, V); + }, Ge = /* @__PURE__ */ sr(() => it(i()).length > 0); + Dr(nn, ($) => { + w(Ge) && $(rn); + }); + } + Ut(_e), Ut(tt); + var Bt = ae(tt, 2), ye = Xt(Bt), Sn = Xt(ye, !0); + Ut(ye); + var Nr = ae(ye, 2); + Si(Nr, 17, () => w(f), Ni, ($, V) => { + var et = yd(), K = Mn(et), rt = Xt(K, !0); + Ut(K), Fi(2), Pr(() => Pn(rt, w(V))), be($, et); + }), Ut(Bt), Br(Bt, ($) => J(o, $), () => w(o)); + var rr = ae(Bt, 2), bi = Xt(rr); + return Fi(2), Ut(rr), Br(rr, ($) => J(l, $), () => w(l)), Pr( + ($, V) => { + Pn(Tt, `${w(g).config.contest ?? ""}, ${$ ?? ""} to be elected, Round ${i() ?? ""}.`), Pn(Sn, w(u)), Pn(bi, `"${V ?? ""}" means all the candidates ranked on `); + }, + [D, ut] + ), be(t, x), ls(G); +} +hu(["click"]); +customElements.define("pie-chart", co( + bd, + { + electionSummary: {}, + currentRound: {}, + requestRoundChange: {}, + candidateColors: {} + }, + [], + [], + { mode: "open" } +)); diff --git a/static/pie/pie.css b/static/pie/pie.css new file mode 100644 index 00000000..a767859d --- /dev/null +++ b/static/pie/pie.css @@ -0,0 +1,5 @@ +/* TODO -- SHEL -- Pie CSS here */ +#pie-body { + max-width: 800px; + width: 100%; +} diff --git a/static/share/share.js b/static/share/share.js index 7357ecc2..059bdf94 100644 --- a/static/share/share.js +++ b/static/share/share.js @@ -20,7 +20,8 @@ function initializeOptions() ["Single Table Summary", "table"], ["Table, By Round (Interactive)", "table-by-round"], ["Table, By Round (Static)", "table-by-round-static"], - ["Table, By Candidate", "table-by-candidate"] + ["Table, By Candidate", "table-by-candidate"], + ["Pie Chart", "pie"] ]; for (const selector of ["exportVistypeSelector", "embedlyVistypeSelector"]) diff --git a/static/visualizer/tabicons/pie.png b/static/visualizer/tabicons/pie.png new file mode 100644 index 0000000000000000000000000000000000000000..51d020cc6ad56c8fe6f3b68da1a694651779675f GIT binary patch literal 2319 zcmb_ed2AF_9G9pac=$Y}*A4U=!VBcHX@C-tYSz z-|xMt8J{~kE%m8X1VPe#UQZspKWAN!B*Xug$i|iM)+6GbY9Pp?8P=76ENRF@kmQw0 zV2U}#KbDuYuuYIP5!lMZ5r{^RVK0|Q1gR95s0f0J>cXyUZ^2MSc43pV{iHwQ2E~fE zQU?<&a|2Rksl>_H%Q@(LIF2JonxJVMB5E<^~*Mp{wDfU*?FMauM0j9iuo5CUPKng+yDacrbmGc}`F zdw}Wq>w5@bcK!Z1$9;VXhvO86IdT>Zqaz{rMH_*N2q5x+p_SFqwI`J8V_LaSKDxx*u|8T1pwWjEzn$ICip;2>gAqZPyRPVq zc#!{wFzeyoGXg2o994t^PITZbD*@ceFf8sM8QCGyA}oT~8GYRQd-ce~_1GovX}gU@ z2m1v{QLPq-&C$M0Di+irfO{x`{fBV6B+hoi2ZVE{z5dT|2y5qT7aH+T4aVNxwada{ z#-`xbZ4Kkc27HJgJV1q+(&4f4YagZ+K@u~3o)H1>SGyPcJ)Q}@tCriTmAe;sv)t2~ zGt+CbMs4wl_JQ>S7TRk(n38cRJ)G`a>fOF5T<^`ImwHb1Tj)Jq`fWu+uN(-> z`DELf8H+rZ^IX4zXKS;cY+^DRc{wB65k=-|~?@1kz zOA{VX9JF)kQ8N(Ywl*h+kZ~oK`ek}k)%vF9nzV+=Ez=$EqgPT7?w#FTPYLa=I`H=V zwbLsRdS>fJXY$AEa_hTYOz2*Ab(ynm+tH1(Cz7{mQ2(B71OA%SR(*7B$hVAb9omNF z{9=zJx9vVjW(5nX_pjc5%21LP=l4FFSM_Pt-X~n?{R_o2DSrfNgT3`0F5G)+#@HiG>$f~Tskx?GD@f}(=2*tzw*76dr(K@# z*3>yO*Q_tuwBx$?*tH)fZK%sXxOLCY-*#@Ou5*5|Ce+&Vdv{Z4Td=sP1bN~3tV`!6 zgg38xrpbMwxk4}8_2r4^yQ^yLkb;e6pM_JdpGhq^ot(Mh-0+`!4E62b`1S1kk3K9wjwu(SOA?nSEV+HN dWn#&##JRRL8akw~yY + + + diff --git a/templates/pie/pie.html b/templates/pie/pie.html new file mode 100644 index 00000000..0511dd44 --- /dev/null +++ b/templates/pie/pie.html @@ -0,0 +1,9 @@ + + +{{ rawData|json_script:"rawDataId" }} + + +
+
+
+
diff --git a/templates/visualizer/visualize-embedded.html b/templates/visualizer/visualize-embedded.html index 3e966b37..84c9260b 100644 --- a/templates/visualizer/visualize-embedded.html +++ b/templates/visualizer/visualize-embedded.html @@ -13,6 +13,8 @@
{% if vistype == "sankey" %} {% include "sankey/sankey.html" %} + {% elif vistype == "pie" %} + {% include "pie/pie.html" %} {% elif vistype == "barchart-fixed" %} {% include "bargraph/barchart-fixed.html" %} {% elif vistype == "barchart-interactive" %} @@ -45,6 +47,8 @@ {% include "visualizer/common-visualizer-nonblocking.html" %} {% if vistype == "sankey" %} {% include "sankey/sankey-nonblocking.html" %} + {% elif vistype == "pie" %} + {% include "pie/pie-nonblocking.html" %} {% elif vistype == "barchart-fixed" %} {% include "bargraph/barchart-common-nonblocking.html" %} {% include "bargraph/barchart-fixed-nonblocking.html" %} diff --git a/templates/visualizer/visualize.html b/templates/visualizer/visualize.html index c0b4a920..a647dcdc 100644 --- a/templates/visualizer/visualize.html +++ b/templates/visualizer/visualize.html @@ -35,7 +35,19 @@ + + -
+
+ {% include "pie/pie.html" %} +
+
{% include "tabular/tabular-by-candidate.html" %}
@@ -156,6 +166,7 @@
{% block afterMaincontent %} {% include "visualizer/common-visualizer-nonblocking.html" %} {% include "sankey/sankey-nonblocking.html" %} + {% include "pie/pie-nonblocking.html" %} {% include "bargraph/barchart-common-nonblocking.html" %} {% include "bargraph/barchart-fixed-nonblocking.html" %} {% include "bargraph/barchart-interactive-nonblocking.html" %} diff --git a/visualizer/graph/readRCVRCJSON.py b/visualizer/graph/readRCVRCJSON.py index e1f55c17..76146f41 100644 --- a/visualizer/graph/readRCVRCJSON.py +++ b/visualizer/graph/readRCVRCJSON.py @@ -274,6 +274,7 @@ def __init__(self, data): self.parse_data(data) self.graph.create_graph_from_rounds(self.rounds) self.set_elimination_order(self.rounds, self.graph.candidates) + self.graph._raw_JSON = data def parse_data(self, data): """ Parses the JSON data, or raises an exception on failure """ diff --git a/visualizer/serializers.py b/visualizer/serializers.py index 2300a68a..b960b693 100644 --- a/visualizer/serializers.py +++ b/visualizer/serializers.py @@ -45,12 +45,14 @@ def to_representation(self, instance): embedRelativeBarUrl = reverse('visualizeEmbedly', args=(instance.slug, 'bar')) embedRelativeSankeyUrl = reverse('visualizeEmbedly', args=(instance.slug, 'sankey')) embedRelativeTableUrl = reverse('visualizeEmbedly', args=(instance.slug, 'table')) + embedRelativePieUrl = reverse('visualizeEmbedly', args=(instance.slug, 'pie')) oembedRelativeUrl = reverse('oembed') + "?url=" + visAbsoluteUrl data['visualizeUrl'] = visAbsoluteUrl data['embedUrl'] = request.build_absolute_uri(embedRelativeBarUrl) data['embedSankeyUrl'] = request.build_absolute_uri(embedRelativeSankeyUrl) data['embedTableUrl'] = request.build_absolute_uri(embedRelativeTableUrl) + data['embedPieUrl'] = request.build_absolute_uri(embedRelativePieUrl) data['oembedEndpointUrl'] = request.build_absolute_uri(oembedRelativeUrl) return data diff --git a/visualizer/tests/testLiveBrowserHeadless.py b/visualizer/tests/testLiveBrowserHeadless.py index e4d290ec..2cb7d144 100644 --- a/visualizer/tests/testLiveBrowserHeadless.py +++ b/visualizer/tests/testLiveBrowserHeadless.py @@ -186,7 +186,9 @@ def test_legacy_embedded_urls(self): "tabular-by-candidate", "tabular-by-round", "tabular-by-round-interactive", - "tabular-candidate-by-round"] + "tabular-candidate-by-round", + "pie" + ] # None of the valid vistypes have errors for vistype in validVistypes: From edbd5feb9743aea2d4a625f8f10ecce4a82bf396 Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 4 Mar 2026 16:17:59 -0500 Subject: [PATCH 03/31] Use election color theme for pie chart instead of hardcoded colors Co-Authored-By: Claude Opus 4.6 --- templates/pie/pie-nonblocking.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index e839d68e..8624e60b 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -12,12 +12,10 @@ // client browser anyway, and the pie chart component can handle it in string form. const electionSummary = document.getElementById("rawDataId").textContent; - const candidateColors = [ - "#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "#8c564b", "#e377c2", "#7f7f7f", - "#bcbd22", "#17becf", "#aec7e8", "#ffbb78", "#98df8a", "#ff9896", "#c5b0d5", "#c49c94", - "#f7b6d2", "#c7c7c7", "#dbdb8d", "#9edae5", "#3366cc", "#dc3912", "#ff9900", "#109618", - "#990099", "#0099c6", "#dd4477", "#66aa00", "#b82e2e", "#316395" - ]; + // Generate candidate colors from the election's color theme, + // matching the palette used by the other visualizations. + const colorGenerator = getColorGenerator(config.colorTheme); + const candidateColors = Array.from(colorGenerator({{ config.numCandidates }})); // Create the pie-chart element const pieChart = document.createElement("pie-chart"); From 10b2d0e4c2bfb4fbdab1cfe573b48ea4e6ee63ab Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 4 Mar 2026 16:59:42 -0500 Subject: [PATCH 04/31] Build pie chart data from processed Graph instead of raw JSON The pie chart was the only visualization reading graph._raw_JSON directly, bypassing config filters like excludeFinalWinnerAndEliminatedCandidate. New converter in visualizer/pie/graphToRCtab.py builds RCTab-compatible JSON from the same processed Graph that bar chart and sankey use. Co-Authored-By: Claude Opus 4.6 --- common/viewUtils.py | 2 + templates/pie/pie.html | 4 +- visualizer/pie/__init__.py | 0 visualizer/pie/graphToRCtab.py | 117 +++++++++++++++++++++++++++++++++ 4 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 visualizer/pie/__init__.py create mode 100644 visualizer/pie/graphToRCtab.py diff --git a/common/viewUtils.py b/common/viewUtils.py index 49c13ce5..b75e1ee5 100644 --- a/common/viewUtils.py +++ b/common/viewUtils.py @@ -10,6 +10,7 @@ from visualizer.descriptors.textForWinnerUtils import as_caption from visualizer.graph.graphCreator import make_graph_with_file from visualizer.models import TextForWinner +from visualizer.pie.graphToRCtab import graph_to_rctab_json from visualizer.sankey.graphToD3 import D3Sankey from visualizer.sidecar.reader import SidecarReader from visualizer.tabular.tabular import TabulateByRoundInteractive, \ @@ -69,6 +70,7 @@ def get_data_for_graph(graph, config): 'tabularByRoundInteractive': tabularByRoundInteractive, 'graph': graph, 'rawData': graph._raw_JSON, + 'pieData': graph_to_rctab_json(graph), 'textForWinner': as_caption(config).lower(), } roundDescriberData = get_data_for_round_describer(graph, config) diff --git a/templates/pie/pie.html b/templates/pie/pie.html index 0511dd44..edb4f589 100644 --- a/templates/pie/pie.html +++ b/templates/pie/pie.html @@ -1,6 +1,6 @@ - -{{ rawData|json_script:"rawDataId" }} + +{{ pieData|json_script:"rawDataId" }}
diff --git a/visualizer/pie/__init__.py b/visualizer/pie/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/visualizer/pie/graphToRCtab.py b/visualizer/pie/graphToRCtab.py new file mode 100644 index 00000000..54a37a2d --- /dev/null +++ b/visualizer/pie/graphToRCtab.py @@ -0,0 +1,117 @@ +""" +Convert a Graph object into an RCTab-compatible JSON dict for the pie chart. + +Other rcvis visualizations (bar chart, sankey, tabular) consume GraphSummary, +which respects config options like excludeFinalWinnerAndEliminatedCandidate. +The pie chart component expects RCTab's JSON format (results/tally/tallyResults). + +This module bridges the two: it reads from the processed Graph (which already +has config filters applied) and produces the JSON structure the pie chart needs. +""" + +from visualizer import common +from visualizer.graph.rcvResult import Elimination, WinTransfer + + +def _stringify(value): + """ Convert a number to string, matching RCTab JSON convention. + Integers are formatted without decimals. """ + if isinstance(value, float) and value == int(value): + return str(int(value)) + return str(value) + + +def graph_to_rctab_json(graph): + """ + Build an RCTab-compatible JSON dict from a processed Graph. + + The Graph has already been through config filters (e.g. + excludeFinalWinnerAndEliminatedCandidate) and migrations, + so the output respects those settings. + + All candidates present in the Graph are included in the tally, + including "Inactive Ballots" and "Residual Surplus" pseudo-candidates + (the pie chart handles these by name). + + Returns a dict matching the RCtabSummary TypeScript interface. + """ + summary = graph.summarize() + num_rounds = graph.numRounds + + # Count active (real) candidates for the summary + inactive_names = {common.INACTIVE_TEXT, common.RESIDUAL_SURPLUS_TEXT} + num_active_candidates = sum(1 for c in graph.candidates if c.name not in inactive_names) + + results = [] + for round_i in range(num_rounds): + nodes_this_round = graph.nodesPerRound[round_i] + + # Build tally: candidate name -> vote count (as string) + # Include all candidates present this round (including Inactive Ballots) + tally = {} + for candidate, node in nodes_this_round.items(): + tally[candidate.name] = _stringify(node.count) + + # Build tallyResults from transfersPerRound + tally_results = [] + for transfer in graph.transfersPerRound[round_i]: + tally_result = {} + + if isinstance(transfer, Elimination): + tally_result['eliminated'] = transfer.candidate.name + elif isinstance(transfer, WinTransfer): + tally_result['elected'] = transfer.candidate.name + else: + # Plain Transfer with no election/elimination action — skip + continue + + # Build transfers dict: target candidate name -> vote count + transfers = {} + for target_candidate, count in transfer.transfersByCandidate.items(): + if count != 0: + transfers[target_candidate.name] = _stringify(count) + tally_result['transfers'] = transfers + + tally_results.append(tally_result) + + # Compute inactive ballots (exhausted choices) for the inactiveBallots field + inactive_ballots = {} + for candidate in graph.candidates: + if candidate.name == common.INACTIVE_TEXT and candidate in nodes_this_round: + exhausted = nodes_this_round[candidate].count + if exhausted > 0: + inactive_ballots['exhaustedChoices'] = _stringify(exhausted) + break + + # Threshold: RCTab has per-round threshold, rcvis stores a single value + threshold = _stringify(graph.threshold) if graph.threshold is not None else "0" + + results.append({ + 'round': round_i + 1, + 'tally': tally, + 'tallyResults': tally_results, + 'inactiveBallots': inactive_ballots, + 'threshold': threshold, + }) + + # Build summary + first_round_total = summary.rounds[0].totalActiveVotes if summary.rounds else 0 + + rctab_json = { + 'config': { + 'contest': graph.title, + }, + 'jsonFormatVersion': '1', + 'results': results, + 'summary': { + 'finalThreshold': _stringify(graph.threshold) if graph.threshold is not None else "0", + 'numCandidates': num_active_candidates, + 'numWinners': summary.numWinners, + 'totalNumBallots': _stringify(first_round_total), + }, + } + + if graph.dateString: + rctab_json['config']['date'] = graph.dateString + + return rctab_json From 48c4e8cd8733a2a7d78b5df23e817a9c24aa927e Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 4 Mar 2026 18:06:05 -0500 Subject: [PATCH 05/31] Pass config options to pie chart, initialize to final round - Pass textForWinner and excludeFinalWinnerAndEliminatedCandidate - Set currentRound to numRounds so pie loads on last round - Rebuilt standalone component with new props Co-Authored-By: Claude Opus 4.6 --- static/pie/pie-chart.es.js | 4222 ++++++++++++++-------------- templates/pie/pie-nonblocking.html | 3 + 2 files changed, 2151 insertions(+), 2074 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index a70b1317..30e857a2 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,27 +1,27 @@ -var ol = Object.defineProperty; -var ks = (t) => { +var ll = Object.defineProperty; +var zs = (t) => { throw TypeError(t); }; -var ll = (t, e, n) => e in t ? ol(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var ot = (t, e, n) => ll(t, typeof e != "symbol" ? e + "" : e, n), Ti = (t, e, n) => e.has(t) || ks("Cannot " + n); -var d = (t, e, n) => (Ti(t, e, "read from private field"), n ? n.call(t) : e.get(t)), L = (t, e, n) => e.has(t) ? ks("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), O = (t, e, n, r) => (Ti(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), pt = (t, e, n) => (Ti(t, e, "access private method"), n); -var ua; -typeof window < "u" && ((ua = window.__svelte ?? (window.__svelte = {})).v ?? (ua.v = /* @__PURE__ */ new Set())).add("5"); -const ul = 1, fl = 2, cl = 16, hl = 1, dl = 4, pl = 8, vl = 16, gl = 2, is = "[", fi = "[!", ss = "]", Bn = {}, _t = Symbol(), _l = "http://www.w3.org/1999/xhtml", Di = !1; -var ha = Array.isArray, ml = Array.prototype.indexOf, Un = Array.prototype.includes, ci = Array.from, Zr = Object.keys, Jr = Object.defineProperty, mn = Object.getOwnPropertyDescriptor, yl = Object.prototype, wl = Array.prototype, xl = Object.getPrototypeOf, Ms = Object.isExtensible; -const bl = () => { +var ul = (t, e, n) => e in t ? ll(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var lt = (t, e, n) => ul(t, typeof e != "symbol" ? e + "" : e, n), Li = (t, e, n) => e.has(t) || zs("Cannot " + n); +var d = (t, e, n) => (Li(t, e, "read from private field"), n ? n.call(t) : e.get(t)), L = (t, e, n) => e.has(t) ? zs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), D = (t, e, n, r) => (Li(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), pt = (t, e, n) => (Li(t, e, "access private method"), n); +var ya; +typeof window < "u" && ((ya = window.__svelte ?? (window.__svelte = {})).v ?? (ya.v = /* @__PURE__ */ new Set())).add("5"); +const fl = 1, cl = 2, hl = 16, dl = 1, pl = 4, vl = 8, gl = 16, _l = 2, vs = "[", yi = "[!", gs = "]", nr = {}, _t = Symbol(), ml = "http://www.w3.org/1999/xhtml", Wi = !1; +var ba = Array.isArray, yl = Array.prototype.indexOf, rr = Array.prototype.includes, wi = Array.from, ai = Object.keys, oi = Object.defineProperty, Tn = Object.getOwnPropertyDescriptor, wl = Object.prototype, xl = Array.prototype, bl = Object.getPrototypeOf, Hs = Object.isExtensible; +const $l = () => { }; -function $l(t) { +function Al(t) { for (var e = 0; e < t.length; e++) t[e](); } -function da() { +function $a() { var t, e, n = new Promise((r, i) => { t = r, e = i; }); return { promise: n, resolve: t, reject: e }; } -function Al(t, e) { +function El(t, e) { if (Array.isArray(t)) return t; if (!(Symbol.iterator in t)) @@ -31,130 +31,130 @@ function Al(t, e) { if (n.push(r), n.length === e) break; return n; } -const wt = 2, vr = 4, hi = 8, pa = 1 << 24, Ue = 16, pe = 32, en = 64, va = 128, Jt = 512, vt = 1024, xt = 2048, de = 4096, Lt = 8192, He = 16384, Qn = 32768, Xn = 65536, Ps = 1 << 17, ga = 1 << 18, Nn = 1 << 19, El = 1 << 20, Ze = 1 << 25, $n = 65536, Ii = 1 << 21, as = 1 << 22, Je = 1 << 23, hr = Symbol("$state"), _a = Symbol("legacy props"), on = new class extends Error { +const xt = 2, Tr = 4, xi = 8, Aa = 1 << 24, je = 16, he = 32, on = 64, Ea = 128, jt = 512, vt = 1024, bt = 2048, ce = 4096, qt = 8192, Xe = 16384, cr = 32768, ir = 65536, Ys = 1 << 17, Ra = 1 << 18, qn = 1 << 19, Rl = 1 << 20, nn = 1 << 25, Pn = 65536, Xi = 1 << 21, _s = 1 << 22, rn = 1 << 23, Er = Symbol("$state"), Ca = Symbol("legacy props"), _n = new class extends Error { constructor() { super(...arguments); - ot(this, "name", "StaleReactionError"); - ot(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + lt(this, "name", "StaleReactionError"); + lt(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } -}(), Rr = 3, tr = 8; -function Rl(t) { +}(), qr = 3, hr = 8; +function Cl(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } function Tl() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function Cl(t, e, n) { +function Nl(t, e, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function Nl(t) { +function Sl(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function Sl() { +function kl() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function kl(t) { +function Ml(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function Ml() { +function Pl() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Pl() { +function Dl() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function Ol(t) { +function Fl(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function Dl() { +function Ol() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } function Il() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function Fl() { +function Ll() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function Ll() { +function ql() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function di(t) { +function bi(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function ql() { +function Vl() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } -let Z = !1; -function ze(t) { - Z = t; +let j = !1; +function We(t) { + j = t; } -let H; -function Pt(t) { +let z; +function Ft(t) { if (t === null) - throw di(), Bn; - return H = t; + throw bi(), nr; + return z = t; } -function pi() { - return Pt(/* @__PURE__ */ ke(H)); +function $i() { + return Ft(/* @__PURE__ */ Ne(z)); } -function Ut(t) { - if (Z) { - if (/* @__PURE__ */ ke(H) !== null) - throw di(), Bn; - H = t; +function Bt(t) { + if (j) { + if (/* @__PURE__ */ Ne(z) !== null) + throw bi(), nr; + z = t; } } -function Fi(t = 1) { - if (Z) { - for (var e = t, n = H; e--; ) +function Gi(t = 1) { + if (j) { + for (var e = t, n = z; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ ke(n); - H = n; + /* @__PURE__ */ Ne(n); + z = n; } } -function Qr(t = !0) { - for (var e = 0, n = H; ; ) { - if (n.nodeType === tr) { +function li(t = !0) { + for (var e = 0, n = z; ; ) { + if (n.nodeType === hr) { var r = ( /** @type {Comment} */ n.data ); - if (r === ss) { + if (r === gs) { if (e === 0) return n; e -= 1; - } else (r === is || r === fi || // "[1", "[2", etc. for if blocks + } else (r === vs || r === yi || // "[1", "[2", etc. for if blocks r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ke(n) + /* @__PURE__ */ Ne(n) ); t && n.remove(), n = i; } } -function ma(t) { - if (!t || t.nodeType !== tr) - throw di(), Bn; +function Ta(t) { + if (!t || t.nodeType !== hr) + throw bi(), nr; return ( /** @type {Comment} */ t.data ); } -function ya(t) { +function Na(t) { return t === this.v; } -function Vl(t, e) { +function zl(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function wa(t) { - return !Vl(t, this.v); +function Sa(t) { + return !zl(t, this.v); } -let zl = !1, qt = null; -function Gn(t) { - qt = t; +let Hl = !1, Vt = null; +function sr(t) { + Vt = t; } -function os(t, e = !1, n) { - qt = { - p: qt, +function ms(t, e = !1, n) { + Vt = { + p: Vt, i: !1, c: null, e: null, @@ -163,52 +163,52 @@ function os(t, e = !1, n) { l: null }; } -function ls(t) { +function ys(t) { var e = ( /** @type {ComponentContext} */ - qt + Vt ), n = e.e; if (n !== null) { e.e = null; for (var r of n) - Ua(r); + eo(r); } - return t !== void 0 && (e.x = t), e.i = !0, qt = e.p, t ?? /** @type {T} */ + return t !== void 0 && (e.x = t), e.i = !0, Vt = e.p, t ?? /** @type {T} */ {}; } -function xa() { +function ka() { return !0; } -let ln = []; -function ba() { - var t = ln; - ln = [], $l(t); +let mn = []; +function Ma() { + var t = mn; + mn = [], Al(t); } -function yn(t) { - if (ln.length === 0 && !dr) { - var e = ln; +function Nn(t) { + if (mn.length === 0 && !Rr) { + var e = mn; queueMicrotask(() => { - e === ln && ba(); + e === mn && Ma(); }); } - ln.push(t); + mn.push(t); } -function Hl() { - for (; ln.length > 0; ) - ba(); +function Yl() { + for (; mn.length > 0; ) + Ma(); } -function $a(t) { +function Pa(t) { var e = X; if (e === null) - return z.f |= Je, t; - if ((e.f & Qn) === 0 && (e.f & vr) === 0) + return V.f |= rn, t; + if ((e.f & cr) === 0 && (e.f & Tr) === 0) throw t; - Kn(t, e); + ar(t, e); } -function Kn(t, e) { +function ar(t, e) { for (; e !== null; ) { - if ((e.f & va) !== 0) { - if ((e.f & Qn) === 0) + if ((e.f & Ea) !== 0) { + if ((e.f & cr) === 0) throw t; try { e.b.error(t); @@ -221,78 +221,78 @@ function Kn(t, e) { } throw t; } -const Yl = -7169; -function lt(t, e) { - t.f = t.f & Yl | e; +const Bl = -7169; +function ut(t, e) { + t.f = t.f & Bl | e; } -function us(t) { - (t.f & Jt) !== 0 || t.deps === null ? lt(t, vt) : lt(t, de); +function ws(t) { + (t.f & jt) !== 0 || t.deps === null ? ut(t, vt) : ut(t, ce); } -function Aa(t) { +function Da(t) { if (t !== null) for (const e of t) - (e.f & wt) === 0 || (e.f & $n) === 0 || (e.f ^= $n, Aa( + (e.f & xt) === 0 || (e.f & Pn) === 0 || (e.f ^= Pn, Da( /** @type {Derived} */ e.deps )); } -function Ea(t, e, n) { - (t.f & xt) !== 0 ? e.add(t) : (t.f & de) !== 0 && n.add(t), Aa(t.deps), lt(t, vt); +function Fa(t, e, n) { + (t.f & bt) !== 0 ? e.add(t) : (t.f & ce) !== 0 && n.add(t), Da(t.deps), ut(t, vt); } -const Mr = /* @__PURE__ */ new Set(); -let Y = null, yt = null, St = [], vi = null, Li = !1, dr = !1; -var Fn, Ln, hn, qn, xr, br, dn, Ie, Vn, Se, qi, Vi, Ra; -const Es = class Es { +const Yr = /* @__PURE__ */ new Set(); +let Y = null, wt = null, Mt = [], Ai = null, Ki = !1, Rr = !1; +var Kn, jn, bn, Zn, Dr, Fr, $n, ze, Jn, Te, ji, Zi, Oa; +const Os = class Os { constructor() { - L(this, Se); - ot(this, "committed", !1); + L(this, Te); + lt(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} */ - ot(this, "current", /* @__PURE__ */ new Map()); + lt(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} */ - ot(this, "previous", /* @__PURE__ */ new Map()); + lt(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>} */ - L(this, Fn, /* @__PURE__ */ new Set()); + L(this, Kn, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - L(this, Ln, /* @__PURE__ */ new Set()); + L(this, jn, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - L(this, hn, 0); + L(this, bn, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - L(this, qn, 0); + L(this, Zn, 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} */ - L(this, xr, null); + L(this, Dr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - L(this, br, /* @__PURE__ */ new Set()); + L(this, Fr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - L(this, dn, /* @__PURE__ */ new Set()); + L(this, $n, /* @__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`. @@ -300,19 +300,19 @@ const Es = class Es { * so they can be rescheduled if the branch survives. * @type {Map} */ - L(this, Ie, /* @__PURE__ */ new Map()); - ot(this, "is_fork", !1); - L(this, Vn, !1); + L(this, ze, /* @__PURE__ */ new Map()); + lt(this, "is_fork", !1); + L(this, Jn, !1); } is_deferred() { - return this.is_fork || d(this, qn) > 0; + return this.is_fork || d(this, Zn) > 0; } /** * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ skip_effect(e) { - d(this, Ie).has(e) || d(this, Ie).set(e, { d: [], m: [] }); + d(this, ze).has(e) || d(this, ze).set(e, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule @@ -320,13 +320,13 @@ const Es = class Es { * @param {Effect} effect */ unskip_effect(e) { - var n = d(this, Ie).get(e); + var n = d(this, ze).get(e); if (n) { - d(this, Ie).delete(e); + d(this, ze).delete(e); for (var r of n.d) - lt(r, xt), ce(r); + ut(r, bt), ue(r); for (r of n.m) - lt(r, de), ce(r); + ut(r, ce), ue(r); } } /** @@ -335,19 +335,19 @@ const Es = class Es { */ process(e) { var i; - St = [], this.apply(); + Mt = [], this.apply(); var n = [], r = []; for (const s of e) - pt(this, Se, qi).call(this, s, n, r); + pt(this, Te, ji).call(this, s, n, r); if (this.is_deferred()) { - pt(this, Se, Vi).call(this, r), pt(this, Se, Vi).call(this, n); - for (const [s, a] of d(this, Ie)) - Sa(s, a); + pt(this, Te, Zi).call(this, r), pt(this, Te, Zi).call(this, n); + for (const [s, a] of d(this, ze)) + Va(s, a); } else { - for (const s of d(this, Fn)) s(); - d(this, Fn).clear(), d(this, hn) === 0 && pt(this, Se, Ra).call(this), Y = null, Os(r), Os(n), (i = d(this, xr)) == null || i.resolve(); + for (const s of d(this, Kn)) s(); + d(this, Kn).clear(), d(this, bn) === 0 && pt(this, Te, Oa).call(this), Y = null, Bs(r), Bs(n), (i = d(this, Dr)) == null || i.resolve(); } - yt = null; + wt = null; } /** * Associate a change to a given source with the current @@ -356,63 +356,63 @@ const Es = class Es { * @param {any} value */ capture(e, n) { - n !== _t && !this.previous.has(e) && this.previous.set(e, n), (e.f & Je) === 0 && (this.current.set(e, e.v), yt == null || yt.set(e, e.v)); + n !== _t && !this.previous.has(e) && this.previous.set(e, n), (e.f & rn) === 0 && (this.current.set(e, e.v), wt == null || wt.set(e, e.v)); } activate() { Y = this, this.apply(); } deactivate() { - Y === this && (Y = null, yt = null); + Y === this && (Y = null, wt = null); } flush() { - if (this.activate(), St.length > 0) { - if (Ta(), Y !== null && Y !== this) + if (this.activate(), Mt.length > 0) { + if (Ia(), Y !== null && Y !== this) return; - } else d(this, hn) === 0 && this.process([]); + } else d(this, bn) === 0 && this.process([]); this.deactivate(); } discard() { - for (const e of d(this, Ln)) e(this); - d(this, Ln).clear(); + for (const e of d(this, jn)) e(this); + d(this, jn).clear(); } /** * * @param {boolean} blocking */ increment(e) { - O(this, hn, d(this, hn) + 1), e && O(this, qn, d(this, qn) + 1); + D(this, bn, d(this, bn) + 1), e && D(this, Zn, d(this, Zn) + 1); } /** * * @param {boolean} blocking */ decrement(e) { - O(this, hn, d(this, hn) - 1), e && O(this, qn, d(this, qn) - 1), !d(this, Vn) && (O(this, Vn, !0), yn(() => { - O(this, Vn, !1), this.is_deferred() ? St.length > 0 && this.flush() : this.revive(); + D(this, bn, d(this, bn) - 1), e && D(this, Zn, d(this, Zn) - 1), !d(this, Jn) && (D(this, Jn, !0), Nn(() => { + D(this, Jn, !1), this.is_deferred() ? Mt.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const e of d(this, br)) - d(this, dn).delete(e), lt(e, xt), ce(e); - for (const e of d(this, dn)) - lt(e, de), ce(e); + for (const e of d(this, Fr)) + d(this, $n).delete(e), ut(e, bt), ue(e); + for (const e of d(this, $n)) + ut(e, ce), ue(e); this.flush(); } /** @param {() => void} fn */ oncommit(e) { - d(this, Fn).add(e); + d(this, Kn).add(e); } /** @param {(batch: Batch) => void} fn */ ondiscard(e) { - d(this, Ln).add(e); + d(this, jn).add(e); } settled() { - return (d(this, xr) ?? O(this, xr, da())).promise; + return (d(this, Dr) ?? D(this, Dr, $a())).promise; } static ensure() { if (Y === null) { - const e = Y = new Es(); - Mr.add(Y), dr || yn(() => { + const e = Y = new Os(); + Yr.add(Y), Rr || Nn(() => { Y === e && e.flush(); }); } @@ -421,19 +421,19 @@ const Es = class Es { apply() { } }; -Fn = new WeakMap(), Ln = new WeakMap(), hn = new WeakMap(), qn = new WeakMap(), xr = new WeakMap(), br = new WeakMap(), dn = new WeakMap(), Ie = new WeakMap(), Vn = new WeakMap(), Se = new WeakSet(), /** +Kn = new WeakMap(), jn = new WeakMap(), bn = new WeakMap(), Zn = new WeakMap(), Dr = new WeakMap(), Fr = new WeakMap(), $n = new WeakMap(), ze = new WeakMap(), Jn = new WeakMap(), Te = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -qi = function(e, n, r) { +ji = function(e, n, r) { e.f ^= vt; for (var i = e.first, s = null; i !== null; ) { - var a = i.f, o = (a & (pe | en)) !== 0, l = o && (a & vt) !== 0, u = l || (a & Lt) !== 0 || d(this, Ie).has(i); + var a = i.f, o = (a & (he | on)) !== 0, l = o && (a & vt) !== 0, u = l || (a & qt) !== 0 || d(this, ze).has(i); if (!u && i.fn !== null) { - o ? i.f ^= vt : s !== null && (a & (vr | hi | pa)) !== 0 ? s.b.defer_effect(i) : (a & vr) !== 0 ? n.push(i) : Tr(i) && ((a & Ue) !== 0 && d(this, dn).add(i), jn(i)); + o ? i.f ^= vt : s !== null && (a & (Tr | xi | Aa)) !== 0 ? s.b.defer_effect(i) : (a & Tr) !== 0 ? n.push(i) : Vr(i) && ((a & je) !== 0 && d(this, $n).add(i), lr(i)); var f = i.first; if (f !== null) { i = f; @@ -447,15 +447,15 @@ qi = function(e, n, r) { }, /** * @param {Effect[]} effects */ -Vi = function(e) { +Zi = function(e) { for (var n = 0; n < e.length; n += 1) - Ea(e[n], d(this, br), d(this, dn)); -}, Ra = function() { + Fa(e[n], d(this, Fr), d(this, $n)); +}, Oa = function() { var i; - if (Mr.size > 1) { + if (Yr.size > 1) { this.previous.clear(); - var e = yt, n = !0; - for (const s of Mr) { + var e = wt, n = !0; + for (const s of Yr) { if (s === this) { n = !1; continue; @@ -473,111 +473,111 @@ Vi = function(e) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = St; - St = []; + var r = Mt; + Mt = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - Ca(f, o, l, u); - if (St.length > 0) { + La(f, o, l, u); + if (Mt.length > 0) { Y = s, s.apply(); - for (const f of St) - pt(i = s, Se, qi).call(i, f, [], []); + for (const f of Mt) + pt(i = s, Te, ji).call(i, f, [], []); s.deactivate(); } - St = r; + Mt = r; } } - Y = null, yt = e; + Y = null, wt = e; } - this.committed = !0, Mr.delete(this); + this.committed = !0, Yr.delete(this); }; -let Ye = Es; -function jt(t) { - var e = dr; - dr = !0; +let Ge = Os; +function mt(t) { + var e = Rr; + Rr = !0; try { for (var n; ; ) { - if (Hl(), St.length === 0 && (Y == null || Y.flush(), St.length === 0)) - return vi = null, /** @type {T} */ + if (Yl(), Mt.length === 0 && (Y == null || Y.flush(), Mt.length === 0)) + return Ai = null, /** @type {T} */ n; - Ta(); + Ia(); } } finally { - dr = e; + Rr = e; } } -function Ta() { - Li = !0; +function Ia() { + Ki = !0; var t = null; try { - for (var e = 0; St.length > 0; ) { - var n = Ye.ensure(); + for (var e = 0; Mt.length > 0; ) { + var n = Ge.ensure(); if (e++ > 1e3) { var r, i; - Bl(); + Ul(); } - n.process(St), Qe.clear(); + n.process(Mt), sn.clear(); } } finally { - St = [], Li = !1, vi = null; + Mt = [], Ki = !1, Ai = null; } } -function Bl() { +function Ul() { try { - Ml(); + Pl(); } catch (t) { - Kn(t, vi); + ar(t, Ai); } } -let oe = null; -function Os(t) { +let se = null; +function Bs(t) { var e = t.length; if (e !== 0) { for (var n = 0; n < e; ) { var r = t[n++]; - if ((r.f & (He | Lt)) === 0 && Tr(r) && (oe = /* @__PURE__ */ new Set(), jn(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Ka(r), (oe == null ? void 0 : oe.size) > 0)) { - Qe.clear(); - for (const i of oe) { - if ((i.f & (He | Lt)) !== 0) continue; + if ((r.f & (Xe | qt)) === 0 && Vr(r) && (se = /* @__PURE__ */ new Set(), lr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && io(r), (se == null ? void 0 : se.size) > 0)) { + sn.clear(); + for (const i of se) { + if ((i.f & (Xe | qt)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - oe.has(a) && (oe.delete(a), s.push(a)), a = a.parent; + se.has(a) && (se.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (He | Lt)) === 0 && jn(l); + (l.f & (Xe | qt)) === 0 && lr(l); } } - oe.clear(); + se.clear(); } } - oe = null; + se = null; } } -function Ca(t, e, n, r) { +function La(t, e, n, r) { if (!n.has(t) && (n.add(t), t.reactions !== null)) for (const i of t.reactions) { const s = i.f; - (s & wt) !== 0 ? Ca( + (s & xt) !== 0 ? La( /** @type {Derived} */ i, e, n, r - ) : (s & (as | Ue)) !== 0 && (s & xt) === 0 && Na(i, e, r) && (lt(i, xt), ce( + ) : (s & (_s | je)) !== 0 && (s & bt) === 0 && qa(i, e, r) && (ut(i, bt), ue( /** @type {Effect} */ i )); } } -function Na(t, e, n) { +function qa(t, e, n) { const r = n.get(t); if (r !== void 0) return r; if (t.deps !== null) for (const i of t.deps) { - if (Un.call(e, i)) + if (rr.call(e, i)) return !0; - if ((i.f & wt) !== 0 && Na( + if ((i.f & xt) !== 0 && qa( /** @type {Derived} */ i, e, @@ -591,41 +591,41 @@ function Na(t, e, n) { } return n.set(t, !1), !1; } -function ce(t) { - for (var e = vi = t; e.parent !== null; ) { +function ue(t) { + for (var e = Ai = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (Li && e === X && (n & Ue) !== 0 && (n & ga) === 0) + if (Ki && e === X && (n & je) !== 0 && (n & Ra) === 0) return; - if ((n & (en | pe)) !== 0) { + if ((n & (on | he)) !== 0) { if ((n & vt) === 0) return; e.f ^= vt; } } - St.push(e); + Mt.push(e); } -function Sa(t, e) { - if (!((t.f & pe) !== 0 && (t.f & vt) !== 0)) { - (t.f & xt) !== 0 ? e.d.push(t) : (t.f & de) !== 0 && e.m.push(t), lt(t, vt); +function Va(t, e) { + if (!((t.f & he) !== 0 && (t.f & vt) !== 0)) { + (t.f & bt) !== 0 ? e.d.push(t) : (t.f & ce) !== 0 && e.m.push(t), ut(t, vt); for (var n = t.first; n !== null; ) - Sa(n, e), n = n.next; + Va(n, e), n = n.next; } } -function Ul(t) { - let e = 0, n = An(0), r; +function Wl(t) { + let e = 0, n = Dn(0), r; return () => { - hs() && (w(n), ps(() => (e === 0 && (r = mi(() => t(() => pr(n)))), e += 1, () => { - yn(() => { - e -= 1, e === 0 && (r == null || r(), r = void 0, pr(n)); + $s() && (w(n), Es(() => (e === 0 && (r = Ci(() => t(() => Cr(n)))), e += 1, () => { + Nn(() => { + e -= 1, e === 0 && (r == null || r(), r = void 0, Cr(n)); }); }))); }; } -var Xl = Xn | Nn | va; +var Xl = ir | qn | Ea; function Gl(t, e, n) { new Kl(t, e, n); } -var It, $r, $e, pn, Ae, Kt, Nt, Ee, Fe, je, vn, Le, zn, gn, Hn, Yn, qe, li, ht, ka, Ma, zi, zr, Hr, Hi; +var It, Or, xe, An, be, Xt, kt, $e, He, en, En, Ye, Qn, Rn, tr, er, Be, _i, ct, za, Ha, Ji, jr, Zr, Qi; class Kl { /** * @param {TemplateNode} node @@ -633,38 +633,38 @@ class Kl { * @param {((anchor: Node) => void)} children */ constructor(e, n, r) { - L(this, ht); + L(this, ct); /** @type {Boundary | null} */ - ot(this, "parent"); - ot(this, "is_pending", !1); + lt(this, "parent"); + lt(this, "is_pending", !1); /** @type {TemplateNode} */ L(this, It); /** @type {TemplateNode | null} */ - L(this, $r, Z ? H : null); + L(this, Or, j ? z : null); /** @type {BoundaryProps} */ - L(this, $e); + L(this, xe); /** @type {((anchor: Node) => void)} */ - L(this, pn); + L(this, An); /** @type {Effect} */ - L(this, Ae); + L(this, be); /** @type {Effect | null} */ - L(this, Kt, null); + L(this, Xt, null); /** @type {Effect | null} */ - L(this, Nt, null); + L(this, kt, null); /** @type {Effect | null} */ - L(this, Ee, null); + L(this, $e, null); /** @type {DocumentFragment | null} */ - L(this, Fe, null); + L(this, He, null); /** @type {TemplateNode | null} */ - L(this, je, null); - L(this, vn, 0); - L(this, Le, 0); - L(this, zn, !1); - L(this, gn, !1); + L(this, en, null); + L(this, En, 0); + L(this, Ye, 0); + L(this, Qn, !1); + L(this, Rn, !1); /** @type {Set} */ - L(this, Hn, /* @__PURE__ */ new Set()); + L(this, tr, /* @__PURE__ */ new Set()); /** @type {Set} */ - L(this, Yn, /* @__PURE__ */ new Set()); + L(this, er, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -672,38 +672,38 @@ class Kl { * calls followed by no-op flushes * @type {Source | null} */ - L(this, qe, null); - L(this, li, Ul(() => (O(this, qe, An(d(this, vn))), () => { - O(this, qe, null); + L(this, Be, null); + L(this, _i, Wl(() => (D(this, Be, Dn(d(this, En))), () => { + D(this, Be, null); }))); - O(this, It, e), O(this, $e, n), O(this, pn, r), this.parent = /** @type {Effect} */ - X.b, this.is_pending = !!d(this, $e).pending, O(this, Ae, vs(() => { - if (X.b = this, Z) { - const s = d(this, $r); - pi(), /** @type {Comment} */ - s.nodeType === tr && /** @type {Comment} */ - s.data === fi ? pt(this, ht, Ma).call(this) : (pt(this, ht, ka).call(this), d(this, Le) === 0 && (this.is_pending = !1)); + D(this, It, e), D(this, xe, n), D(this, An, r), this.parent = /** @type {Effect} */ + X.b, this.is_pending = !!d(this, xe).pending, D(this, be, Rs(() => { + if (X.b = this, j) { + const s = d(this, Or); + $i(), /** @type {Comment} */ + s.nodeType === hr && /** @type {Comment} */ + s.data === yi ? pt(this, ct, Ha).call(this) : (pt(this, ct, za).call(this), d(this, Ye) === 0 && (this.is_pending = !1)); } else { - var i = pt(this, ht, zi).call(this); + var i = pt(this, ct, Ji).call(this); try { - O(this, Kt, Zt(() => r(i))); + D(this, Xt, Kt(() => r(i))); } catch (s) { this.error(s); } - d(this, Le) > 0 ? pt(this, ht, Hr).call(this) : this.is_pending = !1; + d(this, Ye) > 0 ? pt(this, ct, Zr).call(this) : this.is_pending = !1; } return () => { var s; - (s = d(this, je)) == null || s.remove(); + (s = d(this, en)) == null || s.remove(); }; - }, Xl)), Z && O(this, It, H); + }, Xl)), j && D(this, It, z); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ defer_effect(e) { - Ea(e, d(this, Hn), d(this, Yn)); + Fa(e, d(this, tr), d(this, er)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -713,7 +713,7 @@ class Kl { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!d(this, $e).pending; + return !!d(this, xe).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -722,46 +722,46 @@ class Kl { * @param {1 | -1} d */ update_pending_count(e) { - pt(this, ht, Hi).call(this, e), O(this, vn, d(this, vn) + e), !(!d(this, qe) || d(this, zn)) && (O(this, zn, !0), yn(() => { - O(this, zn, !1), d(this, qe) && Wn(d(this, qe), d(this, vn)); + pt(this, ct, Qi).call(this, e), D(this, En, d(this, En) + e), !(!d(this, Be) || d(this, Qn)) && (D(this, Qn, !0), Nn(() => { + D(this, Qn, !1), d(this, Be) && or(d(this, Be), d(this, En)); })); } get_effect_pending() { - return d(this, li).call(this), w( + return d(this, _i).call(this), w( /** @type {Source} */ - d(this, qe) + d(this, Be) ); } /** @param {unknown} error */ error(e) { - var n = d(this, $e).onerror; - let r = d(this, $e).failed; - if (d(this, gn) || !n && !r) + var n = d(this, xe).onerror; + let r = d(this, xe).failed; + if (d(this, Rn) || !n && !r) throw e; - d(this, Kt) && (Rt(d(this, Kt)), O(this, Kt, null)), d(this, Nt) && (Rt(d(this, Nt)), O(this, Nt, null)), d(this, Ee) && (Rt(d(this, Ee)), O(this, Ee, null)), Z && (Pt( + d(this, Xt) && (Tt(d(this, Xt)), D(this, Xt, null)), d(this, kt) && (Tt(d(this, kt)), D(this, kt, null)), d(this, $e) && (Tt(d(this, $e)), D(this, $e, null)), j && (Ft( /** @type {TemplateNode} */ - d(this, $r) - ), Fi(), Pt(Qr())); + d(this, Or) + ), Gi(), Ft(li())); var i = !1, s = !1; const a = () => { if (i) { - ql(); + Vl(); return; } - i = !0, s && Ll(), Ye.ensure(), O(this, vn, 0), d(this, Ee) !== null && wn(d(this, Ee), () => { - O(this, Ee, null); - }), this.is_pending = this.has_pending_snippet(), O(this, Kt, pt(this, ht, zr).call(this, () => (O(this, gn, !1), Zt(() => d(this, pn).call(this, d(this, It)))))), d(this, Le) > 0 ? pt(this, ht, Hr).call(this) : this.is_pending = !1; + i = !0, s && ql(), Ge.ensure(), D(this, En, 0), d(this, $e) !== null && Sn(d(this, $e), () => { + D(this, $e, null); + }), this.is_pending = this.has_pending_snippet(), D(this, Xt, pt(this, ct, jr).call(this, () => (D(this, Rn, !1), Kt(() => d(this, An).call(this, d(this, It)))))), d(this, Ye) > 0 ? pt(this, ct, Zr).call(this) : this.is_pending = !1; }; - yn(() => { + Nn(() => { try { s = !0, n == null || n(e, a), s = !1; } catch (o) { - Kn(o, d(this, Ae) && d(this, Ae).parent); + ar(o, d(this, be) && d(this, be).parent); } - r && O(this, Ee, pt(this, ht, zr).call(this, () => { - Ye.ensure(), O(this, gn, !0); + r && D(this, $e, pt(this, ct, jr).call(this, () => { + Ge.ensure(), D(this, Rn, !0); try { - return Zt(() => { + return Kt(() => { r( d(this, It), () => e, @@ -769,85 +769,85 @@ class Kl { ); }); } catch (o) { - return Kn( + return ar( o, /** @type {Effect} */ - d(this, Ae).parent + d(this, be).parent ), null; } finally { - O(this, gn, !1); + D(this, Rn, !1); } })); }); } } -It = new WeakMap(), $r = new WeakMap(), $e = new WeakMap(), pn = new WeakMap(), Ae = new WeakMap(), Kt = new WeakMap(), Nt = new WeakMap(), Ee = new WeakMap(), Fe = new WeakMap(), je = new WeakMap(), vn = new WeakMap(), Le = new WeakMap(), zn = new WeakMap(), gn = new WeakMap(), Hn = new WeakMap(), Yn = new WeakMap(), qe = new WeakMap(), li = new WeakMap(), ht = new WeakSet(), ka = function() { +It = new WeakMap(), Or = new WeakMap(), xe = new WeakMap(), An = new WeakMap(), be = new WeakMap(), Xt = new WeakMap(), kt = new WeakMap(), $e = new WeakMap(), He = new WeakMap(), en = new WeakMap(), En = new WeakMap(), Ye = new WeakMap(), Qn = new WeakMap(), Rn = new WeakMap(), tr = new WeakMap(), er = new WeakMap(), Be = new WeakMap(), _i = new WeakMap(), ct = new WeakSet(), za = function() { try { - O(this, Kt, Zt(() => d(this, pn).call(this, d(this, It)))); + D(this, Xt, Kt(() => d(this, An).call(this, d(this, It)))); } catch (e) { this.error(e); } -}, Ma = function() { - const e = d(this, $e).pending; - e && (O(this, Nt, Zt(() => e(d(this, It)))), yn(() => { - var n = pt(this, ht, zi).call(this); - O(this, Kt, pt(this, ht, zr).call(this, () => (Ye.ensure(), Zt(() => d(this, pn).call(this, n))))), d(this, Le) > 0 ? pt(this, ht, Hr).call(this) : (wn( +}, Ha = function() { + const e = d(this, xe).pending; + e && (D(this, kt, Kt(() => e(d(this, It)))), Nn(() => { + var n = pt(this, ct, Ji).call(this); + D(this, Xt, pt(this, ct, jr).call(this, () => (Ge.ensure(), Kt(() => d(this, An).call(this, n))))), d(this, Ye) > 0 ? pt(this, ct, Zr).call(this) : (Sn( /** @type {Effect} */ - d(this, Nt), + d(this, kt), () => { - O(this, Nt, null); + D(this, kt, null); } ), this.is_pending = !1); })); -}, zi = function() { +}, Ji = function() { var e = d(this, It); - return this.is_pending && (O(this, je, te()), d(this, It).before(d(this, je)), e = d(this, je)), e; + return this.is_pending && (D(this, en, Jt()), d(this, It).before(d(this, en)), e = d(this, en)), e; }, /** * @param {() => Effect | null} fn */ -zr = function(e) { - var n = X, r = z, i = qt; - Ne(d(this, Ae)), ee(d(this, Ae)), Gn(d(this, Ae).ctx); +jr = function(e) { + var n = X, r = V, i = Vt; + Ce(d(this, be)), Qt(d(this, be)), sr(d(this, be).ctx); try { return e(); } catch (s) { - return $a(s), null; + return Pa(s), null; } finally { - Ne(n), ee(r), Gn(i); + Ce(n), Qt(r), sr(i); } -}, Hr = function() { +}, Zr = function() { const e = ( /** @type {(anchor: Node) => void} */ - d(this, $e).pending + d(this, xe).pending ); - d(this, Kt) !== null && (O(this, Fe, document.createDocumentFragment()), d(this, Fe).append( + d(this, Xt) !== null && (D(this, He, document.createDocumentFragment()), d(this, He).append( /** @type {TemplateNode} */ - d(this, je) - ), Za(d(this, Kt), d(this, Fe))), d(this, Nt) === null && O(this, Nt, Zt(() => e(d(this, It)))); + d(this, en) + ), oo(d(this, Xt), d(this, He))), d(this, kt) === null && D(this, kt, Kt(() => e(d(this, It)))); }, /** * 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 * @param {1 | -1} d */ -Hi = function(e) { +Qi = function(e) { var n; if (!this.has_pending_snippet()) { - this.parent && pt(n = this.parent, ht, Hi).call(n, e); + this.parent && pt(n = this.parent, ct, Qi).call(n, e); return; } - if (O(this, Le, d(this, Le) + e), d(this, Le) === 0) { + if (D(this, Ye, d(this, Ye) + e), d(this, Ye) === 0) { this.is_pending = !1; - for (const r of d(this, Hn)) - lt(r, xt), ce(r); - for (const r of d(this, Yn)) - lt(r, de), ce(r); - d(this, Hn).clear(), d(this, Yn).clear(), d(this, Nt) && wn(d(this, Nt), () => { - O(this, Nt, null); - }), d(this, Fe) && (d(this, It).before(d(this, Fe)), O(this, Fe, null)); + for (const r of d(this, tr)) + ut(r, bt), ue(r); + for (const r of d(this, er)) + ut(r, ce), ue(r); + d(this, tr).clear(), d(this, er).clear(), d(this, kt) && Sn(d(this, kt), () => { + D(this, kt, null); + }), d(this, He) && (d(this, It).before(d(this, He)), D(this, He, null)); } }; -function Wl(t, e, n, r) { - const i = gi; +function jl(t, e, n, r) { + const i = Ei; var s = t.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { r(e.map(i)); @@ -856,45 +856,45 @@ function Wl(t, e, n, r) { var a = Y, o = ( /** @type {Effect} */ X - ), l = jl(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + ), l = Zl(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; function f(c) { l(); try { r(c); } catch (v) { - (o.f & He) === 0 && Kn(v, o); + (o.f & Xe) === 0 && ar(v, o); } - a == null || a.deactivate(), Yi(); + a == null || a.deactivate(), ts(); } if (n.length === 0) { u.then(() => f(e.map(i))); return; } function h() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ Zl(c))).then((c) => f([...e.map(i), ...c])).catch((c) => Kn(c, o)); + l(), Promise.all(n.map((c) => /* @__PURE__ */ Jl(c))).then((c) => f([...e.map(i), ...c])).catch((c) => ar(c, o)); } u ? u.then(h) : h(); } -function jl() { - var t = X, e = z, n = qt, r = Y; +function Zl() { + var t = X, e = V, n = Vt, r = Y; return function(s = !0) { - Ne(t), ee(e), Gn(n), s && (r == null || r.activate()); + Ce(t), Qt(e), sr(n), s && (r == null || r.activate()); }; } -function Yi() { - Ne(null), ee(null), Gn(null); +function ts() { + Ce(null), Qt(null), sr(null); } // @__NO_SIDE_EFFECTS__ -function gi(t) { - var e = wt | xt, n = z !== null && (z.f & wt) !== 0 ? ( +function Ei(t) { + var e = xt | bt, n = V !== null && (V.f & xt) !== 0 ? ( /** @type {Derived} */ - z + V ) : null; - return X !== null && (X.f |= Nn), { - ctx: qt, + return X !== null && (X.f |= qn), { + ctx: Vt, deps: null, effects: null, - equals: ya, + equals: Na, f: e, fn: t, reactions: null, @@ -909,7 +909,7 @@ function gi(t) { }; } // @__NO_SIDE_EFFECTS__ -function Zl(t, e, n) { +function Jl(t, e, n) { let r = ( /** @type {Effect | null} */ X @@ -922,20 +922,20 @@ function Zl(t, e, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = An( + ), a = Dn( /** @type {V} */ _t - ), o = !z, l = /* @__PURE__ */ new Map(); - return ou(() => { + ), o = !V, l = /* @__PURE__ */ new Map(); + return lu(() => { var v; - var u = da(); + var u = $a(); s = u.promise; try { Promise.resolve(t()).then(u.resolve, u.reject).then(() => { - f === Y && f.committed && f.deactivate(), Yi(); + f === Y && f.committed && f.deactivate(), ts(); }); } catch (g) { - u.reject(g), Yi(); + u.reject(g), ts(); } var f = ( /** @type {Batch} */ @@ -943,24 +943,24 @@ function Zl(t, e, n) { ); if (o) { var h = i.is_rendered(); - i.update_pending_count(1), f.increment(h), (v = l.get(f)) == null || v.reject(on), l.delete(f), l.set(f, u); + i.update_pending_count(1), f.increment(h), (v = l.get(f)) == null || v.reject(_n), l.delete(f), l.set(f, u); } const c = (g, m = void 0) => { if (f.activate(), m) - m !== on && (a.f |= Je, Wn(a, m)); + m !== _n && (a.f |= rn, or(a, m)); else { - (a.f & Je) !== 0 && (a.f ^= Je), Wn(a, g); - for (const [b, A] of l) { + (a.f & rn) !== 0 && (a.f ^= rn), or(a, g); + for (const [b, $] of l) { if (l.delete(b), b === f) break; - A.reject(on); + $.reject(_n); } } o && (i.update_pending_count(-1), f.decrement(h)); }; u.promise.then(c, (g) => c(null, g || "unknown")); - }), iu(() => { + }), su(() => { for (const u of l.values()) - u.reject(on); + u.reject(_n); }), new Promise((u) => { function f(h) { function c() { @@ -972,30 +972,30 @@ function Zl(t, e, n) { }); } // @__NO_SIDE_EFFECTS__ -function sr(t) { - const e = /* @__PURE__ */ gi(t); - return Ja(e), e; +function Bn(t) { + const e = /* @__PURE__ */ Ei(t); + return lo(e), e; } // @__NO_SIDE_EFFECTS__ -function Pa(t) { - const e = /* @__PURE__ */ gi(t); - return e.equals = wa, e; +function Ya(t) { + const e = /* @__PURE__ */ Ei(t); + return e.equals = Sa, e; } -function Jl(t) { +function Ql(t) { var e = t.effects; if (e !== null) { t.effects = null; for (var n = 0; n < e.length; n += 1) - Rt( + Tt( /** @type {Effect} */ e[n] ); } } -function Ql(t) { +function tu(t) { for (var e = t.parent; e !== null; ) { - if ((e.f & wt) === 0) - return (e.f & He) === 0 ? ( + if ((e.f & xt) === 0) + return (e.f & Xe) === 0 ? ( /** @type {Effect} */ e ) : null; @@ -1003,127 +1003,127 @@ function Ql(t) { } return null; } -function fs(t) { +function xs(t) { var e, n = X; - Ne(Ql(t)); + Ce(tu(t)); try { - t.f &= ~$n, Jl(t), e = no(t); + t.f &= ~Pn, Ql(t), e = ho(t); } finally { - Ne(n); + Ce(n); } return e; } -function Oa(t) { - var e = fs(t); - if (!t.equals(e) && (t.wv = to(), (!(Y != null && Y.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { - lt(t, vt); +function Ba(t) { + var e = xs(t); + if (!t.equals(e) && (t.wv = fo(), (!(Y != null && Y.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { + ut(t, vt); return; } - tn || (yt !== null ? (hs() || Y != null && Y.is_fork) && yt.set(t, e) : us(t)); + an || (wt !== null ? ($s() || Y != null && Y.is_fork) && wt.set(t, e) : ws(t)); } -function tu(t) { +function eu(t) { var e, n; if (t.effects !== null) for (const r of t.effects) - (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(on), r.teardown = bl, r.ac = null, gr(r, 0), gs(r)); + (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(_n), r.teardown = $l, r.ac = null, Nr(r, 0), Cs(r)); } -function Da(t) { +function Ua(t) { if (t.effects !== null) for (const e of t.effects) - e.teardown && jn(e); + e.teardown && lr(e); } -let Bi = /* @__PURE__ */ new Set(); -const Qe = /* @__PURE__ */ new Map(); -let Ia = !1; -function An(t, e) { +let es = /* @__PURE__ */ new Set(); +const sn = /* @__PURE__ */ new Map(); +let Wa = !1; +function Dn(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: t, reactions: null, - equals: ya, + equals: Na, rv: 0, wv: 0 }; return n; } // @__NO_SIDE_EFFECTS__ -function mt(t, e) { - const n = An(t); - return Ja(n), n; +function yt(t, e) { + const n = Dn(t); + return lo(n), n; } // @__NO_SIDE_EFFECTS__ -function Fa(t, e = !1, n = !0) { - const r = An(t); - return e || (r.equals = wa), r; +function Xa(t, e = !1, n = !0) { + const r = Dn(t); + return e || (r.equals = Sa), r; } -function J(t, e, n = !1) { - z !== null && // since we are untracking the function inside `$inspect.with` we need to add this check +function Q(t, e, n = !1) { + V !== 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 - (!he || (z.f & Ps) !== 0) && xa() && (z.f & (wt | Ue | as | Ps)) !== 0 && (Qt === null || !Un.call(Qt, t)) && Fl(); - let r = n ? un(e) : e; - return Wn(t, r); + (!fe || (V.f & Ys) !== 0) && ka() && (V.f & (xt | je | _s | Ys)) !== 0 && (Zt === null || !rr.call(Zt, t)) && Ll(); + let r = n ? yn(e) : e; + return or(t, r); } -function Wn(t, e) { +function or(t, e) { if (!t.equals(e)) { var n = t.v; - tn ? Qe.set(t, e) : Qe.set(t, n), t.v = e; - var r = Ye.ensure(); - if (r.capture(t, n), (t.f & wt) !== 0) { + an ? sn.set(t, e) : sn.set(t, n), t.v = e; + var r = Ge.ensure(); + if (r.capture(t, n), (t.f & xt) !== 0) { const i = ( /** @type {Derived} */ t ); - (t.f & xt) !== 0 && fs(i), us(i); + (t.f & bt) !== 0 && xs(i), ws(i); } - t.wv = to(), La(t, xt), X !== null && (X.f & vt) !== 0 && (X.f & (pe | en)) === 0 && (Gt === null ? fu([t]) : Gt.push(t)), !r.is_fork && Bi.size > 0 && !Ia && eu(); + t.wv = fo(), Ga(t, bt), X !== null && (X.f & vt) !== 0 && (X.f & (he | on)) === 0 && (Wt === null ? cu([t]) : Wt.push(t)), !r.is_fork && es.size > 0 && !Wa && nu(); } return e; } -function eu() { - Ia = !1; - for (const t of Bi) - (t.f & vt) !== 0 && lt(t, de), Tr(t) && jn(t); - Bi.clear(); +function nu() { + Wa = !1; + for (const t of es) + (t.f & vt) !== 0 && ut(t, ce), Vr(t) && lr(t); + es.clear(); } -function pr(t) { - J(t, t.v + 1); +function Cr(t) { + Q(t, t.v + 1); } -function La(t, e) { +function Ga(t, e) { var n = t.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & xt) === 0; - if (o && lt(s, e), (a & wt) !== 0) { + var s = n[i], a = s.f, o = (a & bt) === 0; + if (o && ut(s, e), (a & xt) !== 0) { var l = ( /** @type {Derived} */ s ); - yt == null || yt.delete(l), (a & $n) === 0 && (a & Jt && (s.f |= $n), La(l, de)); - } else o && ((a & Ue) !== 0 && oe !== null && oe.add( + wt == null || wt.delete(l), (a & Pn) === 0 && (a & jt && (s.f |= Pn), Ga(l, ce)); + } else o && ((a & je) !== 0 && se !== null && se.add( /** @type {Effect} */ s - ), ce( + ), ue( /** @type {Effect} */ s )); } } -function un(t) { - if (typeof t != "object" || t === null || hr in t) +function yn(t) { + if (typeof t != "object" || t === null || Er in t) return t; - const e = xl(t); - if (e !== yl && e !== wl) + const e = bl(t); + if (e !== wl && e !== xl) return t; - var n = /* @__PURE__ */ new Map(), r = ha(t), i = /* @__PURE__ */ mt(0), s = xn, a = (o) => { - if (xn === s) + var n = /* @__PURE__ */ new Map(), r = ba(t), i = /* @__PURE__ */ yt(0), s = kn, a = (o) => { + if (kn === s) return o(); - var l = z, u = xn; - ee(null), Fs(s); + var l = V, u = kn; + Qt(null), Xs(s); var f = o(); - return ee(l), Fs(u), f; + return Qt(l), Xs(u), f; }; - return r && n.set("length", /* @__PURE__ */ mt( + return r && n.set("length", /* @__PURE__ */ yt( /** @type {any[]} */ t.length )), new Proxy( @@ -1131,31 +1131,31 @@ function un(t) { t, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Dl(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ol(); var f = n.get(l); return f === void 0 ? a(() => { - var h = /* @__PURE__ */ mt(u.value); + var h = /* @__PURE__ */ yt(u.value); return n.set(l, h), h; - }) : J(f, u.value, !0), !0; + }) : Q(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__ */ mt(_t)); - n.set(l, f), pr(i); + const f = a(() => /* @__PURE__ */ yt(_t)); + n.set(l, f), Cr(i); } } else - J(u, _t), pr(i); + Q(u, _t), Cr(i); return !0; }, get(o, l, u) { var v; - if (l === hr) + if (l === Er) return t; var f = n.get(l), h = l in o; - if (f === void 0 && (!h || (v = mn(o, l)) != null && v.writable) && (f = a(() => { - var g = un(h ? o[l] : _t), m = /* @__PURE__ */ mt(g); + if (f === void 0 && (!h || (v = Tn(o, l)) != null && v.writable) && (f = a(() => { + var g = yn(h ? o[l] : _t), m = /* @__PURE__ */ yt(g); return m; }), n.set(l, f)), f !== void 0) { var c = w(f); @@ -1182,12 +1182,12 @@ function un(t) { }, has(o, l) { var c; - if (l === hr) + if (l === Er) return !0; var u = n.get(l), f = u !== void 0 && u.v !== _t || Reflect.has(o, l); - if (u !== void 0 || X !== null && (!f || (c = mn(o, l)) != null && c.writable)) { + if (u !== void 0 || X !== null && (!f || (c = Tn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { - var v = f ? un(o[l]) : _t, g = /* @__PURE__ */ mt(v); + var v = f ? yn(o[l]) : _t, g = /* @__PURE__ */ yt(v); return g; }), n.set(l, u)); var h = w(u); @@ -1203,25 +1203,25 @@ function un(t) { for (var v = u; v < /** @type {Source} */ h.v; v += 1) { var g = n.get(v + ""); - g !== void 0 ? J(g, _t) : v in o && (g = a(() => /* @__PURE__ */ mt(_t)), n.set(v + "", g)); + g !== void 0 ? Q(g, _t) : v in o && (g = a(() => /* @__PURE__ */ yt(_t)), n.set(v + "", g)); } if (h === void 0) - (!c || (T = mn(o, l)) != null && T.writable) && (h = a(() => /* @__PURE__ */ mt(void 0)), J(h, un(u)), n.set(l, h)); + (!c || (T = Tn(o, l)) != null && T.writable) && (h = a(() => /* @__PURE__ */ yt(void 0)), Q(h, yn(u)), n.set(l, h)); else { c = h.v !== _t; - var m = a(() => un(u)); - J(h, m); + var m = a(() => yn(u)); + Q(h, m); } var b = Reflect.getOwnPropertyDescriptor(o, l); if (b != null && b.set && b.set.call(f, u), !c) { if (r && typeof l == "string") { - var A = ( + var $ = ( /** @type {Source} */ n.get("length") - ), S = Number(l); - Number.isInteger(S) && S >= A.v && J(A, S + 1); + ), C = Number(l); + Number.isInteger(C) && C >= $.v && Q($, C + 1); } - pr(i); + Cr(i); } return !0; }, @@ -1241,129 +1241,129 @@ function un(t) { } ); } -var Ds, qa, Va, za; -function Ui() { - if (Ds === void 0) { - Ds = window, qa = /Firefox/.test(navigator.userAgent); +var Us, Ka, ja, Za; +function ns() { + if (Us === void 0) { + Us = window, Ka = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype, n = Text.prototype; - Va = mn(e, "firstChild").get, za = mn(e, "nextSibling").get, Ms(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Ms(n) && (n.__t = void 0); + ja = Tn(e, "firstChild").get, Za = Tn(e, "nextSibling").get, Hs(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Hs(n) && (n.__t = void 0); } } -function te(t = "") { +function Jt(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function En(t) { +function Fn(t) { return ( /** @type {TemplateNode | null} */ - Va.call(t) + ja.call(t) ); } // @__NO_SIDE_EFFECTS__ -function ke(t) { +function Ne(t) { return ( /** @type {TemplateNode | null} */ - za.call(t) + Za.call(t) ); } -function Xt(t, e) { - if (!Z) - return /* @__PURE__ */ En(t); - var n = /* @__PURE__ */ En(H); +function Ut(t, e) { + if (!j) + return /* @__PURE__ */ Fn(t); + var n = /* @__PURE__ */ Fn(z); if (n === null) - n = H.appendChild(te()); - else if (e && n.nodeType !== Rr) { - var r = te(); - return n == null || n.before(r), Pt(r), r; + n = z.appendChild(Jt()); + else if (e && n.nodeType !== qr) { + var r = Jt(); + return n == null || n.before(r), Ft(r), r; } - return e && _i( + return e && Ri( /** @type {Text} */ n - ), Pt(n), n; + ), Ft(n), n; } -function Mn(t, e = !1) { - if (!Z) { - var n = /* @__PURE__ */ En(t); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ke(n) : n; +function dn(t, e = !1) { + if (!j) { + var n = /* @__PURE__ */ Fn(t); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ne(n) : n; } if (e) { - if ((H == null ? void 0 : H.nodeType) !== Rr) { - var r = te(); - return H == null || H.before(r), Pt(r), r; + if ((z == null ? void 0 : z.nodeType) !== qr) { + var r = Jt(); + return z == null || z.before(r), Ft(r), r; } - _i( + Ri( /** @type {Text} */ - H + z ); } - return H; + return z; } -function ae(t, e = 1, n = !1) { - let r = Z ? H : t; +function ie(t, e = 1, n = !1) { + let r = j ? z : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ ke(r); - if (!Z) + /* @__PURE__ */ Ne(r); + if (!j) return r; if (n) { - if ((r == null ? void 0 : r.nodeType) !== Rr) { - var s = te(); - return r === null ? i == null || i.after(s) : r.before(s), Pt(s), s; + if ((r == null ? void 0 : r.nodeType) !== qr) { + var s = Jt(); + return r === null ? i == null || i.after(s) : r.before(s), Ft(s), s; } - _i( + Ri( /** @type {Text} */ r ); } - return Pt(r), r; + return Ft(r), r; } -function Ha(t) { +function Ja(t) { t.textContent = ""; } -function Ya() { +function Qa() { return !1; } -function cs(t, e, n) { +function bs(t, e, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(_l, t, void 0) + document.createElementNS(ml, t, void 0) ); } -function _i(t) { +function Ri(t) { if ( /** @type {string} */ t.nodeValue.length < 65536 ) return; let e = t.nextSibling; - for (; e !== null && e.nodeType === Rr; ) + for (; e !== null && e.nodeType === qr; ) e.remove(), t.nodeValue += /** @type {string} */ e.nodeValue, e = t.nextSibling; } -function Ba(t) { - var e = z, n = X; - ee(null), Ne(null); +function to(t) { + var e = V, n = X; + Qt(null), Ce(null); try { return t(); } finally { - ee(e), Ne(n); + Qt(e), Ce(n); } } -function nu(t) { - X === null && (z === null && kl(), Sl()), tn && Nl(); +function ru(t) { + X === null && (V === null && Ml(), kl()), an && Sl(); } -function ru(t, e) { +function iu(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function Me(t, e, n) { +function Se(t, e, n) { var r = X; - r !== null && (r.f & Lt) !== 0 && (t |= Lt); + r !== null && (r.f & qt) !== 0 && (t |= qt); var i = { - ctx: qt, + ctx: Vt, deps: null, nodes: null, - f: t | xt | Jt, + f: t | bt | jt, first: null, fn: e, last: null, @@ -1377,143 +1377,143 @@ function Me(t, e, n) { }; if (n) try { - jn(i); + lr(i); } catch (o) { - throw Rt(i), o; + throw Tt(i), o; } - else e !== null && ce(i); + else e !== null && ue(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 & Nn) === 0 && (s = s.first, (t & Ue) !== 0 && (t & Xn) !== 0 && s !== null && (s.f |= Xn)), s !== null && (s.parent = r, r !== null && ru(s, r), z !== null && (z.f & wt) !== 0 && (t & en) === 0)) { + (s.f & qn) === 0 && (s = s.first, (t & je) !== 0 && (t & ir) !== 0 && s !== null && (s.f |= ir)), s !== null && (s.parent = r, r !== null && iu(s, r), V !== null && (V.f & xt) !== 0 && (t & on) === 0)) { var a = ( /** @type {Derived} */ - z + V ); (a.effects ?? (a.effects = [])).push(s); } return i; } -function hs() { - return z !== null && !he; +function $s() { + return V !== null && !fe; } -function iu(t) { - const e = Me(hi, null, !1); - return lt(e, vt), e.teardown = t, e; +function su(t) { + const e = Se(xi, null, !1); + return ut(e, vt), e.teardown = t, e; } -function ds(t) { - nu(); +function As(t) { + ru(); var e = ( /** @type {Effect} */ X.f - ), n = !z && (e & pe) !== 0 && (e & Qn) === 0; + ), n = !V && (e & he) !== 0 && (e & cr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - qt + Vt ); (r.e ?? (r.e = [])).push(t); } else - return Ua(t); + return eo(t); } -function Ua(t) { - return Me(vr | El, t, !1); +function eo(t) { + return Se(Tr | Rl, t, !1); } -function su(t) { - Ye.ensure(); - const e = Me(en | Nn, t, !0); +function au(t) { + Ge.ensure(); + const e = Se(on | qn, t, !0); return () => { - Rt(e); + Tt(e); }; } -function au(t) { - Ye.ensure(); - const e = Me(en | Nn, t, !0); +function ou(t) { + Ge.ensure(); + const e = Se(on | qn, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? wn(e, () => { - Rt(e), r(void 0); - }) : (Rt(e), r(void 0)); + n.outro ? Sn(e, () => { + Tt(e), r(void 0); + }) : (Tt(e), r(void 0)); }); } -function Xa(t) { - return Me(vr, t, !1); +function no(t) { + return Se(Tr, t, !1); } -function ou(t) { - return Me(as | Nn, t, !0); +function lu(t) { + return Se(_s | qn, t, !0); } -function ps(t, e = 0) { - return Me(hi | e, t, !0); +function Es(t, e = 0) { + return Se(xi | e, t, !0); } -function Pr(t, e = [], n = [], r = []) { - Wl(r, e, n, (i) => { - Me(hi, () => t(...i.map(w)), !0); +function Un(t, e = [], n = [], r = []) { + jl(r, e, n, (i) => { + Se(xi, () => t(...i.map(w)), !0); }); } -function vs(t, e = 0) { - var n = Me(Ue | e, t, !0); +function Rs(t, e = 0) { + var n = Se(je | e, t, !0); return n; } -function Zt(t) { - return Me(pe | Nn, t, !0); +function Kt(t) { + return Se(he | qn, t, !0); } -function Ga(t) { +function ro(t) { var e = t.teardown; if (e !== null) { - const n = tn, r = z; - Is(!0), ee(null); + const n = an, r = V; + Ws(!0), Qt(null); try { e.call(null); } finally { - Is(n), ee(r); + Ws(n), Qt(r); } } } -function gs(t, e = !1) { +function Cs(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { const i = n.ac; - i !== null && Ba(() => { - i.abort(on); + i !== null && to(() => { + i.abort(_n); }); var r = n.next; - (n.f & en) !== 0 ? n.parent = null : Rt(n, e), n = r; + (n.f & on) !== 0 ? n.parent = null : Tt(n, e), n = r; } } -function lu(t) { +function uu(t) { for (var e = t.first; e !== null; ) { var n = e.next; - (e.f & pe) === 0 && Rt(e), e = n; + (e.f & he) === 0 && Tt(e), e = n; } } -function Rt(t, e = !0) { +function Tt(t, e = !0) { var n = !1; - (e || (t.f & ga) !== 0) && t.nodes !== null && t.nodes.end !== null && (uu( + (e || (t.f & Ra) !== 0) && t.nodes !== null && t.nodes.end !== null && (fu( t.nodes.start, /** @type {TemplateNode} */ t.nodes.end - ), n = !0), gs(t, e && !n), gr(t, 0), lt(t, He); + ), n = !0), Cs(t, e && !n), Nr(t, 0), ut(t, Xe); var r = t.nodes && t.nodes.t; if (r !== null) for (const s of r) s.stop(); - Ga(t); + ro(t); var i = t.parent; - i !== null && i.first !== null && Ka(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; + i !== null && i.first !== null && io(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; } -function uu(t, e) { +function fu(t, e) { for (; t !== null; ) { - var n = t === e ? null : /* @__PURE__ */ ke(t); + var n = t === e ? null : /* @__PURE__ */ Ne(t); t.remove(), t = n; } } -function Ka(t) { +function io(t) { var e = t.parent, n = t.prev, r = t.next; n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); } -function wn(t, e, n = !0) { +function Sn(t, e, n = !0) { var r = []; - Wa(t, r, !0); + so(t, r, !0); var i = () => { - n && Rt(t), e && e(); + n && Tt(t), e && e(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1522,31 +1522,31 @@ function wn(t, e, n = !0) { } else i(); } -function Wa(t, e, n) { - if ((t.f & Lt) === 0) { - t.f ^= Lt; +function so(t, e, n) { + if ((t.f & qt) === 0) { + t.f ^= qt; var r = t.nodes && t.nodes.t; if (r !== null) for (const o of r) (o.is_global || n) && e.push(o); for (var i = t.first; i !== null; ) { - var s = i.next, a = (i.f & Xn) !== 0 || // If this is a branch effect without a block effect parent, + var s = i.next, a = (i.f & ir) !== 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 & pe) !== 0 && (t.f & Ue) !== 0; - Wa(i, e, a ? n : !1), i = s; + (i.f & he) !== 0 && (t.f & je) !== 0; + so(i, e, a ? n : !1), i = s; } } } -function _s(t) { - ja(t, !0); +function Ts(t) { + ao(t, !0); } -function ja(t, e) { - if ((t.f & Lt) !== 0) { - t.f ^= Lt, (t.f & vt) === 0 && (lt(t, xt), ce(t)); +function ao(t, e) { + if ((t.f & qt) !== 0) { + t.f ^= qt, (t.f & vt) === 0 && (ut(t, bt), ue(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & Xn) !== 0 || (n.f & pe) !== 0; - ja(n, i ? e : !1), n = r; + var r = n.next, i = (n.f & ir) !== 0 || (n.f & he) !== 0; + ao(n, i ? e : !1), n = r; } var s = t.nodes && t.nodes.t; if (s !== null) @@ -1554,249 +1554,249 @@ function ja(t, e) { (a.is_global || e) && a.in(); } } -function Za(t, e) { +function oo(t, e) { if (t.nodes) for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ ke(n); + var i = n === r ? null : /* @__PURE__ */ Ne(n); e.append(n), n = i; } } -let Yr = !1, tn = !1; -function Is(t) { - tn = t; +let Jr = !1, an = !1; +function Ws(t) { + an = t; } -let z = null, he = !1; -function ee(t) { - z = t; +let V = null, fe = !1; +function Qt(t) { + V = t; } let X = null; -function Ne(t) { +function Ce(t) { X = t; } -let Qt = null; -function Ja(t) { - z !== null && (Qt === null ? Qt = [t] : Qt.push(t)); +let Zt = null; +function lo(t) { + V !== null && (Zt === null ? Zt = [t] : Zt.push(t)); } -let kt = null, Dt = 0, Gt = null; -function fu(t) { - Gt = t; +let Pt = null, Ot = 0, Wt = null; +function cu(t) { + Wt = t; } -let Qa = 1, fn = 0, xn = fn; -function Fs(t) { - xn = t; +let uo = 1, wn = 0, kn = wn; +function Xs(t) { + kn = t; } -function to() { - return ++Qa; +function fo() { + return ++uo; } -function Tr(t) { +function Vr(t) { var e = t.f; - if ((e & xt) !== 0) + if ((e & bt) !== 0) return !0; - if (e & wt && (t.f &= ~$n), (e & de) !== 0) { + if (e & xt && (t.f &= ~Pn), (e & ce) !== 0) { for (var n = ( /** @type {Value[]} */ t.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (Tr( + if (Vr( /** @type {Derived} */ s - ) && Oa( + ) && Ba( /** @type {Derived} */ s ), s.wv > t.wv) return !0; } - (e & Jt) !== 0 && // During time traveling we don't want to reset the status so that + (e & jt) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - yt === null && lt(t, vt); + wt === null && ut(t, vt); } return !1; } -function eo(t, e, n = !0) { +function co(t, e, n = !0) { var r = t.reactions; - if (r !== null && !(Qt !== null && Un.call(Qt, t))) + if (r !== null && !(Zt !== null && rr.call(Zt, t))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & wt) !== 0 ? eo( + (s.f & xt) !== 0 ? co( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? lt(s, xt) : (s.f & vt) !== 0 && lt(s, de), ce( + ) : e === s && (n ? ut(s, bt) : (s.f & vt) !== 0 && ut(s, ce), ue( /** @type {Effect} */ s )); } } -function no(t) { +function ho(t) { var m; - var e = kt, n = Dt, r = Gt, i = z, s = Qt, a = qt, o = he, l = xn, u = t.f; - kt = /** @type {null | Value[]} */ - null, Dt = 0, Gt = null, z = (u & (pe | en)) === 0 ? t : null, Qt = null, Gn(t.ctx), he = !1, xn = ++fn, t.ac !== null && (Ba(() => { - t.ac.abort(on); + var e = Pt, n = Ot, r = Wt, i = V, s = Zt, a = Vt, o = fe, l = kn, u = t.f; + Pt = /** @type {null | Value[]} */ + null, Ot = 0, Wt = null, V = (u & (he | on)) === 0 ? t : null, Zt = null, sr(t.ctx), fe = !1, kn = ++wn, t.ac !== null && (to(() => { + t.ac.abort(_n); }), t.ac = null); try { - t.f |= Ii; + t.f |= Xi; var f = ( /** @type {Function} */ t.fn ), h = f(); - t.f |= Qn; + t.f |= cr; var c = t.deps, v = Y == null ? void 0 : Y.is_fork; - if (kt !== null) { + if (Pt !== null) { var g; - if (v || gr(t, Dt), c !== null && Dt > 0) - for (c.length = Dt + kt.length, g = 0; g < kt.length; g++) - c[Dt + g] = kt[g]; + if (v || Nr(t, Ot), c !== null && Ot > 0) + for (c.length = Ot + Pt.length, g = 0; g < Pt.length; g++) + c[Ot + g] = Pt[g]; else - t.deps = c = kt; - if (hs() && (t.f & Jt) !== 0) - for (g = Dt; g < c.length; g++) + t.deps = c = Pt; + if ($s() && (t.f & jt) !== 0) + for (g = Ot; g < c.length; g++) ((m = c[g]).reactions ?? (m.reactions = [])).push(t); - } else !v && c !== null && Dt < c.length && (gr(t, Dt), c.length = Dt); - if (xa() && Gt !== null && !he && c !== null && (t.f & (wt | de | xt)) === 0) + } else !v && c !== null && Ot < c.length && (Nr(t, Ot), c.length = Ot); + if (ka() && Wt !== null && !fe && c !== null && (t.f & (xt | ce | bt)) === 0) for (g = 0; g < /** @type {Source[]} */ - Gt.length; g++) - eo( - Gt[g], + Wt.length; g++) + co( + Wt[g], /** @type {Effect} */ t ); if (i !== null && i !== t) { - if (fn++, i.deps !== null) + if (wn++, i.deps !== null) for (let b = 0; b < n; b += 1) - i.deps[b].rv = fn; + i.deps[b].rv = wn; if (e !== null) for (const b of e) - b.rv = fn; - Gt !== null && (r === null ? r = Gt : r.push(.../** @type {Source[]} */ - Gt)); + b.rv = wn; + Wt !== null && (r === null ? r = Wt : r.push(.../** @type {Source[]} */ + Wt)); } - return (t.f & Je) !== 0 && (t.f ^= Je), h; + return (t.f & rn) !== 0 && (t.f ^= rn), h; } catch (b) { - return $a(b); + return Pa(b); } finally { - t.f ^= Ii, kt = e, Dt = n, Gt = r, z = i, Qt = s, Gn(a), he = o, xn = l; + t.f ^= Xi, Pt = e, Ot = n, Wt = r, V = i, Zt = s, sr(a), fe = o, kn = l; } } -function cu(t, e) { +function hu(t, e) { let n = e.reactions; if (n !== null) { - var r = ml.call(n, t); + var r = yl.call(n, t); if (r !== -1) { var i = n.length - 1; i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (e.f & wt) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (e.f & xt) !== 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 - (kt === null || !Un.call(kt, e))) { + (Pt === null || !rr.call(Pt, e))) { var s = ( /** @type {Derived} */ e ); - (s.f & Jt) !== 0 && (s.f ^= Jt, s.f &= ~$n), us(s), tu(s), gr(s, 0); + (s.f & jt) !== 0 && (s.f ^= jt, s.f &= ~Pn), ws(s), eu(s), Nr(s, 0); } } -function gr(t, e) { +function Nr(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - cu(t, n[r]); + hu(t, n[r]); } -function jn(t) { +function lr(t) { var e = t.f; - if ((e & He) === 0) { - lt(t, vt); - var n = X, r = Yr; - X = t, Yr = !0; + if ((e & Xe) === 0) { + ut(t, vt); + var n = X, r = Jr; + X = t, Jr = !0; try { - (e & (Ue | pa)) !== 0 ? lu(t) : gs(t), Ga(t); - var i = no(t); - t.teardown = typeof i == "function" ? i : null, t.wv = Qa; + (e & (je | Aa)) !== 0 ? uu(t) : Cs(t), ro(t); + var i = ho(t); + t.teardown = typeof i == "function" ? i : null, t.wv = uo; var s; - Di && zl && (t.f & xt) !== 0 && t.deps; + Wi && Hl && (t.f & bt) !== 0 && t.deps; } finally { - Yr = r, X = n; + Jr = r, X = n; } } } function w(t) { - var e = t.f, n = (e & wt) !== 0; - if (z !== null && !he) { - var r = X !== null && (X.f & He) !== 0; - if (!r && (Qt === null || !Un.call(Qt, t))) { - var i = z.deps; - if ((z.f & Ii) !== 0) - t.rv < fn && (t.rv = fn, kt === null && i !== null && i[Dt] === t ? Dt++ : kt === null ? kt = [t] : kt.push(t)); + var e = t.f, n = (e & xt) !== 0; + if (V !== null && !fe) { + var r = X !== null && (X.f & Xe) !== 0; + if (!r && (Zt === null || !rr.call(Zt, t))) { + var i = V.deps; + if ((V.f & Xi) !== 0) + t.rv < wn && (t.rv = wn, Pt === null && i !== null && i[Ot] === t ? Ot++ : Pt === null ? Pt = [t] : Pt.push(t)); else { - (z.deps ?? (z.deps = [])).push(t); + (V.deps ?? (V.deps = [])).push(t); var s = t.reactions; - s === null ? t.reactions = [z] : Un.call(s, z) || s.push(z); + s === null ? t.reactions = [V] : rr.call(s, V) || s.push(V); } } } - if (tn && Qe.has(t)) - return Qe.get(t); + if (an && sn.has(t)) + return sn.get(t); if (n) { var a = ( /** @type {Derived} */ t ); - if (tn) { + if (an) { var o = a.v; - return ((a.f & vt) === 0 && a.reactions !== null || io(a)) && (o = fs(a)), Qe.set(a, o), o; + return ((a.f & vt) === 0 && a.reactions !== null || vo(a)) && (o = xs(a)), sn.set(a, o), o; } - var l = (a.f & Jt) === 0 && !he && z !== null && (Yr || (z.f & Jt) !== 0), u = (a.f & Qn) === 0; - Tr(a) && (l && (a.f |= Jt), Oa(a)), l && !u && (Da(a), ro(a)); + var l = (a.f & jt) === 0 && !fe && V !== null && (Jr || (V.f & jt) !== 0), u = (a.f & cr) === 0; + Vr(a) && (l && (a.f |= jt), Ba(a)), l && !u && (Ua(a), po(a)); } - if (yt != null && yt.has(t)) - return yt.get(t); - if ((t.f & Je) !== 0) + if (wt != null && wt.has(t)) + return wt.get(t); + if ((t.f & rn) !== 0) throw t.v; return t.v; } -function ro(t) { - if (t.f |= Jt, t.deps !== null) +function po(t) { + if (t.f |= jt, t.deps !== null) for (const e of t.deps) - (e.reactions ?? (e.reactions = [])).push(t), (e.f & wt) !== 0 && (e.f & Jt) === 0 && (Da( + (e.reactions ?? (e.reactions = [])).push(t), (e.f & xt) !== 0 && (e.f & jt) === 0 && (Ua( /** @type {Derived} */ e - ), ro( + ), po( /** @type {Derived} */ e )); } -function io(t) { +function vo(t) { if (t.v === _t) return !0; if (t.deps === null) return !1; for (const e of t.deps) - if (Qe.has(e) || (e.f & wt) !== 0 && io( + if (sn.has(e) || (e.f & xt) !== 0 && vo( /** @type {Derived} */ e )) return !0; return !1; } -function mi(t) { - var e = he; +function Ci(t) { + var e = fe; try { - return he = !0, t(); + return fe = !0, t(); } finally { - he = e; + fe = e; } } -const so = /* @__PURE__ */ new Set(), Xi = /* @__PURE__ */ new Set(); -function hu(t) { +const go = /* @__PURE__ */ new Set(), rs = /* @__PURE__ */ new Set(); +function du(t) { for (var e = 0; e < t.length; e++) - so.add(t[e]); - for (var n of Xi) + go.add(t[e]); + for (var n of rs) n(t); } -let Ls = null; -function qs(t) { +let Gs = null; +function Ks(t) { var b; var e = this, n = ( /** @type {Node} */ @@ -1805,8 +1805,8 @@ function qs(t) { /** @type {null | Element} */ i[0] || t.target ); - Ls = t; - var a = 0, o = Ls === t && t.__root; + Gs = t; + var a = 0, o = Gs === t && t.__root; if (o) { var l = i.indexOf(o); if (l !== -1 && (e === document || e === /** @type {any} */ @@ -1821,14 +1821,14 @@ function qs(t) { } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - Jr(t, "currentTarget", { + oi(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = z, h = X; - ee(null), Ne(null); + var f = V, h = X; + Qt(null), Ce(null); try { for (var c, v = []; s !== null; ) { var g = s.assignedSlot || s.parentNode || /** @type {any} */ @@ -1839,44 +1839,44 @@ function qs(t) { 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 t.target === s) && m.call(s, t); - } catch (A) { - c ? v.push(A) : c = A; + } catch ($) { + c ? v.push($) : c = $; } if (t.cancelBubble || g === e || g === null) break; s = g; } if (c) { - for (let A of v) + for (let $ of v) queueMicrotask(() => { - throw A; + throw $; }); throw c; } } finally { - t.__root = e, delete t.currentTarget, ee(f), Ne(h); + t.__root = e, delete t.currentTarget, Qt(f), Ce(h); } } } -var fa, ca; -const Ci = (ca = (fa = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : fa.trustedTypes) == null ? void 0 : /* @__PURE__ */ ca.createPolicy( +var wa, xa; +const qi = (xa = (wa = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : wa.trustedTypes) == null ? void 0 : /* @__PURE__ */ xa.createPolicy( "svelte-trusted-html", { /** @param {string} html */ createHTML: (t) => t } ); -function du(t) { +function pu(t) { return ( /** @type {string} */ - (Ci == null ? void 0 : Ci.createHTML(t)) ?? t + (qi == null ? void 0 : qi.createHTML(t)) ?? t ); } -function ao(t, e = !1) { - var n = cs("template"); - return t = t.replaceAll("", ""), n.innerHTML = e ? du(t) : t, n.content; +function _o(t, e = !1) { + var n = bs("template"); + return t = t.replaceAll("", ""), n.innerHTML = e ? pu(t) : t, n.content; } -function Rn(t, e) { +function On(t, e) { var n = ( /** @type {Effect} */ X @@ -1884,75 +1884,75 @@ function Rn(t, e) { n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function er(t, e) { - var n = (e & gl) !== 0, r, i = !t.startsWith(""); +function Vn(t, e) { + var n = (e & _l) !== 0, r, i = !t.startsWith(""); return () => { - if (Z) - return Rn(H, null), H; - r === void 0 && (r = ao(i ? t : "" + t, !0)); + if (j) + return On(z, null), z; + r === void 0 && (r = _o(i ? t : "" + t, !0)); var s = ( /** @type {TemplateNode} */ - n || qa ? document.importNode(r, !0) : r.cloneNode(!0) + n || Ka ? document.importNode(r, !0) : r.cloneNode(!0) ); { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ En(s) + /* @__PURE__ */ Fn(s) ), o = ( /** @type {TemplateNode} */ s.lastChild ); - Rn(a, o); + On(a, o); } return s; }; } // @__NO_SIDE_EFFECTS__ -function pu(t, e, n = "svg") { +function vu(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { - if (Z) - return Rn(H, null), H; + if (j) + return On(z, null), z; if (!s) { var a = ( /** @type {DocumentFragment} */ - ao(i, !0) + _o(i, !0) ), o = ( /** @type {Element} */ - /* @__PURE__ */ En(a) + /* @__PURE__ */ Fn(a) ); s = /** @type {Element} */ - /* @__PURE__ */ En(o); + /* @__PURE__ */ Fn(o); } var l = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return Rn(l, l), l; + return On(l, l), l; }; } // @__NO_SIDE_EFFECTS__ -function vu(t, e) { - return /* @__PURE__ */ pu(t, e, "svg"); +function gu(t, e) { + return /* @__PURE__ */ vu(t, e, "svg"); } -function Vs(t = "") { - if (!Z) { - var e = te(t + ""); - return Rn(e, e), e; +function js(t = "") { + if (!j) { + var e = Jt(t + ""); + return On(e, e), e; } - var n = H; - return n.nodeType !== Rr ? (n.before(n = te()), Pt(n)) : _i( + var n = z; + return n.nodeType !== qr ? (n.before(n = Jt()), Ft(n)) : Ri( /** @type {Text} */ n - ), Rn(n, n), n; + ), On(n, n), n; } -function be(t, e) { - if (Z) { +function ae(t, e) { + if (j) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ X ); - ((n.f & Qn) === 0 || n.nodes.end === null) && (n.nodes.end = H), pi(); + ((n.f & cr) === 0 || n.nodes.end === null) && (n.nodes.end = z), $i(); return; } t !== null && t.before( @@ -1960,63 +1960,63 @@ function be(t, e) { e ); } -const gu = ["touchstart", "touchmove"]; -function _u(t) { - return gu.includes(t); +const _u = ["touchstart", "touchmove"]; +function mu(t) { + return _u.includes(t); } -function Pn(t, e) { +function pn(t, e) { var n = e == null ? "" : typeof e == "object" ? e + "" : e; n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); } -function oo(t, e) { - return lo(t, e); +function mo(t, e) { + return yo(t, e); } -function mu(t, e) { - Ui(), e.intro = e.intro ?? !1; - const n = e.target, r = Z, i = H; +function yu(t, e) { + ns(), e.intro = e.intro ?? !1; + const n = e.target, r = j, i = z; try { - for (var s = /* @__PURE__ */ En(n); s && (s.nodeType !== tr || /** @type {Comment} */ - s.data !== is); ) - s = /* @__PURE__ */ ke(s); + for (var s = /* @__PURE__ */ Fn(n); s && (s.nodeType !== hr || /** @type {Comment} */ + s.data !== vs); ) + s = /* @__PURE__ */ Ne(s); if (!s) - throw Bn; - ze(!0), Pt( + throw nr; + We(!0), Ft( /** @type {Comment} */ s ); - const a = lo(t, { ...e, anchor: s }); - return ze(!1), /** @type {Exports} */ + const a = yo(t, { ...e, anchor: s }); + return We(!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 !== Bn && console.warn("Failed to hydrate: ", a), e.recover === !1 && Pl(), Ui(), Ha(n), ze(!1), oo(t, e); + return a !== nr && console.warn("Failed to hydrate: ", a), e.recover === !1 && Dl(), ns(), Ja(n), We(!1), mo(t, e); } finally { - ze(r), Pt(i); + We(r), Ft(i); } } -const Or = /* @__PURE__ */ new Map(); -function lo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - Ui(); +const Br = /* @__PURE__ */ new Map(); +function yo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + ns(); var o = /* @__PURE__ */ new Set(), l = (h) => { for (var c = 0; c < h.length; c++) { var v = h[c]; if (!o.has(v)) { o.add(v); - var g = _u(v); - for (const A of [e, document]) { - var m = Or.get(A); - m === void 0 && (m = /* @__PURE__ */ new Map(), Or.set(A, m)); + var g = mu(v); + for (const $ of [e, document]) { + var m = Br.get($); + m === void 0 && (m = /* @__PURE__ */ new Map(), Br.set($, m)); var b = m.get(v); - b === void 0 ? (A.addEventListener(v, qs, { passive: g }), m.set(v, 1)) : m.set(v, b + 1); + b === void 0 ? ($.addEventListener(v, Ks, { passive: g }), m.set(v, 1)) : m.set(v, b + 1); } } } }; - l(ci(so)), Xi.add(l); - var u = void 0, f = au(() => { - var h = n ?? e.appendChild(te()); + l(wi(go)), rs.add(l); + var u = void 0, f = ou(() => { + var h = n ?? e.appendChild(Jt()); return Gl( /** @type {TemplateNode} */ h, @@ -2025,19 +2025,19 @@ function lo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int } }, (c) => { - os({}); + ms({}); var v = ( /** @type {ComponentContext} */ - qt + Vt ); - if (s && (v.c = s), i && (r.$$events = i), Z && Rn( + if (s && (v.c = s), i && (r.$$events = i), j && On( /** @type {TemplateNode} */ c, null - ), u = t(c, r) || {}, Z && (X.nodes.end = H, H === null || H.nodeType !== tr || /** @type {Comment} */ - H.data !== ss)) - throw di(), Bn; - ls(); + ), u = t(c, r) || {}, j && (X.nodes.end = z, z === null || z.nodeType !== hr || /** @type {Comment} */ + z.data !== gs)) + throw bi(), nr; + ys(); } ), () => { var m; @@ -2045,34 +2045,34 @@ function lo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int for (const b of [e, document]) { var v = ( /** @type {Map} */ - Or.get(b) + Br.get(b) ), g = ( /** @type {number} */ v.get(c) ); - --g == 0 ? (b.removeEventListener(c, qs), v.delete(c), v.size === 0 && Or.delete(b)) : v.set(c, g); + --g == 0 ? (b.removeEventListener(c, Ks), v.delete(c), v.size === 0 && Br.delete(b)) : v.set(c, g); } - Xi.delete(l), h !== n && ((m = h.parentNode) == null || m.removeChild(h)); + rs.delete(l), h !== n && ((m = h.parentNode) == null || m.removeChild(h)); }; }); - return Gi.set(u, f), u; + return is.set(u, f), u; } -let Gi = /* @__PURE__ */ new WeakMap(); -function yu(t, e) { - const n = Gi.get(t); - return n ? (Gi.delete(t), n(e)) : Promise.resolve(); +let is = /* @__PURE__ */ new WeakMap(); +function wu(t, e) { + const n = is.get(t); + return n ? (is.delete(t), n(e)) : Promise.resolve(); } -var le, Re, Ft, _n, Ar, Er, ui; -class wu { +var oe, Ae, Lt, Cn, Ir, Lr, mi; +class xu { /** * @param {TemplateNode} anchor * @param {boolean} transition */ constructor(e, n = !0) { /** @type {TemplateNode} */ - ot(this, "anchor"); + lt(this, "anchor"); /** @type {Map} */ - L(this, le, /* @__PURE__ */ new Map()); + L(this, oe, /* @__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. @@ -2087,69 +2087,69 @@ class wu { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - L(this, Re, /* @__PURE__ */ new Map()); + L(this, Ae, /* @__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} */ - L(this, Ft, /* @__PURE__ */ new Map()); + L(this, Lt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - L(this, _n, /* @__PURE__ */ new Set()); + L(this, Cn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - L(this, Ar, !0); - L(this, Er, () => { + L(this, Ir, !0); + L(this, Lr, () => { var e = ( /** @type {Batch} */ Y ); - if (d(this, le).has(e)) { + if (d(this, oe).has(e)) { var n = ( /** @type {Key} */ - d(this, le).get(e) - ), r = d(this, Re).get(n); + d(this, oe).get(e) + ), r = d(this, Ae).get(n); if (r) - _s(r), d(this, _n).delete(n); + Ts(r), d(this, Cn).delete(n); else { - var i = d(this, Ft).get(n); - i && (d(this, Re).set(n, i.effect), d(this, Ft).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = d(this, Lt).get(n); + i && (d(this, Ae).set(n, i.effect), d(this, Lt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of d(this, le)) { - if (d(this, le).delete(s), s === e) + for (const [s, a] of d(this, oe)) { + if (d(this, oe).delete(s), s === e) break; - const o = d(this, Ft).get(a); - o && (Rt(o.effect), d(this, Ft).delete(a)); + const o = d(this, Lt).get(a); + o && (Tt(o.effect), d(this, Lt).delete(a)); } - for (const [s, a] of d(this, Re)) { - if (s === n || d(this, _n).has(s)) continue; + for (const [s, a] of d(this, Ae)) { + if (s === n || d(this, Cn).has(s)) continue; const o = () => { - if (Array.from(d(this, le).values()).includes(s)) { + if (Array.from(d(this, oe).values()).includes(s)) { var u = document.createDocumentFragment(); - Za(a, u), u.append(te()), d(this, Ft).set(s, { effect: a, fragment: u }); + oo(a, u), u.append(Jt()), d(this, Lt).set(s, { effect: a, fragment: u }); } else - Rt(a); - d(this, _n).delete(s), d(this, Re).delete(s); + Tt(a); + d(this, Cn).delete(s), d(this, Ae).delete(s); }; - d(this, Ar) || !r ? (d(this, _n).add(s), wn(a, o, !1)) : o(); + d(this, Ir) || !r ? (d(this, Cn).add(s), Sn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - L(this, ui, (e) => { - d(this, le).delete(e); - const n = Array.from(d(this, le).values()); - for (const [r, i] of d(this, Ft)) - n.includes(r) || (Rt(i.effect), d(this, Ft).delete(r)); + L(this, mi, (e) => { + d(this, oe).delete(e); + const n = Array.from(d(this, oe).values()); + for (const [r, i] of d(this, Lt)) + n.includes(r) || (Tt(i.effect), d(this, Lt).delete(r)); }); - this.anchor = e, O(this, Ar, n); + this.anchor = e, D(this, Ir, n); } /** * @@ -2160,68 +2160,68 @@ class wu { var r = ( /** @type {Batch} */ Y - ), i = Ya(); - if (n && !d(this, Re).has(e) && !d(this, Ft).has(e)) + ), i = Qa(); + if (n && !d(this, Ae).has(e) && !d(this, Lt).has(e)) if (i) { - var s = document.createDocumentFragment(), a = te(); - s.append(a), d(this, Ft).set(e, { - effect: Zt(() => n(a)), + var s = document.createDocumentFragment(), a = Jt(); + s.append(a), d(this, Lt).set(e, { + effect: Kt(() => n(a)), fragment: s }); } else - d(this, Re).set( + d(this, Ae).set( e, - Zt(() => n(this.anchor)) + Kt(() => n(this.anchor)) ); - if (d(this, le).set(r, e), i) { - for (const [o, l] of d(this, Re)) + if (d(this, oe).set(r, e), i) { + for (const [o, l] of d(this, Ae)) o === e ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of d(this, Ft)) + for (const [o, l] of d(this, Lt)) o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(d(this, Er)), r.ondiscard(d(this, ui)); + r.oncommit(d(this, Lr)), r.ondiscard(d(this, mi)); } else - Z && (this.anchor = H), d(this, Er).call(this); + j && (this.anchor = z), d(this, Lr).call(this); } } -le = new WeakMap(), Re = new WeakMap(), Ft = new WeakMap(), _n = new WeakMap(), Ar = new WeakMap(), Er = new WeakMap(), ui = new WeakMap(); -function xu(t) { - qt === null && Rl(), ds(() => { - const e = mi(t); +oe = new WeakMap(), Ae = new WeakMap(), Lt = new WeakMap(), Cn = new WeakMap(), Ir = new WeakMap(), Lr = new WeakMap(), mi = new WeakMap(); +function bu(t) { + Vt === null && Cl(), As(() => { + const e = Ci(t); if (typeof e == "function") return ( /** @type {() => void} */ e ); }); } -function Dr(t, e, n = !1) { - Z && pi(); - var r = new wu(t), i = n ? Xn : 0; +function mr(t, e, n = !1) { + j && $i(); + var r = new xu(t), i = n ? ir : 0; function s(a, o) { - if (Z) { - const f = ma(t); + if (j) { + const f = Ta(t); var l; - if (f === is ? l = 0 : f === fi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = Qr(); - Pt(u), r.anchor = u, ze(!1), r.ensure(a, o), ze(!0); + if (f === vs ? l = 0 : f === yi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = li(); + Ft(u), r.anchor = u, We(!1), r.ensure(a, o), We(!0); return; } } r.ensure(a, o); } - vs(() => { + Rs(() => { var a = !1; e((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function Ni(t, e) { +function Vi(t, e) { return e; } -function bu(t, e, n) { +function $u(t, e, n) { for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { let h = e[o]; - wn( + Sn( h, () => { if (s) { @@ -2230,7 +2230,7 @@ function bu(t, e, n) { /** @type {Set} */ t.outrogroups ); - Ki(ci(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); + ss(wi(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); } } else a -= 1; @@ -2248,164 +2248,164 @@ function bu(t, e, n) { /** @type {Element} */ u.parentNode ); - Ha(f), f.append(u), t.items.clear(); + Ja(f), f.append(u), t.items.clear(); } - Ki(e, !l); + ss(e, !l); } else s = { pending: new Set(e), done: /* @__PURE__ */ new Set() }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function Ki(t, e = !0) { +function ss(t, e = !0) { for (var n = 0; n < t.length; n++) - Rt(t[n], e); + Tt(t[n], e); } -var zs; -function Si(t, e, n, r, i, s = null) { +var Zs; +function zi(t, e, n, r, i, s = null) { var a = t, o = /* @__PURE__ */ new Map(); - Z && pi(); - var l = null, u = /* @__PURE__ */ Pa(() => { + j && $i(); + var l = null, u = /* @__PURE__ */ Ya(() => { var m = n(); - return ha(m) ? m : m == null ? [] : ci(m); + return ba(m) ? m : m == null ? [] : wi(m); }), f, h = !0; function c() { - g.fallback = l, $u(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & Ze) === 0 ? _s(l) : (l.f ^= Ze, lr(l, null, a)) : wn(l, () => { + g.fallback = l, Au(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & nn) === 0 ? Ts(l) : (l.f ^= nn, xr(l, null, a)) : Sn(l, () => { l = null; })); } - var v = vs(() => { + var v = Rs(() => { f = /** @type {V[]} */ w(u); var m = f.length; let b = !1; - if (Z) { - var A = ma(a) === fi; - A !== (m === 0) && (a = Qr(), Pt(a), ze(!1), b = !0); + if (j) { + var $ = Ta(a) === yi; + $ !== (m === 0) && (a = li(), Ft(a), We(!1), b = !0); } - for (var S = /* @__PURE__ */ new Set(), T = ( + for (var C = /* @__PURE__ */ new Set(), T = ( /** @type {Batch} */ Y - ), D = Ya(), E = 0; E < m; E += 1) { - Z && H.nodeType === tr && /** @type {Comment} */ - H.data === ss && (a = /** @type {Comment} */ - H, b = !0, ze(!1)); - var j = f[E], it = r(j, E), W = h ? null : o.get(it); - W ? (W.v && Wn(W.v, j), W.i && Wn(W.i, E), D && T.unskip_effect(W.e)) : (W = Au( + ), N = Qa(), I = 0; I < m; I += 1) { + j && z.nodeType === hr && /** @type {Comment} */ + z.data === gs && (a = /** @type {Comment} */ + z, b = !0, We(!1)); + var G = f[I], at = r(G, I), Z = h ? null : o.get(at); + Z ? (Z.v && or(Z.v, G), Z.i && or(Z.i, I), N && T.unskip_effect(Z.e)) : (Z = Eu( o, - h ? a : zs ?? (zs = te()), - j, - it, - E, + h ? a : Zs ?? (Zs = Jt()), + G, + at, + I, i, e, n - ), h || (W.e.f |= Ze), o.set(it, W)), S.add(it); + ), h || (Z.e.f |= nn), o.set(at, Z)), C.add(at); } - if (m === 0 && s && !l && (h ? l = Zt(() => s(a)) : (l = Zt(() => s(zs ?? (zs = te()))), l.f |= Ze)), m > S.size && Cl(), Z && m > 0 && Pt(Qr()), !h) - if (D) { - for (const [nt, ut] of o) - S.has(nt) || T.skip_effect(ut.e); + if (m === 0 && s && !l && (h ? l = Kt(() => s(a)) : (l = Kt(() => s(Zs ?? (Zs = Jt()))), l.f |= nn)), m > C.size && Nl(), j && m > 0 && Ft(li()), !h) + if (N) { + for (const [et, dt] of o) + C.has(et) || T.skip_effect(dt.e); T.oncommit(c), T.ondiscard(() => { }); } else c(); - b && ze(!0), w(u); + b && We(!0), w(u); }), g = { effect: v, items: o, outrogroups: null, fallback: l }; - h = !1, Z && (a = H); + h = !1, j && (a = z); } -function ar(t) { - for (; t !== null && (t.f & pe) === 0; ) +function yr(t) { + for (; t !== null && (t.f & he) === 0; ) t = t.next; return t; } -function $u(t, e, n, r, i) { - var W; - var s = e.length, a = t.items, o = ar(t.effect.first), l, u = null, f = [], h = [], c, v, g, m; +function Au(t, e, n, r, i) { + var Z; + var s = e.length, a = t.items, o = yr(t.effect.first), l, u = null, f = [], h = [], c, v, g, m; for (m = 0; m < s; m += 1) { if (c = e[m], v = i(c, m), g = /** @type {EachItem} */ a.get(v).e, t.outrogroups !== null) - for (const nt of t.outrogroups) - nt.pending.delete(g), nt.done.delete(g); - if ((g.f & Ze) !== 0) - if (g.f ^= Ze, g === o) - lr(g, null, n); + for (const et of t.outrogroups) + et.pending.delete(g), et.done.delete(g); + if ((g.f & nn) !== 0) + if (g.f ^= nn, g === o) + xr(g, null, n); else { var b = u ? u.next : o; - g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), We(t, u, g), We(t, g, b), lr(g, b, n), u = g, f = [], h = [], o = ar(u.next); + g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), tn(t, u, g), tn(t, g, b), xr(g, b, n), u = g, f = [], h = [], o = yr(u.next); continue; } - if ((g.f & Lt) !== 0 && _s(g), g !== o) { + if ((g.f & qt) !== 0 && Ts(g), g !== o) { if (l !== void 0 && l.has(g)) { if (f.length < h.length) { - var A = h[0], S; - u = A.prev; - var T = f[0], D = f[f.length - 1]; - for (S = 0; S < f.length; S += 1) - lr(f[S], A, n); - for (S = 0; S < h.length; S += 1) - l.delete(h[S]); - We(t, T.prev, D.next), We(t, u, T), We(t, D, A), o = A, u = D, m -= 1, f = [], h = []; + var $ = h[0], C; + u = $.prev; + var T = f[0], N = f[f.length - 1]; + for (C = 0; C < f.length; C += 1) + xr(f[C], $, n); + for (C = 0; C < h.length; C += 1) + l.delete(h[C]); + tn(t, T.prev, N.next), tn(t, u, T), tn(t, N, $), o = $, u = N, m -= 1, f = [], h = []; } else - l.delete(g), lr(g, o, n), We(t, g.prev, g.next), We(t, g, u === null ? t.effect.first : u.next), We(t, u, g), u = g; + l.delete(g), xr(g, o, n), tn(t, g.prev, g.next), tn(t, g, u === null ? t.effect.first : u.next), tn(t, u, g), u = g; continue; } for (f = [], h = []; o !== null && o !== g; ) - (l ?? (l = /* @__PURE__ */ new Set())).add(o), h.push(o), o = ar(o.next); + (l ?? (l = /* @__PURE__ */ new Set())).add(o), h.push(o), o = yr(o.next); if (o === null) continue; } - (g.f & Ze) === 0 && f.push(g), u = g, o = ar(g.next); + (g.f & nn) === 0 && f.push(g), u = g, o = yr(g.next); } if (t.outrogroups !== null) { - for (const nt of t.outrogroups) - nt.pending.size === 0 && (Ki(ci(nt.done)), (W = t.outrogroups) == null || W.delete(nt)); + for (const et of t.outrogroups) + et.pending.size === 0 && (ss(wi(et.done)), (Z = t.outrogroups) == null || Z.delete(et)); t.outrogroups.size === 0 && (t.outrogroups = null); } if (o !== null || l !== void 0) { - var E = []; + var I = []; if (l !== void 0) for (g of l) - (g.f & Lt) === 0 && E.push(g); + (g.f & qt) === 0 && I.push(g); for (; o !== null; ) - (o.f & Lt) === 0 && o !== t.fallback && E.push(o), o = ar(o.next); - var j = E.length; - if (j > 0) { - var it = null; - bu(t, E, it); + (o.f & qt) === 0 && o !== t.fallback && I.push(o), o = yr(o.next); + var G = I.length; + if (G > 0) { + var at = null; + $u(t, I, at); } } } -function Au(t, e, n, r, i, s, a, o) { - var l = (a & ul) !== 0 ? (a & cl) === 0 ? /* @__PURE__ */ Fa(n, !1, !1) : An(n) : null, u = (a & fl) !== 0 ? An(i) : null; +function Eu(t, e, n, r, i, s, a, o) { + var l = (a & fl) !== 0 ? (a & hl) === 0 ? /* @__PURE__ */ Xa(n, !1, !1) : Dn(n) : null, u = (a & cl) !== 0 ? Dn(i) : null; return { v: l, i: u, - e: Zt(() => (s(e, l ?? n, u ?? i, o), () => { + e: Kt(() => (s(e, l ?? n, u ?? i, o), () => { t.delete(r); })) }; } -function lr(t, e, n) { +function xr(t, e, n) { if (t.nodes) - for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & Ze) === 0 ? ( + for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & nn) === 0 ? ( /** @type {EffectNodes} */ e.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ke(r) + /* @__PURE__ */ Ne(r) ); if (s.before(r), r === i) return; r = a; } } -function We(t, e, n) { +function tn(t, e, n) { e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; } -function uo(t, e) { - Xa(() => { +function wo(t, e) { + no(() => { var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -2418,12 +2418,12 @@ function uo(t, e) { ) ); if (!r.querySelector("#" + e.hash)) { - const i = cs("style"); + const i = bs("style"); i.id = e.hash, i.textContent = e.code, r.appendChild(i); } }); } -function Hs(t, e = !1) { +function Js(t, e = !1) { var n = e ? " !important;" : ";", r = ""; for (var i in t) { var s = t[i]; @@ -2431,59 +2431,59 @@ function Hs(t, e = !1) { } return r; } -function Eu(t, e) { +function Ru(t, e) { if (e) { var n = "", r, i; - return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += Hs(r)), i && (n += Hs(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += Js(r)), i && (n += Js(i, !0)), n = n.trim(), n === "" ? null : n; } return String(t); } -function ki(t, e = {}, n, r) { +function Hi(t, e = {}, n, r) { for (var i in n) { var s = n[i]; e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); } } -function Ys(t, e, n, r) { +function Qs(t, e, n, r) { var i = t.__style; - if (Z || i !== e) { - var s = Eu(e, r); - (!Z || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; - } else r && (Array.isArray(r) ? (ki(t, n == null ? void 0 : n[0], r[0]), ki(t, n == null ? void 0 : n[1], r[1], "important")) : ki(t, n, r)); + if (j || i !== e) { + var s = Ru(e, r); + (!j || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; + } else r && (Array.isArray(r) ? (Hi(t, n == null ? void 0 : n[0], r[0]), Hi(t, n == null ? void 0 : n[1], r[1], "important")) : Hi(t, n, r)); return r; } -function Bs(t, e) { - return t === e || (t == null ? void 0 : t[hr]) === e; +function ta(t, e) { + return t === e || (t == null ? void 0 : t[Er]) === e; } -function Br(t = {}, e, n, r) { - return Xa(() => { +function Qr(t = {}, e, n, r) { + return no(() => { var i, s; - return ps(() => { - i = s, s = [], mi(() => { - t !== n(...s) && (e(t, ...s), i && Bs(n(...i), t) && e(null, ...i)); + return Es(() => { + i = s, s = [], Ci(() => { + t !== n(...s) && (e(t, ...s), i && ta(n(...i), t) && e(null, ...i)); }); }), () => { - yn(() => { - s && Bs(n(...s), t) && e(null, ...s); + Nn(() => { + s && ta(n(...s), t) && e(null, ...s); }); }; }), t; } -let Ir = !1; -function Ru(t) { - var e = Ir; +let Ur = !1; +function Cu(t) { + var e = Ur; try { - return Ir = !1, [t(), Ir]; + return Ur = !1, [t(), Ur]; } finally { - Ir = e; + Ur = e; } } -function ue(t, e, n, r) { - var S; - var i = (n & pl) !== 0, s = (n & vl) !== 0, a = ( +function Et(t, e, n, r) { + var C; + var i = (n & vl) !== 0, s = (n & gl) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? mi( + ), o = !0, l = () => (o && (o = !1, a = s ? Ci( /** @type {() => V} */ r ) : ( @@ -2491,15 +2491,15 @@ function ue(t, e, n, r) { r )), a), u; if (i) { - var f = hr in t || _a in t; - u = ((S = mn(t, e)) == null ? void 0 : S.set) ?? (f && e in t ? (T) => t[e] = T : void 0); + var f = Er in t || Ca in t; + u = ((C = Tn(t, e)) == null ? void 0 : C.set) ?? (f && e in t ? (T) => t[e] = T : void 0); } var h, c = !1; - i ? [h, c] = Ru(() => ( + i ? [h, c] = Cu(() => ( /** @type {V} */ t[e] )) : h = /** @type {V} */ - t[e], h === void 0 && r !== void 0 && (h = l(), u && (Ol(), u(h))); + t[e], h === void 0 && r !== void 0 && (h = l(), u && (Fl(), u(h))); var v; if (v = () => { var T = ( @@ -2507,39 +2507,39 @@ function ue(t, e, n, r) { t[e] ); return T === void 0 ? l() : (o = !0, T); - }, (n & dl) === 0) + }, (n & pl) === 0) return v; if (u) { var g = t.$$legacy; return ( /** @type {() => V} */ - (function(T, D) { - return arguments.length > 0 ? ((!D || g || c) && u(D ? v() : T), T) : v(); + (function(T, N) { + return arguments.length > 0 ? ((!N || g || c) && u(N ? v() : T), T) : v(); }) ); } - var m = !1, b = ((n & hl) !== 0 ? gi : Pa)(() => (m = !1, v())); + var m = !1, b = ((n & dl) !== 0 ? Ei : Ya)(() => (m = !1, v())); i && w(b); - var A = ( + var $ = ( /** @type {Effect} */ X ); return ( /** @type {() => V} */ - (function(T, D) { + (function(T, N) { if (arguments.length > 0) { - const E = D ? w(b) : i ? un(T) : T; - return J(b, E), m = !0, a !== void 0 && (a = E), T; + const I = N ? w(b) : i ? yn(T) : T; + return Q(b, I), m = !0, a !== void 0 && (a = I), T; } - return tn && m || (A.f & He) !== 0 ? b.v : w(b); + return an && m || ($.f & Xe) !== 0 ? b.v : w(b); }) ); } function Tu(t) { - return new Cu(t); + return new Nu(t); } -var Ve, Wt; -class Cu { +var Ue, Gt; +class Nu { /** * @param {ComponentConstructorOptions & { * component: any; @@ -2547,12 +2547,12 @@ class Cu { */ constructor(e) { /** @type {any} */ - L(this, Ve); + L(this, Ue); /** @type {Record} */ - L(this, Wt); + L(this, Gt); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ Fa(o, !1, !1); + var l = /* @__PURE__ */ Xa(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( @@ -2562,42 +2562,42 @@ class Cu { return w(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === _a ? !0 : (w(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === Ca ? !0 : (w(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return J(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return Q(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - O(this, Wt, (e.hydrate ? mu : oo)(e.component, { + D(this, Gt, (e.hydrate ? yu : mo)(e.component, { target: e.target, anchor: e.anchor, props: i, context: e.context, intro: e.intro ?? !1, recover: e.recover - })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && jt(), O(this, Ve, i.$$events); - for (const a of Object.keys(d(this, Wt))) - a === "$set" || a === "$destroy" || a === "$on" || Jr(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && mt(), D(this, Ue, i.$$events); + for (const a of Object.keys(d(this, Gt))) + a === "$set" || a === "$destroy" || a === "$on" || oi(this, a, { get() { - return d(this, Wt)[a]; + return d(this, Gt)[a]; }, /** @param {any} value */ set(o) { - d(this, Wt)[a] = o; + d(this, Gt)[a] = o; }, enumerable: !0 }); - d(this, Wt).$set = /** @param {Record} next */ + d(this, Gt).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, d(this, Wt).$destroy = () => { - yu(d(this, Wt)); + }, d(this, Gt).$destroy = () => { + wu(d(this, Gt)); }; } /** @param {Record} props */ $set(e) { - d(this, Wt).$set(e); + d(this, Gt).$set(e); } /** * @param {string} event @@ -2605,22 +2605,22 @@ class Cu { * @returns {any} */ $on(e, n) { - d(this, Ve)[e] = d(this, Ve)[e] || []; + d(this, Ue)[e] = d(this, Ue)[e] || []; const r = (...i) => n.call(this, ...i); - return d(this, Ve)[e].push(r), () => { - d(this, Ve)[e] = d(this, Ve)[e].filter( + return d(this, Ue)[e].push(r), () => { + d(this, Ue)[e] = d(this, Ue)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - d(this, Wt).$destroy(); + d(this, Gt).$destroy(); } } -Ve = new WeakMap(), Wt = new WeakMap(); -let fo; -typeof HTMLElement == "function" && (fo = class extends HTMLElement { +Ue = new WeakMap(), Gt = new WeakMap(); +let xo; +typeof HTMLElement == "function" && (xo = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -2629,27 +2629,27 @@ typeof HTMLElement == "function" && (fo = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - ot(this, "$$ctor"); + lt(this, "$$ctor"); /** Slots */ - ot(this, "$$s"); + lt(this, "$$s"); /** @type {any} The Svelte component instance */ - ot(this, "$$c"); + lt(this, "$$c"); /** Whether or not the custom element is connected */ - ot(this, "$$cn", !1); + lt(this, "$$cn", !1); /** @type {Record} Component props data */ - ot(this, "$$d", {}); + lt(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - ot(this, "$$r", !1); + lt(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - ot(this, "$$p_d", {}); + lt(this, "$$p_d", {}); /** @type {Record} Event listeners */ - ot(this, "$$l", {}); + lt(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - ot(this, "$$l_u", /* @__PURE__ */ new Map()); + lt(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - ot(this, "$$me"); + lt(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - ot(this, "$$shadowRoot", null); + lt(this, "$$shadowRoot", null); this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** @@ -2679,19 +2679,19 @@ typeof HTMLElement == "function" && (fo = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const o = cs("slot"); - s !== "default" && (o.name = s), be(a, o); + const o = bs("slot"); + s !== "default" && (o.name = s), ae(a, o); }; }; var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = Nu(this); + const r = {}, i = Su(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] = Ur(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = ti(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]); @@ -2703,14 +2703,14 @@ typeof HTMLElement == "function" && (fo = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = su(() => { - ps(() => { + }), this.$$me = au(() => { + Es(() => { var s; this.$$r = !0; - for (const a of Zr(this.$$c)) { + for (const a of ai(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = Ur( + const o = ti( a, this.$$d[a], this.$$p_d, @@ -2738,7 +2738,7 @@ typeof HTMLElement == "function" && (fo = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = Ur(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + this.$$r || (e = this.$$g_p(e), this.$$d[e] = ti(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2749,12 +2749,12 @@ typeof HTMLElement == "function" && (fo = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return Zr(this.$$p_d).find( + return ai(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function Ur(t, e, n, r) { +function ti(t, e, n, r) { var s; const i = (s = n[t]) == null ? void 0 : s.type; if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) @@ -2785,7 +2785,7 @@ function Ur(t, e, n, r) { return e; } } -function Nu(t) { +function Su(t) { const e = {}; return t.childNodes.forEach((n) => { e[ @@ -2794,34 +2794,34 @@ function Nu(t) { ] = !0; }), e; } -function co(t, e, n, r, i, s) { - let a = class extends fo { +function bo(t, e, n, r, i, s) { + let a = class extends xo { constructor() { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return Zr(e).map( + return ai(e).map( (o) => (e[o].attribute || o).toLowerCase() ); } }; - return Zr(e).forEach((o) => { - Jr(a.prototype, o, { + return ai(e).forEach((o) => { + oi(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { var h; - l = Ur(o, l, e), this.$$d[o] = l; + l = ti(o, l, e), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (h = mn(u, o)) == null ? void 0 : h.get; + var f = (h = Tn(u, o)) == null ? void 0 : h.get; f ? u[o] = l : u.$set({ [o]: l }); } } }); }), r.forEach((o) => { - Jr(a.prototype, o, { + oi(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; @@ -2830,43 +2830,43 @@ function co(t, e, n, r, i, s) { }), t.element = /** @type {any} */ a, a; } -var Su = { value: () => { +var ku = { value: () => { } }; -function ho() { +function $o() { for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } - return new Xr(n); + return new ei(n); } -function Xr(t) { +function ei(t) { this._ = t; } -function ku(t, e) { +function Mu(t, e) { return t.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 && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } -Xr.prototype = ho.prototype = { - constructor: Xr, +ei.prototype = $o.prototype = { + constructor: ei, on: function(t, e) { - var n = this._, r = ku(t + "", n), i, s = -1, a = r.length; + var n = this._, r = Mu(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Mu(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Pu(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++s < a; ) - if (i = (t = r[s]).type) n[i] = Us(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = Us(n[i], t.name, null); + if (i = (t = r[s]).type) n[i] = ea(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = ea(n[i], t.name, null); return this; }, copy: function() { var t = {}, e = this._; for (var n in e) t[n] = e[n].slice(); - return new Xr(t); + return new ei(t); }, call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; @@ -2878,135 +2878,135 @@ Xr.prototype = ho.prototype = { for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function Mu(t, e) { +function Pu(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } -function Us(t, e, n) { +function ea(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { - t[r] = Su, t = t.slice(0, r).concat(t.slice(r + 1)); + t[r] = ku, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } -var Wi = "http://www.w3.org/1999/xhtml"; -const Xs = { +var as = "http://www.w3.org/1999/xhtml"; +const na = { svg: "http://www.w3.org/2000/svg", - xhtml: Wi, + xhtml: as, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function yi(t) { +function Ti(t) { var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Xs.hasOwnProperty(e) ? { space: Xs[e], local: t } : t; + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), na.hasOwnProperty(e) ? { space: na[e], local: t } : t; } -function Pu(t) { +function Du(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; - return n === Wi && e.documentElement.namespaceURI === Wi ? e.createElement(t) : e.createElementNS(n, t); + return n === as && e.documentElement.namespaceURI === as ? e.createElement(t) : e.createElementNS(n, t); }; } -function Ou(t) { +function Fu(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } -function po(t) { - var e = yi(t); - return (e.local ? Ou : Pu)(e); +function Ao(t) { + var e = Ti(t); + return (e.local ? Fu : Du)(e); } -function Du() { +function Ou() { } -function ms(t) { - return t == null ? Du : function() { +function Ns(t) { + return t == null ? Ou : function() { return this.querySelector(t); }; } function Iu(t) { - typeof t != "function" && (t = ms(t)); + typeof t != "function" && (t = Ns(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new Vt(r, this._parents); + return new zt(r, this._parents); } -function Fu(t) { +function Lu(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function Lu() { +function qu() { return []; } -function vo(t) { - return t == null ? Lu : function() { +function Eo(t) { + return t == null ? qu : function() { return this.querySelectorAll(t); }; } -function qu(t) { +function Vu(t) { return function() { - return Fu(t.apply(this, arguments)); + return Lu(t.apply(this, arguments)); }; } -function Vu(t) { - typeof t == "function" ? t = qu(t) : t = vo(t); +function zu(t) { + typeof t == "function" ? t = Vu(t) : t = Eo(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); - return new Vt(r, i); + return new zt(r, i); } -function go(t) { +function Ro(t) { return function() { return this.matches(t); }; } -function _o(t) { +function Co(t) { return function(e) { return e.matches(t); }; } -var zu = Array.prototype.find; -function Hu(t) { +var Hu = Array.prototype.find; +function Yu(t) { return function() { - return zu.call(this.children, t); + return Hu.call(this.children, t); }; } -function Yu() { +function Bu() { return this.firstElementChild; } -function Bu(t) { - return this.select(t == null ? Yu : Hu(typeof t == "function" ? t : _o(t))); +function Uu(t) { + return this.select(t == null ? Bu : Yu(typeof t == "function" ? t : Co(t))); } -var Uu = Array.prototype.filter; +var Wu = Array.prototype.filter; function Xu() { return Array.from(this.children); } function Gu(t) { return function() { - return Uu.call(this.children, t); + return Wu.call(this.children, t); }; } function Ku(t) { - return this.selectAll(t == null ? Xu : Gu(typeof t == "function" ? t : _o(t))); + return this.selectAll(t == null ? Xu : Gu(typeof t == "function" ? t : Co(t))); } -function Wu(t) { - typeof t != "function" && (t = go(t)); +function ju(t) { + typeof t != "function" && (t = Ro(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new Vt(r, this._parents); + return new zt(r, this._parents); } -function mo(t) { +function To(t) { return new Array(t.length); } -function ju() { - return new Vt(this._enter || this._groups.map(mo), this._parents); +function Zu() { + return new zt(this._enter || this._groups.map(To), this._parents); } -function ti(t, e) { +function ui(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -ti.prototype = { - constructor: ti, +ui.prototype = { + constructor: ui, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -3020,70 +3020,70 @@ ti.prototype = { return this._parent.querySelectorAll(t); } }; -function Zu(t) { +function Ju(t) { return function() { return t; }; } -function Ju(t, e, n, r, i, s) { +function Qu(t, e, n, r, i, s) { for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new ti(t, s[a]); + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new ui(t, s[a]); for (; a < l; ++a) (o = e[a]) && (i[a] = o); } -function Qu(t, e, n, r, i, s, a) { +function tf(t, e, n, r, i, s, a) { var o, l, u = /* @__PURE__ */ new Map(), f = e.length, h = s.length, c = new Array(f), v; for (o = 0; o < f; ++o) (l = e[o]) && (c[o] = v = a.call(l, l.__data__, o, e) + "", u.has(v) ? i[o] = l : u.set(v, l)); for (o = 0; o < h; ++o) - v = a.call(t, s[o], o, s) + "", (l = u.get(v)) ? (r[o] = l, l.__data__ = s[o], u.delete(v)) : n[o] = new ti(t, s[o]); + v = a.call(t, s[o], o, s) + "", (l = u.get(v)) ? (r[o] = l, l.__data__ = s[o], u.delete(v)) : n[o] = new ui(t, s[o]); for (o = 0; o < f; ++o) (l = e[o]) && u.get(c[o]) === l && (i[o] = l); } -function tf(t) { +function ef(t) { return t.__data__; } -function ef(t, e) { - if (!arguments.length) return Array.from(this, tf); - var n = e ? Qu : Ju, r = this._parents, i = this._groups; - typeof t != "function" && (t = Zu(t)); +function nf(t, e) { + if (!arguments.length) return Array.from(this, ef); + var n = e ? tf : Qu, r = this._parents, i = this._groups; + typeof t != "function" && (t = Ju(t)); 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], h = i[u], c = h.length, v = nf(t.call(f, f && f.__data__, u, r)), g = v.length, m = o[u] = new Array(g), b = a[u] = new Array(g), A = l[u] = new Array(c); - n(f, h, m, b, A, v, e); - for (var S = 0, T = 0, D, E; S < g; ++S) - if (D = m[S]) { - for (S >= T && (T = S + 1); !(E = b[T]) && ++T < g; ) ; - D._next = E || null; + var f = r[u], h = i[u], c = h.length, v = rf(t.call(f, f && f.__data__, u, r)), g = v.length, m = o[u] = new Array(g), b = a[u] = new Array(g), $ = l[u] = new Array(c); + n(f, h, m, b, $, v, e); + for (var C = 0, T = 0, N, I; C < g; ++C) + if (N = m[C]) { + for (C >= T && (T = C + 1); !(I = b[T]) && ++T < g; ) ; + N._next = I || null; } } - return a = new Vt(a, r), a._enter = o, a._exit = l, a; + return a = new zt(a, r), a._enter = o, a._exit = l, a; } -function nf(t) { +function rf(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function rf() { - return new Vt(this._exit || this._groups.map(mo), this._parents); +function sf() { + return new zt(this._exit || this._groups.map(To), this._parents); } -function sf(t, e, n) { +function af(t, e, n) { var r = this.enter(), i = this, s = this.exit(); return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function af(t) { +function of(t) { for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._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], h = u.length, c = o[l] = new Array(h), v, g = 0; g < h; ++g) (v = u[g] || f[g]) && (c[g] = v); for (; l < i; ++l) o[l] = n[l]; - return new Vt(o, this._parents); + return new zt(o, this._parents); } -function of() { +function lf() { for (var t = this._groups, e = -1, n = t.length; ++e < n; ) for (var r = t[e], 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 lf(t) { - t || (t = uf); +function uf(t) { + t || (t = ff); function e(h, c) { return h && c ? t(h.__data__, c.__data__) : !h - !c; } @@ -3092,19 +3092,19 @@ function lf(t) { (u = a[f]) && (l[f] = u); l.sort(e); } - return new Vt(i, this._parents).order(); + return new zt(i, this._parents).order(); } -function uf(t, e) { +function ff(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function ff() { +function cf() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } -function cf() { +function hf() { return Array.from(this); } -function hf() { +function df() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length; i < s; ++i) { var a = r[i]; @@ -3112,114 +3112,114 @@ function hf() { } return null; } -function df() { +function pf() { let t = 0; for (const e of this) ++t; return t; } -function pf() { +function vf() { return !this.node(); } -function vf(t) { +function gf(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) (o = i[s]) && t.call(o, o.__data__, s, i); return this; } -function gf(t) { +function _f(t) { return function() { this.removeAttribute(t); }; } -function _f(t) { +function mf(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function mf(t, e) { +function yf(t, e) { return function() { this.setAttribute(t, e); }; } -function yf(t, e) { +function wf(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } -function wf(t, e) { +function xf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function xf(t, e) { +function bf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); }; } -function bf(t, e) { - var n = yi(t); +function $f(t, e) { + var n = Ti(t); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((e == null ? n.local ? _f : gf : typeof e == "function" ? n.local ? xf : wf : n.local ? yf : mf)(n, e)); + return this.each((e == null ? n.local ? mf : _f : typeof e == "function" ? n.local ? bf : xf : n.local ? wf : yf)(n, e)); } -function yo(t) { +function No(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function $f(t) { +function Af(t) { return function() { this.style.removeProperty(t); }; } -function Af(t, e, n) { +function Ef(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } -function Ef(t, e, n) { +function Rf(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function Rf(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? $f : typeof e == "function" ? Ef : Af)(t, e, n ?? "")) : Zn(this.node(), t); +function Cf(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? Af : typeof e == "function" ? Rf : Ef)(t, e, n ?? "")) : ur(this.node(), t); } -function Zn(t, e) { - return t.style.getPropertyValue(e) || yo(t).getComputedStyle(t, null).getPropertyValue(e); +function ur(t, e) { + return t.style.getPropertyValue(e) || No(t).getComputedStyle(t, null).getPropertyValue(e); } function Tf(t) { return function() { delete this[t]; }; } -function Cf(t, e) { +function Nf(t, e) { return function() { this[t] = e; }; } -function Nf(t, e) { +function Sf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } -function Sf(t, e) { - return arguments.length > 1 ? this.each((e == null ? Tf : typeof e == "function" ? Nf : Cf)(t, e)) : this.node()[t]; +function kf(t, e) { + return arguments.length > 1 ? this.each((e == null ? Tf : typeof e == "function" ? Sf : Nf)(t, e)) : this.node()[t]; } -function wo(t) { +function So(t) { return t.trim().split(/^|\s+/); } -function ys(t) { - return t.classList || new xo(t); +function Ss(t) { + return t.classList || new ko(t); } -function xo(t) { - this._node = t, this._names = wo(t.getAttribute("class") || ""); +function ko(t) { + this._node = t, this._names = So(t.getAttribute("class") || ""); } -xo.prototype = { +ko.prototype = { add: function(t) { var e = this._names.indexOf(t); e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); @@ -3232,36 +3232,36 @@ xo.prototype = { return this._names.indexOf(t) >= 0; } }; -function bo(t, e) { - for (var n = ys(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +function Mo(t, e) { + for (var n = Ss(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function $o(t, e) { - for (var n = ys(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +function Po(t, e) { + for (var n = Ss(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function kf(t) { +function Mf(t) { return function() { - bo(this, t); + Mo(this, t); }; } -function Mf(t) { +function Pf(t) { return function() { - $o(this, t); + Po(this, t); }; } -function Pf(t, e) { +function Df(t, e) { return function() { - (e.apply(this, arguments) ? bo : $o)(this, t); + (e.apply(this, arguments) ? Mo : Po)(this, t); }; } -function Of(t, e) { - var n = wo(t + ""); +function Ff(t, e) { + var n = So(t + ""); if (arguments.length < 2) { - for (var r = ys(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Ss(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? Pf : e ? kf : Mf)(n, e)); + return this.each((typeof e == "function" ? Df : e ? Mf : Pf)(n, e)); } -function Df() { +function Of() { this.textContent = ""; } function If(t) { @@ -3269,46 +3269,46 @@ function If(t) { this.textContent = t; }; } -function Ff(t) { +function Lf(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } -function Lf(t) { - return arguments.length ? this.each(t == null ? Df : (typeof t == "function" ? Ff : If)(t)) : this.node().textContent; +function qf(t) { + return arguments.length ? this.each(t == null ? Of : (typeof t == "function" ? Lf : If)(t)) : this.node().textContent; } -function qf() { +function Vf() { this.innerHTML = ""; } -function Vf(t) { +function zf(t) { return function() { this.innerHTML = t; }; } -function zf(t) { +function Hf(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } -function Hf(t) { - return arguments.length ? this.each(t == null ? qf : (typeof t == "function" ? zf : Vf)(t)) : this.node().innerHTML; -} -function Yf() { - this.nextSibling && this.parentNode.appendChild(this); +function Yf(t) { + return arguments.length ? this.each(t == null ? Vf : (typeof t == "function" ? Hf : zf)(t)) : this.node().innerHTML; } function Bf() { - return this.each(Yf); + this.nextSibling && this.parentNode.appendChild(this); } function Uf() { + return this.each(Bf); +} +function Wf() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function Xf() { - return this.each(Uf); + return this.each(Wf); } function Gf(t) { - var e = typeof t == "function" ? t : po(t); + var e = typeof t == "function" ? t : Ao(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); @@ -3316,45 +3316,45 @@ function Gf(t) { function Kf() { return null; } -function Wf(t, e) { - var n = typeof t == "function" ? t : po(t), r = e == null ? Kf : typeof e == "function" ? e : ms(e); +function jf(t, e) { + var n = typeof t == "function" ? t : Ao(t), r = e == null ? Kf : typeof e == "function" ? e : Ns(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function jf() { +function Zf() { var t = this.parentNode; t && t.removeChild(this); } -function Zf() { - return this.each(jf); -} function Jf() { + return this.each(Zf); +} +function Qf() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function Qf() { +function tc() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function tc(t) { - return this.select(t ? Qf : Jf); -} function ec(t) { - return arguments.length ? this.property("__data__", t) : this.node().__data__; + return this.select(t ? tc : Qf); } function nc(t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; +} +function rc(t) { return function(e) { t.call(this, e, this.__data__); }; } -function rc(t) { +function ic(t) { return t.trim().split(/^|\s+/).map(function(e) { var n = "", r = e.indexOf("."); return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n }; }); } -function ic(t) { +function sc(t) { return function() { var e = this.__on; if (e) { @@ -3364,9 +3364,9 @@ function ic(t) { } }; } -function sc(t, e, n) { +function ac(t, e, n) { return function() { - var r = this.__on, i, s = nc(e); + var r = this.__on, i, s = rc(e); if (r) { for (var a = 0, o = r.length; a < o; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { @@ -3377,8 +3377,8 @@ function sc(t, e, n) { this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function ac(t, e, n) { - var r = rc(t + ""), i, s = r.length, a; +function oc(t, e, n) { + var r = ic(t + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3389,93 +3389,93 @@ function ac(t, e, n) { } return; } - for (o = e ? sc : ic, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + for (o = e ? ac : sc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); return this; } -function Ao(t, e, n) { - var r = yo(t), i = r.CustomEvent; +function Do(t, e, n) { + var r = No(t), i = r.CustomEvent; typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); } -function oc(t, e) { +function lc(t, e) { return function() { - return Ao(this, t, e); + return Do(this, t, e); }; } -function lc(t, e) { +function uc(t, e) { return function() { - return Ao(this, t, e.apply(this, arguments)); + return Do(this, t, e.apply(this, arguments)); }; } -function uc(t, e) { - return this.each((typeof e == "function" ? lc : oc)(t, e)); +function fc(t, e) { + return this.each((typeof e == "function" ? uc : lc)(t, e)); } -function* fc() { +function* cc() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var Eo = [null]; -function Vt(t, e) { +var Fo = [null]; +function zt(t, e) { this._groups = t, this._parents = e; } -function nr() { - return new Vt([[document.documentElement]], Eo); +function dr() { + return new zt([[document.documentElement]], Fo); } -function cc() { +function hc() { return this; } -Vt.prototype = nr.prototype = { - constructor: Vt, +zt.prototype = dr.prototype = { + constructor: zt, select: Iu, - selectAll: Vu, - selectChild: Bu, + selectAll: zu, + selectChild: Uu, selectChildren: Ku, - filter: Wu, - data: ef, - enter: ju, - exit: rf, - join: sf, - merge: af, - selection: cc, - order: of, - sort: lf, - call: ff, - nodes: cf, - node: hf, - size: df, - empty: pf, - each: vf, - attr: bf, - style: Rf, - property: Sf, - classed: Of, - text: Lf, - html: Hf, - raise: Bf, + filter: ju, + data: nf, + enter: Zu, + exit: sf, + join: af, + merge: of, + selection: hc, + order: lf, + sort: uf, + call: cf, + nodes: hf, + node: df, + size: pf, + empty: vf, + each: gf, + attr: $f, + style: Cf, + property: kf, + classed: Ff, + text: qf, + html: Yf, + raise: Uf, lower: Xf, append: Gf, - insert: Wf, - remove: Zf, - clone: tc, - datum: ec, - on: ac, - dispatch: uc, - [Symbol.iterator]: fc + insert: jf, + remove: Jf, + clone: ec, + datum: nc, + on: oc, + dispatch: fc, + [Symbol.iterator]: cc }; function gt(t) { - return typeof t == "string" ? new Vt([[document.querySelector(t)]], [document.documentElement]) : new Vt([[t]], Eo); + return typeof t == "string" ? new zt([[document.querySelector(t)]], [document.documentElement]) : new zt([[t]], Fo); } -function ws(t, e, n) { +function ks(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } -function Ro(t, e) { +function Oo(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } -function Cr() { +function zr() { } -var _r = 0.7, ei = 1 / _r, In = "\\s*([+-]?\\d+)\\s*", mr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Ce = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", hc = /^#([0-9a-f]{3,8})$/, dc = new RegExp(`^rgb\\(${In},${In},${In}\\)$`), pc = new RegExp(`^rgb\\(${Ce},${Ce},${Ce}\\)$`), vc = new RegExp(`^rgba\\(${In},${In},${In},${mr}\\)$`), gc = new RegExp(`^rgba\\(${Ce},${Ce},${Ce},${mr}\\)$`), _c = new RegExp(`^hsl\\(${mr},${Ce},${Ce}\\)$`), mc = new RegExp(`^hsla\\(${mr},${Ce},${Ce},${mr}\\)$`), Gs = { +var Sr = 0.7, fi = 1 / Sr, Gn = "\\s*([+-]?\\d+)\\s*", kr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Re = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", dc = /^#([0-9a-f]{3,8})$/, pc = new RegExp(`^rgb\\(${Gn},${Gn},${Gn}\\)$`), vc = new RegExp(`^rgb\\(${Re},${Re},${Re}\\)$`), gc = new RegExp(`^rgba\\(${Gn},${Gn},${Gn},${kr}\\)$`), _c = new RegExp(`^rgba\\(${Re},${Re},${Re},${kr}\\)$`), mc = new RegExp(`^hsl\\(${kr},${Re},${Re}\\)$`), yc = new RegExp(`^hsla\\(${kr},${Re},${Re},${kr}\\)$`), ra = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3625,171 +3625,171 @@ var _r = 0.7, ei = 1 / _r, In = "\\s*([+-]?\\d+)\\s*", mr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -ws(Cr, Tn, { +ks(zr, In, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, - hex: Ks, + hex: ia, // Deprecated! Use color.formatHex. - formatHex: Ks, - formatHex8: yc, - formatHsl: wc, - formatRgb: Ws, - toString: Ws + formatHex: ia, + formatHex8: wc, + formatHsl: xc, + formatRgb: sa, + toString: sa }); -function Ks() { +function ia() { return this.rgb().formatHex(); } -function yc() { +function wc() { return this.rgb().formatHex8(); } -function wc() { - return To(this).formatHsl(); +function xc() { + return Io(this).formatHsl(); } -function Ws() { +function sa() { return this.rgb().formatRgb(); } -function Tn(t) { +function In(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = hc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? js(e) : n === 3 ? new Mt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Fr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Fr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = dc.exec(t)) ? new Mt(e[1], e[2], e[3], 1) : (e = pc.exec(t)) ? new Mt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = vc.exec(t)) ? Fr(e[1], e[2], e[3], e[4]) : (e = gc.exec(t)) ? Fr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = _c.exec(t)) ? Qs(e[1], e[2] / 100, e[3] / 100, 1) : (e = mc.exec(t)) ? Qs(e[1], e[2] / 100, e[3] / 100, e[4]) : Gs.hasOwnProperty(t) ? js(Gs[t]) : t === "transparent" ? new Mt(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = dc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? aa(e) : n === 3 ? new Dt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Wr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Wr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = pc.exec(t)) ? new Dt(e[1], e[2], e[3], 1) : (e = vc.exec(t)) ? new Dt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = gc.exec(t)) ? Wr(e[1], e[2], e[3], e[4]) : (e = _c.exec(t)) ? Wr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = mc.exec(t)) ? ua(e[1], e[2] / 100, e[3] / 100, 1) : (e = yc.exec(t)) ? ua(e[1], e[2] / 100, e[3] / 100, e[4]) : ra.hasOwnProperty(t) ? aa(ra[t]) : t === "transparent" ? new Dt(NaN, NaN, NaN, 0) : null; } -function js(t) { - return new Mt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +function aa(t) { + return new Dt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function Fr(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new Mt(t, e, n, r); +function Wr(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new Dt(t, e, n, r); } -function xc(t) { - return t instanceof Cr || (t = Tn(t)), t ? (t = t.rgb(), new Mt(t.r, t.g, t.b, t.opacity)) : new Mt(); +function bc(t) { + return t instanceof zr || (t = In(t)), t ? (t = t.rgb(), new Dt(t.r, t.g, t.b, t.opacity)) : new Dt(); } -function ji(t, e, n, r) { - return arguments.length === 1 ? xc(t) : new Mt(t, e, n, r ?? 1); +function os(t, e, n, r) { + return arguments.length === 1 ? bc(t) : new Dt(t, e, n, r ?? 1); } -function Mt(t, e, n, r) { +function Dt(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -ws(Mt, ji, Ro(Cr, { +ks(Dt, os, Oo(zr, { brighter(t) { - return t = t == null ? ei : Math.pow(ei, t), new Mt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? fi : Math.pow(fi, t), new Dt(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? _r : Math.pow(_r, t), new Mt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Sr : Math.pow(Sr, t), new Dt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new Mt(bn(this.r), bn(this.g), bn(this.b), ni(this.opacity)); + return new Dt(Mn(this.r), Mn(this.g), Mn(this.b), ci(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: Zs, + hex: oa, // Deprecated! Use color.formatHex. - formatHex: Zs, - formatHex8: bc, - formatRgb: Js, - toString: Js + formatHex: oa, + formatHex8: $c, + formatRgb: la, + toString: la })); -function Zs() { - return `#${cn(this.r)}${cn(this.g)}${cn(this.b)}`; +function oa() { + return `#${xn(this.r)}${xn(this.g)}${xn(this.b)}`; } -function bc() { - return `#${cn(this.r)}${cn(this.g)}${cn(this.b)}${cn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function $c() { + return `#${xn(this.r)}${xn(this.g)}${xn(this.b)}${xn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function Js() { - const t = ni(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${bn(this.r)}, ${bn(this.g)}, ${bn(this.b)}${t === 1 ? ")" : `, ${t})`}`; +function la() { + const t = ci(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${Mn(this.r)}, ${Mn(this.g)}, ${Mn(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function ni(t) { +function ci(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function bn(t) { +function Mn(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function cn(t) { - return t = bn(t), (t < 16 ? "0" : "") + t.toString(16); +function xn(t) { + return t = Mn(t), (t < 16 ? "0" : "") + t.toString(16); } -function Qs(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new fe(t, e, n, r); +function ua(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new le(t, e, n, r); } -function To(t) { - if (t instanceof fe) return new fe(t.h, t.s, t.l, t.opacity); - if (t instanceof Cr || (t = Tn(t)), !t) return new fe(); - if (t instanceof fe) return t; +function Io(t) { + if (t instanceof le) return new le(t.h, t.s, t.l, t.opacity); + if (t instanceof zr || (t = In(t)), !t) return new le(); + if (t instanceof le) return t; t = t.rgb(); var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new fe(a, o, l, t.opacity); + return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new le(a, o, l, t.opacity); } -function $c(t, e, n, r) { - return arguments.length === 1 ? To(t) : new fe(t, e, n, r ?? 1); +function Ac(t, e, n, r) { + return arguments.length === 1 ? Io(t) : new le(t, e, n, r ?? 1); } -function fe(t, e, n, r) { +function le(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -ws(fe, $c, Ro(Cr, { +ks(le, Ac, Oo(zr, { brighter(t) { - return t = t == null ? ei : Math.pow(ei, t), new fe(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? fi : Math.pow(fi, t), new le(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? _r : Math.pow(_r, t), new fe(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Sr : Math.pow(Sr, t), new le(this.h, this.s, this.l * t, this.opacity); }, rgb() { var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; - return new Mt( - Mi(t >= 240 ? t - 240 : t + 120, i, r), - Mi(t, i, r), - Mi(t < 120 ? t + 240 : t - 120, i, r), + return new Dt( + Yi(t >= 240 ? t - 240 : t + 120, i, r), + Yi(t, i, r), + Yi(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new fe(ta(this.h), Lr(this.s), Lr(this.l), ni(this.opacity)); + return new le(fa(this.h), Xr(this.s), Xr(this.l), ci(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 t = ni(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${ta(this.h)}, ${Lr(this.s) * 100}%, ${Lr(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = ci(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${fa(this.h)}, ${Xr(this.s) * 100}%, ${Xr(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function ta(t) { +function fa(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function Lr(t) { +function Xr(t) { return Math.max(0, Math.min(1, t || 0)); } -function Mi(t, e, n) { +function Yi(t, e, n) { return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; } -const xs = (t) => () => t; -function Ac(t, e) { +const Ms = (t) => () => t; +function Ec(t, e) { return function(n) { return t + n * e; }; } -function Ec(t, e, n) { +function Rc(t, e, n) { return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) { return Math.pow(t + r * e, n); }; } -function Rc(t) { - return (t = +t) == 1 ? Co : function(e, n) { - return n - e ? Ec(e, n, t) : xs(isNaN(e) ? n : e); +function Cc(t) { + return (t = +t) == 1 ? Lo : function(e, n) { + return n - e ? Rc(e, n, t) : Ms(isNaN(e) ? n : e); }; } -function Co(t, e) { +function Lo(t, e) { var n = e - t; - return n ? Ac(t, n) : xs(isNaN(t) ? e : t); + return n ? Ec(t, n) : Ms(isNaN(t) ? e : t); } -const ri = (function t(e) { - var n = Rc(e); +const hi = (function t(e) { + var n = Cc(e); function r(i, s) { - var a = n((i = ji(i)).r, (s = ji(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Co(i.opacity, s.opacity); + var a = n((i = os(i)).r, (s = os(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Lo(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 + ""; }; @@ -3804,64 +3804,64 @@ function Tc(t, e) { return r; }; } -function Cc(t) { +function Nc(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function Nc(t, e) { +function Sc(t, e) { var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = On(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = Wn(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function Sc(t, e) { +function kc(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; }; } -function Te(t, e) { +function Ee(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } -function kc(t, e) { +function Mc(t, e) { var n = {}, r = {}, i; (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); for (i in e) - i in t ? n[i] = On(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = Wn(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var Zi = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Pi = new RegExp(Zi.source, "g"); -function Mc(t) { +var ls = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Bi = new RegExp(ls.source, "g"); +function Pc(t) { return function() { return t; }; } -function Pc(t) { +function Dc(t) { return function(e) { return t(e) + ""; }; } -function No(t, e) { - var n = Zi.lastIndex = Pi.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = Zi.exec(t)) && (i = Pi.exec(e)); ) - (s = i.index) > n && (s = e.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: Te(r, i) })), n = Pi.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Pc(l[0].x) : Mc(e) : (e = l.length, function(u) { +function qo(t, e) { + var n = ls.lastIndex = Bi.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (t = t + "", e = e + ""; (r = ls.exec(t)) && (i = Bi.exec(e)); ) + (s = i.index) > n && (s = e.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: Ee(r, i) })), n = Bi.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Dc(l[0].x) : Pc(e) : (e = l.length, function(u) { for (var f = 0, h; f < e; ++f) o[(h = l[f]).i] = h.x(u); return o.join(""); }); } -function On(t, e) { +function Wn(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? xs(e) : (n === "number" ? Te : n === "string" ? (r = Tn(e)) ? (e = r, ri) : No : e instanceof Tn ? ri : e instanceof Date ? Sc : Cc(e) ? Tc : Array.isArray(e) ? Nc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? kc : Te)(t, e); + return e == null || n === "boolean" ? Ms(e) : (n === "number" ? Ee : n === "string" ? (r = In(e)) ? (e = r, hi) : qo : e instanceof In ? hi : e instanceof Date ? kc : Nc(e) ? Tc : Array.isArray(e) ? Sc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Mc : Ee)(t, e); } -var ea = 180 / Math.PI, Ji = { +var ca = 180 / Math.PI, us = { translateX: 0, translateY: 0, rotate: 0, @@ -3869,45 +3869,45 @@ var ea = 180 / Math.PI, Ji = { scaleX: 1, scaleY: 1 }; -function So(t, e, n, r, i, s) { +function Vo(t, e, n, r, i, s) { var a, o, l; return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(e, t) * ea, - skewX: Math.atan(l) * ea, + rotate: Math.atan2(e, t) * ca, + skewX: Math.atan(l) * ca, scaleX: a, scaleY: o }; } -var qr; -function Oc(t) { +var Gr; +function Fc(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? Ji : So(e.a, e.b, e.c, e.d, e.e, e.f); + return e.isIdentity ? us : Vo(e.a, e.b, e.c, e.d, e.e, e.f); } -function Dc(t) { - return t == null || (qr || (qr = document.createElementNS("http://www.w3.org/2000/svg", "g")), qr.setAttribute("transform", t), !(t = qr.transform.baseVal.consolidate())) ? Ji : (t = t.matrix, So(t.a, t.b, t.c, t.d, t.e, t.f)); +function Oc(t) { + return t == null || (Gr || (Gr = document.createElementNS("http://www.w3.org/2000/svg", "g")), Gr.setAttribute("transform", t), !(t = Gr.transform.baseVal.consolidate())) ? us : (t = t.matrix, Vo(t.a, t.b, t.c, t.d, t.e, t.f)); } -function ko(t, e, n, r) { +function zo(t, e, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } function s(u, f, h, c, v, g) { if (u !== h || f !== c) { var m = v.push("translate(", null, e, null, n); - g.push({ i: m - 4, x: Te(u, h) }, { i: m - 2, x: Te(f, c) }); + g.push({ i: m - 4, x: Ee(u, h) }, { i: m - 2, x: Ee(f, c) }); } else (h || c) && v.push("translate(" + h + e + c + n); } function a(u, f, h, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Te(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Ee(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); } function o(u, f, h, c) { - u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Te(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); + u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Ee(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); } function l(u, f, h, c, v, g) { if (u !== h || f !== c) { var m = v.push(i(v) + "scale(", null, ",", null, ")"); - g.push({ i: m - 4, x: Te(u, h) }, { i: m - 2, x: Te(f, c) }); + g.push({ i: m - 4, x: Ee(u, h) }, { i: m - 2, x: Ee(f, c) }); } else (h !== 1 || c !== 1) && v.push(i(v) + "scale(" + h + "," + c + ")"); } return function(u, f) { @@ -3918,138 +3918,138 @@ function ko(t, e, n, r) { }; }; } -var Ic = ko(Oc, "px, ", "px)", "deg)"), Fc = ko(Dc, ", ", ")", ")"), Jn = 0, ur = 0, or = 0, Mo = 1e3, ii, fr, si = 0, Cn = 0, wi = 0, yr = typeof performance == "object" && performance.now ? performance : Date, Po = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Ic = zo(Fc, "px, ", "px)", "deg)"), Lc = zo(Oc, ", ", ")", ")"), fr = 0, br = 0, wr = 0, Ho = 1e3, di, $r, pi = 0, Ln = 0, Ni = 0, Mr = typeof performance == "object" && performance.now ? performance : Date, Yo = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; -function bs() { - return Cn || (Po(Lc), Cn = yr.now() + wi); +function Ps() { + return Ln || (Yo(qc), Ln = Mr.now() + Ni); } -function Lc() { - Cn = 0; +function qc() { + Ln = 0; } -function ai() { +function vi() { this._call = this._time = this._next = null; } -ai.prototype = Oo.prototype = { - constructor: ai, +vi.prototype = Bo.prototype = { + constructor: vi, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? bs() : +n) + (e == null ? 0 : +e), !this._next && fr !== this && (fr ? fr._next = this : ii = this, fr = this), this._call = t, this._time = n, Qi(); + n = (n == null ? Ps() : +n) + (e == null ? 0 : +e), !this._next && $r !== this && ($r ? $r._next = this : di = this, $r = this), this._call = t, this._time = n, fs(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, Qi()); + this._call && (this._call = null, this._time = 1 / 0, fs()); } }; -function Oo(t, e, n) { - var r = new ai(); +function Bo(t, e, n) { + var r = new vi(); return r.restart(t, e, n), r; } -function qc() { - bs(), ++Jn; - for (var t = ii, e; t; ) - (e = Cn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --Jn; +function Vc() { + Ps(), ++fr; + for (var t = di, e; t; ) + (e = Ln - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --fr; } -function na() { - Cn = (si = yr.now()) + wi, Jn = ur = 0; +function ha() { + Ln = (pi = Mr.now()) + Ni, fr = br = 0; try { - qc(); + Vc(); } finally { - Jn = 0, zc(), Cn = 0; + fr = 0, Hc(), Ln = 0; } } -function Vc() { - var t = yr.now(), e = t - si; - e > Mo && (wi -= e, si = t); -} function zc() { - for (var t, e = ii, n, r = 1 / 0; e; ) - e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : ii = n); - fr = t, Qi(r); + var t = Mr.now(), e = t - pi; + e > Ho && (Ni -= e, pi = t); } -function Qi(t) { - if (!Jn) { - ur && (ur = clearTimeout(ur)); - var e = t - Cn; - e > 24 ? (t < 1 / 0 && (ur = setTimeout(na, t - yr.now() - wi)), or && (or = clearInterval(or))) : (or || (si = yr.now(), or = setInterval(Vc, Mo)), Jn = 1, Po(na)); +function Hc() { + for (var t, e = di, n, r = 1 / 0; e; ) + e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : di = n); + $r = t, fs(r); +} +function fs(t) { + if (!fr) { + br && (br = clearTimeout(br)); + var e = t - Ln; + e > 24 ? (t < 1 / 0 && (br = setTimeout(ha, t - Mr.now() - Ni)), wr && (wr = clearInterval(wr))) : (wr || (pi = Mr.now(), wr = setInterval(zc, Ho)), fr = 1, Yo(ha)); } } -function ra(t, e, n) { - var r = new ai(); +function da(t, e, n) { + var r = new vi(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var Hc = ho("start", "end", "cancel", "interrupt"), Yc = [], Do = 0, ia = 1, ts = 2, Gr = 3, sa = 4, es = 5, Kr = 6; -function xi(t, e, n, r, i, s) { +var Yc = $o("start", "end", "cancel", "interrupt"), Bc = [], Uo = 0, pa = 1, cs = 2, ni = 3, va = 4, hs = 5, ri = 6; +function Si(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - Bc(t, n, { + Uc(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. - on: Hc, - tween: Yc, + on: Yc, + tween: Bc, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: Do + state: Uo }); } -function $s(t, e) { - var n = ve(t, e); - if (n.state > Do) throw new Error("too late; already scheduled"); +function Ds(t, e) { + var n = de(t, e); + if (n.state > Uo) throw new Error("too late; already scheduled"); return n; } -function Pe(t, e) { - var n = ve(t, e); - if (n.state > Gr) throw new Error("too late; already running"); +function ke(t, e) { + var n = de(t, e); + if (n.state > ni) throw new Error("too late; already running"); return n; } -function ve(t, e) { +function de(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Bc(t, e, n) { +function Uc(t, e, n) { var r = t.__transition, i; - r[e] = n, n.timer = Oo(s, 0, n.time); + r[e] = n, n.timer = Bo(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 = pa, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { var f, h, c, v; - if (n.state !== ia) return l(); + if (n.state !== pa) return l(); for (f in r) if (v = r[f], v.name === n.name) { - if (v.state === Gr) return ra(a); - v.state === sa ? (v.state = Kr, v.timer.stop(), v.on.call("interrupt", t, t.__data__, v.index, v.group), delete r[f]) : +f < e && (v.state = Kr, v.timer.stop(), v.on.call("cancel", t, t.__data__, v.index, v.group), delete r[f]); + if (v.state === ni) return da(a); + v.state === va ? (v.state = ri, v.timer.stop(), v.on.call("interrupt", t, t.__data__, v.index, v.group), delete r[f]) : +f < e && (v.state = ri, v.timer.stop(), v.on.call("cancel", t, t.__data__, v.index, v.group), delete r[f]); } - if (ra(function() { - n.state === Gr && (n.state = sa, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = ts, n.on.call("start", t, t.__data__, n.index, n.group), n.state === ts) { - for (n.state = Gr, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) + if (da(function() { + n.state === ni && (n.state = va, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = cs, n.on.call("start", t, t.__data__, n.index, n.group), n.state === cs) { + for (n.state = ni, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) (v = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = v); i.length = h + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = es, 1), h = -1, c = i.length; ++h < c; ) + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = hs, 1), h = -1, c = i.length; ++h < c; ) i[h].call(t, f); - n.state === es && (n.on.call("end", t, t.__data__, n.index, n.group), l()); + n.state === hs && (n.on.call("end", t, t.__data__, n.index, n.group), l()); } function l() { - n.state = Kr, n.timer.stop(), delete r[e]; + n.state = ri, n.timer.stop(), delete r[e]; for (var u in r) return; delete t.__transition; } } -function Uc(t, e) { +function Wc(t, e) { var n = t.__transition, r, i, s = !0, a; if (n) { e = e == null ? null : e + ""; @@ -4058,20 +4058,20 @@ function Uc(t, e) { s = !1; continue; } - i = r.state > ts && r.state < es, r.state = Kr, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > cs && r.state < hs, r.state = ri, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } function Xc(t) { return this.each(function() { - Uc(this, t); + Wc(this, t); }); } function Gc(t, e) { var n, r; return function() { - var i = Pe(this, t), s = i.tween; + var i = ke(this, t), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) @@ -4087,7 +4087,7 @@ function Kc(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Pe(this, t), a = s.tween; + var s = ke(this, t), a = s.tween; if (a !== r) { i = (r = a).slice(); for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) @@ -4100,268 +4100,268 @@ function Kc(t, e, n) { s.tween = i; }; } -function Wc(t, e) { +function jc(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = ve(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = de(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) if ((a = r[i]).name === t) return a.value; return null; } return this.each((e == null ? Gc : Kc)(n, t, e)); } -function As(t, e, n) { +function Fs(t, e, n) { var r = t._id; return t.each(function() { - var i = Pe(this, r); + var i = ke(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return ve(i, r).value[e]; + return de(i, r).value[e]; }; } -function Io(t, e) { +function Wo(t, e) { var n; - return (typeof e == "number" ? Te : e instanceof Tn ? ri : (n = Tn(e)) ? (e = n, ri) : No)(t, e); + return (typeof e == "number" ? Ee : e instanceof In ? hi : (n = In(e)) ? (e = n, hi) : qo)(t, e); } -function jc(t) { +function Zc(t) { return function() { this.removeAttribute(t); }; } -function Zc(t) { +function Jc(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function Jc(t, e, n) { +function Qc(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttribute(t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function Qc(t, e, n) { +function th(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttributeNS(t.space, t.local); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function th(t, e, n) { +function eh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function eh(t, e, n) { +function nh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function nh(t, e) { - var n = yi(t), r = n === "transform" ? Fc : Io; - return this.attrTween(t, typeof e == "function" ? (n.local ? eh : th)(n, r, As(this, "attr." + t, e)) : e == null ? (n.local ? Zc : jc)(n) : (n.local ? Qc : Jc)(n, r, e)); -} function rh(t, e) { + var n = Ti(t), r = n === "transform" ? Lc : Wo; + return this.attrTween(t, typeof e == "function" ? (n.local ? nh : eh)(n, r, Fs(this, "attr." + t, e)) : e == null ? (n.local ? Jc : Zc)(n) : (n.local ? th : Qc)(n, r, e)); +} +function ih(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function ih(t, e) { +function sh(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function sh(t, e) { +function ah(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && ih(t, s)), n; + return s !== r && (n = (r = s) && sh(t, s)), n; } return i._value = e, i; } -function ah(t, e) { +function oh(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && rh(t, s)), n; + return s !== r && (n = (r = s) && ih(t, s)), n; } return i._value = e, i; } -function oh(t, e) { +function lh(t, e) { var n = "attr." + t; if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (e == null) return this.tween(n, null); if (typeof e != "function") throw new Error(); - var r = yi(t); - return this.tween(n, (r.local ? sh : ah)(r, e)); + var r = Ti(t); + return this.tween(n, (r.local ? ah : oh)(r, e)); } -function lh(t, e) { +function uh(t, e) { return function() { - $s(this, t).delay = +e.apply(this, arguments); + Ds(this, t).delay = +e.apply(this, arguments); }; } -function uh(t, e) { +function fh(t, e) { return e = +e, function() { - $s(this, t).delay = e; + Ds(this, t).delay = e; }; } -function fh(t) { +function ch(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? lh : uh)(e, t)) : ve(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? uh : fh)(e, t)) : de(this.node(), e).delay; } -function ch(t, e) { +function hh(t, e) { return function() { - Pe(this, t).duration = +e.apply(this, arguments); + ke(this, t).duration = +e.apply(this, arguments); }; } -function hh(t, e) { +function dh(t, e) { return e = +e, function() { - Pe(this, t).duration = e; + ke(this, t).duration = e; }; } -function dh(t) { +function ph(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? ch : hh)(e, t)) : ve(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? hh : dh)(e, t)) : de(this.node(), e).duration; } -function ph(t, e) { +function vh(t, e) { if (typeof e != "function") throw new Error(); return function() { - Pe(this, t).ease = e; + ke(this, t).ease = e; }; } -function vh(t) { +function gh(t) { var e = this._id; - return arguments.length ? this.each(ph(e, t)) : ve(this.node(), e).ease; + return arguments.length ? this.each(vh(e, t)) : de(this.node(), e).ease; } -function gh(t, e) { +function _h(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - Pe(this, t).ease = n; + ke(this, t).ease = n; }; } -function _h(t) { +function mh(t) { if (typeof t != "function") throw new Error(); - return this.each(gh(this._id, t)); + return this.each(_h(this._id, t)); } -function mh(t) { - typeof t != "function" && (t = go(t)); +function yh(t) { + typeof t != "function" && (t = Ro(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new Be(r, this._parents, this._name, this._id); + return new Ke(r, this._parents, this._name, this._id); } -function yh(t) { +function wh(t) { if (t._id !== this._id) throw new Error(); for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) for (var l = e[o], u = n[o], f = l.length, h = a[o] = new Array(f), c, v = 0; v < f; ++v) (c = l[v] || u[v]) && (h[v] = c); for (; o < r; ++o) a[o] = e[o]; - return new Be(a, this._parents, this._name, this._id); + return new Ke(a, this._parents, this._name, this._id); } -function wh(t) { +function xh(t) { return (t + "").trim().split(/^|\s+/).every(function(e) { var n = e.indexOf("."); return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; }); } -function xh(t, e, n) { - var r, i, s = wh(e) ? $s : Pe; +function bh(t, e, n) { + var r, i, s = xh(e) ? Ds : ke; return function() { var a = s(this, t), o = a.on; o !== r && (i = (r = o).copy()).on(e, n), a.on = i; }; } -function bh(t, e) { +function $h(t, e) { var n = this._id; - return arguments.length < 2 ? ve(this.node(), n).on.on(t) : this.each(xh(n, t, e)); + return arguments.length < 2 ? de(this.node(), n).on.on(t) : this.each(bh(n, t, e)); } -function $h(t) { +function Ah(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } -function Ah() { - return this.on("end.remove", $h(this._id)); +function Eh() { + return this.on("end.remove", Ah(this._id)); } -function Eh(t) { +function Rh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = ms(t)); + typeof t != "function" && (t = Ns(t)); 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, h, c = 0; c < l; ++c) - (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, xi(u[c], e, n, c, u, ve(f, n))); - return new Be(s, this._parents, e, n); + (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Si(u[c], e, n, c, u, de(f, n))); + return new Ke(s, this._parents, e, n); } -function Rh(t) { +function Ch(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = vo(t)); + typeof t != "function" && (t = Eo(t)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) for (var l = r[o], u = l.length, f, h = 0; h < u; ++h) if (f = l[h]) { - for (var c = t.call(f, f.__data__, h, l), v, g = ve(f, n), m = 0, b = c.length; m < b; ++m) - (v = c[m]) && xi(v, e, n, m, c, g); + for (var c = t.call(f, f.__data__, h, l), v, g = de(f, n), m = 0, b = c.length; m < b; ++m) + (v = c[m]) && Si(v, e, n, m, c, g); s.push(c), a.push(f); } - return new Be(s, a, e, n); + return new Ke(s, a, e, n); } -var Th = nr.prototype.constructor; -function Ch() { +var Th = dr.prototype.constructor; +function Nh() { return new Th(this._groups, this._parents); } -function Nh(t, e) { +function Sh(t, e) { var n, r, i; return function() { - var s = Zn(this, t), a = (this.style.removeProperty(t), Zn(this, t)); + var s = ur(this, t), a = (this.style.removeProperty(t), ur(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function Fo(t) { +function Xo(t) { return function() { this.style.removeProperty(t); }; } -function Sh(t, e, n) { +function kh(t, e, n) { var r, i = n + "", s; return function() { - var a = Zn(this, t); + var a = ur(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function kh(t, e, n) { +function Mh(t, e, n) { var r, i, s; return function() { - var a = Zn(this, t), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(t), Zn(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + var a = ur(this, t), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(t), ur(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); }; } -function Mh(t, e) { +function Ph(t, e) { var n, r, i, s = "style." + e, a = "end." + s, o; return function() { - var l = Pe(this, t), u = l.on, f = l.value[s] == null ? o || (o = Fo(e)) : void 0; + var l = ke(this, t), u = l.on, f = l.value[s] == null ? o || (o = Xo(e)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function Ph(t, e, n) { - var r = (t += "") == "transform" ? Ic : Io; - return e == null ? this.styleTween(t, Nh(t, r)).on("end.style." + t, Fo(t)) : typeof e == "function" ? this.styleTween(t, kh(t, r, As(this, "style." + t, e))).each(Mh(this._id, t)) : this.styleTween(t, Sh(t, r, e), n).on("end.style." + t, null); +function Dh(t, e, n) { + var r = (t += "") == "transform" ? Ic : Wo; + return e == null ? this.styleTween(t, Sh(t, r)).on("end.style." + t, Xo(t)) : typeof e == "function" ? this.styleTween(t, Mh(t, r, Fs(this, "style." + t, e))).each(Ph(this._id, t)) : this.styleTween(t, kh(t, r, e), n).on("end.style." + t, null); } -function Oh(t, e, n) { +function Fh(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } -function Dh(t, e, n) { +function Oh(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && Oh(t, a, n)), r; + return a !== i && (r = (i = a) && Fh(t, a, n)), r; } return s._value = e, s; } @@ -4370,110 +4370,110 @@ function Ih(t, e, n) { if (arguments.length < 2) return (r = this.tween(r)) && r._value; if (e == null) return this.tween(r, null); if (typeof e != "function") throw new Error(); - return this.tween(r, Dh(t, e, n ?? "")); + return this.tween(r, Oh(t, e, n ?? "")); } -function Fh(t) { +function Lh(t) { return function() { this.textContent = t; }; } -function Lh(t) { +function qh(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function qh(t) { - return this.tween("text", typeof t == "function" ? Lh(As(this, "text", t)) : Fh(t == null ? "" : t + "")); -} function Vh(t) { + return this.tween("text", typeof t == "function" ? qh(Fs(this, "text", t)) : Lh(t == null ? "" : t + "")); +} +function zh(t) { return function(e) { this.textContent = t.call(this, e); }; } -function zh(t) { +function Hh(t) { var e, n; function r() { var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && Vh(i)), e; + return i !== n && (e = (n = i) && zh(i)), e; } return r._value = t, r; } -function Hh(t) { +function Yh(t) { var e = "text"; if (arguments.length < 1) return (e = this.tween(e)) && e._value; if (t == null) return this.tween(e, null); if (typeof t != "function") throw new Error(); - return this.tween(e, zh(t)); + return this.tween(e, Hh(t)); } -function Yh() { - for (var t = this._name, e = this._id, n = Lo(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function Bh() { + for (var t = this._name, e = this._id, n = Go(), 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 = ve(l, e); - xi(l, t, n, u, a, { + var f = de(l, e); + Si(l, t, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new Be(r, this._parents, t, n); + return new Ke(r, this._parents, t, n); } -function Bh() { +function Uh() { var t, e, 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 = Pe(this, r), f = u.on; + var u = ke(this, r), f = u.on; f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; }), i === 0 && s(); }); } -var Uh = 0; -function Be(t, e, n, r) { +var Wh = 0; +function Ke(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function Wr(t) { - return nr().transition(t); -} -function Lo() { - return ++Uh; -} -var Oe = nr.prototype; -Be.prototype = Wr.prototype = { - constructor: Be, - select: Eh, - selectAll: Rh, - selectChild: Oe.selectChild, - selectChildren: Oe.selectChildren, - filter: mh, - merge: yh, - selection: Ch, - transition: Yh, - call: Oe.call, - nodes: Oe.nodes, - node: Oe.node, - size: Oe.size, - empty: Oe.empty, - each: Oe.each, - on: bh, - attr: nh, - attrTween: oh, - style: Ph, +function ii(t) { + return dr().transition(t); +} +function Go() { + return ++Wh; +} +var qe = dr.prototype; +Ke.prototype = ii.prototype = { + constructor: Ke, + select: Rh, + selectAll: Ch, + selectChild: qe.selectChild, + selectChildren: qe.selectChildren, + filter: yh, + merge: wh, + selection: Nh, + transition: Bh, + call: qe.call, + nodes: qe.nodes, + node: qe.node, + size: qe.size, + empty: qe.empty, + each: qe.each, + on: $h, + attr: rh, + attrTween: lh, + style: Dh, styleTween: Ih, - text: qh, - textTween: Hh, - remove: Ah, - tween: Wc, - delay: fh, - duration: dh, - ease: vh, - easeVarying: _h, - end: Bh, - [Symbol.iterator]: Oe[Symbol.iterator] + text: Vh, + textTween: Yh, + remove: Eh, + tween: jc, + delay: ch, + duration: ph, + ease: gh, + easeVarying: mh, + end: Uh, + [Symbol.iterator]: qe[Symbol.iterator] }; function Xh(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; @@ -4491,26 +4491,26 @@ function Kh(t, e) { throw new Error(`transition ${e} not found`); return n; } -function Wh(t) { +function jh(t) { var e, n; - t instanceof Be ? (e = t._id, t = t._name) : (e = Lo(), (n = Gh).time = bs(), t = t == null ? null : t + ""); + t instanceof Ke ? (e = t._id, t = t._name) : (e = Go(), (n = Gh).time = Ps(), t = t == null ? null : t + ""); 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]) && xi(l, t, e, u, a, n || Kh(l, e)); - return new Be(r, this._parents, t, e); + (l = a[u]) && Si(l, t, e, u, a, n || Kh(l, e)); + return new Ke(r, this._parents, t, e); } -nr.prototype.interrupt = Xc; -nr.prototype.transition = Wh; -const ns = Math.PI, rs = 2 * ns, an = 1e-6, jh = rs - an; -function qo(t) { +dr.prototype.interrupt = Xc; +dr.prototype.transition = jh; +const ds = Math.PI, ps = 2 * ds, gn = 1e-6, Zh = ps - gn; +function Ko(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function Zh(t) { +function Jh(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return qo; + if (e > 15) return Ko; const n = 10 ** e; return function(r) { this._ += r[0]; @@ -4518,10 +4518,10 @@ function Zh(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Jh { +class Qh { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? qo : Zh(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? Ko : Jh(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -4543,17 +4543,17 @@ class Jh { let a = this._x1, o = this._y1, l = r - e, u = i - n, f = a - e, h = o - n, c = f * f + h * h; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > an) if (!(Math.abs(h * l - u * f) > an) || !s) + else if (c > gn) if (!(Math.abs(h * l - u * f) > gn) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let v = r - a, g = i - o, m = l * l + u * u, b = v * v + g * g, A = Math.sqrt(m), S = Math.sqrt(c), T = s * Math.tan((ns - Math.acos((m + c - b) / (2 * A * S))) / 2), D = T / S, E = T / A; - Math.abs(D - 1) > an && this._append`L${e + D * f},${n + D * h}`, this._append`A${s},${s},0,0,${+(h * v > f * g)},${this._x1 = e + E * l},${this._y1 = n + E * u}`; + let v = r - a, g = i - o, m = l * l + u * u, b = v * v + g * g, $ = Math.sqrt(m), C = Math.sqrt(c), T = s * Math.tan((ds - Math.acos((m + c - b) / (2 * $ * C))) / 2), N = T / C, I = T / $; + Math.abs(N - 1) > gn && this._append`L${e + N * f},${n + N * h}`, this._append`A${s},${s},0,0,${+(h * v > f * g)},${this._x1 = e + I * l},${this._y1 = n + I * u}`; } } arc(e, n, r, i, s, a) { if (e = +e, 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 = e + o, f = n + l, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > an || Math.abs(this._y1 - f) > an) && this._append`L${u},${f}`, r && (c < 0 && (c = c % rs + rs), c > jh ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > an && this._append`A${r},${r},0,${+(c >= ns)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > gn || Math.abs(this._y1 - f) > gn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % ps + ps), c > Zh ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > gn && this._append`A${r},${r},0,${+(c >= ds)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } rect(e, n, r, i) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; @@ -4562,24 +4562,24 @@ class Jh { return this._; } } -function Qh(t) { +function td(t) { for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); return n; } -const td = Qh("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Et(t) { +const ed = td("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Ct(t) { return function() { return t; }; } -const aa = Math.abs, $t = Math.atan2, sn = Math.cos, ed = Math.max, Oi = Math.min, xe = Math.sin, Dn = Math.sqrt, Ct = 1e-12, wr = Math.PI, oi = wr / 2, jr = 2 * wr; -function nd(t) { - return t > 1 ? 0 : t < -1 ? wr : Math.acos(t); +const ga = Math.abs, At = Math.atan2, vn = Math.cos, nd = Math.max, Ui = Math.min, we = Math.sin, Xn = Math.sqrt, St = 1e-12, Pr = Math.PI, gi = Pr / 2, si = 2 * Pr; +function rd(t) { + return t > 1 ? 0 : t < -1 ? Pr : Math.acos(t); } -function oa(t) { - return t >= 1 ? oi : t <= -1 ? -oi : Math.asin(t); +function _a(t) { + return t >= 1 ? gi : t <= -1 ? -gi : Math.asin(t); } -function rd(t) { +function id(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -4591,141 +4591,141 @@ function rd(t) { e = r; } return t; - }, () => new Jh(e); + }, () => new Qh(e); } -function id(t) { +function sd(t) { return t.innerRadius; } -function sd(t) { +function ad(t) { return t.outerRadius; } -function ad(t) { +function od(t) { return t.startAngle; } -function od(t) { +function ld(t) { return t.endAngle; } -function ld(t) { +function ud(t) { return t && t.padAngle; } -function ud(t, e, n, r, i, s, a, o) { +function fd(t, e, n, r, i, s, a, o) { var l = n - t, u = r - e, f = a - i, h = o - s, c = h * l - f * u; - if (!(c * c < Ct)) + if (!(c * c < St)) return c = (f * (e - s) - h * (t - i)) / c, [t + c * l, e + c * u]; } -function Vr(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / Dn(o * o + l * l), f = u * l, h = -u * o, c = t + f, v = e + h, g = n + f, m = r + h, b = (c + g) / 2, A = (v + m) / 2, S = g - c, T = m - v, D = S * S + T * T, E = i - s, j = c * m - g * v, it = (T < 0 ? -1 : 1) * Dn(ed(0, E * E * D - j * j)), W = (j * T - S * it) / D, nt = (-j * S - T * it) / D, ut = (j * T + S * it) / D, ft = (-j * S + T * it) / D, G = W - b, x = nt - A, P = ut - b, zt = ft - A; - return G * G + x * x > P * P + zt * zt && (W = ut, nt = ft), { - cx: W, - cy: nt, +function Kr(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / Xn(o * o + l * l), f = u * l, h = -u * o, c = t + f, v = e + h, g = n + f, m = r + h, b = (c + g) / 2, $ = (v + m) / 2, C = g - c, T = m - v, N = C * C + T * T, I = i - s, G = c * m - g * v, at = (T < 0 ? -1 : 1) * Xn(nd(0, I * I * N - G * G)), Z = (G * T - C * at) / N, et = (-G * C - T * at) / N, dt = (G * T + C * at) / N, H = (-G * C + T * at) / N, it = Z - b, A = et - $, E = dt - b, ht = H - $; + return it * it + A * A > E * E + ht * ht && (Z = dt, et = H), { + cx: Z, + cy: et, x01: -f, y01: -h, - x11: W * (i / E - 1), - y11: nt * (i / E - 1) + x11: Z * (i / I - 1), + y11: et * (i / I - 1) }; } -function De() { - var t = id, e = sd, n = Et(0), r = null, i = ad, s = od, a = ld, o = null, l = rd(u); +function Ve() { + var t = sd, e = ad, n = Ct(0), r = null, i = od, s = ld, a = ud, o = null, l = id(u); function u() { - var f, h, c = +t.apply(this, arguments), v = +e.apply(this, arguments), g = i.apply(this, arguments) - oi, m = s.apply(this, arguments) - oi, b = aa(m - g), A = m > g; - if (o || (o = f = l()), v < c && (h = v, v = c, c = h), !(v > Ct)) o.moveTo(0, 0); - else if (b > jr - Ct) - o.moveTo(v * sn(g), v * xe(g)), o.arc(0, 0, v, g, m, !A), c > Ct && (o.moveTo(c * sn(m), c * xe(m)), o.arc(0, 0, c, m, g, A)); + var f, h, c = +t.apply(this, arguments), v = +e.apply(this, arguments), g = i.apply(this, arguments) - gi, m = s.apply(this, arguments) - gi, b = ga(m - g), $ = m > g; + if (o || (o = f = l()), v < c && (h = v, v = c, c = h), !(v > St)) o.moveTo(0, 0); + else if (b > si - St) + o.moveTo(v * vn(g), v * we(g)), o.arc(0, 0, v, g, m, !$), c > St && (o.moveTo(c * vn(m), c * we(m)), o.arc(0, 0, c, m, g, $)); else { - var S = g, T = m, D = g, E = m, j = b, it = b, W = a.apply(this, arguments) / 2, nt = W > Ct && (r ? +r.apply(this, arguments) : Dn(c * c + v * v)), ut = Oi(aa(v - c) / 2, +n.apply(this, arguments)), ft = ut, G = ut, x, P; - if (nt > Ct) { - var zt = oa(nt / c * xe(W)), tt = oa(nt / v * xe(W)); - (j -= zt * 2) > Ct ? (zt *= A ? 1 : -1, D += zt, E -= zt) : (j = 0, D = E = (g + m) / 2), (it -= tt * 2) > Ct ? (tt *= A ? 1 : -1, S += tt, T -= tt) : (it = 0, S = T = (g + m) / 2); + var C = g, T = m, N = g, I = m, G = b, at = b, Z = a.apply(this, arguments) / 2, et = Z > St && (r ? +r.apply(this, arguments) : Xn(c * c + v * v)), dt = Ui(ga(v - c) / 2, +n.apply(this, arguments)), H = dt, it = dt, A, E; + if (et > St) { + var ht = _a(et / c * we(Z)), Me = _a(et / v * we(Z)); + (G -= ht * 2) > St ? (ht *= $ ? 1 : -1, N += ht, I -= ht) : (G = 0, N = I = (g + m) / 2), (at -= Me * 2) > St ? (Me *= $ ? 1 : -1, C += Me, T -= Me) : (at = 0, C = T = (g + m) / 2); } - var Ht = v * sn(S), Yt = v * xe(S), ne = c * sn(E), ge = c * xe(E); - if (ut > Ct) { - var Tt = v * sn(T), _e = v * xe(T), me = c * sn(D), Xe = c * xe(D), Ot; - if (b < wr) - if (Ot = ud(Ht, Yt, me, Xe, Tt, _e, ne, ge)) { - var nn = Ht - Ot[0], rn = Yt - Ot[1], Ge = Tt - Ot[0], Bt = _e - Ot[1], ye = 1 / xe(nd((nn * Ge + rn * Bt) / (Dn(nn * nn + rn * rn) * Dn(Ge * Ge + Bt * Bt))) / 2), Sn = Dn(Ot[0] * Ot[0] + Ot[1] * Ot[1]); - ft = Oi(ut, (c - Sn) / (ye - 1)), G = Oi(ut, (v - Sn) / (ye + 1)); + var tt = v * vn(C), te = v * we(C), Pe = c * vn(I), Ht = c * we(I); + if (dt > St) { + var pe = v * vn(T), Nt = v * we(T), ve = c * vn(N), ee = c * we(N), Rt; + if (b < Pr) + if (Rt = fd(tt, te, ve, ee, pe, Nt, Pe, Ht)) { + var ln = tt - Rt[0], un = te - Rt[1], fn = pe - Rt[0], ne = Nt - Rt[1], ge = 1 / we(rd((ln * fn + un * ne) / (Xn(ln * ln + un * un) * Xn(fn * fn + ne * ne))) / 2), Ze = Xn(Rt[0] * Rt[0] + Rt[1] * Rt[1]); + H = Ui(dt, (c - Ze) / (ge - 1)), it = Ui(dt, (v - Ze) / (ge + 1)); } else - ft = G = 0; + H = it = 0; } - it > Ct ? G > Ct ? (x = Vr(me, Xe, Ht, Yt, v, G, A), P = Vr(Tt, _e, ne, ge, v, G, A), o.moveTo(x.cx + x.x01, x.cy + x.y01), G < ut ? o.arc(x.cx, x.cy, G, $t(x.y01, x.x01), $t(P.y01, P.x01), !A) : (o.arc(x.cx, x.cy, G, $t(x.y01, x.x01), $t(x.y11, x.x11), !A), o.arc(0, 0, v, $t(x.cy + x.y11, x.cx + x.x11), $t(P.cy + P.y11, P.cx + P.x11), !A), o.arc(P.cx, P.cy, G, $t(P.y11, P.x11), $t(P.y01, P.x01), !A))) : (o.moveTo(Ht, Yt), o.arc(0, 0, v, S, T, !A)) : o.moveTo(Ht, Yt), !(c > Ct) || !(j > Ct) ? o.lineTo(ne, ge) : ft > Ct ? (x = Vr(ne, ge, Tt, _e, c, -ft, A), P = Vr(Ht, Yt, me, Xe, c, -ft, A), o.lineTo(x.cx + x.x01, x.cy + x.y01), ft < ut ? o.arc(x.cx, x.cy, ft, $t(x.y01, x.x01), $t(P.y01, P.x01), !A) : (o.arc(x.cx, x.cy, ft, $t(x.y01, x.x01), $t(x.y11, x.x11), !A), o.arc(0, 0, c, $t(x.cy + x.y11, x.cx + x.x11), $t(P.cy + P.y11, P.cx + P.x11), A), o.arc(P.cx, P.cy, ft, $t(P.y11, P.x11), $t(P.y01, P.x01), !A))) : o.arc(0, 0, c, E, D, A); + at > St ? it > St ? (A = Kr(ve, ee, tt, te, v, it, $), E = Kr(pe, Nt, Pe, Ht, v, it, $), o.moveTo(A.cx + A.x01, A.cy + A.y01), it < dt ? o.arc(A.cx, A.cy, it, At(A.y01, A.x01), At(E.y01, E.x01), !$) : (o.arc(A.cx, A.cy, it, At(A.y01, A.x01), At(A.y11, A.x11), !$), o.arc(0, 0, v, At(A.cy + A.y11, A.cx + A.x11), At(E.cy + E.y11, E.cx + E.x11), !$), o.arc(E.cx, E.cy, it, At(E.y11, E.x11), At(E.y01, E.x01), !$))) : (o.moveTo(tt, te), o.arc(0, 0, v, C, T, !$)) : o.moveTo(tt, te), !(c > St) || !(G > St) ? o.lineTo(Pe, Ht) : H > St ? (A = Kr(Pe, Ht, pe, Nt, c, -H, $), E = Kr(tt, te, ve, ee, c, -H, $), o.lineTo(A.cx + A.x01, A.cy + A.y01), H < dt ? o.arc(A.cx, A.cy, H, At(A.y01, A.x01), At(E.y01, E.x01), !$) : (o.arc(A.cx, A.cy, H, At(A.y01, A.x01), At(A.y11, A.x11), !$), o.arc(0, 0, c, At(A.cy + A.y11, A.cx + A.x11), At(E.cy + E.y11, E.cx + E.x11), $), o.arc(E.cx, E.cy, H, At(E.y11, E.x11), At(E.y01, E.x01), !$))) : o.arc(0, 0, c, I, N, $); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - wr / 2; - return [sn(h) * f, xe(h) * f]; + var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Pr / 2; + return [vn(h) * f, we(h) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Et(+f), u) : t; + return arguments.length ? (t = typeof f == "function" ? f : Ct(+f), u) : t; }, u.outerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Et(+f), u) : e; + return arguments.length ? (e = typeof f == "function" ? f : Ct(+f), u) : e; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Et(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Ct(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Et(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Ct(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Et(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Ct(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Et(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Ct(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Et(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Ct(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function fd(t) { +function cd(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function cd(t, e) { +function hd(t, e) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function hd(t) { +function dd(t) { return t; } -function la() { - var t = hd, e = cd, n = null, r = Et(0), i = Et(jr), s = Et(0); +function ma() { + var t = dd, e = hd, n = null, r = Ct(0), i = Ct(si), s = Ct(0); function a(o) { - var l, u = (o = fd(o)).length, f, h, c = 0, v = new Array(u), g = new Array(u), m = +r.apply(this, arguments), b = Math.min(jr, Math.max(-jr, i.apply(this, arguments) - m)), A, S = Math.min(Math.abs(b) / u, s.apply(this, arguments)), T = S * (b < 0 ? -1 : 1), D; + var l, u = (o = cd(o)).length, f, h, c = 0, v = new Array(u), g = new Array(u), m = +r.apply(this, arguments), b = Math.min(si, Math.max(-si, i.apply(this, arguments) - m)), $, C = Math.min(Math.abs(b) / u, s.apply(this, arguments)), T = C * (b < 0 ? -1 : 1), N; for (l = 0; l < u; ++l) - (D = g[v[l] = l] = +t(o[l], l, o)) > 0 && (c += D); - for (e != null ? v.sort(function(E, j) { - return e(g[E], g[j]); - }) : n != null && v.sort(function(E, j) { - return n(o[E], o[j]); - }), l = 0, h = c ? (b - u * T) / c : 0; l < u; ++l, m = A) - f = v[l], D = g[f], A = m + (D > 0 ? D * h : 0) + T, g[f] = { + (N = g[v[l] = l] = +t(o[l], l, o)) > 0 && (c += N); + for (e != null ? v.sort(function(I, G) { + return e(g[I], g[G]); + }) : n != null && v.sort(function(I, G) { + return n(o[I], o[G]); + }), l = 0, h = c ? (b - u * T) / c : 0; l < u; ++l, m = $) + f = v[l], N = g[f], $ = m + (N > 0 ? N * h : 0) + T, g[f] = { data: o[f], index: l, - value: D, + value: N, startAngle: m, - endAngle: A, - padAngle: S + endAngle: $, + padAngle: C }; return g; } return a.value = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : Et(+o), a) : t; + return arguments.length ? (t = typeof o == "function" ? o : Ct(+o), a) : t; }, a.sortValues = function(o) { return arguments.length ? (e = o, n = null, a) : e; }, a.sort = function(o) { return arguments.length ? (n = o, e = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Et(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Ct(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Et(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Ct(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Et(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Ct(+o), a) : s; }, a; } -function cr(t, e, n) { +function Ar(t, e, n) { this.k = t, this.x = e, this.y = n; } -cr.prototype = { - constructor: cr, +Ar.prototype = { + constructor: Ar, scale: function(t) { - return t === 1 ? this : new cr(this.k * t, this.x, this.y); + return t === 1 ? this : new Ar(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new cr(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new Ar(this.k, this.x + this.k * t, this.y + this.k * e); }, apply: function(t) { return [t[0] * this.k + this.x, t[1] * this.k + this.y]; @@ -4755,242 +4755,244 @@ cr.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -cr.prototype; -var dd = /* @__PURE__ */ vu(''); -const pd = { +Ar.prototype; +var pd = /* @__PURE__ */ gu(''); +const vd = { 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 Vo(t, e) { - os(e, !0), uo(t, pd); - let n = ue(e, "jsonData", 7), r = ue(e, "currentRound", 7, 1), i = ue(e, "mouseEventType", 15), s = ue(e, "mouseData", 15), a = ue(e, "mouseY", 15), o = ue(e, "requestRoundChange", 7, (p) => { - }), l = ue(e, "candidateColors", 23, () => []); - function u(p) { +function jo(t, e) { + ms(e, !0), wo(t, vd); + let n = Et(e, "jsonData", 7), r = Et(e, "currentRound", 7, 1), i = Et(e, "mouseEventType", 15), s = Et(e, "mouseData", 15), a = Et(e, "mouseY", 15), o = Et(e, "requestRoundChange", 7, (p) => { + }), l = Et(e, "candidateColors", 23, () => []), u = Et(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1); + function f(p) { return p.isTransfer ? `${p.label}__transfer` : p.transferIndex != null ? `${p.label}__${p.transferIndex}` : p.label; } - const f = 800, h = 800, c = Math.min(f, h) * 0.3, v = f / 2, g = h / 2, m = "Pie", b = "Donut", A = "TextLayer", S = "url(#cross-hatch)", T = 1.15, D = 0.1, E = 750, j = 800; - function it(p) { + const h = 800, c = 800, v = Math.min(h, c) * 0.3, g = h / 2, m = c / 2, b = "Pie", $ = "Donut", C = "TextLayer", T = "url(#cross-hatch)", N = 1.15, I = 0.1, G = 750, at = 800; + function Z(p) { return "hatch-" + p.replace(/[^a-zA-Z0-9]/g, "-"); } - let W = [], nt = [], ut = [], ft = 0, G = /* @__PURE__ */ mt( + let et = [], dt = [], H = [], it = 0, A = /* @__PURE__ */ yt( 0 // $state just to make it inspectable - ), x = 0; - const P = {}, zt = "No Further Rankings"; - let tt = /* @__PURE__ */ mt(null); - function Ht() { + ), E = 0; + const ht = {}, Me = "No Further Rankings"; + let tt = /* @__PURE__ */ yt(null); + function te() { const p = gt(w(tt)); - p.select("#" + m).remove(), p.select("#" + b).remove(), p.select("#" + A).remove(); + p.select("#" + b).remove(), p.select("#" + $).remove(), p.select("#" + C).remove(); } - function Yt(p) { - o() && (st = p, o()(p)); + function Pe(p) { + o() && (K = p, o()(p)); } - function ne(p) { - Ht(), ut = ge(p), W = jo(p, m, ut, v, g, 0, Tt()); + function Ht(p) { + te(), H = pe(p), et = Zo(p, b, H, g, m, 0, Nt()); } - xu(() => { - rr(), setTimeout( + bu(() => { + Mi(), setTimeout( () => { - ne(r()); + Ht(r()); }, 0 ); }); - function ge(p) { - const _ = Nr(p); - return ft = rn(p), _; + function pe(p) { + const _ = zn(p); + return it = fn(p), _; } - function Tt() { - return c; + function Nt() { + return v; } - function _e() { - return Tt() * 1.41; + function ve() { + return Nt() * 1.41; } - function me(p) { + function ee(p) { let _ = 0; for (let y = 1; y < p; y++) { - const M = n().results[y - 1].tallyResults; - for (let R = 0; R < M.length; R++) { - const C = M[R].transfers; - if (C) { - const k = C.exhausted; - k && (_ += Number(k)); + const P = n().results[y - 1].tallyResults; + for (let R = 0; R < P.length; R++) { + const S = P[R].transfers; + if (S) { + const M = S.exhausted; + M && (_ += Number(M)); } } } return _; } - function Xe(p, _) { - if (p === "exhausted") return me(_); + function Rt(p, _) { + if (p === "exhausted") return ee(_); { const y = n().results[_ - 1].tally; return Number(y[p]); } } - function Ot(p, _) { - return Xe(p, _).toLocaleString("en-US"); + function ln(p, _) { + return Rt(p, _).toLocaleString("en-US"); } - function nn(p, _) { - return (Xe(p, _) / ft).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function un(p, _) { + return (Rt(p, _) / it).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function rn(p) { + function fn(p) { const _ = n().results[p - 1].tally; let y = 0; - for (let [M, R] of Object.entries(_)) + for (let [P, R] of Object.entries(_)) y += Number(R); return y; } - function Ge(p, _) { + function ne(p, _) { if (!p || p < 1 || p > n().results.length) return console.warn("In chsoenCandidates: round ${round} is out of range."), []; - const y = n().results[p - 1].tallyResults, M = []; + if (u() && p === n().results.length) + return []; + const y = n().results[p - 1].tallyResults, P = []; for (let R = 0; R < y.length; R++) { - const C = y[R][_]; - C != null && M.push(C); + const S = y[R][_]; + S != null && P.push(S); } - return M; + return P; } - function Bt(p) { - return Ge(p, "eliminated"); + function ge(p) { + return ne(p, "eliminated"); } - function ye(p) { + function Ze(p) { let _ = []; - for (let y = 1; y <= p; y++) _ = _.concat(Ge(y, "elected")); + for (let y = 1; y <= p; y++) _ = _.concat(ne(y, "elected")); return _; } - function Sn(p, _) { + function ki(p, _) { const y = n().results[_ - 1].tallyResults; - let M = 0; - const R = y.findIndex((C) => (C == null ? void 0 : C.elected) && p == C.elected); + let P = 0; + const R = y.findIndex((S) => (S == null ? void 0 : S.elected) && p == S.elected); if (R >= 0) { - const C = y[R].transfers; - if (C) - for (let [k, I] of Object.entries(C)) M += Number(I); + const S = y[R].transfers; + if (S) + for (let [M, F] of Object.entries(S)) P += Number(F); } else return 0; - return M; + return P; } - function Nr(p) { + function zn(p) { const _ = n().results; let y = _[Math.max(0, p - 2)].tally; - const M = [], R = []; - for (let [k, I] of Object.entries(y)) - M.push({ label: k, value: 0 }); + const P = [], R = []; + for (let [M, F] of Object.entries(y)) + P.push({ label: M, value: 0 }); y = _[p - 1].tally; - for (let k of M) { - const I = Number(y[k.label]), q = Sn(k.label, p); + for (let M of P) { + const F = Number(y[M.label]), q = ki(M.label, p); q > 0 ? (R.push({ - label: k.label, + label: M.label, value: q, isTransfer: !0 - }), k.value = I - q, R.push(k)) : (k.value = I, R.push(k)); + }), M.value = F - q, R.push(M)) : (M.value = F, R.push(M)); } - const C = me(p); - return R.push({ label: "exhausted", value: C }), R; + const S = ee(p); + return R.push({ label: "exhausted", value: S }), R; } - function rr() { + function Mi() { const p = gt(w(tt)).select("defs").select("#cross-hatch"); let _ = 0; - for (let [y, M] of Object.entries(n().results[0].tally)) { - !l() || l().length === 0 ? _ < 10 ? P[y] = td[_] : P[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : P[y] = l()[_ % l().length], _++; + for (let [y, P] of Object.entries(n().results[0].tally)) { + !l() || l().length === 0 ? _ < 10 ? ht[y] = ed[_] : ht[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : ht[y] = l()[_ % l().length], _++; { const R = p.clone(!0); - R.attr("id", it(y)).select("rect").attr("fill", P[y]), R.selectAll("circle").attr("fill", "#383838"); + R.attr("id", Z(y)).select("rect").attr("fill", ht[y]), R.selectAll("circle").attr("fill", "#383838"); } } - P.exhausted = S, P["Inactive Ballots"] = S; + ht.exhausted = T, ht["Inactive Ballots"] = T; } - function bi() { - gt(w(tt)).select("#" + b).remove(); + function x() { + gt(w(tt)).select("#" + $).remove(); } - function $(p, _) { - const y = Wr("global").duration(j); - _ && y.on("end", _), bi(), Yo(p), Zo(), Qo(0, Tt()), kr(); + function B(p, _) { + const y = ii("global").duration(at); + _ && y.on("end", _), x(), Fe(p), Jo(), tl(0, Nt()), Hr(); } - function V(p, _) { - const y = Wr("global").duration(j); - _ && y.on("end", _), Bo(p); + function nt(p, _) { + const y = ii("global").duration(at); + _ && y.on("end", _), Oe(p); } - function et(p, _) { - const y = Wr("global").duration(j); - _ && y.on("end", _), zo(p), Ho(Tt()); + function ot(p, _) { + const y = ii("global").duration(at); + _ && y.on("end", _), Hn(p), Yn(Nt()); } - let K = !1, rt = []; - function Q() { - kr(), K = !1, At(); + let J = !1, rt = []; + function $t() { + Hr(), J = !1, Je(); } - function At() { + function Je() { if (rt.length === 0) { - st !== r() && (r() === st + 1 && st > 0 && r() <= n().results.length ? (st = r(), dt(r())) : r() >= 1 && r() <= n().results.length && (st = r(), J(G, 0), ne(r()))); + K !== r() && (r() === K + 1 && K > 0 && r() <= n().results.length ? (K = r(), re(r())) : r() >= 1 && r() <= n().results.length && (K = r(), Q(A, 0), Ht(r()))); return; } const p = rt.shift(); switch (p.type) { case "round": { const _ = p.round; - _ === st + 1 && st > 0 && _ <= n().results.length ? (st = _, dt(_)) : (_ !== st && _ >= 1 && _ <= n().results.length && (st = _, J(G, 0), ne(_)), At()); + _ === K + 1 && K > 0 && _ <= n().results.length ? (K = _, re(_)) : (_ !== K && _ >= 1 && _ <= n().results.length && (K = _, Q(A, 0), Ht(_)), Je()); break; } case "step": - kn(); + hn(); break; } } - function dt(p) { + function re(p) { if (p <= 1 || p > n().results.length) { - At(); + Je(); return; } - K = !0, x = p, J(G, 0), $(x - 1, () => { - V(x - 1, () => { - et(x, Q); + J = !0, E = p, Q(A, 0), B(E - 1, () => { + nt(E - 1, () => { + ot(E, $t); }); }); } - function re() { - K || (K = !0, x = r(), ie()); + function cn() { + J || (J = !0, E = r(), De()); } - function ie() { - if (J( - G, + function De() { + if (Q( + A, 0 // if in the middle of "one small step" animation, reset to 0. ), rt.length > 0) { - Q(); + $t(); return; } - const p = x < n().results.length - 1 ? ie : Q; - $(x, () => { - V(x, () => { - x++, Yt(x), et(x, p); + const p = E < n().results.length - 1 ? De : $t; + B(E, () => { + nt(E, () => { + E++, Pe(E), ot(E, p); }); }); } - ds(() => { - Ke(); + As(() => { + _e(); }); - let st = 0; - function Ke() { - if (st != r()) { - if (K) { + let K = 0; + function _e() { + if (K != r()) { + if (J) { rt.push({ type: "round", round: r() }); return; } - st == r() - 1 && st > 0 ? bt() : se(r()), st = r(); + K == r() - 1 && K > 0 ? Qe() : Yt(r()), K = r(); } } - function se(p) { - if (K) { + function Yt(p) { + if (J) { rt.push({ type: "round", round: p }); return; } - J(G, 0), ne(p); + Q(A, 0), Ht(p); } - function bt() { - if (K) { + function Qe() { + if (J) { rt.push({ type: "round", round: r() }); return; } @@ -4998,297 +5000,303 @@ function Vo(t, e) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (x = r(), x > n().results.length) { - kr(), K = !1; + if (E = r(), E > n().results.length) { + Hr(), J = !1; return; } - K = !0, w(G) === 0 ? $(x - 1, () => { - V(x - 1, () => { - et(x, Q); + J = !0, w(A) === 0 ? B(E - 1, () => { + nt(E - 1, () => { + ot(E, $t); }); - }) : w(G) === 1 ? V(x - 1, () => { - et(x, Q); - }) : w(G) === 2 && et(x, Q), J(G, 0); + }) : w(A) === 1 ? nt(E - 1, () => { + ot(E, $t); + }) : w(A) === 2 && ot(E, $t), Q(A, 0); } - function kn() { + function hn() { if (r() > n().results.length) { - kr(), K = !1; + Hr(), J = !1; return; } - if (K) { + if (J) { rt.push({ type: "step" }); return; } - K = !0, J(G, (w(G) + 1) % 3), x = r(), w(G) === 1 ? $(x, Q) : w(G) === 2 ? V(x, Q) : w(G) === 0 ? (x++, Yt(x), et(x, Q)) : (K = !1, console.warn("displayPhase out of range at ", w(G))); + J = !0, Q(A, (w(A) + 1) % 3), E = r(), w(A) === 1 ? B(E, $t) : w(A) === 2 ? nt(E, $t) : w(A) === 0 ? (E++, Pe(E), ot(E, $t)) : (J = !1, console.warn("displayPhase out of range at ", w(A))); } - function zo(p) { - ut = Nr(p), W = tl(p, m, ut, 0, Tt(), !0); + function Hn(p) { + H = zn(p), et = el(p, b, H, 0, Nt(), !0); } - function Ho(p, _) { - const y = gt(w(tt)).select("#" + b), M = De().outerRadius(p).innerRadius(p - 1), R = y.selectAll(".slice"); - let C = R.size(); - function k() { - C--, C === 0 && Jo(); + function Yn(p, _) { + const y = gt(w(tt)).select("#" + $), P = Ve().outerRadius(p).innerRadius(p - 1), R = y.selectAll(".slice"); + let S = R.size(); + function M() { + S--, S === 0 && Qo(); } - R.select("path").transition("global").duration(E).attr("d", (I) => M(I)).on("end", (I) => k()); + R.select("path").transition("global").duration(G).attr("d", (F) => P(F)).on("end", (F) => M()); } - function Yo(p) { - const _ = Xo(p, W); - nt = Ts(p, b, _, v, g, Tt(), _e(), !1, !0); + function Fe(p) { + const _ = vr(p, et); + dt = Is(p, $, _, g, m, Nt(), ve(), !1, !0); } - function Bo(p) { - const _ = Ko(p, nt, W); - nt = Cs(p, b, _, Tt(), _e(), !1); + function Oe(p) { + const _ = Le(p, dt, et); + dt = Ls(p, $, _, Nt(), ve(), !1); } - function Sr(p) { - return P[p.data.label]; + function Ie(p) { + return ht[p.data.label]; } - function Uo(p) { + function pr(p) { const _ = {}, y = n().results[p - 1].tallyResults; - for (let M = 0; M < y.length; M++) { - let R = y[M].eliminated; - if (R === void 0 && (R = y[M].elected), R === void 0) { + for (let P = 0; P < y.length; P++) { + let R = y[P].eliminated; + if (R === void 0 && (R = y[P].elected), R === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const C = y[M].transfers; - if (C === void 0) { + const S = y[P].transfers; + if (S === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [k, I] of Object.entries(C)) - _[k] === void 0 ? _[k] = Number(I) : _[k] += Number(I); + for (let [M, F] of Object.entries(S)) + _[M] === void 0 ? _[M] = Number(F) : _[M] += Number(F); } return _; } - function Xo(p, _) { - const y = [], M = ft, R = n().results[p - 1].tallyResults; - for (let C = 0; C < R.length; C++) { - let k = R[C].eliminated; - if (k === void 0 && (k = R[C].elected), k === void 0) { + function vr(p, _) { + const y = [], P = it, R = n().results[p - 1].tallyResults; + for (let S = 0; S < R.length; S++) { + let M = R[S].eliminated; + if (M === void 0 && (M = R[S].elected), M === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const I = R[C].transfers; - if (I === void 0) { + const F = R[S].transfers; + if (F === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let q = _.find((F) => F.data.label == k && F.data.isTransfer); - q === void 0 && (q = _.find((F) => F.data.label == k && !F.data.isTransfer)); - let B = 0; - if (q) B = q.startAngle; + let q = _.find((O) => O.data.label == M && O.data.isTransfer); + q === void 0 && (q = _.find((O) => O.data.label == M && !O.data.isTransfer)); + let U = 0; + if (q) U = q.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [F, U] of Object.entries(I)) { - let at; - const we = _.find((ct) => ct.data.label == F); - if (we) - at = structuredClone(we); - else if (F == "exhausted") - at = { - data: { label: F, value: Number(U) }, + for (let [O, W] of Object.entries(F)) { + let st; + const ye = _.find((ft) => ft.data.label == O); + if (ye) + st = structuredClone(ye); + else if (O == "exhausted") + st = { + data: { label: O, value: Number(W) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (F == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", U); + else if (O == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", W); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", F); + console.warn("makeDonutInfo: unrecognized name in transfers ", O); continue; } - const N = Number(U) / M * 2 * Math.PI; - at.startAngle = B, B = at.endAngle = B + N, at.index = C, at.data.transferIndex = C, y.push(at); + const k = Number(W) / P * 2 * Math.PI; + st.startAngle = U, U = st.endAngle = U + k, st.index = S, st.data.transferIndex = S, y.push(st); } } return y; } - function Go(p, _, y) { - const M = {}; - for (let [R, C] of Object.entries(p)) { - const k = y.find((B) => R == B.data.label); - if (k === void 0) { + function gr(p, _, y) { + const P = {}; + for (let [R, S] of Object.entries(p)) { + const M = y.find((U) => R == U.data.label); + if (M === void 0) { console.warn("getTransferStartAngles: mainPieObj not found for ", R); continue; } - const I = (k.startAngle + k.endAngle) / 2, q = p[k.data.label] / _ * 2 * Math.PI; - M[k.data.label] = I - q / 2; + const F = (M.startAngle + M.endAngle) / 2, q = p[M.data.label] / _ * 2 * Math.PI; + P[M.data.label] = F - q / 2; } - return M; - } - function Ko(p, _, y) { - const M = [], R = ft, C = Uo(p), k = Go(C, R, y); - for (let [I, q] of _.entries()) { - const B = structuredClone(q), F = q.endAngle - q.startAngle, U = y.find((at) => q.data.label === at.data.label && !at.data.isTransfer); - if (U) { - const at = U.data.label; - B.startAngle = k[at], k[at] += F, B.endAngle = B.startAngle + F; + return P; + } + function Le(p, _, y) { + const P = [], R = it, S = pr(p), M = gr(S, R, y); + for (let [F, q] of _.entries()) { + const U = structuredClone(q), O = q.endAngle - q.startAngle, W = y.find((st) => q.data.label === st.data.label && !st.data.isTransfer); + if (W) { + const st = W.data.label; + U.startAngle = M[st], M[st] += O, U.endAngle = U.startAngle + O; } else if (q.data.label === "exhausted") - B.startAngle = q.startAngle, B.endAngle = q.endAngle; + U.startAngle = q.startAngle, U.endAngle = q.endAngle; else { console.warn("updateDonutInfo: unrecognized slice name ", q.data.label); continue; } - B.index = I, M.push(B); + U.index = F, P.push(U); } - return M; - } - function Rs(p, _, y, M, R, C) { - const I = gt(w(tt)).append("g").attr("id", A).attr("transform", `translate(${y}, ${M})`), q = De().innerRadius(R * T).outerRadius(R * T); - I.selectAll("text").data(_).enter().each(function(B) { - B.endAngle - B.startAngle < D || B.data.isTransfer || gt(this).append("g").attr("id", (F) => u(F.data)).classed("eliminated", (F) => C.includes(F.data.label) || F.data.isTransfer === !0).each(function(F, U) { - F.data.label === "exhausted" && gt(this).on("mouseenter", (at, we) => el(at)).on("mouseleave", (at, we) => nl()); - }).append("text").attr("transform", (F) => `translate(${q.centroid(F)})`).attr("text-anchor", (F) => $i(F.startAngle, F.endAngle)).text((F) => F.data.label === "exhausted" ? zt : F.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((F) => Ot(F.data.label, p) + " (" + nn(F.data.label, p) + ")"); + return P; + } + function me(p, _, y, P, R, S) { + const F = gt(w(tt)).append("g").attr("id", C).attr("transform", `translate(${y}, ${P})`), q = Ve().innerRadius(R * N).outerRadius(R * N); + F.selectAll("text").data(_).enter().each(function(U) { + U.endAngle - U.startAngle < I || U.data.isTransfer || gt(this).append("g").attr("id", (O) => f(O.data)).classed("eliminated", (O) => S.includes(O.data.label) || O.data.isTransfer === !0).each(function(O, W) { + O.data.label === "exhausted" && gt(this).on("mouseenter", (st, ye) => nl(st)).on("mouseleave", (st, ye) => rl()); + }).append("text").attr("transform", (O) => `translate(${q.centroid(O)})`).attr("text-anchor", (O) => Di(O.startAngle, O.endAngle)).text((O) => O.data.label === "exhausted" ? Me : O.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((O) => ln(O.data.label, p) + " (" + un(O.data.label, p) + ")"); }); } - function Wo(p, _, y, M) { - const C = gt(w(tt)).select("#" + A), k = C.selectAll("tspan"), I = C.selectAll("g").data(_, (U) => u(U.data)).classed("eliminated", (U) => M.includes(U.data.label) || U.data.isTransfer === !0), q = De().innerRadius(y * T).outerRadius(y * T + 1); - k.transition("global").duration(E).attr("transform", (U) => `translate(${q.centroid(U)})`).attr("text-anchor", (U) => $i(U.startAngle, U.endAngle)), I.select("text").transition("global").duration(E).attr("transform", (U) => `translate(${q.centroid(U)})`).attr("text-anchor", (U) => $i(U.startAngle, U.endAngle)).on("end", (U) => F()); - let B = I.size(); - function F(U) { - B--, B === 0 && (C.remove(), Rs(p, _, v, g, y, M)); + function Pi(p, _, y, P) { + const S = gt(w(tt)).select("#" + C), M = S.selectAll("tspan"), F = S.selectAll("g").data(_, (W) => f(W.data)).classed("eliminated", (W) => P.includes(W.data.label) || W.data.isTransfer === !0), q = Ve().innerRadius(y * N).outerRadius(y * N + 1); + M.transition("global").duration(G).attr("transform", (W) => `translate(${q.centroid(W)})`).attr("text-anchor", (W) => Di(W.startAngle, W.endAngle)), F.select("text").transition("global").duration(G).attr("transform", (W) => `translate(${q.centroid(W)})`).attr("text-anchor", (W) => Di(W.startAngle, W.endAngle)).on("end", (W) => O()); + let U = F.size(); + function O(W) { + U--, U === 0 && (S.remove(), me(p, _, g, m, y, P)); } } - function jo(p, _, y, M, R, C, k, I = !0, q = !1) { - const F = la().sort(null).value((U) => U.value)(y); - return Ts(p, _, F, M, R, C, k, I, q), F; + function Zo(p, _, y, P, R, S, M, F = !0, q = !1) { + const O = ma().sort(null).value((W) => W.value)(y); + return Is(p, _, O, P, R, S, M, F, q), O; } - function kr() { - gt(w(tt)).select("#" + m).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); + function Hr() { + gt(w(tt)).select("#" + b).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); } - function Ts(p, _, y, M, R, C, k, I, q) { - const B = Bt(p), F = ye(p), we = gt(w(tt)).attr("viewBox", `0 0 ${f} ${h}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${M}, ${R})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (N) => B.includes(N.data.label) || N.data.isTransfer === !0).classed("elected", (N) => F.includes(N.data.label) && !N.data.isTransfer).attr("id", (N) => u(N.data)).on("mouseenter", (N, ct) => Ei(N, ct)).on("mouseleave", (N, ct) => Ri(N, ct)), ir = De().outerRadius(k).innerRadius(C); + function Is(p, _, y, P, R, S, M, F, q) { + const U = ge(p), O = Ze(p), ye = gt(w(tt)).attr("viewBox", `0 0 ${h} ${c}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${P}, ${R})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (k) => U.includes(k.data.label) || k.data.isTransfer === !0).classed("elected", (k) => O.includes(k.data.label) && !k.data.isTransfer).attr("id", (k) => f(k.data)).on("mouseenter", (k, ft) => Oi(k, ft)).on("mouseleave", (k, ft) => Ii(k, ft)), _r = Ve().outerRadius(M).innerRadius(S); if (q) { - const N = De().outerRadius(C + 1).innerRadius(C); - we.append("path").attr("d", N).transition("global").duration(E).attr("d", (ct) => ir(ct)).attr("fill", (ct) => Sr(ct)).on("end", (ct) => Ai()); + const k = Ve().outerRadius(S + 1).innerRadius(S); + ye.append("path").attr("d", k).transition("global").duration(G).attr("d", (ft) => _r(ft)).attr("fill", (ft) => Ie(ft)).on("end", (ft) => Fi()); } else - we.append("path").attr("d", (N) => ir(N)).attr("fill", (N) => Sr(N)), Ai(); - return I && Rs(p, y, M, R, k, B), y; + ye.append("path").attr("d", (k) => _r(k)).attr("fill", (k) => Ie(k)), Fi(); + return F && me(p, y, P, R, M, U), y; } - function Zo() { - const y = gt(w(tt)).select("#" + A).selectAll(".eliminated"); + function Jo() { + const y = gt(w(tt)).select("#" + C).selectAll(".eliminated"); y.size() > 0 && y.classed("finished", !0); } - function Jo() { - const y = gt(w(tt)).select("#" + A).selectAll(".finished"); + function Qo() { + const y = gt(w(tt)).select("#" + C).selectAll(".finished"); y.size() > 0 && y.remove(); } - function Qo(p, _) { - const R = gt(w(tt)).select("#" + m).selectAll(".eliminated"), C = De().innerRadius(p), k = De().outerRadius(_); - R.classed("finished", !0).select("path").transition("global").duration(E).attrTween("d", function(I) { - const q = On(_, p); - return function(B) { - return k.innerRadius(q(B)), k(I); + function tl(p, _) { + const R = gt(w(tt)).select("#" + b).selectAll(".eliminated"), S = Ve().innerRadius(p), M = Ve().outerRadius(_); + R.classed("finished", !0).select("path").transition("global").duration(G).attrTween("d", function(F) { + const q = Wn(_, p); + return function(U) { + return M.innerRadius(q(U)), M(F); }; - }).attr("fill", (I) => `url(#${it(I.data.label)})`), R.clone(!0).classed("finished", !0).select("path").transition("global").duration(E).attrTween("d", function(I) { - const q = On(_, p); - return function(B) { - return C.outerRadius(q(B)), C(I); + }).attr("fill", (F) => `url(#${Z(F.data.label)})`), R.clone(!0).classed("finished", !0).select("path").transition("global").duration(G).attrTween("d", function(F) { + const q = Wn(_, p); + return function(U) { + return S.outerRadius(q(U)), S(F); }; - }).attr("fill", (I) => Sr(I)); + }).attr("fill", (F) => Ie(F)); } - function $i(p, _) { + function Di(p, _) { const y = (p + _) / 2; return y > Math.PI * 11 / 6 || y < Math.PI * 1 / 6 || y > Math.PI * 5 / 6 && y < Math.PI * 7 / 6 ? "middle" : y < Math.PI ? "start" : "end"; } - function Ai() { + function Fi() { gt(w( tt // force redisplay of text labels - )).select("#" + A).raise().append("g").remove(); - } - function tl(p, _, y, M, R, C) { - const I = la().sort(null).value((q) => q.value)(y); - return Cs(p, _, I, M, R, C), I; - } - function Cs(p, _, y, M, R, C) { - const k = Bt(p), I = ye(p), q = De().outerRadius(R).innerRadius(M).startAngle((N) => N.startAngle).endAngle((N) => N.endAngle), B = De().outerRadius(R).innerRadius(M), U = gt(w(tt)).select("#" + _); - U.selectAll(".slice").attr("prevStart", (N) => N.startAngle).attr("prevEnd", (N) => N.endAngle); - const at = U.selectAll(".slice").data(y, (N) => u(N.data)); - at.enter().append("g").attr("class", "slice").attr("id", (N) => u(N.data)).classed("eliminated", !0).on("mouseenter", (N, ct) => Ei(N, ct)).on("mouseleave", (N, ct) => Ri(N, ct)).append("path").attr("d", (N) => B(N)).attr("fill", (N) => Sr(N)), at.classed("eliminated", (N) => k.includes(N.data.label)).classed("elected", (N) => I.includes(N.data.label)).on("mouseenter", (N, ct) => Ei(N, ct)).on("mouseleave", (N, ct) => Ri(N, ct)); - let we = at.size(); - function ir() { - we--, we <= 0 && (Ai(), U.selectAll(".finished").remove()); + )).select("#" + C).raise().append("g").remove(); + } + function el(p, _, y, P, R, S) { + const F = ma().sort(null).value((q) => q.value)(y); + return Ls(p, _, F, P, R, S), F; + } + function Ls(p, _, y, P, R, S) { + const M = ge(p), F = Ze(p), q = Ve().outerRadius(R).innerRadius(P).startAngle((k) => k.startAngle).endAngle((k) => k.endAngle), U = Ve().outerRadius(R).innerRadius(P), W = gt(w(tt)).select("#" + _); + W.selectAll(".slice").attr("prevStart", (k) => k.startAngle).attr("prevEnd", (k) => k.endAngle); + const st = W.selectAll(".slice").data(y, (k) => f(k.data)); + st.enter().append("g").attr("class", "slice").attr("id", (k) => f(k.data)).classed("eliminated", !0).on("mouseenter", (k, ft) => Oi(k, ft)).on("mouseleave", (k, ft) => Ii(k, ft)).append("path").attr("d", (k) => U(k)).attr("fill", (k) => Ie(k)), st.classed("eliminated", (k) => M.includes(k.data.label)).classed("elected", (k) => F.includes(k.data.label)).on("mouseenter", (k, ft) => Oi(k, ft)).on("mouseleave", (k, ft) => Ii(k, ft)); + let ye = st.size(); + function _r() { + ye--, ye <= 0 && (Fi(), W.selectAll(".finished").remove()); } - return at.select("path").transition("global").duration(E).attrTween("d", function(N) { - const ct = Number(gt(this.parentNode).attr("prevStart")), il = Number(gt(this.parentNode).attr("prevEnd")), sl = On(ct, N.startAngle), al = On(il, N.endAngle); - return (Ss) => (q.startAngle(sl(Ss)).endAngle(al(Ss)), q(N)); - }).on("end", ir), C && Wo(p, y, R, k), y; + return st.select("path").transition("global").duration(G).attrTween("d", function(k) { + const ft = Number(gt(this.parentNode).attr("prevStart")), sl = Number(gt(this.parentNode).attr("prevEnd")), al = Wn(ft, k.startAngle), ol = Wn(sl, k.endAngle); + return (Vs) => (q.startAngle(al(Vs)).endAngle(ol(Vs)), q(k)); + }).on("end", _r), S && Pi(p, y, R, M), y; } - function Ei(p, _) { + function Oi(p, _) { s(_.data.label), i("enter"), a(p.clientY); } - function Ri(p, _) { + function Ii(p, _) { s(_.data.label), i("leave"); } - function el(p, _) { + function nl(p, _) { i("show-exhausted"), a(p.clientY); } - function nl(p, _) { + function rl(p, _) { i("hide-exhausted"); } - var rl = { - pieColors: P, - exhaustedLabel: zt, - countExhaustedVotes: me, - getEliminatedCandidates: Bt, - getElectedCandidates: ye, - runFullAnimationFn: re, - animateOnePhaseFn: kn, + var il = { + pieColors: ht, + exhaustedLabel: Me, + countExhaustedVotes: ee, + getEliminatedCandidates: ge, + getElectedCandidates: Ze, + runFullAnimationFn: cn, + animateOnePhaseFn: hn, get jsonData() { return n(); }, set jsonData(p) { - n(p), jt(); + n(p), mt(); }, get currentRound() { return r(); }, set currentRound(p = 1) { - r(p), jt(); + r(p), mt(); }, get mouseEventType() { return i(); }, set mouseEventType(p) { - i(p), jt(); + i(p), mt(); }, get mouseData() { return s(); }, set mouseData(p) { - s(p), jt(); + s(p), mt(); }, get mouseY() { return a(); }, set mouseY(p) { - a(p), jt(); + a(p), mt(); }, get requestRoundChange() { return o(); }, set requestRoundChange(p = (_) => { }) { - o(p), jt(); + o(p), mt(); }, get candidateColors() { return l(); }, set candidateColors(p = []) { - l(p), jt(); + l(p), mt(); + }, + get excludeFinalWinnerAndEliminatedCandidate() { + return u(); + }, + set excludeFinalWinnerAndEliminatedCandidate(p = !1) { + u(p), mt(); } - }, Ns = dd(); - return Br(Ns, (p) => J(tt, p), () => w(tt)), be(t, Ns), ls(rl); + }, qs = pd(); + return Qr(qs, (p) => Q(tt, p), () => w(tt)), ae(t, qs), ys(il); } -co( - Vo, +bo( + jo, { jsonData: {}, currentRound: {}, @@ -5296,7 +5304,8 @@ co( mouseData: {}, mouseY: {}, requestRoundChange: {}, - candidateColors: {} + candidateColors: {}, + excludeFinalWinnerAndEliminatedCandidate: {} }, [], [ @@ -5310,8 +5319,8 @@ co( ], { mode: "open" } ); -var vd = /* @__PURE__ */ er(" ", 1), gd = /* @__PURE__ */ er("About to eliminate: ", 1), _d = /* @__PURE__ */ er(" ", 1), md = /* @__PURE__ */ er("Elected: ", 1), yd = /* @__PURE__ */ er("
", 1), wd = /* @__PURE__ */ er('


these ballots have already been eliminated.
', 1); -const xd = { +var gd = /* @__PURE__ */ Vn(" ", 1), _d = /* @__PURE__ */ Vn("About to eliminate: ", 1), md = /* @__PURE__ */ Vn(" ", 1), yd = /* @__PURE__ */ Vn(" ", 1), wd = /* @__PURE__ */ Vn('

', 1), xd = /* @__PURE__ */ Vn("
", 1), bd = /* @__PURE__ */ Vn('


these ballots have already been eliminated.
', 1); +const $d = { 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:absolute;width:max-content;text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;left:50%;transform:translate(-50%);font-weight:normal;opacity:0;}.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: 90%; */ @@ -5355,251 +5364,316 @@ const xd = { }` }; -function bd(t, e) { - os(e, !0), uo(t, xd); +function Ad(t, e) { + ms(e, !0), wo(t, $d); const n = 0.85; - let r = ue(e, "electionSummary", 7), i = ue(e, "currentRound", 7, 1), s = ue(e, "requestRoundChange", 7, ($) => { - }), a = ue(e, "candidateColors", 23, () => []), o = /* @__PURE__ */ mt(null), l = /* @__PURE__ */ mt(null), u = /* @__PURE__ */ mt(""), f = /* @__PURE__ */ mt(un([])), h = /* @__PURE__ */ mt(""), c = /* @__PURE__ */ mt(""), v = /* @__PURE__ */ mt(0), g = /* @__PURE__ */ sr(() => m(r())); - function m($) { - if (typeof $ == "string") + let r = Et(e, "electionSummary", 7), i = Et(e, "currentRound", 7, 1), s = Et(e, "requestRoundChange", 7, (x) => { + }), a = Et(e, "candidateColors", 23, () => []), o = Et(e, "textForWinner", 7, "elected"), l = Et(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = Et(e, "firstRoundDeterminesPercentages", 7, !0), f = Et(e, "showCaptions", 7, !1); + const h = { + elected: { + caption: "Elected", + event: "was elected", + infinitive: "to be elected" + }, + won: { caption: "Won", event: "won", infinitive: "to win" }, + advanced: { + caption: "Advanced", + event: "advanced to the general", + infinitive: "to advance to the general" + }, + leading: { + caption: "Leading", + event: "is in the lead", + infinitive: "to take the lead" + } + }; + let c = /* @__PURE__ */ Bn(() => h[o()] ?? h.elected), v = /* @__PURE__ */ yt(null), g = /* @__PURE__ */ yt(null), m = /* @__PURE__ */ yt(""), b = /* @__PURE__ */ yt(yn([])), $ = /* @__PURE__ */ yt(""), C = /* @__PURE__ */ yt(""), T = /* @__PURE__ */ yt(0), N = /* @__PURE__ */ Bn(() => I(r())); + function I(x) { + if (typeof x == "string") try { - $ = JSON.parse($); - } catch (V) { - return console.error("Failed to parse JSON string:", V), {}; + x = JSON.parse(x); + } catch (B) { + return console.error("Failed to parse JSON string:", B), {}; } - return $ || {}; + return x || {}; } - function b($) { - s() ? s()($) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); + function G(x) { + s() ? s()(x) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function A() { - switch (w(h)) { + function at() { + switch (w($)) { case "enter": - (($) => { - var V = Al($, 2); - J(f, V[0], !0), J(u, V[1], !0); - })(T(w(c), i())), w(o) && (w(o).style.top = String(w(v) || 20) + "px", w(o).style.opacity = String(n)); + ((x) => { + var B = El(x, 2); + Q(b, B[0], !0), Q(m, B[1], !0); + })(et(w(C), i())), w(v) && (w(v).style.top = String(w(T) || 20) + "px", w(v).style.opacity = String(n)); break; case "leave": - w(o) && (w(o).style.opacity = "0"), J(f, [], !0), J(u, ""); + w(v) && (w(v).style.opacity = "0"), Q(b, [], !0), Q(m, ""); break; case "show-exhausted": - w(l) && (w(l).style.top = String(w(v) || 20) + "px", w(l).style.opacity = String(n)); + w(g) && (w(g).style.top = String(w(T) || 20) + "px", w(g).style.opacity = String(n)); break; case "hide-exhausted": - w(l) && (w(l).style.opacity = "0"); + w(g) && (w(g).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", w(h)); + console.log("Unknown mouse event: ", w($)); break; } } - ds(() => A()); - function S($, V) { - return $ == 1 ? V ? "vote was" : "vote will be" : V ? "votes were" : "votes will be"; - } - function T($, V) { - const et = [], K = $ === "exhausted" ? ut() : $; - let rt; - $ == "exhausted" ? rt = W(1) : rt = w(g).results[0].tally[$], et.push(`${K} started with ${rt} votes.`); - for (let Q = 1; Q <= V; Q++) { - Q === V && ($ == "exhausted" ? rt = W(V) : rt = w(g).results[V - 1].tally[$], et.push(`${K} has ${rt} votes at round ${V}.`)); - const At = w(g).results[Q - 1].tallyResults; - for (let dt = 0; dt < At.length; dt++) { - const re = At[dt].transfers, ie = At[dt].eliminated, st = At[dt].elected; - if (ie) - ie === $ && et.push(`${K} will be eliminated on round ${Q}.`); - else if ($ === st && (et.push(`${K} was elected on round ${Q}.`), re)) - for (let [se, bt] of Object.entries(re)) - et.push(`${bt} ${S(Number(bt), Q < V)} transferred to ${se} on round ${Q}.`); - const Ke = ie || st; - if (Ke) { - const se = Number(re[$]); - se && et.push(`${se} ${S(se, Q < V)} transferred from ${Ke} on round ${Q}.`); + As(() => at()); + function Z(x, B) { + return x == 1 ? B ? "vote was" : "vote will be" : B ? "votes were" : "votes will be"; + } + function et(x, B) { + const nt = [], ot = x === "exhausted" ? tt() : x; + let J; + x == "exhausted" ? J = ht(1) : J = w(N).results[0].tally[x], nt.push(`${ot} started with ${J} votes.`); + for (let rt = 1; rt <= B; rt++) { + rt === B && (x == "exhausted" ? J = ht(B) : J = w(N).results[B - 1].tally[x], nt.push(`${ot} has ${J} votes at round ${B}.`)); + const $t = w(N).results[rt - 1].tallyResults, Je = it(rt); + for (let re = 0; re < $t.length; re++) { + const cn = $t[re].transfers, De = $t[re].eliminated, K = $t[re].elected; + if (!Je) { + if (De) + De === x && nt.push(`${ot} will be eliminated on round ${rt}.`); + else if (x === K && (nt.push(`${ot} ${w(c).event} on round ${rt}.`), cn)) + for (let [Yt, Qe] of Object.entries(cn)) + nt.push(`${Qe} ${Z(Number(Qe), rt < B)} transferred to ${Yt} on round ${rt}.`); + } + const _e = De || K; + if (_e) { + const Yt = Number(cn[x]); + Yt && nt.push(`${Yt} ${Z(Yt, rt < B)} transferred from ${_e} on round ${rt}.`); } } } - return [et, K]; - } - function D() { - let $ = 0; - for (let V = 1; V <= w(g).results.length; V++) { - const et = w(g).results[V - 1].tallyResults; - for (let K = 0; K < et.length; K++) - et[K].elected && $++; + return [nt, ot]; + } + function dt() { + let x = 0; + for (let B = 1; B <= w(N).results.length; B++) { + if (it(B)) continue; + const nt = w(N).results[B - 1].tallyResults; + for (let ot = 0; ot < nt.length; ot++) + nt[ot].elected && x++; } - return $; + return x; } - let E; - function j($) { - return E ? E.getEliminatedCandidates($) : []; + let H; + function it(x) { + return l() && w(N).results && x === w(N).results.length; } - function it($) { - return E ? E.getElectedCandidates($) : []; + function A(x) { + return it(x) ? [] : H ? H.getEliminatedCandidates(x) : []; } - function W($) { - return E ? E.countExhaustedVotes($) : 0; + function E(x) { + return it(x) ? [] : H ? H.getElectedCandidates(x) : []; } - function nt() { - E && E.animateOnePhaseFn && E.animateOnePhaseFn(); + function ht(x) { + return H ? H.countExhaustedVotes(x) : 0; } - function ut() { - return E ? E.exhaustedLabel : ""; + function Me() { + H && H.animateOnePhaseFn && H.animateOnePhaseFn(); } - function ft() { - return E ? E.pieColors : {}; + function tt() { + return H ? H.exhaustedLabel : ""; } - var G = { + function te() { + return H ? H.pieColors : {}; + } + var Pe = { get electionSummary() { return r(); }, - set electionSummary($) { - r($), jt(); + set electionSummary(x) { + r(x), mt(); }, get currentRound() { return i(); }, - set currentRound($ = 1) { - i($), jt(); + set currentRound(x = 1) { + i(x), mt(); }, get requestRoundChange() { return s(); }, - set requestRoundChange($ = (V) => { + set requestRoundChange(x = (B) => { }) { - s($), jt(); + s(x), mt(); }, get candidateColors() { return a(); }, - set candidateColors($ = []) { - a($), jt(); + set candidateColors(x = []) { + a(x), mt(); + }, + get textForWinner() { + return o(); + }, + set textForWinner(x = "elected") { + o(x), mt(); + }, + get excludeFinalWinnerAndEliminatedCandidate() { + return l(); + }, + set excludeFinalWinnerAndEliminatedCandidate(x = !1) { + l(x), mt(); + }, + get firstRoundDeterminesPercentages() { + return u(); + }, + set firstRoundDeterminesPercentages(x = !0) { + u(x), mt(); + }, + get showCaptions() { + return f(); + }, + set showCaptions(x = !1) { + f(x), mt(); } - }, x = wd(), P = Mn(x), zt = Xt(P); - zt.__click = nt, Ut(P); - var tt = ae(P, 4), Ht = Xt(tt), Yt = Xt(Ht), ne = Xt(Yt); - Br( - Vo(ne, { + }, Ht = bd(), pe = dn(Ht), Nt = Ut(pe); + Nt.__click = Me, Bt(pe); + var ve = ie(pe, 4), ee = Ut(ve), Rt = Ut(ee), ln = Ut(Rt); + Qr( + jo(ln, { get jsonData() { - return w(g); + return w(N); }, get currentRound() { return i(); }, - requestRoundChange: b, + requestRoundChange: G, get candidateColors() { return a(); }, + get excludeFinalWinnerAndEliminatedCandidate() { + return l(); + }, get mouseEventType() { - return w(h); + return w($); }, - set mouseEventType($) { - J(h, $, !0); + set mouseEventType(x) { + Q($, x, !0); }, get mouseData() { - return w(c); + return w(C); }, - set mouseData($) { - J(c, $, !0); + set mouseData(x) { + Q(C, x, !0); }, get mouseY() { - return w(v); + return w(T); }, - set mouseY($) { - J(v, $, !0); + set mouseY(x) { + Q(T, x, !0); } }), - ($) => E = $, - () => E - ), Ut(Yt), Ut(Ht); - var ge = ae(Ht, 2), Tt = Xt(ge); - Ut(ge); - var _e = ae(ge, 2), me = Xt(_e); - { - var Xe = ($) => { - var V = gd(), et = ae(Mn(V)); - Si(et, 17, () => j(i()), Ni, (K, rt, Q) => { - var At = vd(), dt = Mn(At); - let re; - var ie = Xt(dt, !0); - Ut(dt); - var st = ae(dt, 2); - { - var Ke = (bt) => { - var kn = Vs(", "); - be(bt, kn); - }, se = /* @__PURE__ */ sr(() => Q < j(i()).length - 1); - Dr(st, (bt) => { - w(se) && bt(Ke); - }); - } - Pr( - (bt) => { - re = Ys(dt, "", re, bt), Pn(ie, w(rt)); - }, - [() => ({ color: ft()[w(rt)] })] - ), be(K, At); - }), be($, V); - }, Ot = /* @__PURE__ */ sr(() => j(i()).length > 0); - Dr(me, ($) => { - w(Ot) && $(Xe); - }); - } - var nn = ae(me, 2); + (x) => H = x, + () => H + ), Bt(Rt), Bt(ee); + var un = ie(ee, 2); { - var rn = ($) => { - var V = md(), et = ae(Mn(V)); - Si(et, 17, () => it(i()), Ni, (K, rt, Q) => { - var At = _d(), dt = Mn(At); - let re; - var ie = Xt(dt, !0); - Ut(dt); - var st = ae(dt, 2); - { - var Ke = (bt) => { - var kn = Vs(", "); - be(bt, kn); - }, se = /* @__PURE__ */ sr(() => Q < it(i()).length - 1); - Dr(st, (bt) => { - w(se) && bt(Ke); - }); - } - Pr( - (bt) => { - re = Ys(dt, "", re, bt), Pn(ie, w(rt)); - }, - [() => ({ color: ft()[w(rt)] })] - ), be(K, At); - }), be($, V); - }, Ge = /* @__PURE__ */ sr(() => it(i()).length > 0); - Dr(nn, ($) => { - w(Ge) && $(rn); + var fn = (x) => { + var B = wd(), nt = dn(B), ot = Ut(nt); + Bt(nt); + var J = ie(nt, 2), rt = Ut(J); + { + var $t = (K) => { + var _e = _d(), Yt = ie(dn(_e)); + zi(Yt, 17, () => A(i()), Vi, (Qe, hn, Hn) => { + var Yn = gd(), Fe = dn(Yn); + let Oe; + var Ie = Ut(Fe, !0); + Bt(Fe); + var pr = ie(Fe, 2); + { + var vr = (Le) => { + var me = js(", "); + ae(Le, me); + }, gr = /* @__PURE__ */ Bn(() => Hn < A(i()).length - 1); + mr(pr, (Le) => { + w(gr) && Le(vr); + }); + } + Un( + (Le) => { + Oe = Qs(Fe, "", Oe, Le), pn(Ie, w(hn)); + }, + [() => ({ color: te()[w(hn)] })] + ), ae(Qe, Yn); + }), ae(K, _e); + }, Je = /* @__PURE__ */ Bn(() => A(i()).length > 0); + mr(rt, (K) => { + w(Je) && K($t); + }); + } + var re = ie(rt, 2); + { + var cn = (K) => { + var _e = yd(), Yt = dn(_e), Qe = ie(Yt); + zi(Qe, 17, () => E(i()), Vi, (hn, Hn, Yn) => { + var Fe = md(), Oe = dn(Fe); + let Ie; + var pr = Ut(Oe, !0); + Bt(Oe); + var vr = ie(Oe, 2); + { + var gr = (me) => { + var Pi = js(", "); + ae(me, Pi); + }, Le = /* @__PURE__ */ Bn(() => Yn < E(i()).length - 1); + mr(vr, (me) => { + w(Le) && me(gr); + }); + } + Un( + (me) => { + Ie = Qs(Oe, "", Ie, me), pn(pr, w(Hn)); + }, + [() => ({ color: te()[w(Hn)] })] + ), ae(hn, Fe); + }), Un(() => pn(Yt, `${w(c).caption ?? ""}: `)), ae(K, _e); + }, De = /* @__PURE__ */ Bn(() => E(i()).length > 0); + mr(re, (K) => { + w(De) && K(cn); + }); + } + Bt(J), Un((K) => pn(ot, `${w(N).config.contest ?? ""}, ${K ?? ""} ${w(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [dt]), ae(x, B); + }; + mr(un, (x) => { + f() && x(fn); }); } - Ut(_e), Ut(tt); - var Bt = ae(tt, 2), ye = Xt(Bt), Sn = Xt(ye, !0); - Ut(ye); - var Nr = ae(ye, 2); - Si(Nr, 17, () => w(f), Ni, ($, V) => { - var et = yd(), K = Mn(et), rt = Xt(K, !0); - Ut(K), Fi(2), Pr(() => Pn(rt, w(V))), be($, et); - }), Ut(Bt), Br(Bt, ($) => J(o, $), () => w(o)); - var rr = ae(Bt, 2), bi = Xt(rr); - return Fi(2), Ut(rr), Br(rr, ($) => J(l, $), () => w(l)), Pr( - ($, V) => { - Pn(Tt, `${w(g).config.contest ?? ""}, ${$ ?? ""} to be elected, Round ${i() ?? ""}.`), Pn(Sn, w(u)), Pn(bi, `"${V ?? ""}" means all the candidates ranked on `); + Bt(ve); + var ne = ie(ve, 2), ge = Ut(ne), Ze = Ut(ge, !0); + Bt(ge); + var ki = ie(ge, 2); + zi(ki, 17, () => w(b), Vi, (x, B) => { + var nt = xd(), ot = dn(nt), J = Ut(ot, !0); + Bt(ot), Gi(2), Un(() => pn(J, w(B))), ae(x, nt); + }), Bt(ne), Qr(ne, (x) => Q(v, x), () => w(v)); + var zn = ie(ne, 2), Mi = Ut(zn); + return Gi(2), Bt(zn), Qr(zn, (x) => Q(g, x), () => w(g)), Un( + (x) => { + pn(Ze, w(m)), pn(Mi, `"${x ?? ""}" means all the candidates ranked on `); }, - [D, ut] - ), be(t, x), ls(G); + [tt] + ), ae(t, Ht), ys(Pe); } -hu(["click"]); -customElements.define("pie-chart", co( - bd, +du(["click"]); +customElements.define("pie-chart", bo( + Ad, { electionSummary: {}, currentRound: {}, requestRoundChange: {}, - candidateColors: {} + candidateColors: {}, + textForWinner: {}, + excludeFinalWinnerAndEliminatedCandidate: {}, + firstRoundDeterminesPercentages: {}, + showCaptions: {} }, [], [], diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 8624e60b..faf0a731 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -26,6 +26,9 @@ pieChart.requestRoundChange = updateRound; pieChart.electionSummary = electionSummary; pieChart.candidateColors = candidateColors; + pieChart.textForWinner = "{{ textForWinner }}"; + pieChart.excludeFinalWinnerAndEliminatedCandidate = {{ config.excludeFinalWinnerAndEliminatedCandidate|yesno:"true,false" }}; + pieChart.currentRound = {{ config.numRounds }}; // Append it to the div document.getElementById("pie-body").appendChild(pieChart); From 0df774da9684ee9fc73f900ed62048f8a1867642 Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 4 Mar 2026 18:06:12 -0500 Subject: [PATCH 06/31] Add hidePie setting to hide pie chart tab per election Following the hideSankey/hideTabular pattern: model field, config JS variable, settings checkbox, and tab hiding in hideTabsBasedOnConfig(). Co-Authored-By: Claude Opus 4.6 --- static/visualizer/tabs-nonblocking.js | 4 ++++ templates/settings/base.html | 8 ++++++++ .../visualizer/common-visualizer-header.html | 1 + .../migrations/0033_jsonconfig_hidepie.py | 18 ++++++++++++++++++ visualizer/models.py | 2 ++ 5 files changed, 33 insertions(+) create mode 100644 visualizer/migrations/0033_jsonconfig_hidepie.py diff --git a/static/visualizer/tabs-nonblocking.js b/static/visualizer/tabs-nonblocking.js index 25277dcb..ca44626e 100644 --- a/static/visualizer/tabs-nonblocking.js +++ b/static/visualizer/tabs-nonblocking.js @@ -59,6 +59,10 @@ function hideTabsBasedOnConfig() { { $("li[name='li_hideable_tabular']").css("display","none"); } + if (config.hidePie) + { + $("li[name='li_hideable_pie']").css("display","none"); + } if (config.hideSankey) { $("li[name='li_hideable_sankey']").css("display","none"); diff --git a/templates/settings/base.html b/templates/settings/base.html index 0ed3a719..59957868 100644 --- a/templates/settings/base.html +++ b/templates/settings/base.html @@ -48,6 +48,14 @@

+ +
+

+ + +

+
+

diff --git a/templates/visualizer/common-visualizer-header.html b/templates/visualizer/common-visualizer-header.html index 79613737..5bd9868f 100644 --- a/templates/visualizer/common-visualizer-header.html +++ b/templates/visualizer/common-visualizer-header.html @@ -26,6 +26,7 @@ // 1. Load from django (happens once on baking) config.onlyShowWinnersTabular = {% if config.onlyShowWinnersTabular %} true {% else %} false {% endif %}; config.hideSankey = {% if config.hideSankey %} true {% else %} false {% endif %}; + config.hidePie = {% if config.hidePie %} true {% else %} false {% endif %}; config.showRoundNumbersOnSankey = {% if config.showRoundNumbersOnSankey %} true {% else %} false {% endif %}; config.hideTabular = {% if config.hideTabular %} true {% else %} false {% endif %}; config.doDimPrevRoundColors = {% if config.doDimPrevRoundColors %} true {% else %} false {% endif %}; diff --git a/visualizer/migrations/0033_jsonconfig_hidepie.py b/visualizer/migrations/0033_jsonconfig_hidepie.py new file mode 100644 index 00000000..9beb3559 --- /dev/null +++ b/visualizer/migrations/0033_jsonconfig_hidepie.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.22 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('visualizer', '0032_jsonconfig_forcefirstrounddeterminespercentages'), + ] + + operations = [ + migrations.AddField( + model_name='jsonconfig', + name='hidePie', + field=models.BooleanField(default=False), + ), + ] diff --git a/visualizer/models.py b/visualizer/models.py index 65a6a4e1..71a293eb 100644 --- a/visualizer/models.py +++ b/visualizer/models.py @@ -88,6 +88,7 @@ class JsonConfig(models.Model): showRoundNumbersOnSankey = models.BooleanField(default=True) onlyShowWinnersTabular = models.BooleanField(default=True) hideSankey = models.BooleanField(default=False) + hidePie = models.BooleanField(default=False) hideTabular = models.BooleanField(default=False) doDimPrevRoundColors = models.BooleanField(default=True) isPreferentialBlock = models.BooleanField(default=False) @@ -110,6 +111,7 @@ def get_all_non_auto_fields(cls): 'isPreferentialBlock', 'forceFirstRoundDeterminesPercentages', 'hideSankey', + 'hidePie', 'hideTabular', 'doDimPrevRoundColors', 'excludeFinalWinnerAndEliminatedCandidate', From 3a97020e3b19ca9d5aaba3c4f4e376aadf17b0ff Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 4 Mar 2026 18:15:11 -0500 Subject: [PATCH 07/31] Add tests for graphToRCtab converter (32 tests) Covers structure validation, tally correctness, eliminations, multi-winner surplus, inactive ballots, no-threshold elections, excludeFinalWinner flag, and the _stringify helper. Co-Authored-By: Claude Opus 4.6 --- visualizer/tests/testGraphToRCtab.py | 263 +++++++++++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 visualizer/tests/testGraphToRCtab.py diff --git a/visualizer/tests/testGraphToRCtab.py b/visualizer/tests/testGraphToRCtab.py new file mode 100644 index 00000000..a177558f --- /dev/null +++ b/visualizer/tests/testGraphToRCtab.py @@ -0,0 +1,263 @@ +""" +Tests for the graphToRCtab converter that builds RCTab-compatible JSON +from processed Graph objects for the pie chart component. +""" + +from django.test import TestCase + +from visualizer import common +from visualizer.graph.graphCreator import make_graph_with_file +from visualizer.pie.graphToRCtab import graph_to_rctab_json, _stringify +from visualizer.tests import filenames + + +class StringifyTests(TestCase): + """ Tests for the _stringify helper """ + + def test_integer_unchanged(self): + self.assertEqual(_stringify(42), "42") + + def test_integer_float_drops_decimal(self): + self.assertEqual(_stringify(42.0), "42") + + def test_actual_float_kept(self): + self.assertEqual(_stringify(42.5), "42.5") + + def test_zero(self): + self.assertEqual(_stringify(0), "0") + + def test_zero_float(self): + self.assertEqual(_stringify(0.0), "0") + + def test_string_passthrough(self): + """ RCTab JSON sometimes has string values already """ + self.assertEqual(_stringify("100"), "100") + + +class OneRoundTests(TestCase): + """ Tests with a single-round election """ + + def setUp(self): + with open(filenames.ONE_ROUND, 'r', encoding='utf-8') as f: + self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) + self.result = graph_to_rctab_json(self.graph) + + def test_top_level_structure(self): + self.assertIn('config', self.result) + self.assertIn('results', self.result) + self.assertIn('summary', self.result) + self.assertIn('jsonFormatVersion', self.result) + + def test_single_round(self): + self.assertEqual(len(self.result['results']), 1) + + def test_round_has_required_fields(self): + rnd = self.result['results'][0] + self.assertIn('round', rnd) + self.assertIn('tally', rnd) + self.assertIn('tallyResults', rnd) + self.assertIn('inactiveBallots', rnd) + self.assertIn('threshold', rnd) + self.assertEqual(rnd['round'], 1) + + def test_tally_has_candidates(self): + tally = self.result['results'][0]['tally'] + self.assertGreater(len(tally), 0) + # All tally values should be strings (RCTab convention) + for val in tally.values(): + self.assertIsInstance(val, str) + + def test_winner_elected(self): + """ The single-round election should have an elected candidate """ + tally_results = self.result['results'][0]['tallyResults'] + elected = [tr for tr in tally_results if 'elected' in tr] + self.assertGreater(len(elected), 0) + + def test_config_has_contest(self): + self.assertIn('contest', self.result['config']) + self.assertIsInstance(self.result['config']['contest'], str) + self.assertGreater(len(self.result['config']['contest']), 0) + + +class ThreeRoundTests(TestCase): + """ Tests with a three-round single-winner election (medium-rcvis.json) """ + + def setUp(self): + with open(filenames.THREE_ROUND, 'r', encoding='utf-8') as f: + self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) + self.result = graph_to_rctab_json(self.graph) + + def test_round_count(self): + self.assertEqual(len(self.result['results']), 3) + + def test_rounds_numbered_sequentially(self): + for i, rnd in enumerate(self.result['results']): + self.assertEqual(rnd['round'], i + 1) + + def test_first_round_has_all_candidates(self): + """ The first round's tally should include all candidates from the graph """ + graph_candidates = {c.name for c in self.graph.candidates} + first_tally = set(self.result['results'][0]['tally'].keys()) + self.assertTrue(graph_candidates.issubset(first_tally), + f"Missing candidates: {graph_candidates - first_tally}") + + def test_eliminated_candidates_removed_in_later_rounds(self): + """ Eliminated candidates should not appear in subsequent rounds' tallies """ + # Banana is eliminated in round 1, so it should not be in round 2 or 3 + round_2_tally = set(self.result['results'][1]['tally'].keys()) + round_3_tally = set(self.result['results'][2]['tally'].keys()) + self.assertNotIn('Banana', round_2_tally) + self.assertNotIn('Banana', round_3_tally) + + def test_eliminations_present(self): + """ Earlier rounds should have eliminations """ + all_eliminated = [] + for rnd in self.result['results']: + for tr in rnd['tallyResults']: + if 'eliminated' in tr: + all_eliminated.append(tr['eliminated']) + self.assertGreater(len(all_eliminated), 0) + + def test_final_round_has_winner(self): + last_round = self.result['results'][-1] + elected = [tr for tr in last_round['tallyResults'] if 'elected' in tr] + self.assertEqual(len(elected), 1) + + def test_transfers_have_string_values(self): + """ All transfer values should be strings (RCTab convention) """ + for rnd in self.result['results']: + for tr in rnd['tallyResults']: + if 'transfers' in tr: + for val in tr['transfers'].values(): + self.assertIsInstance(val, str) + + def test_threshold_is_string(self): + for rnd in self.result['results']: + self.assertIsInstance(rnd['threshold'], str) + + def test_summary_fields(self): + summary = self.result['summary'] + self.assertIn('numCandidates', summary) + self.assertIn('numWinners', summary) + self.assertIn('totalNumBallots', summary) + self.assertIn('finalThreshold', summary) + + +class MultwinnerTests(TestCase): + """ Tests with a multi-winner surplus election (macomb-multiwinner-surplus.json) """ + + def setUp(self): + with open(filenames.MULTIWINNER, 'r', encoding='utf-8') as f: + self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) + self.result = graph_to_rctab_json(self.graph) + + def test_round_count(self): + self.assertEqual(len(self.result['results']), 5) + + def test_multiple_winners(self): + """ Multi-winner election should have multiple elected candidates """ + all_elected = [] + for rnd in self.result['results']: + for tr in rnd['tallyResults']: + if 'elected' in tr: + all_elected.append(tr['elected']) + self.assertGreater(len(all_elected), 1) + + def test_elected_have_transfers(self): + """ Elected candidates with surplus should have transfer entries """ + for rnd in self.result['results']: + for tr in rnd['tallyResults']: + if 'elected' in tr: + self.assertIn('transfers', tr) + + def test_num_candidates_excludes_pseudocandidates(self): + """ numCandidates in summary should not count Inactive Ballots or Residual Surplus """ + num = self.result['summary']['numCandidates'] + inactive_names = {common.INACTIVE_TEXT, common.RESIDUAL_SURPLUS_TEXT} + real_count = sum(1 for c in self.graph.candidates if c.name not in inactive_names) + self.assertEqual(num, real_count) + + +class InactiveBallotTests(TestCase): + """ Tests with a multiwinner election that has nonzero exhausted votes """ + + def setUp(self): + # Multiwinner election has Inactive Ballots count > 0 in round 5 + with open(filenames.MULTIWINNER, 'r', encoding='utf-8') as f: + self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) + self.result = graph_to_rctab_json(self.graph) + + def test_inactive_ballots_absent_when_zero(self): + """ Early rounds with zero exhausted votes should have empty inactiveBallots """ + first_round = self.result['results'][0] + inactive = first_round['inactiveBallots'] + self.assertNotIn('exhaustedChoices', inactive) + + def test_inactive_ballots_present_when_nonzero(self): + """ Round 5 has nonzero exhausted votes and should populate exhaustedChoices """ + last_round = self.result['results'][-1] + inactive = last_round['inactiveBallots'] + self.assertIn('exhaustedChoices', inactive) + self.assertGreater(float(inactive['exhaustedChoices']), 0) + + +class NoThresholdTests(TestCase): + """ Tests with an election that has no threshold in its config """ + + def setUp(self): + with open(filenames.NO_THRESHOLD, 'r', encoding='utf-8') as f: + self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) + self.result = graph_to_rctab_json(self.graph) + + def test_threshold_defaults_to_zero(self): + """ When no threshold, converter should output "0" rather than crash """ + for rnd in self.result['results']: + self.assertIsInstance(rnd['threshold'], str) + + def test_final_threshold_in_summary(self): + self.assertIn('finalThreshold', self.result['summary']) + + +class ExcludeFinalWinnerTests(TestCase): + """ Tests that excludeFinalWinnerAndEliminatedCandidate affects the output. + + The flag removes isWinner/isEliminated flags from the Graph's nodes, + but the WinTransfer/Elimination objects remain in transfersPerRound. + The converter still produces tallyResults entries — the flag's effect + is on visual markers (gold rings, etc.), not on transfer data. + The pie chart component handles suppression separately via its own + excludeFinalWinnerAndEliminatedCandidate prop. """ + + def test_with_exclude_flag_nodes_not_marked(self): + """ With the flag, the final round's nodes should have no winner/eliminated flags """ + with open(filenames.THREE_ROUND, 'r', encoding='utf-8') as f: + graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=True) + + last_round_nodes = graph.nodesPerRound[-1] + for candidate, node in last_round_nodes.items(): + self.assertFalse(node.isWinner, + f"{candidate.name} should not be marked as winner") + self.assertFalse(node.isEliminated, + f"{candidate.name} should not be marked as eliminated") + + def test_with_exclude_flag_transfers_preserved(self): + """ The converter still outputs tallyResults even with the flag, + because transfersPerRound is not affected by the flag """ + with open(filenames.THREE_ROUND, 'r', encoding='utf-8') as f: + graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=True) + result = graph_to_rctab_json(graph) + + last_round = result['results'][-1] + # WinTransfer is still present, so elected entry still appears + elected = [tr for tr in last_round['tallyResults'] if 'elected' in tr] + self.assertEqual(len(elected), 1) + + def test_without_exclude_flag(self): + """ Without the flag, the final round should have an elected candidate """ + with open(filenames.THREE_ROUND, 'r', encoding='utf-8') as f: + graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) + result = graph_to_rctab_json(graph) + + last_round = result['results'][-1] + elected = [tr for tr in last_round['tallyResults'] if 'elected' in tr] + self.assertEqual(len(elected), 1) From 1b9f289e4ee0457598ea2d4002c8f0f7edb9dd33 Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 4 Mar 2026 19:04:22 -0500 Subject: [PATCH 08/31] Rebuild standalone component with tooltip fix Co-Authored-By: Claude Opus 4.6 --- static/pie/pie-chart.es.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 30e857a2..b0241777 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -5322,7 +5322,7 @@ bo( var gd = /* @__PURE__ */ Vn(" ", 1), _d = /* @__PURE__ */ Vn("About to eliminate: ", 1), md = /* @__PURE__ */ Vn(" ", 1), yd = /* @__PURE__ */ Vn(" ", 1), wd = /* @__PURE__ */ Vn('

', 1), xd = /* @__PURE__ */ Vn("
", 1), bd = /* @__PURE__ */ Vn('


these ballots have already been eliminated.
', 1); const $d = { 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:absolute;width:max-content;text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;left:50%;transform:translate(-50%);font-weight:normal;opacity:0;}.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 { + 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;text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;left:50%;transform:translate(-50%);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: 90%; */ /* min-width: 800px; /* Larger minimum size */width:100%; /* Change from 90% to 100% */min-width:auto; /* Remove the 800px minimum */flex-grow:0; /* Don't grow beyond specified width */margin:0 auto;margin-right:40px; /* Add extra space on right */margin-top:-3vh;}.visualizations-container.svelte-1r6y5gl {display:flex;justify-content:space-between;width:100%;padding:0 20px; /* gap: 80px; */gap:20px; /* Reduce from 80px */} @@ -5406,13 +5406,13 @@ function Ad(t, e) { ((x) => { var B = El(x, 2); Q(b, B[0], !0), Q(m, B[1], !0); - })(et(w(C), i())), w(v) && (w(v).style.top = String(w(T) || 20) + "px", w(v).style.opacity = String(n)); + })(et(w(C), i())), w(v) && (w(v).style.top = String((w(T) || 0) + 20) + "px", w(v).style.opacity = String(n)); break; case "leave": w(v) && (w(v).style.opacity = "0"), Q(b, [], !0), Q(m, ""); break; case "show-exhausted": - w(g) && (w(g).style.top = String(w(T) || 20) + "px", w(g).style.opacity = String(n)); + w(g) && (w(g).style.top = String((w(T) || 0) + 20) + "px", w(g).style.opacity = String(n)); break; case "hide-exhausted": w(g) && (w(g).style.opacity = "0"); From ad3876b9d497b17e5475957f785a2798be1756f6 Mon Sep 17 00:00:00 2001 From: skaphan Date: Thu, 5 Mar 2026 05:27:03 -0500 Subject: [PATCH 09/31] Scramble pie chart colors for better adjacent-slice contrast Use a coprime stride near N/2 to reorder the color palette so that visually similar colors are spread apart around the pie chart. Co-Authored-By: Claude Opus 4.6 --- templates/pie/pie-nonblocking.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index faf0a731..1c5dbbc4 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -15,7 +15,14 @@ // Generate candidate colors from the election's color theme, // matching the palette used by the other visualizations. const colorGenerator = getColorGenerator(config.colorTheme); - const candidateColors = Array.from(colorGenerator({{ config.numCandidates }})); + const candidateColors = Array.from(colorGenerator({{ config.numCandidates }})); + // Scramble colors so adjacent pie slices have more visual contrast. + // Pick a stride near N/2 that is coprime to N, so every index is visited exactly once. + function gcd(a, b) { while (b) { [a, b] = [b, a % b]; } return a; } + const _n = candidateColors.length; + let _stride = Math.floor(_n / 2) || 1; + while (_stride < _n && gcd(_stride, _n) !== 1) _stride++; + const scrambledColors = candidateColors.map((_, i) => candidateColors[(i * _stride) % _n]); // Create the pie-chart element const pieChart = document.createElement("pie-chart"); @@ -25,7 +32,7 @@ // we can just bind it in object form here. pieChart.requestRoundChange = updateRound; pieChart.electionSummary = electionSummary; - pieChart.candidateColors = candidateColors; + pieChart.candidateColors = scrambledColors; pieChart.textForWinner = "{{ textForWinner }}"; pieChart.excludeFinalWinnerAndEliminatedCandidate = {{ config.excludeFinalWinnerAndEliminatedCandidate|yesno:"true,false" }}; pieChart.currentRound = {{ config.numRounds }}; From cd5e09b6cf9ac9ffbadce98b36c2b0e8deef5890 Mon Sep 17 00:00:00 2001 From: skaphan Date: Thu, 5 Mar 2026 06:01:47 -0500 Subject: [PATCH 10/31] Interleave pie slices by vote count, fix color count Replace color scramble with tally interleaving: alternate largest and smallest candidates so small slices always have a large neighbor, reducing label overlap. Inactive Ballots always last. Fix color generation to use actual tally entry count instead of config.numCandidates, which excluded Inactive Ballots and caused color wrapping on large elections. Co-Authored-By: Claude Opus 4.6 --- templates/pie/pie-nonblocking.html | 15 ++++++--------- visualizer/pie/graphToRCtab.py | 24 ++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 1c5dbbc4..cf69e834 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -14,15 +14,12 @@ // Generate candidate colors from the election's color theme, // matching the palette used by the other visualizations. + // Generate enough colors for all tally entries (including Inactive Ballots) + // rather than config.numCandidates, to avoid color wrapping. + const _parsedSummary = JSON.parse(electionSummary); + const _numTallyEntries = Object.keys(_parsedSummary.results[0].tally).length; const colorGenerator = getColorGenerator(config.colorTheme); - const candidateColors = Array.from(colorGenerator({{ config.numCandidates }})); - // Scramble colors so adjacent pie slices have more visual contrast. - // Pick a stride near N/2 that is coprime to N, so every index is visited exactly once. - function gcd(a, b) { while (b) { [a, b] = [b, a % b]; } return a; } - const _n = candidateColors.length; - let _stride = Math.floor(_n / 2) || 1; - while (_stride < _n && gcd(_stride, _n) !== 1) _stride++; - const scrambledColors = candidateColors.map((_, i) => candidateColors[(i * _stride) % _n]); + const candidateColors = Array.from(colorGenerator(_numTallyEntries)); // Create the pie-chart element const pieChart = document.createElement("pie-chart"); @@ -32,7 +29,7 @@ // we can just bind it in object form here. pieChart.requestRoundChange = updateRound; pieChart.electionSummary = electionSummary; - pieChart.candidateColors = scrambledColors; + pieChart.candidateColors = candidateColors; pieChart.textForWinner = "{{ textForWinner }}"; pieChart.excludeFinalWinnerAndEliminatedCandidate = {{ config.excludeFinalWinnerAndEliminatedCandidate|yesno:"true,false" }}; pieChart.currentRound = {{ config.numRounds }}; diff --git a/visualizer/pie/graphToRCtab.py b/visualizer/pie/graphToRCtab.py index 54a37a2d..509c0a0b 100644 --- a/visualizer/pie/graphToRCtab.py +++ b/visualizer/pie/graphToRCtab.py @@ -47,9 +47,29 @@ def graph_to_rctab_json(graph): nodes_this_round = graph.nodesPerRound[round_i] # Build tally: candidate name -> vote count (as string) - # Include all candidates present this round (including Inactive Ballots) - tally = {} + # Include all candidates present this round (including Inactive Ballots). + # Interleave by vote count (largest, smallest, 2nd largest, 2nd smallest, ...) + # so that small slices always have a large neighbor, reducing label overlap. + # Inactive/residual entries always go last. + active_items = [] + inactive_items = [] for candidate, node in nodes_this_round.items(): + if candidate.name in inactive_names: + inactive_items.append((candidate, node)) + else: + active_items.append((candidate, node)) + active_items.sort(key=lambda item: item[1].count, reverse=True) + interleaved = [] + lo, hi = 0, len(active_items) - 1 + while lo <= hi: + interleaved.append(active_items[lo]) + if lo != hi: + interleaved.append(active_items[hi]) + lo += 1 + hi -= 1 + interleaved.extend(inactive_items) + tally = {} + for candidate, node in interleaved: tally[candidate.name] = _stringify(node.count) # Build tallyResults from transfersPerRound From 1cf43d150733951cd5887c52090fed7e4d3fb7dc Mon Sep 17 00:00:00 2001 From: skaphan Date: Thu, 5 Mar 2026 06:36:22 -0500 Subject: [PATCH 11/31] Fix interleave: compute order once from round 1, reuse for all rounds Per-round reordering broke D3 pie animation because candidate positions shifted between rounds. Now the interleave order is stable across all rounds, just dropping eliminated candidates. Co-Authored-By: Claude Opus 4.6 --- visualizer/pie/graphToRCtab.py | 54 +++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/visualizer/pie/graphToRCtab.py b/visualizer/pie/graphToRCtab.py index 509c0a0b..174931a7 100644 --- a/visualizer/pie/graphToRCtab.py +++ b/visualizer/pie/graphToRCtab.py @@ -42,35 +42,41 @@ def graph_to_rctab_json(graph): inactive_names = {common.INACTIVE_TEXT, common.RESIDUAL_SURPLUS_TEXT} num_active_candidates = sum(1 for c in graph.candidates if c.name not in inactive_names) + # Compute interleave order once from round 1, reuse for all rounds. + # Alternates largest/smallest so small slices have large neighbors, + # reducing label overlap. Inactive/residual entries always last. + # Order must be stable across rounds for D3 pie animation to work. + round1_nodes = graph.nodesPerRound[0] + active_items = [] + inactive_order = [] + for candidate, node in round1_nodes.items(): + if candidate.name in inactive_names: + inactive_order.append(candidate.name) + else: + active_items.append((candidate.name, node.count)) + active_items.sort(key=lambda item: item[1], reverse=True) + interleaved_order = [] + lo, hi = 0, len(active_items) - 1 + while lo <= hi: + interleaved_order.append(active_items[lo][0]) + if lo != hi: + interleaved_order.append(active_items[hi][0]) + lo += 1 + hi -= 1 + interleaved_order.extend(inactive_order) + results = [] for round_i in range(num_rounds): nodes_this_round = graph.nodesPerRound[round_i] + names_this_round = {c.name: (c, node) for c, node in nodes_this_round.items()} - # Build tally: candidate name -> vote count (as string) - # Include all candidates present this round (including Inactive Ballots). - # Interleave by vote count (largest, smallest, 2nd largest, 2nd smallest, ...) - # so that small slices always have a large neighbor, reducing label overlap. - # Inactive/residual entries always go last. - active_items = [] - inactive_items = [] - for candidate, node in nodes_this_round.items(): - if candidate.name in inactive_names: - inactive_items.append((candidate, node)) - else: - active_items.append((candidate, node)) - active_items.sort(key=lambda item: item[1].count, reverse=True) - interleaved = [] - lo, hi = 0, len(active_items) - 1 - while lo <= hi: - interleaved.append(active_items[lo]) - if lo != hi: - interleaved.append(active_items[hi]) - lo += 1 - hi -= 1 - interleaved.extend(inactive_items) + # Build tally using the stable interleaved order from round 1, + # including only candidates still present this round. tally = {} - for candidate, node in interleaved: - tally[candidate.name] = _stringify(node.count) + for name in interleaved_order: + if name in names_this_round: + candidate, node = names_this_round[name] + tally[name] = _stringify(node.count) # Build tallyResults from transfersPerRound tally_results = [] From c3e63450243ab3d93fb4b72743efce4d0eb7218b Mon Sep 17 00:00:00 2001 From: skaphan Date: Fri, 6 Mar 2026 17:39:37 -0500 Subject: [PATCH 12/31] Add pie chart and special character tests Tests pie vistype rendering, embedly redirect, hidePie config toggle, and cloudflare cache purge including pie URLs. Tests graphToRCtab with candidate names containing HTML, quotes, and other special characters. Co-Authored-By: Claude Opus 4.6 --- visualizer/tests/testGraphToRCtab.py | 33 ++++++++++++++++++ visualizer/tests/testSimple.py | 52 ++++++++++++++++++++++++++-- 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/visualizer/tests/testGraphToRCtab.py b/visualizer/tests/testGraphToRCtab.py index a177558f..cddfa37a 100644 --- a/visualizer/tests/testGraphToRCtab.py +++ b/visualizer/tests/testGraphToRCtab.py @@ -261,3 +261,36 @@ def test_without_exclude_flag(self): last_round = result['results'][-1] elected = [tr for tr in last_round['tallyResults'] if 'elected' in tr] self.assertEqual(len(elected), 1) + + +class SpecialCharacterTests(TestCase): + """ Tests that candidate names with special characters survive the conversion """ + + def setUp(self): + with open(filenames.CRAZY_NAMES, 'r', encoding='utf-8') as f: + self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) + self.result = graph_to_rctab_json(self.graph) + + def test_conversion_succeeds(self): + """ graphToRCtab should not crash on names with HTML, quotes, commas, etc. """ + self.assertIn('results', self.result) + self.assertGreater(len(self.result['results']), 0) + + def test_html_name_preserved(self): + """ A candidate name containing HTML tags should appear verbatim in the tally """ + first_tally = self.result['results'][0]['tally'] + html_names = [n for n in first_tally if '' in n] + self.assertEqual(len(html_names), 1) + self.assertIn('A malicious name with html', first_tally) + + def test_quotes_preserved(self): + """ A candidate name with quotes and ticks should appear verbatim """ + first_tally = self.result['results'][0]['tally'] + self.assertIn('A malicious name with "quotes" and \'ticks\'', first_tally) + + def test_all_candidates_present_in_first_round(self): + """ All graph candidates should appear in the first round's tally """ + graph_candidates = {c.name for c in self.graph.candidates} + first_tally_names = set(self.result['results'][0]['tally'].keys()) + self.assertTrue(graph_candidates.issubset(first_tally_names), + f"Missing candidates: {graph_candidates - first_tally_names}") diff --git a/visualizer/tests/testSimple.py b/visualizer/tests/testSimple.py index 054e54d9..c42f88f6 100644 --- a/visualizer/tests/testSimple.py +++ b/visualizer/tests/testSimple.py @@ -304,6 +304,50 @@ def test_embedded_404_returns_friendly_page(self): self.assertEqual(response.status_code, 404) self.assertIn(b'Visualization Not Found', response.content) + def test_pie_vistype_renders(self): + """ + Ensure the pie chart vistype renders without error when accessed + via the embedded visualization URL with ?vistype=pie. + """ + TestHelpers.get_multiwinner_upload_response(self.client) + slug = TestHelpers.get_latest_upload().slug + path = reverse('visualizeEmbedded', args=(slug,)) + '?vistype=pie' + response = self.client.get(path) + self.assertEqual(response.status_code, 200) + + def test_pie_embedly_redirect(self): + """ + Ensure the embedly-friendly pie URL /vo/{slug}/pie redirects + to the embedded URL /ve/{slug}?vistype=pie with a 301. + """ + TestHelpers.get_multiwinner_upload_response(self.client) + slug = TestHelpers.get_latest_upload().slug + visualizeUrl = reverse('visualizeEmbedly', args=(slug, 'pie')) + response = self.client.get(visualizeUrl) + expectedUrl = f'/ve/{slug}?vistype=pie' + self.assertRedirects(response, expectedUrl, status_code=301) + + def test_hide_pie_config(self): + """ + When hidePie is True on a JsonConfig, the rendered visualization page + should pass hidePie = true to the JavaScript config. + """ + TestHelpers.get_multiwinner_upload_response(self.client) + config = TestHelpers.get_latest_upload() + + # Default: hidePie is False + path = reverse('visualize', args=(config.slug,)) + response = self.client.get(path) + self.assertContains(response, 'config.hidePie = false') + + # Set hidePie to True; disable cache so we get a fresh response + config.hidePie = True + config.save() + with self.settings(CACHES={'default': { + 'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}}): + response = self.client.get(path) + self.assertContains(response, 'config.hidePie = true') + @patch('visualizer.wikipedia.wikipedia.WikipediaExport._get_todays_date_string') def test_wikicode(self, mockGetDateString): """ Validate that the wikicode can be generated and hasn't inadvertently changed """ @@ -391,7 +435,7 @@ def test_cloudflare_purge(self, requestPostResponse): slug = TestHelpers.get_latest_upload().slug requestPostResponse.side_effect = TestHelpers.create_request_mock({'a': 0}, 200) - expectedLogString = "INFO:common.cloudflare:Cleared cloudflare cache for 15 starting with "\ + expectedLogString = "INFO:common.cloudflare:Cleared cloudflare cache for 17 starting with "\ "/v/one-round: {'a': 0}" with self.settings( @@ -415,6 +459,7 @@ def test_cloudflare_purge(self, requestPostResponse): "https://example.com/vo/one-round/barchart-interactive", "https://example.com/vo/one-round/sankey", "https://example.com/vo/one-round/table", + "https://example.com/vo/one-round/pie", "https://example.com/vb/one-round", "https://example.com/ve/one-round?vistype=barchart-interactive", "https://example.com/ve/one-round?vistype=barchart-fixed", @@ -423,6 +468,7 @@ def test_cloudflare_purge(self, requestPostResponse): "https://example.com/ve/one-round?vistype=tabular-by-round-interactive", "https://example.com/ve/one-round?vistype=candidate-by-round", "https://example.com/ve/one-round?vistype=sankey", + "https://example.com/ve/one-round?vistype=pie", "https://www.example.com/v/one-round", "https://www.example.com/ve/one-round", "https://www.example.com/vo/one-round", @@ -430,6 +476,7 @@ def test_cloudflare_purge(self, requestPostResponse): "https://www.example.com/vo/one-round/barchart-interactive", "https://www.example.com/vo/one-round/sankey", "https://www.example.com/vo/one-round/table", + "https://www.example.com/vo/one-round/pie", "https://www.example.com/vb/one-round", "https://www.example.com/ve/one-round?vistype=barchart-interactive", "https://www.example.com/ve/one-round?vistype=barchart-fixed", @@ -437,7 +484,8 @@ def test_cloudflare_purge(self, requestPostResponse): "https://www.example.com/ve/one-round?vistype=tabular-by-round", "https://www.example.com/ve/one-round?vistype=tabular-by-round-interactive", "https://www.example.com/ve/one-round?vistype=candidate-by-round", - "https://www.example.com/ve/one-round?vistype=sankey"]} + "https://www.example.com/ve/one-round?vistype=sankey", + "https://www.example.com/ve/one-round?vistype=pie"]} requestPostResponse.assert_called_with(expectedUrl, headers=expectedHeaders, data=json.dumps(expectedData), From fc144ae7a3f1db8e35d0e184837bdaebe0e8de34 Mon Sep 17 00:00:00 2001 From: skaphan Date: Sun, 15 Mar 2026 20:01:35 -0700 Subject: [PATCH 13/31] Update pie chart: per-round percentages, phase-labeled button Set firstRoundDeterminesPercentages=false so percentages use active votes per round as denominator. Inactive Ballots shows count only. Animation button cycles Eliminate/Transfer/Consolidate labels. Co-Authored-By: Claude Opus 4.6 --- static/pie/pie-chart.es.js | 4532 ++++++++++++++-------------- templates/pie/pie-nonblocking.html | 1 + 2 files changed, 2285 insertions(+), 2248 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index b0241777..29791b20 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,27 +1,27 @@ -var ll = Object.defineProperty; -var zs = (t) => { +var cl = Object.defineProperty; +var Bs = (t) => { throw TypeError(t); }; -var ul = (t, e, n) => e in t ? ll(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var lt = (t, e, n) => ul(t, typeof e != "symbol" ? e + "" : e, n), Li = (t, e, n) => e.has(t) || zs("Cannot " + n); -var d = (t, e, n) => (Li(t, e, "read from private field"), n ? n.call(t) : e.get(t)), L = (t, e, n) => e.has(t) ? zs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), D = (t, e, n, r) => (Li(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), pt = (t, e, n) => (Li(t, e, "access private method"), n); -var ya; -typeof window < "u" && ((ya = window.__svelte ?? (window.__svelte = {})).v ?? (ya.v = /* @__PURE__ */ new Set())).add("5"); -const fl = 1, cl = 2, hl = 16, dl = 1, pl = 4, vl = 8, gl = 16, _l = 2, vs = "[", yi = "[!", gs = "]", nr = {}, _t = Symbol(), ml = "http://www.w3.org/1999/xhtml", Wi = !1; -var ba = Array.isArray, yl = Array.prototype.indexOf, rr = Array.prototype.includes, wi = Array.from, ai = Object.keys, oi = Object.defineProperty, Tn = Object.getOwnPropertyDescriptor, wl = Object.prototype, xl = Array.prototype, bl = Object.getPrototypeOf, Hs = Object.isExtensible; -const $l = () => { +var hl = (t, e, n) => e in t ? cl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var at = (t, e, n) => hl(t, typeof e != "symbol" ? e + "" : e, n), zi = (t, e, n) => e.has(t) || Bs("Cannot " + n); +var p = (t, e, n) => (zi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), L = (t, e, n) => e.has(t) ? Bs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), P = (t, e, n, r) => (zi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), pt = (t, e, n) => (zi(t, e, "access private method"), n); +var ba; +typeof window < "u" && ((ba = window.__svelte ?? (window.__svelte = {})).v ?? (ba.v = /* @__PURE__ */ new Set())).add("5"); +const dl = 1, pl = 2, vl = 16, gl = 1, _l = 4, ml = 8, yl = 16, wl = 2, ms = "[", bi = "[!", ys = "]", ir = {}, wt = Symbol(), xl = "http://www.w3.org/1999/xhtml", Ki = !1; +var Ea = Array.isArray, bl = Array.prototype.indexOf, sr = Array.prototype.includes, $i = Array.from, ui = Object.keys, fi = Object.defineProperty, Nn = Object.getOwnPropertyDescriptor, $l = Object.prototype, Al = Array.prototype, El = Object.getPrototypeOf, Us = Object.isExtensible; +const Rl = () => { }; -function Al(t) { +function Cl(t) { for (var e = 0; e < t.length; e++) t[e](); } -function $a() { +function Ra() { var t, e, n = new Promise((r, i) => { t = r, e = i; }); return { promise: n, resolve: t, reject: e }; } -function El(t, e) { +function Tl(t, e) { if (Array.isArray(t)) return t; if (!(Symbol.iterator in t)) @@ -31,130 +31,130 @@ function El(t, e) { if (n.push(r), n.length === e) break; return n; } -const xt = 2, Tr = 4, xi = 8, Aa = 1 << 24, je = 16, he = 32, on = 64, Ea = 128, jt = 512, vt = 1024, bt = 2048, ce = 4096, qt = 8192, Xe = 16384, cr = 32768, ir = 65536, Ys = 1 << 17, Ra = 1 << 18, qn = 1 << 19, Rl = 1 << 20, nn = 1 << 25, Pn = 65536, Xi = 1 << 21, _s = 1 << 22, rn = 1 << 23, Er = Symbol("$state"), Ca = Symbol("legacy props"), _n = new class extends Error { +const $t = 2, kr = 4, Ai = 8, Ca = 1 << 24, je = 16, ce = 32, ln = 64, Ta = 128, Zt = 512, gt = 1024, At = 2048, fe = 4096, Ht = 8192, Xe = 16384, dr = 32768, ar = 65536, Ws = 1 << 17, Na = 1 << 18, Vn = 1 << 19, Nl = 1 << 20, rn = 1 << 25, Dn = 65536, ji = 1 << 21, ws = 1 << 22, sn = 1 << 23, Tr = Symbol("$state"), Sa = Symbol("legacy props"), mn = new class extends Error { constructor() { super(...arguments); - lt(this, "name", "StaleReactionError"); - lt(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + at(this, "name", "StaleReactionError"); + at(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } -}(), qr = 3, hr = 8; -function Cl(t) { +}(), Hr = 3, pr = 8; +function Sl(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function Tl() { +function kl() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function Nl(t, e, n) { +function Ml(t, e, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function Sl(t) { +function Pl(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function kl() { +function Dl() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function Ml(t) { +function Fl(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function Pl() { +function Ol() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Dl() { +function Il() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function Fl(t) { +function Ll(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function Ol() { +function ql() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Il() { +function Vl() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function Ll() { +function zl() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function ql() { +function Hl() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function bi(t) { +function Ei(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function Vl() { +function Yl() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } -let j = !1; +let Z = !1; function We(t) { - j = t; + Z = t; } -let z; -function Ft(t) { +let H; +function Ot(t) { if (t === null) - throw bi(), nr; - return z = t; + throw Ei(), ir; + return H = t; } -function $i() { - return Ft(/* @__PURE__ */ Ne(z)); +function Ri() { + return Ot(/* @__PURE__ */ Te(H)); } -function Bt(t) { - if (j) { - if (/* @__PURE__ */ Ne(z) !== null) - throw bi(), nr; - z = t; +function It(t) { + if (Z) { + if (/* @__PURE__ */ Te(H) !== null) + throw Ei(), ir; + H = t; } } -function Gi(t = 1) { - if (j) { - for (var e = t, n = z; e--; ) +function Zi(t = 1) { + if (Z) { + for (var e = t, n = H; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Ne(n); - z = n; + /* @__PURE__ */ Te(n); + H = n; } } -function li(t = !0) { - for (var e = 0, n = z; ; ) { - if (n.nodeType === hr) { +function ci(t = !0) { + for (var e = 0, n = H; ; ) { + if (n.nodeType === pr) { var r = ( /** @type {Comment} */ n.data ); - if (r === gs) { + if (r === ys) { if (e === 0) return n; e -= 1; - } else (r === vs || r === yi || // "[1", "[2", etc. for if blocks + } else (r === ms || r === bi || // "[1", "[2", etc. for if blocks r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Ne(n) + /* @__PURE__ */ Te(n) ); t && n.remove(), n = i; } } -function Ta(t) { - if (!t || t.nodeType !== hr) - throw bi(), nr; +function ka(t) { + if (!t || t.nodeType !== pr) + throw Ei(), ir; return ( /** @type {Comment} */ t.data ); } -function Na(t) { +function Ma(t) { return t === this.v; } -function zl(t, e) { +function Bl(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function Sa(t) { - return !zl(t, this.v); +function Pa(t) { + return !Bl(t, this.v); } -let Hl = !1, Vt = null; -function sr(t) { - Vt = t; +let Ul = !1, Yt = null; +function or(t) { + Yt = t; } -function ms(t, e = !1, n) { - Vt = { - p: Vt, +function xs(t, e = !1, n) { + Yt = { + p: Yt, i: !1, c: null, e: null, @@ -163,52 +163,52 @@ function ms(t, e = !1, n) { l: null }; } -function ys(t) { +function bs(t) { var e = ( /** @type {ComponentContext} */ - Vt + Yt ), n = e.e; if (n !== null) { e.e = null; for (var r of n) - eo(r); + io(r); } - return t !== void 0 && (e.x = t), e.i = !0, Vt = e.p, t ?? /** @type {T} */ + return t !== void 0 && (e.x = t), e.i = !0, Yt = e.p, t ?? /** @type {T} */ {}; } -function ka() { +function Da() { return !0; } -let mn = []; -function Ma() { - var t = mn; - mn = [], Al(t); +let yn = []; +function Fa() { + var t = yn; + yn = [], Cl(t); } -function Nn(t) { - if (mn.length === 0 && !Rr) { - var e = mn; +function Sn(t) { + if (yn.length === 0 && !Nr) { + var e = yn; queueMicrotask(() => { - e === mn && Ma(); + e === yn && Fa(); }); } - mn.push(t); + yn.push(t); } -function Yl() { - for (; mn.length > 0; ) - Ma(); +function Wl() { + for (; yn.length > 0; ) + Fa(); } -function Pa(t) { - var e = X; +function Oa(t) { + var e = K; if (e === null) - return V.f |= rn, t; - if ((e.f & cr) === 0 && (e.f & Tr) === 0) + return z.f |= sn, t; + if ((e.f & dr) === 0 && (e.f & kr) === 0) throw t; - ar(t, e); + lr(t, e); } -function ar(t, e) { +function lr(t, e) { for (; e !== null; ) { - if ((e.f & Ea) !== 0) { - if ((e.f & cr) === 0) + if ((e.f & Ta) !== 0) { + if ((e.f & dr) === 0) throw t; try { e.b.error(t); @@ -221,78 +221,78 @@ function ar(t, e) { } throw t; } -const Bl = -7169; -function ut(t, e) { - t.f = t.f & Bl | e; +const Xl = -7169; +function ot(t, e) { + t.f = t.f & Xl | e; } -function ws(t) { - (t.f & jt) !== 0 || t.deps === null ? ut(t, vt) : ut(t, ce); +function $s(t) { + (t.f & Zt) !== 0 || t.deps === null ? ot(t, gt) : ot(t, fe); } -function Da(t) { +function Ia(t) { if (t !== null) for (const e of t) - (e.f & xt) === 0 || (e.f & Pn) === 0 || (e.f ^= Pn, Da( + (e.f & $t) === 0 || (e.f & Dn) === 0 || (e.f ^= Dn, Ia( /** @type {Derived} */ e.deps )); } -function Fa(t, e, n) { - (t.f & bt) !== 0 ? e.add(t) : (t.f & ce) !== 0 && n.add(t), Da(t.deps), ut(t, vt); +function La(t, e, n) { + (t.f & At) !== 0 ? e.add(t) : (t.f & fe) !== 0 && n.add(t), Ia(t.deps), ot(t, gt); } -const Yr = /* @__PURE__ */ new Set(); -let Y = null, wt = null, Mt = [], Ai = null, Ki = !1, Rr = !1; -var Kn, jn, bn, Zn, Dr, Fr, $n, ze, Jn, Te, ji, Zi, Oa; -const Os = class Os { +const Wr = /* @__PURE__ */ new Set(); +let W = null, bt = null, Pt = [], Ci = null, Ji = !1, Nr = !1; +var Zn, Jn, $n, Qn, Ir, Lr, An, ze, tr, Ce, Qi, ts, qa; +const qs = class qs { constructor() { - L(this, Te); - lt(this, "committed", !1); + L(this, Ce); + at(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} */ - lt(this, "current", /* @__PURE__ */ new Map()); + at(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} */ - lt(this, "previous", /* @__PURE__ */ new Map()); + at(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>} */ - L(this, Kn, /* @__PURE__ */ new Set()); + L(this, Zn, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - L(this, jn, /* @__PURE__ */ new Set()); + L(this, Jn, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - L(this, bn, 0); + L(this, $n, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - L(this, Zn, 0); + L(this, Qn, 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} */ - L(this, Dr, null); + L(this, Ir, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - L(this, Fr, /* @__PURE__ */ new Set()); + L(this, Lr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - L(this, $n, /* @__PURE__ */ new Set()); + L(this, An, /* @__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`. @@ -301,18 +301,18 @@ const Os = class Os { * @type {Map} */ L(this, ze, /* @__PURE__ */ new Map()); - lt(this, "is_fork", !1); - L(this, Jn, !1); + at(this, "is_fork", !1); + L(this, tr, !1); } is_deferred() { - return this.is_fork || d(this, Zn) > 0; + return this.is_fork || p(this, Qn) > 0; } /** * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ skip_effect(e) { - d(this, ze).has(e) || d(this, ze).set(e, { d: [], m: [] }); + p(this, ze).has(e) || p(this, ze).set(e, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule @@ -320,13 +320,13 @@ const Os = class Os { * @param {Effect} effect */ unskip_effect(e) { - var n = d(this, ze).get(e); + var n = p(this, ze).get(e); if (n) { - d(this, ze).delete(e); + p(this, ze).delete(e); for (var r of n.d) - ut(r, bt), ue(r); + ot(r, At), le(r); for (r of n.m) - ut(r, ce), ue(r); + ot(r, fe), le(r); } } /** @@ -335,19 +335,19 @@ const Os = class Os { */ process(e) { var i; - Mt = [], this.apply(); + Pt = [], this.apply(); var n = [], r = []; for (const s of e) - pt(this, Te, ji).call(this, s, n, r); + pt(this, Ce, Qi).call(this, s, n, r); if (this.is_deferred()) { - pt(this, Te, Zi).call(this, r), pt(this, Te, Zi).call(this, n); - for (const [s, a] of d(this, ze)) - Va(s, a); + pt(this, Ce, ts).call(this, r), pt(this, Ce, ts).call(this, n); + for (const [s, a] of p(this, ze)) + Ya(s, a); } else { - for (const s of d(this, Kn)) s(); - d(this, Kn).clear(), d(this, bn) === 0 && pt(this, Te, Oa).call(this), Y = null, Bs(r), Bs(n), (i = d(this, Dr)) == null || i.resolve(); + for (const s of p(this, Zn)) s(); + p(this, Zn).clear(), p(this, $n) === 0 && pt(this, Ce, qa).call(this), W = null, Xs(r), Xs(n), (i = p(this, Ir)) == null || i.resolve(); } - wt = null; + bt = null; } /** * Associate a change to a given source with the current @@ -356,106 +356,106 @@ const Os = class Os { * @param {any} value */ capture(e, n) { - n !== _t && !this.previous.has(e) && this.previous.set(e, n), (e.f & rn) === 0 && (this.current.set(e, e.v), wt == null || wt.set(e, e.v)); + n !== wt && !this.previous.has(e) && this.previous.set(e, n), (e.f & sn) === 0 && (this.current.set(e, e.v), bt == null || bt.set(e, e.v)); } activate() { - Y = this, this.apply(); + W = this, this.apply(); } deactivate() { - Y === this && (Y = null, wt = null); + W === this && (W = null, bt = null); } flush() { - if (this.activate(), Mt.length > 0) { - if (Ia(), Y !== null && Y !== this) + if (this.activate(), Pt.length > 0) { + if (Va(), W !== null && W !== this) return; - } else d(this, bn) === 0 && this.process([]); + } else p(this, $n) === 0 && this.process([]); this.deactivate(); } discard() { - for (const e of d(this, jn)) e(this); - d(this, jn).clear(); + for (const e of p(this, Jn)) e(this); + p(this, Jn).clear(); } /** * * @param {boolean} blocking */ increment(e) { - D(this, bn, d(this, bn) + 1), e && D(this, Zn, d(this, Zn) + 1); + P(this, $n, p(this, $n) + 1), e && P(this, Qn, p(this, Qn) + 1); } /** * * @param {boolean} blocking */ decrement(e) { - D(this, bn, d(this, bn) - 1), e && D(this, Zn, d(this, Zn) - 1), !d(this, Jn) && (D(this, Jn, !0), Nn(() => { - D(this, Jn, !1), this.is_deferred() ? Mt.length > 0 && this.flush() : this.revive(); + P(this, $n, p(this, $n) - 1), e && P(this, Qn, p(this, Qn) - 1), !p(this, tr) && (P(this, tr, !0), Sn(() => { + P(this, tr, !1), this.is_deferred() ? Pt.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const e of d(this, Fr)) - d(this, $n).delete(e), ut(e, bt), ue(e); - for (const e of d(this, $n)) - ut(e, ce), ue(e); + for (const e of p(this, Lr)) + p(this, An).delete(e), ot(e, At), le(e); + for (const e of p(this, An)) + ot(e, fe), le(e); this.flush(); } /** @param {() => void} fn */ oncommit(e) { - d(this, Kn).add(e); + p(this, Zn).add(e); } /** @param {(batch: Batch) => void} fn */ ondiscard(e) { - d(this, jn).add(e); + p(this, Jn).add(e); } settled() { - return (d(this, Dr) ?? D(this, Dr, $a())).promise; + return (p(this, Ir) ?? P(this, Ir, Ra())).promise; } static ensure() { - if (Y === null) { - const e = Y = new Os(); - Yr.add(Y), Rr || Nn(() => { - Y === e && e.flush(); + if (W === null) { + const e = W = new qs(); + Wr.add(W), Nr || Sn(() => { + W === e && e.flush(); }); } - return Y; + return W; } apply() { } }; -Kn = new WeakMap(), jn = new WeakMap(), bn = new WeakMap(), Zn = new WeakMap(), Dr = new WeakMap(), Fr = new WeakMap(), $n = new WeakMap(), ze = new WeakMap(), Jn = new WeakMap(), Te = new WeakSet(), /** +Zn = new WeakMap(), Jn = new WeakMap(), $n = new WeakMap(), Qn = new WeakMap(), Ir = new WeakMap(), Lr = new WeakMap(), An = new WeakMap(), ze = new WeakMap(), tr = new WeakMap(), Ce = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -ji = function(e, n, r) { - e.f ^= vt; +Qi = function(e, n, r) { + e.f ^= gt; for (var i = e.first, s = null; i !== null; ) { - var a = i.f, o = (a & (he | on)) !== 0, l = o && (a & vt) !== 0, u = l || (a & qt) !== 0 || d(this, ze).has(i); + var a = i.f, o = (a & (ce | ln)) !== 0, l = o && (a & gt) !== 0, u = l || (a & Ht) !== 0 || p(this, ze).has(i); if (!u && i.fn !== null) { - o ? i.f ^= vt : s !== null && (a & (Tr | xi | Aa)) !== 0 ? s.b.defer_effect(i) : (a & Tr) !== 0 ? n.push(i) : Vr(i) && ((a & je) !== 0 && d(this, $n).add(i), lr(i)); + o ? i.f ^= gt : s !== null && (a & (kr | Ai | Ca)) !== 0 ? s.b.defer_effect(i) : (a & kr) !== 0 ? n.push(i) : Yr(i) && ((a & je) !== 0 && p(this, An).add(i), fr(i)); var f = i.first; if (f !== null) { i = f; continue; } } - var h = i.parent; - for (i = i.next; i === null && h !== null; ) - h === s && (s = null), i = h.next, h = h.parent; + var c = i.parent; + for (i = i.next; i === null && c !== null; ) + c === s && (s = null), i = c.next, c = c.parent; } }, /** * @param {Effect[]} effects */ -Zi = function(e) { +ts = function(e) { for (var n = 0; n < e.length; n += 1) - Fa(e[n], d(this, Fr), d(this, $n)); -}, Oa = function() { + La(e[n], p(this, Lr), p(this, An)); +}, qa = function() { var i; - if (Yr.size > 1) { + if (Wr.size > 1) { this.previous.clear(); - var e = wt, n = !0; - for (const s of Yr) { + var e = bt, n = !0; + for (const s of Wr) { if (s === this) { n = !1; continue; @@ -473,111 +473,111 @@ Zi = function(e) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = Mt; - Mt = []; + var r = Pt; + Pt = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - La(f, o, l, u); - if (Mt.length > 0) { - Y = s, s.apply(); - for (const f of Mt) - pt(i = s, Te, ji).call(i, f, [], []); + za(f, o, l, u); + if (Pt.length > 0) { + W = s, s.apply(); + for (const f of Pt) + pt(i = s, Ce, Qi).call(i, f, [], []); s.deactivate(); } - Mt = r; + Pt = r; } } - Y = null, wt = e; + W = null, bt = e; } - this.committed = !0, Yr.delete(this); + this.committed = !0, Wr.delete(this); }; -let Ge = Os; -function mt(t) { - var e = Rr; - Rr = !0; +let Ge = qs; +function dt(t) { + var e = Nr; + Nr = !0; try { for (var n; ; ) { - if (Yl(), Mt.length === 0 && (Y == null || Y.flush(), Mt.length === 0)) - return Ai = null, /** @type {T} */ + if (Wl(), Pt.length === 0 && (W == null || W.flush(), Pt.length === 0)) + return Ci = null, /** @type {T} */ n; - Ia(); + Va(); } } finally { - Rr = e; + Nr = e; } } -function Ia() { - Ki = !0; +function Va() { + Ji = !0; var t = null; try { - for (var e = 0; Mt.length > 0; ) { + for (var e = 0; Pt.length > 0; ) { var n = Ge.ensure(); if (e++ > 1e3) { var r, i; - Ul(); + Gl(); } - n.process(Mt), sn.clear(); + n.process(Pt), an.clear(); } } finally { - Mt = [], Ki = !1, Ai = null; + Pt = [], Ji = !1, Ci = null; } } -function Ul() { +function Gl() { try { - Pl(); + Ol(); } catch (t) { - ar(t, Ai); + lr(t, Ci); } } -let se = null; -function Bs(t) { +let ie = null; +function Xs(t) { var e = t.length; if (e !== 0) { for (var n = 0; n < e; ) { var r = t[n++]; - if ((r.f & (Xe | qt)) === 0 && Vr(r) && (se = /* @__PURE__ */ new Set(), lr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && io(r), (se == null ? void 0 : se.size) > 0)) { - sn.clear(); - for (const i of se) { - if ((i.f & (Xe | qt)) !== 0) continue; + if ((r.f & (Xe | Ht)) === 0 && Yr(r) && (ie = /* @__PURE__ */ new Set(), fr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && oo(r), (ie == null ? void 0 : ie.size) > 0)) { + an.clear(); + for (const i of ie) { + if ((i.f & (Xe | Ht)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - se.has(a) && (se.delete(a), s.push(a)), a = a.parent; + ie.has(a) && (ie.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (Xe | qt)) === 0 && lr(l); + (l.f & (Xe | Ht)) === 0 && fr(l); } } - se.clear(); + ie.clear(); } } - se = null; + ie = null; } } -function La(t, e, n, r) { +function za(t, e, n, r) { if (!n.has(t) && (n.add(t), t.reactions !== null)) for (const i of t.reactions) { const s = i.f; - (s & xt) !== 0 ? La( + (s & $t) !== 0 ? za( /** @type {Derived} */ i, e, n, r - ) : (s & (_s | je)) !== 0 && (s & bt) === 0 && qa(i, e, r) && (ut(i, bt), ue( + ) : (s & (ws | je)) !== 0 && (s & At) === 0 && Ha(i, e, r) && (ot(i, At), le( /** @type {Effect} */ i )); } } -function qa(t, e, n) { +function Ha(t, e, n) { const r = n.get(t); if (r !== void 0) return r; if (t.deps !== null) for (const i of t.deps) { - if (rr.call(e, i)) + if (sr.call(e, i)) return !0; - if ((i.f & xt) !== 0 && qa( + if ((i.f & $t) !== 0 && Ha( /** @type {Derived} */ i, e, @@ -591,80 +591,80 @@ function qa(t, e, n) { } return n.set(t, !1), !1; } -function ue(t) { - for (var e = Ai = t; e.parent !== null; ) { +function le(t) { + for (var e = Ci = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (Ki && e === X && (n & je) !== 0 && (n & Ra) === 0) + if (Ji && e === K && (n & je) !== 0 && (n & Na) === 0) return; - if ((n & (on | he)) !== 0) { - if ((n & vt) === 0) return; - e.f ^= vt; + if ((n & (ln | ce)) !== 0) { + if ((n & gt) === 0) return; + e.f ^= gt; } } - Mt.push(e); + Pt.push(e); } -function Va(t, e) { - if (!((t.f & he) !== 0 && (t.f & vt) !== 0)) { - (t.f & bt) !== 0 ? e.d.push(t) : (t.f & ce) !== 0 && e.m.push(t), ut(t, vt); +function Ya(t, e) { + if (!((t.f & ce) !== 0 && (t.f & gt) !== 0)) { + (t.f & At) !== 0 ? e.d.push(t) : (t.f & fe) !== 0 && e.m.push(t), ot(t, gt); for (var n = t.first; n !== null; ) - Va(n, e), n = n.next; + Ya(n, e), n = n.next; } } -function Wl(t) { - let e = 0, n = Dn(0), r; +function Kl(t) { + let e = 0, n = Fn(0), r; return () => { - $s() && (w(n), Es(() => (e === 0 && (r = Ci(() => t(() => Cr(n)))), e += 1, () => { - Nn(() => { - e -= 1, e === 0 && (r == null || r(), r = void 0, Cr(n)); + Rs() && (x(n), Ts(() => (e === 0 && (r = Si(() => t(() => Sr(n)))), e += 1, () => { + Sn(() => { + e -= 1, e === 0 && (r == null || r(), r = void 0, Sr(n)); }); }))); }; } -var Xl = ir | qn | Ea; -function Gl(t, e, n) { - new Kl(t, e, n); +var jl = ar | Vn | Ta; +function Zl(t, e, n) { + new Jl(t, e, n); } -var It, Or, xe, An, be, Xt, kt, $e, He, en, En, Ye, Qn, Rn, tr, er, Be, _i, ct, za, Ha, Ji, jr, Zr, Qi; -class Kl { +var Vt, qr, we, En, xe, Gt, Mt, be, He, nn, Rn, Ye, er, Cn, nr, rr, Be, wi, ft, Ba, Ua, es, Qr, ti, ns; +class Jl { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ constructor(e, n, r) { - L(this, ct); + L(this, ft); /** @type {Boundary | null} */ - lt(this, "parent"); - lt(this, "is_pending", !1); + at(this, "parent"); + at(this, "is_pending", !1); /** @type {TemplateNode} */ - L(this, It); + L(this, Vt); /** @type {TemplateNode | null} */ - L(this, Or, j ? z : null); + L(this, qr, Z ? H : null); /** @type {BoundaryProps} */ - L(this, xe); + L(this, we); /** @type {((anchor: Node) => void)} */ - L(this, An); + L(this, En); /** @type {Effect} */ - L(this, be); + L(this, xe); /** @type {Effect | null} */ - L(this, Xt, null); + L(this, Gt, null); /** @type {Effect | null} */ - L(this, kt, null); + L(this, Mt, null); /** @type {Effect | null} */ - L(this, $e, null); + L(this, be, null); /** @type {DocumentFragment | null} */ L(this, He, null); /** @type {TemplateNode | null} */ - L(this, en, null); - L(this, En, 0); + L(this, nn, null); + L(this, Rn, 0); L(this, Ye, 0); - L(this, Qn, !1); - L(this, Rn, !1); + L(this, er, !1); + L(this, Cn, !1); /** @type {Set} */ - L(this, tr, /* @__PURE__ */ new Set()); + L(this, nr, /* @__PURE__ */ new Set()); /** @type {Set} */ - L(this, er, /* @__PURE__ */ new Set()); + L(this, rr, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -673,37 +673,37 @@ class Kl { * @type {Source | null} */ L(this, Be, null); - L(this, _i, Wl(() => (D(this, Be, Dn(d(this, En))), () => { - D(this, Be, null); + L(this, wi, Kl(() => (P(this, Be, Fn(p(this, Rn))), () => { + P(this, Be, null); }))); - D(this, It, e), D(this, xe, n), D(this, An, r), this.parent = /** @type {Effect} */ - X.b, this.is_pending = !!d(this, xe).pending, D(this, be, Rs(() => { - if (X.b = this, j) { - const s = d(this, Or); - $i(), /** @type {Comment} */ - s.nodeType === hr && /** @type {Comment} */ - s.data === yi ? pt(this, ct, Ha).call(this) : (pt(this, ct, za).call(this), d(this, Ye) === 0 && (this.is_pending = !1)); + P(this, Vt, e), P(this, we, n), P(this, En, r), this.parent = /** @type {Effect} */ + K.b, this.is_pending = !!p(this, we).pending, P(this, xe, Ns(() => { + if (K.b = this, Z) { + const s = p(this, qr); + Ri(), /** @type {Comment} */ + s.nodeType === pr && /** @type {Comment} */ + s.data === bi ? pt(this, ft, Ua).call(this) : (pt(this, ft, Ba).call(this), p(this, Ye) === 0 && (this.is_pending = !1)); } else { - var i = pt(this, ct, Ji).call(this); + var i = pt(this, ft, es).call(this); try { - D(this, Xt, Kt(() => r(i))); + P(this, Gt, jt(() => r(i))); } catch (s) { this.error(s); } - d(this, Ye) > 0 ? pt(this, ct, Zr).call(this) : this.is_pending = !1; + p(this, Ye) > 0 ? pt(this, ft, ti).call(this) : this.is_pending = !1; } return () => { var s; - (s = d(this, en)) == null || s.remove(); + (s = p(this, nn)) == null || s.remove(); }; - }, Xl)), j && D(this, It, z); + }, jl)), Z && P(this, Vt, H); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ defer_effect(e) { - Fa(e, d(this, tr), d(this, er)); + La(e, p(this, nr), p(this, rr)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -713,7 +713,7 @@ class Kl { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!d(this, xe).pending; + return !!p(this, we).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -722,199 +722,199 @@ class Kl { * @param {1 | -1} d */ update_pending_count(e) { - pt(this, ct, Qi).call(this, e), D(this, En, d(this, En) + e), !(!d(this, Be) || d(this, Qn)) && (D(this, Qn, !0), Nn(() => { - D(this, Qn, !1), d(this, Be) && or(d(this, Be), d(this, En)); + pt(this, ft, ns).call(this, e), P(this, Rn, p(this, Rn) + e), !(!p(this, Be) || p(this, er)) && (P(this, er, !0), Sn(() => { + P(this, er, !1), p(this, Be) && ur(p(this, Be), p(this, Rn)); })); } get_effect_pending() { - return d(this, _i).call(this), w( + return p(this, wi).call(this), x( /** @type {Source} */ - d(this, Be) + p(this, Be) ); } /** @param {unknown} error */ error(e) { - var n = d(this, xe).onerror; - let r = d(this, xe).failed; - if (d(this, Rn) || !n && !r) + var n = p(this, we).onerror; + let r = p(this, we).failed; + if (p(this, Cn) || !n && !r) throw e; - d(this, Xt) && (Tt(d(this, Xt)), D(this, Xt, null)), d(this, kt) && (Tt(d(this, kt)), D(this, kt, null)), d(this, $e) && (Tt(d(this, $e)), D(this, $e, null)), j && (Ft( + p(this, Gt) && (St(p(this, Gt)), P(this, Gt, null)), p(this, Mt) && (St(p(this, Mt)), P(this, Mt, null)), p(this, be) && (St(p(this, be)), P(this, be, null)), Z && (Ot( /** @type {TemplateNode} */ - d(this, Or) - ), Gi(), Ft(li())); + p(this, qr) + ), Zi(), Ot(ci())); var i = !1, s = !1; const a = () => { if (i) { - Vl(); + Yl(); return; } - i = !0, s && ql(), Ge.ensure(), D(this, En, 0), d(this, $e) !== null && Sn(d(this, $e), () => { - D(this, $e, null); - }), this.is_pending = this.has_pending_snippet(), D(this, Xt, pt(this, ct, jr).call(this, () => (D(this, Rn, !1), Kt(() => d(this, An).call(this, d(this, It)))))), d(this, Ye) > 0 ? pt(this, ct, Zr).call(this) : this.is_pending = !1; + i = !0, s && Hl(), Ge.ensure(), P(this, Rn, 0), p(this, be) !== null && kn(p(this, be), () => { + P(this, be, null); + }), this.is_pending = this.has_pending_snippet(), P(this, Gt, pt(this, ft, Qr).call(this, () => (P(this, Cn, !1), jt(() => p(this, En).call(this, p(this, Vt)))))), p(this, Ye) > 0 ? pt(this, ft, ti).call(this) : this.is_pending = !1; }; - Nn(() => { + Sn(() => { try { s = !0, n == null || n(e, a), s = !1; } catch (o) { - ar(o, d(this, be) && d(this, be).parent); + lr(o, p(this, xe) && p(this, xe).parent); } - r && D(this, $e, pt(this, ct, jr).call(this, () => { - Ge.ensure(), D(this, Rn, !0); + r && P(this, be, pt(this, ft, Qr).call(this, () => { + Ge.ensure(), P(this, Cn, !0); try { - return Kt(() => { + return jt(() => { r( - d(this, It), + p(this, Vt), () => e, () => a ); }); } catch (o) { - return ar( + return lr( o, /** @type {Effect} */ - d(this, be).parent + p(this, xe).parent ), null; } finally { - D(this, Rn, !1); + P(this, Cn, !1); } })); }); } } -It = new WeakMap(), Or = new WeakMap(), xe = new WeakMap(), An = new WeakMap(), be = new WeakMap(), Xt = new WeakMap(), kt = new WeakMap(), $e = new WeakMap(), He = new WeakMap(), en = new WeakMap(), En = new WeakMap(), Ye = new WeakMap(), Qn = new WeakMap(), Rn = new WeakMap(), tr = new WeakMap(), er = new WeakMap(), Be = new WeakMap(), _i = new WeakMap(), ct = new WeakSet(), za = function() { +Vt = new WeakMap(), qr = new WeakMap(), we = new WeakMap(), En = new WeakMap(), xe = new WeakMap(), Gt = new WeakMap(), Mt = new WeakMap(), be = new WeakMap(), He = new WeakMap(), nn = new WeakMap(), Rn = new WeakMap(), Ye = new WeakMap(), er = new WeakMap(), Cn = new WeakMap(), nr = new WeakMap(), rr = new WeakMap(), Be = new WeakMap(), wi = new WeakMap(), ft = new WeakSet(), Ba = function() { try { - D(this, Xt, Kt(() => d(this, An).call(this, d(this, It)))); + P(this, Gt, jt(() => p(this, En).call(this, p(this, Vt)))); } catch (e) { this.error(e); } -}, Ha = function() { - const e = d(this, xe).pending; - e && (D(this, kt, Kt(() => e(d(this, It)))), Nn(() => { - var n = pt(this, ct, Ji).call(this); - D(this, Xt, pt(this, ct, jr).call(this, () => (Ge.ensure(), Kt(() => d(this, An).call(this, n))))), d(this, Ye) > 0 ? pt(this, ct, Zr).call(this) : (Sn( +}, Ua = function() { + const e = p(this, we).pending; + e && (P(this, Mt, jt(() => e(p(this, Vt)))), Sn(() => { + var n = pt(this, ft, es).call(this); + P(this, Gt, pt(this, ft, Qr).call(this, () => (Ge.ensure(), jt(() => p(this, En).call(this, n))))), p(this, Ye) > 0 ? pt(this, ft, ti).call(this) : (kn( /** @type {Effect} */ - d(this, kt), + p(this, Mt), () => { - D(this, kt, null); + P(this, Mt, null); } ), this.is_pending = !1); })); -}, Ji = function() { - var e = d(this, It); - return this.is_pending && (D(this, en, Jt()), d(this, It).before(d(this, en)), e = d(this, en)), e; +}, es = function() { + var e = p(this, Vt); + return this.is_pending && (P(this, nn, Qt()), p(this, Vt).before(p(this, nn)), e = p(this, nn)), e; }, /** * @param {() => Effect | null} fn */ -jr = function(e) { - var n = X, r = V, i = Vt; - Ce(d(this, be)), Qt(d(this, be)), sr(d(this, be).ctx); +Qr = function(e) { + var n = K, r = z, i = Yt; + Re(p(this, xe)), te(p(this, xe)), or(p(this, xe).ctx); try { return e(); } catch (s) { - return Pa(s), null; + return Oa(s), null; } finally { - Ce(n), Qt(r), sr(i); + Re(n), te(r), or(i); } -}, Zr = function() { +}, ti = function() { const e = ( /** @type {(anchor: Node) => void} */ - d(this, xe).pending + p(this, we).pending ); - d(this, Xt) !== null && (D(this, He, document.createDocumentFragment()), d(this, He).append( + p(this, Gt) !== null && (P(this, He, document.createDocumentFragment()), p(this, He).append( /** @type {TemplateNode} */ - d(this, en) - ), oo(d(this, Xt), d(this, He))), d(this, kt) === null && D(this, kt, Kt(() => e(d(this, It)))); + p(this, nn) + ), fo(p(this, Gt), p(this, He))), p(this, Mt) === null && P(this, Mt, jt(() => e(p(this, Vt)))); }, /** * 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 * @param {1 | -1} d */ -Qi = function(e) { +ns = function(e) { var n; if (!this.has_pending_snippet()) { - this.parent && pt(n = this.parent, ct, Qi).call(n, e); + this.parent && pt(n = this.parent, ft, ns).call(n, e); return; } - if (D(this, Ye, d(this, Ye) + e), d(this, Ye) === 0) { + if (P(this, Ye, p(this, Ye) + e), p(this, Ye) === 0) { this.is_pending = !1; - for (const r of d(this, tr)) - ut(r, bt), ue(r); - for (const r of d(this, er)) - ut(r, ce), ue(r); - d(this, tr).clear(), d(this, er).clear(), d(this, kt) && Sn(d(this, kt), () => { - D(this, kt, null); - }), d(this, He) && (d(this, It).before(d(this, He)), D(this, He, null)); + for (const r of p(this, nr)) + ot(r, At), le(r); + for (const r of p(this, rr)) + ot(r, fe), le(r); + p(this, nr).clear(), p(this, rr).clear(), p(this, Mt) && kn(p(this, Mt), () => { + P(this, Mt, null); + }), p(this, He) && (p(this, Vt).before(p(this, He)), P(this, He, null)); } }; -function jl(t, e, n, r) { - const i = Ei; - var s = t.filter((c) => !c.settled); +function Ql(t, e, n, r) { + const i = Ti; + var s = t.filter((h) => !h.settled); if (n.length === 0 && s.length === 0) { r(e.map(i)); return; } - var a = Y, o = ( + var a = W, o = ( /** @type {Effect} */ - X - ), l = Zl(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; - function f(c) { + K + ), l = tu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((h) => h.promise)) : null; + function f(h) { l(); try { - r(c); + r(h); } catch (v) { - (o.f & Xe) === 0 && ar(v, o); + (o.f & Xe) === 0 && lr(v, o); } - a == null || a.deactivate(), ts(); + a == null || a.deactivate(), rs(); } if (n.length === 0) { u.then(() => f(e.map(i))); return; } - function h() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ Jl(c))).then((c) => f([...e.map(i), ...c])).catch((c) => ar(c, o)); + function c() { + l(), Promise.all(n.map((h) => /* @__PURE__ */ eu(h))).then((h) => f([...e.map(i), ...h])).catch((h) => lr(h, o)); } - u ? u.then(h) : h(); + u ? u.then(c) : c(); } -function Zl() { - var t = X, e = V, n = Vt, r = Y; +function tu() { + var t = K, e = z, n = Yt, r = W; return function(s = !0) { - Ce(t), Qt(e), sr(n), s && (r == null || r.activate()); + Re(t), te(e), or(n), s && (r == null || r.activate()); }; } -function ts() { - Ce(null), Qt(null), sr(null); +function rs() { + Re(null), te(null), or(null); } // @__NO_SIDE_EFFECTS__ -function Ei(t) { - var e = xt | bt, n = V !== null && (V.f & xt) !== 0 ? ( +function Ti(t) { + var e = $t | At, n = z !== null && (z.f & $t) !== 0 ? ( /** @type {Derived} */ - V + z ) : null; - return X !== null && (X.f |= qn), { - ctx: Vt, + return K !== null && (K.f |= Vn), { + ctx: Yt, deps: null, effects: null, - equals: Na, + equals: Ma, f: e, fn: t, reactions: null, rv: 0, v: ( /** @type {V} */ - _t + wt ), wv: 0, - parent: n ?? X, + parent: n ?? K, ac: null }; } // @__NO_SIDE_EFFECTS__ -function Jl(t, e, n) { +function eu(t, e, n) { let r = ( /** @type {Effect | null} */ - X + K ); - r === null && Tl(); + r === null && kl(); var i = ( /** @type {Boundary} */ r.b @@ -922,79 +922,79 @@ function Jl(t, e, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = Dn( + ), a = Fn( /** @type {V} */ - _t - ), o = !V, l = /* @__PURE__ */ new Map(); - return lu(() => { + wt + ), o = !z, l = /* @__PURE__ */ new Map(); + return cu(() => { var v; - var u = $a(); + var u = Ra(); s = u.promise; try { Promise.resolve(t()).then(u.resolve, u.reject).then(() => { - f === Y && f.committed && f.deactivate(), ts(); + f === W && f.committed && f.deactivate(), rs(); }); } catch (g) { - u.reject(g), ts(); + u.reject(g), rs(); } var f = ( /** @type {Batch} */ - Y + W ); if (o) { - var h = i.is_rendered(); - i.update_pending_count(1), f.increment(h), (v = l.get(f)) == null || v.reject(_n), l.delete(f), l.set(f, u); + var c = i.is_rendered(); + i.update_pending_count(1), f.increment(c), (v = l.get(f)) == null || v.reject(mn), l.delete(f), l.set(f, u); } - const c = (g, m = void 0) => { + const h = (g, m = void 0) => { if (f.activate(), m) - m !== _n && (a.f |= rn, or(a, m)); + m !== mn && (a.f |= sn, ur(a, m)); else { - (a.f & rn) !== 0 && (a.f ^= rn), or(a, g); + (a.f & sn) !== 0 && (a.f ^= sn), ur(a, g); for (const [b, $] of l) { if (l.delete(b), b === f) break; - $.reject(_n); + $.reject(mn); } } - o && (i.update_pending_count(-1), f.decrement(h)); + o && (i.update_pending_count(-1), f.decrement(c)); }; - u.promise.then(c, (g) => c(null, g || "unknown")); - }), su(() => { + u.promise.then(h, (g) => h(null, g || "unknown")); + }), lu(() => { for (const u of l.values()) - u.reject(_n); + u.reject(mn); }), new Promise((u) => { - function f(h) { - function c() { - h === s ? u(a) : f(s); + function f(c) { + function h() { + c === s ? u(a) : f(s); } - h.then(c, c); + c.then(h, h); } f(s); }); } // @__NO_SIDE_EFFECTS__ -function Bn(t) { - const e = /* @__PURE__ */ Ei(t); - return lo(e), e; +function Wn(t) { + const e = /* @__PURE__ */ Ti(t); + return co(e), e; } // @__NO_SIDE_EFFECTS__ -function Ya(t) { - const e = /* @__PURE__ */ Ei(t); - return e.equals = Sa, e; +function Wa(t) { + const e = /* @__PURE__ */ Ti(t); + return e.equals = Pa, e; } -function Ql(t) { +function nu(t) { var e = t.effects; if (e !== null) { t.effects = null; for (var n = 0; n < e.length; n += 1) - Tt( + St( /** @type {Effect} */ e[n] ); } } -function tu(t) { +function ru(t) { for (var e = t.parent; e !== null; ) { - if ((e.f & xt) === 0) + if ((e.f & $t) === 0) return (e.f & Xe) === 0 ? ( /** @type {Effect} */ e @@ -1003,127 +1003,127 @@ function tu(t) { } return null; } -function xs(t) { - var e, n = X; - Ce(tu(t)); +function As(t) { + var e, n = K; + Re(ru(t)); try { - t.f &= ~Pn, Ql(t), e = ho(t); + t.f &= ~Dn, nu(t), e = go(t); } finally { - Ce(n); + Re(n); } return e; } -function Ba(t) { - var e = xs(t); - if (!t.equals(e) && (t.wv = fo(), (!(Y != null && Y.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { - ut(t, vt); +function Xa(t) { + var e = As(t); + if (!t.equals(e) && (t.wv = po(), (!(W != null && W.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { + ot(t, gt); return; } - an || (wt !== null ? ($s() || Y != null && Y.is_fork) && wt.set(t, e) : ws(t)); + on || (bt !== null ? (Rs() || W != null && W.is_fork) && bt.set(t, e) : $s(t)); } -function eu(t) { +function iu(t) { var e, n; if (t.effects !== null) for (const r of t.effects) - (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(_n), r.teardown = $l, r.ac = null, Nr(r, 0), Cs(r)); + (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(mn), r.teardown = Rl, r.ac = null, Mr(r, 0), Ss(r)); } -function Ua(t) { +function Ga(t) { if (t.effects !== null) for (const e of t.effects) - e.teardown && lr(e); + e.teardown && fr(e); } -let es = /* @__PURE__ */ new Set(); -const sn = /* @__PURE__ */ new Map(); -let Wa = !1; -function Dn(t, e) { +let is = /* @__PURE__ */ new Set(); +const an = /* @__PURE__ */ new Map(); +let Ka = !1; +function Fn(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: t, reactions: null, - equals: Na, + equals: Ma, rv: 0, wv: 0 }; return n; } // @__NO_SIDE_EFFECTS__ -function yt(t, e) { - const n = Dn(t); - return lo(n), n; +function xt(t, e) { + const n = Fn(t); + return co(n), n; } // @__NO_SIDE_EFFECTS__ -function Xa(t, e = !1, n = !0) { - const r = Dn(t); - return e || (r.equals = Sa), r; +function ja(t, e = !1, n = !0) { + const r = Fn(t); + return e || (r.equals = Pa), r; } -function Q(t, e, n = !1) { - V !== null && // since we are untracking the function inside `$inspect.with` we need to add this check +function ut(t, e, n = !1) { + z !== 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 - (!fe || (V.f & Ys) !== 0) && ka() && (V.f & (xt | je | _s | Ys)) !== 0 && (Zt === null || !rr.call(Zt, t)) && Ll(); - let r = n ? yn(e) : e; - return or(t, r); + (!ue || (z.f & Ws) !== 0) && Da() && (z.f & ($t | je | ws | Ws)) !== 0 && (Jt === null || !sr.call(Jt, t)) && zl(); + let r = n ? wn(e) : e; + return ur(t, r); } -function or(t, e) { +function ur(t, e) { if (!t.equals(e)) { var n = t.v; - an ? sn.set(t, e) : sn.set(t, n), t.v = e; + on ? an.set(t, e) : an.set(t, n), t.v = e; var r = Ge.ensure(); - if (r.capture(t, n), (t.f & xt) !== 0) { + if (r.capture(t, n), (t.f & $t) !== 0) { const i = ( /** @type {Derived} */ t ); - (t.f & bt) !== 0 && xs(i), ws(i); + (t.f & At) !== 0 && As(i), $s(i); } - t.wv = fo(), Ga(t, bt), X !== null && (X.f & vt) !== 0 && (X.f & (he | on)) === 0 && (Wt === null ? cu([t]) : Wt.push(t)), !r.is_fork && es.size > 0 && !Wa && nu(); + t.wv = po(), Za(t, At), K !== null && (K.f & gt) !== 0 && (K.f & (ce | ln)) === 0 && (Xt === null ? pu([t]) : Xt.push(t)), !r.is_fork && is.size > 0 && !Ka && su(); } return e; } -function nu() { - Wa = !1; - for (const t of es) - (t.f & vt) !== 0 && ut(t, ce), Vr(t) && lr(t); - es.clear(); +function su() { + Ka = !1; + for (const t of is) + (t.f & gt) !== 0 && ot(t, fe), Yr(t) && fr(t); + is.clear(); } -function Cr(t) { - Q(t, t.v + 1); +function Sr(t) { + ut(t, t.v + 1); } -function Ga(t, e) { +function Za(t, e) { var n = t.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & bt) === 0; - if (o && ut(s, e), (a & xt) !== 0) { + var s = n[i], a = s.f, o = (a & At) === 0; + if (o && ot(s, e), (a & $t) !== 0) { var l = ( /** @type {Derived} */ s ); - wt == null || wt.delete(l), (a & Pn) === 0 && (a & jt && (s.f |= Pn), Ga(l, ce)); - } else o && ((a & je) !== 0 && se !== null && se.add( + bt == null || bt.delete(l), (a & Dn) === 0 && (a & Zt && (s.f |= Dn), Za(l, fe)); + } else o && ((a & je) !== 0 && ie !== null && ie.add( /** @type {Effect} */ s - ), ue( + ), le( /** @type {Effect} */ s )); } } -function yn(t) { - if (typeof t != "object" || t === null || Er in t) +function wn(t) { + if (typeof t != "object" || t === null || Tr in t) return t; - const e = bl(t); - if (e !== wl && e !== xl) + const e = El(t); + if (e !== $l && e !== Al) return t; - var n = /* @__PURE__ */ new Map(), r = ba(t), i = /* @__PURE__ */ yt(0), s = kn, a = (o) => { - if (kn === s) + var n = /* @__PURE__ */ new Map(), r = Ea(t), i = /* @__PURE__ */ xt(0), s = Mn, a = (o) => { + if (Mn === s) return o(); - var l = V, u = kn; - Qt(null), Xs(s); + var l = z, u = Mn; + te(null), js(s); var f = o(); - return Qt(l), Xs(u), f; + return te(l), js(u), f; }; - return r && n.set("length", /* @__PURE__ */ yt( + return r && n.set("length", /* @__PURE__ */ xt( /** @type {any[]} */ t.length )), new Proxy( @@ -1131,35 +1131,35 @@ function yn(t) { t, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ol(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && ql(); var f = n.get(l); return f === void 0 ? a(() => { - var h = /* @__PURE__ */ yt(u.value); - return n.set(l, h), h; - }) : Q(f, u.value, !0), !0; + var c = /* @__PURE__ */ xt(u.value); + return n.set(l, c), c; + }) : ut(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__ */ yt(_t)); - n.set(l, f), Cr(i); + const f = a(() => /* @__PURE__ */ xt(wt)); + n.set(l, f), Sr(i); } } else - Q(u, _t), Cr(i); + ut(u, wt), Sr(i); return !0; }, get(o, l, u) { var v; - if (l === Er) + if (l === Tr) return t; - var f = n.get(l), h = l in o; - if (f === void 0 && (!h || (v = Tn(o, l)) != null && v.writable) && (f = a(() => { - var g = yn(h ? o[l] : _t), m = /* @__PURE__ */ yt(g); + var f = n.get(l), c = l in o; + if (f === void 0 && (!c || (v = Nn(o, l)) != null && v.writable) && (f = a(() => { + var g = wn(c ? o[l] : wt), m = /* @__PURE__ */ xt(g); return m; }), n.set(l, f)), f !== void 0) { - var c = w(f); - return c === _t ? void 0 : c; + var h = x(f); + return h === wt ? void 0 : h; } return Reflect.get(o, l, u); }, @@ -1167,203 +1167,203 @@ function yn(t) { var u = Reflect.getOwnPropertyDescriptor(o, l); if (u && "value" in u) { var f = n.get(l); - f && (u.value = w(f)); + f && (u.value = x(f)); } else if (u === void 0) { - var h = n.get(l), c = h == null ? void 0 : h.v; - if (h !== void 0 && c !== _t) + var c = n.get(l), h = c == null ? void 0 : c.v; + if (c !== void 0 && h !== wt) return { enumerable: !0, configurable: !0, - value: c, + value: h, writable: !0 }; } return u; }, has(o, l) { - var c; - if (l === Er) + var h; + if (l === Tr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== _t || Reflect.has(o, l); - if (u !== void 0 || X !== null && (!f || (c = Tn(o, l)) != null && c.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== wt || Reflect.has(o, l); + if (u !== void 0 || K !== null && (!f || (h = Nn(o, l)) != null && h.writable)) { u === void 0 && (u = a(() => { - var v = f ? yn(o[l]) : _t, g = /* @__PURE__ */ yt(v); + var v = f ? wn(o[l]) : wt, g = /* @__PURE__ */ xt(v); return g; }), n.set(l, u)); - var h = w(u); - if (h === _t) + var c = x(u); + if (c === wt) return !1; } return f; }, set(o, l, u, f) { - var T; - var h = n.get(l), c = l in o; + var E; + var c = n.get(l), h = l in o; if (r && l === "length") for (var v = u; v < /** @type {Source} */ - h.v; v += 1) { + c.v; v += 1) { var g = n.get(v + ""); - g !== void 0 ? Q(g, _t) : v in o && (g = a(() => /* @__PURE__ */ yt(_t)), n.set(v + "", g)); + g !== void 0 ? ut(g, wt) : v in o && (g = a(() => /* @__PURE__ */ xt(wt)), n.set(v + "", g)); } - if (h === void 0) - (!c || (T = Tn(o, l)) != null && T.writable) && (h = a(() => /* @__PURE__ */ yt(void 0)), Q(h, yn(u)), n.set(l, h)); + if (c === void 0) + (!h || (E = Nn(o, l)) != null && E.writable) && (c = a(() => /* @__PURE__ */ xt(void 0)), ut(c, wn(u)), n.set(l, c)); else { - c = h.v !== _t; - var m = a(() => yn(u)); - Q(h, m); + h = c.v !== wt; + var m = a(() => wn(u)); + ut(c, m); } var b = Reflect.getOwnPropertyDescriptor(o, l); - if (b != null && b.set && b.set.call(f, u), !c) { + if (b != null && b.set && b.set.call(f, u), !h) { if (r && typeof l == "string") { var $ = ( /** @type {Source} */ n.get("length") - ), C = Number(l); - Number.isInteger(C) && C >= $.v && Q($, C + 1); + ), R = Number(l); + Number.isInteger(R) && R >= $.v && ut($, R + 1); } - Cr(i); + Sr(i); } return !0; }, ownKeys(o) { - w(i); - var l = Reflect.ownKeys(o).filter((h) => { - var c = n.get(h); - return c === void 0 || c.v !== _t; + x(i); + var l = Reflect.ownKeys(o).filter((c) => { + var h = n.get(c); + return h === void 0 || h.v !== wt; }); for (var [u, f] of n) - f.v !== _t && !(u in o) && l.push(u); + f.v !== wt && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - Il(); + Vl(); } } ); } -var Us, Ka, ja, Za; -function ns() { - if (Us === void 0) { - Us = window, Ka = /Firefox/.test(navigator.userAgent); +var Gs, Ja, Qa, to; +function ss() { + if (Gs === void 0) { + Gs = window, Ja = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype, n = Text.prototype; - ja = Tn(e, "firstChild").get, Za = Tn(e, "nextSibling").get, Hs(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Hs(n) && (n.__t = void 0); + Qa = Nn(e, "firstChild").get, to = Nn(e, "nextSibling").get, Us(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Us(n) && (n.__t = void 0); } } -function Jt(t = "") { +function Qt(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function Fn(t) { +function On(t) { return ( /** @type {TemplateNode | null} */ - ja.call(t) + Qa.call(t) ); } // @__NO_SIDE_EFFECTS__ -function Ne(t) { +function Te(t) { return ( /** @type {TemplateNode | null} */ - Za.call(t) + to.call(t) ); } -function Ut(t, e) { - if (!j) - return /* @__PURE__ */ Fn(t); - var n = /* @__PURE__ */ Fn(z); +function Lt(t, e) { + if (!Z) + return /* @__PURE__ */ On(t); + var n = /* @__PURE__ */ On(H); if (n === null) - n = z.appendChild(Jt()); - else if (e && n.nodeType !== qr) { - var r = Jt(); - return n == null || n.before(r), Ft(r), r; + n = H.appendChild(Qt()); + else if (e && n.nodeType !== Hr) { + var r = Qt(); + return n == null || n.before(r), Ot(r), r; } - return e && Ri( + return e && Ni( /** @type {Text} */ n - ), Ft(n), n; + ), Ot(n), n; } -function dn(t, e = !1) { - if (!j) { - var n = /* @__PURE__ */ Fn(t); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ne(n) : n; +function vn(t, e = !1) { + if (!Z) { + var n = /* @__PURE__ */ On(t); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Te(n) : n; } if (e) { - if ((z == null ? void 0 : z.nodeType) !== qr) { - var r = Jt(); - return z == null || z.before(r), Ft(r), r; + if ((H == null ? void 0 : H.nodeType) !== Hr) { + var r = Qt(); + return H == null || H.before(r), Ot(r), r; } - Ri( + Ni( /** @type {Text} */ - z + H ); } - return z; + return H; } -function ie(t, e = 1, n = !1) { - let r = j ? z : t; +function re(t, e = 1, n = !1) { + let r = Z ? H : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Ne(r); - if (!j) + /* @__PURE__ */ Te(r); + if (!Z) return r; if (n) { - if ((r == null ? void 0 : r.nodeType) !== qr) { - var s = Jt(); - return r === null ? i == null || i.after(s) : r.before(s), Ft(s), s; + if ((r == null ? void 0 : r.nodeType) !== Hr) { + var s = Qt(); + return r === null ? i == null || i.after(s) : r.before(s), Ot(s), s; } - Ri( + Ni( /** @type {Text} */ r ); } - return Ft(r), r; + return Ot(r), r; } -function Ja(t) { +function eo(t) { t.textContent = ""; } -function Qa() { +function no() { return !1; } -function bs(t, e, n) { +function Es(t, e, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(ml, t, void 0) + document.createElementNS(xl, t, void 0) ); } -function Ri(t) { +function Ni(t) { if ( /** @type {string} */ t.nodeValue.length < 65536 ) return; let e = t.nextSibling; - for (; e !== null && e.nodeType === qr; ) + for (; e !== null && e.nodeType === Hr; ) e.remove(), t.nodeValue += /** @type {string} */ e.nodeValue, e = t.nextSibling; } -function to(t) { - var e = V, n = X; - Qt(null), Ce(null); +function ro(t) { + var e = z, n = K; + te(null), Re(null); try { return t(); } finally { - Qt(e), Ce(n); + te(e), Re(n); } } -function ru(t) { - X === null && (V === null && Ml(), kl()), an && Sl(); +function au(t) { + K === null && (z === null && Fl(), Dl()), on && Pl(); } -function iu(t, e) { +function ou(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function Se(t, e, n) { - var r = X; - r !== null && (r.f & qt) !== 0 && (t |= qt); +function Ne(t, e, n) { + var r = K; + r !== null && (r.f & Ht) !== 0 && (t |= Ht); var i = { - ctx: Vt, + ctx: Yt, deps: null, nodes: null, - f: t | bt | jt, + f: t | At | Zt, first: null, fn: e, last: null, @@ -1377,143 +1377,143 @@ function Se(t, e, n) { }; if (n) try { - lr(i); + fr(i); } catch (o) { - throw Tt(i), o; + throw St(i), o; } - else e !== null && ue(i); + else e !== null && le(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 & qn) === 0 && (s = s.first, (t & je) !== 0 && (t & ir) !== 0 && s !== null && (s.f |= ir)), s !== null && (s.parent = r, r !== null && iu(s, r), V !== null && (V.f & xt) !== 0 && (t & on) === 0)) { + (s.f & Vn) === 0 && (s = s.first, (t & je) !== 0 && (t & ar) !== 0 && s !== null && (s.f |= ar)), s !== null && (s.parent = r, r !== null && ou(s, r), z !== null && (z.f & $t) !== 0 && (t & ln) === 0)) { var a = ( /** @type {Derived} */ - V + z ); (a.effects ?? (a.effects = [])).push(s); } return i; } -function $s() { - return V !== null && !fe; +function Rs() { + return z !== null && !ue; } -function su(t) { - const e = Se(xi, null, !1); - return ut(e, vt), e.teardown = t, e; +function lu(t) { + const e = Ne(Ai, null, !1); + return ot(e, gt), e.teardown = t, e; } -function As(t) { - ru(); +function Cs(t) { + au(); var e = ( /** @type {Effect} */ - X.f - ), n = !V && (e & he) !== 0 && (e & cr) === 0; + K.f + ), n = !z && (e & ce) !== 0 && (e & dr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - Vt + Yt ); (r.e ?? (r.e = [])).push(t); } else - return eo(t); + return io(t); } -function eo(t) { - return Se(Tr | Rl, t, !1); +function io(t) { + return Ne(kr | Nl, t, !1); } -function au(t) { +function uu(t) { Ge.ensure(); - const e = Se(on | qn, t, !0); + const e = Ne(ln | Vn, t, !0); return () => { - Tt(e); + St(e); }; } -function ou(t) { +function fu(t) { Ge.ensure(); - const e = Se(on | qn, t, !0); + const e = Ne(ln | Vn, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Sn(e, () => { - Tt(e), r(void 0); - }) : (Tt(e), r(void 0)); + n.outro ? kn(e, () => { + St(e), r(void 0); + }) : (St(e), r(void 0)); }); } -function no(t) { - return Se(Tr, t, !1); +function so(t) { + return Ne(kr, t, !1); } -function lu(t) { - return Se(_s | qn, t, !0); +function cu(t) { + return Ne(ws | Vn, t, !0); } -function Es(t, e = 0) { - return Se(xi | e, t, !0); +function Ts(t, e = 0) { + return Ne(Ai | e, t, !0); } -function Un(t, e = [], n = [], r = []) { - jl(r, e, n, (i) => { - Se(xi, () => t(...i.map(w)), !0); +function Xn(t, e = [], n = [], r = []) { + Ql(r, e, n, (i) => { + Ne(Ai, () => t(...i.map(x)), !0); }); } -function Rs(t, e = 0) { - var n = Se(je | e, t, !0); +function Ns(t, e = 0) { + var n = Ne(je | e, t, !0); return n; } -function Kt(t) { - return Se(he | qn, t, !0); +function jt(t) { + return Ne(ce | Vn, t, !0); } -function ro(t) { +function ao(t) { var e = t.teardown; if (e !== null) { - const n = an, r = V; - Ws(!0), Qt(null); + const n = on, r = z; + Ks(!0), te(null); try { e.call(null); } finally { - Ws(n), Qt(r); + Ks(n), te(r); } } } -function Cs(t, e = !1) { +function Ss(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { const i = n.ac; - i !== null && to(() => { - i.abort(_n); + i !== null && ro(() => { + i.abort(mn); }); var r = n.next; - (n.f & on) !== 0 ? n.parent = null : Tt(n, e), n = r; + (n.f & ln) !== 0 ? n.parent = null : St(n, e), n = r; } } -function uu(t) { +function hu(t) { for (var e = t.first; e !== null; ) { var n = e.next; - (e.f & he) === 0 && Tt(e), e = n; + (e.f & ce) === 0 && St(e), e = n; } } -function Tt(t, e = !0) { +function St(t, e = !0) { var n = !1; - (e || (t.f & Ra) !== 0) && t.nodes !== null && t.nodes.end !== null && (fu( + (e || (t.f & Na) !== 0) && t.nodes !== null && t.nodes.end !== null && (du( t.nodes.start, /** @type {TemplateNode} */ t.nodes.end - ), n = !0), Cs(t, e && !n), Nr(t, 0), ut(t, Xe); + ), n = !0), Ss(t, e && !n), Mr(t, 0), ot(t, Xe); var r = t.nodes && t.nodes.t; if (r !== null) for (const s of r) s.stop(); - ro(t); + ao(t); var i = t.parent; - i !== null && i.first !== null && io(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; + i !== null && i.first !== null && oo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; } -function fu(t, e) { +function du(t, e) { for (; t !== null; ) { - var n = t === e ? null : /* @__PURE__ */ Ne(t); + var n = t === e ? null : /* @__PURE__ */ Te(t); t.remove(), t = n; } } -function io(t) { +function oo(t) { var e = t.parent, n = t.prev, r = t.next; n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); } -function Sn(t, e, n = !0) { +function kn(t, e, n = !0) { var r = []; - so(t, r, !0); + lo(t, r, !0); var i = () => { - n && Tt(t), e && e(); + n && St(t), e && e(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1522,31 +1522,31 @@ function Sn(t, e, n = !0) { } else i(); } -function so(t, e, n) { - if ((t.f & qt) === 0) { - t.f ^= qt; +function lo(t, e, n) { + if ((t.f & Ht) === 0) { + t.f ^= Ht; var r = t.nodes && t.nodes.t; if (r !== null) for (const o of r) (o.is_global || n) && e.push(o); for (var i = t.first; i !== null; ) { - var s = i.next, a = (i.f & ir) !== 0 || // If this is a branch effect without a block effect parent, + var s = i.next, a = (i.f & ar) !== 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 & he) !== 0 && (t.f & je) !== 0; - so(i, e, a ? n : !1), i = s; + (i.f & ce) !== 0 && (t.f & je) !== 0; + lo(i, e, a ? n : !1), i = s; } } } -function Ts(t) { - ao(t, !0); +function ks(t) { + uo(t, !0); } -function ao(t, e) { - if ((t.f & qt) !== 0) { - t.f ^= qt, (t.f & vt) === 0 && (ut(t, bt), ue(t)); +function uo(t, e) { + if ((t.f & Ht) !== 0) { + t.f ^= Ht, (t.f & gt) === 0 && (ot(t, At), le(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & ir) !== 0 || (n.f & he) !== 0; - ao(n, i ? e : !1), n = r; + var r = n.next, i = (n.f & ar) !== 0 || (n.f & ce) !== 0; + uo(n, i ? e : !1), n = r; } var s = t.nodes && t.nodes.t; if (s !== null) @@ -1554,249 +1554,249 @@ function ao(t, e) { (a.is_global || e) && a.in(); } } -function oo(t, e) { +function fo(t, e) { if (t.nodes) for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Ne(n); + var i = n === r ? null : /* @__PURE__ */ Te(n); e.append(n), n = i; } } -let Jr = !1, an = !1; -function Ws(t) { - an = t; +let ei = !1, on = !1; +function Ks(t) { + on = t; } -let V = null, fe = !1; -function Qt(t) { - V = t; +let z = null, ue = !1; +function te(t) { + z = t; } -let X = null; -function Ce(t) { - X = t; +let K = null; +function Re(t) { + K = t; } -let Zt = null; -function lo(t) { - V !== null && (Zt === null ? Zt = [t] : Zt.push(t)); +let Jt = null; +function co(t) { + z !== null && (Jt === null ? Jt = [t] : Jt.push(t)); } -let Pt = null, Ot = 0, Wt = null; -function cu(t) { - Wt = t; +let Dt = null, qt = 0, Xt = null; +function pu(t) { + Xt = t; } -let uo = 1, wn = 0, kn = wn; -function Xs(t) { - kn = t; +let ho = 1, xn = 0, Mn = xn; +function js(t) { + Mn = t; } -function fo() { - return ++uo; +function po() { + return ++ho; } -function Vr(t) { +function Yr(t) { var e = t.f; - if ((e & bt) !== 0) + if ((e & At) !== 0) return !0; - if (e & xt && (t.f &= ~Pn), (e & ce) !== 0) { + if (e & $t && (t.f &= ~Dn), (e & fe) !== 0) { for (var n = ( /** @type {Value[]} */ t.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (Vr( + if (Yr( /** @type {Derived} */ s - ) && Ba( + ) && Xa( /** @type {Derived} */ s ), s.wv > t.wv) return !0; } - (e & jt) !== 0 && // During time traveling we don't want to reset the status so that + (e & Zt) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - wt === null && ut(t, vt); + bt === null && ot(t, gt); } return !1; } -function co(t, e, n = !0) { +function vo(t, e, n = !0) { var r = t.reactions; - if (r !== null && !(Zt !== null && rr.call(Zt, t))) + if (r !== null && !(Jt !== null && sr.call(Jt, t))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & xt) !== 0 ? co( + (s.f & $t) !== 0 ? vo( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? ut(s, bt) : (s.f & vt) !== 0 && ut(s, ce), ue( + ) : e === s && (n ? ot(s, At) : (s.f & gt) !== 0 && ot(s, fe), le( /** @type {Effect} */ s )); } } -function ho(t) { +function go(t) { var m; - var e = Pt, n = Ot, r = Wt, i = V, s = Zt, a = Vt, o = fe, l = kn, u = t.f; - Pt = /** @type {null | Value[]} */ - null, Ot = 0, Wt = null, V = (u & (he | on)) === 0 ? t : null, Zt = null, sr(t.ctx), fe = !1, kn = ++wn, t.ac !== null && (to(() => { - t.ac.abort(_n); + var e = Dt, n = qt, r = Xt, i = z, s = Jt, a = Yt, o = ue, l = Mn, u = t.f; + Dt = /** @type {null | Value[]} */ + null, qt = 0, Xt = null, z = (u & (ce | ln)) === 0 ? t : null, Jt = null, or(t.ctx), ue = !1, Mn = ++xn, t.ac !== null && (ro(() => { + t.ac.abort(mn); }), t.ac = null); try { - t.f |= Xi; + t.f |= ji; var f = ( /** @type {Function} */ t.fn - ), h = f(); - t.f |= cr; - var c = t.deps, v = Y == null ? void 0 : Y.is_fork; - if (Pt !== null) { + ), c = f(); + t.f |= dr; + var h = t.deps, v = W == null ? void 0 : W.is_fork; + if (Dt !== null) { var g; - if (v || Nr(t, Ot), c !== null && Ot > 0) - for (c.length = Ot + Pt.length, g = 0; g < Pt.length; g++) - c[Ot + g] = Pt[g]; + if (v || Mr(t, qt), h !== null && qt > 0) + for (h.length = qt + Dt.length, g = 0; g < Dt.length; g++) + h[qt + g] = Dt[g]; else - t.deps = c = Pt; - if ($s() && (t.f & jt) !== 0) - for (g = Ot; g < c.length; g++) - ((m = c[g]).reactions ?? (m.reactions = [])).push(t); - } else !v && c !== null && Ot < c.length && (Nr(t, Ot), c.length = Ot); - if (ka() && Wt !== null && !fe && c !== null && (t.f & (xt | ce | bt)) === 0) + t.deps = h = Dt; + if (Rs() && (t.f & Zt) !== 0) + for (g = qt; g < h.length; g++) + ((m = h[g]).reactions ?? (m.reactions = [])).push(t); + } else !v && h !== null && qt < h.length && (Mr(t, qt), h.length = qt); + if (Da() && Xt !== null && !ue && h !== null && (t.f & ($t | fe | At)) === 0) for (g = 0; g < /** @type {Source[]} */ - Wt.length; g++) - co( - Wt[g], + Xt.length; g++) + vo( + Xt[g], /** @type {Effect} */ t ); if (i !== null && i !== t) { - if (wn++, i.deps !== null) + if (xn++, i.deps !== null) for (let b = 0; b < n; b += 1) - i.deps[b].rv = wn; + i.deps[b].rv = xn; if (e !== null) for (const b of e) - b.rv = wn; - Wt !== null && (r === null ? r = Wt : r.push(.../** @type {Source[]} */ - Wt)); + b.rv = xn; + Xt !== null && (r === null ? r = Xt : r.push(.../** @type {Source[]} */ + Xt)); } - return (t.f & rn) !== 0 && (t.f ^= rn), h; + return (t.f & sn) !== 0 && (t.f ^= sn), c; } catch (b) { - return Pa(b); + return Oa(b); } finally { - t.f ^= Xi, Pt = e, Ot = n, Wt = r, V = i, Zt = s, sr(a), fe = o, kn = l; + t.f ^= ji, Dt = e, qt = n, Xt = r, z = i, Jt = s, or(a), ue = o, Mn = l; } } -function hu(t, e) { +function vu(t, e) { let n = e.reactions; if (n !== null) { - var r = yl.call(n, t); + var r = bl.call(n, t); if (r !== -1) { var i = n.length - 1; i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (e.f & xt) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (e.f & $t) !== 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 - (Pt === null || !rr.call(Pt, e))) { + (Dt === null || !sr.call(Dt, e))) { var s = ( /** @type {Derived} */ e ); - (s.f & jt) !== 0 && (s.f ^= jt, s.f &= ~Pn), ws(s), eu(s), Nr(s, 0); + (s.f & Zt) !== 0 && (s.f ^= Zt, s.f &= ~Dn), $s(s), iu(s), Mr(s, 0); } } -function Nr(t, e) { +function Mr(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - hu(t, n[r]); + vu(t, n[r]); } -function lr(t) { +function fr(t) { var e = t.f; if ((e & Xe) === 0) { - ut(t, vt); - var n = X, r = Jr; - X = t, Jr = !0; + ot(t, gt); + var n = K, r = ei; + K = t, ei = !0; try { - (e & (je | Aa)) !== 0 ? uu(t) : Cs(t), ro(t); - var i = ho(t); - t.teardown = typeof i == "function" ? i : null, t.wv = uo; + (e & (je | Ca)) !== 0 ? hu(t) : Ss(t), ao(t); + var i = go(t); + t.teardown = typeof i == "function" ? i : null, t.wv = ho; var s; - Wi && Hl && (t.f & bt) !== 0 && t.deps; + Ki && Ul && (t.f & At) !== 0 && t.deps; } finally { - Jr = r, X = n; + ei = r, K = n; } } } -function w(t) { - var e = t.f, n = (e & xt) !== 0; - if (V !== null && !fe) { - var r = X !== null && (X.f & Xe) !== 0; - if (!r && (Zt === null || !rr.call(Zt, t))) { - var i = V.deps; - if ((V.f & Xi) !== 0) - t.rv < wn && (t.rv = wn, Pt === null && i !== null && i[Ot] === t ? Ot++ : Pt === null ? Pt = [t] : Pt.push(t)); +function x(t) { + var e = t.f, n = (e & $t) !== 0; + if (z !== null && !ue) { + var r = K !== null && (K.f & Xe) !== 0; + if (!r && (Jt === null || !sr.call(Jt, t))) { + var i = z.deps; + if ((z.f & ji) !== 0) + t.rv < xn && (t.rv = xn, Dt === null && i !== null && i[qt] === t ? qt++ : Dt === null ? Dt = [t] : Dt.push(t)); else { - (V.deps ?? (V.deps = [])).push(t); + (z.deps ?? (z.deps = [])).push(t); var s = t.reactions; - s === null ? t.reactions = [V] : rr.call(s, V) || s.push(V); + s === null ? t.reactions = [z] : sr.call(s, z) || s.push(z); } } } - if (an && sn.has(t)) - return sn.get(t); + if (on && an.has(t)) + return an.get(t); if (n) { var a = ( /** @type {Derived} */ t ); - if (an) { + if (on) { var o = a.v; - return ((a.f & vt) === 0 && a.reactions !== null || vo(a)) && (o = xs(a)), sn.set(a, o), o; + return ((a.f & gt) === 0 && a.reactions !== null || mo(a)) && (o = As(a)), an.set(a, o), o; } - var l = (a.f & jt) === 0 && !fe && V !== null && (Jr || (V.f & jt) !== 0), u = (a.f & cr) === 0; - Vr(a) && (l && (a.f |= jt), Ba(a)), l && !u && (Ua(a), po(a)); + var l = (a.f & Zt) === 0 && !ue && z !== null && (ei || (z.f & Zt) !== 0), u = (a.f & dr) === 0; + Yr(a) && (l && (a.f |= Zt), Xa(a)), l && !u && (Ga(a), _o(a)); } - if (wt != null && wt.has(t)) - return wt.get(t); - if ((t.f & rn) !== 0) + if (bt != null && bt.has(t)) + return bt.get(t); + if ((t.f & sn) !== 0) throw t.v; return t.v; } -function po(t) { - if (t.f |= jt, t.deps !== null) +function _o(t) { + if (t.f |= Zt, t.deps !== null) for (const e of t.deps) - (e.reactions ?? (e.reactions = [])).push(t), (e.f & xt) !== 0 && (e.f & jt) === 0 && (Ua( + (e.reactions ?? (e.reactions = [])).push(t), (e.f & $t) !== 0 && (e.f & Zt) === 0 && (Ga( /** @type {Derived} */ e - ), po( + ), _o( /** @type {Derived} */ e )); } -function vo(t) { - if (t.v === _t) return !0; +function mo(t) { + if (t.v === wt) return !0; if (t.deps === null) return !1; for (const e of t.deps) - if (sn.has(e) || (e.f & xt) !== 0 && vo( + if (an.has(e) || (e.f & $t) !== 0 && mo( /** @type {Derived} */ e )) return !0; return !1; } -function Ci(t) { - var e = fe; +function Si(t) { + var e = ue; try { - return fe = !0, t(); + return ue = !0, t(); } finally { - fe = e; + ue = e; } } -const go = /* @__PURE__ */ new Set(), rs = /* @__PURE__ */ new Set(); -function du(t) { +const yo = /* @__PURE__ */ new Set(), as = /* @__PURE__ */ new Set(); +function gu(t) { for (var e = 0; e < t.length; e++) - go.add(t[e]); - for (var n of rs) + yo.add(t[e]); + for (var n of as) n(t); } -let Gs = null; -function Ks(t) { +let Zs = null; +function Js(t) { var b; var e = this, n = ( /** @type {Node} */ @@ -1805,8 +1805,8 @@ function Ks(t) { /** @type {null | Element} */ i[0] || t.target ); - Gs = t; - var a = 0, o = Gs === t && t.__root; + Zs = t; + var a = 0, o = Zs === t && t.__root; if (o) { var l = i.indexOf(o); if (l !== -1 && (e === document || e === /** @type {any} */ @@ -1821,16 +1821,16 @@ function Ks(t) { } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - oi(t, "currentTarget", { + fi(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = V, h = X; - Qt(null), Ce(null); + var f = z, c = K; + te(null), Re(null); try { - for (var c, v = []; s !== null; ) { + for (var h, v = []; s !== null; ) { var g = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { @@ -1840,119 +1840,119 @@ function Ks(t) { // -> the target could not have been disabled because it emits the event in the first place t.target === s) && m.call(s, t); } catch ($) { - c ? v.push($) : c = $; + h ? v.push($) : h = $; } if (t.cancelBubble || g === e || g === null) break; s = g; } - if (c) { + if (h) { for (let $ of v) queueMicrotask(() => { throw $; }); - throw c; + throw h; } } finally { - t.__root = e, delete t.currentTarget, Qt(f), Ce(h); + t.__root = e, delete t.currentTarget, te(f), Re(c); } } } -var wa, xa; -const qi = (xa = (wa = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : wa.trustedTypes) == null ? void 0 : /* @__PURE__ */ xa.createPolicy( +var $a, Aa; +const Hi = (Aa = ($a = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : $a.trustedTypes) == null ? void 0 : /* @__PURE__ */ Aa.createPolicy( "svelte-trusted-html", { /** @param {string} html */ createHTML: (t) => t } ); -function pu(t) { +function _u(t) { return ( /** @type {string} */ - (qi == null ? void 0 : qi.createHTML(t)) ?? t + (Hi == null ? void 0 : Hi.createHTML(t)) ?? t ); } -function _o(t, e = !1) { - var n = bs("template"); - return t = t.replaceAll("", ""), n.innerHTML = e ? pu(t) : t, n.content; +function wo(t, e = !1) { + var n = Es("template"); + return t = t.replaceAll("", ""), n.innerHTML = e ? _u(t) : t, n.content; } -function On(t, e) { +function In(t, e) { var n = ( /** @type {Effect} */ - X + K ); n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function Vn(t, e) { - var n = (e & _l) !== 0, r, i = !t.startsWith(""); +function zn(t, e) { + var n = (e & wl) !== 0, r, i = !t.startsWith(""); return () => { - if (j) - return On(z, null), z; - r === void 0 && (r = _o(i ? t : "" + t, !0)); + if (Z) + return In(H, null), H; + r === void 0 && (r = wo(i ? t : "" + t, !0)); var s = ( /** @type {TemplateNode} */ - n || Ka ? document.importNode(r, !0) : r.cloneNode(!0) + n || Ja ? document.importNode(r, !0) : r.cloneNode(!0) ); { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Fn(s) + /* @__PURE__ */ On(s) ), o = ( /** @type {TemplateNode} */ s.lastChild ); - On(a, o); + In(a, o); } return s; }; } // @__NO_SIDE_EFFECTS__ -function vu(t, e, n = "svg") { +function mu(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { - if (j) - return On(z, null), z; + if (Z) + return In(H, null), H; if (!s) { var a = ( /** @type {DocumentFragment} */ - _o(i, !0) + wo(i, !0) ), o = ( /** @type {Element} */ - /* @__PURE__ */ Fn(a) + /* @__PURE__ */ On(a) ); s = /** @type {Element} */ - /* @__PURE__ */ Fn(o); + /* @__PURE__ */ On(o); } var l = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return On(l, l), l; + return In(l, l), l; }; } // @__NO_SIDE_EFFECTS__ -function gu(t, e) { - return /* @__PURE__ */ vu(t, e, "svg"); +function yu(t, e) { + return /* @__PURE__ */ mu(t, e, "svg"); } -function js(t = "") { - if (!j) { - var e = Jt(t + ""); - return On(e, e), e; +function Qs(t = "") { + if (!Z) { + var e = Qt(t + ""); + return In(e, e), e; } - var n = z; - return n.nodeType !== qr ? (n.before(n = Jt()), Ft(n)) : Ri( + var n = H; + return n.nodeType !== Hr ? (n.before(n = Qt()), Ot(n)) : Ni( /** @type {Text} */ n - ), On(n, n), n; + ), In(n, n), n; } -function ae(t, e) { - if (j) { +function se(t, e) { + if (Z) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ - X + K ); - ((n.f & cr) === 0 || n.nodes.end === null) && (n.nodes.end = z), $i(); + ((n.f & dr) === 0 || n.nodes.end === null) && (n.nodes.end = H), Ri(); return; } t !== null && t.before( @@ -1960,119 +1960,119 @@ function ae(t, e) { e ); } -const _u = ["touchstart", "touchmove"]; -function mu(t) { - return _u.includes(t); +const wu = ["touchstart", "touchmove"]; +function xu(t) { + return wu.includes(t); } -function pn(t, e) { +function tn(t, e) { var n = e == null ? "" : typeof e == "object" ? e + "" : e; n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); } -function mo(t, e) { - return yo(t, e); +function xo(t, e) { + return bo(t, e); } -function yu(t, e) { - ns(), e.intro = e.intro ?? !1; - const n = e.target, r = j, i = z; +function bu(t, e) { + ss(), e.intro = e.intro ?? !1; + const n = e.target, r = Z, i = H; try { - for (var s = /* @__PURE__ */ Fn(n); s && (s.nodeType !== hr || /** @type {Comment} */ - s.data !== vs); ) - s = /* @__PURE__ */ Ne(s); + for (var s = /* @__PURE__ */ On(n); s && (s.nodeType !== pr || /** @type {Comment} */ + s.data !== ms); ) + s = /* @__PURE__ */ Te(s); if (!s) - throw nr; - We(!0), Ft( + throw ir; + We(!0), Ot( /** @type {Comment} */ s ); - const a = yo(t, { ...e, anchor: s }); + const a = bo(t, { ...e, anchor: s }); return We(!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 !== nr && console.warn("Failed to hydrate: ", a), e.recover === !1 && Dl(), ns(), Ja(n), We(!1), mo(t, e); + return a !== ir && console.warn("Failed to hydrate: ", a), e.recover === !1 && Il(), ss(), eo(n), We(!1), xo(t, e); } finally { - We(r), Ft(i); + We(r), Ot(i); } } -const Br = /* @__PURE__ */ new Map(); -function yo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - ns(); - var o = /* @__PURE__ */ new Set(), l = (h) => { - for (var c = 0; c < h.length; c++) { - var v = h[c]; +const Xr = /* @__PURE__ */ new Map(); +function bo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + ss(); + var o = /* @__PURE__ */ new Set(), l = (c) => { + for (var h = 0; h < c.length; h++) { + var v = c[h]; if (!o.has(v)) { o.add(v); - var g = mu(v); + var g = xu(v); for (const $ of [e, document]) { - var m = Br.get($); - m === void 0 && (m = /* @__PURE__ */ new Map(), Br.set($, m)); + var m = Xr.get($); + m === void 0 && (m = /* @__PURE__ */ new Map(), Xr.set($, m)); var b = m.get(v); - b === void 0 ? ($.addEventListener(v, Ks, { passive: g }), m.set(v, 1)) : m.set(v, b + 1); + b === void 0 ? ($.addEventListener(v, Js, { passive: g }), m.set(v, 1)) : m.set(v, b + 1); } } } }; - l(wi(go)), rs.add(l); - var u = void 0, f = ou(() => { - var h = n ?? e.appendChild(Jt()); - return Gl( + l($i(yo)), as.add(l); + var u = void 0, f = fu(() => { + var c = n ?? e.appendChild(Qt()); + return Zl( /** @type {TemplateNode} */ - h, + c, { pending: () => { } }, - (c) => { - ms({}); + (h) => { + xs({}); var v = ( /** @type {ComponentContext} */ - Vt + Yt ); - if (s && (v.c = s), i && (r.$$events = i), j && On( + if (s && (v.c = s), i && (r.$$events = i), Z && In( /** @type {TemplateNode} */ - c, + h, null - ), u = t(c, r) || {}, j && (X.nodes.end = z, z === null || z.nodeType !== hr || /** @type {Comment} */ - z.data !== gs)) - throw bi(), nr; - ys(); + ), u = t(h, r) || {}, Z && (K.nodes.end = H, H === null || H.nodeType !== pr || /** @type {Comment} */ + H.data !== ys)) + throw Ei(), ir; + bs(); } ), () => { var m; - for (var c of o) + for (var h of o) for (const b of [e, document]) { var v = ( /** @type {Map} */ - Br.get(b) + Xr.get(b) ), g = ( /** @type {number} */ - v.get(c) + v.get(h) ); - --g == 0 ? (b.removeEventListener(c, Ks), v.delete(c), v.size === 0 && Br.delete(b)) : v.set(c, g); + --g == 0 ? (b.removeEventListener(h, Js), v.delete(h), v.size === 0 && Xr.delete(b)) : v.set(h, g); } - rs.delete(l), h !== n && ((m = h.parentNode) == null || m.removeChild(h)); + as.delete(l), c !== n && ((m = c.parentNode) == null || m.removeChild(c)); }; }); - return is.set(u, f), u; + return os.set(u, f), u; } -let is = /* @__PURE__ */ new WeakMap(); -function wu(t, e) { - const n = is.get(t); - return n ? (is.delete(t), n(e)) : Promise.resolve(); +let os = /* @__PURE__ */ new WeakMap(); +function $u(t, e) { + const n = os.get(t); + return n ? (os.delete(t), n(e)) : Promise.resolve(); } -var oe, Ae, Lt, Cn, Ir, Lr, mi; -class xu { +var ae, $e, zt, Tn, Vr, zr, xi; +class Au { /** * @param {TemplateNode} anchor * @param {boolean} transition */ constructor(e, n = !0) { /** @type {TemplateNode} */ - lt(this, "anchor"); + at(this, "anchor"); /** @type {Map} */ - L(this, oe, /* @__PURE__ */ new Map()); + L(this, ae, /* @__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. @@ -2087,69 +2087,69 @@ class xu { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - L(this, Ae, /* @__PURE__ */ new Map()); + L(this, $e, /* @__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} */ - L(this, Lt, /* @__PURE__ */ new Map()); + L(this, zt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - L(this, Cn, /* @__PURE__ */ new Set()); + L(this, Tn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - L(this, Ir, !0); - L(this, Lr, () => { + L(this, Vr, !0); + L(this, zr, () => { var e = ( /** @type {Batch} */ - Y + W ); - if (d(this, oe).has(e)) { + if (p(this, ae).has(e)) { var n = ( /** @type {Key} */ - d(this, oe).get(e) - ), r = d(this, Ae).get(n); + p(this, ae).get(e) + ), r = p(this, $e).get(n); if (r) - Ts(r), d(this, Cn).delete(n); + ks(r), p(this, Tn).delete(n); else { - var i = d(this, Lt).get(n); - i && (d(this, Ae).set(n, i.effect), d(this, Lt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = p(this, zt).get(n); + i && (p(this, $e).set(n, i.effect), p(this, zt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of d(this, oe)) { - if (d(this, oe).delete(s), s === e) + for (const [s, a] of p(this, ae)) { + if (p(this, ae).delete(s), s === e) break; - const o = d(this, Lt).get(a); - o && (Tt(o.effect), d(this, Lt).delete(a)); + const o = p(this, zt).get(a); + o && (St(o.effect), p(this, zt).delete(a)); } - for (const [s, a] of d(this, Ae)) { - if (s === n || d(this, Cn).has(s)) continue; + for (const [s, a] of p(this, $e)) { + if (s === n || p(this, Tn).has(s)) continue; const o = () => { - if (Array.from(d(this, oe).values()).includes(s)) { + if (Array.from(p(this, ae).values()).includes(s)) { var u = document.createDocumentFragment(); - oo(a, u), u.append(Jt()), d(this, Lt).set(s, { effect: a, fragment: u }); + fo(a, u), u.append(Qt()), p(this, zt).set(s, { effect: a, fragment: u }); } else - Tt(a); - d(this, Cn).delete(s), d(this, Ae).delete(s); + St(a); + p(this, Tn).delete(s), p(this, $e).delete(s); }; - d(this, Ir) || !r ? (d(this, Cn).add(s), Sn(a, o, !1)) : o(); + p(this, Vr) || !r ? (p(this, Tn).add(s), kn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - L(this, mi, (e) => { - d(this, oe).delete(e); - const n = Array.from(d(this, oe).values()); - for (const [r, i] of d(this, Lt)) - n.includes(r) || (Tt(i.effect), d(this, Lt).delete(r)); + L(this, xi, (e) => { + p(this, ae).delete(e); + const n = Array.from(p(this, ae).values()); + for (const [r, i] of p(this, zt)) + n.includes(r) || (St(i.effect), p(this, zt).delete(r)); }); - this.anchor = e, D(this, Ir, n); + this.anchor = e, P(this, Vr, n); } /** * @@ -2159,78 +2159,78 @@ class xu { ensure(e, n) { var r = ( /** @type {Batch} */ - Y - ), i = Qa(); - if (n && !d(this, Ae).has(e) && !d(this, Lt).has(e)) + W + ), i = no(); + if (n && !p(this, $e).has(e) && !p(this, zt).has(e)) if (i) { - var s = document.createDocumentFragment(), a = Jt(); - s.append(a), d(this, Lt).set(e, { - effect: Kt(() => n(a)), + var s = document.createDocumentFragment(), a = Qt(); + s.append(a), p(this, zt).set(e, { + effect: jt(() => n(a)), fragment: s }); } else - d(this, Ae).set( + p(this, $e).set( e, - Kt(() => n(this.anchor)) + jt(() => n(this.anchor)) ); - if (d(this, oe).set(r, e), i) { - for (const [o, l] of d(this, Ae)) + if (p(this, ae).set(r, e), i) { + for (const [o, l] of p(this, $e)) o === e ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of d(this, Lt)) + for (const [o, l] of p(this, zt)) o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(d(this, Lr)), r.ondiscard(d(this, mi)); + r.oncommit(p(this, zr)), r.ondiscard(p(this, xi)); } else - j && (this.anchor = z), d(this, Lr).call(this); + Z && (this.anchor = H), p(this, zr).call(this); } } -oe = new WeakMap(), Ae = new WeakMap(), Lt = new WeakMap(), Cn = new WeakMap(), Ir = new WeakMap(), Lr = new WeakMap(), mi = new WeakMap(); -function bu(t) { - Vt === null && Cl(), As(() => { - const e = Ci(t); +ae = new WeakMap(), $e = new WeakMap(), zt = new WeakMap(), Tn = new WeakMap(), Vr = new WeakMap(), zr = new WeakMap(), xi = new WeakMap(); +function Eu(t) { + Yt === null && Sl(), Cs(() => { + const e = Si(t); if (typeof e == "function") return ( /** @type {() => void} */ e ); }); } -function mr(t, e, n = !1) { - j && $i(); - var r = new xu(t), i = n ? ir : 0; +function xr(t, e, n = !1) { + Z && Ri(); + var r = new Au(t), i = n ? ar : 0; function s(a, o) { - if (j) { - const f = Ta(t); + if (Z) { + const f = ka(t); var l; - if (f === vs ? l = 0 : f === yi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = li(); - Ft(u), r.anchor = u, We(!1), r.ensure(a, o), We(!0); + if (f === ms ? l = 0 : f === bi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = ci(); + Ot(u), r.anchor = u, We(!1), r.ensure(a, o), We(!0); return; } } r.ensure(a, o); } - Rs(() => { + Ns(() => { var a = !1; e((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function Vi(t, e) { +function Yi(t, e) { return e; } -function $u(t, e, n) { +function Ru(t, e, n) { for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { - let h = e[o]; - Sn( - h, + let c = e[o]; + kn( + c, () => { if (s) { - if (s.pending.delete(h), s.done.add(h), s.pending.size === 0) { - var c = ( + if (s.pending.delete(c), s.done.add(c), s.pending.size === 0) { + var h = ( /** @type {Set} */ t.outrogroups ); - ss(wi(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); + ls($i(s.done)), h.delete(s), h.size === 0 && (t.outrogroups = null); } } else a -= 1; @@ -2248,164 +2248,164 @@ function $u(t, e, n) { /** @type {Element} */ u.parentNode ); - Ja(f), f.append(u), t.items.clear(); + eo(f), f.append(u), t.items.clear(); } - ss(e, !l); + ls(e, !l); } else s = { pending: new Set(e), done: /* @__PURE__ */ new Set() }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function ss(t, e = !0) { +function ls(t, e = !0) { for (var n = 0; n < t.length; n++) - Tt(t[n], e); + St(t[n], e); } -var Zs; -function zi(t, e, n, r, i, s = null) { +var ta; +function Bi(t, e, n, r, i, s = null) { var a = t, o = /* @__PURE__ */ new Map(); - j && $i(); - var l = null, u = /* @__PURE__ */ Ya(() => { + Z && Ri(); + var l = null, u = /* @__PURE__ */ Wa(() => { var m = n(); - return ba(m) ? m : m == null ? [] : wi(m); - }), f, h = !0; - function c() { - g.fallback = l, Au(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & nn) === 0 ? Ts(l) : (l.f ^= nn, xr(l, null, a)) : Sn(l, () => { + return Ea(m) ? m : m == null ? [] : $i(m); + }), f, c = !0; + function h() { + g.fallback = l, Cu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & rn) === 0 ? ks(l) : (l.f ^= rn, Ar(l, null, a)) : kn(l, () => { l = null; })); } - var v = Rs(() => { + var v = Ns(() => { f = /** @type {V[]} */ - w(u); + x(u); var m = f.length; let b = !1; - if (j) { - var $ = Ta(a) === yi; - $ !== (m === 0) && (a = li(), Ft(a), We(!1), b = !0); + if (Z) { + var $ = ka(a) === bi; + $ !== (m === 0) && (a = ci(), Ot(a), We(!1), b = !0); } - for (var C = /* @__PURE__ */ new Set(), T = ( + for (var R = /* @__PURE__ */ new Set(), E = ( /** @type {Batch} */ - Y - ), N = Qa(), I = 0; I < m; I += 1) { - j && z.nodeType === hr && /** @type {Comment} */ - z.data === gs && (a = /** @type {Comment} */ - z, b = !0, We(!1)); - var G = f[I], at = r(G, I), Z = h ? null : o.get(at); - Z ? (Z.v && or(Z.v, G), Z.i && or(Z.i, I), N && T.unskip_effect(Z.e)) : (Z = Eu( + W + ), C = no(), F = 0; F < m; F += 1) { + Z && H.nodeType === pr && /** @type {Comment} */ + H.data === ys && (a = /** @type {Comment} */ + H, b = !0, We(!1)); + var J = f[F], ct = r(J, F), B = c ? null : o.get(ct); + B ? (B.v && ur(B.v, J), B.i && ur(B.i, F), C && E.unskip_effect(B.e)) : (B = Tu( o, - h ? a : Zs ?? (Zs = Jt()), - G, - at, - I, + c ? a : ta ?? (ta = Qt()), + J, + ct, + F, i, e, n - ), h || (Z.e.f |= nn), o.set(at, Z)), C.add(at); + ), c || (B.e.f |= rn), o.set(ct, B)), R.add(ct); } - if (m === 0 && s && !l && (h ? l = Kt(() => s(a)) : (l = Kt(() => s(Zs ?? (Zs = Jt()))), l.f |= nn)), m > C.size && Nl(), j && m > 0 && Ft(li()), !h) - if (N) { - for (const [et, dt] of o) - C.has(et) || T.skip_effect(dt.e); - T.oncommit(c), T.ondiscard(() => { + if (m === 0 && s && !l && (c ? l = jt(() => s(a)) : (l = jt(() => s(ta ?? (ta = Qt()))), l.f |= rn)), m > R.size && Ml(), Z && m > 0 && Ot(ci()), !c) + if (C) { + for (const [et, _t] of o) + R.has(et) || E.skip_effect(_t.e); + E.oncommit(h), E.ondiscard(() => { }); } else - c(); - b && We(!0), w(u); + h(); + b && We(!0), x(u); }), g = { effect: v, items: o, outrogroups: null, fallback: l }; - h = !1, j && (a = z); + c = !1, Z && (a = H); } -function yr(t) { - for (; t !== null && (t.f & he) === 0; ) +function br(t) { + for (; t !== null && (t.f & ce) === 0; ) t = t.next; return t; } -function Au(t, e, n, r, i) { - var Z; - var s = e.length, a = t.items, o = yr(t.effect.first), l, u = null, f = [], h = [], c, v, g, m; +function Cu(t, e, n, r, i) { + var B; + var s = e.length, a = t.items, o = br(t.effect.first), l, u = null, f = [], c = [], h, v, g, m; for (m = 0; m < s; m += 1) { - if (c = e[m], v = i(c, m), g = /** @type {EachItem} */ + if (h = e[m], v = i(h, m), g = /** @type {EachItem} */ a.get(v).e, t.outrogroups !== null) for (const et of t.outrogroups) et.pending.delete(g), et.done.delete(g); - if ((g.f & nn) !== 0) - if (g.f ^= nn, g === o) - xr(g, null, n); + if ((g.f & rn) !== 0) + if (g.f ^= rn, g === o) + Ar(g, null, n); else { var b = u ? u.next : o; - g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), tn(t, u, g), tn(t, g, b), xr(g, b, n), u = g, f = [], h = [], o = yr(u.next); + g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), en(t, u, g), en(t, g, b), Ar(g, b, n), u = g, f = [], c = [], o = br(u.next); continue; } - if ((g.f & qt) !== 0 && Ts(g), g !== o) { + if ((g.f & Ht) !== 0 && ks(g), g !== o) { if (l !== void 0 && l.has(g)) { - if (f.length < h.length) { - var $ = h[0], C; + if (f.length < c.length) { + var $ = c[0], R; u = $.prev; - var T = f[0], N = f[f.length - 1]; - for (C = 0; C < f.length; C += 1) - xr(f[C], $, n); - for (C = 0; C < h.length; C += 1) - l.delete(h[C]); - tn(t, T.prev, N.next), tn(t, u, T), tn(t, N, $), o = $, u = N, m -= 1, f = [], h = []; + var E = f[0], C = f[f.length - 1]; + for (R = 0; R < f.length; R += 1) + Ar(f[R], $, n); + for (R = 0; R < c.length; R += 1) + l.delete(c[R]); + en(t, E.prev, C.next), en(t, u, E), en(t, C, $), o = $, u = C, m -= 1, f = [], c = []; } else - l.delete(g), xr(g, o, n), tn(t, g.prev, g.next), tn(t, g, u === null ? t.effect.first : u.next), tn(t, u, g), u = g; + l.delete(g), Ar(g, o, n), en(t, g.prev, g.next), en(t, g, u === null ? t.effect.first : u.next), en(t, u, g), u = g; continue; } - for (f = [], h = []; o !== null && o !== g; ) - (l ?? (l = /* @__PURE__ */ new Set())).add(o), h.push(o), o = yr(o.next); + for (f = [], c = []; o !== null && o !== g; ) + (l ?? (l = /* @__PURE__ */ new Set())).add(o), c.push(o), o = br(o.next); if (o === null) continue; } - (g.f & nn) === 0 && f.push(g), u = g, o = yr(g.next); + (g.f & rn) === 0 && f.push(g), u = g, o = br(g.next); } if (t.outrogroups !== null) { for (const et of t.outrogroups) - et.pending.size === 0 && (ss(wi(et.done)), (Z = t.outrogroups) == null || Z.delete(et)); + et.pending.size === 0 && (ls($i(et.done)), (B = t.outrogroups) == null || B.delete(et)); t.outrogroups.size === 0 && (t.outrogroups = null); } if (o !== null || l !== void 0) { - var I = []; + var F = []; if (l !== void 0) for (g of l) - (g.f & qt) === 0 && I.push(g); + (g.f & Ht) === 0 && F.push(g); for (; o !== null; ) - (o.f & qt) === 0 && o !== t.fallback && I.push(o), o = yr(o.next); - var G = I.length; - if (G > 0) { - var at = null; - $u(t, I, at); + (o.f & Ht) === 0 && o !== t.fallback && F.push(o), o = br(o.next); + var J = F.length; + if (J > 0) { + var ct = null; + Ru(t, F, ct); } } } -function Eu(t, e, n, r, i, s, a, o) { - var l = (a & fl) !== 0 ? (a & hl) === 0 ? /* @__PURE__ */ Xa(n, !1, !1) : Dn(n) : null, u = (a & cl) !== 0 ? Dn(i) : null; +function Tu(t, e, n, r, i, s, a, o) { + var l = (a & dl) !== 0 ? (a & vl) === 0 ? /* @__PURE__ */ ja(n, !1, !1) : Fn(n) : null, u = (a & pl) !== 0 ? Fn(i) : null; return { v: l, i: u, - e: Kt(() => (s(e, l ?? n, u ?? i, o), () => { + e: jt(() => (s(e, l ?? n, u ?? i, o), () => { t.delete(r); })) }; } -function xr(t, e, n) { +function Ar(t, e, n) { if (t.nodes) - for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & nn) === 0 ? ( + for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & rn) === 0 ? ( /** @type {EffectNodes} */ e.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Ne(r) + /* @__PURE__ */ Te(r) ); if (s.before(r), r === i) return; r = a; } } -function tn(t, e, n) { +function en(t, e, n) { e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; } -function wo(t, e) { - no(() => { +function $o(t, e) { + so(() => { var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -2418,12 +2418,12 @@ function wo(t, e) { ) ); if (!r.querySelector("#" + e.hash)) { - const i = bs("style"); + const i = Es("style"); i.id = e.hash, i.textContent = e.code, r.appendChild(i); } }); } -function Js(t, e = !1) { +function ea(t, e = !1) { var n = e ? " !important;" : ";", r = ""; for (var i in t) { var s = t[i]; @@ -2431,59 +2431,59 @@ function Js(t, e = !1) { } return r; } -function Ru(t, e) { +function Nu(t, e) { if (e) { var n = "", r, i; - return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += Js(r)), i && (n += Js(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += ea(r)), i && (n += ea(i, !0)), n = n.trim(), n === "" ? null : n; } return String(t); } -function Hi(t, e = {}, n, r) { +function Ui(t, e = {}, n, r) { for (var i in n) { var s = n[i]; e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); } } -function Qs(t, e, n, r) { +function na(t, e, n, r) { var i = t.__style; - if (j || i !== e) { - var s = Ru(e, r); - (!j || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; - } else r && (Array.isArray(r) ? (Hi(t, n == null ? void 0 : n[0], r[0]), Hi(t, n == null ? void 0 : n[1], r[1], "important")) : Hi(t, n, r)); + if (Z || i !== e) { + var s = Nu(e, r); + (!Z || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; + } else r && (Array.isArray(r) ? (Ui(t, n == null ? void 0 : n[0], r[0]), Ui(t, n == null ? void 0 : n[1], r[1], "important")) : Ui(t, n, r)); return r; } -function ta(t, e) { - return t === e || (t == null ? void 0 : t[Er]) === e; +function ra(t, e) { + return t === e || (t == null ? void 0 : t[Tr]) === e; } -function Qr(t = {}, e, n, r) { - return no(() => { +function ni(t = {}, e, n, r) { + return so(() => { var i, s; - return Es(() => { - i = s, s = [], Ci(() => { - t !== n(...s) && (e(t, ...s), i && ta(n(...i), t) && e(null, ...i)); + return Ts(() => { + i = s, s = [], Si(() => { + t !== n(...s) && (e(t, ...s), i && ra(n(...i), t) && e(null, ...i)); }); }), () => { - Nn(() => { - s && ta(n(...s), t) && e(null, ...s); + Sn(() => { + s && ra(n(...s), t) && e(null, ...s); }); }; }), t; } -let Ur = !1; -function Cu(t) { - var e = Ur; +let Gr = !1; +function Su(t) { + var e = Gr; try { - return Ur = !1, [t(), Ur]; + return Gr = !1, [t(), Gr]; } finally { - Ur = e; + Gr = e; } } -function Et(t, e, n, r) { - var C; - var i = (n & vl) !== 0, s = (n & gl) !== 0, a = ( +function vt(t, e, n, r) { + var R; + var i = (n & ml) !== 0, s = (n & yl) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? Ci( + ), o = !0, l = () => (o && (o = !1, a = s ? Si( /** @type {() => V} */ r ) : ( @@ -2491,55 +2491,55 @@ function Et(t, e, n, r) { r )), a), u; if (i) { - var f = Er in t || Ca in t; - u = ((C = Tn(t, e)) == null ? void 0 : C.set) ?? (f && e in t ? (T) => t[e] = T : void 0); + var f = Tr in t || Sa in t; + u = ((R = Nn(t, e)) == null ? void 0 : R.set) ?? (f && e in t ? (E) => t[e] = E : void 0); } - var h, c = !1; - i ? [h, c] = Cu(() => ( + var c, h = !1; + i ? [c, h] = Su(() => ( /** @type {V} */ t[e] - )) : h = /** @type {V} */ - t[e], h === void 0 && r !== void 0 && (h = l(), u && (Fl(), u(h))); + )) : c = /** @type {V} */ + t[e], c === void 0 && r !== void 0 && (c = l(), u && (Ll(), u(c))); var v; if (v = () => { - var T = ( + var E = ( /** @type {V} */ t[e] ); - return T === void 0 ? l() : (o = !0, T); - }, (n & pl) === 0) + return E === void 0 ? l() : (o = !0, E); + }, (n & _l) === 0) return v; if (u) { var g = t.$$legacy; return ( /** @type {() => V} */ - (function(T, N) { - return arguments.length > 0 ? ((!N || g || c) && u(N ? v() : T), T) : v(); + (function(E, C) { + return arguments.length > 0 ? ((!C || g || h) && u(C ? v() : E), E) : v(); }) ); } - var m = !1, b = ((n & dl) !== 0 ? Ei : Ya)(() => (m = !1, v())); - i && w(b); + var m = !1, b = ((n & gl) !== 0 ? Ti : Wa)(() => (m = !1, v())); + i && x(b); var $ = ( /** @type {Effect} */ - X + K ); return ( /** @type {() => V} */ - (function(T, N) { + (function(E, C) { if (arguments.length > 0) { - const I = N ? w(b) : i ? yn(T) : T; - return Q(b, I), m = !0, a !== void 0 && (a = I), T; + const F = C ? x(b) : i ? wn(E) : E; + return ut(b, F), m = !0, a !== void 0 && (a = F), E; } - return an && m || ($.f & Xe) !== 0 ? b.v : w(b); + return on && m || ($.f & Xe) !== 0 ? b.v : x(b); }) ); } -function Tu(t) { - return new Nu(t); +function ku(t) { + return new Mu(t); } -var Ue, Gt; -class Nu { +var Ue, Kt; +class Mu { /** * @param {ComponentConstructorOptions & { * component: any; @@ -2549,55 +2549,55 @@ class Nu { /** @type {any} */ L(this, Ue); /** @type {Record} */ - L(this, Gt); + L(this, Kt); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ Xa(o, !1, !1); + var l = /* @__PURE__ */ ja(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( { ...e.props || {}, $$events: {} }, { get(a, o) { - return w(n.get(o) ?? r(o, Reflect.get(a, o))); + return x(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === Ca ? !0 : (w(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === Sa ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return Q(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return ut(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - D(this, Gt, (e.hydrate ? yu : mo)(e.component, { + P(this, Kt, (e.hydrate ? bu : xo)(e.component, { target: e.target, anchor: e.anchor, props: i, context: e.context, intro: e.intro ?? !1, recover: e.recover - })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && mt(), D(this, Ue, i.$$events); - for (const a of Object.keys(d(this, Gt))) - a === "$set" || a === "$destroy" || a === "$on" || oi(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && dt(), P(this, Ue, i.$$events); + for (const a of Object.keys(p(this, Kt))) + a === "$set" || a === "$destroy" || a === "$on" || fi(this, a, { get() { - return d(this, Gt)[a]; + return p(this, Kt)[a]; }, /** @param {any} value */ set(o) { - d(this, Gt)[a] = o; + p(this, Kt)[a] = o; }, enumerable: !0 }); - d(this, Gt).$set = /** @param {Record} next */ + p(this, Kt).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, d(this, Gt).$destroy = () => { - wu(d(this, Gt)); + }, p(this, Kt).$destroy = () => { + $u(p(this, Kt)); }; } /** @param {Record} props */ $set(e) { - d(this, Gt).$set(e); + p(this, Kt).$set(e); } /** * @param {string} event @@ -2605,22 +2605,22 @@ class Nu { * @returns {any} */ $on(e, n) { - d(this, Ue)[e] = d(this, Ue)[e] || []; + p(this, Ue)[e] = p(this, Ue)[e] || []; const r = (...i) => n.call(this, ...i); - return d(this, Ue)[e].push(r), () => { - d(this, Ue)[e] = d(this, Ue)[e].filter( + return p(this, Ue)[e].push(r), () => { + p(this, Ue)[e] = p(this, Ue)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - d(this, Gt).$destroy(); + p(this, Kt).$destroy(); } } -Ue = new WeakMap(), Gt = new WeakMap(); -let xo; -typeof HTMLElement == "function" && (xo = class extends HTMLElement { +Ue = new WeakMap(), Kt = new WeakMap(); +let Ao; +typeof HTMLElement == "function" && (Ao = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -2629,27 +2629,27 @@ typeof HTMLElement == "function" && (xo = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - lt(this, "$$ctor"); + at(this, "$$ctor"); /** Slots */ - lt(this, "$$s"); + at(this, "$$s"); /** @type {any} The Svelte component instance */ - lt(this, "$$c"); + at(this, "$$c"); /** Whether or not the custom element is connected */ - lt(this, "$$cn", !1); + at(this, "$$cn", !1); /** @type {Record} Component props data */ - lt(this, "$$d", {}); + at(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - lt(this, "$$r", !1); + at(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - lt(this, "$$p_d", {}); + at(this, "$$p_d", {}); /** @type {Record} Event listeners */ - lt(this, "$$l", {}); + at(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - lt(this, "$$l_u", /* @__PURE__ */ new Map()); + at(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - lt(this, "$$me"); + at(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - lt(this, "$$shadowRoot", null); + at(this, "$$shadowRoot", null); this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** @@ -2679,23 +2679,23 @@ typeof HTMLElement == "function" && (xo = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const o = bs("slot"); - s !== "default" && (o.name = s), ae(a, o); + const o = Es("slot"); + s !== "default" && (o.name = s), se(a, o); }; }; var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = Su(this); + const r = {}, i = Pu(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] = ti(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = ri(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 = Tu({ + this.$$c = ku({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2703,14 +2703,14 @@ typeof HTMLElement == "function" && (xo = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = au(() => { - Es(() => { + }), this.$$me = uu(() => { + Ts(() => { var s; this.$$r = !0; - for (const a of ai(this.$$c)) { + for (const a of ui(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = ti( + const o = ri( a, this.$$d[a], this.$$p_d, @@ -2738,7 +2738,7 @@ typeof HTMLElement == "function" && (xo = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = ti(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + this.$$r || (e = this.$$g_p(e), this.$$d[e] = ri(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2749,12 +2749,12 @@ typeof HTMLElement == "function" && (xo = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return ai(this.$$p_d).find( + return ui(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function ti(t, e, n, r) { +function ri(t, e, n, r) { var s; const i = (s = n[t]) == null ? void 0 : s.type; if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) @@ -2785,7 +2785,7 @@ function ti(t, e, n, r) { return e; } } -function Su(t) { +function Pu(t) { const e = {}; return t.childNodes.forEach((n) => { e[ @@ -2794,34 +2794,34 @@ function Su(t) { ] = !0; }), e; } -function bo(t, e, n, r, i, s) { - let a = class extends xo { +function Eo(t, e, n, r, i, s) { + let a = class extends Ao { constructor() { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return ai(e).map( + return ui(e).map( (o) => (e[o].attribute || o).toLowerCase() ); } }; - return ai(e).forEach((o) => { - oi(a.prototype, o, { + return ui(e).forEach((o) => { + fi(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { - var h; - l = ti(o, l, e), this.$$d[o] = l; + var c; + l = ri(o, l, e), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (h = Tn(u, o)) == null ? void 0 : h.get; + var f = (c = Nn(u, o)) == null ? void 0 : c.get; f ? u[o] = l : u.$set({ [o]: l }); } } }); }), r.forEach((o) => { - oi(a.prototype, o, { + fi(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; @@ -2830,43 +2830,43 @@ function bo(t, e, n, r, i, s) { }), t.element = /** @type {any} */ a, a; } -var ku = { value: () => { +var Du = { value: () => { } }; -function $o() { +function Ro() { for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } - return new ei(n); + return new ii(n); } -function ei(t) { +function ii(t) { this._ = t; } -function Mu(t, e) { +function Fu(t, e) { return t.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 && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } -ei.prototype = $o.prototype = { - constructor: ei, +ii.prototype = Ro.prototype = { + constructor: ii, on: function(t, e) { - var n = this._, r = Mu(t + "", n), i, s = -1, a = r.length; + var n = this._, r = Fu(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Pu(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Ou(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++s < a; ) - if (i = (t = r[s]).type) n[i] = ea(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = ea(n[i], t.name, null); + if (i = (t = r[s]).type) n[i] = ia(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = ia(n[i], t.name, null); return this; }, copy: function() { var t = {}, e = this._; for (var n in e) t[n] = e[n].slice(); - return new ei(t); + return new ii(t); }, call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; @@ -2878,135 +2878,135 @@ ei.prototype = $o.prototype = { for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function Pu(t, e) { +function Ou(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } -function ea(t, e, n) { +function ia(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { - t[r] = ku, t = t.slice(0, r).concat(t.slice(r + 1)); + t[r] = Du, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } -var as = "http://www.w3.org/1999/xhtml"; -const na = { +var us = "http://www.w3.org/1999/xhtml"; +const sa = { svg: "http://www.w3.org/2000/svg", - xhtml: as, + xhtml: us, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Ti(t) { +function ki(t) { var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), na.hasOwnProperty(e) ? { space: na[e], local: t } : t; + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), sa.hasOwnProperty(e) ? { space: sa[e], local: t } : t; } -function Du(t) { +function Iu(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; - return n === as && e.documentElement.namespaceURI === as ? e.createElement(t) : e.createElementNS(n, t); + return n === us && e.documentElement.namespaceURI === us ? e.createElement(t) : e.createElementNS(n, t); }; } -function Fu(t) { +function Lu(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } -function Ao(t) { - var e = Ti(t); - return (e.local ? Fu : Du)(e); +function Co(t) { + var e = ki(t); + return (e.local ? Lu : Iu)(e); } -function Ou() { +function qu() { } -function Ns(t) { - return t == null ? Ou : function() { +function Ms(t) { + return t == null ? qu : function() { return this.querySelector(t); }; } -function Iu(t) { - typeof t != "function" && (t = Ns(t)); +function Vu(t) { + typeof t != "function" && (t = Ms(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new zt(r, this._parents); + return new Bt(r, this._parents); } -function Lu(t) { +function zu(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function qu() { +function Hu() { return []; } -function Eo(t) { - return t == null ? qu : function() { +function To(t) { + return t == null ? Hu : function() { return this.querySelectorAll(t); }; } -function Vu(t) { +function Yu(t) { return function() { - return Lu(t.apply(this, arguments)); + return zu(t.apply(this, arguments)); }; } -function zu(t) { - typeof t == "function" ? t = Vu(t) : t = Eo(t); +function Bu(t) { + typeof t == "function" ? t = Yu(t) : t = To(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); - return new zt(r, i); + return new Bt(r, i); } -function Ro(t) { +function No(t) { return function() { return this.matches(t); }; } -function Co(t) { +function So(t) { return function(e) { return e.matches(t); }; } -var Hu = Array.prototype.find; -function Yu(t) { +var Uu = Array.prototype.find; +function Wu(t) { return function() { - return Hu.call(this.children, t); + return Uu.call(this.children, t); }; } -function Bu() { +function Xu() { return this.firstElementChild; } -function Uu(t) { - return this.select(t == null ? Bu : Yu(typeof t == "function" ? t : Co(t))); +function Gu(t) { + return this.select(t == null ? Xu : Wu(typeof t == "function" ? t : So(t))); } -var Wu = Array.prototype.filter; -function Xu() { +var Ku = Array.prototype.filter; +function ju() { return Array.from(this.children); } -function Gu(t) { +function Zu(t) { return function() { - return Wu.call(this.children, t); + return Ku.call(this.children, t); }; } -function Ku(t) { - return this.selectAll(t == null ? Xu : Gu(typeof t == "function" ? t : Co(t))); +function Ju(t) { + return this.selectAll(t == null ? ju : Zu(typeof t == "function" ? t : So(t))); } -function ju(t) { - typeof t != "function" && (t = Ro(t)); +function Qu(t) { + typeof t != "function" && (t = No(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new zt(r, this._parents); + return new Bt(r, this._parents); } -function To(t) { +function ko(t) { return new Array(t.length); } -function Zu() { - return new zt(this._enter || this._groups.map(To), this._parents); +function tf() { + return new Bt(this._enter || this._groups.map(ko), this._parents); } -function ui(t, e) { +function hi(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -ui.prototype = { - constructor: ui, +hi.prototype = { + constructor: hi, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -3020,91 +3020,91 @@ ui.prototype = { return this._parent.querySelectorAll(t); } }; -function Ju(t) { +function ef(t) { return function() { return t; }; } -function Qu(t, e, n, r, i, s) { +function nf(t, e, n, r, i, s) { for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new ui(t, s[a]); + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new hi(t, s[a]); for (; a < l; ++a) (o = e[a]) && (i[a] = o); } -function tf(t, e, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = e.length, h = s.length, c = new Array(f), v; +function rf(t, e, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = e.length, c = s.length, h = new Array(f), v; for (o = 0; o < f; ++o) - (l = e[o]) && (c[o] = v = a.call(l, l.__data__, o, e) + "", u.has(v) ? i[o] = l : u.set(v, l)); - for (o = 0; o < h; ++o) - v = a.call(t, s[o], o, s) + "", (l = u.get(v)) ? (r[o] = l, l.__data__ = s[o], u.delete(v)) : n[o] = new ui(t, s[o]); + (l = e[o]) && (h[o] = v = a.call(l, l.__data__, o, e) + "", u.has(v) ? i[o] = l : u.set(v, l)); + for (o = 0; o < c; ++o) + v = a.call(t, s[o], o, s) + "", (l = u.get(v)) ? (r[o] = l, l.__data__ = s[o], u.delete(v)) : n[o] = new hi(t, s[o]); for (o = 0; o < f; ++o) - (l = e[o]) && u.get(c[o]) === l && (i[o] = l); + (l = e[o]) && u.get(h[o]) === l && (i[o] = l); } -function ef(t) { +function sf(t) { return t.__data__; } -function nf(t, e) { - if (!arguments.length) return Array.from(this, ef); - var n = e ? tf : Qu, r = this._parents, i = this._groups; - typeof t != "function" && (t = Ju(t)); +function af(t, e) { + if (!arguments.length) return Array.from(this, sf); + var n = e ? rf : nf, r = this._parents, i = this._groups; + typeof t != "function" && (t = ef(t)); 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], h = i[u], c = h.length, v = rf(t.call(f, f && f.__data__, u, r)), g = v.length, m = o[u] = new Array(g), b = a[u] = new Array(g), $ = l[u] = new Array(c); - n(f, h, m, b, $, v, e); - for (var C = 0, T = 0, N, I; C < g; ++C) - if (N = m[C]) { - for (C >= T && (T = C + 1); !(I = b[T]) && ++T < g; ) ; - N._next = I || null; + var f = r[u], c = i[u], h = c.length, v = of(t.call(f, f && f.__data__, u, r)), g = v.length, m = o[u] = new Array(g), b = a[u] = new Array(g), $ = l[u] = new Array(h); + n(f, c, m, b, $, v, e); + for (var R = 0, E = 0, C, F; R < g; ++R) + if (C = m[R]) { + for (R >= E && (E = R + 1); !(F = b[E]) && ++E < g; ) ; + C._next = F || null; } } - return a = new zt(a, r), a._enter = o, a._exit = l, a; + return a = new Bt(a, r), a._enter = o, a._exit = l, a; } -function rf(t) { +function of(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function sf() { - return new zt(this._exit || this._groups.map(To), this._parents); +function lf() { + return new Bt(this._exit || this._groups.map(ko), this._parents); } -function af(t, e, n) { +function uf(t, e, n) { var r = this.enter(), i = this, s = this.exit(); return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function of(t) { +function ff(t) { for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._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], h = u.length, c = o[l] = new Array(h), v, g = 0; g < h; ++g) - (v = u[g] || f[g]) && (c[g] = v); + for (var u = n[l], f = r[l], c = u.length, h = o[l] = new Array(c), v, g = 0; g < c; ++g) + (v = u[g] || f[g]) && (h[g] = v); for (; l < i; ++l) o[l] = n[l]; - return new zt(o, this._parents); + return new Bt(o, this._parents); } -function lf() { +function cf() { for (var t = this._groups, e = -1, n = t.length; ++e < n; ) for (var r = t[e], 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 uf(t) { - t || (t = ff); - function e(h, c) { - return h && c ? t(h.__data__, c.__data__) : !h - !c; +function hf(t) { + t || (t = df); + function e(c, h) { + return c && h ? t(c.__data__, h.__data__) : !c - !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(e); } - return new zt(i, this._parents).order(); + return new Bt(i, this._parents).order(); } -function ff(t, e) { +function df(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function cf() { +function pf() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } -function hf() { +function vf() { return Array.from(this); } -function df() { +function gf() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length; i < s; ++i) { var a = r[i]; @@ -3112,114 +3112,114 @@ function df() { } return null; } -function pf() { +function _f() { let t = 0; for (const e of this) ++t; return t; } -function vf() { +function mf() { return !this.node(); } -function gf(t) { +function yf(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) (o = i[s]) && t.call(o, o.__data__, s, i); return this; } -function _f(t) { +function wf(t) { return function() { this.removeAttribute(t); }; } -function mf(t) { +function xf(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function yf(t, e) { +function bf(t, e) { return function() { this.setAttribute(t, e); }; } -function wf(t, e) { +function $f(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } -function xf(t, e) { +function Af(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function bf(t, e) { +function Ef(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); }; } -function $f(t, e) { - var n = Ti(t); +function Rf(t, e) { + var n = ki(t); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((e == null ? n.local ? mf : _f : typeof e == "function" ? n.local ? bf : xf : n.local ? wf : yf)(n, e)); + return this.each((e == null ? n.local ? xf : wf : typeof e == "function" ? n.local ? Ef : Af : n.local ? $f : bf)(n, e)); } -function No(t) { +function Mo(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function Af(t) { +function Cf(t) { return function() { this.style.removeProperty(t); }; } -function Ef(t, e, n) { +function Tf(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } -function Rf(t, e, n) { +function Nf(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function Cf(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? Af : typeof e == "function" ? Rf : Ef)(t, e, n ?? "")) : ur(this.node(), t); +function Sf(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? Cf : typeof e == "function" ? Nf : Tf)(t, e, n ?? "")) : cr(this.node(), t); } -function ur(t, e) { - return t.style.getPropertyValue(e) || No(t).getComputedStyle(t, null).getPropertyValue(e); +function cr(t, e) { + return t.style.getPropertyValue(e) || Mo(t).getComputedStyle(t, null).getPropertyValue(e); } -function Tf(t) { +function kf(t) { return function() { delete this[t]; }; } -function Nf(t, e) { +function Mf(t, e) { return function() { this[t] = e; }; } -function Sf(t, e) { +function Pf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } -function kf(t, e) { - return arguments.length > 1 ? this.each((e == null ? Tf : typeof e == "function" ? Sf : Nf)(t, e)) : this.node()[t]; +function Df(t, e) { + return arguments.length > 1 ? this.each((e == null ? kf : typeof e == "function" ? Pf : Mf)(t, e)) : this.node()[t]; } -function So(t) { +function Po(t) { return t.trim().split(/^|\s+/); } -function Ss(t) { - return t.classList || new ko(t); +function Ps(t) { + return t.classList || new Do(t); } -function ko(t) { - this._node = t, this._names = So(t.getAttribute("class") || ""); +function Do(t) { + this._node = t, this._names = Po(t.getAttribute("class") || ""); } -ko.prototype = { +Do.prototype = { add: function(t) { var e = this._names.indexOf(t); e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); @@ -3232,129 +3232,129 @@ ko.prototype = { return this._names.indexOf(t) >= 0; } }; -function Mo(t, e) { - for (var n = Ss(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +function Fo(t, e) { + for (var n = Ps(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function Po(t, e) { - for (var n = Ss(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +function Oo(t, e) { + for (var n = Ps(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function Mf(t) { +function Ff(t) { return function() { - Mo(this, t); + Fo(this, t); }; } -function Pf(t) { +function Of(t) { return function() { - Po(this, t); + Oo(this, t); }; } -function Df(t, e) { +function If(t, e) { return function() { - (e.apply(this, arguments) ? Mo : Po)(this, t); + (e.apply(this, arguments) ? Fo : Oo)(this, t); }; } -function Ff(t, e) { - var n = So(t + ""); +function Lf(t, e) { + var n = Po(t + ""); if (arguments.length < 2) { - for (var r = Ss(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Ps(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? Df : e ? Mf : Pf)(n, e)); + return this.each((typeof e == "function" ? If : e ? Ff : Of)(n, e)); } -function Of() { +function qf() { this.textContent = ""; } -function If(t) { +function Vf(t) { return function() { this.textContent = t; }; } -function Lf(t) { +function zf(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } -function qf(t) { - return arguments.length ? this.each(t == null ? Of : (typeof t == "function" ? Lf : If)(t)) : this.node().textContent; +function Hf(t) { + return arguments.length ? this.each(t == null ? qf : (typeof t == "function" ? zf : Vf)(t)) : this.node().textContent; } -function Vf() { +function Yf() { this.innerHTML = ""; } -function zf(t) { +function Bf(t) { return function() { this.innerHTML = t; }; } -function Hf(t) { +function Uf(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } -function Yf(t) { - return arguments.length ? this.each(t == null ? Vf : (typeof t == "function" ? Hf : zf)(t)) : this.node().innerHTML; +function Wf(t) { + return arguments.length ? this.each(t == null ? Yf : (typeof t == "function" ? Uf : Bf)(t)) : this.node().innerHTML; } -function Bf() { +function Xf() { this.nextSibling && this.parentNode.appendChild(this); } -function Uf() { - return this.each(Bf); +function Gf() { + return this.each(Xf); } -function Wf() { +function Kf() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function Xf() { - return this.each(Wf); +function jf() { + return this.each(Kf); } -function Gf(t) { - var e = typeof t == "function" ? t : Ao(t); +function Zf(t) { + var e = typeof t == "function" ? t : Co(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function Kf() { +function Jf() { return null; } -function jf(t, e) { - var n = typeof t == "function" ? t : Ao(t), r = e == null ? Kf : typeof e == "function" ? e : Ns(e); +function Qf(t, e) { + var n = typeof t == "function" ? t : Co(t), r = e == null ? Jf : typeof e == "function" ? e : Ms(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function Zf() { +function tc() { var t = this.parentNode; t && t.removeChild(this); } -function Jf() { - return this.each(Zf); +function ec() { + return this.each(tc); } -function Qf() { +function nc() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function tc() { +function rc() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function ec(t) { - return this.select(t ? tc : Qf); +function ic(t) { + return this.select(t ? rc : nc); } -function nc(t) { +function sc(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } -function rc(t) { +function ac(t) { return function(e) { t.call(this, e, this.__data__); }; } -function ic(t) { +function oc(t) { return t.trim().split(/^|\s+/).map(function(e) { var n = "", r = e.indexOf("."); return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n }; }); } -function sc(t) { +function lc(t) { return function() { var e = this.__on; if (e) { @@ -3364,9 +3364,9 @@ function sc(t) { } }; } -function ac(t, e, n) { +function uc(t, e, n) { return function() { - var r = this.__on, i, s = rc(e); + var r = this.__on, i, s = ac(e); if (r) { for (var a = 0, o = r.length; a < o; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { @@ -3377,8 +3377,8 @@ function ac(t, e, n) { this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function oc(t, e, n) { - var r = ic(t + ""), i, s = r.length, a; +function fc(t, e, n) { + var r = oc(t + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3389,93 +3389,93 @@ function oc(t, e, n) { } return; } - for (o = e ? ac : sc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + for (o = e ? uc : lc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); return this; } -function Do(t, e, n) { - var r = No(t), i = r.CustomEvent; +function Io(t, e, n) { + var r = Mo(t), i = r.CustomEvent; typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); } -function lc(t, e) { +function cc(t, e) { return function() { - return Do(this, t, e); + return Io(this, t, e); }; } -function uc(t, e) { +function hc(t, e) { return function() { - return Do(this, t, e.apply(this, arguments)); + return Io(this, t, e.apply(this, arguments)); }; } -function fc(t, e) { - return this.each((typeof e == "function" ? uc : lc)(t, e)); +function dc(t, e) { + return this.each((typeof e == "function" ? hc : cc)(t, e)); } -function* cc() { +function* pc() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var Fo = [null]; -function zt(t, e) { +var Lo = [null]; +function Bt(t, e) { this._groups = t, this._parents = e; } -function dr() { - return new zt([[document.documentElement]], Fo); +function vr() { + return new Bt([[document.documentElement]], Lo); } -function hc() { +function vc() { return this; } -zt.prototype = dr.prototype = { - constructor: zt, - select: Iu, - selectAll: zu, - selectChild: Uu, - selectChildren: Ku, - filter: ju, - data: nf, - enter: Zu, - exit: sf, - join: af, - merge: of, - selection: hc, - order: lf, - sort: uf, - call: cf, - nodes: hf, - node: df, - size: pf, - empty: vf, - each: gf, - attr: $f, - style: Cf, - property: kf, - classed: Ff, - text: qf, - html: Yf, - raise: Uf, - lower: Xf, - append: Gf, - insert: jf, - remove: Jf, - clone: ec, - datum: nc, - on: oc, - dispatch: fc, - [Symbol.iterator]: cc +Bt.prototype = vr.prototype = { + constructor: Bt, + select: Vu, + selectAll: Bu, + selectChild: Gu, + selectChildren: Ju, + filter: Qu, + data: af, + enter: tf, + exit: lf, + join: uf, + merge: ff, + selection: vc, + order: cf, + sort: hf, + call: pf, + nodes: vf, + node: gf, + size: _f, + empty: mf, + each: yf, + attr: Rf, + style: Sf, + property: Df, + classed: Lf, + text: Hf, + html: Wf, + raise: Gf, + lower: jf, + append: Zf, + insert: Qf, + remove: ec, + clone: ic, + datum: sc, + on: fc, + dispatch: dc, + [Symbol.iterator]: pc }; -function gt(t) { - return typeof t == "string" ? new zt([[document.querySelector(t)]], [document.documentElement]) : new zt([[t]], Fo); +function yt(t) { + return typeof t == "string" ? new Bt([[document.querySelector(t)]], [document.documentElement]) : new Bt([[t]], Lo); } -function ks(t, e, n) { +function Ds(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } -function Oo(t, e) { +function qo(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } -function zr() { +function Br() { } -var Sr = 0.7, fi = 1 / Sr, Gn = "\\s*([+-]?\\d+)\\s*", kr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Re = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", dc = /^#([0-9a-f]{3,8})$/, pc = new RegExp(`^rgb\\(${Gn},${Gn},${Gn}\\)$`), vc = new RegExp(`^rgb\\(${Re},${Re},${Re}\\)$`), gc = new RegExp(`^rgba\\(${Gn},${Gn},${Gn},${kr}\\)$`), _c = new RegExp(`^rgba\\(${Re},${Re},${Re},${kr}\\)$`), mc = new RegExp(`^hsl\\(${kr},${Re},${Re}\\)$`), yc = new RegExp(`^hsla\\(${kr},${Re},${Re},${kr}\\)$`), ra = { +var Pr = 0.7, di = 1 / Pr, jn = "\\s*([+-]?\\d+)\\s*", Dr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Ee = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", gc = /^#([0-9a-f]{3,8})$/, _c = new RegExp(`^rgb\\(${jn},${jn},${jn}\\)$`), mc = new RegExp(`^rgb\\(${Ee},${Ee},${Ee}\\)$`), yc = new RegExp(`^rgba\\(${jn},${jn},${jn},${Dr}\\)$`), wc = new RegExp(`^rgba\\(${Ee},${Ee},${Ee},${Dr}\\)$`), xc = new RegExp(`^hsl\\(${Dr},${Ee},${Ee}\\)$`), bc = new RegExp(`^hsla\\(${Dr},${Ee},${Ee},${Dr}\\)$`), aa = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3625,178 +3625,178 @@ var Sr = 0.7, fi = 1 / Sr, Gn = "\\s*([+-]?\\d+)\\s*", kr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -ks(zr, In, { +Ds(Br, Ln, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, - hex: ia, + hex: oa, // Deprecated! Use color.formatHex. - formatHex: ia, - formatHex8: wc, - formatHsl: xc, - formatRgb: sa, - toString: sa + formatHex: oa, + formatHex8: $c, + formatHsl: Ac, + formatRgb: la, + toString: la }); -function ia() { +function oa() { return this.rgb().formatHex(); } -function wc() { +function $c() { return this.rgb().formatHex8(); } -function xc() { - return Io(this).formatHsl(); +function Ac() { + return Vo(this).formatHsl(); } -function sa() { +function la() { return this.rgb().formatRgb(); } -function In(t) { +function Ln(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = dc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? aa(e) : n === 3 ? new Dt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Wr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Wr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = pc.exec(t)) ? new Dt(e[1], e[2], e[3], 1) : (e = vc.exec(t)) ? new Dt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = gc.exec(t)) ? Wr(e[1], e[2], e[3], e[4]) : (e = _c.exec(t)) ? Wr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = mc.exec(t)) ? ua(e[1], e[2] / 100, e[3] / 100, 1) : (e = yc.exec(t)) ? ua(e[1], e[2] / 100, e[3] / 100, e[4]) : ra.hasOwnProperty(t) ? aa(ra[t]) : t === "transparent" ? new Dt(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = gc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? ua(e) : n === 3 ? new Ft(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Kr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Kr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = _c.exec(t)) ? new Ft(e[1], e[2], e[3], 1) : (e = mc.exec(t)) ? new Ft(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = yc.exec(t)) ? Kr(e[1], e[2], e[3], e[4]) : (e = wc.exec(t)) ? Kr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = xc.exec(t)) ? ha(e[1], e[2] / 100, e[3] / 100, 1) : (e = bc.exec(t)) ? ha(e[1], e[2] / 100, e[3] / 100, e[4]) : aa.hasOwnProperty(t) ? ua(aa[t]) : t === "transparent" ? new Ft(NaN, NaN, NaN, 0) : null; } -function aa(t) { - return new Dt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +function ua(t) { + return new Ft(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function Wr(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new Dt(t, e, n, r); +function Kr(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new Ft(t, e, n, r); } -function bc(t) { - return t instanceof zr || (t = In(t)), t ? (t = t.rgb(), new Dt(t.r, t.g, t.b, t.opacity)) : new Dt(); +function Ec(t) { + return t instanceof Br || (t = Ln(t)), t ? (t = t.rgb(), new Ft(t.r, t.g, t.b, t.opacity)) : new Ft(); } -function os(t, e, n, r) { - return arguments.length === 1 ? bc(t) : new Dt(t, e, n, r ?? 1); +function fs(t, e, n, r) { + return arguments.length === 1 ? Ec(t) : new Ft(t, e, n, r ?? 1); } -function Dt(t, e, n, r) { +function Ft(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -ks(Dt, os, Oo(zr, { +Ds(Ft, fs, qo(Br, { brighter(t) { - return t = t == null ? fi : Math.pow(fi, t), new Dt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? di : Math.pow(di, t), new Ft(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? Sr : Math.pow(Sr, t), new Dt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Pr : Math.pow(Pr, t), new Ft(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new Dt(Mn(this.r), Mn(this.g), Mn(this.b), ci(this.opacity)); + return new Ft(Pn(this.r), Pn(this.g), Pn(this.b), pi(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: oa, + hex: fa, // Deprecated! Use color.formatHex. - formatHex: oa, - formatHex8: $c, - formatRgb: la, - toString: la + formatHex: fa, + formatHex8: Rc, + formatRgb: ca, + toString: ca })); -function oa() { - return `#${xn(this.r)}${xn(this.g)}${xn(this.b)}`; +function fa() { + return `#${bn(this.r)}${bn(this.g)}${bn(this.b)}`; } -function $c() { - return `#${xn(this.r)}${xn(this.g)}${xn(this.b)}${xn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function Rc() { + return `#${bn(this.r)}${bn(this.g)}${bn(this.b)}${bn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function la() { - const t = ci(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${Mn(this.r)}, ${Mn(this.g)}, ${Mn(this.b)}${t === 1 ? ")" : `, ${t})`}`; +function ca() { + const t = pi(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${Pn(this.r)}, ${Pn(this.g)}, ${Pn(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function ci(t) { +function pi(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function Mn(t) { +function Pn(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function xn(t) { - return t = Mn(t), (t < 16 ? "0" : "") + t.toString(16); +function bn(t) { + return t = Pn(t), (t < 16 ? "0" : "") + t.toString(16); } -function ua(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new le(t, e, n, r); +function ha(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new oe(t, e, n, r); } -function Io(t) { - if (t instanceof le) return new le(t.h, t.s, t.l, t.opacity); - if (t instanceof zr || (t = In(t)), !t) return new le(); - if (t instanceof le) return t; +function Vo(t) { + if (t instanceof oe) return new oe(t.h, t.s, t.l, t.opacity); + if (t instanceof Br || (t = Ln(t)), !t) return new oe(); + if (t instanceof oe) return t; t = t.rgb(); var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new le(a, o, l, t.opacity); + return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new oe(a, o, l, t.opacity); } -function Ac(t, e, n, r) { - return arguments.length === 1 ? Io(t) : new le(t, e, n, r ?? 1); +function Cc(t, e, n, r) { + return arguments.length === 1 ? Vo(t) : new oe(t, e, n, r ?? 1); } -function le(t, e, n, r) { +function oe(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -ks(le, Ac, Oo(zr, { +Ds(oe, Cc, qo(Br, { brighter(t) { - return t = t == null ? fi : Math.pow(fi, t), new le(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? di : Math.pow(di, t), new oe(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? Sr : Math.pow(Sr, t), new le(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Pr : Math.pow(Pr, t), new oe(this.h, this.s, this.l * t, this.opacity); }, rgb() { var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; - return new Dt( - Yi(t >= 240 ? t - 240 : t + 120, i, r), - Yi(t, i, r), - Yi(t < 120 ? t + 240 : t - 120, i, r), + return new Ft( + Wi(t >= 240 ? t - 240 : t + 120, i, r), + Wi(t, i, r), + Wi(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new le(fa(this.h), Xr(this.s), Xr(this.l), ci(this.opacity)); + return new oe(da(this.h), jr(this.s), jr(this.l), pi(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 t = ci(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${fa(this.h)}, ${Xr(this.s) * 100}%, ${Xr(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = pi(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${da(this.h)}, ${jr(this.s) * 100}%, ${jr(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function fa(t) { +function da(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function Xr(t) { +function jr(t) { return Math.max(0, Math.min(1, t || 0)); } -function Yi(t, e, n) { +function Wi(t, e, n) { return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; } -const Ms = (t) => () => t; -function Ec(t, e) { +const Fs = (t) => () => t; +function Tc(t, e) { return function(n) { return t + n * e; }; } -function Rc(t, e, n) { +function Nc(t, e, n) { return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) { return Math.pow(t + r * e, n); }; } -function Cc(t) { - return (t = +t) == 1 ? Lo : function(e, n) { - return n - e ? Rc(e, n, t) : Ms(isNaN(e) ? n : e); +function Sc(t) { + return (t = +t) == 1 ? zo : function(e, n) { + return n - e ? Nc(e, n, t) : Fs(isNaN(e) ? n : e); }; } -function Lo(t, e) { +function zo(t, e) { var n = e - t; - return n ? Ec(t, n) : Ms(isNaN(t) ? e : t); + return n ? Tc(t, n) : Fs(isNaN(t) ? e : t); } -const hi = (function t(e) { - var n = Cc(e); +const vi = (function t(e) { + var n = Sc(e); function r(i, s) { - var a = n((i = os(i)).r, (s = os(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Lo(i.opacity, s.opacity); + var a = n((i = fs(i)).r, (s = fs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = zo(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 = t, r; })(1); -function Tc(t, e) { +function kc(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { @@ -3804,64 +3804,64 @@ function Tc(t, e) { return r; }; } -function Nc(t) { +function Mc(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function Sc(t, e) { +function Pc(t, e) { var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Wn(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = Gn(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function kc(t, e) { +function Dc(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; }; } -function Ee(t, e) { +function Ae(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } -function Mc(t, e) { +function Fc(t, e) { var n = {}, r = {}, i; (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); for (i in e) - i in t ? n[i] = Wn(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = Gn(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var ls = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Bi = new RegExp(ls.source, "g"); -function Pc(t) { +var cs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Xi = new RegExp(cs.source, "g"); +function Oc(t) { return function() { return t; }; } -function Dc(t) { +function Ic(t) { return function(e) { return t(e) + ""; }; } -function qo(t, e) { - var n = ls.lastIndex = Bi.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = ls.exec(t)) && (i = Bi.exec(e)); ) - (s = i.index) > n && (s = e.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: Ee(r, i) })), n = Bi.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Dc(l[0].x) : Pc(e) : (e = l.length, function(u) { - for (var f = 0, h; f < e; ++f) o[(h = l[f]).i] = h.x(u); +function Ho(t, e) { + var n = cs.lastIndex = Xi.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (t = t + "", e = e + ""; (r = cs.exec(t)) && (i = Xi.exec(e)); ) + (s = i.index) > n && (s = e.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: Ae(r, i) })), n = Xi.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Ic(l[0].x) : Oc(e) : (e = l.length, function(u) { + for (var f = 0, c; f < e; ++f) o[(c = l[f]).i] = c.x(u); return o.join(""); }); } -function Wn(t, e) { +function Gn(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? Ms(e) : (n === "number" ? Ee : n === "string" ? (r = In(e)) ? (e = r, hi) : qo : e instanceof In ? hi : e instanceof Date ? kc : Nc(e) ? Tc : Array.isArray(e) ? Sc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Mc : Ee)(t, e); + return e == null || n === "boolean" ? Fs(e) : (n === "number" ? Ae : n === "string" ? (r = Ln(e)) ? (e = r, vi) : Ho : e instanceof Ln ? vi : e instanceof Date ? Dc : Mc(e) ? kc : Array.isArray(e) ? Pc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Fc : Ae)(t, e); } -var ca = 180 / Math.PI, us = { +var pa = 180 / Math.PI, hs = { translateX: 0, translateY: 0, rotate: 0, @@ -3869,187 +3869,187 @@ var ca = 180 / Math.PI, us = { scaleX: 1, scaleY: 1 }; -function Vo(t, e, n, r, i, s) { +function Yo(t, e, n, r, i, s) { var a, o, l; return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(e, t) * ca, - skewX: Math.atan(l) * ca, + rotate: Math.atan2(e, t) * pa, + skewX: Math.atan(l) * pa, scaleX: a, scaleY: o }; } -var Gr; -function Fc(t) { +var Zr; +function Lc(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? us : Vo(e.a, e.b, e.c, e.d, e.e, e.f); + return e.isIdentity ? hs : Yo(e.a, e.b, e.c, e.d, e.e, e.f); } -function Oc(t) { - return t == null || (Gr || (Gr = document.createElementNS("http://www.w3.org/2000/svg", "g")), Gr.setAttribute("transform", t), !(t = Gr.transform.baseVal.consolidate())) ? us : (t = t.matrix, Vo(t.a, t.b, t.c, t.d, t.e, t.f)); +function qc(t) { + return t == null || (Zr || (Zr = document.createElementNS("http://www.w3.org/2000/svg", "g")), Zr.setAttribute("transform", t), !(t = Zr.transform.baseVal.consolidate())) ? hs : (t = t.matrix, Yo(t.a, t.b, t.c, t.d, t.e, t.f)); } -function zo(t, e, n, r) { +function Bo(t, e, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } - function s(u, f, h, c, v, g) { - if (u !== h || f !== c) { + function s(u, f, c, h, v, g) { + if (u !== c || f !== h) { var m = v.push("translate(", null, e, null, n); - g.push({ i: m - 4, x: Ee(u, h) }, { i: m - 2, x: Ee(f, c) }); - } else (h || c) && v.push("translate(" + h + e + c + n); + g.push({ i: m - 4, x: Ae(u, c) }, { i: m - 2, x: Ae(f, h) }); + } else (c || h) && v.push("translate(" + c + e + h + n); } - function a(u, f, h, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Ee(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); + function a(u, f, c, h) { + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), h.push({ i: c.push(i(c) + "rotate(", null, r) - 2, x: Ae(u, f) })) : f && c.push(i(c) + "rotate(" + f + r); } - function o(u, f, h, c) { - u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Ee(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); + function o(u, f, c, h) { + u !== f ? h.push({ i: c.push(i(c) + "skewX(", null, r) - 2, x: Ae(u, f) }) : f && c.push(i(c) + "skewX(" + f + r); } - function l(u, f, h, c, v, g) { - if (u !== h || f !== c) { + function l(u, f, c, h, v, g) { + if (u !== c || f !== h) { var m = v.push(i(v) + "scale(", null, ",", null, ")"); - g.push({ i: m - 4, x: Ee(u, h) }, { i: m - 2, x: Ee(f, c) }); - } else (h !== 1 || c !== 1) && v.push(i(v) + "scale(" + h + "," + c + ")"); + g.push({ i: m - 4, x: Ae(u, c) }, { i: m - 2, x: Ae(f, h) }); + } else (c !== 1 || h !== 1) && v.push(i(v) + "scale(" + c + "," + h + ")"); } return function(u, f) { - var h = [], c = []; - return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, h, c), a(u.rotate, f.rotate, h, c), o(u.skewX, f.skewX, h, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, h, c), u = f = null, function(v) { - for (var g = -1, m = c.length, b; ++g < m; ) h[(b = c[g]).i] = b.x(v); - return h.join(""); + var c = [], h = []; + return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, c, h), a(u.rotate, f.rotate, c, h), o(u.skewX, f.skewX, c, h), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, c, h), u = f = null, function(v) { + for (var g = -1, m = h.length, b; ++g < m; ) c[(b = h[g]).i] = b.x(v); + return c.join(""); }; }; } -var Ic = zo(Fc, "px, ", "px)", "deg)"), Lc = zo(Oc, ", ", ")", ")"), fr = 0, br = 0, wr = 0, Ho = 1e3, di, $r, pi = 0, Ln = 0, Ni = 0, Mr = typeof performance == "object" && performance.now ? performance : Date, Yo = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Vc = Bo(Lc, "px, ", "px)", "deg)"), zc = Bo(qc, ", ", ")", ")"), hr = 0, Er = 0, $r = 0, Uo = 1e3, gi, Rr, _i = 0, qn = 0, Mi = 0, Fr = typeof performance == "object" && performance.now ? performance : Date, Wo = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; -function Ps() { - return Ln || (Yo(qc), Ln = Mr.now() + Ni); +function Os() { + return qn || (Wo(Hc), qn = Fr.now() + Mi); } -function qc() { - Ln = 0; +function Hc() { + qn = 0; } -function vi() { +function mi() { this._call = this._time = this._next = null; } -vi.prototype = Bo.prototype = { - constructor: vi, +mi.prototype = Xo.prototype = { + constructor: mi, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Ps() : +n) + (e == null ? 0 : +e), !this._next && $r !== this && ($r ? $r._next = this : di = this, $r = this), this._call = t, this._time = n, fs(); + n = (n == null ? Os() : +n) + (e == null ? 0 : +e), !this._next && Rr !== this && (Rr ? Rr._next = this : gi = this, Rr = this), this._call = t, this._time = n, ds(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, fs()); + this._call && (this._call = null, this._time = 1 / 0, ds()); } }; -function Bo(t, e, n) { - var r = new vi(); +function Xo(t, e, n) { + var r = new mi(); return r.restart(t, e, n), r; } -function Vc() { - Ps(), ++fr; - for (var t = di, e; t; ) - (e = Ln - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --fr; +function Yc() { + Os(), ++hr; + for (var t = gi, e; t; ) + (e = qn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --hr; } -function ha() { - Ln = (pi = Mr.now()) + Ni, fr = br = 0; +function va() { + qn = (_i = Fr.now()) + Mi, hr = Er = 0; try { - Vc(); + Yc(); } finally { - fr = 0, Hc(), Ln = 0; + hr = 0, Uc(), qn = 0; } } -function zc() { - var t = Mr.now(), e = t - pi; - e > Ho && (Ni -= e, pi = t); +function Bc() { + var t = Fr.now(), e = t - _i; + e > Uo && (Mi -= e, _i = t); } -function Hc() { - for (var t, e = di, n, r = 1 / 0; e; ) - e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : di = n); - $r = t, fs(r); +function Uc() { + for (var t, e = gi, n, r = 1 / 0; e; ) + e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : gi = n); + Rr = t, ds(r); } -function fs(t) { - if (!fr) { - br && (br = clearTimeout(br)); - var e = t - Ln; - e > 24 ? (t < 1 / 0 && (br = setTimeout(ha, t - Mr.now() - Ni)), wr && (wr = clearInterval(wr))) : (wr || (pi = Mr.now(), wr = setInterval(zc, Ho)), fr = 1, Yo(ha)); +function ds(t) { + if (!hr) { + Er && (Er = clearTimeout(Er)); + var e = t - qn; + e > 24 ? (t < 1 / 0 && (Er = setTimeout(va, t - Fr.now() - Mi)), $r && ($r = clearInterval($r))) : ($r || (_i = Fr.now(), $r = setInterval(Bc, Uo)), hr = 1, Wo(va)); } } -function da(t, e, n) { - var r = new vi(); +function ga(t, e, n) { + var r = new mi(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var Yc = $o("start", "end", "cancel", "interrupt"), Bc = [], Uo = 0, pa = 1, cs = 2, ni = 3, va = 4, hs = 5, ri = 6; -function Si(t, e, n, r, i, s) { +var Wc = Ro("start", "end", "cancel", "interrupt"), Xc = [], Go = 0, _a = 1, ps = 2, si = 3, ma = 4, vs = 5, ai = 6; +function Pi(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - Uc(t, n, { + Gc(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. - on: Yc, - tween: Bc, + on: Wc, + tween: Xc, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: Uo + state: Go }); } -function Ds(t, e) { - var n = de(t, e); - if (n.state > Uo) throw new Error("too late; already scheduled"); +function Is(t, e) { + var n = he(t, e); + if (n.state > Go) throw new Error("too late; already scheduled"); return n; } -function ke(t, e) { - var n = de(t, e); - if (n.state > ni) throw new Error("too late; already running"); +function Se(t, e) { + var n = he(t, e); + if (n.state > si) throw new Error("too late; already running"); return n; } -function de(t, e) { +function he(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Uc(t, e, n) { +function Gc(t, e, n) { var r = t.__transition, i; - r[e] = n, n.timer = Bo(s, 0, n.time); + r[e] = n, n.timer = Xo(s, 0, n.time); function s(u) { - n.state = pa, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = _a, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { - var f, h, c, v; - if (n.state !== pa) return l(); + var f, c, h, v; + if (n.state !== _a) return l(); for (f in r) if (v = r[f], v.name === n.name) { - if (v.state === ni) return da(a); - v.state === va ? (v.state = ri, v.timer.stop(), v.on.call("interrupt", t, t.__data__, v.index, v.group), delete r[f]) : +f < e && (v.state = ri, v.timer.stop(), v.on.call("cancel", t, t.__data__, v.index, v.group), delete r[f]); + if (v.state === si) return ga(a); + v.state === ma ? (v.state = ai, v.timer.stop(), v.on.call("interrupt", t, t.__data__, v.index, v.group), delete r[f]) : +f < e && (v.state = ai, v.timer.stop(), v.on.call("cancel", t, t.__data__, v.index, v.group), delete r[f]); } - if (da(function() { - n.state === ni && (n.state = va, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = cs, n.on.call("start", t, t.__data__, n.index, n.group), n.state === cs) { - for (n.state = ni, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) - (v = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = v); - i.length = h + 1; + if (ga(function() { + n.state === si && (n.state = ma, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = ps, n.on.call("start", t, t.__data__, n.index, n.group), n.state === ps) { + for (n.state = si, i = new Array(h = n.tween.length), f = 0, c = -1; f < h; ++f) + (v = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++c] = v); + i.length = c + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = hs, 1), h = -1, c = i.length; ++h < c; ) - i[h].call(t, f); - n.state === hs && (n.on.call("end", t, t.__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 = vs, 1), c = -1, h = i.length; ++c < h; ) + i[c].call(t, f); + n.state === vs && (n.on.call("end", t, t.__data__, n.index, n.group), l()); } function l() { - n.state = ri, n.timer.stop(), delete r[e]; + n.state = ai, n.timer.stop(), delete r[e]; for (var u in r) return; delete t.__transition; } } -function Wc(t, e) { +function Kc(t, e) { var n = t.__transition, r, i, s = !0, a; if (n) { e = e == null ? null : e + ""; @@ -4058,20 +4058,20 @@ function Wc(t, e) { s = !1; continue; } - i = r.state > cs && r.state < hs, r.state = ri, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > ps && r.state < vs, r.state = ai, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } -function Xc(t) { +function jc(t) { return this.each(function() { - Wc(this, t); + Kc(this, t); }); } -function Gc(t, e) { +function Zc(t, e) { var n, r; return function() { - var i = ke(this, t), s = i.tween; + var i = Se(this, t), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) @@ -4083,11 +4083,11 @@ function Gc(t, e) { i.tween = r; }; } -function Kc(t, e, n) { +function Jc(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = ke(this, t), a = s.tween; + var s = Se(this, t), a = s.tween; if (a !== r) { i = (r = a).slice(); for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) @@ -4100,318 +4100,318 @@ function Kc(t, e, n) { s.tween = i; }; } -function jc(t, e) { +function Qc(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = de(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = he(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) if ((a = r[i]).name === t) return a.value; return null; } - return this.each((e == null ? Gc : Kc)(n, t, e)); + return this.each((e == null ? Zc : Jc)(n, t, e)); } -function Fs(t, e, n) { +function Ls(t, e, n) { var r = t._id; return t.each(function() { - var i = ke(this, r); + var i = Se(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return de(i, r).value[e]; + return he(i, r).value[e]; }; } -function Wo(t, e) { +function Ko(t, e) { var n; - return (typeof e == "number" ? Ee : e instanceof In ? hi : (n = In(e)) ? (e = n, hi) : qo)(t, e); + return (typeof e == "number" ? Ae : e instanceof Ln ? vi : (n = Ln(e)) ? (e = n, vi) : Ho)(t, e); } -function Zc(t) { +function th(t) { return function() { this.removeAttribute(t); }; } -function Jc(t) { +function eh(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function Qc(t, e, n) { +function nh(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttribute(t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function th(t, e, n) { +function rh(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttributeNS(t.space, t.local); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function eh(t, e, n) { +function ih(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function nh(t, e, n) { +function sh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function rh(t, e) { - var n = Ti(t), r = n === "transform" ? Lc : Wo; - return this.attrTween(t, typeof e == "function" ? (n.local ? nh : eh)(n, r, Fs(this, "attr." + t, e)) : e == null ? (n.local ? Jc : Zc)(n) : (n.local ? th : Qc)(n, r, e)); +function ah(t, e) { + var n = ki(t), r = n === "transform" ? zc : Ko; + return this.attrTween(t, typeof e == "function" ? (n.local ? sh : ih)(n, r, Ls(this, "attr." + t, e)) : e == null ? (n.local ? eh : th)(n) : (n.local ? rh : nh)(n, r, e)); } -function ih(t, e) { +function oh(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function sh(t, e) { +function lh(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function ah(t, e) { +function uh(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && sh(t, s)), n; + return s !== r && (n = (r = s) && lh(t, s)), n; } return i._value = e, i; } -function oh(t, e) { +function fh(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && ih(t, s)), n; + return s !== r && (n = (r = s) && oh(t, s)), n; } return i._value = e, i; } -function lh(t, e) { +function ch(t, e) { var n = "attr." + t; if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (e == null) return this.tween(n, null); if (typeof e != "function") throw new Error(); - var r = Ti(t); - return this.tween(n, (r.local ? ah : oh)(r, e)); + var r = ki(t); + return this.tween(n, (r.local ? uh : fh)(r, e)); } -function uh(t, e) { +function hh(t, e) { return function() { - Ds(this, t).delay = +e.apply(this, arguments); + Is(this, t).delay = +e.apply(this, arguments); }; } -function fh(t, e) { +function dh(t, e) { return e = +e, function() { - Ds(this, t).delay = e; + Is(this, t).delay = e; }; } -function ch(t) { +function ph(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? uh : fh)(e, t)) : de(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? hh : dh)(e, t)) : he(this.node(), e).delay; } -function hh(t, e) { +function vh(t, e) { return function() { - ke(this, t).duration = +e.apply(this, arguments); + Se(this, t).duration = +e.apply(this, arguments); }; } -function dh(t, e) { +function gh(t, e) { return e = +e, function() { - ke(this, t).duration = e; + Se(this, t).duration = e; }; } -function ph(t) { +function _h(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? hh : dh)(e, t)) : de(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? vh : gh)(e, t)) : he(this.node(), e).duration; } -function vh(t, e) { +function mh(t, e) { if (typeof e != "function") throw new Error(); return function() { - ke(this, t).ease = e; + Se(this, t).ease = e; }; } -function gh(t) { +function yh(t) { var e = this._id; - return arguments.length ? this.each(vh(e, t)) : de(this.node(), e).ease; + return arguments.length ? this.each(mh(e, t)) : he(this.node(), e).ease; } -function _h(t, e) { +function wh(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - ke(this, t).ease = n; + Se(this, t).ease = n; }; } -function mh(t) { +function xh(t) { if (typeof t != "function") throw new Error(); - return this.each(_h(this._id, t)); + return this.each(wh(this._id, t)); } -function yh(t) { - typeof t != "function" && (t = Ro(t)); +function bh(t) { + typeof t != "function" && (t = No(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); return new Ke(r, this._parents, this._name, this._id); } -function wh(t) { +function $h(t) { if (t._id !== this._id) throw new Error(); for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) - for (var l = e[o], u = n[o], f = l.length, h = a[o] = new Array(f), c, v = 0; v < f; ++v) - (c = l[v] || u[v]) && (h[v] = c); + for (var l = e[o], u = n[o], f = l.length, c = a[o] = new Array(f), h, v = 0; v < f; ++v) + (h = l[v] || u[v]) && (c[v] = h); for (; o < r; ++o) a[o] = e[o]; return new Ke(a, this._parents, this._name, this._id); } -function xh(t) { +function Ah(t) { return (t + "").trim().split(/^|\s+/).every(function(e) { var n = e.indexOf("."); return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; }); } -function bh(t, e, n) { - var r, i, s = xh(e) ? Ds : ke; +function Eh(t, e, n) { + var r, i, s = Ah(e) ? Is : Se; return function() { var a = s(this, t), o = a.on; o !== r && (i = (r = o).copy()).on(e, n), a.on = i; }; } -function $h(t, e) { +function Rh(t, e) { var n = this._id; - return arguments.length < 2 ? de(this.node(), n).on.on(t) : this.each(bh(n, t, e)); + return arguments.length < 2 ? he(this.node(), n).on.on(t) : this.each(Eh(n, t, e)); } -function Ah(t) { +function Ch(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } -function Eh() { - return this.on("end.remove", Ah(this._id)); +function Th() { + return this.on("end.remove", Ch(this._id)); } -function Rh(t) { +function Nh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = Ns(t)); + typeof t != "function" && (t = Ms(t)); 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, h, c = 0; c < l; ++c) - (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Si(u[c], e, n, c, u, de(f, n))); + for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, c, h = 0; h < l; ++h) + (f = o[h]) && (c = t.call(f, f.__data__, h, o)) && ("__data__" in f && (c.__data__ = f.__data__), u[h] = c, Pi(u[h], e, n, h, u, he(f, n))); return new Ke(s, this._parents, e, n); } -function Ch(t) { +function Sh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = Eo(t)); + typeof t != "function" && (t = To(t)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) - for (var l = r[o], u = l.length, f, h = 0; h < u; ++h) - if (f = l[h]) { - for (var c = t.call(f, f.__data__, h, l), v, g = de(f, n), m = 0, b = c.length; m < b; ++m) - (v = c[m]) && Si(v, e, n, m, c, g); - s.push(c), a.push(f); + for (var l = r[o], u = l.length, f, c = 0; c < u; ++c) + if (f = l[c]) { + for (var h = t.call(f, f.__data__, c, l), v, g = he(f, n), m = 0, b = h.length; m < b; ++m) + (v = h[m]) && Pi(v, e, n, m, h, g); + s.push(h), a.push(f); } return new Ke(s, a, e, n); } -var Th = dr.prototype.constructor; -function Nh() { - return new Th(this._groups, this._parents); +var kh = vr.prototype.constructor; +function Mh() { + return new kh(this._groups, this._parents); } -function Sh(t, e) { +function Ph(t, e) { var n, r, i; return function() { - var s = ur(this, t), a = (this.style.removeProperty(t), ur(this, t)); + var s = cr(this, t), a = (this.style.removeProperty(t), cr(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function Xo(t) { +function jo(t) { return function() { this.style.removeProperty(t); }; } -function kh(t, e, n) { +function Dh(t, e, n) { var r, i = n + "", s; return function() { - var a = ur(this, t); + var a = cr(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function Mh(t, e, n) { +function Fh(t, e, n) { var r, i, s; return function() { - var a = ur(this, t), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(t), ur(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + var a = cr(this, t), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(t), cr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); }; } -function Ph(t, e) { +function Oh(t, e) { var n, r, i, s = "style." + e, a = "end." + s, o; return function() { - var l = ke(this, t), u = l.on, f = l.value[s] == null ? o || (o = Xo(e)) : void 0; + var l = Se(this, t), u = l.on, f = l.value[s] == null ? o || (o = jo(e)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function Dh(t, e, n) { - var r = (t += "") == "transform" ? Ic : Wo; - return e == null ? this.styleTween(t, Sh(t, r)).on("end.style." + t, Xo(t)) : typeof e == "function" ? this.styleTween(t, Mh(t, r, Fs(this, "style." + t, e))).each(Ph(this._id, t)) : this.styleTween(t, kh(t, r, e), n).on("end.style." + t, null); +function Ih(t, e, n) { + var r = (t += "") == "transform" ? Vc : Ko; + return e == null ? this.styleTween(t, Ph(t, r)).on("end.style." + t, jo(t)) : typeof e == "function" ? this.styleTween(t, Fh(t, r, Ls(this, "style." + t, e))).each(Oh(this._id, t)) : this.styleTween(t, Dh(t, r, e), n).on("end.style." + t, null); } -function Fh(t, e, n) { +function Lh(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } -function Oh(t, e, n) { +function qh(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && Fh(t, a, n)), r; + return a !== i && (r = (i = a) && Lh(t, a, n)), r; } return s._value = e, s; } -function Ih(t, e, n) { +function Vh(t, e, n) { var r = "style." + (t += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; if (e == null) return this.tween(r, null); if (typeof e != "function") throw new Error(); - return this.tween(r, Oh(t, e, n ?? "")); + return this.tween(r, qh(t, e, n ?? "")); } -function Lh(t) { +function zh(t) { return function() { this.textContent = t; }; } -function qh(t) { +function Hh(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function Vh(t) { - return this.tween("text", typeof t == "function" ? qh(Fs(this, "text", t)) : Lh(t == null ? "" : t + "")); +function Yh(t) { + return this.tween("text", typeof t == "function" ? Hh(Ls(this, "text", t)) : zh(t == null ? "" : t + "")); } -function zh(t) { +function Bh(t) { return function(e) { this.textContent = t.call(this, e); }; } -function Hh(t) { +function Uh(t) { var e, n; function r() { var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && zh(i)), e; + return i !== n && (e = (n = i) && Bh(i)), e; } return r._value = t, r; } -function Yh(t) { +function Wh(t) { var e = "text"; if (arguments.length < 1) return (e = this.tween(e)) && e._value; if (t == null) return this.tween(e, null); if (typeof t != "function") throw new Error(); - return this.tween(e, Hh(t)); + return this.tween(e, Uh(t)); } -function Bh() { - for (var t = this._name, e = this._id, n = Go(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function Xh() { + for (var t = this._name, e = this._id, n = Zo(), 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 = de(l, e); - Si(l, t, n, u, a, { + var f = he(l, e); + Pi(l, t, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, @@ -4420,97 +4420,97 @@ function Bh() { } return new Ke(r, this._parents, t, n); } -function Uh() { +function Gh() { var t, e, 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 = ke(this, r), f = u.on; + var u = Se(this, r), f = u.on; f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; }), i === 0 && s(); }); } -var Wh = 0; +var Kh = 0; function Ke(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function ii(t) { - return dr().transition(t); +function oi(t) { + return vr().transition(t); } -function Go() { - return ++Wh; +function Zo() { + return ++Kh; } -var qe = dr.prototype; -Ke.prototype = ii.prototype = { +var qe = vr.prototype; +Ke.prototype = oi.prototype = { constructor: Ke, - select: Rh, - selectAll: Ch, + select: Nh, + selectAll: Sh, selectChild: qe.selectChild, selectChildren: qe.selectChildren, - filter: yh, - merge: wh, - selection: Nh, - transition: Bh, + filter: bh, + merge: $h, + selection: Mh, + transition: Xh, call: qe.call, nodes: qe.nodes, node: qe.node, size: qe.size, empty: qe.empty, each: qe.each, - on: $h, - attr: rh, - attrTween: lh, - style: Dh, - styleTween: Ih, - text: Vh, - textTween: Yh, - remove: Eh, - tween: jc, - delay: ch, - duration: ph, - ease: gh, - easeVarying: mh, - end: Uh, + on: Rh, + attr: ah, + attrTween: ch, + style: Ih, + styleTween: Vh, + text: Yh, + textTween: Wh, + remove: Th, + tween: Qc, + delay: ph, + duration: _h, + ease: yh, + easeVarying: xh, + end: Gh, [Symbol.iterator]: qe[Symbol.iterator] }; -function Xh(t) { +function jh(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var Gh = { +var Zh = { time: null, // Set on use. delay: 0, duration: 250, - ease: Xh + ease: jh }; -function Kh(t, e) { +function Jh(t, e) { for (var n; !(n = t.__transition) || !(n = n[e]); ) if (!(t = t.parentNode)) throw new Error(`transition ${e} not found`); return n; } -function jh(t) { +function Qh(t) { var e, n; - t instanceof Ke ? (e = t._id, t = t._name) : (e = Go(), (n = Gh).time = Ps(), t = t == null ? null : t + ""); + t instanceof Ke ? (e = t._id, t = t._name) : (e = Zo(), (n = Zh).time = Os(), t = t == null ? null : t + ""); 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]) && Si(l, t, e, u, a, n || Kh(l, e)); + (l = a[u]) && Pi(l, t, e, u, a, n || Jh(l, e)); return new Ke(r, this._parents, t, e); } -dr.prototype.interrupt = Xc; -dr.prototype.transition = jh; -const ds = Math.PI, ps = 2 * ds, gn = 1e-6, Zh = ps - gn; -function Ko(t) { +vr.prototype.interrupt = jc; +vr.prototype.transition = Qh; +const gs = Math.PI, _s = 2 * gs, _n = 1e-6, td = _s - _n; +function Jo(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function Jh(t) { +function ed(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return Ko; + if (e > 15) return Jo; const n = 10 ** e; return function(r) { this._ += r[0]; @@ -4518,10 +4518,10 @@ function Jh(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Qh { +class nd { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? Ko : Jh(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? Jo : ed(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -4540,20 +4540,20 @@ class Qh { } arcTo(e, n, r, i, s) { if (e = +e, 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 - e, u = i - n, f = a - e, h = o - n, c = f * f + h * h; + let a = this._x1, o = this._y1, l = r - e, u = i - n, f = a - e, c = o - n, h = f * f + c * c; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > gn) if (!(Math.abs(h * l - u * f) > gn) || !s) + else if (h > _n) if (!(Math.abs(c * l - u * f) > _n) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let v = r - a, g = i - o, m = l * l + u * u, b = v * v + g * g, $ = Math.sqrt(m), C = Math.sqrt(c), T = s * Math.tan((ds - Math.acos((m + c - b) / (2 * $ * C))) / 2), N = T / C, I = T / $; - Math.abs(N - 1) > gn && this._append`L${e + N * f},${n + N * h}`, this._append`A${s},${s},0,0,${+(h * v > f * g)},${this._x1 = e + I * l},${this._y1 = n + I * u}`; + let v = r - a, g = i - o, m = l * l + u * u, b = v * v + g * g, $ = Math.sqrt(m), R = Math.sqrt(h), E = s * Math.tan((gs - Math.acos((m + h - b) / (2 * $ * R))) / 2), C = E / R, F = E / $; + Math.abs(C - 1) > _n && this._append`L${e + C * f},${n + C * c}`, this._append`A${s},${s},0,0,${+(c * v > f * g)},${this._x1 = e + F * l},${this._y1 = n + F * u}`; } } arc(e, n, r, i, s, a) { if (e = +e, 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 = e + o, f = n + l, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > gn || Math.abs(this._y1 - f) > gn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % ps + ps), c > Zh ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > gn && this._append`A${r},${r},0,${+(c >= ds)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + let o = r * Math.cos(i), l = r * Math.sin(i), u = e + o, f = n + l, c = 1 ^ a, h = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > _n || Math.abs(this._y1 - f) > _n) && this._append`L${u},${f}`, r && (h < 0 && (h = h % _s + _s), h > td ? this._append`A${r},${r},0,1,${c},${e - o},${n - l}A${r},${r},0,1,${c},${this._x1 = u},${this._y1 = f}` : h > _n && this._append`A${r},${r},0,${+(h >= gs)},${c},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } rect(e, n, r, i) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; @@ -4562,24 +4562,24 @@ class Qh { return this._; } } -function td(t) { +function rd(t) { for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); return n; } -const ed = td("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Ct(t) { +const id = rd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Nt(t) { return function() { return t; }; } -const ga = Math.abs, At = Math.atan2, vn = Math.cos, nd = Math.max, Ui = Math.min, we = Math.sin, Xn = Math.sqrt, St = 1e-12, Pr = Math.PI, gi = Pr / 2, si = 2 * Pr; -function rd(t) { - return t > 1 ? 0 : t < -1 ? Pr : Math.acos(t); +const ya = Math.abs, Rt = Math.atan2, gn = Math.cos, sd = Math.max, Gi = Math.min, ye = Math.sin, Kn = Math.sqrt, kt = 1e-12, Or = Math.PI, yi = Or / 2, li = 2 * Or; +function ad(t) { + return t > 1 ? 0 : t < -1 ? Or : Math.acos(t); } -function _a(t) { - return t >= 1 ? gi : t <= -1 ? -gi : Math.asin(t); +function wa(t) { + return t >= 1 ? yi : t <= -1 ? -yi : Math.asin(t); } -function id(t) { +function od(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -4591,141 +4591,141 @@ function id(t) { e = r; } return t; - }, () => new Qh(e); + }, () => new nd(e); } -function sd(t) { +function ld(t) { return t.innerRadius; } -function ad(t) { +function ud(t) { return t.outerRadius; } -function od(t) { +function fd(t) { return t.startAngle; } -function ld(t) { +function cd(t) { return t.endAngle; } -function ud(t) { +function hd(t) { return t && t.padAngle; } -function fd(t, e, n, r, i, s, a, o) { - var l = n - t, u = r - e, f = a - i, h = o - s, c = h * l - f * u; - if (!(c * c < St)) - return c = (f * (e - s) - h * (t - i)) / c, [t + c * l, e + c * u]; +function dd(t, e, n, r, i, s, a, o) { + var l = n - t, u = r - e, f = a - i, c = o - s, h = c * l - f * u; + if (!(h * h < kt)) + return h = (f * (e - s) - c * (t - i)) / h, [t + h * l, e + h * u]; } -function Kr(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / Xn(o * o + l * l), f = u * l, h = -u * o, c = t + f, v = e + h, g = n + f, m = r + h, b = (c + g) / 2, $ = (v + m) / 2, C = g - c, T = m - v, N = C * C + T * T, I = i - s, G = c * m - g * v, at = (T < 0 ? -1 : 1) * Xn(nd(0, I * I * N - G * G)), Z = (G * T - C * at) / N, et = (-G * C - T * at) / N, dt = (G * T + C * at) / N, H = (-G * C + T * at) / N, it = Z - b, A = et - $, E = dt - b, ht = H - $; - return it * it + A * A > E * E + ht * ht && (Z = dt, et = H), { - cx: Z, +function Jr(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / Kn(o * o + l * l), f = u * l, c = -u * o, h = t + f, v = e + c, g = n + f, m = r + c, b = (h + g) / 2, $ = (v + m) / 2, R = g - h, E = m - v, C = R * R + E * E, F = i - s, J = h * m - g * v, ct = (E < 0 ? -1 : 1) * Kn(sd(0, F * F * C - J * J)), B = (J * E - R * ct) / C, et = (-J * R - E * ct) / C, _t = (J * E + R * ct) / C, ht = (-J * R + E * ct) / C, U = B - b, S = et - $, I = _t - b, q = ht - $; + return U * U + S * S > I * I + q * q && (B = _t, et = ht), { + cx: B, cy: et, x01: -f, - y01: -h, - x11: Z * (i / I - 1), - y11: et * (i / I - 1) + y01: -c, + x11: B * (i / F - 1), + y11: et * (i / F - 1) }; } function Ve() { - var t = sd, e = ad, n = Ct(0), r = null, i = od, s = ld, a = ud, o = null, l = id(u); + var t = ld, e = ud, n = Nt(0), r = null, i = fd, s = cd, a = hd, o = null, l = od(u); function u() { - var f, h, c = +t.apply(this, arguments), v = +e.apply(this, arguments), g = i.apply(this, arguments) - gi, m = s.apply(this, arguments) - gi, b = ga(m - g), $ = m > g; - if (o || (o = f = l()), v < c && (h = v, v = c, c = h), !(v > St)) o.moveTo(0, 0); - else if (b > si - St) - o.moveTo(v * vn(g), v * we(g)), o.arc(0, 0, v, g, m, !$), c > St && (o.moveTo(c * vn(m), c * we(m)), o.arc(0, 0, c, m, g, $)); + var f, c, h = +t.apply(this, arguments), v = +e.apply(this, arguments), g = i.apply(this, arguments) - yi, m = s.apply(this, arguments) - yi, b = ya(m - g), $ = m > g; + if (o || (o = f = l()), v < h && (c = v, v = h, h = c), !(v > kt)) o.moveTo(0, 0); + else if (b > li - kt) + o.moveTo(v * gn(g), v * ye(g)), o.arc(0, 0, v, g, m, !$), h > kt && (o.moveTo(h * gn(m), h * ye(m)), o.arc(0, 0, h, m, g, $)); else { - var C = g, T = m, N = g, I = m, G = b, at = b, Z = a.apply(this, arguments) / 2, et = Z > St && (r ? +r.apply(this, arguments) : Xn(c * c + v * v)), dt = Ui(ga(v - c) / 2, +n.apply(this, arguments)), H = dt, it = dt, A, E; - if (et > St) { - var ht = _a(et / c * we(Z)), Me = _a(et / v * we(Z)); - (G -= ht * 2) > St ? (ht *= $ ? 1 : -1, N += ht, I -= ht) : (G = 0, N = I = (g + m) / 2), (at -= Me * 2) > St ? (Me *= $ ? 1 : -1, C += Me, T -= Me) : (at = 0, C = T = (g + m) / 2); + var R = g, E = m, C = g, F = m, J = b, ct = b, B = a.apply(this, arguments) / 2, et = B > kt && (r ? +r.apply(this, arguments) : Kn(h * h + v * v)), _t = Gi(ya(v - h) / 2, +n.apply(this, arguments)), ht = _t, U = _t, S, I; + if (et > kt) { + var q = wa(et / h * ye(B)), mt = wa(et / v * ye(B)); + (J -= q * 2) > kt ? (q *= $ ? 1 : -1, C += q, F -= q) : (J = 0, C = F = (g + m) / 2), (ct -= mt * 2) > kt ? (mt *= $ ? 1 : -1, R += mt, E -= mt) : (ct = 0, R = E = (g + m) / 2); } - var tt = v * vn(C), te = v * we(C), Pe = c * vn(I), Ht = c * we(I); - if (dt > St) { - var pe = v * vn(T), Nt = v * we(T), ve = c * vn(N), ee = c * we(N), Rt; - if (b < Pr) - if (Rt = fd(tt, te, ve, ee, pe, Nt, Pe, Ht)) { - var ln = tt - Rt[0], un = te - Rt[1], fn = pe - Rt[0], ne = Nt - Rt[1], ge = 1 / we(rd((ln * fn + un * ne) / (Xn(ln * ln + un * un) * Xn(fn * fn + ne * ne))) / 2), Ze = Xn(Rt[0] * Rt[0] + Rt[1] * Rt[1]); - H = Ui(dt, (c - Ze) / (ge - 1)), it = Ui(dt, (v - Ze) / (ge + 1)); + var Ut = v * gn(R), tt = v * ye(R), ke = h * gn(F), de = h * ye(F); + if (_t > kt) { + var ee = v * gn(E), Me = v * ye(E), Ct = h * gn(C), pe = h * ye(C), Tt; + if (b < Or) + if (Tt = dd(Ut, tt, Ct, pe, ee, Me, ke, de)) { + var ve = Ut - Tt[0], Pe = tt - Tt[1], Ze = ee - Tt[0], un = Me - Tt[1], fn = 1 / ye(ad((ve * Ze + Pe * un) / (Kn(ve * ve + Pe * Pe) * Kn(Ze * Ze + un * un))) / 2), Hn = Kn(Tt[0] * Tt[0] + Tt[1] * Tt[1]); + ht = Gi(_t, (h - Hn) / (fn - 1)), U = Gi(_t, (v - Hn) / (fn + 1)); } else - H = it = 0; + ht = U = 0; } - at > St ? it > St ? (A = Kr(ve, ee, tt, te, v, it, $), E = Kr(pe, Nt, Pe, Ht, v, it, $), o.moveTo(A.cx + A.x01, A.cy + A.y01), it < dt ? o.arc(A.cx, A.cy, it, At(A.y01, A.x01), At(E.y01, E.x01), !$) : (o.arc(A.cx, A.cy, it, At(A.y01, A.x01), At(A.y11, A.x11), !$), o.arc(0, 0, v, At(A.cy + A.y11, A.cx + A.x11), At(E.cy + E.y11, E.cx + E.x11), !$), o.arc(E.cx, E.cy, it, At(E.y11, E.x11), At(E.y01, E.x01), !$))) : (o.moveTo(tt, te), o.arc(0, 0, v, C, T, !$)) : o.moveTo(tt, te), !(c > St) || !(G > St) ? o.lineTo(Pe, Ht) : H > St ? (A = Kr(Pe, Ht, pe, Nt, c, -H, $), E = Kr(tt, te, ve, ee, c, -H, $), o.lineTo(A.cx + A.x01, A.cy + A.y01), H < dt ? o.arc(A.cx, A.cy, H, At(A.y01, A.x01), At(E.y01, E.x01), !$) : (o.arc(A.cx, A.cy, H, At(A.y01, A.x01), At(A.y11, A.x11), !$), o.arc(0, 0, c, At(A.cy + A.y11, A.cx + A.x11), At(E.cy + E.y11, E.cx + E.x11), $), o.arc(E.cx, E.cy, H, At(E.y11, E.x11), At(E.y01, E.x01), !$))) : o.arc(0, 0, c, I, N, $); + ct > kt ? U > kt ? (S = Jr(Ct, pe, Ut, tt, v, U, $), I = Jr(ee, Me, ke, de, v, U, $), o.moveTo(S.cx + S.x01, S.cy + S.y01), U < _t ? o.arc(S.cx, S.cy, U, Rt(S.y01, S.x01), Rt(I.y01, I.x01), !$) : (o.arc(S.cx, S.cy, U, Rt(S.y01, S.x01), Rt(S.y11, S.x11), !$), o.arc(0, 0, v, Rt(S.cy + S.y11, S.cx + S.x11), Rt(I.cy + I.y11, I.cx + I.x11), !$), o.arc(I.cx, I.cy, U, Rt(I.y11, I.x11), Rt(I.y01, I.x01), !$))) : (o.moveTo(Ut, tt), o.arc(0, 0, v, R, E, !$)) : o.moveTo(Ut, tt), !(h > kt) || !(J > kt) ? o.lineTo(ke, de) : ht > kt ? (S = Jr(ke, de, ee, Me, h, -ht, $), I = Jr(Ut, tt, Ct, pe, h, -ht, $), o.lineTo(S.cx + S.x01, S.cy + S.y01), ht < _t ? o.arc(S.cx, S.cy, ht, Rt(S.y01, S.x01), Rt(I.y01, I.x01), !$) : (o.arc(S.cx, S.cy, ht, Rt(S.y01, S.x01), Rt(S.y11, S.x11), !$), o.arc(0, 0, h, Rt(S.cy + S.y11, S.cx + S.x11), Rt(I.cy + I.y11, I.cx + I.x11), $), o.arc(I.cx, I.cy, ht, Rt(I.y11, I.x11), Rt(I.y01, I.x01), !$))) : o.arc(0, 0, h, F, C, $); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Pr / 2; - return [vn(h) * f, we(h) * f]; + var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, c = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Or / 2; + return [gn(c) * f, ye(c) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Ct(+f), u) : t; + return arguments.length ? (t = typeof f == "function" ? f : Nt(+f), u) : t; }, u.outerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Ct(+f), u) : e; + return arguments.length ? (e = typeof f == "function" ? f : Nt(+f), u) : e; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Ct(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Nt(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Ct(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Nt(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Ct(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Nt(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Ct(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Nt(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Ct(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Nt(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function cd(t) { +function pd(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function hd(t, e) { +function vd(t, e) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function dd(t) { +function gd(t) { return t; } -function ma() { - var t = dd, e = hd, n = null, r = Ct(0), i = Ct(si), s = Ct(0); +function xa() { + var t = gd, e = vd, n = null, r = Nt(0), i = Nt(li), s = Nt(0); function a(o) { - var l, u = (o = cd(o)).length, f, h, c = 0, v = new Array(u), g = new Array(u), m = +r.apply(this, arguments), b = Math.min(si, Math.max(-si, i.apply(this, arguments) - m)), $, C = Math.min(Math.abs(b) / u, s.apply(this, arguments)), T = C * (b < 0 ? -1 : 1), N; + var l, u = (o = pd(o)).length, f, c, h = 0, v = new Array(u), g = new Array(u), m = +r.apply(this, arguments), b = Math.min(li, Math.max(-li, i.apply(this, arguments) - m)), $, R = Math.min(Math.abs(b) / u, s.apply(this, arguments)), E = R * (b < 0 ? -1 : 1), C; for (l = 0; l < u; ++l) - (N = g[v[l] = l] = +t(o[l], l, o)) > 0 && (c += N); - for (e != null ? v.sort(function(I, G) { - return e(g[I], g[G]); - }) : n != null && v.sort(function(I, G) { - return n(o[I], o[G]); - }), l = 0, h = c ? (b - u * T) / c : 0; l < u; ++l, m = $) - f = v[l], N = g[f], $ = m + (N > 0 ? N * h : 0) + T, g[f] = { + (C = g[v[l] = l] = +t(o[l], l, o)) > 0 && (h += C); + for (e != null ? v.sort(function(F, J) { + return e(g[F], g[J]); + }) : n != null && v.sort(function(F, J) { + return n(o[F], o[J]); + }), l = 0, c = h ? (b - u * E) / h : 0; l < u; ++l, m = $) + f = v[l], C = g[f], $ = m + (C > 0 ? C * c : 0) + E, g[f] = { data: o[f], index: l, - value: N, + value: C, startAngle: m, endAngle: $, - padAngle: C + padAngle: R }; return g; } return a.value = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : Ct(+o), a) : t; + return arguments.length ? (t = typeof o == "function" ? o : Nt(+o), a) : t; }, a.sortValues = function(o) { return arguments.length ? (e = o, n = null, a) : e; }, a.sort = function(o) { return arguments.length ? (n = o, e = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Ct(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Nt(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Ct(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Nt(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Ct(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Nt(+o), a) : s; }, a; } -function Ar(t, e, n) { +function Cr(t, e, n) { this.k = t, this.x = e, this.y = n; } -Ar.prototype = { - constructor: Ar, +Cr.prototype = { + constructor: Cr, scale: function(t) { - return t === 1 ? this : new Ar(this.k * t, this.x, this.y); + return t === 1 ? this : new Cr(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new Ar(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new Cr(this.k, this.x + this.k * t, this.y + this.k * e); }, apply: function(t) { return [t[0] * this.k + this.x, t[1] * this.k + this.y]; @@ -4755,244 +4755,251 @@ Ar.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Ar.prototype; -var pd = /* @__PURE__ */ gu(''); -const vd = { +Cr.prototype; +var _d = /* @__PURE__ */ yu(''); +const md = { 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 jo(t, e) { - ms(e, !0), wo(t, vd); - let n = Et(e, "jsonData", 7), r = Et(e, "currentRound", 7, 1), i = Et(e, "mouseEventType", 15), s = Et(e, "mouseData", 15), a = Et(e, "mouseY", 15), o = Et(e, "requestRoundChange", 7, (p) => { - }), l = Et(e, "candidateColors", 23, () => []), u = Et(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1); - function f(p) { - return p.isTransfer ? `${p.label}__transfer` : p.transferIndex != null ? `${p.label}__${p.transferIndex}` : p.label; - } - const h = 800, c = 800, v = Math.min(h, c) * 0.3, g = h / 2, m = c / 2, b = "Pie", $ = "Donut", C = "TextLayer", T = "url(#cross-hatch)", N = 1.15, I = 0.1, G = 750, at = 800; - function Z(p) { - return "hatch-" + p.replace(/[^a-zA-Z0-9]/g, "-"); - } - let et = [], dt = [], H = [], it = 0, A = /* @__PURE__ */ yt( - 0 - // $state just to make it inspectable - ), E = 0; - const ht = {}, Me = "No Further Rankings"; - let tt = /* @__PURE__ */ yt(null); - function te() { - const p = gt(w(tt)); - p.select("#" + b).remove(), p.select("#" + $).remove(), p.select("#" + C).remove(); - } - function Pe(p) { - o() && (K = p, o()(p)); - } - function Ht(p) { - te(), H = pe(p), et = Zo(p, b, H, g, m, 0, Nt()); - } - bu(() => { - Mi(), setTimeout( +function Qo(t, e) { + xs(e, !0), $o(t, md); + let n = vt(e, "jsonData", 7), r = vt(e, "currentRound", 7, 1), i = vt(e, "mouseEventType", 15), s = vt(e, "mouseData", 15), a = vt(e, "mouseY", 15), o = vt(e, "requestRoundChange", 7, (d) => { + }), l = vt(e, "candidateColors", 23, () => []), u = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), f = vt(e, "firstRoundDeterminesPercentages", 7, !1), c = vt(e, "displayPhase", 15, 0); + function h(d) { + return d.isTransfer ? `${d.label}__transfer` : d.transferIndex != null ? `${d.label}__${d.transferIndex}` : d.label; + } + const v = 800, g = 800, m = Math.min(v, g) * 0.3, b = v / 2, $ = g / 2, R = "Pie", E = "Donut", C = "TextLayer", F = "url(#cross-hatch)", J = 1.15, ct = 0.1, B = 750, et = 800; + function _t(d) { + return "hatch-" + d.replace(/[^a-zA-Z0-9]/g, "-"); + } + let ht = [], U = [], S = [], I = 0, q = 0; + const mt = {}, Ut = "No Further Rankings"; + let tt = /* @__PURE__ */ xt(null); + function ke() { + const d = yt(x(tt)); + d.select("#" + R).remove(), d.select("#" + E).remove(), d.select("#" + C).remove(); + } + function de(d) { + o() && (j = d, o()(d)); + } + function ee(d) { + ke(), S = Me(d), ht = tl(d, R, S, b, $, 0, Ct()); + } + Eu(() => { + Fi(), setTimeout( () => { - Ht(r()); + ee(r()); }, 0 ); }); - function pe(p) { - const _ = zn(p); - return it = fn(p), _; + function Me(d) { + const _ = Yn(d); + return I = un(d), _; } - function Nt() { - return v; + function Ct() { + return m; } - function ve() { - return Nt() * 1.41; + function pe() { + return Ct() * 1.41; } - function ee(p) { + function Tt(d) { let _ = 0; - for (let y = 1; y < p; y++) { - const P = n().results[y - 1].tallyResults; - for (let R = 0; R < P.length; R++) { - const S = P[R].transfers; - if (S) { - const M = S.exhausted; - M && (_ += Number(M)); + for (let y = 1; y < d; y++) { + const M = n().results[y - 1].tallyResults; + for (let A = 0; A < M.length; A++) { + const T = M[A].transfers; + if (T) { + const k = T.exhausted; + k && (_ += Number(k)); } } } return _; } - function Rt(p, _) { - if (p === "exhausted") return ee(_); + function ve(d, _) { + if (d === "exhausted") return Tt(_); { const y = n().results[_ - 1].tally; - return Number(y[p]); + return Number(y[d]); } } - function ln(p, _) { - return Rt(p, _).toLocaleString("en-US"); + function Pe(d, _) { + return ve(d, _).toLocaleString("en-US"); } - function un(p, _) { - return (Rt(p, _) / it).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Ze(d, _) { + const y = f() ? I : Hn(_); + return (ve(d, _) / y).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function fn(p) { - const _ = n().results[p - 1].tally; + function un(d) { + const _ = n().results[d - 1].tally; let y = 0; - for (let [P, R] of Object.entries(_)) - y += Number(R); + for (let [M, A] of Object.entries(_)) + y += Number(A); return y; } - function ne(p, _) { - if (!p || p < 1 || p > n().results.length) + function fn(d) { + return d === "exhausted" || d === "Inactive Ballots"; + } + function Hn(d) { + const _ = n().results[d - 1].tally; + let y = 0; + for (let [M, A] of Object.entries(_)) + fn(M) || (y += Number(A)); + return y; + } + function cn(d, _) { + if (!d || d < 1 || d > n().results.length) return console.warn("In chsoenCandidates: round ${round} is out of range."), []; - if (u() && p === n().results.length) + if (u() && d === n().results.length) return []; - const y = n().results[p - 1].tallyResults, P = []; - for (let R = 0; R < y.length; R++) { - const S = y[R][_]; - S != null && P.push(S); + const y = n().results[d - 1].tallyResults, M = []; + for (let A = 0; A < y.length; A++) { + const T = y[A][_]; + T != null && M.push(T); } - return P; + return M; } - function ge(p) { - return ne(p, "eliminated"); + function hn(d) { + return cn(d, "eliminated"); } - function Ze(p) { + function gr(d) { let _ = []; - for (let y = 1; y <= p; y++) _ = _.concat(ne(y, "elected")); + for (let y = 1; y <= d; y++) _ = _.concat(cn(y, "elected")); return _; } - function ki(p, _) { + function Di(d, _) { const y = n().results[_ - 1].tallyResults; - let P = 0; - const R = y.findIndex((S) => (S == null ? void 0 : S.elected) && p == S.elected); - if (R >= 0) { - const S = y[R].transfers; - if (S) - for (let [M, F] of Object.entries(S)) P += Number(F); + let M = 0; + const A = y.findIndex((T) => (T == null ? void 0 : T.elected) && d == T.elected); + if (A >= 0) { + const T = y[A].transfers; + if (T) + for (let [k, O] of Object.entries(T)) M += Number(O); } else return 0; - return P; + return M; } - function zn(p) { + function Yn(d) { const _ = n().results; - let y = _[Math.max(0, p - 2)].tally; - const P = [], R = []; - for (let [M, F] of Object.entries(y)) - P.push({ label: M, value: 0 }); - y = _[p - 1].tally; - for (let M of P) { - const F = Number(y[M.label]), q = ki(M.label, p); - q > 0 ? (R.push({ - label: M.label, - value: q, + let y = _[Math.max(0, d - 2)].tally; + const M = [], A = []; + for (let [k, O] of Object.entries(y)) + M.push({ label: k, value: 0 }); + y = _[d - 1].tally; + for (let k of M) { + const O = Number(y[k.label]), V = Di(k.label, d); + V > 0 ? (A.push({ + label: k.label, + value: V, isTransfer: !0 - }), M.value = F - q, R.push(M)) : (M.value = F, R.push(M)); + }), k.value = O - V, A.push(k)) : (k.value = O, A.push(k)); } - const S = ee(p); - return R.push({ label: "exhausted", value: S }), R; + const T = Tt(d); + return A.push({ label: "exhausted", value: T }), A; } - function Mi() { - const p = gt(w(tt)).select("defs").select("#cross-hatch"); + function Fi() { + const d = yt(x(tt)).select("defs").select("#cross-hatch"); let _ = 0; - for (let [y, P] of Object.entries(n().results[0].tally)) { - !l() || l().length === 0 ? _ < 10 ? ht[y] = ed[_] : ht[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : ht[y] = l()[_ % l().length], _++; + for (let [y, M] of Object.entries(n().results[0].tally)) { + !l() || l().length === 0 ? _ < 10 ? mt[y] = id[_] : mt[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : mt[y] = l()[_ % l().length], _++; { - const R = p.clone(!0); - R.attr("id", Z(y)).select("rect").attr("fill", ht[y]), R.selectAll("circle").attr("fill", "#383838"); + const A = d.clone(!0); + A.attr("id", _t(y)).select("rect").attr("fill", mt[y]), A.selectAll("circle").attr("fill", "#383838"); } } - ht.exhausted = T, ht["Inactive Ballots"] = T; + mt.exhausted = F, mt["Inactive Ballots"] = F; } - function x() { - gt(w(tt)).select("#" + $).remove(); + function w() { + yt(x(tt)).select("#" + E).remove(); } - function B(p, _) { - const y = ii("global").duration(at); - _ && y.on("end", _), x(), Fe(p), Jo(), tl(0, Nt()), Hr(); + function X(d, _) { + const y = oi("global").duration(et); + _ && y.on("end", _), w(), Fe(d), el(), rl(0, Ct()), Ur(); } - function nt(p, _) { - const y = ii("global").duration(at); - _ && y.on("end", _), Oe(p); + function nt(d, _) { + const y = oi("global").duration(et); + _ && y.on("end", _), Oe(d); } - function ot(p, _) { - const y = ii("global").duration(at); - _ && y.on("end", _), Hn(p), Yn(Nt()); + function st(d, _) { + const y = oi("global").duration(et); + _ && y.on("end", _), Bn(d), Un(Ct()); } - let J = !1, rt = []; - function $t() { - Hr(), J = !1, Je(); + let Q = !1, rt = []; + function Et() { + Ur(), Q = !1, Je(); } function Je() { if (rt.length === 0) { - K !== r() && (r() === K + 1 && K > 0 && r() <= n().results.length ? (K = r(), re(r())) : r() >= 1 && r() <= n().results.length && (K = r(), Q(A, 0), Ht(r()))); + j !== r() && (r() === j + 1 && j > 0 && r() <= n().results.length ? (j = r(), ne(r())) : r() >= 1 && r() <= n().results.length && (j = r(), c(0), ee(r()))); return; } - const p = rt.shift(); - switch (p.type) { + const d = rt.shift(); + switch (d.type) { case "round": { - const _ = p.round; - _ === K + 1 && K > 0 && _ <= n().results.length ? (K = _, re(_)) : (_ !== K && _ >= 1 && _ <= n().results.length && (K = _, Q(A, 0), Ht(_)), Je()); + const _ = d.round; + _ === j + 1 && j > 0 && _ <= n().results.length ? (j = _, ne(_)) : (_ !== j && _ >= 1 && _ <= n().results.length && (j = _, c(0), ee(_)), Je()); break; } case "step": - hn(); + pn(); break; } } - function re(p) { - if (p <= 1 || p > n().results.length) { + function ne(d) { + if (d <= 1 || d > n().results.length) { Je(); return; } - J = !0, E = p, Q(A, 0), B(E - 1, () => { - nt(E - 1, () => { - ot(E, $t); + Q = !0, q = d, c(0), X(q - 1, () => { + nt(q - 1, () => { + st(q, Et); }); }); } - function cn() { - J || (J = !0, E = r(), De()); + function dn() { + Q || (Q = !0, q = r(), De()); } function De() { - if (Q( - A, + if (c( 0 // if in the middle of "one small step" animation, reset to 0. ), rt.length > 0) { - $t(); + Et(); return; } - const p = E < n().results.length - 1 ? De : $t; - B(E, () => { - nt(E, () => { - E++, Pe(E), ot(E, p); + const d = q < n().results.length - 1 ? De : Et; + X(q, () => { + nt(q, () => { + q++, de(q), st(q, d); }); }); } - As(() => { - _e(); + Cs(() => { + ge(); }); - let K = 0; - function _e() { - if (K != r()) { - if (J) { + let j = 0; + function ge() { + if (j != r()) { + if (Q) { rt.push({ type: "round", round: r() }); return; } - K == r() - 1 && K > 0 ? Qe() : Yt(r()), K = r(); + j == r() - 1 && j > 0 ? Qe() : Wt(r()), j = r(); } } - function Yt(p) { - if (J) { - rt.push({ type: "round", round: p }); + function Wt(d) { + if (Q) { + rt.push({ type: "round", round: d }); return; } - Q(A, 0), Ht(p); + c(0), ee(d); } function Qe() { - if (J) { + if (Q) { rt.push({ type: "round", round: r() }); return; } @@ -5000,303 +5007,318 @@ function jo(t, e) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (E = r(), E > n().results.length) { - Hr(), J = !1; + if (q = r(), q > n().results.length) { + Ur(), Q = !1; return; } - J = !0, w(A) === 0 ? B(E - 1, () => { - nt(E - 1, () => { - ot(E, $t); + Q = !0, c() === 0 ? X(q - 1, () => { + nt(q - 1, () => { + st(q, Et); }); - }) : w(A) === 1 ? nt(E - 1, () => { - ot(E, $t); - }) : w(A) === 2 && ot(E, $t), Q(A, 0); + }) : c() === 1 ? nt(q - 1, () => { + st(q, Et); + }) : c() === 2 && st(q, Et), c(0); } - function hn() { + function pn() { if (r() > n().results.length) { - Hr(), J = !1; + Ur(), Q = !1; return; } - if (J) { + if (Q) { rt.push({ type: "step" }); return; } - J = !0, Q(A, (w(A) + 1) % 3), E = r(), w(A) === 1 ? B(E, $t) : w(A) === 2 ? nt(E, $t) : w(A) === 0 ? (E++, Pe(E), ot(E, $t)) : (J = !1, console.warn("displayPhase out of range at ", w(A))); + Q = !0, c((c() + 1) % 3), q = r(), c() === 1 ? X(q, Et) : c() === 2 ? nt(q, Et) : c() === 0 ? (q++, de(q), st(q, Et)) : (Q = !1, console.warn("displayPhase out of range at ", c())); } - function Hn(p) { - H = zn(p), et = el(p, b, H, 0, Nt(), !0); + function Bn(d) { + S = Yn(d), ht = il(d, R, S, 0, Ct(), !0); } - function Yn(p, _) { - const y = gt(w(tt)).select("#" + $), P = Ve().outerRadius(p).innerRadius(p - 1), R = y.selectAll(".slice"); - let S = R.size(); - function M() { - S--, S === 0 && Qo(); + function Un(d, _) { + const y = yt(x(tt)).select("#" + E), M = Ve().outerRadius(d).innerRadius(d - 1), A = y.selectAll(".slice"); + let T = A.size(); + function k() { + T--, T === 0 && nl(); } - R.select("path").transition("global").duration(G).attr("d", (F) => P(F)).on("end", (F) => M()); + A.select("path").transition("global").duration(B).attr("d", (O) => M(O)).on("end", (O) => k()); } - function Fe(p) { - const _ = vr(p, et); - dt = Is(p, $, _, g, m, Nt(), ve(), !1, !0); + function Fe(d) { + const _ = mr(d, ht); + U = Vs(d, E, _, b, $, Ct(), pe(), !1, !0); } - function Oe(p) { - const _ = Le(p, dt, et); - dt = Ls(p, $, _, Nt(), ve(), !1); + function Oe(d) { + const _ = Le(d, U, ht); + U = zs(d, E, _, Ct(), pe(), !1); } - function Ie(p) { - return ht[p.data.label]; + function Ie(d) { + return mt[d.data.label]; } - function pr(p) { - const _ = {}, y = n().results[p - 1].tallyResults; - for (let P = 0; P < y.length; P++) { - let R = y[P].eliminated; - if (R === void 0 && (R = y[P].elected), R === void 0) { + function _r(d) { + const _ = {}, y = n().results[d - 1].tallyResults; + for (let M = 0; M < y.length; M++) { + let A = y[M].eliminated; + if (A === void 0 && (A = y[M].elected), A === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const S = y[P].transfers; - if (S === void 0) { + const T = y[M].transfers; + if (T === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [M, F] of Object.entries(S)) - _[M] === void 0 ? _[M] = Number(F) : _[M] += Number(F); + for (let [k, O] of Object.entries(T)) + _[k] === void 0 ? _[k] = Number(O) : _[k] += Number(O); } return _; } - function vr(p, _) { - const y = [], P = it, R = n().results[p - 1].tallyResults; - for (let S = 0; S < R.length; S++) { - let M = R[S].eliminated; - if (M === void 0 && (M = R[S].elected), M === void 0) { + function mr(d, _) { + const y = [], M = I, A = n().results[d - 1].tallyResults; + for (let T = 0; T < A.length; T++) { + let k = A[T].eliminated; + if (k === void 0 && (k = A[T].elected), k === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const F = R[S].transfers; - if (F === void 0) { + const O = A[T].transfers; + if (O === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let q = _.find((O) => O.data.label == M && O.data.isTransfer); - q === void 0 && (q = _.find((O) => O.data.label == M && !O.data.isTransfer)); - let U = 0; - if (q) U = q.startAngle; + let V = _.find((D) => D.data.label == k && D.data.isTransfer); + V === void 0 && (V = _.find((D) => D.data.label == k && !D.data.isTransfer)); + let G = 0; + if (V) G = V.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [O, W] of Object.entries(F)) { - let st; - const ye = _.find((ft) => ft.data.label == O); - if (ye) - st = structuredClone(ye); - else if (O == "exhausted") - st = { - data: { label: O, value: Number(W) }, + for (let [D, Y] of Object.entries(O)) { + let it; + const me = _.find((lt) => lt.data.label == D); + if (me) + it = structuredClone(me); + else if (D == "exhausted") + it = { + data: { label: D, value: Number(Y) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (O == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", W); + else if (D == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", Y); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", O); + console.warn("makeDonutInfo: unrecognized name in transfers ", D); continue; } - const k = Number(W) / P * 2 * Math.PI; - st.startAngle = U, U = st.endAngle = U + k, st.index = S, st.data.transferIndex = S, y.push(st); + const N = Number(Y) / M * 2 * Math.PI; + it.startAngle = G, G = it.endAngle = G + N, it.index = T, it.data.transferIndex = T, y.push(it); } } return y; } - function gr(p, _, y) { - const P = {}; - for (let [R, S] of Object.entries(p)) { - const M = y.find((U) => R == U.data.label); - if (M === void 0) { - console.warn("getTransferStartAngles: mainPieObj not found for ", R); + function yr(d, _, y) { + const M = {}; + for (let [A, T] of Object.entries(d)) { + const k = y.find((G) => A == G.data.label); + if (k === void 0) { + console.warn("getTransferStartAngles: mainPieObj not found for ", A); continue; } - const F = (M.startAngle + M.endAngle) / 2, q = p[M.data.label] / _ * 2 * Math.PI; - P[M.data.label] = F - q / 2; + const O = (k.startAngle + k.endAngle) / 2, V = d[k.data.label] / _ * 2 * Math.PI; + M[k.data.label] = O - V / 2; } - return P; - } - function Le(p, _, y) { - const P = [], R = it, S = pr(p), M = gr(S, R, y); - for (let [F, q] of _.entries()) { - const U = structuredClone(q), O = q.endAngle - q.startAngle, W = y.find((st) => q.data.label === st.data.label && !st.data.isTransfer); - if (W) { - const st = W.data.label; - U.startAngle = M[st], M[st] += O, U.endAngle = U.startAngle + O; - } else if (q.data.label === "exhausted") - U.startAngle = q.startAngle, U.endAngle = q.endAngle; + return M; + } + function Le(d, _, y) { + const M = [], A = I, T = _r(d), k = yr(T, A, y); + for (let [O, V] of _.entries()) { + const G = structuredClone(V), D = V.endAngle - V.startAngle, Y = y.find((it) => V.data.label === it.data.label && !it.data.isTransfer); + if (Y) { + const it = Y.data.label; + G.startAngle = k[it], k[it] += D, G.endAngle = G.startAngle + D; + } else if (V.data.label === "exhausted") + G.startAngle = V.startAngle, G.endAngle = V.endAngle; else { - console.warn("updateDonutInfo: unrecognized slice name ", q.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", V.data.label); continue; } - U.index = F, P.push(U); + G.index = O, M.push(G); } - return P; - } - function me(p, _, y, P, R, S) { - const F = gt(w(tt)).append("g").attr("id", C).attr("transform", `translate(${y}, ${P})`), q = Ve().innerRadius(R * N).outerRadius(R * N); - F.selectAll("text").data(_).enter().each(function(U) { - U.endAngle - U.startAngle < I || U.data.isTransfer || gt(this).append("g").attr("id", (O) => f(O.data)).classed("eliminated", (O) => S.includes(O.data.label) || O.data.isTransfer === !0).each(function(O, W) { - O.data.label === "exhausted" && gt(this).on("mouseenter", (st, ye) => nl(st)).on("mouseleave", (st, ye) => rl()); - }).append("text").attr("transform", (O) => `translate(${q.centroid(O)})`).attr("text-anchor", (O) => Di(O.startAngle, O.endAngle)).text((O) => O.data.label === "exhausted" ? Me : O.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((O) => ln(O.data.label, p) + " (" + un(O.data.label, p) + ")"); + return M; + } + function _e(d, _, y, M, A, T) { + const O = yt(x(tt)).append("g").attr("id", C).attr("transform", `translate(${y}, ${M})`), V = Ve().innerRadius(A * J).outerRadius(A * J); + O.selectAll("text").data(_).enter().each(function(G) { + G.endAngle - G.startAngle < ct || G.data.isTransfer || yt(this).append("g").attr("id", (D) => h(D.data)).classed("eliminated", (D) => T.includes(D.data.label) || D.data.isTransfer === !0).each(function(D, Y) { + D.data.label === "exhausted" && yt(this).on("mouseenter", (it, me) => sl(it)).on("mouseleave", (it, me) => al()); + }).append("text").attr("transform", (D) => `translate(${V.centroid(D)})`).attr("text-anchor", (D) => Ii(D.startAngle, D.endAngle)).text((D) => D.data.label === "exhausted" ? Ut : D.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((D) => { + const Y = Pe(D.data.label, d); + return !f() && fn(D.data.label) ? Y : Y + " (" + Ze(D.data.label, d) + ")"; + }); }); } - function Pi(p, _, y, P) { - const S = gt(w(tt)).select("#" + C), M = S.selectAll("tspan"), F = S.selectAll("g").data(_, (W) => f(W.data)).classed("eliminated", (W) => P.includes(W.data.label) || W.data.isTransfer === !0), q = Ve().innerRadius(y * N).outerRadius(y * N + 1); - M.transition("global").duration(G).attr("transform", (W) => `translate(${q.centroid(W)})`).attr("text-anchor", (W) => Di(W.startAngle, W.endAngle)), F.select("text").transition("global").duration(G).attr("transform", (W) => `translate(${q.centroid(W)})`).attr("text-anchor", (W) => Di(W.startAngle, W.endAngle)).on("end", (W) => O()); - let U = F.size(); - function O(W) { - U--, U === 0 && (S.remove(), me(p, _, g, m, y, P)); + function Oi(d, _, y, M) { + const T = yt(x(tt)).select("#" + C), k = T.selectAll("tspan"), O = T.selectAll("g").data(_, (Y) => h(Y.data)).classed("eliminated", (Y) => M.includes(Y.data.label) || Y.data.isTransfer === !0), V = Ve().innerRadius(y * J).outerRadius(y * J + 1); + k.transition("global").duration(B).attr("transform", (Y) => `translate(${V.centroid(Y)})`).attr("text-anchor", (Y) => Ii(Y.startAngle, Y.endAngle)), O.select("text").transition("global").duration(B).attr("transform", (Y) => `translate(${V.centroid(Y)})`).attr("text-anchor", (Y) => Ii(Y.startAngle, Y.endAngle)).on("end", (Y) => D()); + let G = O.size(); + function D(Y) { + G--, G === 0 && (T.remove(), _e(d, _, b, $, y, M)); } } - function Zo(p, _, y, P, R, S, M, F = !0, q = !1) { - const O = ma().sort(null).value((W) => W.value)(y); - return Is(p, _, O, P, R, S, M, F, q), O; + function tl(d, _, y, M, A, T, k, O = !0, V = !1) { + const D = xa().sort(null).value((Y) => Y.value)(y); + return Vs(d, _, D, M, A, T, k, O, V), D; } - function Hr() { - gt(w(tt)).select("#" + b).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); + function Ur() { + yt(x(tt)).select("#" + R).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); } - function Is(p, _, y, P, R, S, M, F, q) { - const U = ge(p), O = Ze(p), ye = gt(w(tt)).attr("viewBox", `0 0 ${h} ${c}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${P}, ${R})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (k) => U.includes(k.data.label) || k.data.isTransfer === !0).classed("elected", (k) => O.includes(k.data.label) && !k.data.isTransfer).attr("id", (k) => f(k.data)).on("mouseenter", (k, ft) => Oi(k, ft)).on("mouseleave", (k, ft) => Ii(k, ft)), _r = Ve().outerRadius(M).innerRadius(S); - if (q) { - const k = Ve().outerRadius(S + 1).innerRadius(S); - ye.append("path").attr("d", k).transition("global").duration(G).attr("d", (ft) => _r(ft)).attr("fill", (ft) => Ie(ft)).on("end", (ft) => Fi()); + function Vs(d, _, y, M, A, T, k, O, V) { + const G = hn(d), D = gr(d), me = yt(x(tt)).attr("viewBox", `0 0 ${v} ${g}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${M}, ${A})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (N) => G.includes(N.data.label) || N.data.isTransfer === !0).classed("elected", (N) => D.includes(N.data.label) && !N.data.isTransfer).attr("id", (N) => h(N.data)).on("mouseenter", (N, lt) => qi(N, lt)).on("mouseleave", (N, lt) => Vi(N, lt)), wr = Ve().outerRadius(k).innerRadius(T); + if (V) { + const N = Ve().outerRadius(T + 1).innerRadius(T); + me.append("path").attr("d", N).transition("global").duration(B).attr("d", (lt) => wr(lt)).attr("fill", (lt) => Ie(lt)).on("end", (lt) => Li()); } else - ye.append("path").attr("d", (k) => _r(k)).attr("fill", (k) => Ie(k)), Fi(); - return F && me(p, y, P, R, M, U), y; + me.append("path").attr("d", (N) => wr(N)).attr("fill", (N) => Ie(N)), Li(); + return O && _e(d, y, M, A, k, G), y; } - function Jo() { - const y = gt(w(tt)).select("#" + C).selectAll(".eliminated"); + function el() { + const y = yt(x(tt)).select("#" + C).selectAll(".eliminated"); y.size() > 0 && y.classed("finished", !0); } - function Qo() { - const y = gt(w(tt)).select("#" + C).selectAll(".finished"); + function nl() { + const y = yt(x(tt)).select("#" + C).selectAll(".finished"); y.size() > 0 && y.remove(); } - function tl(p, _) { - const R = gt(w(tt)).select("#" + b).selectAll(".eliminated"), S = Ve().innerRadius(p), M = Ve().outerRadius(_); - R.classed("finished", !0).select("path").transition("global").duration(G).attrTween("d", function(F) { - const q = Wn(_, p); - return function(U) { - return M.innerRadius(q(U)), M(F); + function rl(d, _) { + const A = yt(x(tt)).select("#" + R).selectAll(".eliminated"), T = Ve().innerRadius(d), k = Ve().outerRadius(_); + A.classed("finished", !0).select("path").transition("global").duration(B).attrTween("d", function(O) { + const V = Gn(_, d); + return function(G) { + return k.innerRadius(V(G)), k(O); }; - }).attr("fill", (F) => `url(#${Z(F.data.label)})`), R.clone(!0).classed("finished", !0).select("path").transition("global").duration(G).attrTween("d", function(F) { - const q = Wn(_, p); - return function(U) { - return S.outerRadius(q(U)), S(F); + }).attr("fill", (O) => `url(#${_t(O.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(B).attrTween("d", function(O) { + const V = Gn(_, d); + return function(G) { + return T.outerRadius(V(G)), T(O); }; - }).attr("fill", (F) => Ie(F)); + }).attr("fill", (O) => Ie(O)); } - function Di(p, _) { - const y = (p + _) / 2; + function Ii(d, _) { + const y = (d + _) / 2; return y > Math.PI * 11 / 6 || y < Math.PI * 1 / 6 || y > Math.PI * 5 / 6 && y < Math.PI * 7 / 6 ? "middle" : y < Math.PI ? "start" : "end"; } - function Fi() { - gt(w( + function Li() { + yt(x( tt // force redisplay of text labels )).select("#" + C).raise().append("g").remove(); } - function el(p, _, y, P, R, S) { - const F = ma().sort(null).value((q) => q.value)(y); - return Ls(p, _, F, P, R, S), F; - } - function Ls(p, _, y, P, R, S) { - const M = ge(p), F = Ze(p), q = Ve().outerRadius(R).innerRadius(P).startAngle((k) => k.startAngle).endAngle((k) => k.endAngle), U = Ve().outerRadius(R).innerRadius(P), W = gt(w(tt)).select("#" + _); - W.selectAll(".slice").attr("prevStart", (k) => k.startAngle).attr("prevEnd", (k) => k.endAngle); - const st = W.selectAll(".slice").data(y, (k) => f(k.data)); - st.enter().append("g").attr("class", "slice").attr("id", (k) => f(k.data)).classed("eliminated", !0).on("mouseenter", (k, ft) => Oi(k, ft)).on("mouseleave", (k, ft) => Ii(k, ft)).append("path").attr("d", (k) => U(k)).attr("fill", (k) => Ie(k)), st.classed("eliminated", (k) => M.includes(k.data.label)).classed("elected", (k) => F.includes(k.data.label)).on("mouseenter", (k, ft) => Oi(k, ft)).on("mouseleave", (k, ft) => Ii(k, ft)); - let ye = st.size(); - function _r() { - ye--, ye <= 0 && (Fi(), W.selectAll(".finished").remove()); + function il(d, _, y, M, A, T) { + const O = xa().sort(null).value((V) => V.value)(y); + return zs(d, _, O, M, A, T), O; + } + function zs(d, _, y, M, A, T) { + const k = hn(d), O = gr(d), V = Ve().outerRadius(A).innerRadius(M).startAngle((N) => N.startAngle).endAngle((N) => N.endAngle), G = Ve().outerRadius(A).innerRadius(M), Y = yt(x(tt)).select("#" + _); + Y.selectAll(".slice").attr("prevStart", (N) => N.startAngle).attr("prevEnd", (N) => N.endAngle); + const it = Y.selectAll(".slice").data(y, (N) => h(N.data)); + it.enter().append("g").attr("class", "slice").attr("id", (N) => h(N.data)).classed("eliminated", !0).on("mouseenter", (N, lt) => qi(N, lt)).on("mouseleave", (N, lt) => Vi(N, lt)).append("path").attr("d", (N) => G(N)).attr("fill", (N) => Ie(N)), it.classed("eliminated", (N) => k.includes(N.data.label)).classed("elected", (N) => O.includes(N.data.label)).on("mouseenter", (N, lt) => qi(N, lt)).on("mouseleave", (N, lt) => Vi(N, lt)); + let me = it.size(); + function wr() { + me--, me <= 0 && (Li(), Y.selectAll(".finished").remove()); } - return st.select("path").transition("global").duration(G).attrTween("d", function(k) { - const ft = Number(gt(this.parentNode).attr("prevStart")), sl = Number(gt(this.parentNode).attr("prevEnd")), al = Wn(ft, k.startAngle), ol = Wn(sl, k.endAngle); - return (Vs) => (q.startAngle(al(Vs)).endAngle(ol(Vs)), q(k)); - }).on("end", _r), S && Pi(p, y, R, M), y; + return it.select("path").transition("global").duration(B).attrTween("d", function(N) { + const lt = Number(yt(this.parentNode).attr("prevStart")), ll = Number(yt(this.parentNode).attr("prevEnd")), ul = Gn(lt, N.startAngle), fl = Gn(ll, N.endAngle); + return (Ys) => (V.startAngle(ul(Ys)).endAngle(fl(Ys)), V(N)); + }).on("end", wr), T && Oi(d, y, A, k), y; } - function Oi(p, _) { - s(_.data.label), i("enter"), a(p.clientY); + function qi(d, _) { + s(_.data.label), i("enter"), a(d.clientY); } - function Ii(p, _) { + function Vi(d, _) { s(_.data.label), i("leave"); } - function nl(p, _) { - i("show-exhausted"), a(p.clientY); + function sl(d, _) { + i("show-exhausted"), a(d.clientY); } - function rl(p, _) { + function al(d, _) { i("hide-exhausted"); } - var il = { - pieColors: ht, - exhaustedLabel: Me, - countExhaustedVotes: ee, - getEliminatedCandidates: ge, - getElectedCandidates: Ze, - runFullAnimationFn: cn, - animateOnePhaseFn: hn, + var ol = { + pieColors: mt, + exhaustedLabel: Ut, + countExhaustedVotes: Tt, + getEliminatedCandidates: hn, + getElectedCandidates: gr, + runFullAnimationFn: dn, + animateOnePhaseFn: pn, get jsonData() { return n(); }, - set jsonData(p) { - n(p), mt(); + set jsonData(d) { + n(d), dt(); }, get currentRound() { return r(); }, - set currentRound(p = 1) { - r(p), mt(); + set currentRound(d = 1) { + r(d), dt(); }, get mouseEventType() { return i(); }, - set mouseEventType(p) { - i(p), mt(); + set mouseEventType(d) { + i(d), dt(); }, get mouseData() { return s(); }, - set mouseData(p) { - s(p), mt(); + set mouseData(d) { + s(d), dt(); }, get mouseY() { return a(); }, - set mouseY(p) { - a(p), mt(); + set mouseY(d) { + a(d), dt(); }, get requestRoundChange() { return o(); }, - set requestRoundChange(p = (_) => { + set requestRoundChange(d = (_) => { }) { - o(p), mt(); + o(d), dt(); }, get candidateColors() { return l(); }, - set candidateColors(p = []) { - l(p), mt(); + set candidateColors(d = []) { + l(d), dt(); }, get excludeFinalWinnerAndEliminatedCandidate() { return u(); }, - set excludeFinalWinnerAndEliminatedCandidate(p = !1) { - u(p), mt(); + set excludeFinalWinnerAndEliminatedCandidate(d = !1) { + u(d), dt(); + }, + get firstRoundDeterminesPercentages() { + return f(); + }, + set firstRoundDeterminesPercentages(d = !1) { + f(d), dt(); + }, + get displayPhase() { + return c(); + }, + set displayPhase(d = 0) { + c(d), dt(); } - }, qs = pd(); - return Qr(qs, (p) => Q(tt, p), () => w(tt)), ae(t, qs), ys(il); + }, Hs = _d(); + return ni(Hs, (d) => ut(tt, d), () => x(tt)), se(t, Hs), bs(ol); } -bo( - jo, +Eo( + Qo, { jsonData: {}, currentRound: {}, @@ -5305,7 +5327,9 @@ bo( mouseY: {}, requestRoundChange: {}, candidateColors: {}, - excludeFinalWinnerAndEliminatedCandidate: {} + excludeFinalWinnerAndEliminatedCandidate: {}, + firstRoundDeterminesPercentages: {}, + displayPhase: {} }, [], [ @@ -5319,10 +5343,10 @@ bo( ], { mode: "open" } ); -var gd = /* @__PURE__ */ Vn(" ", 1), _d = /* @__PURE__ */ Vn("About to eliminate: ", 1), md = /* @__PURE__ */ Vn(" ", 1), yd = /* @__PURE__ */ Vn(" ", 1), wd = /* @__PURE__ */ Vn('

', 1), xd = /* @__PURE__ */ Vn("
", 1), bd = /* @__PURE__ */ Vn('


these ballots have already been eliminated.
', 1); -const $d = { +var yd = /* @__PURE__ */ zn(" ", 1), wd = /* @__PURE__ */ zn("About to eliminate: ", 1), xd = /* @__PURE__ */ zn(" ", 1), bd = /* @__PURE__ */ zn(" ", 1), $d = /* @__PURE__ */ zn('

', 1), Ad = /* @__PURE__ */ zn("
", 1), Ed = /* @__PURE__ */ zn('


these ballots have already been eliminated.
', 1); +const Rd = { 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;text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;left:50%;transform:translate(-50%);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 { + 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;text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;left:50%;transform:translate(-50%);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;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl) {background-color:#4747ff;color:#fff;padding:1px 7px;font-size:0.67rem;min-width:107px;border:none;border-radius:3px;cursor:pointer;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl):hover {background-color:#4747c2;}.pie-chart-container.svelte-1r6y5gl { /* width: 90%; */ /* min-width: 800px; /* Larger minimum size */width:100%; /* Change from 90% to 100% */min-width:auto; /* Remove the 800px minimum */flex-grow:0; /* Don't grow beyond specified width */margin:0 auto;margin-right:40px; /* Add extra space on right */margin-top:-3vh;}.visualizations-container.svelte-1r6y5gl {display:flex;justify-content:space-between;width:100%;padding:0 20px; /* gap: 80px; */gap:20px; /* Reduce from 80px */} @@ -5364,12 +5388,12 @@ const $d = { }` }; -function Ad(t, e) { - ms(e, !0), wo(t, $d); +function Cd(t, e) { + xs(e, !0), $o(t, Rd); const n = 0.85; - let r = Et(e, "electionSummary", 7), i = Et(e, "currentRound", 7, 1), s = Et(e, "requestRoundChange", 7, (x) => { - }), a = Et(e, "candidateColors", 23, () => []), o = Et(e, "textForWinner", 7, "elected"), l = Et(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = Et(e, "firstRoundDeterminesPercentages", 7, !0), f = Et(e, "showCaptions", 7, !1); - const h = { + let r = vt(e, "electionSummary", 7), i = vt(e, "currentRound", 7, 1), s = vt(e, "requestRoundChange", 7, (w) => { + }), a = vt(e, "candidateColors", 23, () => []), o = vt(e, "textForWinner", 7, "elected"), l = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = vt(e, "firstRoundDeterminesPercentages", 7, !1), f = vt(e, "showCaptions", 7, !1); + const c = { elected: { caption: "Elected", event: "was elected", @@ -5387,284 +5411,296 @@ function Ad(t, e) { infinitive: "to take the lead" } }; - let c = /* @__PURE__ */ Bn(() => h[o()] ?? h.elected), v = /* @__PURE__ */ yt(null), g = /* @__PURE__ */ yt(null), m = /* @__PURE__ */ yt(""), b = /* @__PURE__ */ yt(yn([])), $ = /* @__PURE__ */ yt(""), C = /* @__PURE__ */ yt(""), T = /* @__PURE__ */ yt(0), N = /* @__PURE__ */ Bn(() => I(r())); - function I(x) { - if (typeof x == "string") + let h = /* @__PURE__ */ Wn(() => c[o()] ?? c.elected), v = /* @__PURE__ */ xt(null), g = /* @__PURE__ */ xt(null), m = /* @__PURE__ */ xt(""), b = /* @__PURE__ */ xt(wn([])), $ = /* @__PURE__ */ xt(""), R = /* @__PURE__ */ xt(""), E = /* @__PURE__ */ xt(0), C = /* @__PURE__ */ Wn(() => F(r())); + function F(w) { + if (typeof w == "string") try { - x = JSON.parse(x); - } catch (B) { - return console.error("Failed to parse JSON string:", B), {}; + w = JSON.parse(w); + } catch (X) { + return console.error("Failed to parse JSON string:", X), {}; } - return x || {}; + return w || {}; } - function G(x) { - s() ? s()(x) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); + function J(w) { + s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function at() { - switch (w($)) { + function ct() { + switch (x($)) { case "enter": - ((x) => { - var B = El(x, 2); - Q(b, B[0], !0), Q(m, B[1], !0); - })(et(w(C), i())), w(v) && (w(v).style.top = String((w(T) || 0) + 20) + "px", w(v).style.opacity = String(n)); + ((w) => { + var X = Tl(w, 2); + ut(b, X[0], !0), ut(m, X[1], !0); + })(et(x(R), i())), x(v) && (x(v).style.top = String((x(E) || 0) + 20) + "px", x(v).style.opacity = String(n)); break; case "leave": - w(v) && (w(v).style.opacity = "0"), Q(b, [], !0), Q(m, ""); + x(v) && (x(v).style.opacity = "0"), ut(b, [], !0), ut(m, ""); break; case "show-exhausted": - w(g) && (w(g).style.top = String((w(T) || 0) + 20) + "px", w(g).style.opacity = String(n)); + x(g) && (x(g).style.top = String((x(E) || 0) + 20) + "px", x(g).style.opacity = String(n)); break; case "hide-exhausted": - w(g) && (w(g).style.opacity = "0"); + x(g) && (x(g).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", w($)); + console.log("Unknown mouse event: ", x($)); break; } } - As(() => at()); - function Z(x, B) { - return x == 1 ? B ? "vote was" : "vote will be" : B ? "votes were" : "votes will be"; - } - function et(x, B) { - const nt = [], ot = x === "exhausted" ? tt() : x; - let J; - x == "exhausted" ? J = ht(1) : J = w(N).results[0].tally[x], nt.push(`${ot} started with ${J} votes.`); - for (let rt = 1; rt <= B; rt++) { - rt === B && (x == "exhausted" ? J = ht(B) : J = w(N).results[B - 1].tally[x], nt.push(`${ot} has ${J} votes at round ${B}.`)); - const $t = w(N).results[rt - 1].tallyResults, Je = it(rt); - for (let re = 0; re < $t.length; re++) { - const cn = $t[re].transfers, De = $t[re].eliminated, K = $t[re].elected; + Cs(() => ct()); + function B(w, X) { + return w == 1 ? X ? "vote was" : "vote will be" : X ? "votes were" : "votes will be"; + } + function et(w, X) { + const nt = [], st = w === "exhausted" ? ke() : w; + let Q; + w == "exhausted" ? Q = Ut(1) : Q = x(C).results[0].tally[w], nt.push(`${st} started with ${Q} votes.`); + for (let rt = 1; rt <= X; rt++) { + rt === X && (w == "exhausted" ? Q = Ut(X) : Q = x(C).results[X - 1].tally[w], nt.push(`${st} has ${Q} votes at round ${X}.`)); + const Et = x(C).results[rt - 1].tallyResults, Je = I(rt); + for (let ne = 0; ne < Et.length; ne++) { + const dn = Et[ne].transfers, De = Et[ne].eliminated, j = Et[ne].elected; if (!Je) { if (De) - De === x && nt.push(`${ot} will be eliminated on round ${rt}.`); - else if (x === K && (nt.push(`${ot} ${w(c).event} on round ${rt}.`), cn)) - for (let [Yt, Qe] of Object.entries(cn)) - nt.push(`${Qe} ${Z(Number(Qe), rt < B)} transferred to ${Yt} on round ${rt}.`); + De === w && nt.push(`${st} will be eliminated on round ${rt}.`); + else if (w === j && (nt.push(`${st} ${x(h).event} on round ${rt}.`), dn)) + for (let [Wt, Qe] of Object.entries(dn)) + nt.push(`${Qe} ${B(Number(Qe), rt < X)} transferred to ${Wt} on round ${rt}.`); } - const _e = De || K; - if (_e) { - const Yt = Number(cn[x]); - Yt && nt.push(`${Yt} ${Z(Yt, rt < B)} transferred from ${_e} on round ${rt}.`); + const ge = De || j; + if (ge) { + const Wt = Number(dn[w]); + Wt && nt.push(`${Wt} ${B(Wt, rt < X)} transferred from ${ge} on round ${rt}.`); } } } - return [nt, ot]; - } - function dt() { - let x = 0; - for (let B = 1; B <= w(N).results.length; B++) { - if (it(B)) continue; - const nt = w(N).results[B - 1].tallyResults; - for (let ot = 0; ot < nt.length; ot++) - nt[ot].elected && x++; + return [nt, st]; + } + function _t() { + let w = 0; + for (let X = 1; X <= x(C).results.length; X++) { + if (I(X)) continue; + const nt = x(C).results[X - 1].tallyResults; + for (let st = 0; st < nt.length; st++) + nt[st].elected && w++; } - return x; + return w; } - let H; - function it(x) { - return l() && w(N).results && x === w(N).results.length; + const ht = ["Eliminate", "Transfer", "Consolidate"]; + let U, S = /* @__PURE__ */ xt(0); + function I(w) { + return l() && x(C).results && w === x(C).results.length; } - function A(x) { - return it(x) ? [] : H ? H.getEliminatedCandidates(x) : []; + function q(w) { + return I(w) ? [] : U ? U.getEliminatedCandidates(w) : []; } - function E(x) { - return it(x) ? [] : H ? H.getElectedCandidates(x) : []; + function mt(w) { + return I(w) ? [] : U ? U.getElectedCandidates(w) : []; } - function ht(x) { - return H ? H.countExhaustedVotes(x) : 0; - } - function Me() { - H && H.animateOnePhaseFn && H.animateOnePhaseFn(); + function Ut(w) { + return U ? U.countExhaustedVotes(w) : 0; } function tt() { - return H ? H.exhaustedLabel : ""; + U && U.animateOnePhaseFn && U.animateOnePhaseFn(); + } + function ke() { + return U ? U.exhaustedLabel : ""; } - function te() { - return H ? H.pieColors : {}; + function de() { + return U ? U.pieColors : {}; } - var Pe = { + var ee = { get electionSummary() { return r(); }, - set electionSummary(x) { - r(x), mt(); + set electionSummary(w) { + r(w), dt(); }, get currentRound() { return i(); }, - set currentRound(x = 1) { - i(x), mt(); + set currentRound(w = 1) { + i(w), dt(); }, get requestRoundChange() { return s(); }, - set requestRoundChange(x = (B) => { + set requestRoundChange(w = (X) => { }) { - s(x), mt(); + s(w), dt(); }, get candidateColors() { return a(); }, - set candidateColors(x = []) { - a(x), mt(); + set candidateColors(w = []) { + a(w), dt(); }, get textForWinner() { return o(); }, - set textForWinner(x = "elected") { - o(x), mt(); + set textForWinner(w = "elected") { + o(w), dt(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, - set excludeFinalWinnerAndEliminatedCandidate(x = !1) { - l(x), mt(); + set excludeFinalWinnerAndEliminatedCandidate(w = !1) { + l(w), dt(); }, get firstRoundDeterminesPercentages() { return u(); }, - set firstRoundDeterminesPercentages(x = !0) { - u(x), mt(); + set firstRoundDeterminesPercentages(w = !1) { + u(w), dt(); }, get showCaptions() { return f(); }, - set showCaptions(x = !1) { - f(x), mt(); + set showCaptions(w = !1) { + f(w), dt(); } - }, Ht = bd(), pe = dn(Ht), Nt = Ut(pe); - Nt.__click = Me, Bt(pe); - var ve = ie(pe, 4), ee = Ut(ve), Rt = Ut(ee), ln = Ut(Rt); - Qr( - jo(ln, { + }, Me = Ed(), Ct = vn(Me), pe = Lt(Ct); + pe.__click = tt; + var Tt = Lt(pe, !0); + It(pe), It(Ct); + var ve = re(Ct, 4), Pe = Lt(ve), Ze = Lt(Pe), un = Lt(Ze); + ni( + Qo(un, { get jsonData() { - return w(N); + return x(C); }, get currentRound() { return i(); }, - requestRoundChange: G, + requestRoundChange: J, get candidateColors() { return a(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, + get firstRoundDeterminesPercentages() { + return u(); + }, get mouseEventType() { - return w($); + return x($); }, - set mouseEventType(x) { - Q($, x, !0); + set mouseEventType(w) { + ut($, w, !0); }, get mouseData() { - return w(C); + return x(R); }, - set mouseData(x) { - Q(C, x, !0); + set mouseData(w) { + ut(R, w, !0); }, get mouseY() { - return w(T); + return x(E); + }, + set mouseY(w) { + ut(E, w, !0); + }, + get displayPhase() { + return x(S); }, - set mouseY(x) { - Q(T, x, !0); + set displayPhase(w) { + ut(S, w, !0); } }), - (x) => H = x, - () => H - ), Bt(Rt), Bt(ee); - var un = ie(ee, 2); + (w) => U = w, + () => U + ), It(Ze), It(Pe); + var fn = re(Pe, 2); { - var fn = (x) => { - var B = wd(), nt = dn(B), ot = Ut(nt); - Bt(nt); - var J = ie(nt, 2), rt = Ut(J); + var Hn = (w) => { + var X = $d(), nt = vn(X), st = Lt(nt); + It(nt); + var Q = re(nt, 2), rt = Lt(Q); { - var $t = (K) => { - var _e = _d(), Yt = ie(dn(_e)); - zi(Yt, 17, () => A(i()), Vi, (Qe, hn, Hn) => { - var Yn = gd(), Fe = dn(Yn); + var Et = (j) => { + var ge = wd(), Wt = re(vn(ge)); + Bi(Wt, 17, () => q(i()), Yi, (Qe, pn, Bn) => { + var Un = yd(), Fe = vn(Un); let Oe; - var Ie = Ut(Fe, !0); - Bt(Fe); - var pr = ie(Fe, 2); + var Ie = Lt(Fe, !0); + It(Fe); + var _r = re(Fe, 2); { - var vr = (Le) => { - var me = js(", "); - ae(Le, me); - }, gr = /* @__PURE__ */ Bn(() => Hn < A(i()).length - 1); - mr(pr, (Le) => { - w(gr) && Le(vr); + var mr = (Le) => { + var _e = Qs(", "); + se(Le, _e); + }, yr = /* @__PURE__ */ Wn(() => Bn < q(i()).length - 1); + xr(_r, (Le) => { + x(yr) && Le(mr); }); } - Un( + Xn( (Le) => { - Oe = Qs(Fe, "", Oe, Le), pn(Ie, w(hn)); + Oe = na(Fe, "", Oe, Le), tn(Ie, x(pn)); }, - [() => ({ color: te()[w(hn)] })] - ), ae(Qe, Yn); - }), ae(K, _e); - }, Je = /* @__PURE__ */ Bn(() => A(i()).length > 0); - mr(rt, (K) => { - w(Je) && K($t); + [() => ({ color: de()[x(pn)] })] + ), se(Qe, Un); + }), se(j, ge); + }, Je = /* @__PURE__ */ Wn(() => q(i()).length > 0); + xr(rt, (j) => { + x(Je) && j(Et); }); } - var re = ie(rt, 2); + var ne = re(rt, 2); { - var cn = (K) => { - var _e = yd(), Yt = dn(_e), Qe = ie(Yt); - zi(Qe, 17, () => E(i()), Vi, (hn, Hn, Yn) => { - var Fe = md(), Oe = dn(Fe); + var dn = (j) => { + var ge = bd(), Wt = vn(ge), Qe = re(Wt); + Bi(Qe, 17, () => mt(i()), Yi, (pn, Bn, Un) => { + var Fe = xd(), Oe = vn(Fe); let Ie; - var pr = Ut(Oe, !0); - Bt(Oe); - var vr = ie(Oe, 2); + var _r = Lt(Oe, !0); + It(Oe); + var mr = re(Oe, 2); { - var gr = (me) => { - var Pi = js(", "); - ae(me, Pi); - }, Le = /* @__PURE__ */ Bn(() => Yn < E(i()).length - 1); - mr(vr, (me) => { - w(Le) && me(gr); + var yr = (_e) => { + var Oi = Qs(", "); + se(_e, Oi); + }, Le = /* @__PURE__ */ Wn(() => Un < mt(i()).length - 1); + xr(mr, (_e) => { + x(Le) && _e(yr); }); } - Un( - (me) => { - Ie = Qs(Oe, "", Ie, me), pn(pr, w(Hn)); + Xn( + (_e) => { + Ie = na(Oe, "", Ie, _e), tn(_r, x(Bn)); }, - [() => ({ color: te()[w(Hn)] })] - ), ae(hn, Fe); - }), Un(() => pn(Yt, `${w(c).caption ?? ""}: `)), ae(K, _e); - }, De = /* @__PURE__ */ Bn(() => E(i()).length > 0); - mr(re, (K) => { - w(De) && K(cn); + [() => ({ color: de()[x(Bn)] })] + ), se(pn, Fe); + }), Xn(() => tn(Wt, `${x(h).caption ?? ""}: `)), se(j, ge); + }, De = /* @__PURE__ */ Wn(() => mt(i()).length > 0); + xr(ne, (j) => { + x(De) && j(dn); }); } - Bt(J), Un((K) => pn(ot, `${w(N).config.contest ?? ""}, ${K ?? ""} ${w(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [dt]), ae(x, B); + It(Q), Xn((j) => tn(st, `${x(C).config.contest ?? ""}, ${j ?? ""} ${x(h).infinitive ?? ""}, Round ${i() ?? ""}.`), [_t]), se(w, X); }; - mr(un, (x) => { - f() && x(fn); + xr(fn, (w) => { + f() && w(Hn); }); } - Bt(ve); - var ne = ie(ve, 2), ge = Ut(ne), Ze = Ut(ge, !0); - Bt(ge); - var ki = ie(ge, 2); - zi(ki, 17, () => w(b), Vi, (x, B) => { - var nt = xd(), ot = dn(nt), J = Ut(ot, !0); - Bt(ot), Gi(2), Un(() => pn(J, w(B))), ae(x, nt); - }), Bt(ne), Qr(ne, (x) => Q(v, x), () => w(v)); - var zn = ie(ne, 2), Mi = Ut(zn); - return Gi(2), Bt(zn), Qr(zn, (x) => Q(g, x), () => w(g)), Un( - (x) => { - pn(Ze, w(m)), pn(Mi, `"${x ?? ""}" means all the candidates ranked on `); + It(ve); + var cn = re(ve, 2), hn = Lt(cn), gr = Lt(hn, !0); + It(hn); + var Di = re(hn, 2); + Bi(Di, 17, () => x(b), Yi, (w, X) => { + var nt = Ad(), st = vn(nt), Q = Lt(st, !0); + It(st), Zi(2), Xn(() => tn(Q, x(X))), se(w, nt); + }), It(cn), ni(cn, (w) => ut(v, w), () => x(v)); + var Yn = re(cn, 2), Fi = Lt(Yn); + return Zi(2), It(Yn), ni(Yn, (w) => ut(g, w), () => x(g)), Xn( + (w) => { + tn(Tt, ht[x(S)]), tn(gr, x(m)), tn(Fi, `"${w ?? ""}" means all the candidates ranked on `); }, - [tt] - ), ae(t, Ht), ys(Pe); + [ke] + ), se(t, Me), bs(ee); } -du(["click"]); -customElements.define("pie-chart", bo( - Ad, +gu(["click"]); +customElements.define("pie-chart", Eo( + Cd, { electionSummary: {}, currentRound: {}, diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index cf69e834..9a7c185a 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -32,6 +32,7 @@ pieChart.candidateColors = candidateColors; pieChart.textForWinner = "{{ textForWinner }}"; pieChart.excludeFinalWinnerAndEliminatedCandidate = {{ config.excludeFinalWinnerAndEliminatedCandidate|yesno:"true,false" }}; + pieChart.firstRoundDeterminesPercentages = false; pieChart.currentRound = {{ config.numRounds }}; // Append it to the div From c9b41ed8a10feb891e4b014ed2b5bb6934f79284 Mon Sep 17 00:00:00 2001 From: skaphan Date: Mon, 16 Mar 2026 11:52:35 -0700 Subject: [PATCH 14/31] Update pie chart: fix centering, tooltip positioning, remove bubble chart Tooltip now positions near mouse cursor with viewport clamping. Pie chart centered (removed stale margin-right). Bubble visualization references removed. Co-Authored-By: Claude Opus 4.6 --- static/pie/pie-chart.es.js | 4431 ++++++++++++++++++------------------ 1 file changed, 2211 insertions(+), 2220 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 29791b20..3905b77d 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,27 +1,27 @@ -var cl = Object.defineProperty; -var Bs = (t) => { +var hl = Object.defineProperty; +var Ws = (t) => { throw TypeError(t); }; -var hl = (t, e, n) => e in t ? cl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var at = (t, e, n) => hl(t, typeof e != "symbol" ? e + "" : e, n), zi = (t, e, n) => e.has(t) || Bs("Cannot " + n); -var p = (t, e, n) => (zi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), L = (t, e, n) => e.has(t) ? Bs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), P = (t, e, n, r) => (zi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), pt = (t, e, n) => (zi(t, e, "access private method"), n); -var ba; -typeof window < "u" && ((ba = window.__svelte ?? (window.__svelte = {})).v ?? (ba.v = /* @__PURE__ */ new Set())).add("5"); -const dl = 1, pl = 2, vl = 16, gl = 1, _l = 4, ml = 8, yl = 16, wl = 2, ms = "[", bi = "[!", ys = "]", ir = {}, wt = Symbol(), xl = "http://www.w3.org/1999/xhtml", Ki = !1; -var Ea = Array.isArray, bl = Array.prototype.indexOf, sr = Array.prototype.includes, $i = Array.from, ui = Object.keys, fi = Object.defineProperty, Nn = Object.getOwnPropertyDescriptor, $l = Object.prototype, Al = Array.prototype, El = Object.getPrototypeOf, Us = Object.isExtensible; -const Rl = () => { +var dl = (t, e, n) => e in t ? hl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var at = (t, e, n) => dl(t, typeof e != "symbol" ? e + "" : e, n), zi = (t, e, n) => e.has(t) || Ws("Cannot " + n); +var v = (t, e, n) => (zi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), L = (t, e, n) => e.has(t) ? Ws("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), F = (t, e, n, r) => (zi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), gt = (t, e, n) => (zi(t, e, "access private method"), n); +var Aa; +typeof window < "u" && ((Aa = window.__svelte ?? (window.__svelte = {})).v ?? (Aa.v = /* @__PURE__ */ new Set())).add("5"); +const pl = 1, vl = 2, gl = 16, _l = 1, ml = 4, yl = 8, wl = 16, xl = 2, ws = "[", $i = "[!", xs = "]", rr = {}, bt = Symbol(), bl = "http://www.w3.org/1999/xhtml", ji = !1; +var Ca = Array.isArray, $l = Array.prototype.indexOf, ir = Array.prototype.includes, Ai = Array.from, fi = Object.keys, ci = Object.defineProperty, Tn = Object.getOwnPropertyDescriptor, Al = Object.prototype, El = Array.prototype, Rl = Object.getPrototypeOf, Us = Object.isExtensible; +const Cl = () => { }; -function Cl(t) { +function Tl(t) { for (var e = 0; e < t.length; e++) t[e](); } -function Ra() { +function Ta() { var t, e, n = new Promise((r, i) => { t = r, e = i; }); return { promise: n, resolve: t, reject: e }; } -function Tl(t, e) { +function Nl(t, e) { if (Array.isArray(t)) return t; if (!(Symbol.iterator in t)) @@ -31,130 +31,130 @@ function Tl(t, e) { if (n.push(r), n.length === e) break; return n; } -const $t = 2, kr = 4, Ai = 8, Ca = 1 << 24, je = 16, ce = 32, ln = 64, Ta = 128, Zt = 512, gt = 1024, At = 2048, fe = 4096, Ht = 8192, Xe = 16384, dr = 32768, ar = 65536, Ws = 1 << 17, Na = 1 << 18, Vn = 1 << 19, Nl = 1 << 20, rn = 1 << 25, Dn = 65536, ji = 1 << 21, ws = 1 << 22, sn = 1 << 23, Tr = Symbol("$state"), Sa = Symbol("legacy props"), mn = new class extends Error { +const At = 2, Sr = 4, Ei = 8, Na = 1 << 24, Ze = 16, pe = 32, un = 64, Sa = 128, ee = 512, mt = 1024, Et = 2048, de = 4096, Bt = 8192, Ue = 16384, hr = 32768, sr = 65536, Gs = 1 << 17, ka = 1 << 18, qn = 1 << 19, Sl = 1 << 20, sn = 1 << 25, Pn = 65536, Ji = 1 << 21, bs = 1 << 22, an = 1 << 23, Cr = Symbol("$state"), Ma = Symbol("legacy props"), _n = new class extends Error { constructor() { super(...arguments); at(this, "name", "StaleReactionError"); at(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } -}(), Hr = 3, pr = 8; -function Sl(t) { +}(), Yr = 3, dr = 8; +function kl(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function kl() { +function Ml() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function Ml(t, e, n) { +function Pl(t, e, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function Pl(t) { +function Dl(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function Dl() { +function Fl() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function Fl(t) { +function Ol(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function Ol() { +function Il() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Il() { +function Ll() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function Ll(t) { +function ql(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function ql() { +function Vl() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Vl() { +function Yl() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function zl() { +function Hl() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function Hl() { +function zl() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Ei(t) { +function Ri(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function Yl() { +function Xl() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } -let Z = !1; +let j = !1; function We(t) { - Z = t; + j = t; } -let H; -function Ot(t) { +let Y; +function Lt(t) { if (t === null) - throw Ei(), ir; - return H = t; + throw Ri(), rr; + return Y = t; } -function Ri() { - return Ot(/* @__PURE__ */ Te(H)); +function Ci() { + return Lt(/* @__PURE__ */ ke(Y)); } -function It(t) { - if (Z) { - if (/* @__PURE__ */ Te(H) !== null) - throw Ei(), ir; - H = t; +function Vt(t) { + if (j) { + if (/* @__PURE__ */ ke(Y) !== null) + throw Ri(), rr; + Y = t; } } -function Zi(t = 1) { - if (Z) { - for (var e = t, n = H; e--; ) +function Qi(t = 1) { + if (j) { + for (var e = t, n = Y; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Te(n); - H = n; + /* @__PURE__ */ ke(n); + Y = n; } } -function ci(t = !0) { - for (var e = 0, n = H; ; ) { - if (n.nodeType === pr) { +function hi(t = !0) { + for (var e = 0, n = Y; ; ) { + if (n.nodeType === dr) { var r = ( /** @type {Comment} */ n.data ); - if (r === ys) { + if (r === xs) { if (e === 0) return n; e -= 1; - } else (r === ms || r === bi || // "[1", "[2", etc. for if blocks + } else (r === ws || r === $i || // "[1", "[2", etc. for if blocks r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Te(n) + /* @__PURE__ */ ke(n) ); t && n.remove(), n = i; } } -function ka(t) { - if (!t || t.nodeType !== pr) - throw Ei(), ir; +function Pa(t) { + if (!t || t.nodeType !== dr) + throw Ri(), rr; return ( /** @type {Comment} */ t.data ); } -function Ma(t) { +function Da(t) { return t === this.v; } function Bl(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function Pa(t) { +function Fa(t) { return !Bl(t, this.v); } -let Ul = !1, Yt = null; -function or(t) { - Yt = t; +let Wl = !1, Wt = null; +function ar(t) { + Wt = t; } -function xs(t, e = !1, n) { - Yt = { - p: Yt, +function $s(t, e = !1, n) { + Wt = { + p: Wt, i: !1, c: null, e: null, @@ -163,52 +163,52 @@ function xs(t, e = !1, n) { l: null }; } -function bs(t) { +function As(t) { var e = ( /** @type {ComponentContext} */ - Yt + Wt ), n = e.e; if (n !== null) { e.e = null; for (var r of n) - io(r); + ao(r); } - return t !== void 0 && (e.x = t), e.i = !0, Yt = e.p, t ?? /** @type {T} */ + return t !== void 0 && (e.x = t), e.i = !0, Wt = e.p, t ?? /** @type {T} */ {}; } -function Da() { +function Oa() { return !0; } -let yn = []; -function Fa() { - var t = yn; - yn = [], Cl(t); +let mn = []; +function Ia() { + var t = mn; + mn = [], Tl(t); } -function Sn(t) { - if (yn.length === 0 && !Nr) { - var e = yn; +function Nn(t) { + if (mn.length === 0 && !Tr) { + var e = mn; queueMicrotask(() => { - e === yn && Fa(); + e === mn && Ia(); }); } - yn.push(t); + mn.push(t); } -function Wl() { - for (; yn.length > 0; ) - Fa(); +function Ul() { + for (; mn.length > 0; ) + Ia(); } -function Oa(t) { - var e = K; +function La(t) { + var e = U; if (e === null) - return z.f |= sn, t; - if ((e.f & dr) === 0 && (e.f & kr) === 0) + return V.f |= an, t; + if ((e.f & hr) === 0 && (e.f & Sr) === 0) throw t; - lr(t, e); + or(t, e); } -function lr(t, e) { +function or(t, e) { for (; e !== null; ) { - if ((e.f & Ta) !== 0) { - if ((e.f & dr) === 0) + if ((e.f & Sa) !== 0) { + if ((e.f & hr) === 0) throw t; try { e.b.error(t); @@ -221,30 +221,30 @@ function lr(t, e) { } throw t; } -const Xl = -7169; -function ot(t, e) { - t.f = t.f & Xl | e; +const Gl = -7169; +function lt(t, e) { + t.f = t.f & Gl | e; } -function $s(t) { - (t.f & Zt) !== 0 || t.deps === null ? ot(t, gt) : ot(t, fe); +function Es(t) { + (t.f & ee) !== 0 || t.deps === null ? lt(t, mt) : lt(t, de); } -function Ia(t) { +function qa(t) { if (t !== null) for (const e of t) - (e.f & $t) === 0 || (e.f & Dn) === 0 || (e.f ^= Dn, Ia( + (e.f & At) === 0 || (e.f & Pn) === 0 || (e.f ^= Pn, qa( /** @type {Derived} */ e.deps )); } -function La(t, e, n) { - (t.f & At) !== 0 ? e.add(t) : (t.f & fe) !== 0 && n.add(t), Ia(t.deps), ot(t, gt); +function Va(t, e, n) { + (t.f & Et) !== 0 ? e.add(t) : (t.f & de) !== 0 && n.add(t), qa(t.deps), lt(t, mt); } -const Wr = /* @__PURE__ */ new Set(); -let W = null, bt = null, Pt = [], Ci = null, Ji = !1, Nr = !1; -var Zn, Jn, $n, Qn, Ir, Lr, An, ze, tr, Ce, Qi, ts, qa; -const qs = class qs { +const Ur = /* @__PURE__ */ new Set(); +let B = null, $t = null, Ft = [], Ti = null, ts = !1, Tr = !1; +var Zn, jn, bn, Jn, Or, Ir, $n, Ye, Qn, Se, es, ns, Ya; +const Ys = class Ys { constructor() { - L(this, Ce); + L(this, Se); at(this, "committed", !1); /** * The current values of any sources that are updated in this batch @@ -268,31 +268,31 @@ const qs = class qs { * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - L(this, Jn, /* @__PURE__ */ new Set()); + L(this, jn, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - L(this, $n, 0); + L(this, bn, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - L(this, Qn, 0); + L(this, Jn, 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} */ - L(this, Ir, null); + L(this, Or, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - L(this, Lr, /* @__PURE__ */ new Set()); + L(this, Ir, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - L(this, An, /* @__PURE__ */ new Set()); + L(this, $n, /* @__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`. @@ -300,19 +300,19 @@ const qs = class qs { * so they can be rescheduled if the branch survives. * @type {Map} */ - L(this, ze, /* @__PURE__ */ new Map()); + L(this, Ye, /* @__PURE__ */ new Map()); at(this, "is_fork", !1); - L(this, tr, !1); + L(this, Qn, !1); } is_deferred() { - return this.is_fork || p(this, Qn) > 0; + return this.is_fork || v(this, Jn) > 0; } /** * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ skip_effect(e) { - p(this, ze).has(e) || p(this, ze).set(e, { d: [], m: [] }); + v(this, Ye).has(e) || v(this, Ye).set(e, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule @@ -320,13 +320,13 @@ const qs = class qs { * @param {Effect} effect */ unskip_effect(e) { - var n = p(this, ze).get(e); + var n = v(this, Ye).get(e); if (n) { - p(this, ze).delete(e); + v(this, Ye).delete(e); for (var r of n.d) - ot(r, At), le(r); + lt(r, Et), ce(r); for (r of n.m) - ot(r, fe), le(r); + lt(r, de), ce(r); } } /** @@ -335,19 +335,19 @@ const qs = class qs { */ process(e) { var i; - Pt = [], this.apply(); + Ft = [], this.apply(); var n = [], r = []; for (const s of e) - pt(this, Ce, Qi).call(this, s, n, r); + gt(this, Se, es).call(this, s, n, r); if (this.is_deferred()) { - pt(this, Ce, ts).call(this, r), pt(this, Ce, ts).call(this, n); - for (const [s, a] of p(this, ze)) - Ya(s, a); + gt(this, Se, ns).call(this, r), gt(this, Se, ns).call(this, n); + for (const [s, a] of v(this, Ye)) + Ba(s, a); } else { - for (const s of p(this, Zn)) s(); - p(this, Zn).clear(), p(this, $n) === 0 && pt(this, Ce, qa).call(this), W = null, Xs(r), Xs(n), (i = p(this, Ir)) == null || i.resolve(); + for (const s of v(this, Zn)) s(); + v(this, Zn).clear(), v(this, bn) === 0 && gt(this, Se, Ya).call(this), B = null, Ks(r), Ks(n), (i = v(this, Or)) == null || i.resolve(); } - bt = null; + $t = null; } /** * Associate a change to a given source with the current @@ -356,106 +356,106 @@ const qs = class qs { * @param {any} value */ capture(e, n) { - n !== wt && !this.previous.has(e) && this.previous.set(e, n), (e.f & sn) === 0 && (this.current.set(e, e.v), bt == null || bt.set(e, e.v)); + n !== bt && !this.previous.has(e) && this.previous.set(e, n), (e.f & an) === 0 && (this.current.set(e, e.v), $t == null || $t.set(e, e.v)); } activate() { - W = this, this.apply(); + B = this, this.apply(); } deactivate() { - W === this && (W = null, bt = null); + B === this && (B = null, $t = null); } flush() { - if (this.activate(), Pt.length > 0) { - if (Va(), W !== null && W !== this) + if (this.activate(), Ft.length > 0) { + if (Ha(), B !== null && B !== this) return; - } else p(this, $n) === 0 && this.process([]); + } else v(this, bn) === 0 && this.process([]); this.deactivate(); } discard() { - for (const e of p(this, Jn)) e(this); - p(this, Jn).clear(); + for (const e of v(this, jn)) e(this); + v(this, jn).clear(); } /** * * @param {boolean} blocking */ increment(e) { - P(this, $n, p(this, $n) + 1), e && P(this, Qn, p(this, Qn) + 1); + F(this, bn, v(this, bn) + 1), e && F(this, Jn, v(this, Jn) + 1); } /** * * @param {boolean} blocking */ decrement(e) { - P(this, $n, p(this, $n) - 1), e && P(this, Qn, p(this, Qn) - 1), !p(this, tr) && (P(this, tr, !0), Sn(() => { - P(this, tr, !1), this.is_deferred() ? Pt.length > 0 && this.flush() : this.revive(); + F(this, bn, v(this, bn) - 1), e && F(this, Jn, v(this, Jn) - 1), !v(this, Qn) && (F(this, Qn, !0), Nn(() => { + F(this, Qn, !1), this.is_deferred() ? Ft.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const e of p(this, Lr)) - p(this, An).delete(e), ot(e, At), le(e); - for (const e of p(this, An)) - ot(e, fe), le(e); + for (const e of v(this, Ir)) + v(this, $n).delete(e), lt(e, Et), ce(e); + for (const e of v(this, $n)) + lt(e, de), ce(e); this.flush(); } /** @param {() => void} fn */ oncommit(e) { - p(this, Zn).add(e); + v(this, Zn).add(e); } /** @param {(batch: Batch) => void} fn */ ondiscard(e) { - p(this, Jn).add(e); + v(this, jn).add(e); } settled() { - return (p(this, Ir) ?? P(this, Ir, Ra())).promise; + return (v(this, Or) ?? F(this, Or, Ta())).promise; } static ensure() { - if (W === null) { - const e = W = new qs(); - Wr.add(W), Nr || Sn(() => { - W === e && e.flush(); + if (B === null) { + const e = B = new Ys(); + Ur.add(B), Tr || Nn(() => { + B === e && e.flush(); }); } - return W; + return B; } apply() { } }; -Zn = new WeakMap(), Jn = new WeakMap(), $n = new WeakMap(), Qn = new WeakMap(), Ir = new WeakMap(), Lr = new WeakMap(), An = new WeakMap(), ze = new WeakMap(), tr = new WeakMap(), Ce = new WeakSet(), /** +Zn = new WeakMap(), jn = new WeakMap(), bn = new WeakMap(), Jn = new WeakMap(), Or = new WeakMap(), Ir = new WeakMap(), $n = new WeakMap(), Ye = new WeakMap(), Qn = new WeakMap(), Se = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -Qi = function(e, n, r) { - e.f ^= gt; +es = function(e, n, r) { + e.f ^= mt; for (var i = e.first, s = null; i !== null; ) { - var a = i.f, o = (a & (ce | ln)) !== 0, l = o && (a & gt) !== 0, u = l || (a & Ht) !== 0 || p(this, ze).has(i); + var a = i.f, o = (a & (pe | un)) !== 0, l = o && (a & mt) !== 0, u = l || (a & Bt) !== 0 || v(this, Ye).has(i); if (!u && i.fn !== null) { - o ? i.f ^= gt : s !== null && (a & (kr | Ai | Ca)) !== 0 ? s.b.defer_effect(i) : (a & kr) !== 0 ? n.push(i) : Yr(i) && ((a & je) !== 0 && p(this, An).add(i), fr(i)); + o ? i.f ^= mt : s !== null && (a & (Sr | Ei | Na)) !== 0 ? s.b.defer_effect(i) : (a & Sr) !== 0 ? n.push(i) : Hr(i) && ((a & Ze) !== 0 && v(this, $n).add(i), ur(i)); var f = i.first; if (f !== null) { i = f; continue; } } - var c = i.parent; - for (i = i.next; i === null && c !== null; ) - c === s && (s = null), i = c.next, c = c.parent; + var h = i.parent; + for (i = i.next; i === null && h !== null; ) + h === s && (s = null), i = h.next, h = h.parent; } }, /** * @param {Effect[]} effects */ -ts = function(e) { +ns = function(e) { for (var n = 0; n < e.length; n += 1) - La(e[n], p(this, Lr), p(this, An)); -}, qa = function() { + Va(e[n], v(this, Ir), v(this, $n)); +}, Ya = function() { var i; - if (Wr.size > 1) { + if (Ur.size > 1) { this.previous.clear(); - var e = bt, n = !0; - for (const s of Wr) { + var e = $t, n = !0; + for (const s of Ur) { if (s === this) { n = !1; continue; @@ -473,111 +473,111 @@ ts = function(e) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = Pt; - Pt = []; + var r = Ft; + Ft = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) za(f, o, l, u); - if (Pt.length > 0) { - W = s, s.apply(); - for (const f of Pt) - pt(i = s, Ce, Qi).call(i, f, [], []); + if (Ft.length > 0) { + B = s, s.apply(); + for (const f of Ft) + gt(i = s, Se, es).call(i, f, [], []); s.deactivate(); } - Pt = r; + Ft = r; } } - W = null, bt = e; + B = null, $t = e; } - this.committed = !0, Wr.delete(this); + this.committed = !0, Ur.delete(this); }; -let Ge = qs; -function dt(t) { - var e = Nr; - Nr = !0; +let Ge = Ys; +function ft(t) { + var e = Tr; + Tr = !0; try { for (var n; ; ) { - if (Wl(), Pt.length === 0 && (W == null || W.flush(), Pt.length === 0)) - return Ci = null, /** @type {T} */ + if (Ul(), Ft.length === 0 && (B == null || B.flush(), Ft.length === 0)) + return Ti = null, /** @type {T} */ n; - Va(); + Ha(); } } finally { - Nr = e; + Tr = e; } } -function Va() { - Ji = !0; +function Ha() { + ts = !0; var t = null; try { - for (var e = 0; Pt.length > 0; ) { + for (var e = 0; Ft.length > 0; ) { var n = Ge.ensure(); if (e++ > 1e3) { var r, i; - Gl(); + Kl(); } - n.process(Pt), an.clear(); + n.process(Ft), on.clear(); } } finally { - Pt = [], Ji = !1, Ci = null; + Ft = [], ts = !1, Ti = null; } } -function Gl() { +function Kl() { try { - Ol(); + Il(); } catch (t) { - lr(t, Ci); + or(t, Ti); } } -let ie = null; -function Xs(t) { +let oe = null; +function Ks(t) { var e = t.length; if (e !== 0) { for (var n = 0; n < e; ) { var r = t[n++]; - if ((r.f & (Xe | Ht)) === 0 && Yr(r) && (ie = /* @__PURE__ */ new Set(), fr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && oo(r), (ie == null ? void 0 : ie.size) > 0)) { - an.clear(); - for (const i of ie) { - if ((i.f & (Xe | Ht)) !== 0) continue; + if ((r.f & (Ue | Bt)) === 0 && Hr(r) && (oe = /* @__PURE__ */ new Set(), ur(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && uo(r), (oe == null ? void 0 : oe.size) > 0)) { + on.clear(); + for (const i of oe) { + if ((i.f & (Ue | Bt)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - ie.has(a) && (ie.delete(a), s.push(a)), a = a.parent; + oe.has(a) && (oe.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (Xe | Ht)) === 0 && fr(l); + (l.f & (Ue | Bt)) === 0 && ur(l); } } - ie.clear(); + oe.clear(); } } - ie = null; + oe = null; } } function za(t, e, n, r) { if (!n.has(t) && (n.add(t), t.reactions !== null)) for (const i of t.reactions) { const s = i.f; - (s & $t) !== 0 ? za( + (s & At) !== 0 ? za( /** @type {Derived} */ i, e, n, r - ) : (s & (ws | je)) !== 0 && (s & At) === 0 && Ha(i, e, r) && (ot(i, At), le( + ) : (s & (bs | Ze)) !== 0 && (s & Et) === 0 && Xa(i, e, r) && (lt(i, Et), ce( /** @type {Effect} */ i )); } } -function Ha(t, e, n) { +function Xa(t, e, n) { const r = n.get(t); if (r !== void 0) return r; if (t.deps !== null) for (const i of t.deps) { - if (sr.call(e, i)) + if (ir.call(e, i)) return !0; - if ((i.f & $t) !== 0 && Ha( + if ((i.f & At) !== 0 && Xa( /** @type {Derived} */ i, e, @@ -591,80 +591,80 @@ function Ha(t, e, n) { } return n.set(t, !1), !1; } -function le(t) { - for (var e = Ci = t; e.parent !== null; ) { +function ce(t) { + for (var e = Ti = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (Ji && e === K && (n & je) !== 0 && (n & Na) === 0) + if (ts && e === U && (n & Ze) !== 0 && (n & ka) === 0) return; - if ((n & (ln | ce)) !== 0) { - if ((n & gt) === 0) return; - e.f ^= gt; + if ((n & (un | pe)) !== 0) { + if ((n & mt) === 0) return; + e.f ^= mt; } } - Pt.push(e); + Ft.push(e); } -function Ya(t, e) { - if (!((t.f & ce) !== 0 && (t.f & gt) !== 0)) { - (t.f & At) !== 0 ? e.d.push(t) : (t.f & fe) !== 0 && e.m.push(t), ot(t, gt); +function Ba(t, e) { + if (!((t.f & pe) !== 0 && (t.f & mt) !== 0)) { + (t.f & Et) !== 0 ? e.d.push(t) : (t.f & de) !== 0 && e.m.push(t), lt(t, mt); for (var n = t.first; n !== null; ) - Ya(n, e), n = n.next; + Ba(n, e), n = n.next; } } -function Kl(t) { - let e = 0, n = Fn(0), r; +function Zl(t) { + let e = 0, n = Dn(0), r; return () => { - Rs() && (x(n), Ts(() => (e === 0 && (r = Si(() => t(() => Sr(n)))), e += 1, () => { - Sn(() => { - e -= 1, e === 0 && (r == null || r(), r = void 0, Sr(n)); + Ts() && (x(n), Ss(() => (e === 0 && (r = ki(() => t(() => Nr(n)))), e += 1, () => { + Nn(() => { + e -= 1, e === 0 && (r == null || r(), r = void 0, Nr(n)); }); }))); }; } -var jl = ar | Vn | Ta; -function Zl(t, e, n) { - new Jl(t, e, n); +var jl = sr | qn | Sa; +function Jl(t, e, n) { + new Ql(t, e, n); } -var Vt, qr, we, En, xe, Gt, Mt, be, He, nn, Rn, Ye, er, Cn, nr, rr, Be, wi, ft, Ba, Ua, es, Qr, ti, ns; -class Jl { +var zt, Lr, $e, An, Ae, Jt, Dt, Ee, He, rn, En, ze, tr, Rn, er, nr, Xe, xi, ct, Wa, Ua, rs, ti, ei, is; +class Ql { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ constructor(e, n, r) { - L(this, ft); + L(this, ct); /** @type {Boundary | null} */ at(this, "parent"); at(this, "is_pending", !1); /** @type {TemplateNode} */ - L(this, Vt); + L(this, zt); /** @type {TemplateNode | null} */ - L(this, qr, Z ? H : null); + L(this, Lr, j ? Y : null); /** @type {BoundaryProps} */ - L(this, we); + L(this, $e); /** @type {((anchor: Node) => void)} */ - L(this, En); + L(this, An); /** @type {Effect} */ - L(this, xe); + L(this, Ae); /** @type {Effect | null} */ - L(this, Gt, null); + L(this, Jt, null); /** @type {Effect | null} */ - L(this, Mt, null); + L(this, Dt, null); /** @type {Effect | null} */ - L(this, be, null); + L(this, Ee, null); /** @type {DocumentFragment | null} */ L(this, He, null); /** @type {TemplateNode | null} */ - L(this, nn, null); - L(this, Rn, 0); - L(this, Ye, 0); - L(this, er, !1); - L(this, Cn, !1); + L(this, rn, null); + L(this, En, 0); + L(this, ze, 0); + L(this, tr, !1); + L(this, Rn, !1); /** @type {Set} */ - L(this, nr, /* @__PURE__ */ new Set()); + L(this, er, /* @__PURE__ */ new Set()); /** @type {Set} */ - L(this, rr, /* @__PURE__ */ new Set()); + L(this, nr, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -672,38 +672,38 @@ class Jl { * calls followed by no-op flushes * @type {Source | null} */ - L(this, Be, null); - L(this, wi, Kl(() => (P(this, Be, Fn(p(this, Rn))), () => { - P(this, Be, null); + L(this, Xe, null); + L(this, xi, Zl(() => (F(this, Xe, Dn(v(this, En))), () => { + F(this, Xe, null); }))); - P(this, Vt, e), P(this, we, n), P(this, En, r), this.parent = /** @type {Effect} */ - K.b, this.is_pending = !!p(this, we).pending, P(this, xe, Ns(() => { - if (K.b = this, Z) { - const s = p(this, qr); - Ri(), /** @type {Comment} */ - s.nodeType === pr && /** @type {Comment} */ - s.data === bi ? pt(this, ft, Ua).call(this) : (pt(this, ft, Ba).call(this), p(this, Ye) === 0 && (this.is_pending = !1)); + F(this, zt, e), F(this, $e, n), F(this, An, r), this.parent = /** @type {Effect} */ + U.b, this.is_pending = !!v(this, $e).pending, F(this, Ae, ks(() => { + if (U.b = this, j) { + const s = v(this, Lr); + Ci(), /** @type {Comment} */ + s.nodeType === dr && /** @type {Comment} */ + s.data === $i ? gt(this, ct, Ua).call(this) : (gt(this, ct, Wa).call(this), v(this, ze) === 0 && (this.is_pending = !1)); } else { - var i = pt(this, ft, es).call(this); + var i = gt(this, ct, rs).call(this); try { - P(this, Gt, jt(() => r(i))); + F(this, Jt, te(() => r(i))); } catch (s) { this.error(s); } - p(this, Ye) > 0 ? pt(this, ft, ti).call(this) : this.is_pending = !1; + v(this, ze) > 0 ? gt(this, ct, ei).call(this) : this.is_pending = !1; } return () => { var s; - (s = p(this, nn)) == null || s.remove(); + (s = v(this, rn)) == null || s.remove(); }; - }, jl)), Z && P(this, Vt, H); + }, jl)), j && F(this, zt, Y); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ defer_effect(e) { - La(e, p(this, nr), p(this, rr)); + Va(e, v(this, er), v(this, nr)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -713,7 +713,7 @@ class Jl { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!p(this, we).pending; + return !!v(this, $e).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -722,199 +722,199 @@ class Jl { * @param {1 | -1} d */ update_pending_count(e) { - pt(this, ft, ns).call(this, e), P(this, Rn, p(this, Rn) + e), !(!p(this, Be) || p(this, er)) && (P(this, er, !0), Sn(() => { - P(this, er, !1), p(this, Be) && ur(p(this, Be), p(this, Rn)); + gt(this, ct, is).call(this, e), F(this, En, v(this, En) + e), !(!v(this, Xe) || v(this, tr)) && (F(this, tr, !0), Nn(() => { + F(this, tr, !1), v(this, Xe) && lr(v(this, Xe), v(this, En)); })); } get_effect_pending() { - return p(this, wi).call(this), x( + return v(this, xi).call(this), x( /** @type {Source} */ - p(this, Be) + v(this, Xe) ); } /** @param {unknown} error */ error(e) { - var n = p(this, we).onerror; - let r = p(this, we).failed; - if (p(this, Cn) || !n && !r) + var n = v(this, $e).onerror; + let r = v(this, $e).failed; + if (v(this, Rn) || !n && !r) throw e; - p(this, Gt) && (St(p(this, Gt)), P(this, Gt, null)), p(this, Mt) && (St(p(this, Mt)), P(this, Mt, null)), p(this, be) && (St(p(this, be)), P(this, be, null)), Z && (Ot( + v(this, Jt) && (St(v(this, Jt)), F(this, Jt, null)), v(this, Dt) && (St(v(this, Dt)), F(this, Dt, null)), v(this, Ee) && (St(v(this, Ee)), F(this, Ee, null)), j && (Lt( /** @type {TemplateNode} */ - p(this, qr) - ), Zi(), Ot(ci())); + v(this, Lr) + ), Qi(), Lt(hi())); var i = !1, s = !1; const a = () => { if (i) { - Yl(); + Xl(); return; } - i = !0, s && Hl(), Ge.ensure(), P(this, Rn, 0), p(this, be) !== null && kn(p(this, be), () => { - P(this, be, null); - }), this.is_pending = this.has_pending_snippet(), P(this, Gt, pt(this, ft, Qr).call(this, () => (P(this, Cn, !1), jt(() => p(this, En).call(this, p(this, Vt)))))), p(this, Ye) > 0 ? pt(this, ft, ti).call(this) : this.is_pending = !1; + i = !0, s && zl(), Ge.ensure(), F(this, En, 0), v(this, Ee) !== null && Sn(v(this, Ee), () => { + F(this, Ee, null); + }), this.is_pending = this.has_pending_snippet(), F(this, Jt, gt(this, ct, ti).call(this, () => (F(this, Rn, !1), te(() => v(this, An).call(this, v(this, zt)))))), v(this, ze) > 0 ? gt(this, ct, ei).call(this) : this.is_pending = !1; }; - Sn(() => { + Nn(() => { try { s = !0, n == null || n(e, a), s = !1; } catch (o) { - lr(o, p(this, xe) && p(this, xe).parent); + or(o, v(this, Ae) && v(this, Ae).parent); } - r && P(this, be, pt(this, ft, Qr).call(this, () => { - Ge.ensure(), P(this, Cn, !0); + r && F(this, Ee, gt(this, ct, ti).call(this, () => { + Ge.ensure(), F(this, Rn, !0); try { - return jt(() => { + return te(() => { r( - p(this, Vt), + v(this, zt), () => e, () => a ); }); } catch (o) { - return lr( + return or( o, /** @type {Effect} */ - p(this, xe).parent + v(this, Ae).parent ), null; } finally { - P(this, Cn, !1); + F(this, Rn, !1); } })); }); } } -Vt = new WeakMap(), qr = new WeakMap(), we = new WeakMap(), En = new WeakMap(), xe = new WeakMap(), Gt = new WeakMap(), Mt = new WeakMap(), be = new WeakMap(), He = new WeakMap(), nn = new WeakMap(), Rn = new WeakMap(), Ye = new WeakMap(), er = new WeakMap(), Cn = new WeakMap(), nr = new WeakMap(), rr = new WeakMap(), Be = new WeakMap(), wi = new WeakMap(), ft = new WeakSet(), Ba = function() { +zt = new WeakMap(), Lr = new WeakMap(), $e = new WeakMap(), An = new WeakMap(), Ae = new WeakMap(), Jt = new WeakMap(), Dt = new WeakMap(), Ee = new WeakMap(), He = new WeakMap(), rn = new WeakMap(), En = new WeakMap(), ze = new WeakMap(), tr = new WeakMap(), Rn = new WeakMap(), er = new WeakMap(), nr = new WeakMap(), Xe = new WeakMap(), xi = new WeakMap(), ct = new WeakSet(), Wa = function() { try { - P(this, Gt, jt(() => p(this, En).call(this, p(this, Vt)))); + F(this, Jt, te(() => v(this, An).call(this, v(this, zt)))); } catch (e) { this.error(e); } }, Ua = function() { - const e = p(this, we).pending; - e && (P(this, Mt, jt(() => e(p(this, Vt)))), Sn(() => { - var n = pt(this, ft, es).call(this); - P(this, Gt, pt(this, ft, Qr).call(this, () => (Ge.ensure(), jt(() => p(this, En).call(this, n))))), p(this, Ye) > 0 ? pt(this, ft, ti).call(this) : (kn( + const e = v(this, $e).pending; + e && (F(this, Dt, te(() => e(v(this, zt)))), Nn(() => { + var n = gt(this, ct, rs).call(this); + F(this, Jt, gt(this, ct, ti).call(this, () => (Ge.ensure(), te(() => v(this, An).call(this, n))))), v(this, ze) > 0 ? gt(this, ct, ei).call(this) : (Sn( /** @type {Effect} */ - p(this, Mt), + v(this, Dt), () => { - P(this, Mt, null); + F(this, Dt, null); } ), this.is_pending = !1); })); -}, es = function() { - var e = p(this, Vt); - return this.is_pending && (P(this, nn, Qt()), p(this, Vt).before(p(this, nn)), e = p(this, nn)), e; +}, rs = function() { + var e = v(this, zt); + return this.is_pending && (F(this, rn, re()), v(this, zt).before(v(this, rn)), e = v(this, rn)), e; }, /** * @param {() => Effect | null} fn */ -Qr = function(e) { - var n = K, r = z, i = Yt; - Re(p(this, xe)), te(p(this, xe)), or(p(this, xe).ctx); +ti = function(e) { + var n = U, r = V, i = Wt; + Ne(v(this, Ae)), ie(v(this, Ae)), ar(v(this, Ae).ctx); try { return e(); } catch (s) { - return Oa(s), null; + return La(s), null; } finally { - Re(n), te(r), or(i); + Ne(n), ie(r), ar(i); } -}, ti = function() { +}, ei = function() { const e = ( /** @type {(anchor: Node) => void} */ - p(this, we).pending + v(this, $e).pending ); - p(this, Gt) !== null && (P(this, He, document.createDocumentFragment()), p(this, He).append( + v(this, Jt) !== null && (F(this, He, document.createDocumentFragment()), v(this, He).append( /** @type {TemplateNode} */ - p(this, nn) - ), fo(p(this, Gt), p(this, He))), p(this, Mt) === null && P(this, Mt, jt(() => e(p(this, Vt)))); + v(this, rn) + ), ho(v(this, Jt), v(this, He))), v(this, Dt) === null && F(this, Dt, te(() => e(v(this, zt)))); }, /** * 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 * @param {1 | -1} d */ -ns = function(e) { +is = function(e) { var n; if (!this.has_pending_snippet()) { - this.parent && pt(n = this.parent, ft, ns).call(n, e); + this.parent && gt(n = this.parent, ct, is).call(n, e); return; } - if (P(this, Ye, p(this, Ye) + e), p(this, Ye) === 0) { + if (F(this, ze, v(this, ze) + e), v(this, ze) === 0) { this.is_pending = !1; - for (const r of p(this, nr)) - ot(r, At), le(r); - for (const r of p(this, rr)) - ot(r, fe), le(r); - p(this, nr).clear(), p(this, rr).clear(), p(this, Mt) && kn(p(this, Mt), () => { - P(this, Mt, null); - }), p(this, He) && (p(this, Vt).before(p(this, He)), P(this, He, null)); + for (const r of v(this, er)) + lt(r, Et), ce(r); + for (const r of v(this, nr)) + lt(r, de), ce(r); + v(this, er).clear(), v(this, nr).clear(), v(this, Dt) && Sn(v(this, Dt), () => { + F(this, Dt, null); + }), v(this, He) && (v(this, zt).before(v(this, He)), F(this, He, null)); } }; -function Ql(t, e, n, r) { - const i = Ti; - var s = t.filter((h) => !h.settled); +function tu(t, e, n, r) { + const i = Ni; + var s = t.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { r(e.map(i)); return; } - var a = W, o = ( + var a = B, o = ( /** @type {Effect} */ - K - ), l = tu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((h) => h.promise)) : null; - function f(h) { + U + ), l = eu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + function f(c) { l(); try { - r(h); - } catch (v) { - (o.f & Xe) === 0 && lr(v, o); + r(c); + } catch (p) { + (o.f & Ue) === 0 && or(p, o); } - a == null || a.deactivate(), rs(); + a == null || a.deactivate(), ss(); } if (n.length === 0) { u.then(() => f(e.map(i))); return; } - function c() { - l(), Promise.all(n.map((h) => /* @__PURE__ */ eu(h))).then((h) => f([...e.map(i), ...h])).catch((h) => lr(h, o)); + function h() { + l(), Promise.all(n.map((c) => /* @__PURE__ */ nu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => or(c, o)); } - u ? u.then(c) : c(); + u ? u.then(h) : h(); } -function tu() { - var t = K, e = z, n = Yt, r = W; +function eu() { + var t = U, e = V, n = Wt, r = B; return function(s = !0) { - Re(t), te(e), or(n), s && (r == null || r.activate()); + Ne(t), ie(e), ar(n), s && (r == null || r.activate()); }; } -function rs() { - Re(null), te(null), or(null); +function ss() { + Ne(null), ie(null), ar(null); } // @__NO_SIDE_EFFECTS__ -function Ti(t) { - var e = $t | At, n = z !== null && (z.f & $t) !== 0 ? ( +function Ni(t) { + var e = At | Et, n = V !== null && (V.f & At) !== 0 ? ( /** @type {Derived} */ - z + V ) : null; - return K !== null && (K.f |= Vn), { - ctx: Yt, + return U !== null && (U.f |= qn), { + ctx: Wt, deps: null, effects: null, - equals: Ma, + equals: Da, f: e, fn: t, reactions: null, rv: 0, v: ( /** @type {V} */ - wt + bt ), wv: 0, - parent: n ?? K, + parent: n ?? U, ac: null }; } // @__NO_SIDE_EFFECTS__ -function eu(t, e, n) { +function nu(t, e, n) { let r = ( /** @type {Effect | null} */ - K + U ); - r === null && kl(); + r === null && Ml(); var i = ( /** @type {Boundary} */ r.b @@ -922,66 +922,66 @@ function eu(t, e, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = Fn( + ), a = Dn( /** @type {V} */ - wt - ), o = !z, l = /* @__PURE__ */ new Map(); - return cu(() => { - var v; - var u = Ra(); + bt + ), o = !V, l = /* @__PURE__ */ new Map(); + return hu(() => { + var p; + var u = Ta(); s = u.promise; try { Promise.resolve(t()).then(u.resolve, u.reject).then(() => { - f === W && f.committed && f.deactivate(), rs(); + f === B && f.committed && f.deactivate(), ss(); }); } catch (g) { - u.reject(g), rs(); + u.reject(g), ss(); } var f = ( /** @type {Batch} */ - W + B ); if (o) { - var c = i.is_rendered(); - i.update_pending_count(1), f.increment(c), (v = l.get(f)) == null || v.reject(mn), l.delete(f), l.set(f, u); + var h = i.is_rendered(); + i.update_pending_count(1), f.increment(h), (p = l.get(f)) == null || p.reject(_n), l.delete(f), l.set(f, u); } - const h = (g, m = void 0) => { + const c = (g, m = void 0) => { if (f.activate(), m) - m !== mn && (a.f |= sn, ur(a, m)); + m !== _n && (a.f |= an, lr(a, m)); else { - (a.f & sn) !== 0 && (a.f ^= sn), ur(a, g); + (a.f & an) !== 0 && (a.f ^= an), lr(a, g); for (const [b, $] of l) { if (l.delete(b), b === f) break; - $.reject(mn); + $.reject(_n); } } - o && (i.update_pending_count(-1), f.decrement(c)); + o && (i.update_pending_count(-1), f.decrement(h)); }; - u.promise.then(h, (g) => h(null, g || "unknown")); - }), lu(() => { + u.promise.then(c, (g) => c(null, g || "unknown")); + }), uu(() => { for (const u of l.values()) - u.reject(mn); + u.reject(_n); }), new Promise((u) => { - function f(c) { - function h() { - c === s ? u(a) : f(s); + function f(h) { + function c() { + h === s ? u(a) : f(s); } - c.then(h, h); + h.then(c, c); } f(s); }); } // @__NO_SIDE_EFFECTS__ -function Wn(t) { - const e = /* @__PURE__ */ Ti(t); - return co(e), e; +function Bn(t) { + const e = /* @__PURE__ */ Ni(t); + return po(e), e; } // @__NO_SIDE_EFFECTS__ -function Wa(t) { - const e = /* @__PURE__ */ Ti(t); - return e.equals = Pa, e; +function Ga(t) { + const e = /* @__PURE__ */ Ni(t); + return e.equals = Fa, e; } -function nu(t) { +function ru(t) { var e = t.effects; if (e !== null) { t.effects = null; @@ -992,10 +992,10 @@ function nu(t) { ); } } -function ru(t) { +function iu(t) { for (var e = t.parent; e !== null; ) { - if ((e.f & $t) === 0) - return (e.f & Xe) === 0 ? ( + if ((e.f & At) === 0) + return (e.f & Ue) === 0 ? ( /** @type {Effect} */ e ) : null; @@ -1003,127 +1003,127 @@ function ru(t) { } return null; } -function As(t) { - var e, n = K; - Re(ru(t)); +function Rs(t) { + var e, n = U; + Ne(iu(t)); try { - t.f &= ~Dn, nu(t), e = go(t); + t.f &= ~Pn, ru(t), e = mo(t); } finally { - Re(n); + Ne(n); } return e; } -function Xa(t) { - var e = As(t); - if (!t.equals(e) && (t.wv = po(), (!(W != null && W.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { - ot(t, gt); +function Ka(t) { + var e = Rs(t); + if (!t.equals(e) && (t.wv = go(), (!(B != null && B.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { + lt(t, mt); return; } - on || (bt !== null ? (Rs() || W != null && W.is_fork) && bt.set(t, e) : $s(t)); + ln || ($t !== null ? (Ts() || B != null && B.is_fork) && $t.set(t, e) : Es(t)); } -function iu(t) { +function su(t) { var e, n; if (t.effects !== null) for (const r of t.effects) - (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(mn), r.teardown = Rl, r.ac = null, Mr(r, 0), Ss(r)); + (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(_n), r.teardown = Cl, r.ac = null, kr(r, 0), Ms(r)); } -function Ga(t) { +function Za(t) { if (t.effects !== null) for (const e of t.effects) - e.teardown && fr(e); + e.teardown && ur(e); } -let is = /* @__PURE__ */ new Set(); -const an = /* @__PURE__ */ new Map(); -let Ka = !1; -function Fn(t, e) { +let as = /* @__PURE__ */ new Set(); +const on = /* @__PURE__ */ new Map(); +let ja = !1; +function Dn(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: t, reactions: null, - equals: Ma, + equals: Da, rv: 0, wv: 0 }; return n; } // @__NO_SIDE_EFFECTS__ -function xt(t, e) { - const n = Fn(t); - return co(n), n; +function _t(t, e) { + const n = Dn(t); + return po(n), n; } // @__NO_SIDE_EFFECTS__ -function ja(t, e = !1, n = !0) { - const r = Fn(t); - return e || (r.equals = Pa), r; +function Ja(t, e = !1, n = !0) { + const r = Dn(t); + return e || (r.equals = Fa), r; } -function ut(t, e, n = !1) { - z !== null && // since we are untracking the function inside `$inspect.with` we need to add this check +function ot(t, e, n = !1) { + V !== 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 - (!ue || (z.f & Ws) !== 0) && Da() && (z.f & ($t | je | ws | Ws)) !== 0 && (Jt === null || !sr.call(Jt, t)) && zl(); - let r = n ? wn(e) : e; - return ur(t, r); + (!he || (V.f & Gs) !== 0) && Oa() && (V.f & (At | Ze | bs | Gs)) !== 0 && (ne === null || !ir.call(ne, t)) && Hl(); + let r = n ? yn(e) : e; + return lr(t, r); } -function ur(t, e) { +function lr(t, e) { if (!t.equals(e)) { var n = t.v; - on ? an.set(t, e) : an.set(t, n), t.v = e; + ln ? on.set(t, e) : on.set(t, n), t.v = e; var r = Ge.ensure(); - if (r.capture(t, n), (t.f & $t) !== 0) { + if (r.capture(t, n), (t.f & At) !== 0) { const i = ( /** @type {Derived} */ t ); - (t.f & At) !== 0 && As(i), $s(i); + (t.f & Et) !== 0 && Rs(i), Es(i); } - t.wv = po(), Za(t, At), K !== null && (K.f & gt) !== 0 && (K.f & (ce | ln)) === 0 && (Xt === null ? pu([t]) : Xt.push(t)), !r.is_fork && is.size > 0 && !Ka && su(); + t.wv = go(), Qa(t, Et), U !== null && (U.f & mt) !== 0 && (U.f & (pe | un)) === 0 && (jt === null ? vu([t]) : jt.push(t)), !r.is_fork && as.size > 0 && !ja && au(); } return e; } -function su() { - Ka = !1; - for (const t of is) - (t.f & gt) !== 0 && ot(t, fe), Yr(t) && fr(t); - is.clear(); +function au() { + ja = !1; + for (const t of as) + (t.f & mt) !== 0 && lt(t, de), Hr(t) && ur(t); + as.clear(); } -function Sr(t) { - ut(t, t.v + 1); +function Nr(t) { + ot(t, t.v + 1); } -function Za(t, e) { +function Qa(t, e) { var n = t.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & At) === 0; - if (o && ot(s, e), (a & $t) !== 0) { + var s = n[i], a = s.f, o = (a & Et) === 0; + if (o && lt(s, e), (a & At) !== 0) { var l = ( /** @type {Derived} */ s ); - bt == null || bt.delete(l), (a & Dn) === 0 && (a & Zt && (s.f |= Dn), Za(l, fe)); - } else o && ((a & je) !== 0 && ie !== null && ie.add( + $t == null || $t.delete(l), (a & Pn) === 0 && (a & ee && (s.f |= Pn), Qa(l, de)); + } else o && ((a & Ze) !== 0 && oe !== null && oe.add( /** @type {Effect} */ s - ), le( + ), ce( /** @type {Effect} */ s )); } } -function wn(t) { - if (typeof t != "object" || t === null || Tr in t) +function yn(t) { + if (typeof t != "object" || t === null || Cr in t) return t; - const e = El(t); - if (e !== $l && e !== Al) + const e = Rl(t); + if (e !== Al && e !== El) return t; - var n = /* @__PURE__ */ new Map(), r = Ea(t), i = /* @__PURE__ */ xt(0), s = Mn, a = (o) => { - if (Mn === s) + var n = /* @__PURE__ */ new Map(), r = Ca(t), i = /* @__PURE__ */ _t(0), s = kn, a = (o) => { + if (kn === s) return o(); - var l = z, u = Mn; - te(null), js(s); + var l = V, u = kn; + ie(null), Js(s); var f = o(); - return te(l), js(u), f; + return ie(l), Js(u), f; }; - return r && n.set("length", /* @__PURE__ */ xt( + return r && n.set("length", /* @__PURE__ */ _t( /** @type {any[]} */ t.length )), new Proxy( @@ -1131,35 +1131,35 @@ function wn(t) { t, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && ql(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Vl(); var f = n.get(l); return f === void 0 ? a(() => { - var c = /* @__PURE__ */ xt(u.value); - return n.set(l, c), c; - }) : ut(f, u.value, !0), !0; + var h = /* @__PURE__ */ _t(u.value); + return n.set(l, h), h; + }) : ot(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__ */ xt(wt)); - n.set(l, f), Sr(i); + const f = a(() => /* @__PURE__ */ _t(bt)); + n.set(l, f), Nr(i); } } else - ut(u, wt), Sr(i); + ot(u, bt), Nr(i); return !0; }, get(o, l, u) { - var v; - if (l === Tr) + var p; + if (l === Cr) return t; - var f = n.get(l), c = l in o; - if (f === void 0 && (!c || (v = Nn(o, l)) != null && v.writable) && (f = a(() => { - var g = wn(c ? o[l] : wt), m = /* @__PURE__ */ xt(g); + var f = n.get(l), h = l in o; + if (f === void 0 && (!h || (p = Tn(o, l)) != null && p.writable) && (f = a(() => { + var g = yn(h ? o[l] : bt), m = /* @__PURE__ */ _t(g); return m; }), n.set(l, f)), f !== void 0) { - var h = x(f); - return h === wt ? void 0 : h; + var c = x(f); + return c === bt ? void 0 : c; } return Reflect.get(o, l, u); }, @@ -1169,201 +1169,201 @@ function wn(t) { var f = n.get(l); f && (u.value = x(f)); } else if (u === void 0) { - var c = n.get(l), h = c == null ? void 0 : c.v; - if (c !== void 0 && h !== wt) + var h = n.get(l), c = h == null ? void 0 : h.v; + if (h !== void 0 && c !== bt) return { enumerable: !0, configurable: !0, - value: h, + value: c, writable: !0 }; } return u; }, has(o, l) { - var h; - if (l === Tr) + var c; + if (l === Cr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== wt || Reflect.has(o, l); - if (u !== void 0 || K !== null && (!f || (h = Nn(o, l)) != null && h.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== bt || Reflect.has(o, l); + if (u !== void 0 || U !== null && (!f || (c = Tn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { - var v = f ? wn(o[l]) : wt, g = /* @__PURE__ */ xt(v); + var p = f ? yn(o[l]) : bt, g = /* @__PURE__ */ _t(p); return g; }), n.set(l, u)); - var c = x(u); - if (c === wt) + var h = x(u); + if (h === bt) return !1; } return f; }, set(o, l, u, f) { var E; - var c = n.get(l), h = l in o; + var h = n.get(l), c = l in o; if (r && l === "length") - for (var v = u; v < /** @type {Source} */ - c.v; v += 1) { - var g = n.get(v + ""); - g !== void 0 ? ut(g, wt) : v in o && (g = a(() => /* @__PURE__ */ xt(wt)), n.set(v + "", g)); + for (var p = u; p < /** @type {Source} */ + h.v; p += 1) { + var g = n.get(p + ""); + g !== void 0 ? ot(g, bt) : p in o && (g = a(() => /* @__PURE__ */ _t(bt)), n.set(p + "", g)); } - if (c === void 0) - (!h || (E = Nn(o, l)) != null && E.writable) && (c = a(() => /* @__PURE__ */ xt(void 0)), ut(c, wn(u)), n.set(l, c)); + if (h === void 0) + (!c || (E = Tn(o, l)) != null && E.writable) && (h = a(() => /* @__PURE__ */ _t(void 0)), ot(h, yn(u)), n.set(l, h)); else { - h = c.v !== wt; - var m = a(() => wn(u)); - ut(c, m); + c = h.v !== bt; + var m = a(() => yn(u)); + ot(h, m); } var b = Reflect.getOwnPropertyDescriptor(o, l); - if (b != null && b.set && b.set.call(f, u), !h) { + if (b != null && b.set && b.set.call(f, u), !c) { if (r && typeof l == "string") { var $ = ( /** @type {Source} */ n.get("length") ), R = Number(l); - Number.isInteger(R) && R >= $.v && ut($, R + 1); + Number.isInteger(R) && R >= $.v && ot($, R + 1); } - Sr(i); + Nr(i); } return !0; }, ownKeys(o) { x(i); - var l = Reflect.ownKeys(o).filter((c) => { - var h = n.get(c); - return h === void 0 || h.v !== wt; + var l = Reflect.ownKeys(o).filter((h) => { + var c = n.get(h); + return c === void 0 || c.v !== bt; }); for (var [u, f] of n) - f.v !== wt && !(u in o) && l.push(u); + f.v !== bt && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - Vl(); + Yl(); } } ); } -var Gs, Ja, Qa, to; -function ss() { - if (Gs === void 0) { - Gs = window, Ja = /Firefox/.test(navigator.userAgent); +var Zs, to, eo, no; +function os() { + if (Zs === void 0) { + Zs = window, to = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype, n = Text.prototype; - Qa = Nn(e, "firstChild").get, to = Nn(e, "nextSibling").get, Us(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Us(n) && (n.__t = void 0); + eo = Tn(e, "firstChild").get, no = Tn(e, "nextSibling").get, Us(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Us(n) && (n.__t = void 0); } } -function Qt(t = "") { +function re(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function On(t) { +function Fn(t) { return ( /** @type {TemplateNode | null} */ - Qa.call(t) + eo.call(t) ); } // @__NO_SIDE_EFFECTS__ -function Te(t) { +function ke(t) { return ( /** @type {TemplateNode | null} */ - to.call(t) + no.call(t) ); } -function Lt(t, e) { - if (!Z) - return /* @__PURE__ */ On(t); - var n = /* @__PURE__ */ On(H); +function Yt(t, e) { + if (!j) + return /* @__PURE__ */ Fn(t); + var n = /* @__PURE__ */ Fn(Y); if (n === null) - n = H.appendChild(Qt()); - else if (e && n.nodeType !== Hr) { - var r = Qt(); - return n == null || n.before(r), Ot(r), r; + n = Y.appendChild(re()); + else if (e && n.nodeType !== Yr) { + var r = re(); + return n == null || n.before(r), Lt(r), r; } - return e && Ni( + return e && Si( /** @type {Text} */ n - ), Ot(n), n; + ), Lt(n), n; } -function vn(t, e = !1) { - if (!Z) { - var n = /* @__PURE__ */ On(t); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Te(n) : n; +function pn(t, e = !1) { + if (!j) { + var n = /* @__PURE__ */ Fn(t); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ke(n) : n; } if (e) { - if ((H == null ? void 0 : H.nodeType) !== Hr) { - var r = Qt(); - return H == null || H.before(r), Ot(r), r; + if ((Y == null ? void 0 : Y.nodeType) !== Yr) { + var r = re(); + return Y == null || Y.before(r), Lt(r), r; } - Ni( + Si( /** @type {Text} */ - H + Y ); } - return H; + return Y; } -function re(t, e = 1, n = !1) { - let r = Z ? H : t; +function ae(t, e = 1, n = !1) { + let r = j ? Y : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Te(r); - if (!Z) + /* @__PURE__ */ ke(r); + if (!j) return r; if (n) { - if ((r == null ? void 0 : r.nodeType) !== Hr) { - var s = Qt(); - return r === null ? i == null || i.after(s) : r.before(s), Ot(s), s; + if ((r == null ? void 0 : r.nodeType) !== Yr) { + var s = re(); + return r === null ? i == null || i.after(s) : r.before(s), Lt(s), s; } - Ni( + Si( /** @type {Text} */ r ); } - return Ot(r), r; + return Lt(r), r; } -function eo(t) { +function ro(t) { t.textContent = ""; } -function no() { +function io() { return !1; } -function Es(t, e, n) { +function Cs(t, e, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(xl, t, void 0) + document.createElementNS(bl, t, void 0) ); } -function Ni(t) { +function Si(t) { if ( /** @type {string} */ t.nodeValue.length < 65536 ) return; let e = t.nextSibling; - for (; e !== null && e.nodeType === Hr; ) + for (; e !== null && e.nodeType === Yr; ) e.remove(), t.nodeValue += /** @type {string} */ e.nodeValue, e = t.nextSibling; } -function ro(t) { - var e = z, n = K; - te(null), Re(null); +function so(t) { + var e = V, n = U; + ie(null), Ne(null); try { return t(); } finally { - te(e), Re(n); + ie(e), Ne(n); } } -function au(t) { - K === null && (z === null && Fl(), Dl()), on && Pl(); +function ou(t) { + U === null && (V === null && Ol(), Fl()), ln && Dl(); } -function ou(t, e) { +function lu(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function Ne(t, e, n) { - var r = K; - r !== null && (r.f & Ht) !== 0 && (t |= Ht); +function Me(t, e, n) { + var r = U; + r !== null && (r.f & Bt) !== 0 && (t |= Bt); var i = { - ctx: Yt, + ctx: Wt, deps: null, nodes: null, - f: t | At | Zt, + f: t | Et | ee, first: null, fn: e, last: null, @@ -1377,141 +1377,141 @@ function Ne(t, e, n) { }; if (n) try { - fr(i); + ur(i); } catch (o) { throw St(i), o; } - else e !== null && le(i); + else e !== null && ce(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 & Vn) === 0 && (s = s.first, (t & je) !== 0 && (t & ar) !== 0 && s !== null && (s.f |= ar)), s !== null && (s.parent = r, r !== null && ou(s, r), z !== null && (z.f & $t) !== 0 && (t & ln) === 0)) { + (s.f & qn) === 0 && (s = s.first, (t & Ze) !== 0 && (t & sr) !== 0 && s !== null && (s.f |= sr)), s !== null && (s.parent = r, r !== null && lu(s, r), V !== null && (V.f & At) !== 0 && (t & un) === 0)) { var a = ( /** @type {Derived} */ - z + V ); (a.effects ?? (a.effects = [])).push(s); } return i; } -function Rs() { - return z !== null && !ue; +function Ts() { + return V !== null && !he; } -function lu(t) { - const e = Ne(Ai, null, !1); - return ot(e, gt), e.teardown = t, e; +function uu(t) { + const e = Me(Ei, null, !1); + return lt(e, mt), e.teardown = t, e; } -function Cs(t) { - au(); +function Ns(t) { + ou(); var e = ( /** @type {Effect} */ - K.f - ), n = !z && (e & ce) !== 0 && (e & dr) === 0; + U.f + ), n = !V && (e & pe) !== 0 && (e & hr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - Yt + Wt ); (r.e ?? (r.e = [])).push(t); } else - return io(t); + return ao(t); } -function io(t) { - return Ne(kr | Nl, t, !1); +function ao(t) { + return Me(Sr | Sl, t, !1); } -function uu(t) { +function fu(t) { Ge.ensure(); - const e = Ne(ln | Vn, t, !0); + const e = Me(un | qn, t, !0); return () => { St(e); }; } -function fu(t) { +function cu(t) { Ge.ensure(); - const e = Ne(ln | Vn, t, !0); + const e = Me(un | qn, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? kn(e, () => { + n.outro ? Sn(e, () => { St(e), r(void 0); }) : (St(e), r(void 0)); }); } -function so(t) { - return Ne(kr, t, !1); +function oo(t) { + return Me(Sr, t, !1); } -function cu(t) { - return Ne(ws | Vn, t, !0); +function hu(t) { + return Me(bs | qn, t, !0); } -function Ts(t, e = 0) { - return Ne(Ai | e, t, !0); +function Ss(t, e = 0) { + return Me(Ei | e, t, !0); } -function Xn(t, e = [], n = [], r = []) { - Ql(r, e, n, (i) => { - Ne(Ai, () => t(...i.map(x)), !0); +function Wn(t, e = [], n = [], r = []) { + tu(r, e, n, (i) => { + Me(Ei, () => t(...i.map(x)), !0); }); } -function Ns(t, e = 0) { - var n = Ne(je | e, t, !0); +function ks(t, e = 0) { + var n = Me(Ze | e, t, !0); return n; } -function jt(t) { - return Ne(ce | Vn, t, !0); +function te(t) { + return Me(pe | qn, t, !0); } -function ao(t) { +function lo(t) { var e = t.teardown; if (e !== null) { - const n = on, r = z; - Ks(!0), te(null); + const n = ln, r = V; + js(!0), ie(null); try { e.call(null); } finally { - Ks(n), te(r); + js(n), ie(r); } } } -function Ss(t, e = !1) { +function Ms(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { const i = n.ac; - i !== null && ro(() => { - i.abort(mn); + i !== null && so(() => { + i.abort(_n); }); var r = n.next; - (n.f & ln) !== 0 ? n.parent = null : St(n, e), n = r; + (n.f & un) !== 0 ? n.parent = null : St(n, e), n = r; } } -function hu(t) { +function du(t) { for (var e = t.first; e !== null; ) { var n = e.next; - (e.f & ce) === 0 && St(e), e = n; + (e.f & pe) === 0 && St(e), e = n; } } function St(t, e = !0) { var n = !1; - (e || (t.f & Na) !== 0) && t.nodes !== null && t.nodes.end !== null && (du( + (e || (t.f & ka) !== 0) && t.nodes !== null && t.nodes.end !== null && (pu( t.nodes.start, /** @type {TemplateNode} */ t.nodes.end - ), n = !0), Ss(t, e && !n), Mr(t, 0), ot(t, Xe); + ), n = !0), Ms(t, e && !n), kr(t, 0), lt(t, Ue); var r = t.nodes && t.nodes.t; if (r !== null) for (const s of r) s.stop(); - ao(t); + lo(t); var i = t.parent; - i !== null && i.first !== null && oo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; + i !== null && i.first !== null && uo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; } -function du(t, e) { +function pu(t, e) { for (; t !== null; ) { - var n = t === e ? null : /* @__PURE__ */ Te(t); + var n = t === e ? null : /* @__PURE__ */ ke(t); t.remove(), t = n; } } -function oo(t) { +function uo(t) { var e = t.parent, n = t.prev, r = t.next; n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); } -function kn(t, e, n = !0) { +function Sn(t, e, n = !0) { var r = []; - lo(t, r, !0); + fo(t, r, !0); var i = () => { n && St(t), e && e(); }, s = r.length; @@ -1522,31 +1522,31 @@ function kn(t, e, n = !0) { } else i(); } -function lo(t, e, n) { - if ((t.f & Ht) === 0) { - t.f ^= Ht; +function fo(t, e, n) { + if ((t.f & Bt) === 0) { + t.f ^= Bt; var r = t.nodes && t.nodes.t; if (r !== null) for (const o of r) (o.is_global || n) && e.push(o); for (var i = t.first; i !== null; ) { - var s = i.next, a = (i.f & ar) !== 0 || // If this is a branch effect without a block effect parent, + var s = i.next, a = (i.f & sr) !== 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 & ce) !== 0 && (t.f & je) !== 0; - lo(i, e, a ? n : !1), i = s; + (i.f & pe) !== 0 && (t.f & Ze) !== 0; + fo(i, e, a ? n : !1), i = s; } } } -function ks(t) { - uo(t, !0); +function Ps(t) { + co(t, !0); } -function uo(t, e) { - if ((t.f & Ht) !== 0) { - t.f ^= Ht, (t.f & gt) === 0 && (ot(t, At), le(t)); +function co(t, e) { + if ((t.f & Bt) !== 0) { + t.f ^= Bt, (t.f & mt) === 0 && (lt(t, Et), ce(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & ar) !== 0 || (n.f & ce) !== 0; - uo(n, i ? e : !1), n = r; + var r = n.next, i = (n.f & sr) !== 0 || (n.f & pe) !== 0; + co(n, i ? e : !1), n = r; } var s = t.nodes && t.nodes.t; if (s !== null) @@ -1554,249 +1554,249 @@ function uo(t, e) { (a.is_global || e) && a.in(); } } -function fo(t, e) { +function ho(t, e) { if (t.nodes) for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Te(n); + var i = n === r ? null : /* @__PURE__ */ ke(n); e.append(n), n = i; } } -let ei = !1, on = !1; -function Ks(t) { - on = t; +let ni = !1, ln = !1; +function js(t) { + ln = t; } -let z = null, ue = !1; -function te(t) { - z = t; +let V = null, he = !1; +function ie(t) { + V = t; } -let K = null; -function Re(t) { - K = t; +let U = null; +function Ne(t) { + U = t; } -let Jt = null; -function co(t) { - z !== null && (Jt === null ? Jt = [t] : Jt.push(t)); +let ne = null; +function po(t) { + V !== null && (ne === null ? ne = [t] : ne.push(t)); } -let Dt = null, qt = 0, Xt = null; -function pu(t) { - Xt = t; +let Ot = null, Ht = 0, jt = null; +function vu(t) { + jt = t; } -let ho = 1, xn = 0, Mn = xn; -function js(t) { - Mn = t; +let vo = 1, wn = 0, kn = wn; +function Js(t) { + kn = t; } -function po() { - return ++ho; +function go() { + return ++vo; } -function Yr(t) { +function Hr(t) { var e = t.f; - if ((e & At) !== 0) + if ((e & Et) !== 0) return !0; - if (e & $t && (t.f &= ~Dn), (e & fe) !== 0) { + if (e & At && (t.f &= ~Pn), (e & de) !== 0) { for (var n = ( /** @type {Value[]} */ t.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (Yr( + if (Hr( /** @type {Derived} */ s - ) && Xa( + ) && Ka( /** @type {Derived} */ s ), s.wv > t.wv) return !0; } - (e & Zt) !== 0 && // During time traveling we don't want to reset the status so that + (e & ee) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - bt === null && ot(t, gt); + $t === null && lt(t, mt); } return !1; } -function vo(t, e, n = !0) { +function _o(t, e, n = !0) { var r = t.reactions; - if (r !== null && !(Jt !== null && sr.call(Jt, t))) + if (r !== null && !(ne !== null && ir.call(ne, t))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & $t) !== 0 ? vo( + (s.f & At) !== 0 ? _o( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? ot(s, At) : (s.f & gt) !== 0 && ot(s, fe), le( + ) : e === s && (n ? lt(s, Et) : (s.f & mt) !== 0 && lt(s, de), ce( /** @type {Effect} */ s )); } } -function go(t) { +function mo(t) { var m; - var e = Dt, n = qt, r = Xt, i = z, s = Jt, a = Yt, o = ue, l = Mn, u = t.f; - Dt = /** @type {null | Value[]} */ - null, qt = 0, Xt = null, z = (u & (ce | ln)) === 0 ? t : null, Jt = null, or(t.ctx), ue = !1, Mn = ++xn, t.ac !== null && (ro(() => { - t.ac.abort(mn); + var e = Ot, n = Ht, r = jt, i = V, s = ne, a = Wt, o = he, l = kn, u = t.f; + Ot = /** @type {null | Value[]} */ + null, Ht = 0, jt = null, V = (u & (pe | un)) === 0 ? t : null, ne = null, ar(t.ctx), he = !1, kn = ++wn, t.ac !== null && (so(() => { + t.ac.abort(_n); }), t.ac = null); try { - t.f |= ji; + t.f |= Ji; var f = ( /** @type {Function} */ t.fn - ), c = f(); - t.f |= dr; - var h = t.deps, v = W == null ? void 0 : W.is_fork; - if (Dt !== null) { + ), h = f(); + t.f |= hr; + var c = t.deps, p = B == null ? void 0 : B.is_fork; + if (Ot !== null) { var g; - if (v || Mr(t, qt), h !== null && qt > 0) - for (h.length = qt + Dt.length, g = 0; g < Dt.length; g++) - h[qt + g] = Dt[g]; + if (p || kr(t, Ht), c !== null && Ht > 0) + for (c.length = Ht + Ot.length, g = 0; g < Ot.length; g++) + c[Ht + g] = Ot[g]; else - t.deps = h = Dt; - if (Rs() && (t.f & Zt) !== 0) - for (g = qt; g < h.length; g++) - ((m = h[g]).reactions ?? (m.reactions = [])).push(t); - } else !v && h !== null && qt < h.length && (Mr(t, qt), h.length = qt); - if (Da() && Xt !== null && !ue && h !== null && (t.f & ($t | fe | At)) === 0) + t.deps = c = Ot; + if (Ts() && (t.f & ee) !== 0) + for (g = Ht; g < c.length; g++) + ((m = c[g]).reactions ?? (m.reactions = [])).push(t); + } else !p && c !== null && Ht < c.length && (kr(t, Ht), c.length = Ht); + if (Oa() && jt !== null && !he && c !== null && (t.f & (At | de | Et)) === 0) for (g = 0; g < /** @type {Source[]} */ - Xt.length; g++) - vo( - Xt[g], + jt.length; g++) + _o( + jt[g], /** @type {Effect} */ t ); if (i !== null && i !== t) { - if (xn++, i.deps !== null) + if (wn++, i.deps !== null) for (let b = 0; b < n; b += 1) - i.deps[b].rv = xn; + i.deps[b].rv = wn; if (e !== null) for (const b of e) - b.rv = xn; - Xt !== null && (r === null ? r = Xt : r.push(.../** @type {Source[]} */ - Xt)); + b.rv = wn; + jt !== null && (r === null ? r = jt : r.push(.../** @type {Source[]} */ + jt)); } - return (t.f & sn) !== 0 && (t.f ^= sn), c; + return (t.f & an) !== 0 && (t.f ^= an), h; } catch (b) { - return Oa(b); + return La(b); } finally { - t.f ^= ji, Dt = e, qt = n, Xt = r, z = i, Jt = s, or(a), ue = o, Mn = l; + t.f ^= Ji, Ot = e, Ht = n, jt = r, V = i, ne = s, ar(a), he = o, kn = l; } } -function vu(t, e) { +function gu(t, e) { let n = e.reactions; if (n !== null) { - var r = bl.call(n, t); + var r = $l.call(n, t); if (r !== -1) { var i = n.length - 1; i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (e.f & $t) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (e.f & At) !== 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 - (Dt === null || !sr.call(Dt, e))) { + (Ot === null || !ir.call(Ot, e))) { var s = ( /** @type {Derived} */ e ); - (s.f & Zt) !== 0 && (s.f ^= Zt, s.f &= ~Dn), $s(s), iu(s), Mr(s, 0); + (s.f & ee) !== 0 && (s.f ^= ee, s.f &= ~Pn), Es(s), su(s), kr(s, 0); } } -function Mr(t, e) { +function kr(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - vu(t, n[r]); + gu(t, n[r]); } -function fr(t) { +function ur(t) { var e = t.f; - if ((e & Xe) === 0) { - ot(t, gt); - var n = K, r = ei; - K = t, ei = !0; + if ((e & Ue) === 0) { + lt(t, mt); + var n = U, r = ni; + U = t, ni = !0; try { - (e & (je | Ca)) !== 0 ? hu(t) : Ss(t), ao(t); - var i = go(t); - t.teardown = typeof i == "function" ? i : null, t.wv = ho; + (e & (Ze | Na)) !== 0 ? du(t) : Ms(t), lo(t); + var i = mo(t); + t.teardown = typeof i == "function" ? i : null, t.wv = vo; var s; - Ki && Ul && (t.f & At) !== 0 && t.deps; + ji && Wl && (t.f & Et) !== 0 && t.deps; } finally { - ei = r, K = n; + ni = r, U = n; } } } function x(t) { - var e = t.f, n = (e & $t) !== 0; - if (z !== null && !ue) { - var r = K !== null && (K.f & Xe) !== 0; - if (!r && (Jt === null || !sr.call(Jt, t))) { - var i = z.deps; - if ((z.f & ji) !== 0) - t.rv < xn && (t.rv = xn, Dt === null && i !== null && i[qt] === t ? qt++ : Dt === null ? Dt = [t] : Dt.push(t)); + var e = t.f, n = (e & At) !== 0; + if (V !== null && !he) { + var r = U !== null && (U.f & Ue) !== 0; + if (!r && (ne === null || !ir.call(ne, t))) { + var i = V.deps; + if ((V.f & Ji) !== 0) + t.rv < wn && (t.rv = wn, Ot === null && i !== null && i[Ht] === t ? Ht++ : Ot === null ? Ot = [t] : Ot.push(t)); else { - (z.deps ?? (z.deps = [])).push(t); + (V.deps ?? (V.deps = [])).push(t); var s = t.reactions; - s === null ? t.reactions = [z] : sr.call(s, z) || s.push(z); + s === null ? t.reactions = [V] : ir.call(s, V) || s.push(V); } } } - if (on && an.has(t)) - return an.get(t); + if (ln && on.has(t)) + return on.get(t); if (n) { var a = ( /** @type {Derived} */ t ); - if (on) { + if (ln) { var o = a.v; - return ((a.f & gt) === 0 && a.reactions !== null || mo(a)) && (o = As(a)), an.set(a, o), o; + return ((a.f & mt) === 0 && a.reactions !== null || wo(a)) && (o = Rs(a)), on.set(a, o), o; } - var l = (a.f & Zt) === 0 && !ue && z !== null && (ei || (z.f & Zt) !== 0), u = (a.f & dr) === 0; - Yr(a) && (l && (a.f |= Zt), Xa(a)), l && !u && (Ga(a), _o(a)); + var l = (a.f & ee) === 0 && !he && V !== null && (ni || (V.f & ee) !== 0), u = (a.f & hr) === 0; + Hr(a) && (l && (a.f |= ee), Ka(a)), l && !u && (Za(a), yo(a)); } - if (bt != null && bt.has(t)) - return bt.get(t); - if ((t.f & sn) !== 0) + if ($t != null && $t.has(t)) + return $t.get(t); + if ((t.f & an) !== 0) throw t.v; return t.v; } -function _o(t) { - if (t.f |= Zt, t.deps !== null) +function yo(t) { + if (t.f |= ee, t.deps !== null) for (const e of t.deps) - (e.reactions ?? (e.reactions = [])).push(t), (e.f & $t) !== 0 && (e.f & Zt) === 0 && (Ga( + (e.reactions ?? (e.reactions = [])).push(t), (e.f & At) !== 0 && (e.f & ee) === 0 && (Za( /** @type {Derived} */ e - ), _o( + ), yo( /** @type {Derived} */ e )); } -function mo(t) { - if (t.v === wt) return !0; +function wo(t) { + if (t.v === bt) return !0; if (t.deps === null) return !1; for (const e of t.deps) - if (an.has(e) || (e.f & $t) !== 0 && mo( + if (on.has(e) || (e.f & At) !== 0 && wo( /** @type {Derived} */ e )) return !0; return !1; } -function Si(t) { - var e = ue; +function ki(t) { + var e = he; try { - return ue = !0, t(); + return he = !0, t(); } finally { - ue = e; + he = e; } } -const yo = /* @__PURE__ */ new Set(), as = /* @__PURE__ */ new Set(); -function gu(t) { +const xo = /* @__PURE__ */ new Set(), ls = /* @__PURE__ */ new Set(); +function _u(t) { for (var e = 0; e < t.length; e++) - yo.add(t[e]); - for (var n of as) + xo.add(t[e]); + for (var n of ls) n(t); } -let Zs = null; -function Js(t) { +let Qs = null; +function ta(t) { var b; var e = this, n = ( /** @type {Node} */ @@ -1805,8 +1805,8 @@ function Js(t) { /** @type {null | Element} */ i[0] || t.target ); - Zs = t; - var a = 0, o = Zs === t && t.__root; + Qs = t; + var a = 0, o = Qs === t && t.__root; if (o) { var l = i.indexOf(o); if (l !== -1 && (e === document || e === /** @type {any} */ @@ -1821,16 +1821,16 @@ function Js(t) { } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - fi(t, "currentTarget", { + ci(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = z, c = K; - te(null), Re(null); + var f = V, h = U; + ie(null), Ne(null); try { - for (var h, v = []; s !== null; ) { + for (var c, p = []; s !== null; ) { var g = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { @@ -1840,119 +1840,119 @@ function Js(t) { // -> the target could not have been disabled because it emits the event in the first place t.target === s) && m.call(s, t); } catch ($) { - h ? v.push($) : h = $; + c ? p.push($) : c = $; } if (t.cancelBubble || g === e || g === null) break; s = g; } - if (h) { - for (let $ of v) + if (c) { + for (let $ of p) queueMicrotask(() => { throw $; }); - throw h; + throw c; } } finally { - t.__root = e, delete t.currentTarget, te(f), Re(c); + t.__root = e, delete t.currentTarget, ie(f), Ne(h); } } } -var $a, Aa; -const Hi = (Aa = ($a = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : $a.trustedTypes) == null ? void 0 : /* @__PURE__ */ Aa.createPolicy( +var Ea, Ra; +const Xi = (Ra = (Ea = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ea.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ra.createPolicy( "svelte-trusted-html", { /** @param {string} html */ createHTML: (t) => t } ); -function _u(t) { +function mu(t) { return ( /** @type {string} */ - (Hi == null ? void 0 : Hi.createHTML(t)) ?? t + (Xi == null ? void 0 : Xi.createHTML(t)) ?? t ); } -function wo(t, e = !1) { - var n = Es("template"); - return t = t.replaceAll("", ""), n.innerHTML = e ? _u(t) : t, n.content; +function bo(t, e = !1) { + var n = Cs("template"); + return t = t.replaceAll("", ""), n.innerHTML = e ? mu(t) : t, n.content; } -function In(t, e) { +function On(t, e) { var n = ( /** @type {Effect} */ - K + U ); n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function zn(t, e) { - var n = (e & wl) !== 0, r, i = !t.startsWith(""); +function Vn(t, e) { + var n = (e & xl) !== 0, r, i = !t.startsWith(""); return () => { - if (Z) - return In(H, null), H; - r === void 0 && (r = wo(i ? t : "" + t, !0)); + if (j) + return On(Y, null), Y; + r === void 0 && (r = bo(i ? t : "" + t, !0)); var s = ( /** @type {TemplateNode} */ - n || Ja ? document.importNode(r, !0) : r.cloneNode(!0) + n || to ? document.importNode(r, !0) : r.cloneNode(!0) ); { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ On(s) + /* @__PURE__ */ Fn(s) ), o = ( /** @type {TemplateNode} */ s.lastChild ); - In(a, o); + On(a, o); } return s; }; } // @__NO_SIDE_EFFECTS__ -function mu(t, e, n = "svg") { +function yu(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { - if (Z) - return In(H, null), H; + if (j) + return On(Y, null), Y; if (!s) { var a = ( /** @type {DocumentFragment} */ - wo(i, !0) + bo(i, !0) ), o = ( /** @type {Element} */ - /* @__PURE__ */ On(a) + /* @__PURE__ */ Fn(a) ); s = /** @type {Element} */ - /* @__PURE__ */ On(o); + /* @__PURE__ */ Fn(o); } var l = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return In(l, l), l; + return On(l, l), l; }; } // @__NO_SIDE_EFFECTS__ -function yu(t, e) { - return /* @__PURE__ */ mu(t, e, "svg"); +function wu(t, e) { + return /* @__PURE__ */ yu(t, e, "svg"); } -function Qs(t = "") { - if (!Z) { - var e = Qt(t + ""); - return In(e, e), e; +function ea(t = "") { + if (!j) { + var e = re(t + ""); + return On(e, e), e; } - var n = H; - return n.nodeType !== Hr ? (n.before(n = Qt()), Ot(n)) : Ni( + var n = Y; + return n.nodeType !== Yr ? (n.before(n = re()), Lt(n)) : Si( /** @type {Text} */ n - ), In(n, n), n; + ), On(n, n), n; } -function se(t, e) { - if (Z) { +function le(t, e) { + if (j) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ - K + U ); - ((n.f & dr) === 0 || n.nodes.end === null) && (n.nodes.end = H), Ri(); + ((n.f & hr) === 0 || n.nodes.end === null) && (n.nodes.end = Y), Ci(); return; } t !== null && t.before( @@ -1960,110 +1960,110 @@ function se(t, e) { e ); } -const wu = ["touchstart", "touchmove"]; -function xu(t) { - return wu.includes(t); +const xu = ["touchstart", "touchmove"]; +function bu(t) { + return xu.includes(t); } -function tn(t, e) { +function en(t, e) { var n = e == null ? "" : typeof e == "object" ? e + "" : e; n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); } -function xo(t, e) { - return bo(t, e); +function $o(t, e) { + return Ao(t, e); } -function bu(t, e) { - ss(), e.intro = e.intro ?? !1; - const n = e.target, r = Z, i = H; +function $u(t, e) { + os(), e.intro = e.intro ?? !1; + const n = e.target, r = j, i = Y; try { - for (var s = /* @__PURE__ */ On(n); s && (s.nodeType !== pr || /** @type {Comment} */ - s.data !== ms); ) - s = /* @__PURE__ */ Te(s); + for (var s = /* @__PURE__ */ Fn(n); s && (s.nodeType !== dr || /** @type {Comment} */ + s.data !== ws); ) + s = /* @__PURE__ */ ke(s); if (!s) - throw ir; - We(!0), Ot( + throw rr; + We(!0), Lt( /** @type {Comment} */ s ); - const a = bo(t, { ...e, anchor: s }); + const a = Ao(t, { ...e, anchor: s }); return We(!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 !== ir && console.warn("Failed to hydrate: ", a), e.recover === !1 && Il(), ss(), eo(n), We(!1), xo(t, e); + return a !== rr && console.warn("Failed to hydrate: ", a), e.recover === !1 && Ll(), os(), ro(n), We(!1), $o(t, e); } finally { - We(r), Ot(i); - } -} -const Xr = /* @__PURE__ */ new Map(); -function bo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - ss(); - var o = /* @__PURE__ */ new Set(), l = (c) => { - for (var h = 0; h < c.length; h++) { - var v = c[h]; - if (!o.has(v)) { - o.add(v); - var g = xu(v); + We(r), Lt(i); + } +} +const Gr = /* @__PURE__ */ new Map(); +function Ao(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + os(); + var o = /* @__PURE__ */ new Set(), l = (h) => { + for (var c = 0; c < h.length; c++) { + var p = h[c]; + if (!o.has(p)) { + o.add(p); + var g = bu(p); for (const $ of [e, document]) { - var m = Xr.get($); - m === void 0 && (m = /* @__PURE__ */ new Map(), Xr.set($, m)); - var b = m.get(v); - b === void 0 ? ($.addEventListener(v, Js, { passive: g }), m.set(v, 1)) : m.set(v, b + 1); + var m = Gr.get($); + m === void 0 && (m = /* @__PURE__ */ new Map(), Gr.set($, m)); + var b = m.get(p); + b === void 0 ? ($.addEventListener(p, ta, { passive: g }), m.set(p, 1)) : m.set(p, b + 1); } } } }; - l($i(yo)), as.add(l); - var u = void 0, f = fu(() => { - var c = n ?? e.appendChild(Qt()); - return Zl( + l(Ai(xo)), ls.add(l); + var u = void 0, f = cu(() => { + var h = n ?? e.appendChild(re()); + return Jl( /** @type {TemplateNode} */ - c, + h, { pending: () => { } }, - (h) => { - xs({}); - var v = ( + (c) => { + $s({}); + var p = ( /** @type {ComponentContext} */ - Yt + Wt ); - if (s && (v.c = s), i && (r.$$events = i), Z && In( + if (s && (p.c = s), i && (r.$$events = i), j && On( /** @type {TemplateNode} */ - h, + c, null - ), u = t(h, r) || {}, Z && (K.nodes.end = H, H === null || H.nodeType !== pr || /** @type {Comment} */ - H.data !== ys)) - throw Ei(), ir; - bs(); + ), u = t(c, r) || {}, j && (U.nodes.end = Y, Y === null || Y.nodeType !== dr || /** @type {Comment} */ + Y.data !== xs)) + throw Ri(), rr; + As(); } ), () => { var m; - for (var h of o) + for (var c of o) for (const b of [e, document]) { - var v = ( + var p = ( /** @type {Map} */ - Xr.get(b) + Gr.get(b) ), g = ( /** @type {number} */ - v.get(h) + p.get(c) ); - --g == 0 ? (b.removeEventListener(h, Js), v.delete(h), v.size === 0 && Xr.delete(b)) : v.set(h, g); + --g == 0 ? (b.removeEventListener(c, ta), p.delete(c), p.size === 0 && Gr.delete(b)) : p.set(c, g); } - as.delete(l), c !== n && ((m = c.parentNode) == null || m.removeChild(c)); + ls.delete(l), h !== n && ((m = h.parentNode) == null || m.removeChild(h)); }; }); - return os.set(u, f), u; + return us.set(u, f), u; } -let os = /* @__PURE__ */ new WeakMap(); -function $u(t, e) { - const n = os.get(t); - return n ? (os.delete(t), n(e)) : Promise.resolve(); +let us = /* @__PURE__ */ new WeakMap(); +function Au(t, e) { + const n = us.get(t); + return n ? (us.delete(t), n(e)) : Promise.resolve(); } -var ae, $e, zt, Tn, Vr, zr, xi; -class Au { +var ue, Re, Xt, Cn, qr, Vr, bi; +class Eu { /** * @param {TemplateNode} anchor * @param {boolean} transition @@ -2072,7 +2072,7 @@ class Au { /** @type {TemplateNode} */ at(this, "anchor"); /** @type {Map} */ - L(this, ae, /* @__PURE__ */ new Map()); + L(this, ue, /* @__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. @@ -2087,69 +2087,69 @@ class Au { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - L(this, $e, /* @__PURE__ */ new Map()); + L(this, Re, /* @__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} */ - L(this, zt, /* @__PURE__ */ new Map()); + L(this, Xt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - L(this, Tn, /* @__PURE__ */ new Set()); + L(this, Cn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - L(this, Vr, !0); - L(this, zr, () => { + L(this, qr, !0); + L(this, Vr, () => { var e = ( /** @type {Batch} */ - W + B ); - if (p(this, ae).has(e)) { + if (v(this, ue).has(e)) { var n = ( /** @type {Key} */ - p(this, ae).get(e) - ), r = p(this, $e).get(n); + v(this, ue).get(e) + ), r = v(this, Re).get(n); if (r) - ks(r), p(this, Tn).delete(n); + Ps(r), v(this, Cn).delete(n); else { - var i = p(this, zt).get(n); - i && (p(this, $e).set(n, i.effect), p(this, zt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, Xt).get(n); + i && (v(this, Re).set(n, i.effect), v(this, Xt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of p(this, ae)) { - if (p(this, ae).delete(s), s === e) + for (const [s, a] of v(this, ue)) { + if (v(this, ue).delete(s), s === e) break; - const o = p(this, zt).get(a); - o && (St(o.effect), p(this, zt).delete(a)); + const o = v(this, Xt).get(a); + o && (St(o.effect), v(this, Xt).delete(a)); } - for (const [s, a] of p(this, $e)) { - if (s === n || p(this, Tn).has(s)) continue; + for (const [s, a] of v(this, Re)) { + if (s === n || v(this, Cn).has(s)) continue; const o = () => { - if (Array.from(p(this, ae).values()).includes(s)) { + if (Array.from(v(this, ue).values()).includes(s)) { var u = document.createDocumentFragment(); - fo(a, u), u.append(Qt()), p(this, zt).set(s, { effect: a, fragment: u }); + ho(a, u), u.append(re()), v(this, Xt).set(s, { effect: a, fragment: u }); } else St(a); - p(this, Tn).delete(s), p(this, $e).delete(s); + v(this, Cn).delete(s), v(this, Re).delete(s); }; - p(this, Vr) || !r ? (p(this, Tn).add(s), kn(a, o, !1)) : o(); + v(this, qr) || !r ? (v(this, Cn).add(s), Sn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - L(this, xi, (e) => { - p(this, ae).delete(e); - const n = Array.from(p(this, ae).values()); - for (const [r, i] of p(this, zt)) - n.includes(r) || (St(i.effect), p(this, zt).delete(r)); + L(this, bi, (e) => { + v(this, ue).delete(e); + const n = Array.from(v(this, ue).values()); + for (const [r, i] of v(this, Xt)) + n.includes(r) || (St(i.effect), v(this, Xt).delete(r)); }); - this.anchor = e, P(this, Vr, n); + this.anchor = e, F(this, qr, n); } /** * @@ -2159,78 +2159,78 @@ class Au { ensure(e, n) { var r = ( /** @type {Batch} */ - W - ), i = no(); - if (n && !p(this, $e).has(e) && !p(this, zt).has(e)) + B + ), i = io(); + if (n && !v(this, Re).has(e) && !v(this, Xt).has(e)) if (i) { - var s = document.createDocumentFragment(), a = Qt(); - s.append(a), p(this, zt).set(e, { - effect: jt(() => n(a)), + var s = document.createDocumentFragment(), a = re(); + s.append(a), v(this, Xt).set(e, { + effect: te(() => n(a)), fragment: s }); } else - p(this, $e).set( + v(this, Re).set( e, - jt(() => n(this.anchor)) + te(() => n(this.anchor)) ); - if (p(this, ae).set(r, e), i) { - for (const [o, l] of p(this, $e)) + if (v(this, ue).set(r, e), i) { + for (const [o, l] of v(this, Re)) o === e ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of p(this, zt)) + for (const [o, l] of v(this, Xt)) o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(p(this, zr)), r.ondiscard(p(this, xi)); + r.oncommit(v(this, Vr)), r.ondiscard(v(this, bi)); } else - Z && (this.anchor = H), p(this, zr).call(this); + j && (this.anchor = Y), v(this, Vr).call(this); } } -ae = new WeakMap(), $e = new WeakMap(), zt = new WeakMap(), Tn = new WeakMap(), Vr = new WeakMap(), zr = new WeakMap(), xi = new WeakMap(); -function Eu(t) { - Yt === null && Sl(), Cs(() => { - const e = Si(t); +ue = new WeakMap(), Re = new WeakMap(), Xt = new WeakMap(), Cn = new WeakMap(), qr = new WeakMap(), Vr = new WeakMap(), bi = new WeakMap(); +function Ru(t) { + Wt === null && kl(), Ns(() => { + const e = ki(t); if (typeof e == "function") return ( /** @type {() => void} */ e ); }); } -function xr(t, e, n = !1) { - Z && Ri(); - var r = new Au(t), i = n ? ar : 0; +function wr(t, e, n = !1) { + j && Ci(); + var r = new Eu(t), i = n ? sr : 0; function s(a, o) { - if (Z) { - const f = ka(t); + if (j) { + const f = Pa(t); var l; - if (f === ms ? l = 0 : f === bi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = ci(); - Ot(u), r.anchor = u, We(!1), r.ensure(a, o), We(!0); + if (f === ws ? l = 0 : f === $i ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = hi(); + Lt(u), r.anchor = u, We(!1), r.ensure(a, o), We(!0); return; } } r.ensure(a, o); } - Ns(() => { + ks(() => { var a = !1; e((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function Yi(t, e) { +function Bi(t, e) { return e; } -function Ru(t, e, n) { +function Cu(t, e, n) { for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { - let c = e[o]; - kn( - c, + let h = e[o]; + Sn( + h, () => { if (s) { - if (s.pending.delete(c), s.done.add(c), s.pending.size === 0) { - var h = ( + if (s.pending.delete(h), s.done.add(h), s.pending.size === 0) { + var c = ( /** @type {Set} */ t.outrogroups ); - ls($i(s.done)), h.delete(s), h.size === 0 && (t.outrogroups = null); + fs(Ai(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); } } else a -= 1; @@ -2248,164 +2248,164 @@ function Ru(t, e, n) { /** @type {Element} */ u.parentNode ); - eo(f), f.append(u), t.items.clear(); + ro(f), f.append(u), t.items.clear(); } - ls(e, !l); + fs(e, !l); } else s = { pending: new Set(e), done: /* @__PURE__ */ new Set() }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function ls(t, e = !0) { +function fs(t, e = !0) { for (var n = 0; n < t.length; n++) St(t[n], e); } -var ta; -function Bi(t, e, n, r, i, s = null) { +var na; +function Wi(t, e, n, r, i, s = null) { var a = t, o = /* @__PURE__ */ new Map(); - Z && Ri(); - var l = null, u = /* @__PURE__ */ Wa(() => { + j && Ci(); + var l = null, u = /* @__PURE__ */ Ga(() => { var m = n(); - return Ea(m) ? m : m == null ? [] : $i(m); - }), f, c = !0; - function h() { - g.fallback = l, Cu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & rn) === 0 ? ks(l) : (l.f ^= rn, Ar(l, null, a)) : kn(l, () => { + return Ca(m) ? m : m == null ? [] : Ai(m); + }), f, h = !0; + function c() { + g.fallback = l, Tu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & sn) === 0 ? Ps(l) : (l.f ^= sn, $r(l, null, a)) : Sn(l, () => { l = null; })); } - var v = Ns(() => { + var p = ks(() => { f = /** @type {V[]} */ x(u); var m = f.length; let b = !1; - if (Z) { - var $ = ka(a) === bi; - $ !== (m === 0) && (a = ci(), Ot(a), We(!1), b = !0); + if (j) { + var $ = Pa(a) === $i; + $ !== (m === 0) && (a = hi(), Lt(a), We(!1), b = !0); } for (var R = /* @__PURE__ */ new Set(), E = ( /** @type {Batch} */ - W - ), C = no(), F = 0; F < m; F += 1) { - Z && H.nodeType === pr && /** @type {Comment} */ - H.data === ys && (a = /** @type {Comment} */ - H, b = !0, We(!1)); - var J = f[F], ct = r(J, F), B = c ? null : o.get(ct); - B ? (B.v && ur(B.v, J), B.i && ur(B.i, F), C && E.unskip_effect(B.e)) : (B = Tu( + B + ), M = io(), C = 0; C < m; C += 1) { + j && Y.nodeType === dr && /** @type {Comment} */ + Y.data === xs && (a = /** @type {Comment} */ + Y, b = !0, We(!1)); + var tt = f[C], nt = r(tt, C), Q = h ? null : o.get(nt); + Q ? (Q.v && lr(Q.v, tt), Q.i && lr(Q.i, C), M && E.unskip_effect(Q.e)) : (Q = Nu( o, - c ? a : ta ?? (ta = Qt()), - J, - ct, - F, + h ? a : na ?? (na = re()), + tt, + nt, + C, i, e, n - ), c || (B.e.f |= rn), o.set(ct, B)), R.add(ct); + ), h || (Q.e.f |= sn), o.set(nt, Q)), R.add(nt); } - if (m === 0 && s && !l && (c ? l = jt(() => s(a)) : (l = jt(() => s(ta ?? (ta = Qt()))), l.f |= rn)), m > R.size && Ml(), Z && m > 0 && Ot(ci()), !c) - if (C) { - for (const [et, _t] of o) - R.has(et) || E.skip_effect(_t.e); - E.oncommit(h), E.ondiscard(() => { + if (m === 0 && s && !l && (h ? l = te(() => s(a)) : (l = te(() => s(na ?? (na = re()))), l.f |= sn)), m > R.size && Pl(), j && m > 0 && Lt(hi()), !h) + if (M) { + for (const [J, ht] of o) + R.has(J) || E.skip_effect(ht.e); + E.oncommit(c), E.ondiscard(() => { }); } else - h(); + c(); b && We(!0), x(u); - }), g = { effect: v, items: o, outrogroups: null, fallback: l }; - c = !1, Z && (a = H); + }), g = { effect: p, items: o, outrogroups: null, fallback: l }; + h = !1, j && (a = Y); } -function br(t) { - for (; t !== null && (t.f & ce) === 0; ) +function xr(t) { + for (; t !== null && (t.f & pe) === 0; ) t = t.next; return t; } -function Cu(t, e, n, r, i) { - var B; - var s = e.length, a = t.items, o = br(t.effect.first), l, u = null, f = [], c = [], h, v, g, m; +function Tu(t, e, n, r, i) { + var Q; + var s = e.length, a = t.items, o = xr(t.effect.first), l, u = null, f = [], h = [], c, p, g, m; for (m = 0; m < s; m += 1) { - if (h = e[m], v = i(h, m), g = /** @type {EachItem} */ - a.get(v).e, t.outrogroups !== null) - for (const et of t.outrogroups) - et.pending.delete(g), et.done.delete(g); - if ((g.f & rn) !== 0) - if (g.f ^= rn, g === o) - Ar(g, null, n); + if (c = e[m], p = i(c, m), g = /** @type {EachItem} */ + a.get(p).e, t.outrogroups !== null) + for (const J of t.outrogroups) + J.pending.delete(g), J.done.delete(g); + if ((g.f & sn) !== 0) + if (g.f ^= sn, g === o) + $r(g, null, n); else { var b = u ? u.next : o; - g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), en(t, u, g), en(t, g, b), Ar(g, b, n), u = g, f = [], c = [], o = br(u.next); + g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), nn(t, u, g), nn(t, g, b), $r(g, b, n), u = g, f = [], h = [], o = xr(u.next); continue; } - if ((g.f & Ht) !== 0 && ks(g), g !== o) { + if ((g.f & Bt) !== 0 && Ps(g), g !== o) { if (l !== void 0 && l.has(g)) { - if (f.length < c.length) { - var $ = c[0], R; + if (f.length < h.length) { + var $ = h[0], R; u = $.prev; - var E = f[0], C = f[f.length - 1]; + var E = f[0], M = f[f.length - 1]; for (R = 0; R < f.length; R += 1) - Ar(f[R], $, n); - for (R = 0; R < c.length; R += 1) - l.delete(c[R]); - en(t, E.prev, C.next), en(t, u, E), en(t, C, $), o = $, u = C, m -= 1, f = [], c = []; + $r(f[R], $, n); + for (R = 0; R < h.length; R += 1) + l.delete(h[R]); + nn(t, E.prev, M.next), nn(t, u, E), nn(t, M, $), o = $, u = M, m -= 1, f = [], h = []; } else - l.delete(g), Ar(g, o, n), en(t, g.prev, g.next), en(t, g, u === null ? t.effect.first : u.next), en(t, u, g), u = g; + l.delete(g), $r(g, o, n), nn(t, g.prev, g.next), nn(t, g, u === null ? t.effect.first : u.next), nn(t, u, g), u = g; continue; } - for (f = [], c = []; o !== null && o !== g; ) - (l ?? (l = /* @__PURE__ */ new Set())).add(o), c.push(o), o = br(o.next); + for (f = [], h = []; o !== null && o !== g; ) + (l ?? (l = /* @__PURE__ */ new Set())).add(o), h.push(o), o = xr(o.next); if (o === null) continue; } - (g.f & rn) === 0 && f.push(g), u = g, o = br(g.next); + (g.f & sn) === 0 && f.push(g), u = g, o = xr(g.next); } if (t.outrogroups !== null) { - for (const et of t.outrogroups) - et.pending.size === 0 && (ls($i(et.done)), (B = t.outrogroups) == null || B.delete(et)); + for (const J of t.outrogroups) + J.pending.size === 0 && (fs(Ai(J.done)), (Q = t.outrogroups) == null || Q.delete(J)); t.outrogroups.size === 0 && (t.outrogroups = null); } if (o !== null || l !== void 0) { - var F = []; + var C = []; if (l !== void 0) for (g of l) - (g.f & Ht) === 0 && F.push(g); + (g.f & Bt) === 0 && C.push(g); for (; o !== null; ) - (o.f & Ht) === 0 && o !== t.fallback && F.push(o), o = br(o.next); - var J = F.length; - if (J > 0) { - var ct = null; - Ru(t, F, ct); + (o.f & Bt) === 0 && o !== t.fallback && C.push(o), o = xr(o.next); + var tt = C.length; + if (tt > 0) { + var nt = null; + Cu(t, C, nt); } } } -function Tu(t, e, n, r, i, s, a, o) { - var l = (a & dl) !== 0 ? (a & vl) === 0 ? /* @__PURE__ */ ja(n, !1, !1) : Fn(n) : null, u = (a & pl) !== 0 ? Fn(i) : null; +function Nu(t, e, n, r, i, s, a, o) { + var l = (a & pl) !== 0 ? (a & gl) === 0 ? /* @__PURE__ */ Ja(n, !1, !1) : Dn(n) : null, u = (a & vl) !== 0 ? Dn(i) : null; return { v: l, i: u, - e: jt(() => (s(e, l ?? n, u ?? i, o), () => { + e: te(() => (s(e, l ?? n, u ?? i, o), () => { t.delete(r); })) }; } -function Ar(t, e, n) { +function $r(t, e, n) { if (t.nodes) - for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & rn) === 0 ? ( + for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & sn) === 0 ? ( /** @type {EffectNodes} */ e.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Te(r) + /* @__PURE__ */ ke(r) ); if (s.before(r), r === i) return; r = a; } } -function en(t, e, n) { +function nn(t, e, n) { e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; } -function $o(t, e) { - so(() => { +function Eo(t, e) { + oo(() => { var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -2418,12 +2418,12 @@ function $o(t, e) { ) ); if (!r.querySelector("#" + e.hash)) { - const i = Es("style"); + const i = Cs("style"); i.id = e.hash, i.textContent = e.code, r.appendChild(i); } }); } -function ea(t, e = !1) { +function ra(t, e = !1) { var n = e ? " !important;" : ";", r = ""; for (var i in t) { var s = t[i]; @@ -2431,10 +2431,10 @@ function ea(t, e = !1) { } return r; } -function Nu(t, e) { +function Su(t, e) { if (e) { var n = "", r, i; - return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += ea(r)), i && (n += ea(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += ra(r)), i && (n += ra(i, !0)), n = n.trim(), n === "" ? null : n; } return String(t); } @@ -2444,46 +2444,46 @@ function Ui(t, e = {}, n, r) { e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); } } -function na(t, e, n, r) { +function ia(t, e, n, r) { var i = t.__style; - if (Z || i !== e) { - var s = Nu(e, r); - (!Z || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; + if (j || i !== e) { + var s = Su(e, r); + (!j || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; } else r && (Array.isArray(r) ? (Ui(t, n == null ? void 0 : n[0], r[0]), Ui(t, n == null ? void 0 : n[1], r[1], "important")) : Ui(t, n, r)); return r; } -function ra(t, e) { - return t === e || (t == null ? void 0 : t[Tr]) === e; +function sa(t, e) { + return t === e || (t == null ? void 0 : t[Cr]) === e; } -function ni(t = {}, e, n, r) { - return so(() => { +function ri(t = {}, e, n, r) { + return oo(() => { var i, s; - return Ts(() => { - i = s, s = [], Si(() => { - t !== n(...s) && (e(t, ...s), i && ra(n(...i), t) && e(null, ...i)); + return Ss(() => { + i = s, s = [], ki(() => { + t !== n(...s) && (e(t, ...s), i && sa(n(...i), t) && e(null, ...i)); }); }), () => { - Sn(() => { - s && ra(n(...s), t) && e(null, ...s); + Nn(() => { + s && sa(n(...s), t) && e(null, ...s); }); }; }), t; } -let Gr = !1; -function Su(t) { - var e = Gr; +let Kr = !1; +function ku(t) { + var e = Kr; try { - return Gr = !1, [t(), Gr]; + return Kr = !1, [t(), Kr]; } finally { - Gr = e; + Kr = e; } } function vt(t, e, n, r) { var R; - var i = (n & ml) !== 0, s = (n & yl) !== 0, a = ( + var i = (n & yl) !== 0, s = (n & wl) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? Si( + ), o = !0, l = () => (o && (o = !1, a = s ? ki( /** @type {() => V} */ r ) : ( @@ -2491,55 +2491,55 @@ function vt(t, e, n, r) { r )), a), u; if (i) { - var f = Tr in t || Sa in t; - u = ((R = Nn(t, e)) == null ? void 0 : R.set) ?? (f && e in t ? (E) => t[e] = E : void 0); + var f = Cr in t || Ma in t; + u = ((R = Tn(t, e)) == null ? void 0 : R.set) ?? (f && e in t ? (E) => t[e] = E : void 0); } - var c, h = !1; - i ? [c, h] = Su(() => ( + var h, c = !1; + i ? [h, c] = ku(() => ( /** @type {V} */ t[e] - )) : c = /** @type {V} */ - t[e], c === void 0 && r !== void 0 && (c = l(), u && (Ll(), u(c))); - var v; - if (v = () => { + )) : h = /** @type {V} */ + t[e], h === void 0 && r !== void 0 && (h = l(), u && (ql(), u(h))); + var p; + if (p = () => { var E = ( /** @type {V} */ t[e] ); return E === void 0 ? l() : (o = !0, E); - }, (n & _l) === 0) - return v; + }, (n & ml) === 0) + return p; if (u) { var g = t.$$legacy; return ( /** @type {() => V} */ - (function(E, C) { - return arguments.length > 0 ? ((!C || g || h) && u(C ? v() : E), E) : v(); + (function(E, M) { + return arguments.length > 0 ? ((!M || g || c) && u(M ? p() : E), E) : p(); }) ); } - var m = !1, b = ((n & gl) !== 0 ? Ti : Wa)(() => (m = !1, v())); + var m = !1, b = ((n & _l) !== 0 ? Ni : Ga)(() => (m = !1, p())); i && x(b); var $ = ( /** @type {Effect} */ - K + U ); return ( /** @type {() => V} */ - (function(E, C) { + (function(E, M) { if (arguments.length > 0) { - const F = C ? x(b) : i ? wn(E) : E; - return ut(b, F), m = !0, a !== void 0 && (a = F), E; + const C = M ? x(b) : i ? yn(E) : E; + return ot(b, C), m = !0, a !== void 0 && (a = C), E; } - return on && m || ($.f & Xe) !== 0 ? b.v : x(b); + return ln && m || ($.f & Ue) !== 0 ? b.v : x(b); }) ); } -function ku(t) { - return new Mu(t); +function Mu(t) { + return new Pu(t); } -var Ue, Kt; -class Mu { +var Be, Qt; +class Pu { /** * @param {ComponentConstructorOptions & { * component: any; @@ -2547,12 +2547,12 @@ class Mu { */ constructor(e) { /** @type {any} */ - L(this, Ue); + L(this, Be); /** @type {Record} */ - L(this, Kt); + L(this, Qt); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ ja(o, !1, !1); + var l = /* @__PURE__ */ Ja(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( @@ -2562,42 +2562,42 @@ class Mu { return x(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === Sa ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === Ma ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return ut(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return ot(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - P(this, Kt, (e.hydrate ? bu : xo)(e.component, { + F(this, Qt, (e.hydrate ? $u : $o)(e.component, { target: e.target, anchor: e.anchor, props: i, context: e.context, intro: e.intro ?? !1, recover: e.recover - })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && dt(), P(this, Ue, i.$$events); - for (const a of Object.keys(p(this, Kt))) - a === "$set" || a === "$destroy" || a === "$on" || fi(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && ft(), F(this, Be, i.$$events); + for (const a of Object.keys(v(this, Qt))) + a === "$set" || a === "$destroy" || a === "$on" || ci(this, a, { get() { - return p(this, Kt)[a]; + return v(this, Qt)[a]; }, /** @param {any} value */ set(o) { - p(this, Kt)[a] = o; + v(this, Qt)[a] = o; }, enumerable: !0 }); - p(this, Kt).$set = /** @param {Record} next */ + v(this, Qt).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, p(this, Kt).$destroy = () => { - $u(p(this, Kt)); + }, v(this, Qt).$destroy = () => { + Au(v(this, Qt)); }; } /** @param {Record} props */ $set(e) { - p(this, Kt).$set(e); + v(this, Qt).$set(e); } /** * @param {string} event @@ -2605,22 +2605,22 @@ class Mu { * @returns {any} */ $on(e, n) { - p(this, Ue)[e] = p(this, Ue)[e] || []; + v(this, Be)[e] = v(this, Be)[e] || []; const r = (...i) => n.call(this, ...i); - return p(this, Ue)[e].push(r), () => { - p(this, Ue)[e] = p(this, Ue)[e].filter( + return v(this, Be)[e].push(r), () => { + v(this, Be)[e] = v(this, Be)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - p(this, Kt).$destroy(); + v(this, Qt).$destroy(); } } -Ue = new WeakMap(), Kt = new WeakMap(); -let Ao; -typeof HTMLElement == "function" && (Ao = class extends HTMLElement { +Be = new WeakMap(), Qt = new WeakMap(); +let Ro; +typeof HTMLElement == "function" && (Ro = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -2679,23 +2679,23 @@ typeof HTMLElement == "function" && (Ao = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const o = Es("slot"); - s !== "default" && (o.name = s), se(a, o); + const o = Cs("slot"); + s !== "default" && (o.name = s), le(a, o); }; }; var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = Pu(this); + const r = {}, i = Du(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] = ri(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = ii(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 = ku({ + this.$$c = Mu({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2703,14 +2703,14 @@ typeof HTMLElement == "function" && (Ao = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = uu(() => { - Ts(() => { + }), this.$$me = fu(() => { + Ss(() => { var s; this.$$r = !0; - for (const a of ui(this.$$c)) { + for (const a of fi(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = ri( + const o = ii( a, this.$$d[a], this.$$p_d, @@ -2738,7 +2738,7 @@ typeof HTMLElement == "function" && (Ao = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = ri(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + this.$$r || (e = this.$$g_p(e), this.$$d[e] = ii(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2749,12 +2749,12 @@ typeof HTMLElement == "function" && (Ao = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return ui(this.$$p_d).find( + return fi(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function ri(t, e, n, r) { +function ii(t, e, n, r) { var s; const i = (s = n[t]) == null ? void 0 : s.type; if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) @@ -2785,7 +2785,7 @@ function ri(t, e, n, r) { return e; } } -function Pu(t) { +function Du(t) { const e = {}; return t.childNodes.forEach((n) => { e[ @@ -2794,34 +2794,34 @@ function Pu(t) { ] = !0; }), e; } -function Eo(t, e, n, r, i, s) { - let a = class extends Ao { +function Co(t, e, n, r, i, s) { + let a = class extends Ro { constructor() { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return ui(e).map( + return fi(e).map( (o) => (e[o].attribute || o).toLowerCase() ); } }; - return ui(e).forEach((o) => { - fi(a.prototype, o, { + return fi(e).forEach((o) => { + ci(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { - var c; - l = ri(o, l, e), this.$$d[o] = l; + var h; + l = ii(o, l, e), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (c = Nn(u, o)) == null ? void 0 : c.get; + var f = (h = Tn(u, o)) == null ? void 0 : h.get; f ? u[o] = l : u.$set({ [o]: l }); } } }); }), r.forEach((o) => { - fi(a.prototype, o, { + ci(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; @@ -2830,43 +2830,43 @@ function Eo(t, e, n, r, i, s) { }), t.element = /** @type {any} */ a, a; } -var Du = { value: () => { +var Fu = { value: () => { } }; -function Ro() { +function To() { for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } - return new ii(n); + return new si(n); } -function ii(t) { +function si(t) { this._ = t; } -function Fu(t, e) { +function Ou(t, e) { return t.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 && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } -ii.prototype = Ro.prototype = { - constructor: ii, +si.prototype = To.prototype = { + constructor: si, on: function(t, e) { - var n = this._, r = Fu(t + "", n), i, s = -1, a = r.length; + var n = this._, r = Ou(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Ou(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Iu(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++s < a; ) - if (i = (t = r[s]).type) n[i] = ia(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = ia(n[i], t.name, null); + if (i = (t = r[s]).type) n[i] = aa(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = aa(n[i], t.name, null); return this; }, copy: function() { var t = {}, e = this._; for (var n in e) t[n] = e[n].slice(); - return new ii(t); + return new si(t); }, call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; @@ -2878,135 +2878,135 @@ ii.prototype = Ro.prototype = { for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function Ou(t, e) { +function Iu(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } -function ia(t, e, n) { +function aa(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { - t[r] = Du, t = t.slice(0, r).concat(t.slice(r + 1)); + t[r] = Fu, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } -var us = "http://www.w3.org/1999/xhtml"; -const sa = { +var cs = "http://www.w3.org/1999/xhtml"; +const oa = { svg: "http://www.w3.org/2000/svg", - xhtml: us, + xhtml: cs, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function ki(t) { +function Mi(t) { var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), sa.hasOwnProperty(e) ? { space: sa[e], local: t } : t; + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), oa.hasOwnProperty(e) ? { space: oa[e], local: t } : t; } -function Iu(t) { +function Lu(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; - return n === us && e.documentElement.namespaceURI === us ? e.createElement(t) : e.createElementNS(n, t); + return n === cs && e.documentElement.namespaceURI === cs ? e.createElement(t) : e.createElementNS(n, t); }; } -function Lu(t) { +function qu(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } -function Co(t) { - var e = ki(t); - return (e.local ? Lu : Iu)(e); +function No(t) { + var e = Mi(t); + return (e.local ? qu : Lu)(e); } -function qu() { +function Vu() { } -function Ms(t) { - return t == null ? qu : function() { +function Ds(t) { + return t == null ? Vu : function() { return this.querySelector(t); }; } -function Vu(t) { - typeof t != "function" && (t = Ms(t)); +function Yu(t) { + typeof t != "function" && (t = Ds(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new Bt(r, this._parents); + return new Ut(r, this._parents); } -function zu(t) { +function Hu(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function Hu() { +function zu() { return []; } -function To(t) { - return t == null ? Hu : function() { +function So(t) { + return t == null ? zu : function() { return this.querySelectorAll(t); }; } -function Yu(t) { +function Xu(t) { return function() { - return zu(t.apply(this, arguments)); + return Hu(t.apply(this, arguments)); }; } function Bu(t) { - typeof t == "function" ? t = Yu(t) : t = To(t); + typeof t == "function" ? t = Xu(t) : t = So(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); - return new Bt(r, i); + return new Ut(r, i); } -function No(t) { +function ko(t) { return function() { return this.matches(t); }; } -function So(t) { +function Mo(t) { return function(e) { return e.matches(t); }; } -var Uu = Array.prototype.find; -function Wu(t) { +var Wu = Array.prototype.find; +function Uu(t) { return function() { - return Uu.call(this.children, t); + return Wu.call(this.children, t); }; } -function Xu() { +function Gu() { return this.firstElementChild; } -function Gu(t) { - return this.select(t == null ? Xu : Wu(typeof t == "function" ? t : So(t))); +function Ku(t) { + return this.select(t == null ? Gu : Uu(typeof t == "function" ? t : Mo(t))); } -var Ku = Array.prototype.filter; +var Zu = Array.prototype.filter; function ju() { return Array.from(this.children); } -function Zu(t) { +function Ju(t) { return function() { - return Ku.call(this.children, t); + return Zu.call(this.children, t); }; } -function Ju(t) { - return this.selectAll(t == null ? ju : Zu(typeof t == "function" ? t : So(t))); -} function Qu(t) { - typeof t != "function" && (t = No(t)); + return this.selectAll(t == null ? ju : Ju(typeof t == "function" ? t : Mo(t))); +} +function tf(t) { + typeof t != "function" && (t = ko(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new Bt(r, this._parents); + return new Ut(r, this._parents); } -function ko(t) { +function Po(t) { return new Array(t.length); } -function tf() { - return new Bt(this._enter || this._groups.map(ko), this._parents); +function ef() { + return new Ut(this._enter || this._groups.map(Po), this._parents); } -function hi(t, e) { +function di(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -hi.prototype = { - constructor: hi, +di.prototype = { + constructor: di, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -3020,91 +3020,91 @@ hi.prototype = { return this._parent.querySelectorAll(t); } }; -function ef(t) { +function nf(t) { return function() { return t; }; } -function nf(t, e, n, r, i, s) { +function rf(t, e, n, r, i, s) { for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new hi(t, s[a]); + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new di(t, s[a]); for (; a < l; ++a) (o = e[a]) && (i[a] = o); } -function rf(t, e, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = e.length, c = s.length, h = new Array(f), v; +function sf(t, e, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = e.length, h = s.length, c = new Array(f), p; for (o = 0; o < f; ++o) - (l = e[o]) && (h[o] = v = a.call(l, l.__data__, o, e) + "", u.has(v) ? i[o] = l : u.set(v, l)); - for (o = 0; o < c; ++o) - v = a.call(t, s[o], o, s) + "", (l = u.get(v)) ? (r[o] = l, l.__data__ = s[o], u.delete(v)) : n[o] = new hi(t, s[o]); + (l = e[o]) && (c[o] = p = a.call(l, l.__data__, o, e) + "", u.has(p) ? i[o] = l : u.set(p, l)); + for (o = 0; o < h; ++o) + p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new di(t, s[o]); for (o = 0; o < f; ++o) - (l = e[o]) && u.get(h[o]) === l && (i[o] = l); + (l = e[o]) && u.get(c[o]) === l && (i[o] = l); } -function sf(t) { +function af(t) { return t.__data__; } -function af(t, e) { - if (!arguments.length) return Array.from(this, sf); - var n = e ? rf : nf, r = this._parents, i = this._groups; - typeof t != "function" && (t = ef(t)); +function of(t, e) { + if (!arguments.length) return Array.from(this, af); + var n = e ? sf : rf, r = this._parents, i = this._groups; + typeof t != "function" && (t = nf(t)); 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], c = i[u], h = c.length, v = of(t.call(f, f && f.__data__, u, r)), g = v.length, m = o[u] = new Array(g), b = a[u] = new Array(g), $ = l[u] = new Array(h); - n(f, c, m, b, $, v, e); - for (var R = 0, E = 0, C, F; R < g; ++R) - if (C = m[R]) { - for (R >= E && (E = R + 1); !(F = b[E]) && ++E < g; ) ; - C._next = F || null; + var f = r[u], h = i[u], c = h.length, p = lf(t.call(f, f && f.__data__, u, r)), g = p.length, m = o[u] = new Array(g), b = a[u] = new Array(g), $ = l[u] = new Array(c); + n(f, h, m, b, $, p, e); + for (var R = 0, E = 0, M, C; R < g; ++R) + if (M = m[R]) { + for (R >= E && (E = R + 1); !(C = b[E]) && ++E < g; ) ; + M._next = C || null; } } - return a = new Bt(a, r), a._enter = o, a._exit = l, a; + return a = new Ut(a, r), a._enter = o, a._exit = l, a; } -function of(t) { +function lf(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function lf() { - return new Bt(this._exit || this._groups.map(ko), this._parents); +function uf() { + return new Ut(this._exit || this._groups.map(Po), this._parents); } -function uf(t, e, n) { +function ff(t, e, n) { var r = this.enter(), i = this, s = this.exit(); return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function ff(t) { +function cf(t) { for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._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], c = u.length, h = o[l] = new Array(c), v, g = 0; g < c; ++g) - (v = u[g] || f[g]) && (h[g] = v); + for (var u = n[l], f = r[l], h = u.length, c = o[l] = new Array(h), p, g = 0; g < h; ++g) + (p = u[g] || f[g]) && (c[g] = p); for (; l < i; ++l) o[l] = n[l]; - return new Bt(o, this._parents); + return new Ut(o, this._parents); } -function cf() { +function hf() { for (var t = this._groups, e = -1, n = t.length; ++e < n; ) for (var r = t[e], 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 hf(t) { - t || (t = df); - function e(c, h) { - return c && h ? t(c.__data__, h.__data__) : !c - !h; +function df(t) { + t || (t = pf); + function e(h, c) { + return h && c ? t(h.__data__, c.__data__) : !h - !c; } 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(e); } - return new Bt(i, this._parents).order(); + return new Ut(i, this._parents).order(); } -function df(t, e) { +function pf(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function pf() { +function vf() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } -function vf() { +function gf() { return Array.from(this); } -function gf() { +function _f() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length; i < s; ++i) { var a = r[i]; @@ -3112,114 +3112,114 @@ function gf() { } return null; } -function _f() { +function mf() { let t = 0; for (const e of this) ++t; return t; } -function mf() { +function yf() { return !this.node(); } -function yf(t) { +function wf(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) (o = i[s]) && t.call(o, o.__data__, s, i); return this; } -function wf(t) { +function xf(t) { return function() { this.removeAttribute(t); }; } -function xf(t) { +function bf(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function bf(t, e) { +function $f(t, e) { return function() { this.setAttribute(t, e); }; } -function $f(t, e) { +function Af(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } -function Af(t, e) { +function Ef(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function Ef(t, e) { +function Rf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); }; } -function Rf(t, e) { - var n = ki(t); +function Cf(t, e) { + var n = Mi(t); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((e == null ? n.local ? xf : wf : typeof e == "function" ? n.local ? Ef : Af : n.local ? $f : bf)(n, e)); + return this.each((e == null ? n.local ? bf : xf : typeof e == "function" ? n.local ? Rf : Ef : n.local ? Af : $f)(n, e)); } -function Mo(t) { +function Do(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function Cf(t) { +function Tf(t) { return function() { this.style.removeProperty(t); }; } -function Tf(t, e, n) { +function Nf(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } -function Nf(t, e, n) { +function Sf(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function Sf(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? Cf : typeof e == "function" ? Nf : Tf)(t, e, n ?? "")) : cr(this.node(), t); +function kf(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? Tf : typeof e == "function" ? Sf : Nf)(t, e, n ?? "")) : fr(this.node(), t); } -function cr(t, e) { - return t.style.getPropertyValue(e) || Mo(t).getComputedStyle(t, null).getPropertyValue(e); +function fr(t, e) { + return t.style.getPropertyValue(e) || Do(t).getComputedStyle(t, null).getPropertyValue(e); } -function kf(t) { +function Mf(t) { return function() { delete this[t]; }; } -function Mf(t, e) { +function Pf(t, e) { return function() { this[t] = e; }; } -function Pf(t, e) { +function Df(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } -function Df(t, e) { - return arguments.length > 1 ? this.each((e == null ? kf : typeof e == "function" ? Pf : Mf)(t, e)) : this.node()[t]; +function Ff(t, e) { + return arguments.length > 1 ? this.each((e == null ? Mf : typeof e == "function" ? Df : Pf)(t, e)) : this.node()[t]; } -function Po(t) { +function Fo(t) { return t.trim().split(/^|\s+/); } -function Ps(t) { - return t.classList || new Do(t); +function Fs(t) { + return t.classList || new Oo(t); } -function Do(t) { - this._node = t, this._names = Po(t.getAttribute("class") || ""); +function Oo(t) { + this._node = t, this._names = Fo(t.getAttribute("class") || ""); } -Do.prototype = { +Oo.prototype = { add: function(t) { var e = this._names.indexOf(t); e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); @@ -3232,53 +3232,53 @@ Do.prototype = { return this._names.indexOf(t) >= 0; } }; -function Fo(t, e) { - for (var n = Ps(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +function Io(t, e) { + for (var n = Fs(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function Oo(t, e) { - for (var n = Ps(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +function Lo(t, e) { + for (var n = Fs(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function Ff(t) { +function Of(t) { return function() { - Fo(this, t); + Io(this, t); }; } -function Of(t) { +function If(t) { return function() { - Oo(this, t); + Lo(this, t); }; } -function If(t, e) { +function Lf(t, e) { return function() { - (e.apply(this, arguments) ? Fo : Oo)(this, t); + (e.apply(this, arguments) ? Io : Lo)(this, t); }; } -function Lf(t, e) { - var n = Po(t + ""); +function qf(t, e) { + var n = Fo(t + ""); if (arguments.length < 2) { - for (var r = Ps(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Fs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? If : e ? Ff : Of)(n, e)); + return this.each((typeof e == "function" ? Lf : e ? Of : If)(n, e)); } -function qf() { +function Vf() { this.textContent = ""; } -function Vf(t) { +function Yf(t) { return function() { this.textContent = t; }; } -function zf(t) { +function Hf(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } -function Hf(t) { - return arguments.length ? this.each(t == null ? qf : (typeof t == "function" ? zf : Vf)(t)) : this.node().textContent; +function zf(t) { + return arguments.length ? this.each(t == null ? Vf : (typeof t == "function" ? Hf : Yf)(t)) : this.node().textContent; } -function Yf() { +function Xf() { this.innerHTML = ""; } function Bf(t) { @@ -3286,75 +3286,75 @@ function Bf(t) { this.innerHTML = t; }; } -function Uf(t) { +function Wf(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } -function Wf(t) { - return arguments.length ? this.each(t == null ? Yf : (typeof t == "function" ? Uf : Bf)(t)) : this.node().innerHTML; -} -function Xf() { - this.nextSibling && this.parentNode.appendChild(this); +function Uf(t) { + return arguments.length ? this.each(t == null ? Xf : (typeof t == "function" ? Wf : Bf)(t)) : this.node().innerHTML; } function Gf() { - return this.each(Xf); + this.nextSibling && this.parentNode.appendChild(this); } function Kf() { + return this.each(Gf); +} +function Zf() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function jf() { - return this.each(Kf); + return this.each(Zf); } -function Zf(t) { - var e = typeof t == "function" ? t : Co(t); +function Jf(t) { + var e = typeof t == "function" ? t : No(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function Jf() { +function Qf() { return null; } -function Qf(t, e) { - var n = typeof t == "function" ? t : Co(t), r = e == null ? Jf : typeof e == "function" ? e : Ms(e); +function tc(t, e) { + var n = typeof t == "function" ? t : No(t), r = e == null ? Qf : typeof e == "function" ? e : Ds(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function tc() { +function ec() { var t = this.parentNode; t && t.removeChild(this); } -function ec() { - return this.each(tc); -} function nc() { + return this.each(ec); +} +function rc() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function rc() { +function ic() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function ic(t) { - return this.select(t ? rc : nc); -} function sc(t) { - return arguments.length ? this.property("__data__", t) : this.node().__data__; + return this.select(t ? ic : rc); } function ac(t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; +} +function oc(t) { return function(e) { t.call(this, e, this.__data__); }; } -function oc(t) { +function lc(t) { return t.trim().split(/^|\s+/).map(function(e) { var n = "", r = e.indexOf("."); return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n }; }); } -function lc(t) { +function uc(t) { return function() { var e = this.__on; if (e) { @@ -3364,9 +3364,9 @@ function lc(t) { } }; } -function uc(t, e, n) { +function fc(t, e, n) { return function() { - var r = this.__on, i, s = ac(e); + var r = this.__on, i, s = oc(e); if (r) { for (var a = 0, o = r.length; a < o; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { @@ -3377,8 +3377,8 @@ function uc(t, e, n) { this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function fc(t, e, n) { - var r = oc(t + ""), i, s = r.length, a; +function cc(t, e, n) { + var r = lc(t + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3389,93 +3389,93 @@ function fc(t, e, n) { } return; } - for (o = e ? uc : lc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + for (o = e ? fc : uc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); return this; } -function Io(t, e, n) { - var r = Mo(t), i = r.CustomEvent; +function qo(t, e, n) { + var r = Do(t), i = r.CustomEvent; typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); } -function cc(t, e) { +function hc(t, e) { return function() { - return Io(this, t, e); + return qo(this, t, e); }; } -function hc(t, e) { +function dc(t, e) { return function() { - return Io(this, t, e.apply(this, arguments)); + return qo(this, t, e.apply(this, arguments)); }; } -function dc(t, e) { - return this.each((typeof e == "function" ? hc : cc)(t, e)); +function pc(t, e) { + return this.each((typeof e == "function" ? dc : hc)(t, e)); } -function* pc() { +function* vc() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var Lo = [null]; -function Bt(t, e) { +var Vo = [null]; +function Ut(t, e) { this._groups = t, this._parents = e; } -function vr() { - return new Bt([[document.documentElement]], Lo); +function pr() { + return new Ut([[document.documentElement]], Vo); } -function vc() { +function gc() { return this; } -Bt.prototype = vr.prototype = { - constructor: Bt, - select: Vu, +Ut.prototype = pr.prototype = { + constructor: Ut, + select: Yu, selectAll: Bu, - selectChild: Gu, - selectChildren: Ju, - filter: Qu, - data: af, - enter: tf, - exit: lf, - join: uf, - merge: ff, - selection: vc, - order: cf, - sort: hf, - call: pf, - nodes: vf, - node: gf, - size: _f, - empty: mf, - each: yf, - attr: Rf, - style: Sf, - property: Df, - classed: Lf, - text: Hf, - html: Wf, - raise: Gf, + selectChild: Ku, + selectChildren: Qu, + filter: tf, + data: of, + enter: ef, + exit: uf, + join: ff, + merge: cf, + selection: gc, + order: hf, + sort: df, + call: vf, + nodes: gf, + node: _f, + size: mf, + empty: yf, + each: wf, + attr: Cf, + style: kf, + property: Ff, + classed: qf, + text: zf, + html: Uf, + raise: Kf, lower: jf, - append: Zf, - insert: Qf, - remove: ec, - clone: ic, - datum: sc, - on: fc, - dispatch: dc, - [Symbol.iterator]: pc + append: Jf, + insert: tc, + remove: nc, + clone: sc, + datum: ac, + on: cc, + dispatch: pc, + [Symbol.iterator]: vc }; -function yt(t) { - return typeof t == "string" ? new Bt([[document.querySelector(t)]], [document.documentElement]) : new Bt([[t]], Lo); +function xt(t) { + return typeof t == "string" ? new Ut([[document.querySelector(t)]], [document.documentElement]) : new Ut([[t]], Vo); } -function Ds(t, e, n) { +function Os(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } -function qo(t, e) { +function Yo(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } -function Br() { +function zr() { } -var Pr = 0.7, di = 1 / Pr, jn = "\\s*([+-]?\\d+)\\s*", Dr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Ee = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", gc = /^#([0-9a-f]{3,8})$/, _c = new RegExp(`^rgb\\(${jn},${jn},${jn}\\)$`), mc = new RegExp(`^rgb\\(${Ee},${Ee},${Ee}\\)$`), yc = new RegExp(`^rgba\\(${jn},${jn},${jn},${Dr}\\)$`), wc = new RegExp(`^rgba\\(${Ee},${Ee},${Ee},${Dr}\\)$`), xc = new RegExp(`^hsl\\(${Dr},${Ee},${Ee}\\)$`), bc = new RegExp(`^hsla\\(${Dr},${Ee},${Ee},${Dr}\\)$`), aa = { +var Mr = 0.7, pi = 1 / Mr, Kn = "\\s*([+-]?\\d+)\\s*", Pr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Te = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", _c = /^#([0-9a-f]{3,8})$/, mc = new RegExp(`^rgb\\(${Kn},${Kn},${Kn}\\)$`), yc = new RegExp(`^rgb\\(${Te},${Te},${Te}\\)$`), wc = new RegExp(`^rgba\\(${Kn},${Kn},${Kn},${Pr}\\)$`), xc = new RegExp(`^rgba\\(${Te},${Te},${Te},${Pr}\\)$`), bc = new RegExp(`^hsl\\(${Pr},${Te},${Te}\\)$`), $c = new RegExp(`^hsla\\(${Pr},${Te},${Te},${Pr}\\)$`), la = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3625,178 +3625,178 @@ var Pr = 0.7, di = 1 / Pr, jn = "\\s*([+-]?\\d+)\\s*", Dr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Ds(Br, Ln, { +Os(zr, In, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, - hex: oa, + hex: ua, // Deprecated! Use color.formatHex. - formatHex: oa, - formatHex8: $c, - formatHsl: Ac, - formatRgb: la, - toString: la + formatHex: ua, + formatHex8: Ac, + formatHsl: Ec, + formatRgb: fa, + toString: fa }); -function oa() { +function ua() { return this.rgb().formatHex(); } -function $c() { +function Ac() { return this.rgb().formatHex8(); } -function Ac() { - return Vo(this).formatHsl(); +function Ec() { + return Ho(this).formatHsl(); } -function la() { +function fa() { return this.rgb().formatRgb(); } -function Ln(t) { +function In(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = gc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? ua(e) : n === 3 ? new Ft(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Kr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Kr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = _c.exec(t)) ? new Ft(e[1], e[2], e[3], 1) : (e = mc.exec(t)) ? new Ft(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = yc.exec(t)) ? Kr(e[1], e[2], e[3], e[4]) : (e = wc.exec(t)) ? Kr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = xc.exec(t)) ? ha(e[1], e[2] / 100, e[3] / 100, 1) : (e = bc.exec(t)) ? ha(e[1], e[2] / 100, e[3] / 100, e[4]) : aa.hasOwnProperty(t) ? ua(aa[t]) : t === "transparent" ? new Ft(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = _c.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? ca(e) : n === 3 ? new It(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Zr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Zr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = mc.exec(t)) ? new It(e[1], e[2], e[3], 1) : (e = yc.exec(t)) ? new It(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = wc.exec(t)) ? Zr(e[1], e[2], e[3], e[4]) : (e = xc.exec(t)) ? Zr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = bc.exec(t)) ? pa(e[1], e[2] / 100, e[3] / 100, 1) : (e = $c.exec(t)) ? pa(e[1], e[2] / 100, e[3] / 100, e[4]) : la.hasOwnProperty(t) ? ca(la[t]) : t === "transparent" ? new It(NaN, NaN, NaN, 0) : null; } -function ua(t) { - return new Ft(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +function ca(t) { + return new It(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function Kr(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new Ft(t, e, n, r); +function Zr(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new It(t, e, n, r); } -function Ec(t) { - return t instanceof Br || (t = Ln(t)), t ? (t = t.rgb(), new Ft(t.r, t.g, t.b, t.opacity)) : new Ft(); +function Rc(t) { + return t instanceof zr || (t = In(t)), t ? (t = t.rgb(), new It(t.r, t.g, t.b, t.opacity)) : new It(); } -function fs(t, e, n, r) { - return arguments.length === 1 ? Ec(t) : new Ft(t, e, n, r ?? 1); +function hs(t, e, n, r) { + return arguments.length === 1 ? Rc(t) : new It(t, e, n, r ?? 1); } -function Ft(t, e, n, r) { +function It(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -Ds(Ft, fs, qo(Br, { +Os(It, hs, Yo(zr, { brighter(t) { - return t = t == null ? di : Math.pow(di, t), new Ft(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? pi : Math.pow(pi, t), new It(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? Pr : Math.pow(Pr, t), new Ft(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Mr : Math.pow(Mr, t), new It(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new Ft(Pn(this.r), Pn(this.g), Pn(this.b), pi(this.opacity)); + return new It(Mn(this.r), Mn(this.g), Mn(this.b), vi(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: fa, + hex: ha, // Deprecated! Use color.formatHex. - formatHex: fa, - formatHex8: Rc, - formatRgb: ca, - toString: ca + formatHex: ha, + formatHex8: Cc, + formatRgb: da, + toString: da })); -function fa() { - return `#${bn(this.r)}${bn(this.g)}${bn(this.b)}`; +function ha() { + return `#${xn(this.r)}${xn(this.g)}${xn(this.b)}`; } -function Rc() { - return `#${bn(this.r)}${bn(this.g)}${bn(this.b)}${bn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function Cc() { + return `#${xn(this.r)}${xn(this.g)}${xn(this.b)}${xn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function ca() { - const t = pi(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${Pn(this.r)}, ${Pn(this.g)}, ${Pn(this.b)}${t === 1 ? ")" : `, ${t})`}`; +function da() { + const t = vi(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${Mn(this.r)}, ${Mn(this.g)}, ${Mn(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function pi(t) { +function vi(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function Pn(t) { +function Mn(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function bn(t) { - return t = Pn(t), (t < 16 ? "0" : "") + t.toString(16); +function xn(t) { + return t = Mn(t), (t < 16 ? "0" : "") + t.toString(16); } -function ha(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new oe(t, e, n, r); +function pa(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new fe(t, e, n, r); } -function Vo(t) { - if (t instanceof oe) return new oe(t.h, t.s, t.l, t.opacity); - if (t instanceof Br || (t = Ln(t)), !t) return new oe(); - if (t instanceof oe) return t; +function Ho(t) { + if (t instanceof fe) return new fe(t.h, t.s, t.l, t.opacity); + if (t instanceof zr || (t = In(t)), !t) return new fe(); + if (t instanceof fe) return t; t = t.rgb(); var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new oe(a, o, l, t.opacity); + return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new fe(a, o, l, t.opacity); } -function Cc(t, e, n, r) { - return arguments.length === 1 ? Vo(t) : new oe(t, e, n, r ?? 1); +function Tc(t, e, n, r) { + return arguments.length === 1 ? Ho(t) : new fe(t, e, n, r ?? 1); } -function oe(t, e, n, r) { +function fe(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -Ds(oe, Cc, qo(Br, { +Os(fe, Tc, Yo(zr, { brighter(t) { - return t = t == null ? di : Math.pow(di, t), new oe(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? pi : Math.pow(pi, t), new fe(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? Pr : Math.pow(Pr, t), new oe(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Mr : Math.pow(Mr, t), new fe(this.h, this.s, this.l * t, this.opacity); }, rgb() { var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; - return new Ft( - Wi(t >= 240 ? t - 240 : t + 120, i, r), - Wi(t, i, r), - Wi(t < 120 ? t + 240 : t - 120, i, r), + return new It( + Gi(t >= 240 ? t - 240 : t + 120, i, r), + Gi(t, i, r), + Gi(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new oe(da(this.h), jr(this.s), jr(this.l), pi(this.opacity)); + return new fe(va(this.h), jr(this.s), jr(this.l), vi(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 t = pi(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${da(this.h)}, ${jr(this.s) * 100}%, ${jr(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = vi(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${va(this.h)}, ${jr(this.s) * 100}%, ${jr(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function da(t) { +function va(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } function jr(t) { return Math.max(0, Math.min(1, t || 0)); } -function Wi(t, e, n) { +function Gi(t, e, n) { return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; } -const Fs = (t) => () => t; -function Tc(t, e) { +const Is = (t) => () => t; +function Nc(t, e) { return function(n) { return t + n * e; }; } -function Nc(t, e, n) { +function Sc(t, e, n) { return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) { return Math.pow(t + r * e, n); }; } -function Sc(t) { +function kc(t) { return (t = +t) == 1 ? zo : function(e, n) { - return n - e ? Nc(e, n, t) : Fs(isNaN(e) ? n : e); + return n - e ? Sc(e, n, t) : Is(isNaN(e) ? n : e); }; } function zo(t, e) { var n = e - t; - return n ? Tc(t, n) : Fs(isNaN(t) ? e : t); + return n ? Nc(t, n) : Is(isNaN(t) ? e : t); } -const vi = (function t(e) { - var n = Sc(e); +const gi = (function t(e) { + var n = kc(e); function r(i, s) { - var a = n((i = fs(i)).r, (s = fs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = zo(i.opacity, s.opacity); + var a = n((i = hs(i)).r, (s = hs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = zo(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 = t, r; })(1); -function kc(t, e) { +function Mc(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { @@ -3804,64 +3804,64 @@ function kc(t, e) { return r; }; } -function Mc(t) { +function Pc(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function Pc(t, e) { +function Dc(t, e) { var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Gn(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = Un(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function Dc(t, e) { +function Fc(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; }; } -function Ae(t, e) { +function Ce(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } -function Fc(t, e) { +function Oc(t, e) { var n = {}, r = {}, i; (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); for (i in e) - i in t ? n[i] = Gn(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = Un(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var cs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Xi = new RegExp(cs.source, "g"); -function Oc(t) { +var ds = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Ki = new RegExp(ds.source, "g"); +function Ic(t) { return function() { return t; }; } -function Ic(t) { +function Lc(t) { return function(e) { return t(e) + ""; }; } -function Ho(t, e) { - var n = cs.lastIndex = Xi.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = cs.exec(t)) && (i = Xi.exec(e)); ) - (s = i.index) > n && (s = e.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: Ae(r, i) })), n = Xi.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Ic(l[0].x) : Oc(e) : (e = l.length, function(u) { - for (var f = 0, c; f < e; ++f) o[(c = l[f]).i] = c.x(u); +function Xo(t, e) { + var n = ds.lastIndex = Ki.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (t = t + "", e = e + ""; (r = ds.exec(t)) && (i = Ki.exec(e)); ) + (s = i.index) > n && (s = e.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: Ce(r, i) })), n = Ki.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Lc(l[0].x) : Ic(e) : (e = l.length, function(u) { + for (var f = 0, h; f < e; ++f) o[(h = l[f]).i] = h.x(u); return o.join(""); }); } -function Gn(t, e) { +function Un(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? Fs(e) : (n === "number" ? Ae : n === "string" ? (r = Ln(e)) ? (e = r, vi) : Ho : e instanceof Ln ? vi : e instanceof Date ? Dc : Mc(e) ? kc : Array.isArray(e) ? Pc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Fc : Ae)(t, e); + return e == null || n === "boolean" ? Is(e) : (n === "number" ? Ce : n === "string" ? (r = In(e)) ? (e = r, gi) : Xo : e instanceof In ? gi : e instanceof Date ? Fc : Pc(e) ? Mc : Array.isArray(e) ? Dc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Oc : Ce)(t, e); } -var pa = 180 / Math.PI, hs = { +var ga = 180 / Math.PI, ps = { translateX: 0, translateY: 0, rotate: 0, @@ -3869,187 +3869,187 @@ var pa = 180 / Math.PI, hs = { scaleX: 1, scaleY: 1 }; -function Yo(t, e, n, r, i, s) { +function Bo(t, e, n, r, i, s) { var a, o, l; return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(e, t) * pa, - skewX: Math.atan(l) * pa, + rotate: Math.atan2(e, t) * ga, + skewX: Math.atan(l) * ga, scaleX: a, scaleY: o }; } -var Zr; -function Lc(t) { +var Jr; +function qc(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? hs : Yo(e.a, e.b, e.c, e.d, e.e, e.f); + return e.isIdentity ? ps : Bo(e.a, e.b, e.c, e.d, e.e, e.f); } -function qc(t) { - return t == null || (Zr || (Zr = document.createElementNS("http://www.w3.org/2000/svg", "g")), Zr.setAttribute("transform", t), !(t = Zr.transform.baseVal.consolidate())) ? hs : (t = t.matrix, Yo(t.a, t.b, t.c, t.d, t.e, t.f)); +function Vc(t) { + return t == null || (Jr || (Jr = document.createElementNS("http://www.w3.org/2000/svg", "g")), Jr.setAttribute("transform", t), !(t = Jr.transform.baseVal.consolidate())) ? ps : (t = t.matrix, Bo(t.a, t.b, t.c, t.d, t.e, t.f)); } -function Bo(t, e, n, r) { +function Wo(t, e, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } - function s(u, f, c, h, v, g) { - if (u !== c || f !== h) { - var m = v.push("translate(", null, e, null, n); - g.push({ i: m - 4, x: Ae(u, c) }, { i: m - 2, x: Ae(f, h) }); - } else (c || h) && v.push("translate(" + c + e + h + n); + function s(u, f, h, c, p, g) { + if (u !== h || f !== c) { + var m = p.push("translate(", null, e, null, n); + g.push({ i: m - 4, x: Ce(u, h) }, { i: m - 2, x: Ce(f, c) }); + } else (h || c) && p.push("translate(" + h + e + c + n); } - function a(u, f, c, h) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), h.push({ i: c.push(i(c) + "rotate(", null, r) - 2, x: Ae(u, f) })) : f && c.push(i(c) + "rotate(" + f + r); + function a(u, f, h, c) { + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Ce(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); } - function o(u, f, c, h) { - u !== f ? h.push({ i: c.push(i(c) + "skewX(", null, r) - 2, x: Ae(u, f) }) : f && c.push(i(c) + "skewX(" + f + r); + function o(u, f, h, c) { + u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Ce(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); } - function l(u, f, c, h, v, g) { - if (u !== c || f !== h) { - var m = v.push(i(v) + "scale(", null, ",", null, ")"); - g.push({ i: m - 4, x: Ae(u, c) }, { i: m - 2, x: Ae(f, h) }); - } else (c !== 1 || h !== 1) && v.push(i(v) + "scale(" + c + "," + h + ")"); + function l(u, f, h, c, p, g) { + if (u !== h || f !== c) { + var m = p.push(i(p) + "scale(", null, ",", null, ")"); + g.push({ i: m - 4, x: Ce(u, h) }, { i: m - 2, x: Ce(f, c) }); + } else (h !== 1 || c !== 1) && p.push(i(p) + "scale(" + h + "," + c + ")"); } return function(u, f) { - var c = [], h = []; - return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, c, h), a(u.rotate, f.rotate, c, h), o(u.skewX, f.skewX, c, h), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, c, h), u = f = null, function(v) { - for (var g = -1, m = h.length, b; ++g < m; ) c[(b = h[g]).i] = b.x(v); - return c.join(""); + var h = [], c = []; + return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, h, c), a(u.rotate, f.rotate, h, c), o(u.skewX, f.skewX, h, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, h, c), u = f = null, function(p) { + for (var g = -1, m = c.length, b; ++g < m; ) h[(b = c[g]).i] = b.x(p); + return h.join(""); }; }; } -var Vc = Bo(Lc, "px, ", "px)", "deg)"), zc = Bo(qc, ", ", ")", ")"), hr = 0, Er = 0, $r = 0, Uo = 1e3, gi, Rr, _i = 0, qn = 0, Mi = 0, Fr = typeof performance == "object" && performance.now ? performance : Date, Wo = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Yc = Wo(qc, "px, ", "px)", "deg)"), Hc = Wo(Vc, ", ", ")", ")"), cr = 0, Ar = 0, br = 0, Uo = 1e3, _i, Er, mi = 0, Ln = 0, Pi = 0, Dr = typeof performance == "object" && performance.now ? performance : Date, Go = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; -function Os() { - return qn || (Wo(Hc), qn = Fr.now() + Mi); +function Ls() { + return Ln || (Go(zc), Ln = Dr.now() + Pi); } -function Hc() { - qn = 0; +function zc() { + Ln = 0; } -function mi() { +function yi() { this._call = this._time = this._next = null; } -mi.prototype = Xo.prototype = { - constructor: mi, +yi.prototype = Ko.prototype = { + constructor: yi, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Os() : +n) + (e == null ? 0 : +e), !this._next && Rr !== this && (Rr ? Rr._next = this : gi = this, Rr = this), this._call = t, this._time = n, ds(); + n = (n == null ? Ls() : +n) + (e == null ? 0 : +e), !this._next && Er !== this && (Er ? Er._next = this : _i = this, Er = this), this._call = t, this._time = n, vs(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, ds()); + this._call && (this._call = null, this._time = 1 / 0, vs()); } }; -function Xo(t, e, n) { - var r = new mi(); +function Ko(t, e, n) { + var r = new yi(); return r.restart(t, e, n), r; } -function Yc() { - Os(), ++hr; - for (var t = gi, e; t; ) - (e = qn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --hr; +function Xc() { + Ls(), ++cr; + for (var t = _i, e; t; ) + (e = Ln - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --cr; } -function va() { - qn = (_i = Fr.now()) + Mi, hr = Er = 0; +function _a() { + Ln = (mi = Dr.now()) + Pi, cr = Ar = 0; try { - Yc(); + Xc(); } finally { - hr = 0, Uc(), qn = 0; + cr = 0, Wc(), Ln = 0; } } function Bc() { - var t = Fr.now(), e = t - _i; - e > Uo && (Mi -= e, _i = t); + var t = Dr.now(), e = t - mi; + e > Uo && (Pi -= e, mi = t); } -function Uc() { - for (var t, e = gi, n, r = 1 / 0; e; ) - e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : gi = n); - Rr = t, ds(r); +function Wc() { + for (var t, e = _i, n, r = 1 / 0; e; ) + e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : _i = n); + Er = t, vs(r); } -function ds(t) { - if (!hr) { - Er && (Er = clearTimeout(Er)); - var e = t - qn; - e > 24 ? (t < 1 / 0 && (Er = setTimeout(va, t - Fr.now() - Mi)), $r && ($r = clearInterval($r))) : ($r || (_i = Fr.now(), $r = setInterval(Bc, Uo)), hr = 1, Wo(va)); +function vs(t) { + if (!cr) { + Ar && (Ar = clearTimeout(Ar)); + var e = t - Ln; + e > 24 ? (t < 1 / 0 && (Ar = setTimeout(_a, t - Dr.now() - Pi)), br && (br = clearInterval(br))) : (br || (mi = Dr.now(), br = setInterval(Bc, Uo)), cr = 1, Go(_a)); } } -function ga(t, e, n) { - var r = new mi(); +function ma(t, e, n) { + var r = new yi(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var Wc = Ro("start", "end", "cancel", "interrupt"), Xc = [], Go = 0, _a = 1, ps = 2, si = 3, ma = 4, vs = 5, ai = 6; -function Pi(t, e, n, r, i, s) { +var Uc = To("start", "end", "cancel", "interrupt"), Gc = [], Zo = 0, ya = 1, gs = 2, ai = 3, wa = 4, _s = 5, oi = 6; +function Di(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - Gc(t, n, { + Kc(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. - on: Wc, - tween: Xc, + on: Uc, + tween: Gc, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: Go + state: Zo }); } -function Is(t, e) { - var n = he(t, e); - if (n.state > Go) throw new Error("too late; already scheduled"); +function qs(t, e) { + var n = ve(t, e); + if (n.state > Zo) throw new Error("too late; already scheduled"); return n; } -function Se(t, e) { - var n = he(t, e); - if (n.state > si) throw new Error("too late; already running"); +function Pe(t, e) { + var n = ve(t, e); + if (n.state > ai) throw new Error("too late; already running"); return n; } -function he(t, e) { +function ve(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Gc(t, e, n) { +function Kc(t, e, n) { var r = t.__transition, i; - r[e] = n, n.timer = Xo(s, 0, n.time); + r[e] = n, n.timer = Ko(s, 0, n.time); function s(u) { - n.state = _a, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = ya, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { - var f, c, h, v; - if (n.state !== _a) return l(); + var f, h, c, p; + if (n.state !== ya) return l(); for (f in r) - if (v = r[f], v.name === n.name) { - if (v.state === si) return ga(a); - v.state === ma ? (v.state = ai, v.timer.stop(), v.on.call("interrupt", t, t.__data__, v.index, v.group), delete r[f]) : +f < e && (v.state = ai, v.timer.stop(), v.on.call("cancel", t, t.__data__, v.index, v.group), delete r[f]); + if (p = r[f], p.name === n.name) { + if (p.state === ai) return ma(a); + p.state === wa ? (p.state = oi, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = oi, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); } - if (ga(function() { - n.state === si && (n.state = ma, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = ps, n.on.call("start", t, t.__data__, n.index, n.group), n.state === ps) { - for (n.state = si, i = new Array(h = n.tween.length), f = 0, c = -1; f < h; ++f) - (v = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++c] = v); - i.length = c + 1; + if (ma(function() { + n.state === ai && (n.state = wa, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = gs, n.on.call("start", t, t.__data__, n.index, n.group), n.state === gs) { + for (n.state = ai, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) + (p = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = p); + i.length = h + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = vs, 1), c = -1, h = i.length; ++c < h; ) - i[c].call(t, f); - n.state === vs && (n.on.call("end", t, t.__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 = _s, 1), h = -1, c = i.length; ++h < c; ) + i[h].call(t, f); + n.state === _s && (n.on.call("end", t, t.__data__, n.index, n.group), l()); } function l() { - n.state = ai, n.timer.stop(), delete r[e]; + n.state = oi, n.timer.stop(), delete r[e]; for (var u in r) return; delete t.__transition; } } -function Kc(t, e) { +function Zc(t, e) { var n = t.__transition, r, i, s = !0, a; if (n) { e = e == null ? null : e + ""; @@ -4058,20 +4058,20 @@ function Kc(t, e) { s = !1; continue; } - i = r.state > ps && r.state < vs, r.state = ai, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > gs && r.state < _s, r.state = oi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } function jc(t) { return this.each(function() { - Kc(this, t); + Zc(this, t); }); } -function Zc(t, e) { +function Jc(t, e) { var n, r; return function() { - var i = Se(this, t), s = i.tween; + var i = Pe(this, t), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) @@ -4083,11 +4083,11 @@ function Zc(t, e) { i.tween = r; }; } -function Jc(t, e, n) { +function Qc(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Se(this, t), a = s.tween; + var s = Pe(this, t), a = s.tween; if (a !== r) { i = (r = a).slice(); for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) @@ -4100,298 +4100,298 @@ function Jc(t, e, n) { s.tween = i; }; } -function Qc(t, e) { +function th(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = he(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = ve(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) if ((a = r[i]).name === t) return a.value; return null; } - return this.each((e == null ? Zc : Jc)(n, t, e)); + return this.each((e == null ? Jc : Qc)(n, t, e)); } -function Ls(t, e, n) { +function Vs(t, e, n) { var r = t._id; return t.each(function() { - var i = Se(this, r); + var i = Pe(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return he(i, r).value[e]; + return ve(i, r).value[e]; }; } -function Ko(t, e) { +function jo(t, e) { var n; - return (typeof e == "number" ? Ae : e instanceof Ln ? vi : (n = Ln(e)) ? (e = n, vi) : Ho)(t, e); + return (typeof e == "number" ? Ce : e instanceof In ? gi : (n = In(e)) ? (e = n, gi) : Xo)(t, e); } -function th(t) { +function eh(t) { return function() { this.removeAttribute(t); }; } -function eh(t) { +function nh(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function nh(t, e, n) { +function rh(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttribute(t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function rh(t, e, n) { +function ih(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttributeNS(t.space, t.local); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function ih(t, e, n) { +function sh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function sh(t, e, n) { +function ah(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function ah(t, e) { - var n = ki(t), r = n === "transform" ? zc : Ko; - return this.attrTween(t, typeof e == "function" ? (n.local ? sh : ih)(n, r, Ls(this, "attr." + t, e)) : e == null ? (n.local ? eh : th)(n) : (n.local ? rh : nh)(n, r, e)); -} function oh(t, e) { + var n = Mi(t), r = n === "transform" ? Hc : jo; + return this.attrTween(t, typeof e == "function" ? (n.local ? ah : sh)(n, r, Vs(this, "attr." + t, e)) : e == null ? (n.local ? nh : eh)(n) : (n.local ? ih : rh)(n, r, e)); +} +function lh(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function lh(t, e) { +function uh(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function uh(t, e) { +function fh(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && lh(t, s)), n; + return s !== r && (n = (r = s) && uh(t, s)), n; } return i._value = e, i; } -function fh(t, e) { +function ch(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && oh(t, s)), n; + return s !== r && (n = (r = s) && lh(t, s)), n; } return i._value = e, i; } -function ch(t, e) { +function hh(t, e) { var n = "attr." + t; if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (e == null) return this.tween(n, null); if (typeof e != "function") throw new Error(); - var r = ki(t); - return this.tween(n, (r.local ? uh : fh)(r, e)); + var r = Mi(t); + return this.tween(n, (r.local ? fh : ch)(r, e)); } -function hh(t, e) { +function dh(t, e) { return function() { - Is(this, t).delay = +e.apply(this, arguments); + qs(this, t).delay = +e.apply(this, arguments); }; } -function dh(t, e) { +function ph(t, e) { return e = +e, function() { - Is(this, t).delay = e; + qs(this, t).delay = e; }; } -function ph(t) { +function vh(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? hh : dh)(e, t)) : he(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? dh : ph)(e, t)) : ve(this.node(), e).delay; } -function vh(t, e) { +function gh(t, e) { return function() { - Se(this, t).duration = +e.apply(this, arguments); + Pe(this, t).duration = +e.apply(this, arguments); }; } -function gh(t, e) { +function _h(t, e) { return e = +e, function() { - Se(this, t).duration = e; + Pe(this, t).duration = e; }; } -function _h(t) { +function mh(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? vh : gh)(e, t)) : he(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? gh : _h)(e, t)) : ve(this.node(), e).duration; } -function mh(t, e) { +function yh(t, e) { if (typeof e != "function") throw new Error(); return function() { - Se(this, t).ease = e; + Pe(this, t).ease = e; }; } -function yh(t) { +function wh(t) { var e = this._id; - return arguments.length ? this.each(mh(e, t)) : he(this.node(), e).ease; + return arguments.length ? this.each(yh(e, t)) : ve(this.node(), e).ease; } -function wh(t, e) { +function xh(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - Se(this, t).ease = n; + Pe(this, t).ease = n; }; } -function xh(t) { +function bh(t) { if (typeof t != "function") throw new Error(); - return this.each(wh(this._id, t)); + return this.each(xh(this._id, t)); } -function bh(t) { - typeof t != "function" && (t = No(t)); +function $h(t) { + typeof t != "function" && (t = ko(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); return new Ke(r, this._parents, this._name, this._id); } -function $h(t) { +function Ah(t) { if (t._id !== this._id) throw new Error(); for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) - for (var l = e[o], u = n[o], f = l.length, c = a[o] = new Array(f), h, v = 0; v < f; ++v) - (h = l[v] || u[v]) && (c[v] = h); + for (var l = e[o], u = n[o], f = l.length, h = a[o] = new Array(f), c, p = 0; p < f; ++p) + (c = l[p] || u[p]) && (h[p] = c); for (; o < r; ++o) a[o] = e[o]; return new Ke(a, this._parents, this._name, this._id); } -function Ah(t) { +function Eh(t) { return (t + "").trim().split(/^|\s+/).every(function(e) { var n = e.indexOf("."); return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; }); } -function Eh(t, e, n) { - var r, i, s = Ah(e) ? Is : Se; +function Rh(t, e, n) { + var r, i, s = Eh(e) ? qs : Pe; return function() { var a = s(this, t), o = a.on; o !== r && (i = (r = o).copy()).on(e, n), a.on = i; }; } -function Rh(t, e) { +function Ch(t, e) { var n = this._id; - return arguments.length < 2 ? he(this.node(), n).on.on(t) : this.each(Eh(n, t, e)); + return arguments.length < 2 ? ve(this.node(), n).on.on(t) : this.each(Rh(n, t, e)); } -function Ch(t) { +function Th(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } -function Th() { - return this.on("end.remove", Ch(this._id)); +function Nh() { + return this.on("end.remove", Th(this._id)); } -function Nh(t) { +function Sh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = Ms(t)); + typeof t != "function" && (t = Ds(t)); 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, c, h = 0; h < l; ++h) - (f = o[h]) && (c = t.call(f, f.__data__, h, o)) && ("__data__" in f && (c.__data__ = f.__data__), u[h] = c, Pi(u[h], e, n, h, u, he(f, n))); + for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, h, c = 0; c < l; ++c) + (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Di(u[c], e, n, c, u, ve(f, n))); return new Ke(s, this._parents, e, n); } -function Sh(t) { +function kh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = To(t)); + typeof t != "function" && (t = So(t)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) - for (var l = r[o], u = l.length, f, c = 0; c < u; ++c) - if (f = l[c]) { - for (var h = t.call(f, f.__data__, c, l), v, g = he(f, n), m = 0, b = h.length; m < b; ++m) - (v = h[m]) && Pi(v, e, n, m, h, g); - s.push(h), a.push(f); + for (var l = r[o], u = l.length, f, h = 0; h < u; ++h) + if (f = l[h]) { + for (var c = t.call(f, f.__data__, h, l), p, g = ve(f, n), m = 0, b = c.length; m < b; ++m) + (p = c[m]) && Di(p, e, n, m, c, g); + s.push(c), a.push(f); } return new Ke(s, a, e, n); } -var kh = vr.prototype.constructor; -function Mh() { - return new kh(this._groups, this._parents); +var Mh = pr.prototype.constructor; +function Ph() { + return new Mh(this._groups, this._parents); } -function Ph(t, e) { +function Dh(t, e) { var n, r, i; return function() { - var s = cr(this, t), a = (this.style.removeProperty(t), cr(this, t)); + var s = fr(this, t), a = (this.style.removeProperty(t), fr(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function jo(t) { +function Jo(t) { return function() { this.style.removeProperty(t); }; } -function Dh(t, e, n) { +function Fh(t, e, n) { var r, i = n + "", s; return function() { - var a = cr(this, t); + var a = fr(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function Fh(t, e, n) { +function Oh(t, e, n) { var r, i, s; return function() { - var a = cr(this, t), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(t), cr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + var a = fr(this, t), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(t), fr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); }; } -function Oh(t, e) { +function Ih(t, e) { var n, r, i, s = "style." + e, a = "end." + s, o; return function() { - var l = Se(this, t), u = l.on, f = l.value[s] == null ? o || (o = jo(e)) : void 0; + var l = Pe(this, t), u = l.on, f = l.value[s] == null ? o || (o = Jo(e)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function Ih(t, e, n) { - var r = (t += "") == "transform" ? Vc : Ko; - return e == null ? this.styleTween(t, Ph(t, r)).on("end.style." + t, jo(t)) : typeof e == "function" ? this.styleTween(t, Fh(t, r, Ls(this, "style." + t, e))).each(Oh(this._id, t)) : this.styleTween(t, Dh(t, r, e), n).on("end.style." + t, null); -} function Lh(t, e, n) { + var r = (t += "") == "transform" ? Yc : jo; + return e == null ? this.styleTween(t, Dh(t, r)).on("end.style." + t, Jo(t)) : typeof e == "function" ? this.styleTween(t, Oh(t, r, Vs(this, "style." + t, e))).each(Ih(this._id, t)) : this.styleTween(t, Fh(t, r, e), n).on("end.style." + t, null); +} +function qh(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } -function qh(t, e, n) { +function Vh(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && Lh(t, a, n)), r; + return a !== i && (r = (i = a) && qh(t, a, n)), r; } return s._value = e, s; } -function Vh(t, e, n) { +function Yh(t, e, n) { var r = "style." + (t += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; if (e == null) return this.tween(r, null); if (typeof e != "function") throw new Error(); - return this.tween(r, qh(t, e, n ?? "")); + return this.tween(r, Vh(t, e, n ?? "")); } -function zh(t) { +function Hh(t) { return function() { this.textContent = t; }; } -function Hh(t) { +function zh(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function Yh(t) { - return this.tween("text", typeof t == "function" ? Hh(Ls(this, "text", t)) : zh(t == null ? "" : t + "")); +function Xh(t) { + return this.tween("text", typeof t == "function" ? zh(Vs(this, "text", t)) : Hh(t == null ? "" : t + "")); } function Bh(t) { return function(e) { this.textContent = t.call(this, e); }; } -function Uh(t) { +function Wh(t) { var e, n; function r() { var i = t.apply(this, arguments); @@ -4399,19 +4399,19 @@ function Uh(t) { } return r._value = t, r; } -function Wh(t) { +function Uh(t) { var e = "text"; if (arguments.length < 1) return (e = this.tween(e)) && e._value; if (t == null) return this.tween(e, null); if (typeof t != "function") throw new Error(); - return this.tween(e, Uh(t)); + return this.tween(e, Wh(t)); } -function Xh() { - for (var t = this._name, e = this._id, n = Zo(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function Gh() { + for (var t = this._name, e = this._id, n = Qo(), 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 = he(l, e); - Pi(l, t, n, u, a, { + var f = ve(l, e); + Di(l, t, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, @@ -4420,97 +4420,97 @@ function Xh() { } return new Ke(r, this._parents, t, n); } -function Gh() { +function Kh() { var t, e, 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 = Se(this, r), f = u.on; + var u = Pe(this, r), f = u.on; f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; }), i === 0 && s(); }); } -var Kh = 0; +var Zh = 0; function Ke(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function oi(t) { - return vr().transition(t); +function li(t) { + return pr().transition(t); } -function Zo() { - return ++Kh; +function Qo() { + return ++Zh; } -var qe = vr.prototype; -Ke.prototype = oi.prototype = { +var qe = pr.prototype; +Ke.prototype = li.prototype = { constructor: Ke, - select: Nh, - selectAll: Sh, + select: Sh, + selectAll: kh, selectChild: qe.selectChild, selectChildren: qe.selectChildren, - filter: bh, - merge: $h, - selection: Mh, - transition: Xh, + filter: $h, + merge: Ah, + selection: Ph, + transition: Gh, call: qe.call, nodes: qe.nodes, node: qe.node, size: qe.size, empty: qe.empty, each: qe.each, - on: Rh, - attr: ah, - attrTween: ch, - style: Ih, - styleTween: Vh, - text: Yh, - textTween: Wh, - remove: Th, - tween: Qc, - delay: ph, - duration: _h, - ease: yh, - easeVarying: xh, - end: Gh, + on: Ch, + attr: oh, + attrTween: hh, + style: Lh, + styleTween: Yh, + text: Xh, + textTween: Uh, + remove: Nh, + tween: th, + delay: vh, + duration: mh, + ease: wh, + easeVarying: bh, + end: Kh, [Symbol.iterator]: qe[Symbol.iterator] }; function jh(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var Zh = { +var Jh = { time: null, // Set on use. delay: 0, duration: 250, ease: jh }; -function Jh(t, e) { +function Qh(t, e) { for (var n; !(n = t.__transition) || !(n = n[e]); ) if (!(t = t.parentNode)) throw new Error(`transition ${e} not found`); return n; } -function Qh(t) { +function td(t) { var e, n; - t instanceof Ke ? (e = t._id, t = t._name) : (e = Zo(), (n = Zh).time = Os(), t = t == null ? null : t + ""); + t instanceof Ke ? (e = t._id, t = t._name) : (e = Qo(), (n = Jh).time = Ls(), t = t == null ? null : t + ""); 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]) && Pi(l, t, e, u, a, n || Jh(l, e)); + (l = a[u]) && Di(l, t, e, u, a, n || Qh(l, e)); return new Ke(r, this._parents, t, e); } -vr.prototype.interrupt = jc; -vr.prototype.transition = Qh; -const gs = Math.PI, _s = 2 * gs, _n = 1e-6, td = _s - _n; -function Jo(t) { +pr.prototype.interrupt = jc; +pr.prototype.transition = td; +const ms = Math.PI, ys = 2 * ms, gn = 1e-6, ed = ys - gn; +function tl(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function ed(t) { +function nd(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return Jo; + if (e > 15) return tl; const n = 10 ** e; return function(r) { this._ += r[0]; @@ -4518,10 +4518,10 @@ function ed(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class nd { +class rd { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? Jo : ed(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? tl : nd(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -4540,20 +4540,20 @@ class nd { } arcTo(e, n, r, i, s) { if (e = +e, 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 - e, u = i - n, f = a - e, c = o - n, h = f * f + c * c; + let a = this._x1, o = this._y1, l = r - e, u = i - n, f = a - e, h = o - n, c = f * f + h * h; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (h > _n) if (!(Math.abs(c * l - u * f) > _n) || !s) + else if (c > gn) if (!(Math.abs(h * l - u * f) > gn) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let v = r - a, g = i - o, m = l * l + u * u, b = v * v + g * g, $ = Math.sqrt(m), R = Math.sqrt(h), E = s * Math.tan((gs - Math.acos((m + h - b) / (2 * $ * R))) / 2), C = E / R, F = E / $; - Math.abs(C - 1) > _n && this._append`L${e + C * f},${n + C * c}`, this._append`A${s},${s},0,0,${+(c * v > f * g)},${this._x1 = e + F * l},${this._y1 = n + F * u}`; + let p = r - a, g = i - o, m = l * l + u * u, b = p * p + g * g, $ = Math.sqrt(m), R = Math.sqrt(c), E = s * Math.tan((ms - Math.acos((m + c - b) / (2 * $ * R))) / 2), M = E / R, C = E / $; + Math.abs(M - 1) > gn && this._append`L${e + M * f},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * p > f * g)},${this._x1 = e + C * l},${this._y1 = n + C * u}`; } } arc(e, n, r, i, s, a) { if (e = +e, 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 = e + o, f = n + l, c = 1 ^ a, h = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > _n || Math.abs(this._y1 - f) > _n) && this._append`L${u},${f}`, r && (h < 0 && (h = h % _s + _s), h > td ? this._append`A${r},${r},0,1,${c},${e - o},${n - l}A${r},${r},0,1,${c},${this._x1 = u},${this._y1 = f}` : h > _n && this._append`A${r},${r},0,${+(h >= gs)},${c},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + let o = r * Math.cos(i), l = r * Math.sin(i), u = e + o, f = n + l, h = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > gn || Math.abs(this._y1 - f) > gn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % ys + ys), c > ed ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > gn && this._append`A${r},${r},0,${+(c >= ms)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } rect(e, n, r, i) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; @@ -4562,24 +4562,24 @@ class nd { return this._; } } -function rd(t) { +function id(t) { for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); return n; } -const id = rd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +const sd = id("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); function Nt(t) { return function() { return t; }; } -const ya = Math.abs, Rt = Math.atan2, gn = Math.cos, sd = Math.max, Gi = Math.min, ye = Math.sin, Kn = Math.sqrt, kt = 1e-12, Or = Math.PI, yi = Or / 2, li = 2 * Or; -function ad(t) { - return t > 1 ? 0 : t < -1 ? Or : Math.acos(t); +const xa = Math.abs, Tt = Math.atan2, vn = Math.cos, ad = Math.max, Zi = Math.min, be = Math.sin, Gn = Math.sqrt, Pt = 1e-12, Fr = Math.PI, wi = Fr / 2, ui = 2 * Fr; +function od(t) { + return t > 1 ? 0 : t < -1 ? Fr : Math.acos(t); } -function wa(t) { - return t >= 1 ? yi : t <= -1 ? -yi : Math.asin(t); +function ba(t) { + return t >= 1 ? wi : t <= -1 ? -wi : Math.asin(t); } -function od(t) { +function ld(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -4591,69 +4591,69 @@ function od(t) { e = r; } return t; - }, () => new nd(e); + }, () => new rd(e); } -function ld(t) { +function ud(t) { return t.innerRadius; } -function ud(t) { +function fd(t) { return t.outerRadius; } -function fd(t) { +function cd(t) { return t.startAngle; } -function cd(t) { +function hd(t) { return t.endAngle; } -function hd(t) { +function dd(t) { return t && t.padAngle; } -function dd(t, e, n, r, i, s, a, o) { - var l = n - t, u = r - e, f = a - i, c = o - s, h = c * l - f * u; - if (!(h * h < kt)) - return h = (f * (e - s) - c * (t - i)) / h, [t + h * l, e + h * u]; +function pd(t, e, n, r, i, s, a, o) { + var l = n - t, u = r - e, f = a - i, h = o - s, c = h * l - f * u; + if (!(c * c < Pt)) + return c = (f * (e - s) - h * (t - i)) / c, [t + c * l, e + c * u]; } -function Jr(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / Kn(o * o + l * l), f = u * l, c = -u * o, h = t + f, v = e + c, g = n + f, m = r + c, b = (h + g) / 2, $ = (v + m) / 2, R = g - h, E = m - v, C = R * R + E * E, F = i - s, J = h * m - g * v, ct = (E < 0 ? -1 : 1) * Kn(sd(0, F * F * C - J * J)), B = (J * E - R * ct) / C, et = (-J * R - E * ct) / C, _t = (J * E + R * ct) / C, ht = (-J * R + E * ct) / C, U = B - b, S = et - $, I = _t - b, q = ht - $; - return U * U + S * S > I * I + q * q && (B = _t, et = ht), { - cx: B, - cy: et, +function Qr(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / Gn(o * o + l * l), f = u * l, h = -u * o, c = t + f, p = e + h, g = n + f, m = r + h, b = (c + g) / 2, $ = (p + m) / 2, R = g - c, E = m - p, M = R * R + E * E, C = i - s, tt = c * m - g * p, nt = (E < 0 ? -1 : 1) * Gn(ad(0, C * C * M - tt * tt)), Q = (tt * E - R * nt) / M, J = (-tt * R - E * nt) / M, ht = (tt * E + R * nt) / M, yt = (-tt * R + E * nt) / M, dt = Q - b, D = J - $, S = ht - b, Rt = yt - $; + return dt * dt + D * D > S * S + Rt * Rt && (Q = ht, J = yt), { + cx: Q, + cy: J, x01: -f, - y01: -c, - x11: B * (i / F - 1), - y11: et * (i / F - 1) + y01: -h, + x11: Q * (i / C - 1), + y11: J * (i / C - 1) }; } function Ve() { - var t = ld, e = ud, n = Nt(0), r = null, i = fd, s = cd, a = hd, o = null, l = od(u); + var t = ud, e = fd, n = Nt(0), r = null, i = cd, s = hd, a = dd, o = null, l = ld(u); function u() { - var f, c, h = +t.apply(this, arguments), v = +e.apply(this, arguments), g = i.apply(this, arguments) - yi, m = s.apply(this, arguments) - yi, b = ya(m - g), $ = m > g; - if (o || (o = f = l()), v < h && (c = v, v = h, h = c), !(v > kt)) o.moveTo(0, 0); - else if (b > li - kt) - o.moveTo(v * gn(g), v * ye(g)), o.arc(0, 0, v, g, m, !$), h > kt && (o.moveTo(h * gn(m), h * ye(m)), o.arc(0, 0, h, m, g, $)); + var f, h, c = +t.apply(this, arguments), p = +e.apply(this, arguments), g = i.apply(this, arguments) - wi, m = s.apply(this, arguments) - wi, b = xa(m - g), $ = m > g; + if (o || (o = f = l()), p < c && (h = p, p = c, c = h), !(p > Pt)) o.moveTo(0, 0); + else if (b > ui - Pt) + o.moveTo(p * vn(g), p * be(g)), o.arc(0, 0, p, g, m, !$), c > Pt && (o.moveTo(c * vn(m), c * be(m)), o.arc(0, 0, c, m, g, $)); else { - var R = g, E = m, C = g, F = m, J = b, ct = b, B = a.apply(this, arguments) / 2, et = B > kt && (r ? +r.apply(this, arguments) : Kn(h * h + v * v)), _t = Gi(ya(v - h) / 2, +n.apply(this, arguments)), ht = _t, U = _t, S, I; - if (et > kt) { - var q = wa(et / h * ye(B)), mt = wa(et / v * ye(B)); - (J -= q * 2) > kt ? (q *= $ ? 1 : -1, C += q, F -= q) : (J = 0, C = F = (g + m) / 2), (ct -= mt * 2) > kt ? (mt *= $ ? 1 : -1, R += mt, E -= mt) : (ct = 0, R = E = (g + m) / 2); + var R = g, E = m, M = g, C = m, tt = b, nt = b, Q = a.apply(this, arguments) / 2, J = Q > Pt && (r ? +r.apply(this, arguments) : Gn(c * c + p * p)), ht = Zi(xa(p - c) / 2, +n.apply(this, arguments)), yt = ht, dt = ht, D, S; + if (J > Pt) { + var Rt = ba(J / c * be(Q)), H = ba(J / p * be(Q)); + (tt -= Rt * 2) > Pt ? (Rt *= $ ? 1 : -1, M += Rt, C -= Rt) : (tt = 0, M = C = (g + m) / 2), (nt -= H * 2) > Pt ? (H *= $ ? 1 : -1, R += H, E -= H) : (nt = 0, R = E = (g + m) / 2); } - var Ut = v * gn(R), tt = v * ye(R), ke = h * gn(F), de = h * ye(F); - if (_t > kt) { - var ee = v * gn(E), Me = v * ye(E), Ct = h * gn(C), pe = h * ye(C), Tt; - if (b < Or) - if (Tt = dd(Ut, tt, Ct, pe, ee, Me, ke, de)) { - var ve = Ut - Tt[0], Pe = tt - Tt[1], Ze = ee - Tt[0], un = Me - Tt[1], fn = 1 / ye(ad((ve * Ze + Pe * un) / (Kn(ve * ve + Pe * Pe) * Kn(Ze * Ze + un * un))) / 2), Hn = Kn(Tt[0] * Tt[0] + Tt[1] * Tt[1]); - ht = Gi(_t, (h - Hn) / (fn - 1)), U = Gi(_t, (v - Hn) / (fn + 1)); + var pt = p * vn(R), qt = p * be(R), et = c * vn(C), je = c * be(C); + if (ht > Pt) { + var ge = p * vn(E), Gt = p * be(E), fn = c * vn(M), kt = c * be(M), Ct; + if (b < Fr) + if (Ct = pd(pt, qt, fn, kt, ge, Gt, et, je)) { + var se = pt - Ct[0], Je = qt - Ct[1], De = ge - Ct[0], Fe = Gt - Ct[1], cn = 1 / be(od((se * De + Je * Fe) / (Gn(se * se + Je * Je) * Gn(De * De + Fe * Fe))) / 2), hn = Gn(Ct[0] * Ct[0] + Ct[1] * Ct[1]); + yt = Zi(ht, (c - hn) / (cn - 1)), dt = Zi(ht, (p - hn) / (cn + 1)); } else - ht = U = 0; + yt = dt = 0; } - ct > kt ? U > kt ? (S = Jr(Ct, pe, Ut, tt, v, U, $), I = Jr(ee, Me, ke, de, v, U, $), o.moveTo(S.cx + S.x01, S.cy + S.y01), U < _t ? o.arc(S.cx, S.cy, U, Rt(S.y01, S.x01), Rt(I.y01, I.x01), !$) : (o.arc(S.cx, S.cy, U, Rt(S.y01, S.x01), Rt(S.y11, S.x11), !$), o.arc(0, 0, v, Rt(S.cy + S.y11, S.cx + S.x11), Rt(I.cy + I.y11, I.cx + I.x11), !$), o.arc(I.cx, I.cy, U, Rt(I.y11, I.x11), Rt(I.y01, I.x01), !$))) : (o.moveTo(Ut, tt), o.arc(0, 0, v, R, E, !$)) : o.moveTo(Ut, tt), !(h > kt) || !(J > kt) ? o.lineTo(ke, de) : ht > kt ? (S = Jr(ke, de, ee, Me, h, -ht, $), I = Jr(Ut, tt, Ct, pe, h, -ht, $), o.lineTo(S.cx + S.x01, S.cy + S.y01), ht < _t ? o.arc(S.cx, S.cy, ht, Rt(S.y01, S.x01), Rt(I.y01, I.x01), !$) : (o.arc(S.cx, S.cy, ht, Rt(S.y01, S.x01), Rt(S.y11, S.x11), !$), o.arc(0, 0, h, Rt(S.cy + S.y11, S.cx + S.x11), Rt(I.cy + I.y11, I.cx + I.x11), $), o.arc(I.cx, I.cy, ht, Rt(I.y11, I.x11), Rt(I.y01, I.x01), !$))) : o.arc(0, 0, h, F, C, $); + nt > Pt ? dt > Pt ? (D = Qr(fn, kt, pt, qt, p, dt, $), S = Qr(ge, Gt, et, je, p, dt, $), o.moveTo(D.cx + D.x01, D.cy + D.y01), dt < ht ? o.arc(D.cx, D.cy, dt, Tt(D.y01, D.x01), Tt(S.y01, S.x01), !$) : (o.arc(D.cx, D.cy, dt, Tt(D.y01, D.x01), Tt(D.y11, D.x11), !$), o.arc(0, 0, p, Tt(D.cy + D.y11, D.cx + D.x11), Tt(S.cy + S.y11, S.cx + S.x11), !$), o.arc(S.cx, S.cy, dt, Tt(S.y11, S.x11), Tt(S.y01, S.x01), !$))) : (o.moveTo(pt, qt), o.arc(0, 0, p, R, E, !$)) : o.moveTo(pt, qt), !(c > Pt) || !(tt > Pt) ? o.lineTo(et, je) : yt > Pt ? (D = Qr(et, je, ge, Gt, c, -yt, $), S = Qr(pt, qt, fn, kt, c, -yt, $), o.lineTo(D.cx + D.x01, D.cy + D.y01), yt < ht ? o.arc(D.cx, D.cy, yt, Tt(D.y01, D.x01), Tt(S.y01, S.x01), !$) : (o.arc(D.cx, D.cy, yt, Tt(D.y01, D.x01), Tt(D.y11, D.x11), !$), o.arc(0, 0, c, Tt(D.cy + D.y11, D.cx + D.x11), Tt(S.cy + S.y11, S.cx + S.x11), $), o.arc(S.cx, S.cy, yt, Tt(S.y11, S.x11), Tt(S.y01, S.x01), !$))) : o.arc(0, 0, c, C, M, $); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, c = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Or / 2; - return [gn(c) * f, ye(c) * f]; + var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Fr / 2; + return [vn(h) * f, be(h) * f]; }, u.innerRadius = function(f) { return arguments.length ? (t = typeof f == "function" ? f : Nt(+f), u) : t; }, u.outerRadius = function(f) { @@ -4672,30 +4672,30 @@ function Ve() { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function pd(t) { +function vd(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function vd(t, e) { +function gd(t, e) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function gd(t) { +function _d(t) { return t; } -function xa() { - var t = gd, e = vd, n = null, r = Nt(0), i = Nt(li), s = Nt(0); +function $a() { + var t = _d, e = gd, n = null, r = Nt(0), i = Nt(ui), s = Nt(0); function a(o) { - var l, u = (o = pd(o)).length, f, c, h = 0, v = new Array(u), g = new Array(u), m = +r.apply(this, arguments), b = Math.min(li, Math.max(-li, i.apply(this, arguments) - m)), $, R = Math.min(Math.abs(b) / u, s.apply(this, arguments)), E = R * (b < 0 ? -1 : 1), C; + var l, u = (o = vd(o)).length, f, h, c = 0, p = new Array(u), g = new Array(u), m = +r.apply(this, arguments), b = Math.min(ui, Math.max(-ui, i.apply(this, arguments) - m)), $, R = Math.min(Math.abs(b) / u, s.apply(this, arguments)), E = R * (b < 0 ? -1 : 1), M; for (l = 0; l < u; ++l) - (C = g[v[l] = l] = +t(o[l], l, o)) > 0 && (h += C); - for (e != null ? v.sort(function(F, J) { - return e(g[F], g[J]); - }) : n != null && v.sort(function(F, J) { - return n(o[F], o[J]); - }), l = 0, c = h ? (b - u * E) / h : 0; l < u; ++l, m = $) - f = v[l], C = g[f], $ = m + (C > 0 ? C * c : 0) + E, g[f] = { + (M = g[p[l] = l] = +t(o[l], l, o)) > 0 && (c += M); + for (e != null ? p.sort(function(C, tt) { + return e(g[C], g[tt]); + }) : n != null && p.sort(function(C, tt) { + return n(o[C], o[tt]); + }), l = 0, h = c ? (b - u * E) / c : 0; l < u; ++l, m = $) + f = p[l], M = g[f], $ = m + (M > 0 ? M * h : 0) + E, g[f] = { data: o[f], index: l, - value: C, + value: M, startAngle: m, endAngle: $, padAngle: R @@ -4716,16 +4716,16 @@ function xa() { return arguments.length ? (s = typeof o == "function" ? o : Nt(+o), a) : s; }, a; } -function Cr(t, e, n) { +function Rr(t, e, n) { this.k = t, this.x = e, this.y = n; } -Cr.prototype = { - constructor: Cr, +Rr.prototype = { + constructor: Rr, scale: function(t) { - return t === 1 ? this : new Cr(this.k * t, this.x, this.y); + return t === 1 ? this : new Rr(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new Cr(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new Rr(this.k, this.x + this.k * t, this.y + this.k * e); }, apply: function(t) { return [t[0] * this.k + this.x, t[1] * this.k + this.y]; @@ -4755,63 +4755,63 @@ Cr.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Cr.prototype; -var _d = /* @__PURE__ */ yu(''); -const md = { +Rr.prototype; +var md = /* @__PURE__ */ wu(''); +const yd = { 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 Qo(t, e) { - xs(e, !0), $o(t, md); - let n = vt(e, "jsonData", 7), r = vt(e, "currentRound", 7, 1), i = vt(e, "mouseEventType", 15), s = vt(e, "mouseData", 15), a = vt(e, "mouseY", 15), o = vt(e, "requestRoundChange", 7, (d) => { - }), l = vt(e, "candidateColors", 23, () => []), u = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), f = vt(e, "firstRoundDeterminesPercentages", 7, !1), c = vt(e, "displayPhase", 15, 0); - function h(d) { +function el(t, e) { + $s(e, !0), Eo(t, yd); + let n = vt(e, "jsonData", 7), r = vt(e, "currentRound", 7, 1), i = vt(e, "mouseEventType", 15), s = vt(e, "mouseData", 15), a = vt(e, "mouseX", 15), o = vt(e, "mouseY", 15), l = vt(e, "requestRoundChange", 7, (d) => { + }), u = vt(e, "candidateColors", 23, () => []), f = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = vt(e, "firstRoundDeterminesPercentages", 7, !1), c = vt(e, "displayPhase", 15, 0); + function p(d) { return d.isTransfer ? `${d.label}__transfer` : d.transferIndex != null ? `${d.label}__${d.transferIndex}` : d.label; } - const v = 800, g = 800, m = Math.min(v, g) * 0.3, b = v / 2, $ = g / 2, R = "Pie", E = "Donut", C = "TextLayer", F = "url(#cross-hatch)", J = 1.15, ct = 0.1, B = 750, et = 800; - function _t(d) { + const g = 800, m = 800, b = Math.min(g, m) * 0.3, $ = g / 2, R = m / 2, E = "Pie", M = "Donut", C = "TextLayer", tt = "url(#cross-hatch)", nt = 1.15, Q = 0.1, J = 750, ht = 800; + function yt(d) { return "hatch-" + d.replace(/[^a-zA-Z0-9]/g, "-"); } - let ht = [], U = [], S = [], I = 0, q = 0; - const mt = {}, Ut = "No Further Rankings"; - let tt = /* @__PURE__ */ xt(null); - function ke() { - const d = yt(x(tt)); - d.select("#" + R).remove(), d.select("#" + E).remove(), d.select("#" + C).remove(); + let dt = [], D = [], S = [], Rt = 0, H = 0; + const pt = {}, qt = "No Further Rankings"; + let et = /* @__PURE__ */ _t(null); + function je() { + const d = xt(x(et)); + d.select("#" + E).remove(), d.select("#" + M).remove(), d.select("#" + C).remove(); } - function de(d) { - o() && (j = d, o()(d)); + function ge(d) { + l() && (rt = d, l()(d)); } - function ee(d) { - ke(), S = Me(d), ht = tl(d, R, S, b, $, 0, Ct()); + function Gt(d) { + je(), S = fn(d), dt = Li(d, E, S, $, R, 0, kt()); } - Eu(() => { - Fi(), setTimeout( + Ru(() => { + vr(), setTimeout( () => { - ee(r()); + Gt(r()); }, 0 ); }); - function Me(d) { - const _ = Yn(d); - return I = un(d), _; + function fn(d) { + const _ = Br(d); + return Rt = cn(d), _; } - function Ct() { - return m; + function kt() { + return b; } - function pe() { - return Ct() * 1.41; + function Ct() { + return kt() * 1.41; } - function Tt(d) { + function se(d) { let _ = 0; - for (let y = 1; y < d; y++) { - const M = n().results[y - 1].tallyResults; - for (let A = 0; A < M.length; A++) { - const T = M[A].transfers; + for (let w = 1; w < d; w++) { + const P = n().results[w - 1].tallyResults; + for (let A = 0; A < P.length; A++) { + const T = P[A].transfers; if (T) { const k = T.exhausted; k && (_ += Number(k)); @@ -4820,510 +4820,517 @@ function Qo(t, e) { } return _; } - function ve(d, _) { - if (d === "exhausted") return Tt(_); + function Je(d, _) { + if (d === "exhausted") return se(_); { - const y = n().results[_ - 1].tally; - return Number(y[d]); + const w = n().results[_ - 1].tally; + return Number(w[d]); } } - function Pe(d, _) { - return ve(d, _).toLocaleString("en-US"); + function De(d, _) { + return Je(d, _).toLocaleString("en-US"); } - function Ze(d, _) { - const y = f() ? I : Hn(_); - return (ve(d, _) / y).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Fe(d, _) { + const w = h() ? Rt : Fi(_); + return (Je(d, _) / w).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function un(d) { + function cn(d) { const _ = n().results[d - 1].tally; - let y = 0; - for (let [M, A] of Object.entries(_)) - y += Number(A); - return y; + let w = 0; + for (let [P, A] of Object.entries(_)) + w += Number(A); + return w; } - function fn(d) { + function hn(d) { return d === "exhausted" || d === "Inactive Ballots"; } - function Hn(d) { + function Fi(d) { const _ = n().results[d - 1].tally; - let y = 0; - for (let [M, A] of Object.entries(_)) - fn(M) || (y += Number(A)); - return y; + let w = 0; + for (let [P, A] of Object.entries(_)) + hn(P) || (w += Number(A)); + return w; } - function cn(d, _) { + function Xr(d, _) { if (!d || d < 1 || d > n().results.length) return console.warn("In chsoenCandidates: round ${round} is out of range."), []; - if (u() && d === n().results.length) + if (f() && d === n().results.length) return []; - const y = n().results[d - 1].tallyResults, M = []; - for (let A = 0; A < y.length; A++) { - const T = y[A][_]; - T != null && M.push(T); + const w = n().results[d - 1].tallyResults, P = []; + for (let A = 0; A < w.length; A++) { + const T = w[A][_]; + T != null && P.push(T); } - return M; + return P; } - function hn(d) { - return cn(d, "eliminated"); + function Qe(d) { + return Xr(d, "eliminated"); } - function gr(d) { + function dn(d) { let _ = []; - for (let y = 1; y <= d; y++) _ = _.concat(cn(y, "elected")); + for (let w = 1; w <= d; w++) _ = _.concat(Xr(w, "elected")); return _; } - function Di(d, _) { - const y = n().results[_ - 1].tallyResults; - let M = 0; - const A = y.findIndex((T) => (T == null ? void 0 : T.elected) && d == T.elected); + function Oi(d, _) { + const w = n().results[_ - 1].tallyResults; + let P = 0; + const A = w.findIndex((T) => (T == null ? void 0 : T.elected) && d == T.elected); if (A >= 0) { - const T = y[A].transfers; + const T = w[A].transfers; if (T) - for (let [k, O] of Object.entries(T)) M += Number(O); + for (let [k, I] of Object.entries(T)) P += Number(I); } else return 0; - return M; + return P; } - function Yn(d) { + function Br(d) { const _ = n().results; - let y = _[Math.max(0, d - 2)].tally; - const M = [], A = []; - for (let [k, O] of Object.entries(y)) - M.push({ label: k, value: 0 }); - y = _[d - 1].tally; - for (let k of M) { - const O = Number(y[k.label]), V = Di(k.label, d); - V > 0 ? (A.push({ + let w = _[Math.max(0, d - 2)].tally; + const P = [], A = []; + for (let [k, I] of Object.entries(w)) + P.push({ label: k, value: 0 }); + w = _[d - 1].tally; + for (let k of P) { + const I = Number(w[k.label]), q = Oi(k.label, d); + q > 0 ? (A.push({ label: k.label, - value: V, + value: q, isTransfer: !0 - }), k.value = O - V, A.push(k)) : (k.value = O, A.push(k)); + }), k.value = I - q, A.push(k)) : (k.value = I, A.push(k)); } - const T = Tt(d); + const T = se(d); return A.push({ label: "exhausted", value: T }), A; } - function Fi() { - const d = yt(x(tt)).select("defs").select("#cross-hatch"); + function vr() { + const d = xt(x(et)).select("defs").select("#cross-hatch"); let _ = 0; - for (let [y, M] of Object.entries(n().results[0].tally)) { - !l() || l().length === 0 ? _ < 10 ? mt[y] = id[_] : mt[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : mt[y] = l()[_ % l().length], _++; + for (let [w, P] of Object.entries(n().results[0].tally)) { + !u() || u().length === 0 ? _ < 10 ? pt[w] = sd[_] : pt[w] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : pt[w] = u()[_ % u().length], _++; { const A = d.clone(!0); - A.attr("id", _t(y)).select("rect").attr("fill", mt[y]), A.selectAll("circle").attr("fill", "#383838"); + A.attr("id", yt(w)).select("rect").attr("fill", pt[w]), A.selectAll("circle").attr("fill", "#383838"); } } - mt.exhausted = F, mt["Inactive Ballots"] = F; + pt.exhausted = tt, pt["Inactive Ballots"] = tt; } - function w() { - yt(x(tt)).select("#" + E).remove(); + function Ii() { + xt(x(et)).select("#" + M).remove(); } - function X(d, _) { - const y = oi("global").duration(et); - _ && y.on("end", _), w(), Fe(d), el(), rl(0, Ct()), Ur(); + function y(d, _) { + const w = li("global").duration(ht); + _ && w.on("end", _), Ii(), zn(d), nl(), il(0, kt()), Wr(); } - function nt(d, _) { - const y = oi("global").duration(et); - _ && y.on("end", _), Oe(d); + function z(d, _) { + const w = li("global").duration(ht); + _ && w.on("end", _), Ie(d); } - function st(d, _) { - const y = oi("global").duration(et); - _ && y.on("end", _), Bn(d), Un(Ct()); + function Z(d, _) { + const w = li("global").duration(ht); + _ && w.on("end", _), Yn(d), Hn(kt()); } - let Q = !1, rt = []; - function Et() { - Ur(), Q = !1, Je(); + let K = !1, st = []; + function G() { + Wr(), K = !1, wt(); } - function Je() { - if (rt.length === 0) { - j !== r() && (r() === j + 1 && j > 0 && r() <= n().results.length ? (j = r(), ne(r())) : r() >= 1 && r() <= n().results.length && (j = r(), c(0), ee(r()))); + function wt() { + if (st.length === 0) { + rt !== r() && (r() === rt + 1 && rt > 0 && r() <= n().results.length ? (rt = r(), _e(r())) : r() >= 1 && r() <= n().results.length && (rt = r(), c(0), Gt(r()))); return; } - const d = rt.shift(); + const d = st.shift(); switch (d.type) { case "round": { const _ = d.round; - _ === j + 1 && j > 0 && _ <= n().results.length ? (j = _, ne(_)) : (_ !== j && _ >= 1 && _ <= n().results.length && (j = _, c(0), ee(_)), Je()); + _ === rt + 1 && rt > 0 && _ <= n().results.length ? (rt = _, _e(_)) : (_ !== rt && _ >= 1 && _ <= n().results.length && (rt = _, c(0), Gt(_)), wt()); break; } case "step": - pn(); + Oe(); break; } } - function ne(d) { + function _e(d) { if (d <= 1 || d > n().results.length) { - Je(); + wt(); return; } - Q = !0, q = d, c(0), X(q - 1, () => { - nt(q - 1, () => { - st(q, Et); + K = !0, H = d, c(0), y(H - 1, () => { + z(H - 1, () => { + Z(H, G); }); }); } - function dn() { - Q || (Q = !0, q = r(), De()); + function me() { + K || (K = !0, H = r(), tn()); } - function De() { + function tn() { if (c( 0 // if in the middle of "one small step" animation, reset to 0. - ), rt.length > 0) { - Et(); + ), st.length > 0) { + G(); return; } - const d = q < n().results.length - 1 ? De : Et; - X(q, () => { - nt(q, () => { - q++, de(q), st(q, d); + const d = H < n().results.length - 1 ? tn : G; + y(H, () => { + z(H, () => { + H++, ge(H), Z(H, d); }); }); } - Cs(() => { - ge(); + Ns(() => { + Mt(); }); - let j = 0; - function ge() { - if (j != r()) { - if (Q) { - rt.push({ type: "round", round: r() }); + let rt = 0; + function Mt() { + if (rt != r()) { + if (K) { + st.push({ type: "round", round: r() }); return; } - j == r() - 1 && j > 0 ? Qe() : Wt(r()), j = r(); + rt == r() - 1 && rt > 0 ? Kt() : ye(r()), rt = r(); } } - function Wt(d) { - if (Q) { - rt.push({ type: "round", round: d }); + function ye(d) { + if (K) { + st.push({ type: "round", round: d }); return; } - c(0), ee(d); + c(0), Gt(d); } - function Qe() { - if (Q) { - rt.push({ type: "round", round: r() }); + function Kt() { + if (K) { + st.push({ type: "round", round: r() }); return; } if (r() <= 1) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (q = r(), q > n().results.length) { - Ur(), Q = !1; + if (H = r(), H > n().results.length) { + Wr(), K = !1; return; } - Q = !0, c() === 0 ? X(q - 1, () => { - nt(q - 1, () => { - st(q, Et); + K = !0, c() === 0 ? y(H - 1, () => { + z(H - 1, () => { + Z(H, G); }); - }) : c() === 1 ? nt(q - 1, () => { - st(q, Et); - }) : c() === 2 && st(q, Et), c(0); + }) : c() === 1 ? z(H - 1, () => { + Z(H, G); + }) : c() === 2 && Z(H, G), c(0); } - function pn() { + function Oe() { if (r() > n().results.length) { - Ur(), Q = !1; + Wr(), K = !1; return; } - if (Q) { - rt.push({ type: "step" }); + if (K) { + st.push({ type: "step" }); return; } - Q = !0, c((c() + 1) % 3), q = r(), c() === 1 ? X(q, Et) : c() === 2 ? nt(q, Et) : c() === 0 ? (q++, de(q), st(q, Et)) : (Q = !1, console.warn("displayPhase out of range at ", c())); + K = !0, c((c() + 1) % 3), H = r(), c() === 1 ? y(H, G) : c() === 2 ? z(H, G) : c() === 0 ? (H++, ge(H), Z(H, G)) : (K = !1, console.warn("displayPhase out of range at ", c())); } - function Bn(d) { - S = Yn(d), ht = il(d, R, S, 0, Ct(), !0); + function Yn(d) { + S = Br(d), dt = sl(d, E, S, 0, kt(), !0); } - function Un(d, _) { - const y = yt(x(tt)).select("#" + E), M = Ve().outerRadius(d).innerRadius(d - 1), A = y.selectAll(".slice"); + function Hn(d, _) { + const w = xt(x(et)).select("#" + M), P = Ve().outerRadius(d).innerRadius(d - 1), A = w.selectAll(".slice"); let T = A.size(); function k() { - T--, T === 0 && nl(); + T--, T === 0 && rl(); } - A.select("path").transition("global").duration(B).attr("d", (O) => M(O)).on("end", (O) => k()); - } - function Fe(d) { - const _ = mr(d, ht); - U = Vs(d, E, _, b, $, Ct(), pe(), !1, !0); + A.select("path").transition("global").duration(J).attr("d", (I) => P(I)).on("end", (I) => k()); } - function Oe(d) { - const _ = Le(d, U, ht); - U = zs(d, E, _, Ct(), pe(), !1); + function zn(d) { + const _ = gr(d, dt); + D = Hs(d, M, _, $, R, kt(), Ct(), !1, !0); } function Ie(d) { - return mt[d.data.label]; + const _ = mr(d, D, dt); + D = zs(d, M, _, kt(), Ct(), !1); } - function _r(d) { - const _ = {}, y = n().results[d - 1].tallyResults; - for (let M = 0; M < y.length; M++) { - let A = y[M].eliminated; - if (A === void 0 && (A = y[M].elected), A === void 0) { + function Zt(d) { + return pt[d.data.label]; + } + function Xn(d) { + const _ = {}, w = n().results[d - 1].tallyResults; + for (let P = 0; P < w.length; P++) { + let A = w[P].eliminated; + if (A === void 0 && (A = w[P].elected), A === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const T = y[M].transfers; + const T = w[P].transfers; if (T === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [k, O] of Object.entries(T)) - _[k] === void 0 ? _[k] = Number(O) : _[k] += Number(O); + for (let [k, I] of Object.entries(T)) + _[k] === void 0 ? _[k] = Number(I) : _[k] += Number(I); } return _; } - function mr(d, _) { - const y = [], M = I, A = n().results[d - 1].tallyResults; + function gr(d, _) { + const w = [], P = Rt, A = n().results[d - 1].tallyResults; for (let T = 0; T < A.length; T++) { let k = A[T].eliminated; if (k === void 0 && (k = A[T].elected), k === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const O = A[T].transfers; - if (O === void 0) { + const I = A[T].transfers; + if (I === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let V = _.find((D) => D.data.label == k && D.data.isTransfer); - V === void 0 && (V = _.find((D) => D.data.label == k && !D.data.isTransfer)); - let G = 0; - if (V) G = V.startAngle; + let q = _.find((O) => O.data.label == k && O.data.isTransfer); + q === void 0 && (q = _.find((O) => O.data.label == k && !O.data.isTransfer)); + let W = 0; + if (q) W = q.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [D, Y] of Object.entries(O)) { + for (let [O, X] of Object.entries(I)) { let it; - const me = _.find((lt) => lt.data.label == D); - if (me) - it = structuredClone(me); - else if (D == "exhausted") + const xe = _.find((ut) => ut.data.label == O); + if (xe) + it = structuredClone(xe); + else if (O == "exhausted") it = { - data: { label: D, value: Number(Y) }, + data: { label: O, value: Number(X) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (D == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", Y); + else if (O == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", X); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", D); + console.warn("makeDonutInfo: unrecognized name in transfers ", O); continue; } - const N = Number(Y) / M * 2 * Math.PI; - it.startAngle = G, G = it.endAngle = G + N, it.index = T, it.data.transferIndex = T, y.push(it); + const N = Number(X) / P * 2 * Math.PI; + it.startAngle = W, W = it.endAngle = W + N, it.index = T, it.data.transferIndex = T, w.push(it); } } - return y; + return w; } - function yr(d, _, y) { - const M = {}; + function _r(d, _, w) { + const P = {}; for (let [A, T] of Object.entries(d)) { - const k = y.find((G) => A == G.data.label); + const k = w.find((W) => A == W.data.label); if (k === void 0) { console.warn("getTransferStartAngles: mainPieObj not found for ", A); continue; } - const O = (k.startAngle + k.endAngle) / 2, V = d[k.data.label] / _ * 2 * Math.PI; - M[k.data.label] = O - V / 2; + const I = (k.startAngle + k.endAngle) / 2, q = d[k.data.label] / _ * 2 * Math.PI; + P[k.data.label] = I - q / 2; } - return M; - } - function Le(d, _, y) { - const M = [], A = I, T = _r(d), k = yr(T, A, y); - for (let [O, V] of _.entries()) { - const G = structuredClone(V), D = V.endAngle - V.startAngle, Y = y.find((it) => V.data.label === it.data.label && !it.data.isTransfer); - if (Y) { - const it = Y.data.label; - G.startAngle = k[it], k[it] += D, G.endAngle = G.startAngle + D; - } else if (V.data.label === "exhausted") - G.startAngle = V.startAngle, G.endAngle = V.endAngle; + return P; + } + function mr(d, _, w) { + const P = [], A = Rt, T = Xn(d), k = _r(T, A, w); + for (let [I, q] of _.entries()) { + const W = structuredClone(q), O = q.endAngle - q.startAngle, X = w.find((it) => q.data.label === it.data.label && !it.data.isTransfer); + if (X) { + const it = X.data.label; + W.startAngle = k[it], k[it] += O, W.endAngle = W.startAngle + O; + } else if (q.data.label === "exhausted") + W.startAngle = q.startAngle, W.endAngle = q.endAngle; else { - console.warn("updateDonutInfo: unrecognized slice name ", V.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", q.data.label); continue; } - G.index = O, M.push(G); + W.index = I, P.push(W); } - return M; - } - function _e(d, _, y, M, A, T) { - const O = yt(x(tt)).append("g").attr("id", C).attr("transform", `translate(${y}, ${M})`), V = Ve().innerRadius(A * J).outerRadius(A * J); - O.selectAll("text").data(_).enter().each(function(G) { - G.endAngle - G.startAngle < ct || G.data.isTransfer || yt(this).append("g").attr("id", (D) => h(D.data)).classed("eliminated", (D) => T.includes(D.data.label) || D.data.isTransfer === !0).each(function(D, Y) { - D.data.label === "exhausted" && yt(this).on("mouseenter", (it, me) => sl(it)).on("mouseleave", (it, me) => al()); - }).append("text").attr("transform", (D) => `translate(${V.centroid(D)})`).attr("text-anchor", (D) => Ii(D.startAngle, D.endAngle)).text((D) => D.data.label === "exhausted" ? Ut : D.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((D) => { - const Y = Pe(D.data.label, d); - return !f() && fn(D.data.label) ? Y : Y + " (" + Ze(D.data.label, d) + ")"; + return P; + } + function we(d, _, w, P, A, T) { + const I = xt(x(et)).append("g").attr("id", C).attr("transform", `translate(${w}, ${P})`), q = Ve().innerRadius(A * nt).outerRadius(A * nt); + I.selectAll("text").data(_).enter().each(function(W) { + W.endAngle - W.startAngle < Q || W.data.isTransfer || xt(this).append("g").attr("id", (O) => p(O.data)).classed("eliminated", (O) => T.includes(O.data.label) || O.data.isTransfer === !0).each(function(O, X) { + O.data.label === "exhausted" && xt(this).on("mouseenter", (it, xe) => al(it)).on("mouseleave", (it, xe) => ol()); + }).append("text").attr("transform", (O) => `translate(${q.centroid(O)})`).attr("text-anchor", (O) => qi(O.startAngle, O.endAngle)).text((O) => O.data.label === "exhausted" ? qt : O.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((O) => { + const X = De(O.data.label, d); + return !h() && hn(O.data.label) ? X : X + " (" + Fe(O.data.label, d) + ")"; }); }); } - function Oi(d, _, y, M) { - const T = yt(x(tt)).select("#" + C), k = T.selectAll("tspan"), O = T.selectAll("g").data(_, (Y) => h(Y.data)).classed("eliminated", (Y) => M.includes(Y.data.label) || Y.data.isTransfer === !0), V = Ve().innerRadius(y * J).outerRadius(y * J + 1); - k.transition("global").duration(B).attr("transform", (Y) => `translate(${V.centroid(Y)})`).attr("text-anchor", (Y) => Ii(Y.startAngle, Y.endAngle)), O.select("text").transition("global").duration(B).attr("transform", (Y) => `translate(${V.centroid(Y)})`).attr("text-anchor", (Y) => Ii(Y.startAngle, Y.endAngle)).on("end", (Y) => D()); - let G = O.size(); - function D(Y) { - G--, G === 0 && (T.remove(), _e(d, _, b, $, y, M)); + function Le(d, _, w, P) { + const T = xt(x(et)).select("#" + C), k = T.selectAll("tspan"), I = T.selectAll("g").data(_, (X) => p(X.data)).classed("eliminated", (X) => P.includes(X.data.label) || X.data.isTransfer === !0), q = Ve().innerRadius(w * nt).outerRadius(w * nt + 1); + k.transition("global").duration(J).attr("transform", (X) => `translate(${q.centroid(X)})`).attr("text-anchor", (X) => qi(X.startAngle, X.endAngle)), I.select("text").transition("global").duration(J).attr("transform", (X) => `translate(${q.centroid(X)})`).attr("text-anchor", (X) => qi(X.startAngle, X.endAngle)).on("end", (X) => O()); + let W = I.size(); + function O(X) { + W--, W === 0 && (T.remove(), we(d, _, $, R, w, P)); } } - function tl(d, _, y, M, A, T, k, O = !0, V = !1) { - const D = xa().sort(null).value((Y) => Y.value)(y); - return Vs(d, _, D, M, A, T, k, O, V), D; + function Li(d, _, w, P, A, T, k, I = !0, q = !1) { + const O = $a().sort(null).value((X) => X.value)(w); + return Hs(d, _, O, P, A, T, k, I, q), O; } - function Ur() { - yt(x(tt)).select("#" + R).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); + function Wr() { + xt(x(et)).select("#" + E).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); } - function Vs(d, _, y, M, A, T, k, O, V) { - const G = hn(d), D = gr(d), me = yt(x(tt)).attr("viewBox", `0 0 ${v} ${g}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${M}, ${A})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (N) => G.includes(N.data.label) || N.data.isTransfer === !0).classed("elected", (N) => D.includes(N.data.label) && !N.data.isTransfer).attr("id", (N) => h(N.data)).on("mouseenter", (N, lt) => qi(N, lt)).on("mouseleave", (N, lt) => Vi(N, lt)), wr = Ve().outerRadius(k).innerRadius(T); - if (V) { + function Hs(d, _, w, P, A, T, k, I, q) { + const W = Qe(d), O = dn(d), xe = xt(x(et)).attr("viewBox", `0 0 ${g} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${P}, ${A})`).selectAll(".slice").data(w).enter().append("g").attr("class", "slice").classed("eliminated", (N) => W.includes(N.data.label) || N.data.isTransfer === !0).classed("elected", (N) => O.includes(N.data.label) && !N.data.isTransfer).attr("id", (N) => p(N.data)).on("mouseenter", (N, ut) => Yi(N, ut)).on("mouseleave", (N, ut) => Hi(N, ut)), yr = Ve().outerRadius(k).innerRadius(T); + if (q) { const N = Ve().outerRadius(T + 1).innerRadius(T); - me.append("path").attr("d", N).transition("global").duration(B).attr("d", (lt) => wr(lt)).attr("fill", (lt) => Ie(lt)).on("end", (lt) => Li()); + xe.append("path").attr("d", N).transition("global").duration(J).attr("d", (ut) => yr(ut)).attr("fill", (ut) => Zt(ut)).on("end", (ut) => Vi()); } else - me.append("path").attr("d", (N) => wr(N)).attr("fill", (N) => Ie(N)), Li(); - return O && _e(d, y, M, A, k, G), y; - } - function el() { - const y = yt(x(tt)).select("#" + C).selectAll(".eliminated"); - y.size() > 0 && y.classed("finished", !0); + xe.append("path").attr("d", (N) => yr(N)).attr("fill", (N) => Zt(N)), Vi(); + return I && we(d, w, P, A, k, W), w; } function nl() { - const y = yt(x(tt)).select("#" + C).selectAll(".finished"); - y.size() > 0 && y.remove(); - } - function rl(d, _) { - const A = yt(x(tt)).select("#" + R).selectAll(".eliminated"), T = Ve().innerRadius(d), k = Ve().outerRadius(_); - A.classed("finished", !0).select("path").transition("global").duration(B).attrTween("d", function(O) { - const V = Gn(_, d); - return function(G) { - return k.innerRadius(V(G)), k(O); + const w = xt(x(et)).select("#" + C).selectAll(".eliminated"); + w.size() > 0 && w.classed("finished", !0); + } + function rl() { + const w = xt(x(et)).select("#" + C).selectAll(".finished"); + w.size() > 0 && w.remove(); + } + function il(d, _) { + const A = xt(x(et)).select("#" + E).selectAll(".eliminated"), T = Ve().innerRadius(d), k = Ve().outerRadius(_); + A.classed("finished", !0).select("path").transition("global").duration(J).attrTween("d", function(I) { + const q = Un(_, d); + return function(W) { + return k.innerRadius(q(W)), k(I); }; - }).attr("fill", (O) => `url(#${_t(O.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(B).attrTween("d", function(O) { - const V = Gn(_, d); - return function(G) { - return T.outerRadius(V(G)), T(O); + }).attr("fill", (I) => `url(#${yt(I.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(J).attrTween("d", function(I) { + const q = Un(_, d); + return function(W) { + return T.outerRadius(q(W)), T(I); }; - }).attr("fill", (O) => Ie(O)); + }).attr("fill", (I) => Zt(I)); } - function Ii(d, _) { - const y = (d + _) / 2; - return y > Math.PI * 11 / 6 || y < Math.PI * 1 / 6 || y > Math.PI * 5 / 6 && y < Math.PI * 7 / 6 ? "middle" : y < Math.PI ? "start" : "end"; + function qi(d, _) { + const w = (d + _) / 2; + return w > Math.PI * 11 / 6 || w < Math.PI * 1 / 6 || w > Math.PI * 5 / 6 && w < Math.PI * 7 / 6 ? "middle" : w < Math.PI ? "start" : "end"; } - function Li() { - yt(x( - tt + function Vi() { + xt(x( + et // force redisplay of text labels )).select("#" + C).raise().append("g").remove(); } - function il(d, _, y, M, A, T) { - const O = xa().sort(null).value((V) => V.value)(y); - return zs(d, _, O, M, A, T), O; - } - function zs(d, _, y, M, A, T) { - const k = hn(d), O = gr(d), V = Ve().outerRadius(A).innerRadius(M).startAngle((N) => N.startAngle).endAngle((N) => N.endAngle), G = Ve().outerRadius(A).innerRadius(M), Y = yt(x(tt)).select("#" + _); - Y.selectAll(".slice").attr("prevStart", (N) => N.startAngle).attr("prevEnd", (N) => N.endAngle); - const it = Y.selectAll(".slice").data(y, (N) => h(N.data)); - it.enter().append("g").attr("class", "slice").attr("id", (N) => h(N.data)).classed("eliminated", !0).on("mouseenter", (N, lt) => qi(N, lt)).on("mouseleave", (N, lt) => Vi(N, lt)).append("path").attr("d", (N) => G(N)).attr("fill", (N) => Ie(N)), it.classed("eliminated", (N) => k.includes(N.data.label)).classed("elected", (N) => O.includes(N.data.label)).on("mouseenter", (N, lt) => qi(N, lt)).on("mouseleave", (N, lt) => Vi(N, lt)); - let me = it.size(); - function wr() { - me--, me <= 0 && (Li(), Y.selectAll(".finished").remove()); + function sl(d, _, w, P, A, T) { + const I = $a().sort(null).value((q) => q.value)(w); + return zs(d, _, I, P, A, T), I; + } + function zs(d, _, w, P, A, T) { + const k = Qe(d), I = dn(d), q = Ve().outerRadius(A).innerRadius(P).startAngle((N) => N.startAngle).endAngle((N) => N.endAngle), W = Ve().outerRadius(A).innerRadius(P), X = xt(x(et)).select("#" + _); + X.selectAll(".slice").attr("prevStart", (N) => N.startAngle).attr("prevEnd", (N) => N.endAngle); + const it = X.selectAll(".slice").data(w, (N) => p(N.data)); + it.enter().append("g").attr("class", "slice").attr("id", (N) => p(N.data)).classed("eliminated", !0).on("mouseenter", (N, ut) => Yi(N, ut)).on("mouseleave", (N, ut) => Hi(N, ut)).append("path").attr("d", (N) => W(N)).attr("fill", (N) => Zt(N)), it.classed("eliminated", (N) => k.includes(N.data.label)).classed("elected", (N) => I.includes(N.data.label)).on("mouseenter", (N, ut) => Yi(N, ut)).on("mouseleave", (N, ut) => Hi(N, ut)); + let xe = it.size(); + function yr() { + xe--, xe <= 0 && (Vi(), X.selectAll(".finished").remove()); } - return it.select("path").transition("global").duration(B).attrTween("d", function(N) { - const lt = Number(yt(this.parentNode).attr("prevStart")), ll = Number(yt(this.parentNode).attr("prevEnd")), ul = Gn(lt, N.startAngle), fl = Gn(ll, N.endAngle); - return (Ys) => (V.startAngle(ul(Ys)).endAngle(fl(Ys)), V(N)); - }).on("end", wr), T && Oi(d, y, A, k), y; + return it.select("path").transition("global").duration(J).attrTween("d", function(N) { + const ut = Number(xt(this.parentNode).attr("prevStart")), ul = Number(xt(this.parentNode).attr("prevEnd")), fl = Un(ut, N.startAngle), cl = Un(ul, N.endAngle); + return (Bs) => (q.startAngle(fl(Bs)).endAngle(cl(Bs)), q(N)); + }).on("end", yr), T && Le(d, w, A, k), w; } - function qi(d, _) { - s(_.data.label), i("enter"), a(d.clientY); + function Yi(d, _) { + s(_.data.label), i("enter"), a(d.clientX), o(d.clientY); } - function Vi(d, _) { + function Hi(d, _) { s(_.data.label), i("leave"); } - function sl(d, _) { - i("show-exhausted"), a(d.clientY); - } function al(d, _) { + i("show-exhausted"), a(d.clientX), o(d.clientY); + } + function ol(d, _) { i("hide-exhausted"); } - var ol = { - pieColors: mt, - exhaustedLabel: Ut, - countExhaustedVotes: Tt, - getEliminatedCandidates: hn, - getElectedCandidates: gr, - runFullAnimationFn: dn, - animateOnePhaseFn: pn, + var ll = { + pieColors: pt, + exhaustedLabel: qt, + countExhaustedVotes: se, + getEliminatedCandidates: Qe, + getElectedCandidates: dn, + runFullAnimationFn: me, + animateOnePhaseFn: Oe, get jsonData() { return n(); }, set jsonData(d) { - n(d), dt(); + n(d), ft(); }, get currentRound() { return r(); }, set currentRound(d = 1) { - r(d), dt(); + r(d), ft(); }, get mouseEventType() { return i(); }, set mouseEventType(d) { - i(d), dt(); + i(d), ft(); }, get mouseData() { return s(); }, set mouseData(d) { - s(d), dt(); + s(d), ft(); }, - get mouseY() { + get mouseX() { return a(); }, + set mouseX(d) { + a(d), ft(); + }, + get mouseY() { + return o(); + }, set mouseY(d) { - a(d), dt(); + o(d), ft(); }, get requestRoundChange() { - return o(); + return l(); }, set requestRoundChange(d = (_) => { }) { - o(d), dt(); + l(d), ft(); }, get candidateColors() { - return l(); + return u(); }, set candidateColors(d = []) { - l(d), dt(); + u(d), ft(); }, get excludeFinalWinnerAndEliminatedCandidate() { - return u(); + return f(); }, set excludeFinalWinnerAndEliminatedCandidate(d = !1) { - u(d), dt(); + f(d), ft(); }, get firstRoundDeterminesPercentages() { - return f(); + return h(); }, set firstRoundDeterminesPercentages(d = !1) { - f(d), dt(); + h(d), ft(); }, get displayPhase() { return c(); }, set displayPhase(d = 0) { - c(d), dt(); + c(d), ft(); } - }, Hs = _d(); - return ni(Hs, (d) => ut(tt, d), () => x(tt)), se(t, Hs), bs(ol); + }, Xs = md(); + return ri(Xs, (d) => ot(et, d), () => x(et)), le(t, Xs), As(ll); } -Eo( - Qo, +Co( + el, { jsonData: {}, currentRound: {}, mouseEventType: {}, mouseData: {}, + mouseX: {}, mouseY: {}, requestRoundChange: {}, candidateColors: {}, @@ -5343,39 +5350,10 @@ Eo( ], { mode: "open" } ); -var yd = /* @__PURE__ */ zn(" ", 1), wd = /* @__PURE__ */ zn("About to eliminate: ", 1), xd = /* @__PURE__ */ zn(" ", 1), bd = /* @__PURE__ */ zn(" ", 1), $d = /* @__PURE__ */ zn('

', 1), Ad = /* @__PURE__ */ zn("
", 1), Ed = /* @__PURE__ */ zn('


these ballots have already been eliminated.
', 1); -const Rd = { +var wd = /* @__PURE__ */ Vn(" ", 1), xd = /* @__PURE__ */ Vn("About to eliminate: ", 1), bd = /* @__PURE__ */ Vn(" ", 1), $d = /* @__PURE__ */ Vn(" ", 1), Ad = /* @__PURE__ */ Vn('

', 1), Ed = /* @__PURE__ */ Vn("
", 1), Rd = /* @__PURE__ */ Vn('


these ballots have already been eliminated.
', 1); +const Cd = { 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;text-align:left;padding:.5rem;background:#FFFFFF;color:#313639;border:1px solid #313639;border-radius:8px;pointer-events:none;font-size:0.8rem;left:50%;transform:translate(-50%);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;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl) {background-color:#4747ff;color:#fff;padding:1px 7px;font-size:0.67rem;min-width:107px;border:none;border-radius:3px;cursor:pointer;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl):hover {background-color:#4747c2;}.pie-chart-container.svelte-1r6y5gl { - /* width: 90%; */ - /* min-width: 800px; /* Larger minimum size */width:100%; /* Change from 90% to 100% */min-width:auto; /* Remove the 800px minimum */flex-grow:0; /* Don't grow beyond specified width */margin:0 auto;margin-right:40px; /* Add extra space on right */margin-top:-3vh;}.visualizations-container.svelte-1r6y5gl {display:flex;justify-content:space-between;width:100%;padding:0 20px; - /* gap: 80px; */gap:20px; /* Reduce from 80px */} - - -/*** It looks like it is always OK to use justify-content: space-between even with no bubble viz display - -.visualizations-container { - justify-content: space-between; -} - ***/ - - - -/* width: 25%; /* Smaller percentage */ -/* flex-grow: 0; /* Don't grow beyond specified width */ -/* margin-left: 40px; /* Add extra space on left */ - -/*** Omit this if we are not using the bubble-visualization -.bubble-visualization-container { - width: 25%; - flex-grow: 0; - align-self: center; - margin: 0 auto; - margin-top: 30px; - margin-left: 40px; -} -***/ - + 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;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl) {background-color:#4747ff;color:#fff;padding:1px 7px;font-size:0.67rem;min-width:107px;border:none;border-radius:3px;cursor:pointer;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl):hover {background-color:#4747c2;}.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;} /* Media query for smaller screens */ @media (max-width: 1300px) {.visualizations-container.svelte-1r6y5gl {flex-direction:column;align-items:center;} @@ -5388,12 +5366,12 @@ const Rd = { }` }; -function Cd(t, e) { - xs(e, !0), $o(t, Rd); +function Td(t, e) { + $s(e, !0), Eo(t, Cd); const n = 0.85; - let r = vt(e, "electionSummary", 7), i = vt(e, "currentRound", 7, 1), s = vt(e, "requestRoundChange", 7, (w) => { + let r = vt(e, "electionSummary", 7), i = vt(e, "currentRound", 7, 1), s = vt(e, "requestRoundChange", 7, (y) => { }), a = vt(e, "candidateColors", 23, () => []), o = vt(e, "textForWinner", 7, "elected"), l = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = vt(e, "firstRoundDeterminesPercentages", 7, !1), f = vt(e, "showCaptions", 7, !1); - const c = { + const h = { elected: { caption: "Elected", event: "was elected", @@ -5411,32 +5389,39 @@ function Cd(t, e) { infinitive: "to take the lead" } }; - let h = /* @__PURE__ */ Wn(() => c[o()] ?? c.elected), v = /* @__PURE__ */ xt(null), g = /* @__PURE__ */ xt(null), m = /* @__PURE__ */ xt(""), b = /* @__PURE__ */ xt(wn([])), $ = /* @__PURE__ */ xt(""), R = /* @__PURE__ */ xt(""), E = /* @__PURE__ */ xt(0), C = /* @__PURE__ */ Wn(() => F(r())); - function F(w) { - if (typeof w == "string") + let c = /* @__PURE__ */ Bn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ _t(null), g = /* @__PURE__ */ _t(null), m = /* @__PURE__ */ _t(""), b = /* @__PURE__ */ _t(yn([])), $ = /* @__PURE__ */ _t(""), R = /* @__PURE__ */ _t(""), E = /* @__PURE__ */ _t(0), M = /* @__PURE__ */ _t(0), C = /* @__PURE__ */ Bn(() => tt(r())); + function tt(y) { + if (typeof y == "string") try { - w = JSON.parse(w); - } catch (X) { - return console.error("Failed to parse JSON string:", X), {}; + y = JSON.parse(y); + } catch (z) { + return console.error("Failed to parse JSON string:", z), {}; } - return w || {}; + return y || {}; + } + function nt(y) { + s() ? s()(y) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function J(w) { - s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); + function Q(y, z, Z) { + y.style.left = z + "px", y.style.top = Z + 20 + "px", y.style.transform = "none", requestAnimationFrame(() => { + const G = y.getBoundingClientRect(); + let wt = z, _e = Z + 20; + wt + G.width > window.innerWidth - 12 && (wt = window.innerWidth - G.width - 12), wt < 12 && (wt = 12), _e + G.height > window.innerHeight - 12 && (_e = Z - G.height - 12), y.style.left = wt + "px", y.style.top = _e + "px"; + }); } - function ct() { + function J() { switch (x($)) { case "enter": - ((w) => { - var X = Tl(w, 2); - ut(b, X[0], !0), ut(m, X[1], !0); - })(et(x(R), i())), x(v) && (x(v).style.top = String((x(E) || 0) + 20) + "px", x(v).style.opacity = String(n)); + ((y) => { + var z = Nl(y, 2); + ot(b, z[0], !0), ot(m, z[1], !0); + })(yt(x(R), i())), x(p) && (Q(x(p), x(E) || 0, x(M) || 0), x(p).style.opacity = String(n)); break; case "leave": - x(v) && (x(v).style.opacity = "0"), ut(b, [], !0), ut(m, ""); + x(p) && (x(p).style.opacity = "0"), ot(b, [], !0), ot(m, ""); break; case "show-exhausted": - x(g) && (x(g).style.top = String((x(E) || 0) + 20) + "px", x(g).style.opacity = String(n)); + x(g) && (Q(x(g), x(E) || 0, x(M) || 0), x(g).style.opacity = String(n)); break; case "hide-exhausted": x(g) && (x(g).style.opacity = "0"); @@ -5446,132 +5431,132 @@ function Cd(t, e) { break; } } - Cs(() => ct()); - function B(w, X) { - return w == 1 ? X ? "vote was" : "vote will be" : X ? "votes were" : "votes will be"; - } - function et(w, X) { - const nt = [], st = w === "exhausted" ? ke() : w; - let Q; - w == "exhausted" ? Q = Ut(1) : Q = x(C).results[0].tally[w], nt.push(`${st} started with ${Q} votes.`); - for (let rt = 1; rt <= X; rt++) { - rt === X && (w == "exhausted" ? Q = Ut(X) : Q = x(C).results[X - 1].tally[w], nt.push(`${st} has ${Q} votes at round ${X}.`)); - const Et = x(C).results[rt - 1].tallyResults, Je = I(rt); - for (let ne = 0; ne < Et.length; ne++) { - const dn = Et[ne].transfers, De = Et[ne].eliminated, j = Et[ne].elected; - if (!Je) { - if (De) - De === w && nt.push(`${st} will be eliminated on round ${rt}.`); - else if (w === j && (nt.push(`${st} ${x(h).event} on round ${rt}.`), dn)) - for (let [Wt, Qe] of Object.entries(dn)) - nt.push(`${Qe} ${B(Number(Qe), rt < X)} transferred to ${Wt} on round ${rt}.`); + Ns(() => J()); + function ht(y, z) { + return y == 1 ? z ? "vote was" : "vote will be" : z ? "votes were" : "votes will be"; + } + function yt(y, z) { + const Z = [], K = y === "exhausted" ? ge() : y; + let st; + y == "exhausted" ? st = et(1) : st = x(C).results[0].tally[y], Z.push(`${K} started with ${st} votes.`); + for (let G = 1; G <= z; G++) { + G === z && (y == "exhausted" ? st = et(z) : st = x(C).results[z - 1].tally[y], Z.push(`${K} has ${st} votes at round ${z}.`)); + const wt = x(C).results[G - 1].tallyResults, _e = H(G); + for (let me = 0; me < wt.length; me++) { + const tn = wt[me].transfers, rt = wt[me].eliminated, Mt = wt[me].elected; + if (!_e) { + if (rt) + rt === y && Z.push(`${K} will be eliminated on round ${G}.`); + else if (y === Mt && (Z.push(`${K} ${x(c).event} on round ${G}.`), tn)) + for (let [Kt, Oe] of Object.entries(tn)) + Z.push(`${Oe} ${ht(Number(Oe), G < z)} transferred to ${Kt} on round ${G}.`); } - const ge = De || j; - if (ge) { - const Wt = Number(dn[w]); - Wt && nt.push(`${Wt} ${B(Wt, rt < X)} transferred from ${ge} on round ${rt}.`); + const ye = rt || Mt; + if (ye) { + const Kt = Number(tn[y]); + Kt && Z.push(`${Kt} ${ht(Kt, G < z)} transferred from ${ye} on round ${G}.`); } } } - return [nt, st]; + return [Z, K]; } - function _t() { - let w = 0; - for (let X = 1; X <= x(C).results.length; X++) { - if (I(X)) continue; - const nt = x(C).results[X - 1].tallyResults; - for (let st = 0; st < nt.length; st++) - nt[st].elected && w++; + function dt() { + let y = 0; + for (let z = 1; z <= x(C).results.length; z++) { + if (H(z)) continue; + const Z = x(C).results[z - 1].tallyResults; + for (let K = 0; K < Z.length; K++) + Z[K].elected && y++; } - return w; + return y; } - const ht = ["Eliminate", "Transfer", "Consolidate"]; - let U, S = /* @__PURE__ */ xt(0); - function I(w) { - return l() && x(C).results && w === x(C).results.length; + const D = ["Eliminate", "Transfer", "Consolidate"]; + let S, Rt = /* @__PURE__ */ _t(0); + function H(y) { + return l() && x(C).results && y === x(C).results.length; } - function q(w) { - return I(w) ? [] : U ? U.getEliminatedCandidates(w) : []; + function pt(y) { + return H(y) ? [] : S ? S.getEliminatedCandidates(y) : []; } - function mt(w) { - return I(w) ? [] : U ? U.getElectedCandidates(w) : []; + function qt(y) { + return H(y) ? [] : S ? S.getElectedCandidates(y) : []; } - function Ut(w) { - return U ? U.countExhaustedVotes(w) : 0; + function et(y) { + return S ? S.countExhaustedVotes(y) : 0; } - function tt() { - U && U.animateOnePhaseFn && U.animateOnePhaseFn(); + function je() { + S && S.animateOnePhaseFn && S.animateOnePhaseFn(); } - function ke() { - return U ? U.exhaustedLabel : ""; + function ge() { + return S ? S.exhaustedLabel : ""; } - function de() { - return U ? U.pieColors : {}; + function Gt() { + return S ? S.pieColors : {}; } - var ee = { + var fn = { get electionSummary() { return r(); }, - set electionSummary(w) { - r(w), dt(); + set electionSummary(y) { + r(y), ft(); }, get currentRound() { return i(); }, - set currentRound(w = 1) { - i(w), dt(); + set currentRound(y = 1) { + i(y), ft(); }, get requestRoundChange() { return s(); }, - set requestRoundChange(w = (X) => { + set requestRoundChange(y = (z) => { }) { - s(w), dt(); + s(y), ft(); }, get candidateColors() { return a(); }, - set candidateColors(w = []) { - a(w), dt(); + set candidateColors(y = []) { + a(y), ft(); }, get textForWinner() { return o(); }, - set textForWinner(w = "elected") { - o(w), dt(); + set textForWinner(y = "elected") { + o(y), ft(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, - set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - l(w), dt(); + set excludeFinalWinnerAndEliminatedCandidate(y = !1) { + l(y), ft(); }, get firstRoundDeterminesPercentages() { return u(); }, - set firstRoundDeterminesPercentages(w = !1) { - u(w), dt(); + set firstRoundDeterminesPercentages(y = !1) { + u(y), ft(); }, get showCaptions() { return f(); }, - set showCaptions(w = !1) { - f(w), dt(); + set showCaptions(y = !1) { + f(y), ft(); } - }, Me = Ed(), Ct = vn(Me), pe = Lt(Ct); - pe.__click = tt; - var Tt = Lt(pe, !0); - It(pe), It(Ct); - var ve = re(Ct, 4), Pe = Lt(ve), Ze = Lt(Pe), un = Lt(Ze); - ni( - Qo(un, { + }, kt = Rd(), Ct = pn(kt), se = Yt(Ct); + se.__click = je; + var Je = Yt(se, !0); + Vt(se), Vt(Ct); + var De = ae(Ct, 4), Fe = Yt(De), cn = Yt(Fe), hn = Yt(cn); + ri( + el(hn, { get jsonData() { return x(C); }, get currentRound() { return i(); }, - requestRoundChange: J, + requestRoundChange: nt, get candidateColors() { return a(); }, @@ -5584,123 +5569,129 @@ function Cd(t, e) { get mouseEventType() { return x($); }, - set mouseEventType(w) { - ut($, w, !0); + set mouseEventType(y) { + ot($, y, !0); }, get mouseData() { return x(R); }, - set mouseData(w) { - ut(R, w, !0); + set mouseData(y) { + ot(R, y, !0); }, - get mouseY() { + get mouseX() { return x(E); }, - set mouseY(w) { - ut(E, w, !0); + set mouseX(y) { + ot(E, y, !0); + }, + get mouseY() { + return x(M); + }, + set mouseY(y) { + ot(M, y, !0); }, get displayPhase() { - return x(S); + return x(Rt); }, - set displayPhase(w) { - ut(S, w, !0); + set displayPhase(y) { + ot(Rt, y, !0); } }), - (w) => U = w, - () => U - ), It(Ze), It(Pe); - var fn = re(Pe, 2); + (y) => S = y, + () => S + ), Vt(cn), Vt(Fe); + var Fi = ae(Fe, 2); { - var Hn = (w) => { - var X = $d(), nt = vn(X), st = Lt(nt); - It(nt); - var Q = re(nt, 2), rt = Lt(Q); + var Xr = (y) => { + var z = Ad(), Z = pn(z), K = Yt(Z); + Vt(Z); + var st = ae(Z, 2), G = Yt(st); { - var Et = (j) => { - var ge = wd(), Wt = re(vn(ge)); - Bi(Wt, 17, () => q(i()), Yi, (Qe, pn, Bn) => { - var Un = yd(), Fe = vn(Un); - let Oe; - var Ie = Lt(Fe, !0); - It(Fe); - var _r = re(Fe, 2); + var wt = (Mt) => { + var ye = xd(), Kt = ae(pn(ye)); + Wi(Kt, 17, () => pt(i()), Bi, (Oe, Yn, Hn) => { + var zn = wd(), Ie = pn(zn); + let Zt; + var Xn = Yt(Ie, !0); + Vt(Ie); + var gr = ae(Ie, 2); { - var mr = (Le) => { - var _e = Qs(", "); - se(Le, _e); - }, yr = /* @__PURE__ */ Wn(() => Bn < q(i()).length - 1); - xr(_r, (Le) => { - x(yr) && Le(mr); + var _r = (we) => { + var Le = ea(", "); + le(we, Le); + }, mr = /* @__PURE__ */ Bn(() => Hn < pt(i()).length - 1); + wr(gr, (we) => { + x(mr) && we(_r); }); } - Xn( - (Le) => { - Oe = na(Fe, "", Oe, Le), tn(Ie, x(pn)); + Wn( + (we) => { + Zt = ia(Ie, "", Zt, we), en(Xn, x(Yn)); }, - [() => ({ color: de()[x(pn)] })] - ), se(Qe, Un); - }), se(j, ge); - }, Je = /* @__PURE__ */ Wn(() => q(i()).length > 0); - xr(rt, (j) => { - x(Je) && j(Et); + [() => ({ color: Gt()[x(Yn)] })] + ), le(Oe, zn); + }), le(Mt, ye); + }, _e = /* @__PURE__ */ Bn(() => pt(i()).length > 0); + wr(G, (Mt) => { + x(_e) && Mt(wt); }); } - var ne = re(rt, 2); + var me = ae(G, 2); { - var dn = (j) => { - var ge = bd(), Wt = vn(ge), Qe = re(Wt); - Bi(Qe, 17, () => mt(i()), Yi, (pn, Bn, Un) => { - var Fe = xd(), Oe = vn(Fe); - let Ie; - var _r = Lt(Oe, !0); - It(Oe); - var mr = re(Oe, 2); + var tn = (Mt) => { + var ye = $d(), Kt = pn(ye), Oe = ae(Kt); + Wi(Oe, 17, () => qt(i()), Bi, (Yn, Hn, zn) => { + var Ie = bd(), Zt = pn(Ie); + let Xn; + var gr = Yt(Zt, !0); + Vt(Zt); + var _r = ae(Zt, 2); { - var yr = (_e) => { - var Oi = Qs(", "); - se(_e, Oi); - }, Le = /* @__PURE__ */ Wn(() => Un < mt(i()).length - 1); - xr(mr, (_e) => { - x(Le) && _e(yr); + var mr = (Le) => { + var Li = ea(", "); + le(Le, Li); + }, we = /* @__PURE__ */ Bn(() => zn < qt(i()).length - 1); + wr(_r, (Le) => { + x(we) && Le(mr); }); } - Xn( - (_e) => { - Ie = na(Oe, "", Ie, _e), tn(_r, x(Bn)); + Wn( + (Le) => { + Xn = ia(Zt, "", Xn, Le), en(gr, x(Hn)); }, - [() => ({ color: de()[x(Bn)] })] - ), se(pn, Fe); - }), Xn(() => tn(Wt, `${x(h).caption ?? ""}: `)), se(j, ge); - }, De = /* @__PURE__ */ Wn(() => mt(i()).length > 0); - xr(ne, (j) => { - x(De) && j(dn); + [() => ({ color: Gt()[x(Hn)] })] + ), le(Yn, Ie); + }), Wn(() => en(Kt, `${x(c).caption ?? ""}: `)), le(Mt, ye); + }, rt = /* @__PURE__ */ Bn(() => qt(i()).length > 0); + wr(me, (Mt) => { + x(rt) && Mt(tn); }); } - It(Q), Xn((j) => tn(st, `${x(C).config.contest ?? ""}, ${j ?? ""} ${x(h).infinitive ?? ""}, Round ${i() ?? ""}.`), [_t]), se(w, X); + Vt(st), Wn((Mt) => en(K, `${x(C).config.contest ?? ""}, ${Mt ?? ""} ${x(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [dt]), le(y, z); }; - xr(fn, (w) => { - f() && w(Hn); + wr(Fi, (y) => { + f() && y(Xr); }); } - It(ve); - var cn = re(ve, 2), hn = Lt(cn), gr = Lt(hn, !0); - It(hn); - var Di = re(hn, 2); - Bi(Di, 17, () => x(b), Yi, (w, X) => { - var nt = Ad(), st = vn(nt), Q = Lt(st, !0); - It(st), Zi(2), Xn(() => tn(Q, x(X))), se(w, nt); - }), It(cn), ni(cn, (w) => ut(v, w), () => x(v)); - var Yn = re(cn, 2), Fi = Lt(Yn); - return Zi(2), It(Yn), ni(Yn, (w) => ut(g, w), () => x(g)), Xn( - (w) => { - tn(Tt, ht[x(S)]), tn(gr, x(m)), tn(Fi, `"${w ?? ""}" means all the candidates ranked on `); + Vt(De); + var Qe = ae(De, 2), dn = Yt(Qe), Oi = Yt(dn, !0); + Vt(dn); + var Br = ae(dn, 2); + Wi(Br, 17, () => x(b), Bi, (y, z) => { + var Z = Ed(), K = pn(Z), st = Yt(K, !0); + Vt(K), Qi(2), Wn(() => en(st, x(z))), le(y, Z); + }), Vt(Qe), ri(Qe, (y) => ot(p, y), () => x(p)); + var vr = ae(Qe, 2), Ii = Yt(vr); + return Qi(2), Vt(vr), ri(vr, (y) => ot(g, y), () => x(g)), Wn( + (y) => { + en(Je, D[x(Rt)]), en(Oi, x(m)), en(Ii, `"${y ?? ""}" means all the candidates ranked on `); }, - [ke] - ), se(t, Me), bs(ee); + [ge] + ), le(t, kt), As(fn); } -gu(["click"]); -customElements.define("pie-chart", Eo( - Cd, +_u(["click"]); +customElements.define("pie-chart", Co( + Td, { electionSummary: {}, currentRound: {}, From 9b03f5ff4dd2655fd8b467f5c57edf6129a9f885 Mon Sep 17 00:00:00 2001 From: skaphan Date: Sun, 22 Mar 2026 17:44:49 +0000 Subject: [PATCH 15/31] Fix CLS: reserve pie chart dimensions before JS loads Set aspect-ratio and max-width on pie-body container so the browser allocates space before the custom element renders. Reduces Cumulative Layout Shift from 0.753 to 0.014. Co-Authored-By: Claude Opus 4.6 --- templates/pie/pie.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/pie/pie.html b/templates/pie/pie.html index edb4f589..10584166 100644 --- a/templates/pie/pie.html +++ b/templates/pie/pie.html @@ -5,5 +5,5 @@
-
+
From a648b2e69844150a2d1a15688d8e06debc8e896f Mon Sep 17 00:00:00 2001 From: skaphan Date: Mon, 23 Mar 2026 08:13:42 +0000 Subject: [PATCH 16/31] Update pie chart: shadow outline pie, slice separators Co-Authored-By: Claude Opus 4.6 --- static/pie/pie-chart.es.js | 4328 ++++++++++++++++++------------------ 1 file changed, 2167 insertions(+), 2161 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 3905b77d..9664d299 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,27 +1,27 @@ -var hl = Object.defineProperty; -var Ws = (t) => { +var yl = Object.defineProperty; +var js = (t) => { throw TypeError(t); }; -var dl = (t, e, n) => e in t ? hl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var at = (t, e, n) => dl(t, typeof e != "symbol" ? e + "" : e, n), zi = (t, e, n) => e.has(t) || Ws("Cannot " + n); -var v = (t, e, n) => (zi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), L = (t, e, n) => e.has(t) ? Ws("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), F = (t, e, n, r) => (zi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), gt = (t, e, n) => (zi(t, e, "access private method"), n); -var Aa; -typeof window < "u" && ((Aa = window.__svelte ?? (window.__svelte = {})).v ?? (Aa.v = /* @__PURE__ */ new Set())).add("5"); -const pl = 1, vl = 2, gl = 16, _l = 1, ml = 4, yl = 8, wl = 16, xl = 2, ws = "[", $i = "[!", xs = "]", rr = {}, bt = Symbol(), bl = "http://www.w3.org/1999/xhtml", ji = !1; -var Ca = Array.isArray, $l = Array.prototype.indexOf, ir = Array.prototype.includes, Ai = Array.from, fi = Object.keys, ci = Object.defineProperty, Tn = Object.getOwnPropertyDescriptor, Al = Object.prototype, El = Array.prototype, Rl = Object.getPrototypeOf, Us = Object.isExtensible; -const Cl = () => { +var wl = (t, e, n) => e in t ? yl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var st = (t, e, n) => wl(t, typeof e != "symbol" ? e + "" : e, n), Bi = (t, e, n) => e.has(t) || js("Cannot " + n); +var v = (t, e, n) => (Bi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? js("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), F = (t, e, n, r) => (Bi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), gt = (t, e, n) => (Bi(t, e, "access private method"), n); +var Na; +typeof window < "u" && ((Na = window.__svelte ?? (window.__svelte = {})).v ?? (Na.v = /* @__PURE__ */ new Set())).add("5"); +const xl = 1, bl = 2, $l = 16, Al = 1, El = 4, Rl = 8, Cl = 16, Tl = 2, bs = "[", Ri = "[!", $s = "]", ar = {}, $t = Symbol(), Nl = "http://www.w3.org/1999/xhtml", Qi = !1; +var Ma = Array.isArray, Sl = Array.prototype.indexOf, or = Array.prototype.includes, Ci = Array.from, di = Object.keys, pi = Object.defineProperty, Sn = Object.getOwnPropertyDescriptor, kl = Object.prototype, Ml = Array.prototype, Pl = Object.getPrototypeOf, Js = Object.isExtensible; +const Dl = () => { }; -function Tl(t) { +function Fl(t) { for (var e = 0; e < t.length; e++) t[e](); } -function Ta() { +function Pa() { var t, e, n = new Promise((r, i) => { t = r, e = i; }); return { promise: n, resolve: t, reject: e }; } -function Nl(t, e) { +function Il(t, e) { if (Array.isArray(t)) return t; if (!(Symbol.iterator in t)) @@ -31,130 +31,130 @@ function Nl(t, e) { if (n.push(r), n.length === e) break; return n; } -const At = 2, Sr = 4, Ei = 8, Na = 1 << 24, Ze = 16, pe = 32, un = 64, Sa = 128, ee = 512, mt = 1024, Et = 2048, de = 4096, Bt = 8192, Ue = 16384, hr = 32768, sr = 65536, Gs = 1 << 17, ka = 1 << 18, qn = 1 << 19, Sl = 1 << 20, sn = 1 << 25, Pn = 65536, Ji = 1 << 21, bs = 1 << 22, an = 1 << 23, Cr = Symbol("$state"), Ma = Symbol("legacy props"), _n = new class extends Error { +const Et = 2, Pr = 4, Ti = 8, Da = 1 << 24, nn = 16, be = 32, pn = 64, Fa = 128, oe = 512, yt = 1024, Rt = 2048, xe = 4096, jt = 8192, Qe = 16384, vr = 32768, lr = 65536, Qs = 1 << 17, Ia = 1 << 18, Yn = 1 << 19, Ol = 1 << 20, fn = 1 << 25, Fn = 65536, ts = 1 << 21, As = 1 << 22, cn = 1 << 23, Sr = Symbol("$state"), Oa = Symbol("legacy props"), yn = new class extends Error { constructor() { super(...arguments); - at(this, "name", "StaleReactionError"); - at(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + st(this, "name", "StaleReactionError"); + st(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } -}(), Yr = 3, dr = 8; -function kl(t) { +}(), Xr = 3, gr = 8; +function Ll(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function Ml() { +function ql() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function Pl(t, e, n) { +function Vl(t, e, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function Dl(t) { +function Yl(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function Fl() { +function Hl() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function Ol(t) { +function zl(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function Il() { +function Xl() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Ll() { +function Bl() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function ql(t) { +function Wl(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function Vl() { +function Ul() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Yl() { +function Gl() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function Hl() { +function Kl() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function zl() { +function Zl() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Ri(t) { +function Ni(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function Xl() { +function jl() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } -let j = !1; -function We(t) { - j = t; +let Z = !1; +function Je(t) { + Z = t; } -let Y; -function Lt(t) { +let H; +function zt(t) { if (t === null) - throw Ri(), rr; - return Y = t; + throw Ni(), ar; + return H = t; } -function Ci() { - return Lt(/* @__PURE__ */ ke(Y)); +function Si() { + return zt(/* @__PURE__ */ Ie(H)); } -function Vt(t) { - if (j) { - if (/* @__PURE__ */ ke(Y) !== null) - throw Ri(), rr; - Y = t; +function Wt(t) { + if (Z) { + if (/* @__PURE__ */ Ie(H) !== null) + throw Ni(), ar; + H = t; } } -function Qi(t = 1) { - if (j) { - for (var e = t, n = Y; e--; ) +function es(t = 1) { + if (Z) { + for (var e = t, n = H; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ ke(n); - Y = n; + /* @__PURE__ */ Ie(n); + H = n; } } -function hi(t = !0) { - for (var e = 0, n = Y; ; ) { - if (n.nodeType === dr) { +function vi(t = !0) { + for (var e = 0, n = H; ; ) { + if (n.nodeType === gr) { var r = ( /** @type {Comment} */ n.data ); - if (r === xs) { + if (r === $s) { if (e === 0) return n; e -= 1; - } else (r === ws || r === $i || // "[1", "[2", etc. for if blocks + } else (r === bs || r === Ri || // "[1", "[2", etc. for if blocks r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ke(n) + /* @__PURE__ */ Ie(n) ); t && n.remove(), n = i; } } -function Pa(t) { - if (!t || t.nodeType !== dr) - throw Ri(), rr; +function La(t) { + if (!t || t.nodeType !== gr) + throw Ni(), ar; return ( /** @type {Comment} */ t.data ); } -function Da(t) { +function qa(t) { return t === this.v; } -function Bl(t, e) { +function Jl(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function Fa(t) { - return !Bl(t, this.v); +function Va(t) { + return !Jl(t, this.v); } -let Wl = !1, Wt = null; -function ar(t) { - Wt = t; +let Ql = !1, Jt = null; +function ur(t) { + Jt = t; } -function $s(t, e = !1, n) { - Wt = { - p: Wt, +function Es(t, e = !1, n) { + Jt = { + p: Jt, i: !1, c: null, e: null, @@ -163,52 +163,52 @@ function $s(t, e = !1, n) { l: null }; } -function As(t) { +function Rs(t) { var e = ( /** @type {ComponentContext} */ - Wt + Jt ), n = e.e; if (n !== null) { e.e = null; for (var r of n) - ao(r); + co(r); } - return t !== void 0 && (e.x = t), e.i = !0, Wt = e.p, t ?? /** @type {T} */ + return t !== void 0 && (e.x = t), e.i = !0, Jt = e.p, t ?? /** @type {T} */ {}; } -function Oa() { +function Ya() { return !0; } -let mn = []; -function Ia() { - var t = mn; - mn = [], Tl(t); +let wn = []; +function Ha() { + var t = wn; + wn = [], Fl(t); } -function Nn(t) { - if (mn.length === 0 && !Tr) { - var e = mn; +function kn(t) { + if (wn.length === 0 && !kr) { + var e = wn; queueMicrotask(() => { - e === mn && Ia(); + e === wn && Ha(); }); } - mn.push(t); + wn.push(t); } -function Ul() { - for (; mn.length > 0; ) - Ia(); +function tu() { + for (; wn.length > 0; ) + Ha(); } -function La(t) { +function za(t) { var e = U; if (e === null) - return V.f |= an, t; - if ((e.f & hr) === 0 && (e.f & Sr) === 0) + return Y.f |= cn, t; + if ((e.f & vr) === 0 && (e.f & Pr) === 0) throw t; - or(t, e); + fr(t, e); } -function or(t, e) { +function fr(t, e) { for (; e !== null; ) { - if ((e.f & Sa) !== 0) { - if ((e.f & hr) === 0) + if ((e.f & Fa) !== 0) { + if ((e.f & vr) === 0) throw t; try { e.b.error(t); @@ -221,78 +221,78 @@ function or(t, e) { } throw t; } -const Gl = -7169; -function lt(t, e) { - t.f = t.f & Gl | e; +const eu = -7169; +function ot(t, e) { + t.f = t.f & eu | e; } -function Es(t) { - (t.f & ee) !== 0 || t.deps === null ? lt(t, mt) : lt(t, de); +function Cs(t) { + (t.f & oe) !== 0 || t.deps === null ? ot(t, yt) : ot(t, xe); } -function qa(t) { +function Xa(t) { if (t !== null) for (const e of t) - (e.f & At) === 0 || (e.f & Pn) === 0 || (e.f ^= Pn, qa( + (e.f & Et) === 0 || (e.f & Fn) === 0 || (e.f ^= Fn, Xa( /** @type {Derived} */ e.deps )); } -function Va(t, e, n) { - (t.f & Et) !== 0 ? e.add(t) : (t.f & de) !== 0 && n.add(t), qa(t.deps), lt(t, mt); +function Ba(t, e, n) { + (t.f & Rt) !== 0 ? e.add(t) : (t.f & xe) !== 0 && n.add(t), Xa(t.deps), ot(t, yt); } -const Ur = /* @__PURE__ */ new Set(); -let B = null, $t = null, Ft = [], Ti = null, ts = !1, Tr = !1; -var Zn, jn, bn, Jn, Or, Ir, $n, Ye, Qn, Se, es, ns, Ya; -const Ys = class Ys { +const Zr = /* @__PURE__ */ new Set(); +let B = null, At = null, Vt = [], ki = null, ns = !1, kr = !1; +var Qn, tr, An, er, qr, Vr, En, Ue, nr, Fe, rs, is, Wa; +const zs = class zs { constructor() { - L(this, Se); - at(this, "committed", !1); + q(this, Fe); + st(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} */ - at(this, "current", /* @__PURE__ */ new Map()); + st(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} */ - at(this, "previous", /* @__PURE__ */ new Map()); + st(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>} */ - L(this, Zn, /* @__PURE__ */ new Set()); + q(this, Qn, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - L(this, jn, /* @__PURE__ */ new Set()); + q(this, tr, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - L(this, bn, 0); + q(this, An, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - L(this, Jn, 0); + q(this, er, 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} */ - L(this, Or, null); + q(this, qr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - L(this, Ir, /* @__PURE__ */ new Set()); + q(this, Vr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - L(this, $n, /* @__PURE__ */ new Set()); + q(this, En, /* @__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`. @@ -300,19 +300,19 @@ const Ys = class Ys { * so they can be rescheduled if the branch survives. * @type {Map} */ - L(this, Ye, /* @__PURE__ */ new Map()); - at(this, "is_fork", !1); - L(this, Qn, !1); + q(this, Ue, /* @__PURE__ */ new Map()); + st(this, "is_fork", !1); + q(this, nr, !1); } is_deferred() { - return this.is_fork || v(this, Jn) > 0; + return this.is_fork || v(this, er) > 0; } /** * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ skip_effect(e) { - v(this, Ye).has(e) || v(this, Ye).set(e, { d: [], m: [] }); + v(this, Ue).has(e) || v(this, Ue).set(e, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule @@ -320,13 +320,13 @@ const Ys = class Ys { * @param {Effect} effect */ unskip_effect(e) { - var n = v(this, Ye).get(e); + var n = v(this, Ue).get(e); if (n) { - v(this, Ye).delete(e); + v(this, Ue).delete(e); for (var r of n.d) - lt(r, Et), ce(r); + ot(r, Rt), ye(r); for (r of n.m) - lt(r, de), ce(r); + ot(r, xe), ye(r); } } /** @@ -335,19 +335,19 @@ const Ys = class Ys { */ process(e) { var i; - Ft = [], this.apply(); + Vt = [], this.apply(); var n = [], r = []; for (const s of e) - gt(this, Se, es).call(this, s, n, r); + gt(this, Fe, rs).call(this, s, n, r); if (this.is_deferred()) { - gt(this, Se, ns).call(this, r), gt(this, Se, ns).call(this, n); - for (const [s, a] of v(this, Ye)) - Ba(s, a); + gt(this, Fe, is).call(this, r), gt(this, Fe, is).call(this, n); + for (const [s, a] of v(this, Ue)) + Za(s, a); } else { - for (const s of v(this, Zn)) s(); - v(this, Zn).clear(), v(this, bn) === 0 && gt(this, Se, Ya).call(this), B = null, Ks(r), Ks(n), (i = v(this, Or)) == null || i.resolve(); + for (const s of v(this, Qn)) s(); + v(this, Qn).clear(), v(this, An) === 0 && gt(this, Fe, Wa).call(this), B = null, ta(r), ta(n), (i = v(this, qr)) == null || i.resolve(); } - $t = null; + At = null; } /** * Associate a change to a given source with the current @@ -356,63 +356,63 @@ const Ys = class Ys { * @param {any} value */ capture(e, n) { - n !== bt && !this.previous.has(e) && this.previous.set(e, n), (e.f & an) === 0 && (this.current.set(e, e.v), $t == null || $t.set(e, e.v)); + n !== $t && !this.previous.has(e) && this.previous.set(e, n), (e.f & cn) === 0 && (this.current.set(e, e.v), At == null || At.set(e, e.v)); } activate() { B = this, this.apply(); } deactivate() { - B === this && (B = null, $t = null); + B === this && (B = null, At = null); } flush() { - if (this.activate(), Ft.length > 0) { - if (Ha(), B !== null && B !== this) + if (this.activate(), Vt.length > 0) { + if (Ua(), B !== null && B !== this) return; - } else v(this, bn) === 0 && this.process([]); + } else v(this, An) === 0 && this.process([]); this.deactivate(); } discard() { - for (const e of v(this, jn)) e(this); - v(this, jn).clear(); + for (const e of v(this, tr)) e(this); + v(this, tr).clear(); } /** * * @param {boolean} blocking */ increment(e) { - F(this, bn, v(this, bn) + 1), e && F(this, Jn, v(this, Jn) + 1); + F(this, An, v(this, An) + 1), e && F(this, er, v(this, er) + 1); } /** * * @param {boolean} blocking */ decrement(e) { - F(this, bn, v(this, bn) - 1), e && F(this, Jn, v(this, Jn) - 1), !v(this, Qn) && (F(this, Qn, !0), Nn(() => { - F(this, Qn, !1), this.is_deferred() ? Ft.length > 0 && this.flush() : this.revive(); + F(this, An, v(this, An) - 1), e && F(this, er, v(this, er) - 1), !v(this, nr) && (F(this, nr, !0), kn(() => { + F(this, nr, !1), this.is_deferred() ? Vt.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const e of v(this, Ir)) - v(this, $n).delete(e), lt(e, Et), ce(e); - for (const e of v(this, $n)) - lt(e, de), ce(e); + for (const e of v(this, Vr)) + v(this, En).delete(e), ot(e, Rt), ye(e); + for (const e of v(this, En)) + ot(e, xe), ye(e); this.flush(); } /** @param {() => void} fn */ oncommit(e) { - v(this, Zn).add(e); + v(this, Qn).add(e); } /** @param {(batch: Batch) => void} fn */ ondiscard(e) { - v(this, jn).add(e); + v(this, tr).add(e); } settled() { - return (v(this, Or) ?? F(this, Or, Ta())).promise; + return (v(this, qr) ?? F(this, qr, Pa())).promise; } static ensure() { if (B === null) { - const e = B = new Ys(); - Ur.add(B), Tr || Nn(() => { + const e = B = new zs(); + Zr.add(B), kr || kn(() => { B === e && e.flush(); }); } @@ -421,19 +421,19 @@ const Ys = class Ys { apply() { } }; -Zn = new WeakMap(), jn = new WeakMap(), bn = new WeakMap(), Jn = new WeakMap(), Or = new WeakMap(), Ir = new WeakMap(), $n = new WeakMap(), Ye = new WeakMap(), Qn = new WeakMap(), Se = new WeakSet(), /** +Qn = new WeakMap(), tr = new WeakMap(), An = new WeakMap(), er = new WeakMap(), qr = new WeakMap(), Vr = new WeakMap(), En = new WeakMap(), Ue = new WeakMap(), nr = new WeakMap(), Fe = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -es = function(e, n, r) { - e.f ^= mt; +rs = function(e, n, r) { + e.f ^= yt; for (var i = e.first, s = null; i !== null; ) { - var a = i.f, o = (a & (pe | un)) !== 0, l = o && (a & mt) !== 0, u = l || (a & Bt) !== 0 || v(this, Ye).has(i); + var a = i.f, o = (a & (be | pn)) !== 0, l = o && (a & yt) !== 0, u = l || (a & jt) !== 0 || v(this, Ue).has(i); if (!u && i.fn !== null) { - o ? i.f ^= mt : s !== null && (a & (Sr | Ei | Na)) !== 0 ? s.b.defer_effect(i) : (a & Sr) !== 0 ? n.push(i) : Hr(i) && ((a & Ze) !== 0 && v(this, $n).add(i), ur(i)); + o ? i.f ^= yt : s !== null && (a & (Pr | Ti | Da)) !== 0 ? s.b.defer_effect(i) : (a & Pr) !== 0 ? n.push(i) : Br(i) && ((a & nn) !== 0 && v(this, En).add(i), hr(i)); var f = i.first; if (f !== null) { i = f; @@ -447,15 +447,15 @@ es = function(e, n, r) { }, /** * @param {Effect[]} effects */ -ns = function(e) { +is = function(e) { for (var n = 0; n < e.length; n += 1) - Va(e[n], v(this, Ir), v(this, $n)); -}, Ya = function() { + Ba(e[n], v(this, Vr), v(this, En)); +}, Wa = function() { var i; - if (Ur.size > 1) { + if (Zr.size > 1) { this.previous.clear(); - var e = $t, n = !0; - for (const s of Ur) { + var e = At, n = !0; + for (const s of Zr) { if (s === this) { n = !1; continue; @@ -473,111 +473,111 @@ ns = function(e) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = Ft; - Ft = []; + var r = Vt; + Vt = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - za(f, o, l, u); - if (Ft.length > 0) { + Ga(f, o, l, u); + if (Vt.length > 0) { B = s, s.apply(); - for (const f of Ft) - gt(i = s, Se, es).call(i, f, [], []); + for (const f of Vt) + gt(i = s, Fe, rs).call(i, f, [], []); s.deactivate(); } - Ft = r; + Vt = r; } } - B = null, $t = e; + B = null, At = e; } - this.committed = !0, Ur.delete(this); + this.committed = !0, Zr.delete(this); }; -let Ge = Ys; +let tn = zs; function ft(t) { - var e = Tr; - Tr = !0; + var e = kr; + kr = !0; try { for (var n; ; ) { - if (Ul(), Ft.length === 0 && (B == null || B.flush(), Ft.length === 0)) - return Ti = null, /** @type {T} */ + if (tu(), Vt.length === 0 && (B == null || B.flush(), Vt.length === 0)) + return ki = null, /** @type {T} */ n; - Ha(); + Ua(); } } finally { - Tr = e; + kr = e; } } -function Ha() { - ts = !0; +function Ua() { + ns = !0; var t = null; try { - for (var e = 0; Ft.length > 0; ) { - var n = Ge.ensure(); + for (var e = 0; Vt.length > 0; ) { + var n = tn.ensure(); if (e++ > 1e3) { var r, i; - Kl(); + nu(); } - n.process(Ft), on.clear(); + n.process(Vt), hn.clear(); } } finally { - Ft = [], ts = !1, Ti = null; + Vt = [], ns = !1, ki = null; } } -function Kl() { +function nu() { try { - Il(); + Xl(); } catch (t) { - or(t, Ti); + fr(t, ki); } } -let oe = null; -function Ks(t) { +let ve = null; +function ta(t) { var e = t.length; if (e !== 0) { for (var n = 0; n < e; ) { var r = t[n++]; - if ((r.f & (Ue | Bt)) === 0 && Hr(r) && (oe = /* @__PURE__ */ new Set(), ur(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && uo(r), (oe == null ? void 0 : oe.size) > 0)) { - on.clear(); - for (const i of oe) { - if ((i.f & (Ue | Bt)) !== 0) continue; + if ((r.f & (Qe | jt)) === 0 && Br(r) && (ve = /* @__PURE__ */ new Set(), hr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && vo(r), (ve == null ? void 0 : ve.size) > 0)) { + hn.clear(); + for (const i of ve) { + if ((i.f & (Qe | jt)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - oe.has(a) && (oe.delete(a), s.push(a)), a = a.parent; + ve.has(a) && (ve.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (Ue | Bt)) === 0 && ur(l); + (l.f & (Qe | jt)) === 0 && hr(l); } } - oe.clear(); + ve.clear(); } } - oe = null; + ve = null; } } -function za(t, e, n, r) { +function Ga(t, e, n, r) { if (!n.has(t) && (n.add(t), t.reactions !== null)) for (const i of t.reactions) { const s = i.f; - (s & At) !== 0 ? za( + (s & Et) !== 0 ? Ga( /** @type {Derived} */ i, e, n, r - ) : (s & (bs | Ze)) !== 0 && (s & Et) === 0 && Xa(i, e, r) && (lt(i, Et), ce( + ) : (s & (As | nn)) !== 0 && (s & Rt) === 0 && Ka(i, e, r) && (ot(i, Rt), ye( /** @type {Effect} */ i )); } } -function Xa(t, e, n) { +function Ka(t, e, n) { const r = n.get(t); if (r !== void 0) return r; if (t.deps !== null) for (const i of t.deps) { - if (ir.call(e, i)) + if (or.call(e, i)) return !0; - if ((i.f & At) !== 0 && Xa( + if ((i.f & Et) !== 0 && Ka( /** @type {Derived} */ i, e, @@ -591,80 +591,80 @@ function Xa(t, e, n) { } return n.set(t, !1), !1; } -function ce(t) { - for (var e = Ti = t; e.parent !== null; ) { +function ye(t) { + for (var e = ki = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (ts && e === U && (n & Ze) !== 0 && (n & ka) === 0) + if (ns && e === U && (n & nn) !== 0 && (n & Ia) === 0) return; - if ((n & (un | pe)) !== 0) { - if ((n & mt) === 0) return; - e.f ^= mt; + if ((n & (pn | be)) !== 0) { + if ((n & yt) === 0) return; + e.f ^= yt; } } - Ft.push(e); + Vt.push(e); } -function Ba(t, e) { - if (!((t.f & pe) !== 0 && (t.f & mt) !== 0)) { - (t.f & Et) !== 0 ? e.d.push(t) : (t.f & de) !== 0 && e.m.push(t), lt(t, mt); +function Za(t, e) { + if (!((t.f & be) !== 0 && (t.f & yt) !== 0)) { + (t.f & Rt) !== 0 ? e.d.push(t) : (t.f & xe) !== 0 && e.m.push(t), ot(t, yt); for (var n = t.first; n !== null; ) - Ba(n, e), n = n.next; + Za(n, e), n = n.next; } } -function Zl(t) { - let e = 0, n = Dn(0), r; +function ru(t) { + let e = 0, n = In(0), r; return () => { - Ts() && (x(n), Ss(() => (e === 0 && (r = ki(() => t(() => Nr(n)))), e += 1, () => { - Nn(() => { - e -= 1, e === 0 && (r == null || r(), r = void 0, Nr(n)); + Ss() && (x(n), Ms(() => (e === 0 && (r = Di(() => t(() => Mr(n)))), e += 1, () => { + kn(() => { + e -= 1, e === 0 && (r == null || r(), r = void 0, Mr(n)); }); }))); }; } -var jl = sr | qn | Sa; -function Jl(t, e, n) { - new Ql(t, e, n); +var iu = lr | Yn | Fa; +function su(t, e, n) { + new au(t, e, n); } -var zt, Lr, $e, An, Ae, Jt, Dt, Ee, He, rn, En, ze, tr, Rn, er, nr, Xe, xi, ct, Wa, Ua, rs, ti, ei, is; -class Ql { +var Kt, Yr, Te, Rn, Ne, ie, qt, Se, Ge, un, Cn, Ke, rr, Tn, ir, sr, Ze, Ai, ct, ja, Ja, ss, ri, ii, as; +class au { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ constructor(e, n, r) { - L(this, ct); + q(this, ct); /** @type {Boundary | null} */ - at(this, "parent"); - at(this, "is_pending", !1); + st(this, "parent"); + st(this, "is_pending", !1); /** @type {TemplateNode} */ - L(this, zt); + q(this, Kt); /** @type {TemplateNode | null} */ - L(this, Lr, j ? Y : null); + q(this, Yr, Z ? H : null); /** @type {BoundaryProps} */ - L(this, $e); + q(this, Te); /** @type {((anchor: Node) => void)} */ - L(this, An); + q(this, Rn); /** @type {Effect} */ - L(this, Ae); + q(this, Ne); /** @type {Effect | null} */ - L(this, Jt, null); + q(this, ie, null); /** @type {Effect | null} */ - L(this, Dt, null); + q(this, qt, null); /** @type {Effect | null} */ - L(this, Ee, null); + q(this, Se, null); /** @type {DocumentFragment | null} */ - L(this, He, null); + q(this, Ge, null); /** @type {TemplateNode | null} */ - L(this, rn, null); - L(this, En, 0); - L(this, ze, 0); - L(this, tr, !1); - L(this, Rn, !1); + q(this, un, null); + q(this, Cn, 0); + q(this, Ke, 0); + q(this, rr, !1); + q(this, Tn, !1); /** @type {Set} */ - L(this, er, /* @__PURE__ */ new Set()); + q(this, ir, /* @__PURE__ */ new Set()); /** @type {Set} */ - L(this, nr, /* @__PURE__ */ new Set()); + q(this, sr, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -672,38 +672,38 @@ class Ql { * calls followed by no-op flushes * @type {Source | null} */ - L(this, Xe, null); - L(this, xi, Zl(() => (F(this, Xe, Dn(v(this, En))), () => { - F(this, Xe, null); + q(this, Ze, null); + q(this, Ai, ru(() => (F(this, Ze, In(v(this, Cn))), () => { + F(this, Ze, null); }))); - F(this, zt, e), F(this, $e, n), F(this, An, r), this.parent = /** @type {Effect} */ - U.b, this.is_pending = !!v(this, $e).pending, F(this, Ae, ks(() => { - if (U.b = this, j) { - const s = v(this, Lr); - Ci(), /** @type {Comment} */ - s.nodeType === dr && /** @type {Comment} */ - s.data === $i ? gt(this, ct, Ua).call(this) : (gt(this, ct, Wa).call(this), v(this, ze) === 0 && (this.is_pending = !1)); + F(this, Kt, e), F(this, Te, n), F(this, Rn, r), this.parent = /** @type {Effect} */ + U.b, this.is_pending = !!v(this, Te).pending, F(this, Ne, Ps(() => { + if (U.b = this, Z) { + const s = v(this, Yr); + Si(), /** @type {Comment} */ + s.nodeType === gr && /** @type {Comment} */ + s.data === Ri ? gt(this, ct, Ja).call(this) : (gt(this, ct, ja).call(this), v(this, Ke) === 0 && (this.is_pending = !1)); } else { - var i = gt(this, ct, rs).call(this); + var i = gt(this, ct, ss).call(this); try { - F(this, Jt, te(() => r(i))); + F(this, ie, ae(() => r(i))); } catch (s) { this.error(s); } - v(this, ze) > 0 ? gt(this, ct, ei).call(this) : this.is_pending = !1; + v(this, Ke) > 0 ? gt(this, ct, ii).call(this) : this.is_pending = !1; } return () => { var s; - (s = v(this, rn)) == null || s.remove(); + (s = v(this, un)) == null || s.remove(); }; - }, jl)), j && F(this, zt, Y); + }, iu)), Z && F(this, Kt, H); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ defer_effect(e) { - Va(e, v(this, er), v(this, nr)); + Ba(e, v(this, ir), v(this, sr)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -713,7 +713,7 @@ class Ql { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, $e).pending; + return !!v(this, Te).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -722,132 +722,132 @@ class Ql { * @param {1 | -1} d */ update_pending_count(e) { - gt(this, ct, is).call(this, e), F(this, En, v(this, En) + e), !(!v(this, Xe) || v(this, tr)) && (F(this, tr, !0), Nn(() => { - F(this, tr, !1), v(this, Xe) && lr(v(this, Xe), v(this, En)); + gt(this, ct, as).call(this, e), F(this, Cn, v(this, Cn) + e), !(!v(this, Ze) || v(this, rr)) && (F(this, rr, !0), kn(() => { + F(this, rr, !1), v(this, Ze) && cr(v(this, Ze), v(this, Cn)); })); } get_effect_pending() { - return v(this, xi).call(this), x( + return v(this, Ai).call(this), x( /** @type {Source} */ - v(this, Xe) + v(this, Ze) ); } /** @param {unknown} error */ error(e) { - var n = v(this, $e).onerror; - let r = v(this, $e).failed; - if (v(this, Rn) || !n && !r) + var n = v(this, Te).onerror; + let r = v(this, Te).failed; + if (v(this, Tn) || !n && !r) throw e; - v(this, Jt) && (St(v(this, Jt)), F(this, Jt, null)), v(this, Dt) && (St(v(this, Dt)), F(this, Dt, null)), v(this, Ee) && (St(v(this, Ee)), F(this, Ee, null)), j && (Lt( + v(this, ie) && (Dt(v(this, ie)), F(this, ie, null)), v(this, qt) && (Dt(v(this, qt)), F(this, qt, null)), v(this, Se) && (Dt(v(this, Se)), F(this, Se, null)), Z && (zt( /** @type {TemplateNode} */ - v(this, Lr) - ), Qi(), Lt(hi())); + v(this, Yr) + ), es(), zt(vi())); var i = !1, s = !1; const a = () => { if (i) { - Xl(); + jl(); return; } - i = !0, s && zl(), Ge.ensure(), F(this, En, 0), v(this, Ee) !== null && Sn(v(this, Ee), () => { - F(this, Ee, null); - }), this.is_pending = this.has_pending_snippet(), F(this, Jt, gt(this, ct, ti).call(this, () => (F(this, Rn, !1), te(() => v(this, An).call(this, v(this, zt)))))), v(this, ze) > 0 ? gt(this, ct, ei).call(this) : this.is_pending = !1; + i = !0, s && Zl(), tn.ensure(), F(this, Cn, 0), v(this, Se) !== null && Mn(v(this, Se), () => { + F(this, Se, null); + }), this.is_pending = this.has_pending_snippet(), F(this, ie, gt(this, ct, ri).call(this, () => (F(this, Tn, !1), ae(() => v(this, Rn).call(this, v(this, Kt)))))), v(this, Ke) > 0 ? gt(this, ct, ii).call(this) : this.is_pending = !1; }; - Nn(() => { + kn(() => { try { s = !0, n == null || n(e, a), s = !1; } catch (o) { - or(o, v(this, Ae) && v(this, Ae).parent); + fr(o, v(this, Ne) && v(this, Ne).parent); } - r && F(this, Ee, gt(this, ct, ti).call(this, () => { - Ge.ensure(), F(this, Rn, !0); + r && F(this, Se, gt(this, ct, ri).call(this, () => { + tn.ensure(), F(this, Tn, !0); try { - return te(() => { + return ae(() => { r( - v(this, zt), + v(this, Kt), () => e, () => a ); }); } catch (o) { - return or( + return fr( o, /** @type {Effect} */ - v(this, Ae).parent + v(this, Ne).parent ), null; } finally { - F(this, Rn, !1); + F(this, Tn, !1); } })); }); } } -zt = new WeakMap(), Lr = new WeakMap(), $e = new WeakMap(), An = new WeakMap(), Ae = new WeakMap(), Jt = new WeakMap(), Dt = new WeakMap(), Ee = new WeakMap(), He = new WeakMap(), rn = new WeakMap(), En = new WeakMap(), ze = new WeakMap(), tr = new WeakMap(), Rn = new WeakMap(), er = new WeakMap(), nr = new WeakMap(), Xe = new WeakMap(), xi = new WeakMap(), ct = new WeakSet(), Wa = function() { +Kt = new WeakMap(), Yr = new WeakMap(), Te = new WeakMap(), Rn = new WeakMap(), Ne = new WeakMap(), ie = new WeakMap(), qt = new WeakMap(), Se = new WeakMap(), Ge = new WeakMap(), un = new WeakMap(), Cn = new WeakMap(), Ke = new WeakMap(), rr = new WeakMap(), Tn = new WeakMap(), ir = new WeakMap(), sr = new WeakMap(), Ze = new WeakMap(), Ai = new WeakMap(), ct = new WeakSet(), ja = function() { try { - F(this, Jt, te(() => v(this, An).call(this, v(this, zt)))); + F(this, ie, ae(() => v(this, Rn).call(this, v(this, Kt)))); } catch (e) { this.error(e); } -}, Ua = function() { - const e = v(this, $e).pending; - e && (F(this, Dt, te(() => e(v(this, zt)))), Nn(() => { - var n = gt(this, ct, rs).call(this); - F(this, Jt, gt(this, ct, ti).call(this, () => (Ge.ensure(), te(() => v(this, An).call(this, n))))), v(this, ze) > 0 ? gt(this, ct, ei).call(this) : (Sn( +}, Ja = function() { + const e = v(this, Te).pending; + e && (F(this, qt, ae(() => e(v(this, Kt)))), kn(() => { + var n = gt(this, ct, ss).call(this); + F(this, ie, gt(this, ct, ri).call(this, () => (tn.ensure(), ae(() => v(this, Rn).call(this, n))))), v(this, Ke) > 0 ? gt(this, ct, ii).call(this) : (Mn( /** @type {Effect} */ - v(this, Dt), + v(this, qt), () => { - F(this, Dt, null); + F(this, qt, null); } ), this.is_pending = !1); })); -}, rs = function() { - var e = v(this, zt); - return this.is_pending && (F(this, rn, re()), v(this, zt).before(v(this, rn)), e = v(this, rn)), e; +}, ss = function() { + var e = v(this, Kt); + return this.is_pending && (F(this, un, ue()), v(this, Kt).before(v(this, un)), e = v(this, un)), e; }, /** * @param {() => Effect | null} fn */ -ti = function(e) { - var n = U, r = V, i = Wt; - Ne(v(this, Ae)), ie(v(this, Ae)), ar(v(this, Ae).ctx); +ri = function(e) { + var n = U, r = Y, i = Jt; + De(v(this, Ne)), fe(v(this, Ne)), ur(v(this, Ne).ctx); try { return e(); } catch (s) { - return La(s), null; + return za(s), null; } finally { - Ne(n), ie(r), ar(i); + De(n), fe(r), ur(i); } -}, ei = function() { +}, ii = function() { const e = ( /** @type {(anchor: Node) => void} */ - v(this, $e).pending + v(this, Te).pending ); - v(this, Jt) !== null && (F(this, He, document.createDocumentFragment()), v(this, He).append( + v(this, ie) !== null && (F(this, Ge, document.createDocumentFragment()), v(this, Ge).append( /** @type {TemplateNode} */ - v(this, rn) - ), ho(v(this, Jt), v(this, He))), v(this, Dt) === null && F(this, Dt, te(() => e(v(this, zt)))); + v(this, un) + ), mo(v(this, ie), v(this, Ge))), v(this, qt) === null && F(this, qt, ae(() => e(v(this, Kt)))); }, /** * 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 * @param {1 | -1} d */ -is = function(e) { +as = function(e) { var n; if (!this.has_pending_snippet()) { - this.parent && gt(n = this.parent, ct, is).call(n, e); + this.parent && gt(n = this.parent, ct, as).call(n, e); return; } - if (F(this, ze, v(this, ze) + e), v(this, ze) === 0) { + if (F(this, Ke, v(this, Ke) + e), v(this, Ke) === 0) { this.is_pending = !1; - for (const r of v(this, er)) - lt(r, Et), ce(r); - for (const r of v(this, nr)) - lt(r, de), ce(r); - v(this, er).clear(), v(this, nr).clear(), v(this, Dt) && Sn(v(this, Dt), () => { - F(this, Dt, null); - }), v(this, He) && (v(this, zt).before(v(this, He)), F(this, He, null)); + for (const r of v(this, ir)) + ot(r, Rt), ye(r); + for (const r of v(this, sr)) + ot(r, xe), ye(r); + v(this, ir).clear(), v(this, sr).clear(), v(this, qt) && Mn(v(this, qt), () => { + F(this, qt, null); + }), v(this, Ge) && (v(this, Kt).before(v(this, Ge)), F(this, Ge, null)); } }; -function tu(t, e, n, r) { - const i = Ni; +function ou(t, e, n, r) { + const i = Mi; var s = t.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { r(e.map(i)); @@ -856,52 +856,52 @@ function tu(t, e, n, r) { var a = B, o = ( /** @type {Effect} */ U - ), l = eu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + ), l = lu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; function f(c) { l(); try { r(c); } catch (p) { - (o.f & Ue) === 0 && or(p, o); + (o.f & Qe) === 0 && fr(p, o); } - a == null || a.deactivate(), ss(); + a == null || a.deactivate(), os(); } if (n.length === 0) { u.then(() => f(e.map(i))); return; } function h() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ nu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => or(c, o)); + l(), Promise.all(n.map((c) => /* @__PURE__ */ uu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => fr(c, o)); } u ? u.then(h) : h(); } -function eu() { - var t = U, e = V, n = Wt, r = B; +function lu() { + var t = U, e = Y, n = Jt, r = B; return function(s = !0) { - Ne(t), ie(e), ar(n), s && (r == null || r.activate()); + De(t), fe(e), ur(n), s && (r == null || r.activate()); }; } -function ss() { - Ne(null), ie(null), ar(null); +function os() { + De(null), fe(null), ur(null); } // @__NO_SIDE_EFFECTS__ -function Ni(t) { - var e = At | Et, n = V !== null && (V.f & At) !== 0 ? ( +function Mi(t) { + var e = Et | Rt, n = Y !== null && (Y.f & Et) !== 0 ? ( /** @type {Derived} */ - V + Y ) : null; - return U !== null && (U.f |= qn), { - ctx: Wt, + return U !== null && (U.f |= Yn), { + ctx: Jt, deps: null, effects: null, - equals: Da, + equals: qa, f: e, fn: t, reactions: null, rv: 0, v: ( /** @type {V} */ - bt + $t ), wv: 0, parent: n ?? U, @@ -909,12 +909,12 @@ function Ni(t) { }; } // @__NO_SIDE_EFFECTS__ -function nu(t, e, n) { +function uu(t, e, n) { let r = ( /** @type {Effect | null} */ U ); - r === null && Ml(); + r === null && ql(); var i = ( /** @type {Boundary} */ r.b @@ -922,20 +922,20 @@ function nu(t, e, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = Dn( + ), a = In( /** @type {V} */ - bt - ), o = !V, l = /* @__PURE__ */ new Map(); - return hu(() => { + $t + ), o = !Y, l = /* @__PURE__ */ new Map(); + return yu(() => { var p; - var u = Ta(); + var u = Pa(); s = u.promise; try { Promise.resolve(t()).then(u.resolve, u.reject).then(() => { - f === B && f.committed && f.deactivate(), ss(); + f === B && f.committed && f.deactivate(), os(); }); } catch (g) { - u.reject(g), ss(); + u.reject(g), os(); } var f = ( /** @type {Batch} */ @@ -943,24 +943,24 @@ function nu(t, e, n) { ); if (o) { var h = i.is_rendered(); - i.update_pending_count(1), f.increment(h), (p = l.get(f)) == null || p.reject(_n), l.delete(f), l.set(f, u); + i.update_pending_count(1), f.increment(h), (p = l.get(f)) == null || p.reject(yn), l.delete(f), l.set(f, u); } const c = (g, m = void 0) => { if (f.activate(), m) - m !== _n && (a.f |= an, lr(a, m)); + m !== yn && (a.f |= cn, cr(a, m)); else { - (a.f & an) !== 0 && (a.f ^= an), lr(a, g); + (a.f & cn) !== 0 && (a.f ^= cn), cr(a, g); for (const [b, $] of l) { if (l.delete(b), b === f) break; - $.reject(_n); + $.reject(yn); } } o && (i.update_pending_count(-1), f.decrement(h)); }; u.promise.then(c, (g) => c(null, g || "unknown")); - }), uu(() => { + }), gu(() => { for (const u of l.values()) - u.reject(_n); + u.reject(yn); }), new Promise((u) => { function f(h) { function c() { @@ -972,30 +972,30 @@ function nu(t, e, n) { }); } // @__NO_SIDE_EFFECTS__ -function Bn(t) { - const e = /* @__PURE__ */ Ni(t); - return po(e), e; +function Gn(t) { + const e = /* @__PURE__ */ Mi(t); + return yo(e), e; } // @__NO_SIDE_EFFECTS__ -function Ga(t) { - const e = /* @__PURE__ */ Ni(t); - return e.equals = Fa, e; +function Qa(t) { + const e = /* @__PURE__ */ Mi(t); + return e.equals = Va, e; } -function ru(t) { +function fu(t) { var e = t.effects; if (e !== null) { t.effects = null; for (var n = 0; n < e.length; n += 1) - St( + Dt( /** @type {Effect} */ e[n] ); } } -function iu(t) { +function cu(t) { for (var e = t.parent; e !== null; ) { - if ((e.f & At) === 0) - return (e.f & Ue) === 0 ? ( + if ((e.f & Et) === 0) + return (e.f & Qe) === 0 ? ( /** @type {Effect} */ e ) : null; @@ -1003,127 +1003,127 @@ function iu(t) { } return null; } -function Rs(t) { +function Ts(t) { var e, n = U; - Ne(iu(t)); + De(cu(t)); try { - t.f &= ~Pn, ru(t), e = mo(t); + t.f &= ~Fn, fu(t), e = $o(t); } finally { - Ne(n); + De(n); } return e; } -function Ka(t) { - var e = Rs(t); - if (!t.equals(e) && (t.wv = go(), (!(B != null && B.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { - lt(t, mt); +function to(t) { + var e = Ts(t); + if (!t.equals(e) && (t.wv = xo(), (!(B != null && B.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { + ot(t, yt); return; } - ln || ($t !== null ? (Ts() || B != null && B.is_fork) && $t.set(t, e) : Es(t)); + dn || (At !== null ? (Ss() || B != null && B.is_fork) && At.set(t, e) : Cs(t)); } -function su(t) { +function hu(t) { var e, n; if (t.effects !== null) for (const r of t.effects) - (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(_n), r.teardown = Cl, r.ac = null, kr(r, 0), Ms(r)); + (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(yn), r.teardown = Dl, r.ac = null, Dr(r, 0), Ds(r)); } -function Za(t) { +function eo(t) { if (t.effects !== null) for (const e of t.effects) - e.teardown && ur(e); + e.teardown && hr(e); } -let as = /* @__PURE__ */ new Set(); -const on = /* @__PURE__ */ new Map(); -let ja = !1; -function Dn(t, e) { +let ls = /* @__PURE__ */ new Set(); +const hn = /* @__PURE__ */ new Map(); +let no = !1; +function In(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: t, reactions: null, - equals: Da, + equals: qa, rv: 0, wv: 0 }; return n; } // @__NO_SIDE_EFFECTS__ -function _t(t, e) { - const n = Dn(t); - return po(n), n; +function mt(t, e) { + const n = In(t); + return yo(n), n; } // @__NO_SIDE_EFFECTS__ -function Ja(t, e = !1, n = !0) { - const r = Dn(t); - return e || (r.equals = Fa), r; +function ro(t, e = !1, n = !0) { + const r = In(t); + return e || (r.equals = Va), r; } -function ot(t, e, n = !1) { - V !== null && // since we are untracking the function inside `$inspect.with` we need to add this check +function at(t, e, n = !1) { + Y !== 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 - (!he || (V.f & Gs) !== 0) && Oa() && (V.f & (At | Ze | bs | Gs)) !== 0 && (ne === null || !ir.call(ne, t)) && Hl(); - let r = n ? yn(e) : e; - return lr(t, r); + (!we || (Y.f & Qs) !== 0) && Ya() && (Y.f & (Et | nn | As | Qs)) !== 0 && (le === null || !or.call(le, t)) && Kl(); + let r = n ? xn(e) : e; + return cr(t, r); } -function lr(t, e) { +function cr(t, e) { if (!t.equals(e)) { var n = t.v; - ln ? on.set(t, e) : on.set(t, n), t.v = e; - var r = Ge.ensure(); - if (r.capture(t, n), (t.f & At) !== 0) { + dn ? hn.set(t, e) : hn.set(t, n), t.v = e; + var r = tn.ensure(); + if (r.capture(t, n), (t.f & Et) !== 0) { const i = ( /** @type {Derived} */ t ); - (t.f & Et) !== 0 && Rs(i), Es(i); + (t.f & Rt) !== 0 && Ts(i), Cs(i); } - t.wv = go(), Qa(t, Et), U !== null && (U.f & mt) !== 0 && (U.f & (pe | un)) === 0 && (jt === null ? vu([t]) : jt.push(t)), !r.is_fork && as.size > 0 && !ja && au(); + t.wv = xo(), io(t, Rt), U !== null && (U.f & yt) !== 0 && (U.f & (be | pn)) === 0 && (re === null ? bu([t]) : re.push(t)), !r.is_fork && ls.size > 0 && !no && du(); } return e; } -function au() { - ja = !1; - for (const t of as) - (t.f & mt) !== 0 && lt(t, de), Hr(t) && ur(t); - as.clear(); +function du() { + no = !1; + for (const t of ls) + (t.f & yt) !== 0 && ot(t, xe), Br(t) && hr(t); + ls.clear(); } -function Nr(t) { - ot(t, t.v + 1); +function Mr(t) { + at(t, t.v + 1); } -function Qa(t, e) { +function io(t, e) { var n = t.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & Et) === 0; - if (o && lt(s, e), (a & At) !== 0) { + var s = n[i], a = s.f, o = (a & Rt) === 0; + if (o && ot(s, e), (a & Et) !== 0) { var l = ( /** @type {Derived} */ s ); - $t == null || $t.delete(l), (a & Pn) === 0 && (a & ee && (s.f |= Pn), Qa(l, de)); - } else o && ((a & Ze) !== 0 && oe !== null && oe.add( + At == null || At.delete(l), (a & Fn) === 0 && (a & oe && (s.f |= Fn), io(l, xe)); + } else o && ((a & nn) !== 0 && ve !== null && ve.add( /** @type {Effect} */ s - ), ce( + ), ye( /** @type {Effect} */ s )); } } -function yn(t) { - if (typeof t != "object" || t === null || Cr in t) +function xn(t) { + if (typeof t != "object" || t === null || Sr in t) return t; - const e = Rl(t); - if (e !== Al && e !== El) + const e = Pl(t); + if (e !== kl && e !== Ml) return t; - var n = /* @__PURE__ */ new Map(), r = Ca(t), i = /* @__PURE__ */ _t(0), s = kn, a = (o) => { - if (kn === s) + var n = /* @__PURE__ */ new Map(), r = Ma(t), i = /* @__PURE__ */ mt(0), s = Pn, a = (o) => { + if (Pn === s) return o(); - var l = V, u = kn; - ie(null), Js(s); + var l = Y, u = Pn; + fe(null), ra(s); var f = o(); - return ie(l), Js(u), f; + return fe(l), ra(u), f; }; - return r && n.set("length", /* @__PURE__ */ _t( + return r && n.set("length", /* @__PURE__ */ mt( /** @type {any[]} */ t.length )), new Proxy( @@ -1131,35 +1131,35 @@ function yn(t) { t, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Vl(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ul(); var f = n.get(l); return f === void 0 ? a(() => { - var h = /* @__PURE__ */ _t(u.value); + var h = /* @__PURE__ */ mt(u.value); return n.set(l, h), h; - }) : ot(f, u.value, !0), !0; + }) : at(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__ */ _t(bt)); - n.set(l, f), Nr(i); + const f = a(() => /* @__PURE__ */ mt($t)); + n.set(l, f), Mr(i); } } else - ot(u, bt), Nr(i); + at(u, $t), Mr(i); return !0; }, get(o, l, u) { var p; - if (l === Cr) + if (l === Sr) return t; var f = n.get(l), h = l in o; - if (f === void 0 && (!h || (p = Tn(o, l)) != null && p.writable) && (f = a(() => { - var g = yn(h ? o[l] : bt), m = /* @__PURE__ */ _t(g); + if (f === void 0 && (!h || (p = Sn(o, l)) != null && p.writable) && (f = a(() => { + var g = xn(h ? o[l] : $t), m = /* @__PURE__ */ mt(g); return m; }), n.set(l, f)), f !== void 0) { var c = x(f); - return c === bt ? void 0 : c; + return c === $t ? void 0 : c; } return Reflect.get(o, l, u); }, @@ -1170,7 +1170,7 @@ function yn(t) { f && (u.value = x(f)); } else if (u === void 0) { var h = n.get(l), c = h == null ? void 0 : h.v; - if (h !== void 0 && c !== bt) + if (h !== void 0 && c !== $t) return { enumerable: !0, configurable: !0, @@ -1182,16 +1182,16 @@ function yn(t) { }, has(o, l) { var c; - if (l === Cr) + if (l === Sr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== bt || Reflect.has(o, l); - if (u !== void 0 || U !== null && (!f || (c = Tn(o, l)) != null && c.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== $t || Reflect.has(o, l); + if (u !== void 0 || U !== null && (!f || (c = Sn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { - var p = f ? yn(o[l]) : bt, g = /* @__PURE__ */ _t(p); + var p = f ? xn(o[l]) : $t, g = /* @__PURE__ */ mt(p); return g; }), n.set(l, u)); var h = x(u); - if (h === bt) + if (h === $t) return !1; } return f; @@ -1203,14 +1203,14 @@ function yn(t) { for (var p = u; p < /** @type {Source} */ h.v; p += 1) { var g = n.get(p + ""); - g !== void 0 ? ot(g, bt) : p in o && (g = a(() => /* @__PURE__ */ _t(bt)), n.set(p + "", g)); + g !== void 0 ? at(g, $t) : p in o && (g = a(() => /* @__PURE__ */ mt($t)), n.set(p + "", g)); } if (h === void 0) - (!c || (E = Tn(o, l)) != null && E.writable) && (h = a(() => /* @__PURE__ */ _t(void 0)), ot(h, yn(u)), n.set(l, h)); + (!c || (E = Sn(o, l)) != null && E.writable) && (h = a(() => /* @__PURE__ */ mt(void 0)), at(h, xn(u)), n.set(l, h)); else { - c = h.v !== bt; - var m = a(() => yn(u)); - ot(h, m); + c = h.v !== $t; + var m = a(() => xn(u)); + at(h, m); } var b = Reflect.getOwnPropertyDescriptor(o, l); if (b != null && b.set && b.set.call(f, u), !c) { @@ -1218,10 +1218,10 @@ function yn(t) { var $ = ( /** @type {Source} */ n.get("length") - ), R = Number(l); - Number.isInteger(R) && R >= $.v && ot($, R + 1); + ), C = Number(l); + Number.isInteger(C) && C >= $.v && at($, C + 1); } - Nr(i); + Mr(i); } return !0; }, @@ -1229,141 +1229,141 @@ function yn(t) { x(i); var l = Reflect.ownKeys(o).filter((h) => { var c = n.get(h); - return c === void 0 || c.v !== bt; + return c === void 0 || c.v !== $t; }); for (var [u, f] of n) - f.v !== bt && !(u in o) && l.push(u); + f.v !== $t && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - Yl(); + Gl(); } } ); } -var Zs, to, eo, no; -function os() { - if (Zs === void 0) { - Zs = window, to = /Firefox/.test(navigator.userAgent); +var ea, so, ao, oo; +function us() { + if (ea === void 0) { + ea = window, so = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype, n = Text.prototype; - eo = Tn(e, "firstChild").get, no = Tn(e, "nextSibling").get, Us(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Us(n) && (n.__t = void 0); + ao = Sn(e, "firstChild").get, oo = Sn(e, "nextSibling").get, Js(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Js(n) && (n.__t = void 0); } } -function re(t = "") { +function ue(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function Fn(t) { +function On(t) { return ( /** @type {TemplateNode | null} */ - eo.call(t) + ao.call(t) ); } // @__NO_SIDE_EFFECTS__ -function ke(t) { +function Ie(t) { return ( /** @type {TemplateNode | null} */ - no.call(t) + oo.call(t) ); } -function Yt(t, e) { - if (!j) - return /* @__PURE__ */ Fn(t); - var n = /* @__PURE__ */ Fn(Y); +function Ut(t, e) { + if (!Z) + return /* @__PURE__ */ On(t); + var n = /* @__PURE__ */ On(H); if (n === null) - n = Y.appendChild(re()); - else if (e && n.nodeType !== Yr) { - var r = re(); - return n == null || n.before(r), Lt(r), r; + n = H.appendChild(ue()); + else if (e && n.nodeType !== Xr) { + var r = ue(); + return n == null || n.before(r), zt(r), r; } - return e && Si( + return e && Pi( /** @type {Text} */ n - ), Lt(n), n; + ), zt(n), n; } -function pn(t, e = !1) { - if (!j) { - var n = /* @__PURE__ */ Fn(t); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ke(n) : n; +function gn(t, e = !1) { + if (!Z) { + var n = /* @__PURE__ */ On(t); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ie(n) : n; } if (e) { - if ((Y == null ? void 0 : Y.nodeType) !== Yr) { - var r = re(); - return Y == null || Y.before(r), Lt(r), r; + if ((H == null ? void 0 : H.nodeType) !== Xr) { + var r = ue(); + return H == null || H.before(r), zt(r), r; } - Si( + Pi( /** @type {Text} */ - Y + H ); } - return Y; + return H; } -function ae(t, e = 1, n = !1) { - let r = j ? Y : t; +function pe(t, e = 1, n = !1) { + let r = Z ? H : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ ke(r); - if (!j) + /* @__PURE__ */ Ie(r); + if (!Z) return r; if (n) { - if ((r == null ? void 0 : r.nodeType) !== Yr) { - var s = re(); - return r === null ? i == null || i.after(s) : r.before(s), Lt(s), s; + if ((r == null ? void 0 : r.nodeType) !== Xr) { + var s = ue(); + return r === null ? i == null || i.after(s) : r.before(s), zt(s), s; } - Si( + Pi( /** @type {Text} */ r ); } - return Lt(r), r; + return zt(r), r; } -function ro(t) { +function lo(t) { t.textContent = ""; } -function io() { +function uo() { return !1; } -function Cs(t, e, n) { +function Ns(t, e, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(bl, t, void 0) + document.createElementNS(Nl, t, void 0) ); } -function Si(t) { +function Pi(t) { if ( /** @type {string} */ t.nodeValue.length < 65536 ) return; let e = t.nextSibling; - for (; e !== null && e.nodeType === Yr; ) + for (; e !== null && e.nodeType === Xr; ) e.remove(), t.nodeValue += /** @type {string} */ e.nodeValue, e = t.nextSibling; } -function so(t) { - var e = V, n = U; - ie(null), Ne(null); +function fo(t) { + var e = Y, n = U; + fe(null), De(null); try { return t(); } finally { - ie(e), Ne(n); + fe(e), De(n); } } -function ou(t) { - U === null && (V === null && Ol(), Fl()), ln && Dl(); +function pu(t) { + U === null && (Y === null && zl(), Hl()), dn && Yl(); } -function lu(t, e) { +function vu(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function Me(t, e, n) { +function Oe(t, e, n) { var r = U; - r !== null && (r.f & Bt) !== 0 && (t |= Bt); + r !== null && (r.f & jt) !== 0 && (t |= jt); var i = { - ctx: Wt, + ctx: Jt, deps: null, nodes: null, - f: t | Et | ee, + f: t | Rt | oe, first: null, fn: e, last: null, @@ -1377,143 +1377,143 @@ function Me(t, e, n) { }; if (n) try { - ur(i); + hr(i); } catch (o) { - throw St(i), o; + throw Dt(i), o; } - else e !== null && ce(i); + else e !== null && ye(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 & qn) === 0 && (s = s.first, (t & Ze) !== 0 && (t & sr) !== 0 && s !== null && (s.f |= sr)), s !== null && (s.parent = r, r !== null && lu(s, r), V !== null && (V.f & At) !== 0 && (t & un) === 0)) { + (s.f & Yn) === 0 && (s = s.first, (t & nn) !== 0 && (t & lr) !== 0 && s !== null && (s.f |= lr)), s !== null && (s.parent = r, r !== null && vu(s, r), Y !== null && (Y.f & Et) !== 0 && (t & pn) === 0)) { var a = ( /** @type {Derived} */ - V + Y ); (a.effects ?? (a.effects = [])).push(s); } return i; } -function Ts() { - return V !== null && !he; +function Ss() { + return Y !== null && !we; } -function uu(t) { - const e = Me(Ei, null, !1); - return lt(e, mt), e.teardown = t, e; +function gu(t) { + const e = Oe(Ti, null, !1); + return ot(e, yt), e.teardown = t, e; } -function Ns(t) { - ou(); +function ks(t) { + pu(); var e = ( /** @type {Effect} */ U.f - ), n = !V && (e & pe) !== 0 && (e & hr) === 0; + ), n = !Y && (e & be) !== 0 && (e & vr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - Wt + Jt ); (r.e ?? (r.e = [])).push(t); } else - return ao(t); + return co(t); } -function ao(t) { - return Me(Sr | Sl, t, !1); +function co(t) { + return Oe(Pr | Ol, t, !1); } -function fu(t) { - Ge.ensure(); - const e = Me(un | qn, t, !0); +function _u(t) { + tn.ensure(); + const e = Oe(pn | Yn, t, !0); return () => { - St(e); + Dt(e); }; } -function cu(t) { - Ge.ensure(); - const e = Me(un | qn, t, !0); +function mu(t) { + tn.ensure(); + const e = Oe(pn | Yn, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Sn(e, () => { - St(e), r(void 0); - }) : (St(e), r(void 0)); + n.outro ? Mn(e, () => { + Dt(e), r(void 0); + }) : (Dt(e), r(void 0)); }); } -function oo(t) { - return Me(Sr, t, !1); +function ho(t) { + return Oe(Pr, t, !1); } -function hu(t) { - return Me(bs | qn, t, !0); +function yu(t) { + return Oe(As | Yn, t, !0); } -function Ss(t, e = 0) { - return Me(Ei | e, t, !0); +function Ms(t, e = 0) { + return Oe(Ti | e, t, !0); } -function Wn(t, e = [], n = [], r = []) { - tu(r, e, n, (i) => { - Me(Ei, () => t(...i.map(x)), !0); +function Kn(t, e = [], n = [], r = []) { + ou(r, e, n, (i) => { + Oe(Ti, () => t(...i.map(x)), !0); }); } -function ks(t, e = 0) { - var n = Me(Ze | e, t, !0); +function Ps(t, e = 0) { + var n = Oe(nn | e, t, !0); return n; } -function te(t) { - return Me(pe | qn, t, !0); +function ae(t) { + return Oe(be | Yn, t, !0); } -function lo(t) { +function po(t) { var e = t.teardown; if (e !== null) { - const n = ln, r = V; - js(!0), ie(null); + const n = dn, r = Y; + na(!0), fe(null); try { e.call(null); } finally { - js(n), ie(r); + na(n), fe(r); } } } -function Ms(t, e = !1) { +function Ds(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { const i = n.ac; - i !== null && so(() => { - i.abort(_n); + i !== null && fo(() => { + i.abort(yn); }); var r = n.next; - (n.f & un) !== 0 ? n.parent = null : St(n, e), n = r; + (n.f & pn) !== 0 ? n.parent = null : Dt(n, e), n = r; } } -function du(t) { +function wu(t) { for (var e = t.first; e !== null; ) { var n = e.next; - (e.f & pe) === 0 && St(e), e = n; + (e.f & be) === 0 && Dt(e), e = n; } } -function St(t, e = !0) { +function Dt(t, e = !0) { var n = !1; - (e || (t.f & ka) !== 0) && t.nodes !== null && t.nodes.end !== null && (pu( + (e || (t.f & Ia) !== 0) && t.nodes !== null && t.nodes.end !== null && (xu( t.nodes.start, /** @type {TemplateNode} */ t.nodes.end - ), n = !0), Ms(t, e && !n), kr(t, 0), lt(t, Ue); + ), n = !0), Ds(t, e && !n), Dr(t, 0), ot(t, Qe); var r = t.nodes && t.nodes.t; if (r !== null) for (const s of r) s.stop(); - lo(t); + po(t); var i = t.parent; - i !== null && i.first !== null && uo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; + i !== null && i.first !== null && vo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; } -function pu(t, e) { +function xu(t, e) { for (; t !== null; ) { - var n = t === e ? null : /* @__PURE__ */ ke(t); + var n = t === e ? null : /* @__PURE__ */ Ie(t); t.remove(), t = n; } } -function uo(t) { +function vo(t) { var e = t.parent, n = t.prev, r = t.next; n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); } -function Sn(t, e, n = !0) { +function Mn(t, e, n = !0) { var r = []; - fo(t, r, !0); + go(t, r, !0); var i = () => { - n && St(t), e && e(); + n && Dt(t), e && e(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1522,31 +1522,31 @@ function Sn(t, e, n = !0) { } else i(); } -function fo(t, e, n) { - if ((t.f & Bt) === 0) { - t.f ^= Bt; +function go(t, e, n) { + if ((t.f & jt) === 0) { + t.f ^= jt; var r = t.nodes && t.nodes.t; if (r !== null) for (const o of r) (o.is_global || n) && e.push(o); for (var i = t.first; i !== null; ) { - var s = i.next, a = (i.f & sr) !== 0 || // If this is a branch effect without a block effect parent, + var s = i.next, a = (i.f & lr) !== 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 & pe) !== 0 && (t.f & Ze) !== 0; - fo(i, e, a ? n : !1), i = s; + (i.f & be) !== 0 && (t.f & nn) !== 0; + go(i, e, a ? n : !1), i = s; } } } -function Ps(t) { - co(t, !0); +function Fs(t) { + _o(t, !0); } -function co(t, e) { - if ((t.f & Bt) !== 0) { - t.f ^= Bt, (t.f & mt) === 0 && (lt(t, Et), ce(t)); +function _o(t, e) { + if ((t.f & jt) !== 0) { + t.f ^= jt, (t.f & yt) === 0 && (ot(t, Rt), ye(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & sr) !== 0 || (n.f & pe) !== 0; - co(n, i ? e : !1), n = r; + var r = n.next, i = (n.f & lr) !== 0 || (n.f & be) !== 0; + _o(n, i ? e : !1), n = r; } var s = t.nodes && t.nodes.t; if (s !== null) @@ -1554,249 +1554,249 @@ function co(t, e) { (a.is_global || e) && a.in(); } } -function ho(t, e) { +function mo(t, e) { if (t.nodes) for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ ke(n); + var i = n === r ? null : /* @__PURE__ */ Ie(n); e.append(n), n = i; } } -let ni = !1, ln = !1; -function js(t) { - ln = t; +let si = !1, dn = !1; +function na(t) { + dn = t; } -let V = null, he = !1; -function ie(t) { - V = t; +let Y = null, we = !1; +function fe(t) { + Y = t; } let U = null; -function Ne(t) { +function De(t) { U = t; } -let ne = null; -function po(t) { - V !== null && (ne === null ? ne = [t] : ne.push(t)); +let le = null; +function yo(t) { + Y !== null && (le === null ? le = [t] : le.push(t)); } -let Ot = null, Ht = 0, jt = null; -function vu(t) { - jt = t; +let Yt = null, Gt = 0, re = null; +function bu(t) { + re = t; } -let vo = 1, wn = 0, kn = wn; -function Js(t) { - kn = t; +let wo = 1, bn = 0, Pn = bn; +function ra(t) { + Pn = t; } -function go() { - return ++vo; +function xo() { + return ++wo; } -function Hr(t) { +function Br(t) { var e = t.f; - if ((e & Et) !== 0) + if ((e & Rt) !== 0) return !0; - if (e & At && (t.f &= ~Pn), (e & de) !== 0) { + if (e & Et && (t.f &= ~Fn), (e & xe) !== 0) { for (var n = ( /** @type {Value[]} */ t.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (Hr( + if (Br( /** @type {Derived} */ s - ) && Ka( + ) && to( /** @type {Derived} */ s ), s.wv > t.wv) return !0; } - (e & ee) !== 0 && // During time traveling we don't want to reset the status so that + (e & oe) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - $t === null && lt(t, mt); + At === null && ot(t, yt); } return !1; } -function _o(t, e, n = !0) { +function bo(t, e, n = !0) { var r = t.reactions; - if (r !== null && !(ne !== null && ir.call(ne, t))) + if (r !== null && !(le !== null && or.call(le, t))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & At) !== 0 ? _o( + (s.f & Et) !== 0 ? bo( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? lt(s, Et) : (s.f & mt) !== 0 && lt(s, de), ce( + ) : e === s && (n ? ot(s, Rt) : (s.f & yt) !== 0 && ot(s, xe), ye( /** @type {Effect} */ s )); } } -function mo(t) { +function $o(t) { var m; - var e = Ot, n = Ht, r = jt, i = V, s = ne, a = Wt, o = he, l = kn, u = t.f; - Ot = /** @type {null | Value[]} */ - null, Ht = 0, jt = null, V = (u & (pe | un)) === 0 ? t : null, ne = null, ar(t.ctx), he = !1, kn = ++wn, t.ac !== null && (so(() => { - t.ac.abort(_n); + var e = Yt, n = Gt, r = re, i = Y, s = le, a = Jt, o = we, l = Pn, u = t.f; + Yt = /** @type {null | Value[]} */ + null, Gt = 0, re = null, Y = (u & (be | pn)) === 0 ? t : null, le = null, ur(t.ctx), we = !1, Pn = ++bn, t.ac !== null && (fo(() => { + t.ac.abort(yn); }), t.ac = null); try { - t.f |= Ji; + t.f |= ts; var f = ( /** @type {Function} */ t.fn ), h = f(); - t.f |= hr; + t.f |= vr; var c = t.deps, p = B == null ? void 0 : B.is_fork; - if (Ot !== null) { + if (Yt !== null) { var g; - if (p || kr(t, Ht), c !== null && Ht > 0) - for (c.length = Ht + Ot.length, g = 0; g < Ot.length; g++) - c[Ht + g] = Ot[g]; + if (p || Dr(t, Gt), c !== null && Gt > 0) + for (c.length = Gt + Yt.length, g = 0; g < Yt.length; g++) + c[Gt + g] = Yt[g]; else - t.deps = c = Ot; - if (Ts() && (t.f & ee) !== 0) - for (g = Ht; g < c.length; g++) + t.deps = c = Yt; + if (Ss() && (t.f & oe) !== 0) + for (g = Gt; g < c.length; g++) ((m = c[g]).reactions ?? (m.reactions = [])).push(t); - } else !p && c !== null && Ht < c.length && (kr(t, Ht), c.length = Ht); - if (Oa() && jt !== null && !he && c !== null && (t.f & (At | de | Et)) === 0) + } else !p && c !== null && Gt < c.length && (Dr(t, Gt), c.length = Gt); + if (Ya() && re !== null && !we && c !== null && (t.f & (Et | xe | Rt)) === 0) for (g = 0; g < /** @type {Source[]} */ - jt.length; g++) - _o( - jt[g], + re.length; g++) + bo( + re[g], /** @type {Effect} */ t ); if (i !== null && i !== t) { - if (wn++, i.deps !== null) + if (bn++, i.deps !== null) for (let b = 0; b < n; b += 1) - i.deps[b].rv = wn; + i.deps[b].rv = bn; if (e !== null) for (const b of e) - b.rv = wn; - jt !== null && (r === null ? r = jt : r.push(.../** @type {Source[]} */ - jt)); + b.rv = bn; + re !== null && (r === null ? r = re : r.push(.../** @type {Source[]} */ + re)); } - return (t.f & an) !== 0 && (t.f ^= an), h; + return (t.f & cn) !== 0 && (t.f ^= cn), h; } catch (b) { - return La(b); + return za(b); } finally { - t.f ^= Ji, Ot = e, Ht = n, jt = r, V = i, ne = s, ar(a), he = o, kn = l; + t.f ^= ts, Yt = e, Gt = n, re = r, Y = i, le = s, ur(a), we = o, Pn = l; } } -function gu(t, e) { +function $u(t, e) { let n = e.reactions; if (n !== null) { - var r = $l.call(n, t); + var r = Sl.call(n, t); if (r !== -1) { var i = n.length - 1; i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (e.f & At) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (e.f & Et) !== 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 - (Ot === null || !ir.call(Ot, e))) { + (Yt === null || !or.call(Yt, e))) { var s = ( /** @type {Derived} */ e ); - (s.f & ee) !== 0 && (s.f ^= ee, s.f &= ~Pn), Es(s), su(s), kr(s, 0); + (s.f & oe) !== 0 && (s.f ^= oe, s.f &= ~Fn), Cs(s), hu(s), Dr(s, 0); } } -function kr(t, e) { +function Dr(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - gu(t, n[r]); + $u(t, n[r]); } -function ur(t) { +function hr(t) { var e = t.f; - if ((e & Ue) === 0) { - lt(t, mt); - var n = U, r = ni; - U = t, ni = !0; + if ((e & Qe) === 0) { + ot(t, yt); + var n = U, r = si; + U = t, si = !0; try { - (e & (Ze | Na)) !== 0 ? du(t) : Ms(t), lo(t); - var i = mo(t); - t.teardown = typeof i == "function" ? i : null, t.wv = vo; + (e & (nn | Da)) !== 0 ? wu(t) : Ds(t), po(t); + var i = $o(t); + t.teardown = typeof i == "function" ? i : null, t.wv = wo; var s; - ji && Wl && (t.f & Et) !== 0 && t.deps; + Qi && Ql && (t.f & Rt) !== 0 && t.deps; } finally { - ni = r, U = n; + si = r, U = n; } } } function x(t) { - var e = t.f, n = (e & At) !== 0; - if (V !== null && !he) { - var r = U !== null && (U.f & Ue) !== 0; - if (!r && (ne === null || !ir.call(ne, t))) { - var i = V.deps; - if ((V.f & Ji) !== 0) - t.rv < wn && (t.rv = wn, Ot === null && i !== null && i[Ht] === t ? Ht++ : Ot === null ? Ot = [t] : Ot.push(t)); + var e = t.f, n = (e & Et) !== 0; + if (Y !== null && !we) { + var r = U !== null && (U.f & Qe) !== 0; + if (!r && (le === null || !or.call(le, t))) { + var i = Y.deps; + if ((Y.f & ts) !== 0) + t.rv < bn && (t.rv = bn, Yt === null && i !== null && i[Gt] === t ? Gt++ : Yt === null ? Yt = [t] : Yt.push(t)); else { - (V.deps ?? (V.deps = [])).push(t); + (Y.deps ?? (Y.deps = [])).push(t); var s = t.reactions; - s === null ? t.reactions = [V] : ir.call(s, V) || s.push(V); + s === null ? t.reactions = [Y] : or.call(s, Y) || s.push(Y); } } } - if (ln && on.has(t)) - return on.get(t); + if (dn && hn.has(t)) + return hn.get(t); if (n) { var a = ( /** @type {Derived} */ t ); - if (ln) { + if (dn) { var o = a.v; - return ((a.f & mt) === 0 && a.reactions !== null || wo(a)) && (o = Rs(a)), on.set(a, o), o; + return ((a.f & yt) === 0 && a.reactions !== null || Eo(a)) && (o = Ts(a)), hn.set(a, o), o; } - var l = (a.f & ee) === 0 && !he && V !== null && (ni || (V.f & ee) !== 0), u = (a.f & hr) === 0; - Hr(a) && (l && (a.f |= ee), Ka(a)), l && !u && (Za(a), yo(a)); + var l = (a.f & oe) === 0 && !we && Y !== null && (si || (Y.f & oe) !== 0), u = (a.f & vr) === 0; + Br(a) && (l && (a.f |= oe), to(a)), l && !u && (eo(a), Ao(a)); } - if ($t != null && $t.has(t)) - return $t.get(t); - if ((t.f & an) !== 0) + if (At != null && At.has(t)) + return At.get(t); + if ((t.f & cn) !== 0) throw t.v; return t.v; } -function yo(t) { - if (t.f |= ee, t.deps !== null) +function Ao(t) { + if (t.f |= oe, t.deps !== null) for (const e of t.deps) - (e.reactions ?? (e.reactions = [])).push(t), (e.f & At) !== 0 && (e.f & ee) === 0 && (Za( + (e.reactions ?? (e.reactions = [])).push(t), (e.f & Et) !== 0 && (e.f & oe) === 0 && (eo( /** @type {Derived} */ e - ), yo( + ), Ao( /** @type {Derived} */ e )); } -function wo(t) { - if (t.v === bt) return !0; +function Eo(t) { + if (t.v === $t) return !0; if (t.deps === null) return !1; for (const e of t.deps) - if (on.has(e) || (e.f & At) !== 0 && wo( + if (hn.has(e) || (e.f & Et) !== 0 && Eo( /** @type {Derived} */ e )) return !0; return !1; } -function ki(t) { - var e = he; +function Di(t) { + var e = we; try { - return he = !0, t(); + return we = !0, t(); } finally { - he = e; + we = e; } } -const xo = /* @__PURE__ */ new Set(), ls = /* @__PURE__ */ new Set(); -function _u(t) { +const Ro = /* @__PURE__ */ new Set(), fs = /* @__PURE__ */ new Set(); +function Au(t) { for (var e = 0; e < t.length; e++) - xo.add(t[e]); - for (var n of ls) + Ro.add(t[e]); + for (var n of fs) n(t); } -let Qs = null; -function ta(t) { +let ia = null; +function sa(t) { var b; var e = this, n = ( /** @type {Node} */ @@ -1805,8 +1805,8 @@ function ta(t) { /** @type {null | Element} */ i[0] || t.target ); - Qs = t; - var a = 0, o = Qs === t && t.__root; + ia = t; + var a = 0, o = ia === t && t.__root; if (o) { var l = i.indexOf(o); if (l !== -1 && (e === document || e === /** @type {any} */ @@ -1821,14 +1821,14 @@ function ta(t) { } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - ci(t, "currentTarget", { + pi(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = V, h = U; - ie(null), Ne(null); + var f = Y, h = U; + fe(null), De(null); try { for (var c, p = []; s !== null; ) { var g = s.assignedSlot || s.parentNode || /** @type {any} */ @@ -1854,29 +1854,29 @@ function ta(t) { throw c; } } finally { - t.__root = e, delete t.currentTarget, ie(f), Ne(h); + t.__root = e, delete t.currentTarget, fe(f), De(h); } } } -var Ea, Ra; -const Xi = (Ra = (Ea = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ea.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ra.createPolicy( +var Sa, ka; +const Wi = (ka = (Sa = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Sa.trustedTypes) == null ? void 0 : /* @__PURE__ */ ka.createPolicy( "svelte-trusted-html", { /** @param {string} html */ createHTML: (t) => t } ); -function mu(t) { +function Eu(t) { return ( /** @type {string} */ - (Xi == null ? void 0 : Xi.createHTML(t)) ?? t + (Wi == null ? void 0 : Wi.createHTML(t)) ?? t ); } -function bo(t, e = !1) { - var n = Cs("template"); - return t = t.replaceAll("", ""), n.innerHTML = e ? mu(t) : t, n.content; +function Co(t, e = !1) { + var n = Ns("template"); + return t = t.replaceAll("", ""), n.innerHTML = e ? Eu(t) : t, n.content; } -function On(t, e) { +function Ln(t, e) { var n = ( /** @type {Effect} */ U @@ -1884,75 +1884,75 @@ function On(t, e) { n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function Vn(t, e) { - var n = (e & xl) !== 0, r, i = !t.startsWith(""); +function Hn(t, e) { + var n = (e & Tl) !== 0, r, i = !t.startsWith(""); return () => { - if (j) - return On(Y, null), Y; - r === void 0 && (r = bo(i ? t : "" + t, !0)); + if (Z) + return Ln(H, null), H; + r === void 0 && (r = Co(i ? t : "" + t, !0)); var s = ( /** @type {TemplateNode} */ - n || to ? document.importNode(r, !0) : r.cloneNode(!0) + n || so ? document.importNode(r, !0) : r.cloneNode(!0) ); { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Fn(s) + /* @__PURE__ */ On(s) ), o = ( /** @type {TemplateNode} */ s.lastChild ); - On(a, o); + Ln(a, o); } return s; }; } // @__NO_SIDE_EFFECTS__ -function yu(t, e, n = "svg") { +function Ru(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { - if (j) - return On(Y, null), Y; + if (Z) + return Ln(H, null), H; if (!s) { var a = ( /** @type {DocumentFragment} */ - bo(i, !0) + Co(i, !0) ), o = ( /** @type {Element} */ - /* @__PURE__ */ Fn(a) + /* @__PURE__ */ On(a) ); s = /** @type {Element} */ - /* @__PURE__ */ Fn(o); + /* @__PURE__ */ On(o); } var l = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return On(l, l), l; + return Ln(l, l), l; }; } // @__NO_SIDE_EFFECTS__ -function wu(t, e) { - return /* @__PURE__ */ yu(t, e, "svg"); +function Cu(t, e) { + return /* @__PURE__ */ Ru(t, e, "svg"); } -function ea(t = "") { - if (!j) { - var e = re(t + ""); - return On(e, e), e; +function aa(t = "") { + if (!Z) { + var e = ue(t + ""); + return Ln(e, e), e; } - var n = Y; - return n.nodeType !== Yr ? (n.before(n = re()), Lt(n)) : Si( + var n = H; + return n.nodeType !== Xr ? (n.before(n = ue()), zt(n)) : Pi( /** @type {Text} */ n - ), On(n, n), n; + ), Ln(n, n), n; } -function le(t, e) { - if (j) { +function ge(t, e) { + if (Z) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ U ); - ((n.f & hr) === 0 || n.nodes.end === null) && (n.nodes.end = Y), Ci(); + ((n.f & vr) === 0 || n.nodes.end === null) && (n.nodes.end = H), Si(); return; } t !== null && t.before( @@ -1960,64 +1960,64 @@ function le(t, e) { e ); } -const xu = ["touchstart", "touchmove"]; -function bu(t) { - return xu.includes(t); +const Tu = ["touchstart", "touchmove"]; +function Nu(t) { + return Tu.includes(t); } -function en(t, e) { +function on(t, e) { var n = e == null ? "" : typeof e == "object" ? e + "" : e; n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); } -function $o(t, e) { - return Ao(t, e); +function To(t, e) { + return No(t, e); } -function $u(t, e) { - os(), e.intro = e.intro ?? !1; - const n = e.target, r = j, i = Y; +function Su(t, e) { + us(), e.intro = e.intro ?? !1; + const n = e.target, r = Z, i = H; try { - for (var s = /* @__PURE__ */ Fn(n); s && (s.nodeType !== dr || /** @type {Comment} */ - s.data !== ws); ) - s = /* @__PURE__ */ ke(s); + for (var s = /* @__PURE__ */ On(n); s && (s.nodeType !== gr || /** @type {Comment} */ + s.data !== bs); ) + s = /* @__PURE__ */ Ie(s); if (!s) - throw rr; - We(!0), Lt( + throw ar; + Je(!0), zt( /** @type {Comment} */ s ); - const a = Ao(t, { ...e, anchor: s }); - return We(!1), /** @type {Exports} */ + const a = No(t, { ...e, anchor: s }); + return Je(!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 !== rr && console.warn("Failed to hydrate: ", a), e.recover === !1 && Ll(), os(), ro(n), We(!1), $o(t, e); + return a !== ar && console.warn("Failed to hydrate: ", a), e.recover === !1 && Bl(), us(), lo(n), Je(!1), To(t, e); } finally { - We(r), Lt(i); + Je(r), zt(i); } } -const Gr = /* @__PURE__ */ new Map(); -function Ao(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - os(); +const jr = /* @__PURE__ */ new Map(); +function No(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + us(); var o = /* @__PURE__ */ new Set(), l = (h) => { for (var c = 0; c < h.length; c++) { var p = h[c]; if (!o.has(p)) { o.add(p); - var g = bu(p); + var g = Nu(p); for (const $ of [e, document]) { - var m = Gr.get($); - m === void 0 && (m = /* @__PURE__ */ new Map(), Gr.set($, m)); + var m = jr.get($); + m === void 0 && (m = /* @__PURE__ */ new Map(), jr.set($, m)); var b = m.get(p); - b === void 0 ? ($.addEventListener(p, ta, { passive: g }), m.set(p, 1)) : m.set(p, b + 1); + b === void 0 ? ($.addEventListener(p, sa, { passive: g }), m.set(p, 1)) : m.set(p, b + 1); } } } }; - l(Ai(xo)), ls.add(l); - var u = void 0, f = cu(() => { - var h = n ?? e.appendChild(re()); - return Jl( + l(Ci(Ro)), fs.add(l); + var u = void 0, f = mu(() => { + var h = n ?? e.appendChild(ue()); + return su( /** @type {TemplateNode} */ h, { @@ -2025,19 +2025,19 @@ function Ao(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int } }, (c) => { - $s({}); + Es({}); var p = ( /** @type {ComponentContext} */ - Wt + Jt ); - if (s && (p.c = s), i && (r.$$events = i), j && On( + if (s && (p.c = s), i && (r.$$events = i), Z && Ln( /** @type {TemplateNode} */ c, null - ), u = t(c, r) || {}, j && (U.nodes.end = Y, Y === null || Y.nodeType !== dr || /** @type {Comment} */ - Y.data !== xs)) - throw Ri(), rr; - As(); + ), u = t(c, r) || {}, Z && (U.nodes.end = H, H === null || H.nodeType !== gr || /** @type {Comment} */ + H.data !== $s)) + throw Ni(), ar; + Rs(); } ), () => { var m; @@ -2045,34 +2045,34 @@ function Ao(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int for (const b of [e, document]) { var p = ( /** @type {Map} */ - Gr.get(b) + jr.get(b) ), g = ( /** @type {number} */ p.get(c) ); - --g == 0 ? (b.removeEventListener(c, ta), p.delete(c), p.size === 0 && Gr.delete(b)) : p.set(c, g); + --g == 0 ? (b.removeEventListener(c, sa), p.delete(c), p.size === 0 && jr.delete(b)) : p.set(c, g); } - ls.delete(l), h !== n && ((m = h.parentNode) == null || m.removeChild(h)); + fs.delete(l), h !== n && ((m = h.parentNode) == null || m.removeChild(h)); }; }); - return us.set(u, f), u; + return cs.set(u, f), u; } -let us = /* @__PURE__ */ new WeakMap(); -function Au(t, e) { - const n = us.get(t); - return n ? (us.delete(t), n(e)) : Promise.resolve(); +let cs = /* @__PURE__ */ new WeakMap(); +function ku(t, e) { + const n = cs.get(t); + return n ? (cs.delete(t), n(e)) : Promise.resolve(); } -var ue, Re, Xt, Cn, qr, Vr, bi; -class Eu { +var _e, ke, Zt, Nn, Hr, zr, Ei; +class Mu { /** * @param {TemplateNode} anchor * @param {boolean} transition */ constructor(e, n = !0) { /** @type {TemplateNode} */ - at(this, "anchor"); + st(this, "anchor"); /** @type {Map} */ - L(this, ue, /* @__PURE__ */ new Map()); + q(this, _e, /* @__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. @@ -2087,69 +2087,69 @@ class Eu { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - L(this, Re, /* @__PURE__ */ new Map()); + q(this, ke, /* @__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} */ - L(this, Xt, /* @__PURE__ */ new Map()); + q(this, Zt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - L(this, Cn, /* @__PURE__ */ new Set()); + q(this, Nn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - L(this, qr, !0); - L(this, Vr, () => { + q(this, Hr, !0); + q(this, zr, () => { var e = ( /** @type {Batch} */ B ); - if (v(this, ue).has(e)) { + if (v(this, _e).has(e)) { var n = ( /** @type {Key} */ - v(this, ue).get(e) - ), r = v(this, Re).get(n); + v(this, _e).get(e) + ), r = v(this, ke).get(n); if (r) - Ps(r), v(this, Cn).delete(n); + Fs(r), v(this, Nn).delete(n); else { - var i = v(this, Xt).get(n); - i && (v(this, Re).set(n, i.effect), v(this, Xt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, Zt).get(n); + i && (v(this, ke).set(n, i.effect), v(this, Zt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, ue)) { - if (v(this, ue).delete(s), s === e) + for (const [s, a] of v(this, _e)) { + if (v(this, _e).delete(s), s === e) break; - const o = v(this, Xt).get(a); - o && (St(o.effect), v(this, Xt).delete(a)); + const o = v(this, Zt).get(a); + o && (Dt(o.effect), v(this, Zt).delete(a)); } - for (const [s, a] of v(this, Re)) { - if (s === n || v(this, Cn).has(s)) continue; + for (const [s, a] of v(this, ke)) { + if (s === n || v(this, Nn).has(s)) continue; const o = () => { - if (Array.from(v(this, ue).values()).includes(s)) { + if (Array.from(v(this, _e).values()).includes(s)) { var u = document.createDocumentFragment(); - ho(a, u), u.append(re()), v(this, Xt).set(s, { effect: a, fragment: u }); + mo(a, u), u.append(ue()), v(this, Zt).set(s, { effect: a, fragment: u }); } else - St(a); - v(this, Cn).delete(s), v(this, Re).delete(s); + Dt(a); + v(this, Nn).delete(s), v(this, ke).delete(s); }; - v(this, qr) || !r ? (v(this, Cn).add(s), Sn(a, o, !1)) : o(); + v(this, Hr) || !r ? (v(this, Nn).add(s), Mn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - L(this, bi, (e) => { - v(this, ue).delete(e); - const n = Array.from(v(this, ue).values()); - for (const [r, i] of v(this, Xt)) - n.includes(r) || (St(i.effect), v(this, Xt).delete(r)); + q(this, Ei, (e) => { + v(this, _e).delete(e); + const n = Array.from(v(this, _e).values()); + for (const [r, i] of v(this, Zt)) + n.includes(r) || (Dt(i.effect), v(this, Zt).delete(r)); }); - this.anchor = e, F(this, qr, n); + this.anchor = e, F(this, Hr, n); } /** * @@ -2160,68 +2160,68 @@ class Eu { var r = ( /** @type {Batch} */ B - ), i = io(); - if (n && !v(this, Re).has(e) && !v(this, Xt).has(e)) + ), i = uo(); + if (n && !v(this, ke).has(e) && !v(this, Zt).has(e)) if (i) { - var s = document.createDocumentFragment(), a = re(); - s.append(a), v(this, Xt).set(e, { - effect: te(() => n(a)), + var s = document.createDocumentFragment(), a = ue(); + s.append(a), v(this, Zt).set(e, { + effect: ae(() => n(a)), fragment: s }); } else - v(this, Re).set( + v(this, ke).set( e, - te(() => n(this.anchor)) + ae(() => n(this.anchor)) ); - if (v(this, ue).set(r, e), i) { - for (const [o, l] of v(this, Re)) + if (v(this, _e).set(r, e), i) { + for (const [o, l] of v(this, ke)) o === e ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, Xt)) + for (const [o, l] of v(this, Zt)) o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, Vr)), r.ondiscard(v(this, bi)); + r.oncommit(v(this, zr)), r.ondiscard(v(this, Ei)); } else - j && (this.anchor = Y), v(this, Vr).call(this); + Z && (this.anchor = H), v(this, zr).call(this); } } -ue = new WeakMap(), Re = new WeakMap(), Xt = new WeakMap(), Cn = new WeakMap(), qr = new WeakMap(), Vr = new WeakMap(), bi = new WeakMap(); -function Ru(t) { - Wt === null && kl(), Ns(() => { - const e = ki(t); +_e = new WeakMap(), ke = new WeakMap(), Zt = new WeakMap(), Nn = new WeakMap(), Hr = new WeakMap(), zr = new WeakMap(), Ei = new WeakMap(); +function Pu(t) { + Jt === null && Ll(), ks(() => { + const e = Di(t); if (typeof e == "function") return ( /** @type {() => void} */ e ); }); } -function wr(t, e, n = !1) { - j && Ci(); - var r = new Eu(t), i = n ? sr : 0; +function $r(t, e, n = !1) { + Z && Si(); + var r = new Mu(t), i = n ? lr : 0; function s(a, o) { - if (j) { - const f = Pa(t); + if (Z) { + const f = La(t); var l; - if (f === ws ? l = 0 : f === $i ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = hi(); - Lt(u), r.anchor = u, We(!1), r.ensure(a, o), We(!0); + if (f === bs ? l = 0 : f === Ri ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = vi(); + zt(u), r.anchor = u, Je(!1), r.ensure(a, o), Je(!0); return; } } r.ensure(a, o); } - ks(() => { + Ps(() => { var a = !1; e((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function Bi(t, e) { +function Ui(t, e) { return e; } -function Cu(t, e, n) { +function Du(t, e, n) { for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { let h = e[o]; - Sn( + Mn( h, () => { if (s) { @@ -2230,7 +2230,7 @@ function Cu(t, e, n) { /** @type {Set} */ t.outrogroups ); - fs(Ai(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); + hs(Ci(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); } } else a -= 1; @@ -2248,164 +2248,164 @@ function Cu(t, e, n) { /** @type {Element} */ u.parentNode ); - ro(f), f.append(u), t.items.clear(); + lo(f), f.append(u), t.items.clear(); } - fs(e, !l); + hs(e, !l); } else s = { pending: new Set(e), done: /* @__PURE__ */ new Set() }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function fs(t, e = !0) { +function hs(t, e = !0) { for (var n = 0; n < t.length; n++) - St(t[n], e); + Dt(t[n], e); } -var na; -function Wi(t, e, n, r, i, s = null) { +var oa; +function Gi(t, e, n, r, i, s = null) { var a = t, o = /* @__PURE__ */ new Map(); - j && Ci(); - var l = null, u = /* @__PURE__ */ Ga(() => { + Z && Si(); + var l = null, u = /* @__PURE__ */ Qa(() => { var m = n(); - return Ca(m) ? m : m == null ? [] : Ai(m); + return Ma(m) ? m : m == null ? [] : Ci(m); }), f, h = !0; function c() { - g.fallback = l, Tu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & sn) === 0 ? Ps(l) : (l.f ^= sn, $r(l, null, a)) : Sn(l, () => { + g.fallback = l, Fu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & fn) === 0 ? Fs(l) : (l.f ^= fn, Rr(l, null, a)) : Mn(l, () => { l = null; })); } - var p = ks(() => { + var p = Ps(() => { f = /** @type {V[]} */ x(u); var m = f.length; let b = !1; - if (j) { - var $ = Pa(a) === $i; - $ !== (m === 0) && (a = hi(), Lt(a), We(!1), b = !0); + if (Z) { + var $ = La(a) === Ri; + $ !== (m === 0) && (a = vi(), zt(a), Je(!1), b = !0); } - for (var R = /* @__PURE__ */ new Set(), E = ( + for (var C = /* @__PURE__ */ new Set(), E = ( /** @type {Batch} */ B - ), M = io(), C = 0; C < m; C += 1) { - j && Y.nodeType === dr && /** @type {Comment} */ - Y.data === xs && (a = /** @type {Comment} */ - Y, b = !0, We(!1)); - var tt = f[C], nt = r(tt, C), Q = h ? null : o.get(nt); - Q ? (Q.v && lr(Q.v, tt), Q.i && lr(Q.i, C), M && E.unskip_effect(Q.e)) : (Q = Nu( + ), S = uo(), T = 0; T < m; T += 1) { + Z && H.nodeType === gr && /** @type {Comment} */ + H.data === $s && (a = /** @type {Comment} */ + H, b = !0, Je(!1)); + var G = f[T], lt = r(G, T), K = h ? null : o.get(lt); + K ? (K.v && cr(K.v, G), K.i && cr(K.i, T), S && E.unskip_effect(K.e)) : (K = Iu( o, - h ? a : na ?? (na = re()), - tt, - nt, - C, + h ? a : oa ?? (oa = ue()), + G, + lt, + T, i, e, n - ), h || (Q.e.f |= sn), o.set(nt, Q)), R.add(nt); + ), h || (K.e.f |= fn), o.set(lt, K)), C.add(lt); } - if (m === 0 && s && !l && (h ? l = te(() => s(a)) : (l = te(() => s(na ?? (na = re()))), l.f |= sn)), m > R.size && Pl(), j && m > 0 && Lt(hi()), !h) - if (M) { - for (const [J, ht] of o) - R.has(J) || E.skip_effect(ht.e); + if (m === 0 && s && !l && (h ? l = ae(() => s(a)) : (l = ae(() => s(oa ?? (oa = ue()))), l.f |= fn)), m > C.size && Vl(), Z && m > 0 && zt(vi()), !h) + if (S) { + for (const [rt, Q] of o) + C.has(rt) || E.skip_effect(Q.e); E.oncommit(c), E.ondiscard(() => { }); } else c(); - b && We(!0), x(u); + b && Je(!0), x(u); }), g = { effect: p, items: o, outrogroups: null, fallback: l }; - h = !1, j && (a = Y); + h = !1, Z && (a = H); } -function xr(t) { - for (; t !== null && (t.f & pe) === 0; ) +function Ar(t) { + for (; t !== null && (t.f & be) === 0; ) t = t.next; return t; } -function Tu(t, e, n, r, i) { - var Q; - var s = e.length, a = t.items, o = xr(t.effect.first), l, u = null, f = [], h = [], c, p, g, m; +function Fu(t, e, n, r, i) { + var K; + var s = e.length, a = t.items, o = Ar(t.effect.first), l, u = null, f = [], h = [], c, p, g, m; for (m = 0; m < s; m += 1) { if (c = e[m], p = i(c, m), g = /** @type {EachItem} */ a.get(p).e, t.outrogroups !== null) - for (const J of t.outrogroups) - J.pending.delete(g), J.done.delete(g); - if ((g.f & sn) !== 0) - if (g.f ^= sn, g === o) - $r(g, null, n); + for (const rt of t.outrogroups) + rt.pending.delete(g), rt.done.delete(g); + if ((g.f & fn) !== 0) + if (g.f ^= fn, g === o) + Rr(g, null, n); else { var b = u ? u.next : o; - g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), nn(t, u, g), nn(t, g, b), $r(g, b, n), u = g, f = [], h = [], o = xr(u.next); + g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), ln(t, u, g), ln(t, g, b), Rr(g, b, n), u = g, f = [], h = [], o = Ar(u.next); continue; } - if ((g.f & Bt) !== 0 && Ps(g), g !== o) { + if ((g.f & jt) !== 0 && Fs(g), g !== o) { if (l !== void 0 && l.has(g)) { if (f.length < h.length) { - var $ = h[0], R; + var $ = h[0], C; u = $.prev; - var E = f[0], M = f[f.length - 1]; - for (R = 0; R < f.length; R += 1) - $r(f[R], $, n); - for (R = 0; R < h.length; R += 1) - l.delete(h[R]); - nn(t, E.prev, M.next), nn(t, u, E), nn(t, M, $), o = $, u = M, m -= 1, f = [], h = []; + var E = f[0], S = f[f.length - 1]; + for (C = 0; C < f.length; C += 1) + Rr(f[C], $, n); + for (C = 0; C < h.length; C += 1) + l.delete(h[C]); + ln(t, E.prev, S.next), ln(t, u, E), ln(t, S, $), o = $, u = S, m -= 1, f = [], h = []; } else - l.delete(g), $r(g, o, n), nn(t, g.prev, g.next), nn(t, g, u === null ? t.effect.first : u.next), nn(t, u, g), u = g; + l.delete(g), Rr(g, o, n), ln(t, g.prev, g.next), ln(t, g, u === null ? t.effect.first : u.next), ln(t, u, g), u = g; continue; } for (f = [], h = []; o !== null && o !== g; ) - (l ?? (l = /* @__PURE__ */ new Set())).add(o), h.push(o), o = xr(o.next); + (l ?? (l = /* @__PURE__ */ new Set())).add(o), h.push(o), o = Ar(o.next); if (o === null) continue; } - (g.f & sn) === 0 && f.push(g), u = g, o = xr(g.next); + (g.f & fn) === 0 && f.push(g), u = g, o = Ar(g.next); } if (t.outrogroups !== null) { - for (const J of t.outrogroups) - J.pending.size === 0 && (fs(Ai(J.done)), (Q = t.outrogroups) == null || Q.delete(J)); + for (const rt of t.outrogroups) + rt.pending.size === 0 && (hs(Ci(rt.done)), (K = t.outrogroups) == null || K.delete(rt)); t.outrogroups.size === 0 && (t.outrogroups = null); } if (o !== null || l !== void 0) { - var C = []; + var T = []; if (l !== void 0) for (g of l) - (g.f & Bt) === 0 && C.push(g); + (g.f & jt) === 0 && T.push(g); for (; o !== null; ) - (o.f & Bt) === 0 && o !== t.fallback && C.push(o), o = xr(o.next); - var tt = C.length; - if (tt > 0) { - var nt = null; - Cu(t, C, nt); + (o.f & jt) === 0 && o !== t.fallback && T.push(o), o = Ar(o.next); + var G = T.length; + if (G > 0) { + var lt = null; + Du(t, T, lt); } } } -function Nu(t, e, n, r, i, s, a, o) { - var l = (a & pl) !== 0 ? (a & gl) === 0 ? /* @__PURE__ */ Ja(n, !1, !1) : Dn(n) : null, u = (a & vl) !== 0 ? Dn(i) : null; +function Iu(t, e, n, r, i, s, a, o) { + var l = (a & xl) !== 0 ? (a & $l) === 0 ? /* @__PURE__ */ ro(n, !1, !1) : In(n) : null, u = (a & bl) !== 0 ? In(i) : null; return { v: l, i: u, - e: te(() => (s(e, l ?? n, u ?? i, o), () => { + e: ae(() => (s(e, l ?? n, u ?? i, o), () => { t.delete(r); })) }; } -function $r(t, e, n) { +function Rr(t, e, n) { if (t.nodes) - for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & sn) === 0 ? ( + for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & fn) === 0 ? ( /** @type {EffectNodes} */ e.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ke(r) + /* @__PURE__ */ Ie(r) ); if (s.before(r), r === i) return; r = a; } } -function nn(t, e, n) { +function ln(t, e, n) { e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; } -function Eo(t, e) { - oo(() => { +function So(t, e) { + ho(() => { var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -2418,12 +2418,12 @@ function Eo(t, e) { ) ); if (!r.querySelector("#" + e.hash)) { - const i = Cs("style"); + const i = Ns("style"); i.id = e.hash, i.textContent = e.code, r.appendChild(i); } }); } -function ra(t, e = !1) { +function la(t, e = !1) { var n = e ? " !important;" : ";", r = ""; for (var i in t) { var s = t[i]; @@ -2431,59 +2431,59 @@ function ra(t, e = !1) { } return r; } -function Su(t, e) { +function Ou(t, e) { if (e) { var n = "", r, i; - return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += ra(r)), i && (n += ra(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += la(r)), i && (n += la(i, !0)), n = n.trim(), n === "" ? null : n; } return String(t); } -function Ui(t, e = {}, n, r) { +function Ki(t, e = {}, n, r) { for (var i in n) { var s = n[i]; e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); } } -function ia(t, e, n, r) { +function ua(t, e, n, r) { var i = t.__style; - if (j || i !== e) { - var s = Su(e, r); - (!j || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; - } else r && (Array.isArray(r) ? (Ui(t, n == null ? void 0 : n[0], r[0]), Ui(t, n == null ? void 0 : n[1], r[1], "important")) : Ui(t, n, r)); + if (Z || i !== e) { + var s = Ou(e, r); + (!Z || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; + } else r && (Array.isArray(r) ? (Ki(t, n == null ? void 0 : n[0], r[0]), Ki(t, n == null ? void 0 : n[1], r[1], "important")) : Ki(t, n, r)); return r; } -function sa(t, e) { - return t === e || (t == null ? void 0 : t[Cr]) === e; +function fa(t, e) { + return t === e || (t == null ? void 0 : t[Sr]) === e; } -function ri(t = {}, e, n, r) { - return oo(() => { +function ai(t = {}, e, n, r) { + return ho(() => { var i, s; - return Ss(() => { - i = s, s = [], ki(() => { - t !== n(...s) && (e(t, ...s), i && sa(n(...i), t) && e(null, ...i)); + return Ms(() => { + i = s, s = [], Di(() => { + t !== n(...s) && (e(t, ...s), i && fa(n(...i), t) && e(null, ...i)); }); }), () => { - Nn(() => { - s && sa(n(...s), t) && e(null, ...s); + kn(() => { + s && fa(n(...s), t) && e(null, ...s); }); }; }), t; } -let Kr = !1; -function ku(t) { - var e = Kr; +let Jr = !1; +function Lu(t) { + var e = Jr; try { - return Kr = !1, [t(), Kr]; + return Jr = !1, [t(), Jr]; } finally { - Kr = e; + Jr = e; } } -function vt(t, e, n, r) { - var R; - var i = (n & yl) !== 0, s = (n & wl) !== 0, a = ( +function ht(t, e, n, r) { + var C; + var i = (n & Rl) !== 0, s = (n & Cl) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? ki( + ), o = !0, l = () => (o && (o = !1, a = s ? Di( /** @type {() => V} */ r ) : ( @@ -2491,15 +2491,15 @@ function vt(t, e, n, r) { r )), a), u; if (i) { - var f = Cr in t || Ma in t; - u = ((R = Tn(t, e)) == null ? void 0 : R.set) ?? (f && e in t ? (E) => t[e] = E : void 0); + var f = Sr in t || Oa in t; + u = ((C = Sn(t, e)) == null ? void 0 : C.set) ?? (f && e in t ? (E) => t[e] = E : void 0); } var h, c = !1; - i ? [h, c] = ku(() => ( + i ? [h, c] = Lu(() => ( /** @type {V} */ t[e] )) : h = /** @type {V} */ - t[e], h === void 0 && r !== void 0 && (h = l(), u && (ql(), u(h))); + t[e], h === void 0 && r !== void 0 && (h = l(), u && (Wl(), u(h))); var p; if (p = () => { var E = ( @@ -2507,18 +2507,18 @@ function vt(t, e, n, r) { t[e] ); return E === void 0 ? l() : (o = !0, E); - }, (n & ml) === 0) + }, (n & El) === 0) return p; if (u) { var g = t.$$legacy; return ( /** @type {() => V} */ - (function(E, M) { - return arguments.length > 0 ? ((!M || g || c) && u(M ? p() : E), E) : p(); + (function(E, S) { + return arguments.length > 0 ? ((!S || g || c) && u(S ? p() : E), E) : p(); }) ); } - var m = !1, b = ((n & _l) !== 0 ? Ni : Ga)(() => (m = !1, p())); + var m = !1, b = ((n & Al) !== 0 ? Mi : Qa)(() => (m = !1, p())); i && x(b); var $ = ( /** @type {Effect} */ @@ -2526,20 +2526,20 @@ function vt(t, e, n, r) { ); return ( /** @type {() => V} */ - (function(E, M) { + (function(E, S) { if (arguments.length > 0) { - const C = M ? x(b) : i ? yn(E) : E; - return ot(b, C), m = !0, a !== void 0 && (a = C), E; + const T = S ? x(b) : i ? xn(E) : E; + return at(b, T), m = !0, a !== void 0 && (a = T), E; } - return ln && m || ($.f & Ue) !== 0 ? b.v : x(b); + return dn && m || ($.f & Qe) !== 0 ? b.v : x(b); }) ); } -function Mu(t) { - return new Pu(t); +function qu(t) { + return new Vu(t); } -var Be, Qt; -class Pu { +var je, se; +class Vu { /** * @param {ComponentConstructorOptions & { * component: any; @@ -2547,12 +2547,12 @@ class Pu { */ constructor(e) { /** @type {any} */ - L(this, Be); + q(this, je); /** @type {Record} */ - L(this, Qt); + q(this, se); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ Ja(o, !1, !1); + var l = /* @__PURE__ */ ro(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( @@ -2562,42 +2562,42 @@ class Pu { return x(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === Ma ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === Oa ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return ot(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return at(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - F(this, Qt, (e.hydrate ? $u : $o)(e.component, { + F(this, se, (e.hydrate ? Su : To)(e.component, { target: e.target, anchor: e.anchor, props: i, context: e.context, intro: e.intro ?? !1, recover: e.recover - })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && ft(), F(this, Be, i.$$events); - for (const a of Object.keys(v(this, Qt))) - a === "$set" || a === "$destroy" || a === "$on" || ci(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && ft(), F(this, je, i.$$events); + for (const a of Object.keys(v(this, se))) + a === "$set" || a === "$destroy" || a === "$on" || pi(this, a, { get() { - return v(this, Qt)[a]; + return v(this, se)[a]; }, /** @param {any} value */ set(o) { - v(this, Qt)[a] = o; + v(this, se)[a] = o; }, enumerable: !0 }); - v(this, Qt).$set = /** @param {Record} next */ + v(this, se).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, Qt).$destroy = () => { - Au(v(this, Qt)); + }, v(this, se).$destroy = () => { + ku(v(this, se)); }; } /** @param {Record} props */ $set(e) { - v(this, Qt).$set(e); + v(this, se).$set(e); } /** * @param {string} event @@ -2605,22 +2605,22 @@ class Pu { * @returns {any} */ $on(e, n) { - v(this, Be)[e] = v(this, Be)[e] || []; + v(this, je)[e] = v(this, je)[e] || []; const r = (...i) => n.call(this, ...i); - return v(this, Be)[e].push(r), () => { - v(this, Be)[e] = v(this, Be)[e].filter( + return v(this, je)[e].push(r), () => { + v(this, je)[e] = v(this, je)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, Qt).$destroy(); + v(this, se).$destroy(); } } -Be = new WeakMap(), Qt = new WeakMap(); -let Ro; -typeof HTMLElement == "function" && (Ro = class extends HTMLElement { +je = new WeakMap(), se = new WeakMap(); +let ko; +typeof HTMLElement == "function" && (ko = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -2629,27 +2629,27 @@ typeof HTMLElement == "function" && (Ro = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - at(this, "$$ctor"); + st(this, "$$ctor"); /** Slots */ - at(this, "$$s"); + st(this, "$$s"); /** @type {any} The Svelte component instance */ - at(this, "$$c"); + st(this, "$$c"); /** Whether or not the custom element is connected */ - at(this, "$$cn", !1); + st(this, "$$cn", !1); /** @type {Record} Component props data */ - at(this, "$$d", {}); + st(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - at(this, "$$r", !1); + st(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - at(this, "$$p_d", {}); + st(this, "$$p_d", {}); /** @type {Record} Event listeners */ - at(this, "$$l", {}); + st(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - at(this, "$$l_u", /* @__PURE__ */ new Map()); + st(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - at(this, "$$me"); + st(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - at(this, "$$shadowRoot", null); + st(this, "$$shadowRoot", null); this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** @@ -2679,23 +2679,23 @@ typeof HTMLElement == "function" && (Ro = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const o = Cs("slot"); - s !== "default" && (o.name = s), le(a, o); + const o = Ns("slot"); + s !== "default" && (o.name = s), ge(a, o); }; }; var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = Du(this); + const r = {}, i = Yu(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] = ii(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = oi(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 = Mu({ + this.$$c = qu({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2703,14 +2703,14 @@ typeof HTMLElement == "function" && (Ro = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = fu(() => { - Ss(() => { + }), this.$$me = _u(() => { + Ms(() => { var s; this.$$r = !0; - for (const a of fi(this.$$c)) { + for (const a of di(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = ii( + const o = oi( a, this.$$d[a], this.$$p_d, @@ -2738,7 +2738,7 @@ typeof HTMLElement == "function" && (Ro = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = ii(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + this.$$r || (e = this.$$g_p(e), this.$$d[e] = oi(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2749,12 +2749,12 @@ typeof HTMLElement == "function" && (Ro = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return fi(this.$$p_d).find( + return di(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function ii(t, e, n, r) { +function oi(t, e, n, r) { var s; const i = (s = n[t]) == null ? void 0 : s.type; if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) @@ -2785,7 +2785,7 @@ function ii(t, e, n, r) { return e; } } -function Du(t) { +function Yu(t) { const e = {}; return t.childNodes.forEach((n) => { e[ @@ -2794,34 +2794,34 @@ function Du(t) { ] = !0; }), e; } -function Co(t, e, n, r, i, s) { - let a = class extends Ro { +function Mo(t, e, n, r, i, s) { + let a = class extends ko { constructor() { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return fi(e).map( + return di(e).map( (o) => (e[o].attribute || o).toLowerCase() ); } }; - return fi(e).forEach((o) => { - ci(a.prototype, o, { + return di(e).forEach((o) => { + pi(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { var h; - l = ii(o, l, e), this.$$d[o] = l; + l = oi(o, l, e), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (h = Tn(u, o)) == null ? void 0 : h.get; + var f = (h = Sn(u, o)) == null ? void 0 : h.get; f ? u[o] = l : u.$set({ [o]: l }); } } }); }), r.forEach((o) => { - ci(a.prototype, o, { + pi(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; @@ -2830,43 +2830,43 @@ function Co(t, e, n, r, i, s) { }), t.element = /** @type {any} */ a, a; } -var Fu = { value: () => { +var Hu = { value: () => { } }; -function To() { +function Po() { for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } - return new si(n); + return new li(n); } -function si(t) { +function li(t) { this._ = t; } -function Ou(t, e) { +function zu(t, e) { return t.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 && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } -si.prototype = To.prototype = { - constructor: si, +li.prototype = Po.prototype = { + constructor: li, on: function(t, e) { - var n = this._, r = Ou(t + "", n), i, s = -1, a = r.length; + var n = this._, r = zu(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Iu(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Xu(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++s < a; ) - if (i = (t = r[s]).type) n[i] = aa(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = aa(n[i], t.name, null); + if (i = (t = r[s]).type) n[i] = ca(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = ca(n[i], t.name, null); return this; }, copy: function() { var t = {}, e = this._; for (var n in e) t[n] = e[n].slice(); - return new si(t); + return new li(t); }, call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; @@ -2878,135 +2878,135 @@ si.prototype = To.prototype = { for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function Iu(t, e) { +function Xu(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } -function aa(t, e, n) { +function ca(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { - t[r] = Fu, t = t.slice(0, r).concat(t.slice(r + 1)); + t[r] = Hu, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } -var cs = "http://www.w3.org/1999/xhtml"; -const oa = { +var ds = "http://www.w3.org/1999/xhtml"; +const ha = { svg: "http://www.w3.org/2000/svg", - xhtml: cs, + xhtml: ds, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Mi(t) { +function Fi(t) { var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), oa.hasOwnProperty(e) ? { space: oa[e], local: t } : t; + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), ha.hasOwnProperty(e) ? { space: ha[e], local: t } : t; } -function Lu(t) { +function Bu(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; - return n === cs && e.documentElement.namespaceURI === cs ? e.createElement(t) : e.createElementNS(n, t); + return n === ds && e.documentElement.namespaceURI === ds ? e.createElement(t) : e.createElementNS(n, t); }; } -function qu(t) { +function Wu(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } -function No(t) { - var e = Mi(t); - return (e.local ? qu : Lu)(e); +function Do(t) { + var e = Fi(t); + return (e.local ? Wu : Bu)(e); } -function Vu() { +function Uu() { } -function Ds(t) { - return t == null ? Vu : function() { +function Is(t) { + return t == null ? Uu : function() { return this.querySelector(t); }; } -function Yu(t) { - typeof t != "function" && (t = Ds(t)); +function Gu(t) { + typeof t != "function" && (t = Is(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new Ut(r, this._parents); + return new Qt(r, this._parents); } -function Hu(t) { +function Ku(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function zu() { +function Zu() { return []; } -function So(t) { - return t == null ? zu : function() { +function Fo(t) { + return t == null ? Zu : function() { return this.querySelectorAll(t); }; } -function Xu(t) { +function ju(t) { return function() { - return Hu(t.apply(this, arguments)); + return Ku(t.apply(this, arguments)); }; } -function Bu(t) { - typeof t == "function" ? t = Xu(t) : t = So(t); +function Ju(t) { + typeof t == "function" ? t = ju(t) : t = Fo(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); - return new Ut(r, i); + return new Qt(r, i); } -function ko(t) { +function Io(t) { return function() { return this.matches(t); }; } -function Mo(t) { +function Oo(t) { return function(e) { return e.matches(t); }; } -var Wu = Array.prototype.find; -function Uu(t) { +var Qu = Array.prototype.find; +function tf(t) { return function() { - return Wu.call(this.children, t); + return Qu.call(this.children, t); }; } -function Gu() { +function ef() { return this.firstElementChild; } -function Ku(t) { - return this.select(t == null ? Gu : Uu(typeof t == "function" ? t : Mo(t))); +function nf(t) { + return this.select(t == null ? ef : tf(typeof t == "function" ? t : Oo(t))); } -var Zu = Array.prototype.filter; -function ju() { +var rf = Array.prototype.filter; +function sf() { return Array.from(this.children); } -function Ju(t) { +function af(t) { return function() { - return Zu.call(this.children, t); + return rf.call(this.children, t); }; } -function Qu(t) { - return this.selectAll(t == null ? ju : Ju(typeof t == "function" ? t : Mo(t))); +function of(t) { + return this.selectAll(t == null ? sf : af(typeof t == "function" ? t : Oo(t))); } -function tf(t) { - typeof t != "function" && (t = ko(t)); +function lf(t) { + typeof t != "function" && (t = Io(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new Ut(r, this._parents); + return new Qt(r, this._parents); } -function Po(t) { +function Lo(t) { return new Array(t.length); } -function ef() { - return new Ut(this._enter || this._groups.map(Po), this._parents); +function uf() { + return new Qt(this._enter || this._groups.map(Lo), this._parents); } -function di(t, e) { +function gi(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -di.prototype = { - constructor: di, +gi.prototype = { + constructor: gi, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -3020,70 +3020,70 @@ di.prototype = { return this._parent.querySelectorAll(t); } }; -function nf(t) { +function ff(t) { return function() { return t; }; } -function rf(t, e, n, r, i, s) { +function cf(t, e, n, r, i, s) { for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new di(t, s[a]); + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new gi(t, s[a]); for (; a < l; ++a) (o = e[a]) && (i[a] = o); } -function sf(t, e, n, r, i, s, a) { +function hf(t, e, n, r, i, s, a) { var o, l, u = /* @__PURE__ */ new Map(), f = e.length, h = s.length, c = new Array(f), p; for (o = 0; o < f; ++o) (l = e[o]) && (c[o] = p = a.call(l, l.__data__, o, e) + "", u.has(p) ? i[o] = l : u.set(p, l)); for (o = 0; o < h; ++o) - p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new di(t, s[o]); + p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new gi(t, s[o]); for (o = 0; o < f; ++o) (l = e[o]) && u.get(c[o]) === l && (i[o] = l); } -function af(t) { +function df(t) { return t.__data__; } -function of(t, e) { - if (!arguments.length) return Array.from(this, af); - var n = e ? sf : rf, r = this._parents, i = this._groups; - typeof t != "function" && (t = nf(t)); +function pf(t, e) { + if (!arguments.length) return Array.from(this, df); + var n = e ? hf : cf, r = this._parents, i = this._groups; + typeof t != "function" && (t = ff(t)); 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], h = i[u], c = h.length, p = lf(t.call(f, f && f.__data__, u, r)), g = p.length, m = o[u] = new Array(g), b = a[u] = new Array(g), $ = l[u] = new Array(c); + var f = r[u], h = i[u], c = h.length, p = vf(t.call(f, f && f.__data__, u, r)), g = p.length, m = o[u] = new Array(g), b = a[u] = new Array(g), $ = l[u] = new Array(c); n(f, h, m, b, $, p, e); - for (var R = 0, E = 0, M, C; R < g; ++R) - if (M = m[R]) { - for (R >= E && (E = R + 1); !(C = b[E]) && ++E < g; ) ; - M._next = C || null; + for (var C = 0, E = 0, S, T; C < g; ++C) + if (S = m[C]) { + for (C >= E && (E = C + 1); !(T = b[E]) && ++E < g; ) ; + S._next = T || null; } } - return a = new Ut(a, r), a._enter = o, a._exit = l, a; + return a = new Qt(a, r), a._enter = o, a._exit = l, a; } -function lf(t) { +function vf(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function uf() { - return new Ut(this._exit || this._groups.map(Po), this._parents); +function gf() { + return new Qt(this._exit || this._groups.map(Lo), this._parents); } -function ff(t, e, n) { +function _f(t, e, n) { var r = this.enter(), i = this, s = this.exit(); return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function cf(t) { +function mf(t) { for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._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], h = u.length, c = o[l] = new Array(h), p, g = 0; g < h; ++g) (p = u[g] || f[g]) && (c[g] = p); for (; l < i; ++l) o[l] = n[l]; - return new Ut(o, this._parents); + return new Qt(o, this._parents); } -function hf() { +function yf() { for (var t = this._groups, e = -1, n = t.length; ++e < n; ) for (var r = t[e], 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 df(t) { - t || (t = pf); +function wf(t) { + t || (t = xf); function e(h, c) { return h && c ? t(h.__data__, c.__data__) : !h - !c; } @@ -3092,19 +3092,19 @@ function df(t) { (u = a[f]) && (l[f] = u); l.sort(e); } - return new Ut(i, this._parents).order(); + return new Qt(i, this._parents).order(); } -function pf(t, e) { +function xf(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function vf() { +function bf() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } -function gf() { +function $f() { return Array.from(this); } -function _f() { +function Af() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length; i < s; ++i) { var a = r[i]; @@ -3112,114 +3112,114 @@ function _f() { } return null; } -function mf() { +function Ef() { let t = 0; for (const e of this) ++t; return t; } -function yf() { +function Rf() { return !this.node(); } -function wf(t) { +function Cf(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) (o = i[s]) && t.call(o, o.__data__, s, i); return this; } -function xf(t) { +function Tf(t) { return function() { this.removeAttribute(t); }; } -function bf(t) { +function Nf(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function $f(t, e) { +function Sf(t, e) { return function() { this.setAttribute(t, e); }; } -function Af(t, e) { +function kf(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } -function Ef(t, e) { +function Mf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function Rf(t, e) { +function Pf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); }; } -function Cf(t, e) { - var n = Mi(t); +function Df(t, e) { + var n = Fi(t); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((e == null ? n.local ? bf : xf : typeof e == "function" ? n.local ? Rf : Ef : n.local ? Af : $f)(n, e)); + return this.each((e == null ? n.local ? Nf : Tf : typeof e == "function" ? n.local ? Pf : Mf : n.local ? kf : Sf)(n, e)); } -function Do(t) { +function qo(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function Tf(t) { +function Ff(t) { return function() { this.style.removeProperty(t); }; } -function Nf(t, e, n) { +function If(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } -function Sf(t, e, n) { +function Of(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function kf(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? Tf : typeof e == "function" ? Sf : Nf)(t, e, n ?? "")) : fr(this.node(), t); +function Lf(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? Ff : typeof e == "function" ? Of : If)(t, e, n ?? "")) : dr(this.node(), t); } -function fr(t, e) { - return t.style.getPropertyValue(e) || Do(t).getComputedStyle(t, null).getPropertyValue(e); +function dr(t, e) { + return t.style.getPropertyValue(e) || qo(t).getComputedStyle(t, null).getPropertyValue(e); } -function Mf(t) { +function qf(t) { return function() { delete this[t]; }; } -function Pf(t, e) { +function Vf(t, e) { return function() { this[t] = e; }; } -function Df(t, e) { +function Yf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } -function Ff(t, e) { - return arguments.length > 1 ? this.each((e == null ? Mf : typeof e == "function" ? Df : Pf)(t, e)) : this.node()[t]; +function Hf(t, e) { + return arguments.length > 1 ? this.each((e == null ? qf : typeof e == "function" ? Yf : Vf)(t, e)) : this.node()[t]; } -function Fo(t) { +function Vo(t) { return t.trim().split(/^|\s+/); } -function Fs(t) { - return t.classList || new Oo(t); +function Os(t) { + return t.classList || new Yo(t); } -function Oo(t) { - this._node = t, this._names = Fo(t.getAttribute("class") || ""); +function Yo(t) { + this._node = t, this._names = Vo(t.getAttribute("class") || ""); } -Oo.prototype = { +Yo.prototype = { add: function(t) { var e = this._names.indexOf(t); e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); @@ -3232,129 +3232,129 @@ Oo.prototype = { return this._names.indexOf(t) >= 0; } }; -function Io(t, e) { - for (var n = Fs(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +function Ho(t, e) { + for (var n = Os(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function Lo(t, e) { - for (var n = Fs(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +function zo(t, e) { + for (var n = Os(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function Of(t) { +function zf(t) { return function() { - Io(this, t); + Ho(this, t); }; } -function If(t) { +function Xf(t) { return function() { - Lo(this, t); + zo(this, t); }; } -function Lf(t, e) { +function Bf(t, e) { return function() { - (e.apply(this, arguments) ? Io : Lo)(this, t); + (e.apply(this, arguments) ? Ho : zo)(this, t); }; } -function qf(t, e) { - var n = Fo(t + ""); +function Wf(t, e) { + var n = Vo(t + ""); if (arguments.length < 2) { - for (var r = Fs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Os(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? Lf : e ? Of : If)(n, e)); + return this.each((typeof e == "function" ? Bf : e ? zf : Xf)(n, e)); } -function Vf() { +function Uf() { this.textContent = ""; } -function Yf(t) { +function Gf(t) { return function() { this.textContent = t; }; } -function Hf(t) { +function Kf(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } -function zf(t) { - return arguments.length ? this.each(t == null ? Vf : (typeof t == "function" ? Hf : Yf)(t)) : this.node().textContent; +function Zf(t) { + return arguments.length ? this.each(t == null ? Uf : (typeof t == "function" ? Kf : Gf)(t)) : this.node().textContent; } -function Xf() { +function jf() { this.innerHTML = ""; } -function Bf(t) { +function Jf(t) { return function() { this.innerHTML = t; }; } -function Wf(t) { +function Qf(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } -function Uf(t) { - return arguments.length ? this.each(t == null ? Xf : (typeof t == "function" ? Wf : Bf)(t)) : this.node().innerHTML; +function tc(t) { + return arguments.length ? this.each(t == null ? jf : (typeof t == "function" ? Qf : Jf)(t)) : this.node().innerHTML; } -function Gf() { +function ec() { this.nextSibling && this.parentNode.appendChild(this); } -function Kf() { - return this.each(Gf); +function nc() { + return this.each(ec); } -function Zf() { +function rc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function jf() { - return this.each(Zf); +function ic() { + return this.each(rc); } -function Jf(t) { - var e = typeof t == "function" ? t : No(t); +function sc(t) { + var e = typeof t == "function" ? t : Do(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function Qf() { +function ac() { return null; } -function tc(t, e) { - var n = typeof t == "function" ? t : No(t), r = e == null ? Qf : typeof e == "function" ? e : Ds(e); +function oc(t, e) { + var n = typeof t == "function" ? t : Do(t), r = e == null ? ac : typeof e == "function" ? e : Is(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function ec() { +function lc() { var t = this.parentNode; t && t.removeChild(this); } -function nc() { - return this.each(ec); +function uc() { + return this.each(lc); } -function rc() { +function fc() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function ic() { +function cc() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function sc(t) { - return this.select(t ? ic : rc); +function hc(t) { + return this.select(t ? cc : fc); } -function ac(t) { +function dc(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } -function oc(t) { +function pc(t) { return function(e) { t.call(this, e, this.__data__); }; } -function lc(t) { +function vc(t) { return t.trim().split(/^|\s+/).map(function(e) { var n = "", r = e.indexOf("."); return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n }; }); } -function uc(t) { +function gc(t) { return function() { var e = this.__on; if (e) { @@ -3364,9 +3364,9 @@ function uc(t) { } }; } -function fc(t, e, n) { +function _c(t, e, n) { return function() { - var r = this.__on, i, s = oc(e); + var r = this.__on, i, s = pc(e); if (r) { for (var a = 0, o = r.length; a < o; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { @@ -3377,8 +3377,8 @@ function fc(t, e, n) { this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function cc(t, e, n) { - var r = lc(t + ""), i, s = r.length, a; +function mc(t, e, n) { + var r = vc(t + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3389,93 +3389,93 @@ function cc(t, e, n) { } return; } - for (o = e ? fc : uc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + for (o = e ? _c : gc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); return this; } -function qo(t, e, n) { - var r = Do(t), i = r.CustomEvent; +function Xo(t, e, n) { + var r = qo(t), i = r.CustomEvent; typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); } -function hc(t, e) { +function yc(t, e) { return function() { - return qo(this, t, e); + return Xo(this, t, e); }; } -function dc(t, e) { +function wc(t, e) { return function() { - return qo(this, t, e.apply(this, arguments)); + return Xo(this, t, e.apply(this, arguments)); }; } -function pc(t, e) { - return this.each((typeof e == "function" ? dc : hc)(t, e)); +function xc(t, e) { + return this.each((typeof e == "function" ? wc : yc)(t, e)); } -function* vc() { +function* bc() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var Vo = [null]; -function Ut(t, e) { +var Bo = [null]; +function Qt(t, e) { this._groups = t, this._parents = e; } -function pr() { - return new Ut([[document.documentElement]], Vo); +function _r() { + return new Qt([[document.documentElement]], Bo); } -function gc() { +function $c() { return this; } -Ut.prototype = pr.prototype = { - constructor: Ut, - select: Yu, - selectAll: Bu, - selectChild: Ku, - selectChildren: Qu, - filter: tf, - data: of, - enter: ef, - exit: uf, - join: ff, - merge: cf, - selection: gc, - order: hf, - sort: df, - call: vf, - nodes: gf, - node: _f, - size: mf, - empty: yf, - each: wf, - attr: Cf, - style: kf, - property: Ff, - classed: qf, - text: zf, - html: Uf, - raise: Kf, - lower: jf, - append: Jf, - insert: tc, - remove: nc, - clone: sc, - datum: ac, - on: cc, - dispatch: pc, - [Symbol.iterator]: vc +Qt.prototype = _r.prototype = { + constructor: Qt, + select: Gu, + selectAll: Ju, + selectChild: nf, + selectChildren: of, + filter: lf, + data: pf, + enter: uf, + exit: gf, + join: _f, + merge: mf, + selection: $c, + order: yf, + sort: wf, + call: bf, + nodes: $f, + node: Af, + size: Ef, + empty: Rf, + each: Cf, + attr: Df, + style: Lf, + property: Hf, + classed: Wf, + text: Zf, + html: tc, + raise: nc, + lower: ic, + append: sc, + insert: oc, + remove: uc, + clone: hc, + datum: dc, + on: mc, + dispatch: xc, + [Symbol.iterator]: bc }; -function xt(t) { - return typeof t == "string" ? new Ut([[document.querySelector(t)]], [document.documentElement]) : new Ut([[t]], Vo); +function _t(t) { + return typeof t == "string" ? new Qt([[document.querySelector(t)]], [document.documentElement]) : new Qt([[t]], Bo); } -function Os(t, e, n) { +function Ls(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } -function Yo(t, e) { +function Wo(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } -function zr() { +function Wr() { } -var Mr = 0.7, pi = 1 / Mr, Kn = "\\s*([+-]?\\d+)\\s*", Pr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Te = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", _c = /^#([0-9a-f]{3,8})$/, mc = new RegExp(`^rgb\\(${Kn},${Kn},${Kn}\\)$`), yc = new RegExp(`^rgb\\(${Te},${Te},${Te}\\)$`), wc = new RegExp(`^rgba\\(${Kn},${Kn},${Kn},${Pr}\\)$`), xc = new RegExp(`^rgba\\(${Te},${Te},${Te},${Pr}\\)$`), bc = new RegExp(`^hsl\\(${Pr},${Te},${Te}\\)$`), $c = new RegExp(`^hsla\\(${Pr},${Te},${Te},${Pr}\\)$`), la = { +var Fr = 0.7, _i = 1 / Fr, Jn = "\\s*([+-]?\\d+)\\s*", Ir = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Pe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Ac = /^#([0-9a-f]{3,8})$/, Ec = new RegExp(`^rgb\\(${Jn},${Jn},${Jn}\\)$`), Rc = new RegExp(`^rgb\\(${Pe},${Pe},${Pe}\\)$`), Cc = new RegExp(`^rgba\\(${Jn},${Jn},${Jn},${Ir}\\)$`), Tc = new RegExp(`^rgba\\(${Pe},${Pe},${Pe},${Ir}\\)$`), Nc = new RegExp(`^hsl\\(${Ir},${Pe},${Pe}\\)$`), Sc = new RegExp(`^hsla\\(${Ir},${Pe},${Pe},${Ir}\\)$`), da = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3625,178 +3625,178 @@ var Mr = 0.7, pi = 1 / Mr, Kn = "\\s*([+-]?\\d+)\\s*", Pr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Os(zr, In, { +Ls(Wr, qn, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, - hex: ua, + hex: pa, // Deprecated! Use color.formatHex. - formatHex: ua, - formatHex8: Ac, - formatHsl: Ec, - formatRgb: fa, - toString: fa + formatHex: pa, + formatHex8: kc, + formatHsl: Mc, + formatRgb: va, + toString: va }); -function ua() { +function pa() { return this.rgb().formatHex(); } -function Ac() { +function kc() { return this.rgb().formatHex8(); } -function Ec() { - return Ho(this).formatHsl(); +function Mc() { + return Uo(this).formatHsl(); } -function fa() { +function va() { return this.rgb().formatRgb(); } -function In(t) { +function qn(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = _c.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? ca(e) : n === 3 ? new It(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Zr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Zr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = mc.exec(t)) ? new It(e[1], e[2], e[3], 1) : (e = yc.exec(t)) ? new It(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = wc.exec(t)) ? Zr(e[1], e[2], e[3], e[4]) : (e = xc.exec(t)) ? Zr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = bc.exec(t)) ? pa(e[1], e[2] / 100, e[3] / 100, 1) : (e = $c.exec(t)) ? pa(e[1], e[2] / 100, e[3] / 100, e[4]) : la.hasOwnProperty(t) ? ca(la[t]) : t === "transparent" ? new It(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = Ac.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? ga(e) : n === 3 ? new Ht(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Qr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Qr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Ec.exec(t)) ? new Ht(e[1], e[2], e[3], 1) : (e = Rc.exec(t)) ? new Ht(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Cc.exec(t)) ? Qr(e[1], e[2], e[3], e[4]) : (e = Tc.exec(t)) ? Qr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Nc.exec(t)) ? ya(e[1], e[2] / 100, e[3] / 100, 1) : (e = Sc.exec(t)) ? ya(e[1], e[2] / 100, e[3] / 100, e[4]) : da.hasOwnProperty(t) ? ga(da[t]) : t === "transparent" ? new Ht(NaN, NaN, NaN, 0) : null; } -function ca(t) { - return new It(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +function ga(t) { + return new Ht(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function Zr(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new It(t, e, n, r); +function Qr(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new Ht(t, e, n, r); } -function Rc(t) { - return t instanceof zr || (t = In(t)), t ? (t = t.rgb(), new It(t.r, t.g, t.b, t.opacity)) : new It(); +function Pc(t) { + return t instanceof Wr || (t = qn(t)), t ? (t = t.rgb(), new Ht(t.r, t.g, t.b, t.opacity)) : new Ht(); } -function hs(t, e, n, r) { - return arguments.length === 1 ? Rc(t) : new It(t, e, n, r ?? 1); +function ps(t, e, n, r) { + return arguments.length === 1 ? Pc(t) : new Ht(t, e, n, r ?? 1); } -function It(t, e, n, r) { +function Ht(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -Os(It, hs, Yo(zr, { +Ls(Ht, ps, Wo(Wr, { brighter(t) { - return t = t == null ? pi : Math.pow(pi, t), new It(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? _i : Math.pow(_i, t), new Ht(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? Mr : Math.pow(Mr, t), new It(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Fr : Math.pow(Fr, t), new Ht(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new It(Mn(this.r), Mn(this.g), Mn(this.b), vi(this.opacity)); + return new Ht(Dn(this.r), Dn(this.g), Dn(this.b), mi(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: ha, + hex: _a, // Deprecated! Use color.formatHex. - formatHex: ha, - formatHex8: Cc, - formatRgb: da, - toString: da + formatHex: _a, + formatHex8: Dc, + formatRgb: ma, + toString: ma })); -function ha() { - return `#${xn(this.r)}${xn(this.g)}${xn(this.b)}`; +function _a() { + return `#${$n(this.r)}${$n(this.g)}${$n(this.b)}`; } -function Cc() { - return `#${xn(this.r)}${xn(this.g)}${xn(this.b)}${xn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function Dc() { + return `#${$n(this.r)}${$n(this.g)}${$n(this.b)}${$n((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function da() { - const t = vi(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${Mn(this.r)}, ${Mn(this.g)}, ${Mn(this.b)}${t === 1 ? ")" : `, ${t})`}`; +function ma() { + const t = mi(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${Dn(this.r)}, ${Dn(this.g)}, ${Dn(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function vi(t) { +function mi(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function Mn(t) { +function Dn(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function xn(t) { - return t = Mn(t), (t < 16 ? "0" : "") + t.toString(16); +function $n(t) { + return t = Dn(t), (t < 16 ? "0" : "") + t.toString(16); } -function pa(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new fe(t, e, n, r); +function ya(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new me(t, e, n, r); } -function Ho(t) { - if (t instanceof fe) return new fe(t.h, t.s, t.l, t.opacity); - if (t instanceof zr || (t = In(t)), !t) return new fe(); - if (t instanceof fe) return t; +function Uo(t) { + if (t instanceof me) return new me(t.h, t.s, t.l, t.opacity); + if (t instanceof Wr || (t = qn(t)), !t) return new me(); + if (t instanceof me) return t; t = t.rgb(); var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new fe(a, o, l, t.opacity); + return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new me(a, o, l, t.opacity); } -function Tc(t, e, n, r) { - return arguments.length === 1 ? Ho(t) : new fe(t, e, n, r ?? 1); +function Fc(t, e, n, r) { + return arguments.length === 1 ? Uo(t) : new me(t, e, n, r ?? 1); } -function fe(t, e, n, r) { +function me(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -Os(fe, Tc, Yo(zr, { +Ls(me, Fc, Wo(Wr, { brighter(t) { - return t = t == null ? pi : Math.pow(pi, t), new fe(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? _i : Math.pow(_i, t), new me(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? Mr : Math.pow(Mr, t), new fe(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Fr : Math.pow(Fr, t), new me(this.h, this.s, this.l * t, this.opacity); }, rgb() { var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; - return new It( - Gi(t >= 240 ? t - 240 : t + 120, i, r), - Gi(t, i, r), - Gi(t < 120 ? t + 240 : t - 120, i, r), + return new Ht( + Zi(t >= 240 ? t - 240 : t + 120, i, r), + Zi(t, i, r), + Zi(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new fe(va(this.h), jr(this.s), jr(this.l), vi(this.opacity)); + return new me(wa(this.h), ti(this.s), ti(this.l), mi(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 t = vi(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${va(this.h)}, ${jr(this.s) * 100}%, ${jr(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = mi(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${wa(this.h)}, ${ti(this.s) * 100}%, ${ti(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function va(t) { +function wa(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function jr(t) { +function ti(t) { return Math.max(0, Math.min(1, t || 0)); } -function Gi(t, e, n) { +function Zi(t, e, n) { return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; } -const Is = (t) => () => t; -function Nc(t, e) { +const qs = (t) => () => t; +function Ic(t, e) { return function(n) { return t + n * e; }; } -function Sc(t, e, n) { +function Oc(t, e, n) { return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) { return Math.pow(t + r * e, n); }; } -function kc(t) { - return (t = +t) == 1 ? zo : function(e, n) { - return n - e ? Sc(e, n, t) : Is(isNaN(e) ? n : e); +function Lc(t) { + return (t = +t) == 1 ? Go : function(e, n) { + return n - e ? Oc(e, n, t) : qs(isNaN(e) ? n : e); }; } -function zo(t, e) { +function Go(t, e) { var n = e - t; - return n ? Nc(t, n) : Is(isNaN(t) ? e : t); + return n ? Ic(t, n) : qs(isNaN(t) ? e : t); } -const gi = (function t(e) { - var n = kc(e); +const yi = (function t(e) { + var n = Lc(e); function r(i, s) { - var a = n((i = hs(i)).r, (s = hs(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = zo(i.opacity, s.opacity); + var a = n((i = ps(i)).r, (s = ps(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Go(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 = t, r; })(1); -function Mc(t, e) { +function qc(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { @@ -3804,64 +3804,64 @@ function Mc(t, e) { return r; }; } -function Pc(t) { +function Vc(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function Dc(t, e) { +function Yc(t, e) { var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Un(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = Zn(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function Fc(t, e) { +function Hc(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; }; } -function Ce(t, e) { +function Me(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } -function Oc(t, e) { +function zc(t, e) { var n = {}, r = {}, i; (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); for (i in e) - i in t ? n[i] = Un(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = Zn(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var ds = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Ki = new RegExp(ds.source, "g"); -function Ic(t) { +var vs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ji = new RegExp(vs.source, "g"); +function Xc(t) { return function() { return t; }; } -function Lc(t) { +function Bc(t) { return function(e) { return t(e) + ""; }; } -function Xo(t, e) { - var n = ds.lastIndex = Ki.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = ds.exec(t)) && (i = Ki.exec(e)); ) - (s = i.index) > n && (s = e.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: Ce(r, i) })), n = Ki.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Lc(l[0].x) : Ic(e) : (e = l.length, function(u) { +function Ko(t, e) { + var n = vs.lastIndex = ji.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (t = t + "", e = e + ""; (r = vs.exec(t)) && (i = ji.exec(e)); ) + (s = i.index) > n && (s = e.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: Me(r, i) })), n = ji.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Bc(l[0].x) : Xc(e) : (e = l.length, function(u) { for (var f = 0, h; f < e; ++f) o[(h = l[f]).i] = h.x(u); return o.join(""); }); } -function Un(t, e) { +function Zn(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? Is(e) : (n === "number" ? Ce : n === "string" ? (r = In(e)) ? (e = r, gi) : Xo : e instanceof In ? gi : e instanceof Date ? Fc : Pc(e) ? Mc : Array.isArray(e) ? Dc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Oc : Ce)(t, e); + return e == null || n === "boolean" ? qs(e) : (n === "number" ? Me : n === "string" ? (r = qn(e)) ? (e = r, yi) : Ko : e instanceof qn ? yi : e instanceof Date ? Hc : Vc(e) ? qc : Array.isArray(e) ? Yc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? zc : Me)(t, e); } -var ga = 180 / Math.PI, ps = { +var xa = 180 / Math.PI, gs = { translateX: 0, translateY: 0, rotate: 0, @@ -3869,45 +3869,45 @@ var ga = 180 / Math.PI, ps = { scaleX: 1, scaleY: 1 }; -function Bo(t, e, n, r, i, s) { +function Zo(t, e, n, r, i, s) { var a, o, l; return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(e, t) * ga, - skewX: Math.atan(l) * ga, + rotate: Math.atan2(e, t) * xa, + skewX: Math.atan(l) * xa, scaleX: a, scaleY: o }; } -var Jr; -function qc(t) { +var ei; +function Wc(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? ps : Bo(e.a, e.b, e.c, e.d, e.e, e.f); + return e.isIdentity ? gs : Zo(e.a, e.b, e.c, e.d, e.e, e.f); } -function Vc(t) { - return t == null || (Jr || (Jr = document.createElementNS("http://www.w3.org/2000/svg", "g")), Jr.setAttribute("transform", t), !(t = Jr.transform.baseVal.consolidate())) ? ps : (t = t.matrix, Bo(t.a, t.b, t.c, t.d, t.e, t.f)); +function Uc(t) { + return t == null || (ei || (ei = document.createElementNS("http://www.w3.org/2000/svg", "g")), ei.setAttribute("transform", t), !(t = ei.transform.baseVal.consolidate())) ? gs : (t = t.matrix, Zo(t.a, t.b, t.c, t.d, t.e, t.f)); } -function Wo(t, e, n, r) { +function jo(t, e, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } function s(u, f, h, c, p, g) { if (u !== h || f !== c) { var m = p.push("translate(", null, e, null, n); - g.push({ i: m - 4, x: Ce(u, h) }, { i: m - 2, x: Ce(f, c) }); + g.push({ i: m - 4, x: Me(u, h) }, { i: m - 2, x: Me(f, c) }); } else (h || c) && p.push("translate(" + h + e + c + n); } function a(u, f, h, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Ce(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Me(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); } function o(u, f, h, c) { - u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Ce(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); + u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Me(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); } function l(u, f, h, c, p, g) { if (u !== h || f !== c) { var m = p.push(i(p) + "scale(", null, ",", null, ")"); - g.push({ i: m - 4, x: Ce(u, h) }, { i: m - 2, x: Ce(f, c) }); + g.push({ i: m - 4, x: Me(u, h) }, { i: m - 2, x: Me(f, c) }); } else (h !== 1 || c !== 1) && p.push(i(p) + "scale(" + h + "," + c + ")"); } return function(u, f) { @@ -3918,138 +3918,138 @@ function Wo(t, e, n, r) { }; }; } -var Yc = Wo(qc, "px, ", "px)", "deg)"), Hc = Wo(Vc, ", ", ")", ")"), cr = 0, Ar = 0, br = 0, Uo = 1e3, _i, Er, mi = 0, Ln = 0, Pi = 0, Dr = typeof performance == "object" && performance.now ? performance : Date, Go = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Gc = jo(Wc, "px, ", "px)", "deg)"), Kc = jo(Uc, ", ", ")", ")"), pr = 0, Cr = 0, Er = 0, Jo = 1e3, wi, Tr, xi = 0, Vn = 0, Ii = 0, Or = typeof performance == "object" && performance.now ? performance : Date, Qo = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; -function Ls() { - return Ln || (Go(zc), Ln = Dr.now() + Pi); +function Vs() { + return Vn || (Qo(Zc), Vn = Or.now() + Ii); } -function zc() { - Ln = 0; +function Zc() { + Vn = 0; } -function yi() { +function bi() { this._call = this._time = this._next = null; } -yi.prototype = Ko.prototype = { - constructor: yi, +bi.prototype = tl.prototype = { + constructor: bi, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Ls() : +n) + (e == null ? 0 : +e), !this._next && Er !== this && (Er ? Er._next = this : _i = this, Er = this), this._call = t, this._time = n, vs(); + n = (n == null ? Vs() : +n) + (e == null ? 0 : +e), !this._next && Tr !== this && (Tr ? Tr._next = this : wi = this, Tr = this), this._call = t, this._time = n, _s(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, vs()); + this._call && (this._call = null, this._time = 1 / 0, _s()); } }; -function Ko(t, e, n) { - var r = new yi(); +function tl(t, e, n) { + var r = new bi(); return r.restart(t, e, n), r; } -function Xc() { - Ls(), ++cr; - for (var t = _i, e; t; ) - (e = Ln - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --cr; +function jc() { + Vs(), ++pr; + for (var t = wi, e; t; ) + (e = Vn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --pr; } -function _a() { - Ln = (mi = Dr.now()) + Pi, cr = Ar = 0; +function ba() { + Vn = (xi = Or.now()) + Ii, pr = Cr = 0; try { - Xc(); + jc(); } finally { - cr = 0, Wc(), Ln = 0; + pr = 0, Qc(), Vn = 0; } } -function Bc() { - var t = Dr.now(), e = t - mi; - e > Uo && (Pi -= e, mi = t); +function Jc() { + var t = Or.now(), e = t - xi; + e > Jo && (Ii -= e, xi = t); } -function Wc() { - for (var t, e = _i, n, r = 1 / 0; e; ) - e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : _i = n); - Er = t, vs(r); +function Qc() { + for (var t, e = wi, n, r = 1 / 0; e; ) + e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : wi = n); + Tr = t, _s(r); } -function vs(t) { - if (!cr) { - Ar && (Ar = clearTimeout(Ar)); - var e = t - Ln; - e > 24 ? (t < 1 / 0 && (Ar = setTimeout(_a, t - Dr.now() - Pi)), br && (br = clearInterval(br))) : (br || (mi = Dr.now(), br = setInterval(Bc, Uo)), cr = 1, Go(_a)); +function _s(t) { + if (!pr) { + Cr && (Cr = clearTimeout(Cr)); + var e = t - Vn; + e > 24 ? (t < 1 / 0 && (Cr = setTimeout(ba, t - Or.now() - Ii)), Er && (Er = clearInterval(Er))) : (Er || (xi = Or.now(), Er = setInterval(Jc, Jo)), pr = 1, Qo(ba)); } } -function ma(t, e, n) { - var r = new yi(); +function $a(t, e, n) { + var r = new bi(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var Uc = To("start", "end", "cancel", "interrupt"), Gc = [], Zo = 0, ya = 1, gs = 2, ai = 3, wa = 4, _s = 5, oi = 6; -function Di(t, e, n, r, i, s) { +var th = Po("start", "end", "cancel", "interrupt"), eh = [], el = 0, Aa = 1, ms = 2, ui = 3, Ea = 4, ys = 5, fi = 6; +function Oi(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - Kc(t, n, { + nh(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. - on: Uc, - tween: Gc, + on: th, + tween: eh, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: Zo + state: el }); } -function qs(t, e) { - var n = ve(t, e); - if (n.state > Zo) throw new Error("too late; already scheduled"); +function Ys(t, e) { + var n = $e(t, e); + if (n.state > el) throw new Error("too late; already scheduled"); return n; } -function Pe(t, e) { - var n = ve(t, e); - if (n.state > ai) throw new Error("too late; already running"); +function Le(t, e) { + var n = $e(t, e); + if (n.state > ui) throw new Error("too late; already running"); return n; } -function ve(t, e) { +function $e(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Kc(t, e, n) { +function nh(t, e, n) { var r = t.__transition, i; - r[e] = n, n.timer = Ko(s, 0, n.time); + r[e] = n, n.timer = tl(s, 0, n.time); function s(u) { - n.state = ya, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = Aa, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { var f, h, c, p; - if (n.state !== ya) return l(); + if (n.state !== Aa) return l(); for (f in r) if (p = r[f], p.name === n.name) { - if (p.state === ai) return ma(a); - p.state === wa ? (p.state = oi, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = oi, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); + if (p.state === ui) return $a(a); + p.state === Ea ? (p.state = fi, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = fi, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); } - if (ma(function() { - n.state === ai && (n.state = wa, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = gs, n.on.call("start", t, t.__data__, n.index, n.group), n.state === gs) { - for (n.state = ai, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) + if ($a(function() { + n.state === ui && (n.state = Ea, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = ms, n.on.call("start", t, t.__data__, n.index, n.group), n.state === ms) { + for (n.state = ui, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) (p = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = p); i.length = h + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = _s, 1), h = -1, c = i.length; ++h < c; ) + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = ys, 1), h = -1, c = i.length; ++h < c; ) i[h].call(t, f); - n.state === _s && (n.on.call("end", t, t.__data__, n.index, n.group), l()); + n.state === ys && (n.on.call("end", t, t.__data__, n.index, n.group), l()); } function l() { - n.state = oi, n.timer.stop(), delete r[e]; + n.state = fi, n.timer.stop(), delete r[e]; for (var u in r) return; delete t.__transition; } } -function Zc(t, e) { +function rh(t, e) { var n = t.__transition, r, i, s = !0, a; if (n) { e = e == null ? null : e + ""; @@ -4058,20 +4058,20 @@ function Zc(t, e) { s = !1; continue; } - i = r.state > gs && r.state < _s, r.state = oi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > ms && r.state < ys, r.state = fi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } -function jc(t) { +function ih(t) { return this.each(function() { - Zc(this, t); + rh(this, t); }); } -function Jc(t, e) { +function sh(t, e) { var n, r; return function() { - var i = Pe(this, t), s = i.tween; + var i = Le(this, t), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) @@ -4083,11 +4083,11 @@ function Jc(t, e) { i.tween = r; }; } -function Qc(t, e, n) { +function ah(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Pe(this, t), a = s.tween; + var s = Le(this, t), a = s.tween; if (a !== r) { i = (r = a).slice(); for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) @@ -4100,417 +4100,417 @@ function Qc(t, e, n) { s.tween = i; }; } -function th(t, e) { +function oh(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = ve(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = $e(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) if ((a = r[i]).name === t) return a.value; return null; } - return this.each((e == null ? Jc : Qc)(n, t, e)); + return this.each((e == null ? sh : ah)(n, t, e)); } -function Vs(t, e, n) { +function Hs(t, e, n) { var r = t._id; return t.each(function() { - var i = Pe(this, r); + var i = Le(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return ve(i, r).value[e]; + return $e(i, r).value[e]; }; } -function jo(t, e) { +function nl(t, e) { var n; - return (typeof e == "number" ? Ce : e instanceof In ? gi : (n = In(e)) ? (e = n, gi) : Xo)(t, e); + return (typeof e == "number" ? Me : e instanceof qn ? yi : (n = qn(e)) ? (e = n, yi) : Ko)(t, e); } -function eh(t) { +function lh(t) { return function() { this.removeAttribute(t); }; } -function nh(t) { +function uh(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function rh(t, e, n) { +function fh(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttribute(t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function ih(t, e, n) { +function ch(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttributeNS(t.space, t.local); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function sh(t, e, n) { +function hh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function ah(t, e, n) { +function dh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function oh(t, e) { - var n = Mi(t), r = n === "transform" ? Hc : jo; - return this.attrTween(t, typeof e == "function" ? (n.local ? ah : sh)(n, r, Vs(this, "attr." + t, e)) : e == null ? (n.local ? nh : eh)(n) : (n.local ? ih : rh)(n, r, e)); +function ph(t, e) { + var n = Fi(t), r = n === "transform" ? Kc : nl; + return this.attrTween(t, typeof e == "function" ? (n.local ? dh : hh)(n, r, Hs(this, "attr." + t, e)) : e == null ? (n.local ? uh : lh)(n) : (n.local ? ch : fh)(n, r, e)); } -function lh(t, e) { +function vh(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function uh(t, e) { +function gh(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function fh(t, e) { +function _h(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && uh(t, s)), n; + return s !== r && (n = (r = s) && gh(t, s)), n; } return i._value = e, i; } -function ch(t, e) { +function mh(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && lh(t, s)), n; + return s !== r && (n = (r = s) && vh(t, s)), n; } return i._value = e, i; } -function hh(t, e) { +function yh(t, e) { var n = "attr." + t; if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (e == null) return this.tween(n, null); if (typeof e != "function") throw new Error(); - var r = Mi(t); - return this.tween(n, (r.local ? fh : ch)(r, e)); + var r = Fi(t); + return this.tween(n, (r.local ? _h : mh)(r, e)); } -function dh(t, e) { +function wh(t, e) { return function() { - qs(this, t).delay = +e.apply(this, arguments); + Ys(this, t).delay = +e.apply(this, arguments); }; } -function ph(t, e) { +function xh(t, e) { return e = +e, function() { - qs(this, t).delay = e; + Ys(this, t).delay = e; }; } -function vh(t) { +function bh(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? dh : ph)(e, t)) : ve(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? wh : xh)(e, t)) : $e(this.node(), e).delay; } -function gh(t, e) { +function $h(t, e) { return function() { - Pe(this, t).duration = +e.apply(this, arguments); + Le(this, t).duration = +e.apply(this, arguments); }; } -function _h(t, e) { +function Ah(t, e) { return e = +e, function() { - Pe(this, t).duration = e; + Le(this, t).duration = e; }; } -function mh(t) { +function Eh(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? gh : _h)(e, t)) : ve(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? $h : Ah)(e, t)) : $e(this.node(), e).duration; } -function yh(t, e) { +function Rh(t, e) { if (typeof e != "function") throw new Error(); return function() { - Pe(this, t).ease = e; + Le(this, t).ease = e; }; } -function wh(t) { +function Ch(t) { var e = this._id; - return arguments.length ? this.each(yh(e, t)) : ve(this.node(), e).ease; + return arguments.length ? this.each(Rh(e, t)) : $e(this.node(), e).ease; } -function xh(t, e) { +function Th(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - Pe(this, t).ease = n; + Le(this, t).ease = n; }; } -function bh(t) { +function Nh(t) { if (typeof t != "function") throw new Error(); - return this.each(xh(this._id, t)); + return this.each(Th(this._id, t)); } -function $h(t) { - typeof t != "function" && (t = ko(t)); +function Sh(t) { + typeof t != "function" && (t = Io(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new Ke(r, this._parents, this._name, this._id); + return new en(r, this._parents, this._name, this._id); } -function Ah(t) { +function kh(t) { if (t._id !== this._id) throw new Error(); for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) for (var l = e[o], u = n[o], f = l.length, h = a[o] = new Array(f), c, p = 0; p < f; ++p) (c = l[p] || u[p]) && (h[p] = c); for (; o < r; ++o) a[o] = e[o]; - return new Ke(a, this._parents, this._name, this._id); + return new en(a, this._parents, this._name, this._id); } -function Eh(t) { +function Mh(t) { return (t + "").trim().split(/^|\s+/).every(function(e) { var n = e.indexOf("."); return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; }); } -function Rh(t, e, n) { - var r, i, s = Eh(e) ? qs : Pe; +function Ph(t, e, n) { + var r, i, s = Mh(e) ? Ys : Le; return function() { var a = s(this, t), o = a.on; o !== r && (i = (r = o).copy()).on(e, n), a.on = i; }; } -function Ch(t, e) { +function Dh(t, e) { var n = this._id; - return arguments.length < 2 ? ve(this.node(), n).on.on(t) : this.each(Rh(n, t, e)); + return arguments.length < 2 ? $e(this.node(), n).on.on(t) : this.each(Ph(n, t, e)); } -function Th(t) { +function Fh(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } -function Nh() { - return this.on("end.remove", Th(this._id)); +function Ih() { + return this.on("end.remove", Fh(this._id)); } -function Sh(t) { +function Oh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = Ds(t)); + typeof t != "function" && (t = Is(t)); 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, h, c = 0; c < l; ++c) - (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Di(u[c], e, n, c, u, ve(f, n))); - return new Ke(s, this._parents, e, n); + (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Oi(u[c], e, n, c, u, $e(f, n))); + return new en(s, this._parents, e, n); } -function kh(t) { +function Lh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = So(t)); + typeof t != "function" && (t = Fo(t)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) for (var l = r[o], u = l.length, f, h = 0; h < u; ++h) if (f = l[h]) { - for (var c = t.call(f, f.__data__, h, l), p, g = ve(f, n), m = 0, b = c.length; m < b; ++m) - (p = c[m]) && Di(p, e, n, m, c, g); + for (var c = t.call(f, f.__data__, h, l), p, g = $e(f, n), m = 0, b = c.length; m < b; ++m) + (p = c[m]) && Oi(p, e, n, m, c, g); s.push(c), a.push(f); } - return new Ke(s, a, e, n); + return new en(s, a, e, n); } -var Mh = pr.prototype.constructor; -function Ph() { - return new Mh(this._groups, this._parents); +var qh = _r.prototype.constructor; +function Vh() { + return new qh(this._groups, this._parents); } -function Dh(t, e) { +function Yh(t, e) { var n, r, i; return function() { - var s = fr(this, t), a = (this.style.removeProperty(t), fr(this, t)); + var s = dr(this, t), a = (this.style.removeProperty(t), dr(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function Jo(t) { +function rl(t) { return function() { this.style.removeProperty(t); }; } -function Fh(t, e, n) { +function Hh(t, e, n) { var r, i = n + "", s; return function() { - var a = fr(this, t); + var a = dr(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function Oh(t, e, n) { +function zh(t, e, n) { var r, i, s; return function() { - var a = fr(this, t), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(t), fr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + var a = dr(this, t), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(t), dr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); }; } -function Ih(t, e) { +function Xh(t, e) { var n, r, i, s = "style." + e, a = "end." + s, o; return function() { - var l = Pe(this, t), u = l.on, f = l.value[s] == null ? o || (o = Jo(e)) : void 0; + var l = Le(this, t), u = l.on, f = l.value[s] == null ? o || (o = rl(e)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function Lh(t, e, n) { - var r = (t += "") == "transform" ? Yc : jo; - return e == null ? this.styleTween(t, Dh(t, r)).on("end.style." + t, Jo(t)) : typeof e == "function" ? this.styleTween(t, Oh(t, r, Vs(this, "style." + t, e))).each(Ih(this._id, t)) : this.styleTween(t, Fh(t, r, e), n).on("end.style." + t, null); +function Bh(t, e, n) { + var r = (t += "") == "transform" ? Gc : nl; + return e == null ? this.styleTween(t, Yh(t, r)).on("end.style." + t, rl(t)) : typeof e == "function" ? this.styleTween(t, zh(t, r, Hs(this, "style." + t, e))).each(Xh(this._id, t)) : this.styleTween(t, Hh(t, r, e), n).on("end.style." + t, null); } -function qh(t, e, n) { +function Wh(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } -function Vh(t, e, n) { +function Uh(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && qh(t, a, n)), r; + return a !== i && (r = (i = a) && Wh(t, a, n)), r; } return s._value = e, s; } -function Yh(t, e, n) { +function Gh(t, e, n) { var r = "style." + (t += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; if (e == null) return this.tween(r, null); if (typeof e != "function") throw new Error(); - return this.tween(r, Vh(t, e, n ?? "")); + return this.tween(r, Uh(t, e, n ?? "")); } -function Hh(t) { +function Kh(t) { return function() { this.textContent = t; }; } -function zh(t) { +function Zh(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function Xh(t) { - return this.tween("text", typeof t == "function" ? zh(Vs(this, "text", t)) : Hh(t == null ? "" : t + "")); +function jh(t) { + return this.tween("text", typeof t == "function" ? Zh(Hs(this, "text", t)) : Kh(t == null ? "" : t + "")); } -function Bh(t) { +function Jh(t) { return function(e) { this.textContent = t.call(this, e); }; } -function Wh(t) { +function Qh(t) { var e, n; function r() { var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && Bh(i)), e; + return i !== n && (e = (n = i) && Jh(i)), e; } return r._value = t, r; } -function Uh(t) { +function td(t) { var e = "text"; if (arguments.length < 1) return (e = this.tween(e)) && e._value; if (t == null) return this.tween(e, null); if (typeof t != "function") throw new Error(); - return this.tween(e, Wh(t)); + return this.tween(e, Qh(t)); } -function Gh() { - for (var t = this._name, e = this._id, n = Qo(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function ed() { + for (var t = this._name, e = this._id, n = il(), 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 = ve(l, e); - Di(l, t, n, u, a, { + var f = $e(l, e); + Oi(l, t, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new Ke(r, this._parents, t, n); + return new en(r, this._parents, t, n); } -function Kh() { +function nd() { var t, e, 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 = Pe(this, r), f = u.on; + var u = Le(this, r), f = u.on; f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; }), i === 0 && s(); }); } -var Zh = 0; -function Ke(t, e, n, r) { +var rd = 0; +function en(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function li(t) { - return pr().transition(t); -} -function Qo() { - return ++Zh; -} -var qe = pr.prototype; -Ke.prototype = li.prototype = { - constructor: Ke, - select: Sh, - selectAll: kh, - selectChild: qe.selectChild, - selectChildren: qe.selectChildren, - filter: $h, - merge: Ah, - selection: Ph, - transition: Gh, - call: qe.call, - nodes: qe.nodes, - node: qe.node, - size: qe.size, - empty: qe.empty, - each: qe.each, - on: Ch, - attr: oh, - attrTween: hh, - style: Lh, - styleTween: Yh, - text: Xh, - textTween: Uh, - remove: Nh, - tween: th, - delay: vh, - duration: mh, - ease: wh, - easeVarying: bh, - end: Kh, - [Symbol.iterator]: qe[Symbol.iterator] +function ci(t) { + return _r().transition(t); +} +function il() { + return ++rd; +} +var Be = _r.prototype; +en.prototype = ci.prototype = { + constructor: en, + select: Oh, + selectAll: Lh, + selectChild: Be.selectChild, + selectChildren: Be.selectChildren, + filter: Sh, + merge: kh, + selection: Vh, + transition: ed, + call: Be.call, + nodes: Be.nodes, + node: Be.node, + size: Be.size, + empty: Be.empty, + each: Be.each, + on: Dh, + attr: ph, + attrTween: yh, + style: Bh, + styleTween: Gh, + text: jh, + textTween: td, + remove: Ih, + tween: oh, + delay: bh, + duration: Eh, + ease: Ch, + easeVarying: Nh, + end: nd, + [Symbol.iterator]: Be[Symbol.iterator] }; -function jh(t) { +function id(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var Jh = { +var sd = { time: null, // Set on use. delay: 0, duration: 250, - ease: jh + ease: id }; -function Qh(t, e) { +function ad(t, e) { for (var n; !(n = t.__transition) || !(n = n[e]); ) if (!(t = t.parentNode)) throw new Error(`transition ${e} not found`); return n; } -function td(t) { +function od(t) { var e, n; - t instanceof Ke ? (e = t._id, t = t._name) : (e = Qo(), (n = Jh).time = Ls(), t = t == null ? null : t + ""); + t instanceof en ? (e = t._id, t = t._name) : (e = il(), (n = sd).time = Vs(), t = t == null ? null : t + ""); 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]) && Di(l, t, e, u, a, n || Qh(l, e)); - return new Ke(r, this._parents, t, e); + (l = a[u]) && Oi(l, t, e, u, a, n || ad(l, e)); + return new en(r, this._parents, t, e); } -pr.prototype.interrupt = jc; -pr.prototype.transition = td; -const ms = Math.PI, ys = 2 * ms, gn = 1e-6, ed = ys - gn; -function tl(t) { +_r.prototype.interrupt = ih; +_r.prototype.transition = od; +const ws = Math.PI, xs = 2 * ws, mn = 1e-6, ld = xs - mn; +function sl(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function nd(t) { +function ud(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return tl; + if (e > 15) return sl; const n = 10 ** e; return function(r) { this._ += r[0]; @@ -4518,10 +4518,10 @@ function nd(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class rd { +class fd { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? tl : nd(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? sl : ud(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -4543,17 +4543,17 @@ class rd { let a = this._x1, o = this._y1, l = r - e, u = i - n, f = a - e, h = o - n, c = f * f + h * h; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > gn) if (!(Math.abs(h * l - u * f) > gn) || !s) + else if (c > mn) if (!(Math.abs(h * l - u * f) > mn) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let p = r - a, g = i - o, m = l * l + u * u, b = p * p + g * g, $ = Math.sqrt(m), R = Math.sqrt(c), E = s * Math.tan((ms - Math.acos((m + c - b) / (2 * $ * R))) / 2), M = E / R, C = E / $; - Math.abs(M - 1) > gn && this._append`L${e + M * f},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * p > f * g)},${this._x1 = e + C * l},${this._y1 = n + C * u}`; + let p = r - a, g = i - o, m = l * l + u * u, b = p * p + g * g, $ = Math.sqrt(m), C = Math.sqrt(c), E = s * Math.tan((ws - Math.acos((m + c - b) / (2 * $ * C))) / 2), S = E / C, T = E / $; + Math.abs(S - 1) > mn && this._append`L${e + S * f},${n + S * h}`, this._append`A${s},${s},0,0,${+(h * p > f * g)},${this._x1 = e + T * l},${this._y1 = n + T * u}`; } } arc(e, n, r, i, s, a) { if (e = +e, 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 = e + o, f = n + l, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > gn || Math.abs(this._y1 - f) > gn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % ys + ys), c > ed ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > gn && this._append`A${r},${r},0,${+(c >= ms)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > mn || Math.abs(this._y1 - f) > mn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % xs + xs), c > ld ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > mn && this._append`A${r},${r},0,${+(c >= ws)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } rect(e, n, r, i) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; @@ -4562,24 +4562,24 @@ class rd { return this._; } } -function id(t) { +function cd(t) { for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); return n; } -const sd = id("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Nt(t) { +const hd = cd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Pt(t) { return function() { return t; }; } -const xa = Math.abs, Tt = Math.atan2, vn = Math.cos, ad = Math.max, Zi = Math.min, be = Math.sin, Gn = Math.sqrt, Pt = 1e-12, Fr = Math.PI, wi = Fr / 2, ui = 2 * Fr; -function od(t) { - return t > 1 ? 0 : t < -1 ? Fr : Math.acos(t); +const Ra = Math.abs, Nt = Math.atan2, _n = Math.cos, dd = Math.max, Ji = Math.min, Ce = Math.sin, jn = Math.sqrt, Lt = 1e-12, Lr = Math.PI, $i = Lr / 2, hi = 2 * Lr; +function pd(t) { + return t > 1 ? 0 : t < -1 ? Lr : Math.acos(t); } -function ba(t) { - return t >= 1 ? wi : t <= -1 ? -wi : Math.asin(t); +function Ca(t) { + return t >= 1 ? $i : t <= -1 ? -$i : Math.asin(t); } -function ld(t) { +function vd(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -4591,141 +4591,141 @@ function ld(t) { e = r; } return t; - }, () => new rd(e); + }, () => new fd(e); } -function ud(t) { +function gd(t) { return t.innerRadius; } -function fd(t) { +function _d(t) { return t.outerRadius; } -function cd(t) { +function md(t) { return t.startAngle; } -function hd(t) { +function yd(t) { return t.endAngle; } -function dd(t) { +function wd(t) { return t && t.padAngle; } -function pd(t, e, n, r, i, s, a, o) { +function xd(t, e, n, r, i, s, a, o) { var l = n - t, u = r - e, f = a - i, h = o - s, c = h * l - f * u; - if (!(c * c < Pt)) + if (!(c * c < Lt)) return c = (f * (e - s) - h * (t - i)) / c, [t + c * l, e + c * u]; } -function Qr(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / Gn(o * o + l * l), f = u * l, h = -u * o, c = t + f, p = e + h, g = n + f, m = r + h, b = (c + g) / 2, $ = (p + m) / 2, R = g - c, E = m - p, M = R * R + E * E, C = i - s, tt = c * m - g * p, nt = (E < 0 ? -1 : 1) * Gn(ad(0, C * C * M - tt * tt)), Q = (tt * E - R * nt) / M, J = (-tt * R - E * nt) / M, ht = (tt * E + R * nt) / M, yt = (-tt * R + E * nt) / M, dt = Q - b, D = J - $, S = ht - b, Rt = yt - $; - return dt * dt + D * D > S * S + Rt * Rt && (Q = ht, J = yt), { - cx: Q, - cy: J, +function ni(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / jn(o * o + l * l), f = u * l, h = -u * o, c = t + f, p = e + h, g = n + f, m = r + h, b = (c + g) / 2, $ = (p + m) / 2, C = g - c, E = m - p, S = C * C + E * E, T = i - s, G = c * m - g * p, lt = (E < 0 ? -1 : 1) * jn(dd(0, T * T * S - G * G)), K = (G * E - C * lt) / S, rt = (-G * C - E * lt) / S, Q = (G * E + C * lt) / S, dt = (-G * C + E * lt) / S, pt = K - b, M = rt - $, P = Q - b, Xt = dt - $; + return pt * pt + M * M > P * P + Xt * Xt && (K = Q, rt = dt), { + cx: K, + cy: rt, x01: -f, y01: -h, - x11: Q * (i / C - 1), - y11: J * (i / C - 1) + x11: K * (i / T - 1), + y11: rt * (i / T - 1) }; } -function Ve() { - var t = ud, e = fd, n = Nt(0), r = null, i = cd, s = hd, a = dd, o = null, l = ld(u); +function We() { + var t = gd, e = _d, n = Pt(0), r = null, i = md, s = yd, a = wd, o = null, l = vd(u); function u() { - var f, h, c = +t.apply(this, arguments), p = +e.apply(this, arguments), g = i.apply(this, arguments) - wi, m = s.apply(this, arguments) - wi, b = xa(m - g), $ = m > g; - if (o || (o = f = l()), p < c && (h = p, p = c, c = h), !(p > Pt)) o.moveTo(0, 0); - else if (b > ui - Pt) - o.moveTo(p * vn(g), p * be(g)), o.arc(0, 0, p, g, m, !$), c > Pt && (o.moveTo(c * vn(m), c * be(m)), o.arc(0, 0, c, m, g, $)); + var f, h, c = +t.apply(this, arguments), p = +e.apply(this, arguments), g = i.apply(this, arguments) - $i, m = s.apply(this, arguments) - $i, b = Ra(m - g), $ = m > g; + if (o || (o = f = l()), p < c && (h = p, p = c, c = h), !(p > Lt)) o.moveTo(0, 0); + else if (b > hi - Lt) + o.moveTo(p * _n(g), p * Ce(g)), o.arc(0, 0, p, g, m, !$), c > Lt && (o.moveTo(c * _n(m), c * Ce(m)), o.arc(0, 0, c, m, g, $)); else { - var R = g, E = m, M = g, C = m, tt = b, nt = b, Q = a.apply(this, arguments) / 2, J = Q > Pt && (r ? +r.apply(this, arguments) : Gn(c * c + p * p)), ht = Zi(xa(p - c) / 2, +n.apply(this, arguments)), yt = ht, dt = ht, D, S; - if (J > Pt) { - var Rt = ba(J / c * be(Q)), H = ba(J / p * be(Q)); - (tt -= Rt * 2) > Pt ? (Rt *= $ ? 1 : -1, M += Rt, C -= Rt) : (tt = 0, M = C = (g + m) / 2), (nt -= H * 2) > Pt ? (H *= $ ? 1 : -1, R += H, E -= H) : (nt = 0, R = E = (g + m) / 2); + var C = g, E = m, S = g, T = m, G = b, lt = b, K = a.apply(this, arguments) / 2, rt = K > Lt && (r ? +r.apply(this, arguments) : jn(c * c + p * p)), Q = Ji(Ra(p - c) / 2, +n.apply(this, arguments)), dt = Q, pt = Q, M, P; + if (rt > Lt) { + var Xt = Ca(rt / c * Ce(K)), te = Ca(rt / p * Ce(K)); + (G -= Xt * 2) > Lt ? (Xt *= $ ? 1 : -1, S += Xt, T -= Xt) : (G = 0, S = T = (g + m) / 2), (lt -= te * 2) > Lt ? (te *= $ ? 1 : -1, C += te, E -= te) : (lt = 0, C = E = (g + m) / 2); } - var pt = p * vn(R), qt = p * be(R), et = c * vn(C), je = c * be(C); - if (ht > Pt) { - var ge = p * vn(E), Gt = p * be(E), fn = c * vn(M), kt = c * be(M), Ct; - if (b < Fr) - if (Ct = pd(pt, qt, fn, kt, ge, Gt, et, je)) { - var se = pt - Ct[0], Je = qt - Ct[1], De = ge - Ct[0], Fe = Gt - Ct[1], cn = 1 / be(od((se * De + Je * Fe) / (Gn(se * se + Je * Je) * Gn(De * De + Fe * Fe))) / 2), hn = Gn(Ct[0] * Ct[0] + Ct[1] * Ct[1]); - yt = Zi(ht, (c - hn) / (cn - 1)), dt = Zi(ht, (p - hn) / (cn + 1)); + var St = p * _n(C), Ft = p * Ce(C), It = c * _n(T), ce = c * Ce(T); + if (Q > Lt) { + var z = p * _n(E), Ct = p * Ce(E), rn = c * _n(S), tt = c * Ce(S), kt; + if (b < Lr) + if (kt = xd(St, Ft, rn, tt, z, Ct, It, ce)) { + var Ae = St - kt[0], Ee = Ft - kt[1], qe = z - kt[0], wt = Ct - kt[1], sn = 1 / Ce(pd((Ae * qe + Ee * wt) / (jn(Ae * Ae + Ee * Ee) * jn(qe * qe + wt * wt))) / 2), an = jn(kt[0] * kt[0] + kt[1] * kt[1]); + dt = Ji(Q, (c - an) / (sn - 1)), pt = Ji(Q, (p - an) / (sn + 1)); } else - yt = dt = 0; + dt = pt = 0; } - nt > Pt ? dt > Pt ? (D = Qr(fn, kt, pt, qt, p, dt, $), S = Qr(ge, Gt, et, je, p, dt, $), o.moveTo(D.cx + D.x01, D.cy + D.y01), dt < ht ? o.arc(D.cx, D.cy, dt, Tt(D.y01, D.x01), Tt(S.y01, S.x01), !$) : (o.arc(D.cx, D.cy, dt, Tt(D.y01, D.x01), Tt(D.y11, D.x11), !$), o.arc(0, 0, p, Tt(D.cy + D.y11, D.cx + D.x11), Tt(S.cy + S.y11, S.cx + S.x11), !$), o.arc(S.cx, S.cy, dt, Tt(S.y11, S.x11), Tt(S.y01, S.x01), !$))) : (o.moveTo(pt, qt), o.arc(0, 0, p, R, E, !$)) : o.moveTo(pt, qt), !(c > Pt) || !(tt > Pt) ? o.lineTo(et, je) : yt > Pt ? (D = Qr(et, je, ge, Gt, c, -yt, $), S = Qr(pt, qt, fn, kt, c, -yt, $), o.lineTo(D.cx + D.x01, D.cy + D.y01), yt < ht ? o.arc(D.cx, D.cy, yt, Tt(D.y01, D.x01), Tt(S.y01, S.x01), !$) : (o.arc(D.cx, D.cy, yt, Tt(D.y01, D.x01), Tt(D.y11, D.x11), !$), o.arc(0, 0, c, Tt(D.cy + D.y11, D.cx + D.x11), Tt(S.cy + S.y11, S.cx + S.x11), $), o.arc(S.cx, S.cy, yt, Tt(S.y11, S.x11), Tt(S.y01, S.x01), !$))) : o.arc(0, 0, c, C, M, $); + lt > Lt ? pt > Lt ? (M = ni(rn, tt, St, Ft, p, pt, $), P = ni(z, Ct, It, ce, p, pt, $), o.moveTo(M.cx + M.x01, M.cy + M.y01), pt < Q ? o.arc(M.cx, M.cy, pt, Nt(M.y01, M.x01), Nt(P.y01, P.x01), !$) : (o.arc(M.cx, M.cy, pt, Nt(M.y01, M.x01), Nt(M.y11, M.x11), !$), o.arc(0, 0, p, Nt(M.cy + M.y11, M.cx + M.x11), Nt(P.cy + P.y11, P.cx + P.x11), !$), o.arc(P.cx, P.cy, pt, Nt(P.y11, P.x11), Nt(P.y01, P.x01), !$))) : (o.moveTo(St, Ft), o.arc(0, 0, p, C, E, !$)) : o.moveTo(St, Ft), !(c > Lt) || !(G > Lt) ? o.lineTo(It, ce) : dt > Lt ? (M = ni(It, ce, z, Ct, c, -dt, $), P = ni(St, Ft, rn, tt, c, -dt, $), o.lineTo(M.cx + M.x01, M.cy + M.y01), dt < Q ? o.arc(M.cx, M.cy, dt, Nt(M.y01, M.x01), Nt(P.y01, P.x01), !$) : (o.arc(M.cx, M.cy, dt, Nt(M.y01, M.x01), Nt(M.y11, M.x11), !$), o.arc(0, 0, c, Nt(M.cy + M.y11, M.cx + M.x11), Nt(P.cy + P.y11, P.cx + P.x11), $), o.arc(P.cx, P.cy, dt, Nt(P.y11, P.x11), Nt(P.y01, P.x01), !$))) : o.arc(0, 0, c, T, S, $); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Fr / 2; - return [vn(h) * f, be(h) * f]; + var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Lr / 2; + return [_n(h) * f, Ce(h) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Nt(+f), u) : t; + return arguments.length ? (t = typeof f == "function" ? f : Pt(+f), u) : t; }, u.outerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Nt(+f), u) : e; + return arguments.length ? (e = typeof f == "function" ? f : Pt(+f), u) : e; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Nt(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Pt(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Nt(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Pt(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Nt(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Pt(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Nt(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Pt(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Nt(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Pt(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function vd(t) { +function bd(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function gd(t, e) { +function $d(t, e) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function _d(t) { +function Ad(t) { return t; } -function $a() { - var t = _d, e = gd, n = null, r = Nt(0), i = Nt(ui), s = Nt(0); +function Ta() { + var t = Ad, e = $d, n = null, r = Pt(0), i = Pt(hi), s = Pt(0); function a(o) { - var l, u = (o = vd(o)).length, f, h, c = 0, p = new Array(u), g = new Array(u), m = +r.apply(this, arguments), b = Math.min(ui, Math.max(-ui, i.apply(this, arguments) - m)), $, R = Math.min(Math.abs(b) / u, s.apply(this, arguments)), E = R * (b < 0 ? -1 : 1), M; + var l, u = (o = bd(o)).length, f, h, c = 0, p = new Array(u), g = new Array(u), m = +r.apply(this, arguments), b = Math.min(hi, Math.max(-hi, i.apply(this, arguments) - m)), $, C = Math.min(Math.abs(b) / u, s.apply(this, arguments)), E = C * (b < 0 ? -1 : 1), S; for (l = 0; l < u; ++l) - (M = g[p[l] = l] = +t(o[l], l, o)) > 0 && (c += M); - for (e != null ? p.sort(function(C, tt) { - return e(g[C], g[tt]); - }) : n != null && p.sort(function(C, tt) { - return n(o[C], o[tt]); + (S = g[p[l] = l] = +t(o[l], l, o)) > 0 && (c += S); + for (e != null ? p.sort(function(T, G) { + return e(g[T], g[G]); + }) : n != null && p.sort(function(T, G) { + return n(o[T], o[G]); }), l = 0, h = c ? (b - u * E) / c : 0; l < u; ++l, m = $) - f = p[l], M = g[f], $ = m + (M > 0 ? M * h : 0) + E, g[f] = { + f = p[l], S = g[f], $ = m + (S > 0 ? S * h : 0) + E, g[f] = { data: o[f], index: l, - value: M, + value: S, startAngle: m, endAngle: $, - padAngle: R + padAngle: C }; return g; } return a.value = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : Nt(+o), a) : t; + return arguments.length ? (t = typeof o == "function" ? o : Pt(+o), a) : t; }, a.sortValues = function(o) { return arguments.length ? (e = o, n = null, a) : e; }, a.sort = function(o) { return arguments.length ? (n = o, e = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Nt(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Pt(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Nt(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Pt(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Nt(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Pt(+o), a) : s; }, a; } -function Rr(t, e, n) { +function Nr(t, e, n) { this.k = t, this.x = e, this.y = n; } -Rr.prototype = { - constructor: Rr, +Nr.prototype = { + constructor: Nr, scale: function(t) { - return t === 1 ? this : new Rr(this.k * t, this.x, this.y); + return t === 1 ? this : new Nr(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new Rr(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new Nr(this.k, this.x + this.k * t, this.y + this.k * e); }, apply: function(t) { return [t[0] * this.k + this.x, t[1] * this.k + this.y]; @@ -4755,504 +4755,510 @@ Rr.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Rr.prototype; -var md = /* @__PURE__ */ wu(''); -const yd = { +Nr.prototype; +var Ed = /* @__PURE__ */ Cu(''); +const Rd = { 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 el(t, e) { - $s(e, !0), Eo(t, yd); - let n = vt(e, "jsonData", 7), r = vt(e, "currentRound", 7, 1), i = vt(e, "mouseEventType", 15), s = vt(e, "mouseData", 15), a = vt(e, "mouseX", 15), o = vt(e, "mouseY", 15), l = vt(e, "requestRoundChange", 7, (d) => { - }), u = vt(e, "candidateColors", 23, () => []), f = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = vt(e, "firstRoundDeterminesPercentages", 7, !1), c = vt(e, "displayPhase", 15, 0); +function al(t, e) { + Es(e, !0), So(t, Rd); + let n = ht(e, "jsonData", 7), r = ht(e, "currentRound", 7, 1), i = ht(e, "mouseEventType", 15), s = ht(e, "mouseData", 15), a = ht(e, "mouseX", 15), o = ht(e, "mouseY", 15), l = ht(e, "requestRoundChange", 7, (d) => { + }), u = ht(e, "candidateColors", 23, () => []), f = ht(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = ht(e, "firstRoundDeterminesPercentages", 7, !1), c = ht(e, "displayPhase", 15, 0); function p(d) { return d.isTransfer ? `${d.label}__transfer` : d.transferIndex != null ? `${d.label}__${d.transferIndex}` : d.label; } - const g = 800, m = 800, b = Math.min(g, m) * 0.3, $ = g / 2, R = m / 2, E = "Pie", M = "Donut", C = "TextLayer", tt = "url(#cross-hatch)", nt = 1.15, Q = 0.1, J = 750, ht = 800; - function yt(d) { + const g = 800, m = 800, b = Math.min(g, m) * 0.3, $ = g / 2, C = m / 2, E = "Pie", S = "PieOutline", T = "Donut", G = "TextLayer", lt = "url(#cross-hatch)", K = 1.15, rt = 0.1, Q = 750, dt = 800, pt = "white", M = 1, P = "#ff00ff", Xt = 3; + function te(d) { return "hatch-" + d.replace(/[^a-zA-Z0-9]/g, "-"); } - let dt = [], D = [], S = [], Rt = 0, H = 0; - const pt = {}, qt = "No Further Rankings"; - let et = /* @__PURE__ */ _t(null); - function je() { - const d = xt(x(et)); - d.select("#" + E).remove(), d.select("#" + M).remove(), d.select("#" + C).remove(); + let St = [], Ft = [], It = [], ce = 0, z = 0; + const Ct = {}, rn = "No Further Rankings"; + let tt = /* @__PURE__ */ mt(null); + function kt() { + const d = _t(x(tt)); + d.select("#" + E).remove(), d.select("#" + S).remove(), d.select("#" + T).remove(), d.select("#" + G).remove(); } - function ge(d) { - l() && (rt = d, l()(d)); + function Ae(d) { + l() && (ut = d, l()(d)); } - function Gt(d) { - je(), S = fn(d), dt = Li(d, E, S, $, R, 0, kt()); + function Ee(d) { + kt(), It = qe(d), St = Bs(d, E, It, $, C, 0, wt()), Bs(d, S, It, $, C, 0, wt(), !1, !1, !0); } - Ru(() => { - vr(), setTimeout( + Pu(() => { + xt(), setTimeout( () => { - Gt(r()); + Ee(r()); }, 0 ); }); - function fn(d) { - const _ = Br(d); - return Rt = cn(d), _; + function qe(d) { + const _ = J(d); + return ce = mr(d), _; } - function kt() { + function wt() { return b; } - function Ct() { - return kt() * 1.41; + function sn() { + return wt() * 1.41; } - function se(d) { + function an(d) { let _ = 0; - for (let w = 1; w < d; w++) { - const P = n().results[w - 1].tallyResults; - for (let A = 0; A < P.length; A++) { - const T = P[A].transfers; - if (T) { - const k = T.exhausted; - k && (_ += Number(k)); + for (let y = 1; y < d; y++) { + const k = n().results[y - 1].tallyResults; + for (let A = 0; A < k.length; A++) { + const N = k[A].transfers; + if (N) { + const R = N.exhausted; + R && (_ += Number(R)); } } } return _; } - function Je(d, _) { - if (d === "exhausted") return se(_); + function Ur(d, _) { + if (d === "exhausted") return an(_); { - const w = n().results[_ - 1].tally; - return Number(w[d]); + const y = n().results[_ - 1].tally; + return Number(y[d]); } } - function De(d, _) { - return Je(d, _).toLocaleString("en-US"); + function Li(d, _) { + return Ur(d, _).toLocaleString("en-US"); } - function Fe(d, _) { - const w = h() ? Rt : Fi(_); - return (Je(d, _) / w).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function zn(d, _) { + const y = h() ? ce : qi(_); + return (Ur(d, _) / y).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function cn(d) { + function mr(d) { const _ = n().results[d - 1].tally; - let w = 0; - for (let [P, A] of Object.entries(_)) - w += Number(A); - return w; + let y = 0; + for (let [k, A] of Object.entries(_)) + y += Number(A); + return y; } - function hn(d) { + function Gr(d) { return d === "exhausted" || d === "Inactive Ballots"; } - function Fi(d) { + function qi(d) { const _ = n().results[d - 1].tally; - let w = 0; - for (let [P, A] of Object.entries(_)) - hn(P) || (w += Number(A)); - return w; + let y = 0; + for (let [k, A] of Object.entries(_)) + Gr(k) || (y += Number(A)); + return y; } - function Xr(d, _) { + function Xn(d, _) { if (!d || d < 1 || d > n().results.length) return console.warn("In chsoenCandidates: round ${round} is out of range."), []; if (f() && d === n().results.length) return []; - const w = n().results[d - 1].tallyResults, P = []; - for (let A = 0; A < w.length; A++) { - const T = w[A][_]; - T != null && P.push(T); + const y = n().results[d - 1].tallyResults, k = []; + for (let A = 0; A < y.length; A++) { + const N = y[A][_]; + N != null && k.push(N); } - return P; + return k; } - function Qe(d) { - return Xr(d, "eliminated"); + function yr(d) { + return Xn(d, "eliminated"); } - function dn(d) { + function w(d) { let _ = []; - for (let w = 1; w <= d; w++) _ = _.concat(Xr(w, "elected")); + for (let y = 1; y <= d; y++) _ = _.concat(Xn(y, "elected")); return _; } - function Oi(d, _) { - const w = n().results[_ - 1].tallyResults; - let P = 0; - const A = w.findIndex((T) => (T == null ? void 0 : T.elected) && d == T.elected); + function W(d, _) { + const y = n().results[_ - 1].tallyResults; + let k = 0; + const A = y.findIndex((N) => (N == null ? void 0 : N.elected) && d == N.elected); if (A >= 0) { - const T = w[A].transfers; - if (T) - for (let [k, I] of Object.entries(T)) P += Number(I); + const N = y[A].transfers; + if (N) + for (let [R, L] of Object.entries(N)) k += Number(L); } else return 0; - return P; + return k; } - function Br(d) { + function J(d) { const _ = n().results; - let w = _[Math.max(0, d - 2)].tally; - const P = [], A = []; - for (let [k, I] of Object.entries(w)) - P.push({ label: k, value: 0 }); - w = _[d - 1].tally; - for (let k of P) { - const I = Number(w[k.label]), q = Oi(k.label, d); - q > 0 ? (A.push({ - label: k.label, - value: q, + let y = _[Math.max(0, d - 2)].tally; + const k = [], A = []; + for (let [R, L] of Object.entries(y)) + k.push({ label: R, value: 0 }); + y = _[d - 1].tally; + for (let R of k) { + const L = Number(y[R.label]), V = W(R.label, d); + V > 0 ? (A.push({ + label: R.label, + value: V, isTransfer: !0 - }), k.value = I - q, A.push(k)) : (k.value = I, A.push(k)); + }), R.value = L - V, A.push(R)) : (R.value = L, A.push(R)); } - const T = se(d); - return A.push({ label: "exhausted", value: T }), A; + const N = an(d); + return A.push({ label: "exhausted", value: N }), A; } - function vr() { - const d = xt(x(et)).select("defs").select("#cross-hatch"); + function xt() { + const d = _t(x(tt)).select("defs").select("#cross-hatch"); let _ = 0; - for (let [w, P] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? _ < 10 ? pt[w] = sd[_] : pt[w] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : pt[w] = u()[_ % u().length], _++; + for (let [y, k] of Object.entries(n().results[0].tally)) { + !u() || u().length === 0 ? _ < 10 ? Ct[y] = hd[_] : Ct[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ct[y] = u()[_ % u().length], _++; { const A = d.clone(!0); - A.attr("id", yt(w)).select("rect").attr("fill", pt[w]), A.selectAll("circle").attr("fill", "#383838"); + A.attr("id", te(y)).select("rect").attr("fill", Ct[y]), A.selectAll("circle").attr("fill", "#383838"); } } - pt.exhausted = tt, pt["Inactive Ballots"] = tt; + Ct.exhausted = lt, Ct["Inactive Ballots"] = lt; } - function Ii() { - xt(x(et)).select("#" + M).remove(); + function Mt() { + _t(x(tt)).select("#" + T).remove(); } - function y(d, _) { - const w = li("global").duration(ht); - _ && w.on("end", _), Ii(), zn(d), nl(), il(0, kt()), Wr(); + function j(d, _) { + const y = ci("global").duration(dt); + _ && y.on("end", _), Mt(), xr(d), fl(), hl(0, wt()), Kr(); } - function z(d, _) { - const w = li("global").duration(ht); - _ && w.on("end", _), Ie(d); + function vt(d, _) { + const y = ci("global").duration(dt); + _ && y.on("end", _), br(d); } - function Z(d, _) { - const w = li("global").duration(ht); - _ && w.on("end", _), Yn(d), Hn(kt()); + function Ot(d, _) { + const y = ci("global").duration(dt); + _ && y.on("end", _), Un(d), wr(wt()); } - let K = !1, st = []; - function G() { - Wr(), K = !1, wt(); + let nt = !1, Bt = []; + function Tt() { + Kr(), nt = !1, bt(); } - function wt() { - if (st.length === 0) { - rt !== r() && (r() === rt + 1 && rt > 0 && r() <= n().results.length ? (rt = r(), _e(r())) : r() >= 1 && r() <= n().results.length && (rt = r(), c(0), Gt(r()))); + function bt() { + if (Bt.length === 0) { + ut !== r() && (r() === ut + 1 && ut > 0 && r() <= n().results.length ? (ut = r(), he(r())) : r() >= 1 && r() <= n().results.length && (ut = r(), c(0), Ee(r()))); return; } - const d = st.shift(); + const d = Bt.shift(); switch (d.type) { case "round": { const _ = d.round; - _ === rt + 1 && rt > 0 && _ <= n().results.length ? (rt = _, _e(_)) : (_ !== rt && _ >= 1 && _ <= n().results.length && (rt = _, c(0), Gt(_)), wt()); + _ === ut + 1 && ut > 0 && _ <= n().results.length ? (ut = _, he(_)) : (_ !== ut && _ >= 1 && _ <= n().results.length && (ut = _, c(0), Ee(_)), bt()); break; } case "step": - Oe(); + Re(); break; } } - function _e(d) { + function he(d) { if (d <= 1 || d > n().results.length) { - wt(); + bt(); return; } - K = !0, H = d, c(0), y(H - 1, () => { - z(H - 1, () => { - Z(H, G); + nt = !0, z = d, c(0), j(z - 1, () => { + vt(z - 1, () => { + Ot(z, Tt); }); }); } - function me() { - K || (K = !0, H = r(), tn()); + function ee() { + nt || (nt = !0, z = r(), Ve()); } - function tn() { + function Ve() { if (c( 0 // if in the middle of "one small step" animation, reset to 0. - ), st.length > 0) { - G(); + ), Bt.length > 0) { + Tt(); return; } - const d = H < n().results.length - 1 ? tn : G; - y(H, () => { - z(H, () => { - H++, ge(H), Z(H, d); + const d = z < n().results.length - 1 ? Ve : Tt; + j(z, () => { + vt(z, () => { + z++, Ae(z), Ot(z, d); }); }); } - Ns(() => { - Mt(); + ks(() => { + Bn(); }); - let rt = 0; - function Mt() { - if (rt != r()) { - if (K) { - st.push({ type: "round", round: r() }); + let ut = 0; + function Bn() { + if (ut != r()) { + if (nt) { + Bt.push({ type: "round", round: r() }); return; } - rt == r() - 1 && rt > 0 ? Kt() : ye(r()), rt = r(); + ut == r() - 1 && ut > 0 ? Ye() : Wn(r()), ut = r(); } } - function ye(d) { - if (K) { - st.push({ type: "round", round: d }); + function Wn(d) { + if (nt) { + Bt.push({ type: "round", round: d }); return; } - c(0), Gt(d); + c(0), Ee(d); } - function Kt() { - if (K) { - st.push({ type: "round", round: r() }); + function Ye() { + if (nt) { + Bt.push({ type: "round", round: r() }); return; } if (r() <= 1) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (H = r(), H > n().results.length) { - Wr(), K = !1; + if (z = r(), z > n().results.length) { + Kr(), nt = !1; return; } - K = !0, c() === 0 ? y(H - 1, () => { - z(H - 1, () => { - Z(H, G); + nt = !0, c() === 0 ? j(z - 1, () => { + vt(z - 1, () => { + Ot(z, Tt); }); - }) : c() === 1 ? z(H - 1, () => { - Z(H, G); - }) : c() === 2 && Z(H, G), c(0); + }) : c() === 1 ? vt(z - 1, () => { + Ot(z, Tt); + }) : c() === 2 && Ot(z, Tt), c(0); } - function Oe() { + function Re() { if (r() > n().results.length) { - Wr(), K = !1; + Kr(), nt = !1; return; } - if (K) { - st.push({ type: "step" }); + if (nt) { + Bt.push({ type: "step" }); return; } - K = !0, c((c() + 1) % 3), H = r(), c() === 1 ? y(H, G) : c() === 2 ? z(H, G) : c() === 0 ? (H++, ge(H), Z(H, G)) : (K = !1, console.warn("displayPhase out of range at ", c())); + nt = !0, c((c() + 1) % 3), z = r(), c() === 1 ? j(z, Tt) : c() === 2 ? vt(z, Tt) : c() === 0 ? (z++, Ae(z), Ot(z, Tt)) : (nt = !1, console.warn("displayPhase out of range at ", c())); } - function Yn(d) { - S = Br(d), dt = sl(d, E, S, 0, kt(), !0); + function Un(d) { + It = J(d), St = Us(d, E, It, 0, wt(), !0), Us(d, S, It, 0, wt(), !1, !0); } - function Hn(d, _) { - const w = xt(x(et)).select("#" + M), P = Ve().outerRadius(d).innerRadius(d - 1), A = w.selectAll(".slice"); - let T = A.size(); - function k() { - T--, T === 0 && rl(); + function wr(d, _) { + const y = _t(x(tt)).select("#" + T), k = We().outerRadius(d).innerRadius(d - 1), A = y.selectAll(".slice"); + let N = A.size(); + function R() { + N--, N === 0 && cl(); } - A.select("path").transition("global").duration(J).attr("d", (I) => P(I)).on("end", (I) => k()); - } - function zn(d) { - const _ = gr(d, dt); - D = Hs(d, M, _, $, R, kt(), Ct(), !1, !0); - } - function Ie(d) { - const _ = mr(d, D, dt); - D = zs(d, M, _, kt(), Ct(), !1); - } - function Zt(d) { - return pt[d.data.label]; - } - function Xn(d) { - const _ = {}, w = n().results[d - 1].tallyResults; - for (let P = 0; P < w.length; P++) { - let A = w[P].eliminated; - if (A === void 0 && (A = w[P].elected), A === void 0) { + A.select("path").transition("global").duration(Q).attr("d", (L) => k(L)).on("end", (L) => R()); + } + function xr(d) { + const _ = Vi(d, St); + Ft = Ws(d, T, _, $, C, wt(), sn(), !1, !0); + const y = _t(x(tt)); + y.select("#" + E).raise(), y.select("#" + S).raise(); + } + function br(d) { + const _ = ll(d, Ft, St); + Ft = Gs(d, T, _, wt(), sn(), !1); + } + function ne(d) { + return Ct[d.data.label]; + } + function He(d) { + const _ = {}, y = n().results[d - 1].tallyResults; + for (let k = 0; k < y.length; k++) { + let A = y[k].eliminated; + if (A === void 0 && (A = y[k].elected), A === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const T = w[P].transfers; - if (T === void 0) { + const N = y[k].transfers; + if (N === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [k, I] of Object.entries(T)) - _[k] === void 0 ? _[k] = Number(I) : _[k] += Number(I); + for (let [R, L] of Object.entries(N)) + _[R] === void 0 ? _[R] = Number(L) : _[R] += Number(L); } return _; } - function gr(d, _) { - const w = [], P = Rt, A = n().results[d - 1].tallyResults; - for (let T = 0; T < A.length; T++) { - let k = A[T].eliminated; - if (k === void 0 && (k = A[T].elected), k === void 0) { + function Vi(d, _) { + const y = [], k = ce, A = n().results[d - 1].tallyResults; + for (let N = 0; N < A.length; N++) { + let R = A[N].eliminated; + if (R === void 0 && (R = A[N].elected), R === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const I = A[T].transfers; - if (I === void 0) { + const L = A[N].transfers; + if (L === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let q = _.find((O) => O.data.label == k && O.data.isTransfer); - q === void 0 && (q = _.find((O) => O.data.label == k && !O.data.isTransfer)); - let W = 0; - if (q) W = q.startAngle; + let V = _.find((I) => I.data.label == R && I.data.isTransfer); + V === void 0 && (V = _.find((I) => I.data.label == R && !I.data.isTransfer)); + let D = 0; + if (V) D = V.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [O, X] of Object.entries(I)) { - let it; - const xe = _.find((ut) => ut.data.label == O); - if (xe) - it = structuredClone(xe); - else if (O == "exhausted") - it = { - data: { label: O, value: Number(X) }, + for (let [I, X] of Object.entries(L)) { + let et; + const de = _.find((it) => it.data.label == I); + if (de) + et = structuredClone(de); + else if (I == "exhausted") + et = { + data: { label: I, value: Number(X) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (O == "residual surplus") { + else if (I == "residual surplus") { console.warn("makeDonutInfo: residual surplus = ", X); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", O); + console.warn("makeDonutInfo: unrecognized name in transfers ", I); continue; } - const N = Number(X) / P * 2 * Math.PI; - it.startAngle = W, W = it.endAngle = W + N, it.index = T, it.data.transferIndex = T, w.push(it); + const vn = Number(X) / k * 2 * Math.PI; + et.startAngle = D, D = et.endAngle = D + vn, et.index = N, et.data.transferIndex = N, y.push(et); } } - return w; + return y; } - function _r(d, _, w) { - const P = {}; - for (let [A, T] of Object.entries(d)) { - const k = w.find((W) => A == W.data.label); - if (k === void 0) { + function ol(d, _, y) { + const k = {}; + for (let [A, N] of Object.entries(d)) { + const R = y.find((D) => A == D.data.label); + if (R === void 0) { console.warn("getTransferStartAngles: mainPieObj not found for ", A); continue; } - const I = (k.startAngle + k.endAngle) / 2, q = d[k.data.label] / _ * 2 * Math.PI; - P[k.data.label] = I - q / 2; + const L = (R.startAngle + R.endAngle) / 2, V = d[R.data.label] / _ * 2 * Math.PI; + k[R.data.label] = L - V / 2; } - return P; + return k; } - function mr(d, _, w) { - const P = [], A = Rt, T = Xn(d), k = _r(T, A, w); - for (let [I, q] of _.entries()) { - const W = structuredClone(q), O = q.endAngle - q.startAngle, X = w.find((it) => q.data.label === it.data.label && !it.data.isTransfer); + function ll(d, _, y) { + const k = [], A = ce, N = He(d), R = ol(N, A, y); + for (let [L, V] of _.entries()) { + const D = structuredClone(V), I = V.endAngle - V.startAngle, X = y.find((et) => V.data.label === et.data.label && !et.data.isTransfer); if (X) { - const it = X.data.label; - W.startAngle = k[it], k[it] += O, W.endAngle = W.startAngle + O; - } else if (q.data.label === "exhausted") - W.startAngle = q.startAngle, W.endAngle = q.endAngle; + const et = X.data.label; + D.startAngle = R[et], R[et] += I, D.endAngle = D.startAngle + I; + } else if (V.data.label === "exhausted") + D.startAngle = V.startAngle, D.endAngle = V.endAngle; else { - console.warn("updateDonutInfo: unrecognized slice name ", q.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", V.data.label); continue; } - W.index = I, P.push(W); + D.index = L, k.push(D); } - return P; - } - function we(d, _, w, P, A, T) { - const I = xt(x(et)).append("g").attr("id", C).attr("transform", `translate(${w}, ${P})`), q = Ve().innerRadius(A * nt).outerRadius(A * nt); - I.selectAll("text").data(_).enter().each(function(W) { - W.endAngle - W.startAngle < Q || W.data.isTransfer || xt(this).append("g").attr("id", (O) => p(O.data)).classed("eliminated", (O) => T.includes(O.data.label) || O.data.isTransfer === !0).each(function(O, X) { - O.data.label === "exhausted" && xt(this).on("mouseenter", (it, xe) => al(it)).on("mouseleave", (it, xe) => ol()); - }).append("text").attr("transform", (O) => `translate(${q.centroid(O)})`).attr("text-anchor", (O) => qi(O.startAngle, O.endAngle)).text((O) => O.data.label === "exhausted" ? qt : O.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((O) => { - const X = De(O.data.label, d); - return !h() && hn(O.data.label) ? X : X + " (" + Fe(O.data.label, d) + ")"; + return k; + } + function Xs(d, _, y, k, A, N) { + const L = _t(x(tt)).append("g").attr("id", G).attr("transform", `translate(${y}, ${k})`), V = We().innerRadius(A * K).outerRadius(A * K); + L.selectAll("text").data(_).enter().each(function(D) { + D.endAngle - D.startAngle < rt || D.data.isTransfer || _t(this).append("g").attr("id", (I) => p(I.data)).classed("eliminated", (I) => N.includes(I.data.label) || I.data.isTransfer === !0).each(function(I, X) { + I.data.label === "exhausted" && _t(this).on("mouseenter", (et, de) => dl(et)).on("mouseleave", (et, de) => pl()); + }).append("text").attr("transform", (I) => `translate(${V.centroid(I)})`).attr("text-anchor", (I) => Yi(I.startAngle, I.endAngle)).text((I) => I.data.label === "exhausted" ? rn : I.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((I) => { + const X = Li(I.data.label, d); + return !h() && Gr(I.data.label) ? X : X + " (" + zn(I.data.label, d) + ")"; }); }); } - function Le(d, _, w, P) { - const T = xt(x(et)).select("#" + C), k = T.selectAll("tspan"), I = T.selectAll("g").data(_, (X) => p(X.data)).classed("eliminated", (X) => P.includes(X.data.label) || X.data.isTransfer === !0), q = Ve().innerRadius(w * nt).outerRadius(w * nt + 1); - k.transition("global").duration(J).attr("transform", (X) => `translate(${q.centroid(X)})`).attr("text-anchor", (X) => qi(X.startAngle, X.endAngle)), I.select("text").transition("global").duration(J).attr("transform", (X) => `translate(${q.centroid(X)})`).attr("text-anchor", (X) => qi(X.startAngle, X.endAngle)).on("end", (X) => O()); - let W = I.size(); - function O(X) { - W--, W === 0 && (T.remove(), we(d, _, $, R, w, P)); + function ul(d, _, y, k) { + const N = _t(x(tt)).select("#" + G), R = N.selectAll("tspan"), L = N.selectAll("g").data(_, (X) => p(X.data)).classed("eliminated", (X) => k.includes(X.data.label) || X.data.isTransfer === !0), V = We().innerRadius(y * K).outerRadius(y * K + 1); + R.transition("global").duration(Q).attr("transform", (X) => `translate(${V.centroid(X)})`).attr("text-anchor", (X) => Yi(X.startAngle, X.endAngle)), L.select("text").transition("global").duration(Q).attr("transform", (X) => `translate(${V.centroid(X)})`).attr("text-anchor", (X) => Yi(X.startAngle, X.endAngle)).on("end", (X) => I()); + let D = L.size(); + function I(X) { + D--, D === 0 && (N.remove(), Xs(d, _, $, C, y, k)); } } - function Li(d, _, w, P, A, T, k, I = !0, q = !1) { - const O = $a().sort(null).value((X) => X.value)(w); - return Hs(d, _, O, P, A, T, k, I, q), O; - } - function Wr() { - xt(x(et)).select("#" + E).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); - } - function Hs(d, _, w, P, A, T, k, I, q) { - const W = Qe(d), O = dn(d), xe = xt(x(et)).attr("viewBox", `0 0 ${g} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${P}, ${A})`).selectAll(".slice").data(w).enter().append("g").attr("class", "slice").classed("eliminated", (N) => W.includes(N.data.label) || N.data.isTransfer === !0).classed("elected", (N) => O.includes(N.data.label) && !N.data.isTransfer).attr("id", (N) => p(N.data)).on("mouseenter", (N, ut) => Yi(N, ut)).on("mouseleave", (N, ut) => Hi(N, ut)), yr = Ve().outerRadius(k).innerRadius(T); - if (q) { - const N = Ve().outerRadius(T + 1).innerRadius(T); - xe.append("path").attr("d", N).transition("global").duration(J).attr("d", (ut) => yr(ut)).attr("fill", (ut) => Zt(ut)).on("end", (ut) => Vi()); + function Bs(d, _, y, k, A, N, R, L = !0, V = !1, D = !1) { + const X = Ta().sort(null).value((et) => et.value)(y); + return Ws(d, _, X, k, A, N, R, L, V, D), X; + } + function Kr() { + _t(x(tt)).select("#" + S).selectAll(".elected").select("path").style("stroke", P).style("stroke-width", `${Xt}px`); + } + function Ws(d, _, y, k, A, N, R, L, V, D = !1) { + const I = yr(d), X = w(d), ze = _t(x(tt)).attr("viewBox", `0 0 ${g} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${k}, ${A})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (it) => I.includes(it.data.label) || it.data.isTransfer === !0).classed("elected", (it) => X.includes(it.data.label) && !it.data.isTransfer).attr("id", (it) => p(it.data)); + D ? ze.style("pointer-events", "none") : ze.on("mouseenter", (it, O) => zi(it, O)).on("mouseleave", (it, O) => Xi(it, O)); + const vn = We().outerRadius(R).innerRadius(N); + if (V) { + const it = We().outerRadius(N + 1).innerRadius(N); + ze.append("path").attr("d", it).attr("stroke", D ? "none" : pt).attr("stroke-width", D ? 0 : M).attr("fill", "none").transition("global").duration(Q).attr("d", (O) => vn(O)).attr("fill", D ? "none" : (O) => ne(O)).on("end", (O) => { + D || Hi(); + }); } else - xe.append("path").attr("d", (N) => yr(N)).attr("fill", (N) => Zt(N)), Vi(); - return I && we(d, w, P, A, k, W), w; - } - function nl() { - const w = xt(x(et)).select("#" + C).selectAll(".eliminated"); - w.size() > 0 && w.classed("finished", !0); - } - function rl() { - const w = xt(x(et)).select("#" + C).selectAll(".finished"); - w.size() > 0 && w.remove(); - } - function il(d, _) { - const A = xt(x(et)).select("#" + E).selectAll(".eliminated"), T = Ve().innerRadius(d), k = Ve().outerRadius(_); - A.classed("finished", !0).select("path").transition("global").duration(J).attrTween("d", function(I) { - const q = Un(_, d); - return function(W) { - return k.innerRadius(q(W)), k(I); + ze.append("path").attr("d", (it) => vn(it)).attr("fill", D ? "none" : (it) => ne(it)).attr("stroke", D ? "none" : pt).attr("stroke-width", D ? 0 : M), D || Hi(); + return L && !D && Xs(d, y, k, A, R, I), y; + } + function fl() { + const y = _t(x(tt)).select("#" + G).selectAll(".eliminated"); + y.size() > 0 && y.classed("finished", !0); + } + function cl() { + const y = _t(x(tt)).select("#" + G).selectAll(".finished"); + y.size() > 0 && y.remove(); + } + function hl(d, _) { + const A = _t(x(tt)).select("#" + E).selectAll(".eliminated"), N = We().innerRadius(d), R = We().outerRadius(_); + A.classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(L) { + const V = Zn(_, d); + return function(D) { + return R.innerRadius(V(D)), R(L); }; - }).attr("fill", (I) => `url(#${yt(I.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(J).attrTween("d", function(I) { - const q = Un(_, d); - return function(W) { - return T.outerRadius(q(W)), T(I); + }).attr("fill", (L) => `url(#${te(L.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(L) { + const V = Zn(_, d); + return function(D) { + return N.outerRadius(V(D)), N(L); }; - }).attr("fill", (I) => Zt(I)); + }).attr("fill", (L) => ne(L)); } - function qi(d, _) { - const w = (d + _) / 2; - return w > Math.PI * 11 / 6 || w < Math.PI * 1 / 6 || w > Math.PI * 5 / 6 && w < Math.PI * 7 / 6 ? "middle" : w < Math.PI ? "start" : "end"; + function Yi(d, _) { + const y = (d + _) / 2; + return y > Math.PI * 11 / 6 || y < Math.PI * 1 / 6 || y > Math.PI * 5 / 6 && y < Math.PI * 7 / 6 ? "middle" : y < Math.PI ? "start" : "end"; } - function Vi() { - xt(x( - et + function Hi() { + _t(x( + tt // force redisplay of text labels - )).select("#" + C).raise().append("g").remove(); - } - function sl(d, _, w, P, A, T) { - const I = $a().sort(null).value((q) => q.value)(w); - return zs(d, _, I, P, A, T), I; - } - function zs(d, _, w, P, A, T) { - const k = Qe(d), I = dn(d), q = Ve().outerRadius(A).innerRadius(P).startAngle((N) => N.startAngle).endAngle((N) => N.endAngle), W = Ve().outerRadius(A).innerRadius(P), X = xt(x(et)).select("#" + _); - X.selectAll(".slice").attr("prevStart", (N) => N.startAngle).attr("prevEnd", (N) => N.endAngle); - const it = X.selectAll(".slice").data(w, (N) => p(N.data)); - it.enter().append("g").attr("class", "slice").attr("id", (N) => p(N.data)).classed("eliminated", !0).on("mouseenter", (N, ut) => Yi(N, ut)).on("mouseleave", (N, ut) => Hi(N, ut)).append("path").attr("d", (N) => W(N)).attr("fill", (N) => Zt(N)), it.classed("eliminated", (N) => k.includes(N.data.label)).classed("elected", (N) => I.includes(N.data.label)).on("mouseenter", (N, ut) => Yi(N, ut)).on("mouseleave", (N, ut) => Hi(N, ut)); - let xe = it.size(); - function yr() { - xe--, xe <= 0 && (Vi(), X.selectAll(".finished").remove()); + )).select("#" + G).raise().append("g").remove(); + } + function Us(d, _, y, k, A, N, R = !1) { + const V = Ta().sort(null).value((D) => D.value)(y); + return Gs(d, _, V, k, A, N, R), V; + } + function Gs(d, _, y, k, A, N, R = !1) { + const L = yr(d), V = w(d), D = We().outerRadius(A).innerRadius(k).startAngle((O) => O.startAngle).endAngle((O) => O.endAngle), I = We().outerRadius(A).innerRadius(k), et = _t(x(tt)).select("#" + _); + et.selectAll(".slice").attr("prevStart", (O) => O.startAngle).attr("prevEnd", (O) => O.endAngle); + const de = et.selectAll(".slice").data(y, (O) => p(O.data)), ze = de.enter().append("g").attr("class", "slice").attr("id", (O) => p(O.data)).classed("eliminated", !0); + R ? ze.style("pointer-events", "none") : ze.on("mouseenter", (O, Xe) => zi(O, Xe)).on("mouseleave", (O, Xe) => Xi(O, Xe)), ze.append("path").attr("d", (O) => I(O)).attr("fill", R ? "none" : (O) => ne(O)).attr("stroke", R ? "none" : pt).attr("stroke-width", R ? 0 : M), de.classed("eliminated", (O) => L.includes(O.data.label)).classed("elected", (O) => V.includes(O.data.label)), R || de.on("mouseenter", (O, Xe) => zi(O, Xe)).on("mouseleave", (O, Xe) => Xi(O, Xe)); + let vn = de.size(); + function it() { + vn--, vn <= 0 && (R || Hi(), et.selectAll(".finished").remove()); } - return it.select("path").transition("global").duration(J).attrTween("d", function(N) { - const ut = Number(xt(this.parentNode).attr("prevStart")), ul = Number(xt(this.parentNode).attr("prevEnd")), fl = Un(ut, N.startAngle), cl = Un(ul, N.endAngle); - return (Bs) => (q.startAngle(fl(Bs)).endAngle(cl(Bs)), q(N)); - }).on("end", yr), T && Le(d, w, A, k), w; + return de.select("path").transition("global").duration(Q).attrTween("d", function(O) { + const Xe = Number(_t(this.parentNode).attr("prevStart")), gl = Number(_t(this.parentNode).attr("prevEnd")), _l = Zn(Xe, O.startAngle), ml = Zn(gl, O.endAngle); + return (Zs) => (D.startAngle(_l(Zs)).endAngle(ml(Zs)), D(O)); + }).on("end", it), N && !R && ul(d, y, A, L), y; } - function Yi(d, _) { + function zi(d, _) { s(_.data.label), i("enter"), a(d.clientX), o(d.clientY); } - function Hi(d, _) { + function Xi(d, _) { s(_.data.label), i("leave"); } - function al(d, _) { + function dl(d, _) { i("show-exhausted"), a(d.clientX), o(d.clientY); } - function ol(d, _) { + function pl(d, _) { i("hide-exhausted"); } - var ll = { - pieColors: pt, - exhaustedLabel: qt, - countExhaustedVotes: se, - getEliminatedCandidates: Qe, - getElectedCandidates: dn, - runFullAnimationFn: me, - animateOnePhaseFn: Oe, + var vl = { + pieColors: Ct, + exhaustedLabel: rn, + countExhaustedVotes: an, + getEliminatedCandidates: yr, + getElectedCandidates: w, + runFullAnimationFn: ee, + animateOnePhaseFn: Re, get jsonData() { return n(); }, @@ -5320,11 +5326,11 @@ function el(t, e) { set displayPhase(d = 0) { c(d), ft(); } - }, Xs = md(); - return ri(Xs, (d) => ot(et, d), () => x(et)), le(t, Xs), As(ll); + }, Ks = Ed(); + return ai(Ks, (d) => at(tt, d), () => x(tt)), ge(t, Ks), Rs(vl); } -Co( - el, +Mo( + al, { jsonData: {}, currentRound: {}, @@ -5350,8 +5356,8 @@ Co( ], { mode: "open" } ); -var wd = /* @__PURE__ */ Vn(" ", 1), xd = /* @__PURE__ */ Vn("About to eliminate: ", 1), bd = /* @__PURE__ */ Vn(" ", 1), $d = /* @__PURE__ */ Vn(" ", 1), Ad = /* @__PURE__ */ Vn('

', 1), Ed = /* @__PURE__ */ Vn("
", 1), Rd = /* @__PURE__ */ Vn('


these ballots have already been eliminated.
', 1); -const Cd = { +var Cd = /* @__PURE__ */ Hn(" ", 1), Td = /* @__PURE__ */ Hn("About to eliminate: ", 1), Nd = /* @__PURE__ */ Hn(" ", 1), Sd = /* @__PURE__ */ Hn(" ", 1), kd = /* @__PURE__ */ Hn('

', 1), Md = /* @__PURE__ */ Hn("
", 1), Pd = /* @__PURE__ */ Hn('


these ballots have already been eliminated.
', 1); +const Dd = { 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;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl) {background-color:#4747ff;color:#fff;padding:1px 7px;font-size:0.67rem;min-width:107px;border:none;border-radius:3px;cursor:pointer;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl):hover {background-color:#4747c2;}.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;} @@ -5366,11 +5372,11 @@ const Cd = { }` }; -function Td(t, e) { - $s(e, !0), Eo(t, Cd); +function Fd(t, e) { + Es(e, !0), So(t, Dd); const n = 0.85; - let r = vt(e, "electionSummary", 7), i = vt(e, "currentRound", 7, 1), s = vt(e, "requestRoundChange", 7, (y) => { - }), a = vt(e, "candidateColors", 23, () => []), o = vt(e, "textForWinner", 7, "elected"), l = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = vt(e, "firstRoundDeterminesPercentages", 7, !1), f = vt(e, "showCaptions", 7, !1); + let r = ht(e, "electionSummary", 7), i = ht(e, "currentRound", 7, 1), s = ht(e, "requestRoundChange", 7, (w) => { + }), a = ht(e, "candidateColors", 23, () => []), o = ht(e, "textForWinner", 7, "elected"), l = ht(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = ht(e, "firstRoundDeterminesPercentages", 7, !1), f = ht(e, "showCaptions", 7, !1); const h = { elected: { caption: "Elected", @@ -5389,39 +5395,39 @@ function Td(t, e) { infinitive: "to take the lead" } }; - let c = /* @__PURE__ */ Bn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ _t(null), g = /* @__PURE__ */ _t(null), m = /* @__PURE__ */ _t(""), b = /* @__PURE__ */ _t(yn([])), $ = /* @__PURE__ */ _t(""), R = /* @__PURE__ */ _t(""), E = /* @__PURE__ */ _t(0), M = /* @__PURE__ */ _t(0), C = /* @__PURE__ */ Bn(() => tt(r())); - function tt(y) { - if (typeof y == "string") + let c = /* @__PURE__ */ Gn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ mt(null), g = /* @__PURE__ */ mt(null), m = /* @__PURE__ */ mt(""), b = /* @__PURE__ */ mt(xn([])), $ = /* @__PURE__ */ mt(""), C = /* @__PURE__ */ mt(""), E = /* @__PURE__ */ mt(0), S = /* @__PURE__ */ mt(0), T = /* @__PURE__ */ Gn(() => G(r())); + function G(w) { + if (typeof w == "string") try { - y = JSON.parse(y); - } catch (z) { - return console.error("Failed to parse JSON string:", z), {}; + w = JSON.parse(w); + } catch (W) { + return console.error("Failed to parse JSON string:", W), {}; } - return y || {}; + return w || {}; } - function nt(y) { - s() ? s()(y) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); + function lt(w) { + s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function Q(y, z, Z) { - y.style.left = z + "px", y.style.top = Z + 20 + "px", y.style.transform = "none", requestAnimationFrame(() => { - const G = y.getBoundingClientRect(); - let wt = z, _e = Z + 20; - wt + G.width > window.innerWidth - 12 && (wt = window.innerWidth - G.width - 12), wt < 12 && (wt = 12), _e + G.height > window.innerHeight - 12 && (_e = Z - G.height - 12), y.style.left = wt + "px", y.style.top = _e + "px"; + function K(w, W, J) { + w.style.left = W + "px", w.style.top = J + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const j = w.getBoundingClientRect(); + let vt = W, Ot = J + 20; + vt + j.width > window.innerWidth - 12 && (vt = window.innerWidth - j.width - 12), vt < 12 && (vt = 12), Ot + j.height > window.innerHeight - 12 && (Ot = J - j.height - 12), w.style.left = vt + "px", w.style.top = Ot + "px"; }); } - function J() { + function rt() { switch (x($)) { case "enter": - ((y) => { - var z = Nl(y, 2); - ot(b, z[0], !0), ot(m, z[1], !0); - })(yt(x(R), i())), x(p) && (Q(x(p), x(E) || 0, x(M) || 0), x(p).style.opacity = String(n)); + ((w) => { + var W = Il(w, 2); + at(b, W[0], !0), at(m, W[1], !0); + })(dt(x(C), i())), x(p) && (K(x(p), x(E) || 0, x(S) || 0), x(p).style.opacity = String(n)); break; case "leave": - x(p) && (x(p).style.opacity = "0"), ot(b, [], !0), ot(m, ""); + x(p) && (x(p).style.opacity = "0"), at(b, [], !0), at(m, ""); break; case "show-exhausted": - x(g) && (Q(x(g), x(E) || 0, x(M) || 0), x(g).style.opacity = String(n)); + x(g) && (K(x(g), x(E) || 0, x(S) || 0), x(g).style.opacity = String(n)); break; case "hide-exhausted": x(g) && (x(g).style.opacity = "0"); @@ -5431,132 +5437,132 @@ function Td(t, e) { break; } } - Ns(() => J()); - function ht(y, z) { - return y == 1 ? z ? "vote was" : "vote will be" : z ? "votes were" : "votes will be"; - } - function yt(y, z) { - const Z = [], K = y === "exhausted" ? ge() : y; - let st; - y == "exhausted" ? st = et(1) : st = x(C).results[0].tally[y], Z.push(`${K} started with ${st} votes.`); - for (let G = 1; G <= z; G++) { - G === z && (y == "exhausted" ? st = et(z) : st = x(C).results[z - 1].tally[y], Z.push(`${K} has ${st} votes at round ${z}.`)); - const wt = x(C).results[G - 1].tallyResults, _e = H(G); - for (let me = 0; me < wt.length; me++) { - const tn = wt[me].transfers, rt = wt[me].eliminated, Mt = wt[me].elected; - if (!_e) { - if (rt) - rt === y && Z.push(`${K} will be eliminated on round ${G}.`); - else if (y === Mt && (Z.push(`${K} ${x(c).event} on round ${G}.`), tn)) - for (let [Kt, Oe] of Object.entries(tn)) - Z.push(`${Oe} ${ht(Number(Oe), G < z)} transferred to ${Kt} on round ${G}.`); + ks(() => rt()); + function Q(w, W) { + return w == 1 ? W ? "vote was" : "vote will be" : W ? "votes were" : "votes will be"; + } + function dt(w, W) { + const J = [], xt = w === "exhausted" ? z() : w; + let Mt; + w == "exhausted" ? Mt = It(1) : Mt = x(T).results[0].tally[w], J.push(`${xt} started with ${Mt} votes.`); + for (let j = 1; j <= W; j++) { + j === W && (w == "exhausted" ? Mt = It(W) : Mt = x(T).results[W - 1].tally[w], J.push(`${xt} has ${Mt} votes at round ${W}.`)); + const vt = x(T).results[j - 1].tallyResults, Ot = te(j); + for (let nt = 0; nt < vt.length; nt++) { + const Bt = vt[nt].transfers, Tt = vt[nt].eliminated, bt = vt[nt].elected; + if (!Ot) { + if (Tt) + Tt === w && J.push(`${xt} will be eliminated on round ${j}.`); + else if (w === bt && (J.push(`${xt} ${x(c).event} on round ${j}.`), Bt)) + for (let [ee, Ve] of Object.entries(Bt)) + J.push(`${Ve} ${Q(Number(Ve), j < W)} transferred to ${ee} on round ${j}.`); } - const ye = rt || Mt; - if (ye) { - const Kt = Number(tn[y]); - Kt && Z.push(`${Kt} ${ht(Kt, G < z)} transferred from ${ye} on round ${G}.`); + const he = Tt || bt; + if (he) { + const ee = Number(Bt[w]); + ee && J.push(`${ee} ${Q(ee, j < W)} transferred from ${he} on round ${j}.`); } } } - return [Z, K]; + return [J, xt]; } - function dt() { - let y = 0; - for (let z = 1; z <= x(C).results.length; z++) { - if (H(z)) continue; - const Z = x(C).results[z - 1].tallyResults; - for (let K = 0; K < Z.length; K++) - Z[K].elected && y++; + function pt() { + let w = 0; + for (let W = 1; W <= x(T).results.length; W++) { + if (te(W)) continue; + const J = x(T).results[W - 1].tallyResults; + for (let xt = 0; xt < J.length; xt++) + J[xt].elected && w++; } - return y; + return w; } - const D = ["Eliminate", "Transfer", "Consolidate"]; - let S, Rt = /* @__PURE__ */ _t(0); - function H(y) { - return l() && x(C).results && y === x(C).results.length; + const M = ["Eliminate", "Transfer", "Consolidate"]; + let P, Xt = /* @__PURE__ */ mt(0); + function te(w) { + return l() && x(T).results && w === x(T).results.length; } - function pt(y) { - return H(y) ? [] : S ? S.getEliminatedCandidates(y) : []; + function St(w) { + return te(w) ? [] : P ? P.getEliminatedCandidates(w) : []; } - function qt(y) { - return H(y) ? [] : S ? S.getElectedCandidates(y) : []; + function Ft(w) { + return te(w) ? [] : P ? P.getElectedCandidates(w) : []; } - function et(y) { - return S ? S.countExhaustedVotes(y) : 0; + function It(w) { + return P ? P.countExhaustedVotes(w) : 0; } - function je() { - S && S.animateOnePhaseFn && S.animateOnePhaseFn(); + function ce() { + P && P.animateOnePhaseFn && P.animateOnePhaseFn(); } - function ge() { - return S ? S.exhaustedLabel : ""; + function z() { + return P ? P.exhaustedLabel : ""; } - function Gt() { - return S ? S.pieColors : {}; + function Ct() { + return P ? P.pieColors : {}; } - var fn = { + var rn = { get electionSummary() { return r(); }, - set electionSummary(y) { - r(y), ft(); + set electionSummary(w) { + r(w), ft(); }, get currentRound() { return i(); }, - set currentRound(y = 1) { - i(y), ft(); + set currentRound(w = 1) { + i(w), ft(); }, get requestRoundChange() { return s(); }, - set requestRoundChange(y = (z) => { + set requestRoundChange(w = (W) => { }) { - s(y), ft(); + s(w), ft(); }, get candidateColors() { return a(); }, - set candidateColors(y = []) { - a(y), ft(); + set candidateColors(w = []) { + a(w), ft(); }, get textForWinner() { return o(); }, - set textForWinner(y = "elected") { - o(y), ft(); + set textForWinner(w = "elected") { + o(w), ft(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, - set excludeFinalWinnerAndEliminatedCandidate(y = !1) { - l(y), ft(); + set excludeFinalWinnerAndEliminatedCandidate(w = !1) { + l(w), ft(); }, get firstRoundDeterminesPercentages() { return u(); }, - set firstRoundDeterminesPercentages(y = !1) { - u(y), ft(); + set firstRoundDeterminesPercentages(w = !1) { + u(w), ft(); }, get showCaptions() { return f(); }, - set showCaptions(y = !1) { - f(y), ft(); + set showCaptions(w = !1) { + f(w), ft(); } - }, kt = Rd(), Ct = pn(kt), se = Yt(Ct); - se.__click = je; - var Je = Yt(se, !0); - Vt(se), Vt(Ct); - var De = ae(Ct, 4), Fe = Yt(De), cn = Yt(Fe), hn = Yt(cn); - ri( - el(hn, { + }, tt = Pd(), kt = gn(tt), Ae = Ut(kt); + Ae.__click = ce; + var Ee = Ut(Ae, !0); + Wt(Ae), Wt(kt); + var qe = pe(kt, 4), wt = Ut(qe), sn = Ut(wt), an = Ut(sn); + ai( + al(an, { get jsonData() { - return x(C); + return x(T); }, get currentRound() { return i(); }, - requestRoundChange: nt, + requestRoundChange: lt, get candidateColors() { return a(); }, @@ -5569,129 +5575,129 @@ function Td(t, e) { get mouseEventType() { return x($); }, - set mouseEventType(y) { - ot($, y, !0); + set mouseEventType(w) { + at($, w, !0); }, get mouseData() { - return x(R); + return x(C); }, - set mouseData(y) { - ot(R, y, !0); + set mouseData(w) { + at(C, w, !0); }, get mouseX() { return x(E); }, - set mouseX(y) { - ot(E, y, !0); + set mouseX(w) { + at(E, w, !0); }, get mouseY() { - return x(M); + return x(S); }, - set mouseY(y) { - ot(M, y, !0); + set mouseY(w) { + at(S, w, !0); }, get displayPhase() { - return x(Rt); + return x(Xt); }, - set displayPhase(y) { - ot(Rt, y, !0); + set displayPhase(w) { + at(Xt, w, !0); } }), - (y) => S = y, - () => S - ), Vt(cn), Vt(Fe); - var Fi = ae(Fe, 2); + (w) => P = w, + () => P + ), Wt(sn), Wt(wt); + var Ur = pe(wt, 2); { - var Xr = (y) => { - var z = Ad(), Z = pn(z), K = Yt(Z); - Vt(Z); - var st = ae(Z, 2), G = Yt(st); + var Li = (w) => { + var W = kd(), J = gn(W), xt = Ut(J); + Wt(J); + var Mt = pe(J, 2), j = Ut(Mt); { - var wt = (Mt) => { - var ye = xd(), Kt = ae(pn(ye)); - Wi(Kt, 17, () => pt(i()), Bi, (Oe, Yn, Hn) => { - var zn = wd(), Ie = pn(zn); - let Zt; - var Xn = Yt(Ie, !0); - Vt(Ie); - var gr = ae(Ie, 2); + var vt = (bt) => { + var he = Td(), ee = pe(gn(he)); + Gi(ee, 17, () => St(i()), Ui, (Ve, ut, Bn) => { + var Wn = Cd(), Ye = gn(Wn); + let Re; + var Un = Ut(Ye, !0); + Wt(Ye); + var wr = pe(Ye, 2); { - var _r = (we) => { - var Le = ea(", "); - le(we, Le); - }, mr = /* @__PURE__ */ Bn(() => Hn < pt(i()).length - 1); - wr(gr, (we) => { - x(mr) && we(_r); + var xr = (ne) => { + var He = aa(", "); + ge(ne, He); + }, br = /* @__PURE__ */ Gn(() => Bn < St(i()).length - 1); + $r(wr, (ne) => { + x(br) && ne(xr); }); } - Wn( - (we) => { - Zt = ia(Ie, "", Zt, we), en(Xn, x(Yn)); + Kn( + (ne) => { + Re = ua(Ye, "", Re, ne), on(Un, x(ut)); }, - [() => ({ color: Gt()[x(Yn)] })] - ), le(Oe, zn); - }), le(Mt, ye); - }, _e = /* @__PURE__ */ Bn(() => pt(i()).length > 0); - wr(G, (Mt) => { - x(_e) && Mt(wt); + [() => ({ color: Ct()[x(ut)] })] + ), ge(Ve, Wn); + }), ge(bt, he); + }, Ot = /* @__PURE__ */ Gn(() => St(i()).length > 0); + $r(j, (bt) => { + x(Ot) && bt(vt); }); } - var me = ae(G, 2); + var nt = pe(j, 2); { - var tn = (Mt) => { - var ye = $d(), Kt = pn(ye), Oe = ae(Kt); - Wi(Oe, 17, () => qt(i()), Bi, (Yn, Hn, zn) => { - var Ie = bd(), Zt = pn(Ie); - let Xn; - var gr = Yt(Zt, !0); - Vt(Zt); - var _r = ae(Zt, 2); + var Bt = (bt) => { + var he = Sd(), ee = gn(he), Ve = pe(ee); + Gi(Ve, 17, () => Ft(i()), Ui, (ut, Bn, Wn) => { + var Ye = Nd(), Re = gn(Ye); + let Un; + var wr = Ut(Re, !0); + Wt(Re); + var xr = pe(Re, 2); { - var mr = (Le) => { - var Li = ea(", "); - le(Le, Li); - }, we = /* @__PURE__ */ Bn(() => zn < qt(i()).length - 1); - wr(_r, (Le) => { - x(we) && Le(mr); + var br = (He) => { + var Vi = aa(", "); + ge(He, Vi); + }, ne = /* @__PURE__ */ Gn(() => Wn < Ft(i()).length - 1); + $r(xr, (He) => { + x(ne) && He(br); }); } - Wn( - (Le) => { - Xn = ia(Zt, "", Xn, Le), en(gr, x(Hn)); + Kn( + (He) => { + Un = ua(Re, "", Un, He), on(wr, x(Bn)); }, - [() => ({ color: Gt()[x(Hn)] })] - ), le(Yn, Ie); - }), Wn(() => en(Kt, `${x(c).caption ?? ""}: `)), le(Mt, ye); - }, rt = /* @__PURE__ */ Bn(() => qt(i()).length > 0); - wr(me, (Mt) => { - x(rt) && Mt(tn); + [() => ({ color: Ct()[x(Bn)] })] + ), ge(ut, Ye); + }), Kn(() => on(ee, `${x(c).caption ?? ""}: `)), ge(bt, he); + }, Tt = /* @__PURE__ */ Gn(() => Ft(i()).length > 0); + $r(nt, (bt) => { + x(Tt) && bt(Bt); }); } - Vt(st), Wn((Mt) => en(K, `${x(C).config.contest ?? ""}, ${Mt ?? ""} ${x(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [dt]), le(y, z); + Wt(Mt), Kn((bt) => on(xt, `${x(T).config.contest ?? ""}, ${bt ?? ""} ${x(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [pt]), ge(w, W); }; - wr(Fi, (y) => { - f() && y(Xr); + $r(Ur, (w) => { + f() && w(Li); }); } - Vt(De); - var Qe = ae(De, 2), dn = Yt(Qe), Oi = Yt(dn, !0); - Vt(dn); - var Br = ae(dn, 2); - Wi(Br, 17, () => x(b), Bi, (y, z) => { - var Z = Ed(), K = pn(Z), st = Yt(K, !0); - Vt(K), Qi(2), Wn(() => en(st, x(z))), le(y, Z); - }), Vt(Qe), ri(Qe, (y) => ot(p, y), () => x(p)); - var vr = ae(Qe, 2), Ii = Yt(vr); - return Qi(2), Vt(vr), ri(vr, (y) => ot(g, y), () => x(g)), Wn( - (y) => { - en(Je, D[x(Rt)]), en(Oi, x(m)), en(Ii, `"${y ?? ""}" means all the candidates ranked on `); + Wt(qe); + var zn = pe(qe, 2), mr = Ut(zn), Gr = Ut(mr, !0); + Wt(mr); + var qi = pe(mr, 2); + Gi(qi, 17, () => x(b), Ui, (w, W) => { + var J = Md(), xt = gn(J), Mt = Ut(xt, !0); + Wt(xt), es(2), Kn(() => on(Mt, x(W))), ge(w, J); + }), Wt(zn), ai(zn, (w) => at(p, w), () => x(p)); + var Xn = pe(zn, 2), yr = Ut(Xn); + return es(2), Wt(Xn), ai(Xn, (w) => at(g, w), () => x(g)), Kn( + (w) => { + on(Ee, M[x(Xt)]), on(Gr, x(m)), on(yr, `"${w ?? ""}" means all the candidates ranked on `); }, - [ge] - ), le(t, kt), As(fn); + [z] + ), ge(t, tt), Rs(rn); } -_u(["click"]); -customElements.define("pie-chart", Co( - Td, +Au(["click"]); +customElements.define("pie-chart", Mo( + Fd, { electionSummary: {}, currentRound: {}, From d58fd415f0b7899ccece5c481052107fd4421e86 Mon Sep 17 00:00:00 2001 From: skaphan Date: Mon, 23 Mar 2026 16:10:57 +0000 Subject: [PATCH 17/31] Update pie chart bundle: defer elected slice splitting Co-Authored-By: Claude Opus 4.6 --- static/pie/pie-chart.es.js | 2989 ++++++++++++++++++------------------ 1 file changed, 1504 insertions(+), 1485 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 9664d299..c9c49905 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,21 +1,21 @@ var yl = Object.defineProperty; -var js = (t) => { +var Qs = (t) => { throw TypeError(t); }; var wl = (t, e, n) => e in t ? yl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var st = (t, e, n) => wl(t, typeof e != "symbol" ? e + "" : e, n), Bi = (t, e, n) => e.has(t) || js("Cannot " + n); -var v = (t, e, n) => (Bi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? js("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), F = (t, e, n, r) => (Bi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), gt = (t, e, n) => (Bi(t, e, "access private method"), n); -var Na; -typeof window < "u" && ((Na = window.__svelte ?? (window.__svelte = {})).v ?? (Na.v = /* @__PURE__ */ new Set())).add("5"); -const xl = 1, bl = 2, $l = 16, Al = 1, El = 4, Rl = 8, Cl = 16, Tl = 2, bs = "[", Ri = "[!", $s = "]", ar = {}, $t = Symbol(), Nl = "http://www.w3.org/1999/xhtml", Qi = !1; -var Ma = Array.isArray, Sl = Array.prototype.indexOf, or = Array.prototype.includes, Ci = Array.from, di = Object.keys, pi = Object.defineProperty, Sn = Object.getOwnPropertyDescriptor, kl = Object.prototype, Ml = Array.prototype, Pl = Object.getPrototypeOf, Js = Object.isExtensible; +var it = (t, e, n) => wl(t, typeof e != "symbol" ? e + "" : e, n), Xi = (t, e, n) => e.has(t) || Qs("Cannot " + n); +var v = (t, e, n) => (Xi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), L = (t, e, n) => e.has(t) ? Qs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), O = (t, e, n, r) => (Xi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), _t = (t, e, n) => (Xi(t, e, "access private method"), n); +var Sa; +typeof window < "u" && ((Sa = window.__svelte ?? (window.__svelte = {})).v ?? (Sa.v = /* @__PURE__ */ new Set())).add("5"); +const xl = 1, bl = 2, $l = 16, Al = 1, El = 4, Rl = 8, Cl = 16, Tl = 2, bs = "[", Ei = "[!", $s = "]", ar = {}, $t = Symbol(), Nl = "http://www.w3.org/1999/xhtml", Qi = !1; +var Ma = Array.isArray, Sl = Array.prototype.indexOf, or = Array.prototype.includes, Ri = Array.from, hi = Object.keys, di = Object.defineProperty, Sn = Object.getOwnPropertyDescriptor, kl = Object.prototype, Pl = Array.prototype, Ml = Object.getPrototypeOf, ta = Object.isExtensible; const Dl = () => { }; function Fl(t) { for (var e = 0; e < t.length; e++) t[e](); } -function Pa() { +function Da() { var t, e, n = new Promise((r, i) => { t = r, e = i; }); @@ -31,11 +31,11 @@ function Il(t, e) { if (n.push(r), n.length === e) break; return n; } -const Et = 2, Pr = 4, Ti = 8, Da = 1 << 24, nn = 16, be = 32, pn = 64, Fa = 128, oe = 512, yt = 1024, Rt = 2048, xe = 4096, jt = 8192, Qe = 16384, vr = 32768, lr = 65536, Qs = 1 << 17, Ia = 1 << 18, Yn = 1 << 19, Ol = 1 << 20, fn = 1 << 25, Fn = 65536, ts = 1 << 21, As = 1 << 22, cn = 1 << 23, Sr = Symbol("$state"), Oa = Symbol("legacy props"), yn = new class extends Error { +const Et = 2, Mr = 4, Ci = 8, Fa = 1 << 24, Qe = 16, xe = 32, hn = 64, Ia = 128, le = 512, yt = 1024, Rt = 2048, we = 4096, te = 8192, Je = 16384, vr = 32768, lr = 65536, ea = 1 << 17, Oa = 1 << 18, Yn = 1 << 19, Ol = 1 << 20, ln = 1 << 25, Fn = 65536, ts = 1 << 21, As = 1 << 22, un = 1 << 23, Sr = Symbol("$state"), La = Symbol("legacy props"), yn = new class extends Error { constructor() { super(...arguments); - st(this, "name", "StaleReactionError"); - st(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + it(this, "name", "StaleReactionError"); + it(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } }(), Xr = 3, gr = 8; function Ll(t) { @@ -74,44 +74,44 @@ function Gl() { function Kl() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function Zl() { +function Jl() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Ni(t) { +function Ti(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function jl() { +function Zl() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } -let Z = !1; -function Je(t) { - Z = t; +let J = !1; +function Ke(t) { + J = t; } let H; function zt(t) { if (t === null) - throw Ni(), ar; + throw Ti(), ar; return H = t; } -function Si() { +function Ni() { return zt(/* @__PURE__ */ Ie(H)); } -function Wt(t) { - if (Z) { +function Kt(t) { + if (J) { if (/* @__PURE__ */ Ie(H) !== null) - throw Ni(), ar; + throw Ti(), ar; H = t; } } function es(t = 1) { - if (Z) { + if (J) { for (var e = t, n = H; e--; ) n = /** @type {TemplateNode} */ /* @__PURE__ */ Ie(n); H = n; } } -function vi(t = !0) { +function pi(t = !0) { for (var e = 0, n = H; ; ) { if (n.nodeType === gr) { var r = ( @@ -121,7 +121,7 @@ function vi(t = !0) { if (r === $s) { if (e === 0) return n; e -= 1; - } else (r === bs || r === Ri || // "[1", "[2", etc. for if blocks + } else (r === bs || r === Ei || // "[1", "[2", etc. for if blocks r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); } var i = ( @@ -131,30 +131,30 @@ function vi(t = !0) { t && n.remove(), n = i; } } -function La(t) { +function qa(t) { if (!t || t.nodeType !== gr) - throw Ni(), ar; + throw Ti(), ar; return ( /** @type {Comment} */ t.data ); } -function qa(t) { +function Va(t) { return t === this.v; } -function Jl(t, e) { +function jl(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function Va(t) { - return !Jl(t, this.v); +function Ya(t) { + return !jl(t, this.v); } -let Ql = !1, Jt = null; +let Ql = !1, ee = null; function ur(t) { - Jt = t; + ee = t; } function Es(t, e = !1, n) { - Jt = { - p: Jt, + ee = { + p: ee, i: !1, c: null, e: null, @@ -166,21 +166,21 @@ function Es(t, e = !1, n) { function Rs(t) { var e = ( /** @type {ComponentContext} */ - Jt + ee ), n = e.e; if (n !== null) { e.e = null; for (var r of n) - co(r); + ho(r); } - return t !== void 0 && (e.x = t), e.i = !0, Jt = e.p, t ?? /** @type {T} */ + return t !== void 0 && (e.x = t), e.i = !0, ee = e.p, t ?? /** @type {T} */ {}; } -function Ya() { +function Ha() { return !0; } let wn = []; -function Ha() { +function za() { var t = wn; wn = [], Fl(t); } @@ -188,26 +188,26 @@ function kn(t) { if (wn.length === 0 && !kr) { var e = wn; queueMicrotask(() => { - e === wn && Ha(); + e === wn && za(); }); } wn.push(t); } function tu() { for (; wn.length > 0; ) - Ha(); + za(); } -function za(t) { - var e = U; +function Xa(t) { + var e = W; if (e === null) - return Y.f |= cn, t; - if ((e.f & vr) === 0 && (e.f & Pr) === 0) + return Y.f |= un, t; + if ((e.f & vr) === 0 && (e.f & Mr) === 0) throw t; fr(t, e); } function fr(t, e) { for (; e !== null; ) { - if ((e.f & Fa) !== 0) { + if ((e.f & Ia) !== 0) { if ((e.f & vr) === 0) throw t; try { @@ -222,77 +222,77 @@ function fr(t, e) { throw t; } const eu = -7169; -function ot(t, e) { +function at(t, e) { t.f = t.f & eu | e; } function Cs(t) { - (t.f & oe) !== 0 || t.deps === null ? ot(t, yt) : ot(t, xe); + (t.f & le) !== 0 || t.deps === null ? at(t, yt) : at(t, we); } -function Xa(t) { +function Ba(t) { if (t !== null) for (const e of t) - (e.f & Et) === 0 || (e.f & Fn) === 0 || (e.f ^= Fn, Xa( + (e.f & Et) === 0 || (e.f & Fn) === 0 || (e.f ^= Fn, Ba( /** @type {Derived} */ e.deps )); } -function Ba(t, e, n) { - (t.f & Rt) !== 0 ? e.add(t) : (t.f & xe) !== 0 && n.add(t), Xa(t.deps), ot(t, yt); +function Wa(t, e, n) { + (t.f & Rt) !== 0 ? e.add(t) : (t.f & we) !== 0 && n.add(t), Ba(t.deps), at(t, yt); } -const Zr = /* @__PURE__ */ new Set(); -let B = null, At = null, Vt = [], ki = null, ns = !1, kr = !1; -var Qn, tr, An, er, qr, Vr, En, Ue, nr, Fe, rs, is, Wa; +const Kr = /* @__PURE__ */ new Set(); +let X = null, At = null, Vt = [], Si = null, ns = !1, kr = !1; +var Qn, tr, An, er, qr, Vr, En, Xe, nr, Fe, rs, is, Ua; const zs = class zs { constructor() { - q(this, Fe); - st(this, "committed", !1); + L(this, Fe); + it(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} */ - st(this, "current", /* @__PURE__ */ new Map()); + it(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} */ - st(this, "previous", /* @__PURE__ */ new Map()); + it(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>} */ - q(this, Qn, /* @__PURE__ */ new Set()); + L(this, Qn, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - q(this, tr, /* @__PURE__ */ new Set()); + L(this, tr, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - q(this, An, 0); + L(this, An, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - q(this, er, 0); + L(this, er, 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} */ - q(this, qr, null); + L(this, qr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - q(this, Vr, /* @__PURE__ */ new Set()); + L(this, Vr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - q(this, En, /* @__PURE__ */ new Set()); + L(this, En, /* @__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`. @@ -300,9 +300,9 @@ const zs = class zs { * so they can be rescheduled if the branch survives. * @type {Map} */ - q(this, Ue, /* @__PURE__ */ new Map()); - st(this, "is_fork", !1); - q(this, nr, !1); + L(this, Xe, /* @__PURE__ */ new Map()); + it(this, "is_fork", !1); + L(this, nr, !1); } is_deferred() { return this.is_fork || v(this, er) > 0; @@ -312,7 +312,7 @@ const zs = class zs { * @param {Effect} effect */ skip_effect(e) { - v(this, Ue).has(e) || v(this, Ue).set(e, { d: [], m: [] }); + v(this, Xe).has(e) || v(this, Xe).set(e, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule @@ -320,13 +320,13 @@ const zs = class zs { * @param {Effect} effect */ unskip_effect(e) { - var n = v(this, Ue).get(e); + var n = v(this, Xe).get(e); if (n) { - v(this, Ue).delete(e); + v(this, Xe).delete(e); for (var r of n.d) - ot(r, Rt), ye(r); + at(r, Rt), me(r); for (r of n.m) - ot(r, xe), ye(r); + at(r, we), me(r); } } /** @@ -338,14 +338,14 @@ const zs = class zs { Vt = [], this.apply(); var n = [], r = []; for (const s of e) - gt(this, Fe, rs).call(this, s, n, r); + _t(this, Fe, rs).call(this, s, n, r); if (this.is_deferred()) { - gt(this, Fe, is).call(this, r), gt(this, Fe, is).call(this, n); - for (const [s, a] of v(this, Ue)) + _t(this, Fe, is).call(this, r), _t(this, Fe, is).call(this, n); + for (const [s, a] of v(this, Xe)) Za(s, a); } else { for (const s of v(this, Qn)) s(); - v(this, Qn).clear(), v(this, An) === 0 && gt(this, Fe, Wa).call(this), B = null, ta(r), ta(n), (i = v(this, qr)) == null || i.resolve(); + v(this, Qn).clear(), v(this, An) === 0 && _t(this, Fe, Ua).call(this), X = null, na(r), na(n), (i = v(this, qr)) == null || i.resolve(); } At = null; } @@ -356,17 +356,17 @@ const zs = class zs { * @param {any} value */ capture(e, n) { - n !== $t && !this.previous.has(e) && this.previous.set(e, n), (e.f & cn) === 0 && (this.current.set(e, e.v), At == null || At.set(e, e.v)); + n !== $t && !this.previous.has(e) && this.previous.set(e, n), (e.f & un) === 0 && (this.current.set(e, e.v), At == null || At.set(e, e.v)); } activate() { - B = this, this.apply(); + X = this, this.apply(); } deactivate() { - B === this && (B = null, At = null); + X === this && (X = null, At = null); } flush() { if (this.activate(), Vt.length > 0) { - if (Ua(), B !== null && B !== this) + if (Ga(), X !== null && X !== this) return; } else v(this, An) === 0 && this.process([]); this.deactivate(); @@ -380,22 +380,22 @@ const zs = class zs { * @param {boolean} blocking */ increment(e) { - F(this, An, v(this, An) + 1), e && F(this, er, v(this, er) + 1); + O(this, An, v(this, An) + 1), e && O(this, er, v(this, er) + 1); } /** * * @param {boolean} blocking */ decrement(e) { - F(this, An, v(this, An) - 1), e && F(this, er, v(this, er) - 1), !v(this, nr) && (F(this, nr, !0), kn(() => { - F(this, nr, !1), this.is_deferred() ? Vt.length > 0 && this.flush() : this.revive(); + O(this, An, v(this, An) - 1), e && O(this, er, v(this, er) - 1), !v(this, nr) && (O(this, nr, !0), kn(() => { + O(this, nr, !1), this.is_deferred() ? Vt.length > 0 && this.flush() : this.revive(); })); } revive() { for (const e of v(this, Vr)) - v(this, En).delete(e), ot(e, Rt), ye(e); + v(this, En).delete(e), at(e, Rt), me(e); for (const e of v(this, En)) - ot(e, xe), ye(e); + at(e, we), me(e); this.flush(); } /** @param {() => void} fn */ @@ -407,21 +407,21 @@ const zs = class zs { v(this, tr).add(e); } settled() { - return (v(this, qr) ?? F(this, qr, Pa())).promise; + return (v(this, qr) ?? O(this, qr, Da())).promise; } static ensure() { - if (B === null) { - const e = B = new zs(); - Zr.add(B), kr || kn(() => { - B === e && e.flush(); + if (X === null) { + const e = X = new zs(); + Kr.add(X), kr || kn(() => { + X === e && e.flush(); }); } - return B; + return X; } apply() { } }; -Qn = new WeakMap(), tr = new WeakMap(), An = new WeakMap(), er = new WeakMap(), qr = new WeakMap(), Vr = new WeakMap(), En = new WeakMap(), Ue = new WeakMap(), nr = new WeakMap(), Fe = new WeakSet(), /** +Qn = new WeakMap(), tr = new WeakMap(), An = new WeakMap(), er = new WeakMap(), qr = new WeakMap(), Vr = new WeakMap(), En = new WeakMap(), Xe = new WeakMap(), nr = new WeakMap(), Fe = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root @@ -431,9 +431,9 @@ Qn = new WeakMap(), tr = new WeakMap(), An = new WeakMap(), er = new WeakMap(), rs = function(e, n, r) { e.f ^= yt; for (var i = e.first, s = null; i !== null; ) { - var a = i.f, o = (a & (be | pn)) !== 0, l = o && (a & yt) !== 0, u = l || (a & jt) !== 0 || v(this, Ue).has(i); + var a = i.f, o = (a & (xe | hn)) !== 0, l = o && (a & yt) !== 0, u = l || (a & te) !== 0 || v(this, Xe).has(i); if (!u && i.fn !== null) { - o ? i.f ^= yt : s !== null && (a & (Pr | Ti | Da)) !== 0 ? s.b.defer_effect(i) : (a & Pr) !== 0 ? n.push(i) : Br(i) && ((a & nn) !== 0 && v(this, En).add(i), hr(i)); + o ? i.f ^= yt : s !== null && (a & (Mr | Ci | Fa)) !== 0 ? s.b.defer_effect(i) : (a & Mr) !== 0 ? n.push(i) : Br(i) && ((a & Qe) !== 0 && v(this, En).add(i), hr(i)); var f = i.first; if (f !== null) { i = f; @@ -449,13 +449,13 @@ rs = function(e, n, r) { */ is = function(e) { for (var n = 0; n < e.length; n += 1) - Ba(e[n], v(this, Vr), v(this, En)); -}, Wa = function() { + Wa(e[n], v(this, Vr), v(this, En)); +}, Ua = function() { var i; - if (Zr.size > 1) { + if (Kr.size > 1) { this.previous.clear(); var e = At, n = !0; - for (const s of Zr) { + for (const s of Kr) { if (s === this) { n = !1; continue; @@ -477,107 +477,107 @@ is = function(e) { Vt = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - Ga(f, o, l, u); + Ka(f, o, l, u); if (Vt.length > 0) { - B = s, s.apply(); + X = s, s.apply(); for (const f of Vt) - gt(i = s, Fe, rs).call(i, f, [], []); + _t(i = s, Fe, rs).call(i, f, [], []); s.deactivate(); } Vt = r; } } - B = null, At = e; + X = null, At = e; } - this.committed = !0, Zr.delete(this); + this.committed = !0, Kr.delete(this); }; -let tn = zs; +let Ze = zs; function ft(t) { var e = kr; kr = !0; try { for (var n; ; ) { - if (tu(), Vt.length === 0 && (B == null || B.flush(), Vt.length === 0)) - return ki = null, /** @type {T} */ + if (tu(), Vt.length === 0 && (X == null || X.flush(), Vt.length === 0)) + return Si = null, /** @type {T} */ n; - Ua(); + Ga(); } } finally { kr = e; } } -function Ua() { +function Ga() { ns = !0; var t = null; try { for (var e = 0; Vt.length > 0; ) { - var n = tn.ensure(); + var n = Ze.ensure(); if (e++ > 1e3) { var r, i; nu(); } - n.process(Vt), hn.clear(); + n.process(Vt), fn.clear(); } } finally { - Vt = [], ns = !1, ki = null; + Vt = [], ns = !1, Si = null; } } function nu() { try { Xl(); } catch (t) { - fr(t, ki); + fr(t, Si); } } -let ve = null; -function ta(t) { +let pe = null; +function na(t) { var e = t.length; if (e !== 0) { for (var n = 0; n < e; ) { var r = t[n++]; - if ((r.f & (Qe | jt)) === 0 && Br(r) && (ve = /* @__PURE__ */ new Set(), hr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && vo(r), (ve == null ? void 0 : ve.size) > 0)) { - hn.clear(); - for (const i of ve) { - if ((i.f & (Qe | jt)) !== 0) continue; + if ((r.f & (Je | te)) === 0 && Br(r) && (pe = /* @__PURE__ */ new Set(), hr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && go(r), (pe == null ? void 0 : pe.size) > 0)) { + fn.clear(); + for (const i of pe) { + if ((i.f & (Je | te)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - ve.has(a) && (ve.delete(a), s.push(a)), a = a.parent; + pe.has(a) && (pe.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (Qe | jt)) === 0 && hr(l); + (l.f & (Je | te)) === 0 && hr(l); } } - ve.clear(); + pe.clear(); } } - ve = null; + pe = null; } } -function Ga(t, e, n, r) { +function Ka(t, e, n, r) { if (!n.has(t) && (n.add(t), t.reactions !== null)) for (const i of t.reactions) { const s = i.f; - (s & Et) !== 0 ? Ga( + (s & Et) !== 0 ? Ka( /** @type {Derived} */ i, e, n, r - ) : (s & (As | nn)) !== 0 && (s & Rt) === 0 && Ka(i, e, r) && (ot(i, Rt), ye( + ) : (s & (As | Qe)) !== 0 && (s & Rt) === 0 && Ja(i, e, r) && (at(i, Rt), me( /** @type {Effect} */ i )); } } -function Ka(t, e, n) { +function Ja(t, e, n) { const r = n.get(t); if (r !== void 0) return r; if (t.deps !== null) for (const i of t.deps) { if (or.call(e, i)) return !0; - if ((i.f & Et) !== 0 && Ka( + if ((i.f & Et) !== 0 && Ja( /** @type {Derived} */ i, e, @@ -591,13 +591,13 @@ function Ka(t, e, n) { } return n.set(t, !1), !1; } -function ye(t) { - for (var e = ki = t; e.parent !== null; ) { +function me(t) { + for (var e = Si = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (ns && e === U && (n & nn) !== 0 && (n & Ia) === 0) + if (ns && e === W && (n & Qe) !== 0 && (n & Oa) === 0) return; - if ((n & (pn | be)) !== 0) { + if ((n & (hn | xe)) !== 0) { if ((n & yt) === 0) return; e.f ^= yt; } @@ -605,8 +605,8 @@ function ye(t) { Vt.push(e); } function Za(t, e) { - if (!((t.f & be) !== 0 && (t.f & yt) !== 0)) { - (t.f & Rt) !== 0 ? e.d.push(t) : (t.f & xe) !== 0 && e.m.push(t), ot(t, yt); + if (!((t.f & xe) !== 0 && (t.f & yt) !== 0)) { + (t.f & Rt) !== 0 ? e.d.push(t) : (t.f & we) !== 0 && e.m.push(t), at(t, yt); for (var n = t.first; n !== null; ) Za(n, e), n = n.next; } @@ -614,18 +614,18 @@ function Za(t, e) { function ru(t) { let e = 0, n = In(0), r; return () => { - Ss() && (x(n), Ms(() => (e === 0 && (r = Di(() => t(() => Mr(n)))), e += 1, () => { + Ss() && (x(n), Ps(() => (e === 0 && (r = Mi(() => t(() => Pr(n)))), e += 1, () => { kn(() => { - e -= 1, e === 0 && (r == null || r(), r = void 0, Mr(n)); + e -= 1, e === 0 && (r == null || r(), r = void 0, Pr(n)); }); }))); }; } -var iu = lr | Yn | Fa; +var iu = lr | Yn | Ia; function su(t, e, n) { new au(t, e, n); } -var Kt, Yr, Te, Rn, Ne, ie, qt, Se, Ge, un, Cn, Ke, rr, Tn, ir, sr, Ze, Ai, ct, ja, Ja, ss, ri, ii, as; +var jt, Yr, Te, Rn, Ne, se, qt, Se, Be, on, Cn, We, rr, Tn, ir, sr, Ue, $i, ct, ja, Qa, ss, ni, ri, as; class au { /** * @param {TemplateNode} node @@ -633,38 +633,38 @@ class au { * @param {((anchor: Node) => void)} children */ constructor(e, n, r) { - q(this, ct); + L(this, ct); /** @type {Boundary | null} */ - st(this, "parent"); - st(this, "is_pending", !1); + it(this, "parent"); + it(this, "is_pending", !1); /** @type {TemplateNode} */ - q(this, Kt); + L(this, jt); /** @type {TemplateNode | null} */ - q(this, Yr, Z ? H : null); + L(this, Yr, J ? H : null); /** @type {BoundaryProps} */ - q(this, Te); + L(this, Te); /** @type {((anchor: Node) => void)} */ - q(this, Rn); + L(this, Rn); /** @type {Effect} */ - q(this, Ne); + L(this, Ne); /** @type {Effect | null} */ - q(this, ie, null); + L(this, se, null); /** @type {Effect | null} */ - q(this, qt, null); + L(this, qt, null); /** @type {Effect | null} */ - q(this, Se, null); + L(this, Se, null); /** @type {DocumentFragment | null} */ - q(this, Ge, null); + L(this, Be, null); /** @type {TemplateNode | null} */ - q(this, un, null); - q(this, Cn, 0); - q(this, Ke, 0); - q(this, rr, !1); - q(this, Tn, !1); + L(this, on, null); + L(this, Cn, 0); + L(this, We, 0); + L(this, rr, !1); + L(this, Tn, !1); /** @type {Set} */ - q(this, ir, /* @__PURE__ */ new Set()); + L(this, ir, /* @__PURE__ */ new Set()); /** @type {Set} */ - q(this, sr, /* @__PURE__ */ new Set()); + L(this, sr, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -672,38 +672,38 @@ class au { * calls followed by no-op flushes * @type {Source | null} */ - q(this, Ze, null); - q(this, Ai, ru(() => (F(this, Ze, In(v(this, Cn))), () => { - F(this, Ze, null); + L(this, Ue, null); + L(this, $i, ru(() => (O(this, Ue, In(v(this, Cn))), () => { + O(this, Ue, null); }))); - F(this, Kt, e), F(this, Te, n), F(this, Rn, r), this.parent = /** @type {Effect} */ - U.b, this.is_pending = !!v(this, Te).pending, F(this, Ne, Ps(() => { - if (U.b = this, Z) { + O(this, jt, e), O(this, Te, n), O(this, Rn, r), this.parent = /** @type {Effect} */ + W.b, this.is_pending = !!v(this, Te).pending, O(this, Ne, Ms(() => { + if (W.b = this, J) { const s = v(this, Yr); - Si(), /** @type {Comment} */ + Ni(), /** @type {Comment} */ s.nodeType === gr && /** @type {Comment} */ - s.data === Ri ? gt(this, ct, Ja).call(this) : (gt(this, ct, ja).call(this), v(this, Ke) === 0 && (this.is_pending = !1)); + s.data === Ei ? _t(this, ct, Qa).call(this) : (_t(this, ct, ja).call(this), v(this, We) === 0 && (this.is_pending = !1)); } else { - var i = gt(this, ct, ss).call(this); + var i = _t(this, ct, ss).call(this); try { - F(this, ie, ae(() => r(i))); + O(this, se, oe(() => r(i))); } catch (s) { this.error(s); } - v(this, Ke) > 0 ? gt(this, ct, ii).call(this) : this.is_pending = !1; + v(this, We) > 0 ? _t(this, ct, ri).call(this) : this.is_pending = !1; } return () => { var s; - (s = v(this, un)) == null || s.remove(); + (s = v(this, on)) == null || s.remove(); }; - }, iu)), Z && F(this, Kt, H); + }, iu)), J && O(this, jt, H); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ defer_effect(e) { - Ba(e, v(this, ir), v(this, sr)); + Wa(e, v(this, ir), v(this, sr)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -722,14 +722,14 @@ class au { * @param {1 | -1} d */ update_pending_count(e) { - gt(this, ct, as).call(this, e), F(this, Cn, v(this, Cn) + e), !(!v(this, Ze) || v(this, rr)) && (F(this, rr, !0), kn(() => { - F(this, rr, !1), v(this, Ze) && cr(v(this, Ze), v(this, Cn)); + _t(this, ct, as).call(this, e), O(this, Cn, v(this, Cn) + e), !(!v(this, Ue) || v(this, rr)) && (O(this, rr, !0), kn(() => { + O(this, rr, !1), v(this, Ue) && cr(v(this, Ue), v(this, Cn)); })); } get_effect_pending() { - return v(this, Ai).call(this), x( + return v(this, $i).call(this), x( /** @type {Source} */ - v(this, Ze) + v(this, Ue) ); } /** @param {unknown} error */ @@ -738,19 +738,19 @@ class au { let r = v(this, Te).failed; if (v(this, Tn) || !n && !r) throw e; - v(this, ie) && (Dt(v(this, ie)), F(this, ie, null)), v(this, qt) && (Dt(v(this, qt)), F(this, qt, null)), v(this, Se) && (Dt(v(this, Se)), F(this, Se, null)), Z && (zt( + v(this, se) && (Ft(v(this, se)), O(this, se, null)), v(this, qt) && (Ft(v(this, qt)), O(this, qt, null)), v(this, Se) && (Ft(v(this, Se)), O(this, Se, null)), J && (zt( /** @type {TemplateNode} */ v(this, Yr) - ), es(), zt(vi())); + ), es(), zt(pi())); var i = !1, s = !1; const a = () => { if (i) { - jl(); + Zl(); return; } - i = !0, s && Zl(), tn.ensure(), F(this, Cn, 0), v(this, Se) !== null && Mn(v(this, Se), () => { - F(this, Se, null); - }), this.is_pending = this.has_pending_snippet(), F(this, ie, gt(this, ct, ri).call(this, () => (F(this, Tn, !1), ae(() => v(this, Rn).call(this, v(this, Kt)))))), v(this, Ke) > 0 ? gt(this, ct, ii).call(this) : this.is_pending = !1; + i = !0, s && Jl(), Ze.ensure(), O(this, Cn, 0), v(this, Se) !== null && Pn(v(this, Se), () => { + O(this, Se, null); + }), this.is_pending = this.has_pending_snippet(), O(this, se, _t(this, ct, ni).call(this, () => (O(this, Tn, !1), oe(() => v(this, Rn).call(this, v(this, jt)))))), v(this, We) > 0 ? _t(this, ct, ri).call(this) : this.is_pending = !1; }; kn(() => { try { @@ -758,12 +758,12 @@ class au { } catch (o) { fr(o, v(this, Ne) && v(this, Ne).parent); } - r && F(this, Se, gt(this, ct, ri).call(this, () => { - tn.ensure(), F(this, Tn, !0); + r && O(this, Se, _t(this, ct, ni).call(this, () => { + Ze.ensure(), O(this, Tn, !0); try { - return ae(() => { + return oe(() => { r( - v(this, Kt), + v(this, jt), () => e, () => a ); @@ -775,55 +775,55 @@ class au { v(this, Ne).parent ), null; } finally { - F(this, Tn, !1); + O(this, Tn, !1); } })); }); } } -Kt = new WeakMap(), Yr = new WeakMap(), Te = new WeakMap(), Rn = new WeakMap(), Ne = new WeakMap(), ie = new WeakMap(), qt = new WeakMap(), Se = new WeakMap(), Ge = new WeakMap(), un = new WeakMap(), Cn = new WeakMap(), Ke = new WeakMap(), rr = new WeakMap(), Tn = new WeakMap(), ir = new WeakMap(), sr = new WeakMap(), Ze = new WeakMap(), Ai = new WeakMap(), ct = new WeakSet(), ja = function() { +jt = new WeakMap(), Yr = new WeakMap(), Te = new WeakMap(), Rn = new WeakMap(), Ne = new WeakMap(), se = new WeakMap(), qt = new WeakMap(), Se = new WeakMap(), Be = new WeakMap(), on = new WeakMap(), Cn = new WeakMap(), We = new WeakMap(), rr = new WeakMap(), Tn = new WeakMap(), ir = new WeakMap(), sr = new WeakMap(), Ue = new WeakMap(), $i = new WeakMap(), ct = new WeakSet(), ja = function() { try { - F(this, ie, ae(() => v(this, Rn).call(this, v(this, Kt)))); + O(this, se, oe(() => v(this, Rn).call(this, v(this, jt)))); } catch (e) { this.error(e); } -}, Ja = function() { +}, Qa = function() { const e = v(this, Te).pending; - e && (F(this, qt, ae(() => e(v(this, Kt)))), kn(() => { - var n = gt(this, ct, ss).call(this); - F(this, ie, gt(this, ct, ri).call(this, () => (tn.ensure(), ae(() => v(this, Rn).call(this, n))))), v(this, Ke) > 0 ? gt(this, ct, ii).call(this) : (Mn( + e && (O(this, qt, oe(() => e(v(this, jt)))), kn(() => { + var n = _t(this, ct, ss).call(this); + O(this, se, _t(this, ct, ni).call(this, () => (Ze.ensure(), oe(() => v(this, Rn).call(this, n))))), v(this, We) > 0 ? _t(this, ct, ri).call(this) : (Pn( /** @type {Effect} */ v(this, qt), () => { - F(this, qt, null); + O(this, qt, null); } ), this.is_pending = !1); })); }, ss = function() { - var e = v(this, Kt); - return this.is_pending && (F(this, un, ue()), v(this, Kt).before(v(this, un)), e = v(this, un)), e; + var e = v(this, jt); + return this.is_pending && (O(this, on, fe()), v(this, jt).before(v(this, on)), e = v(this, on)), e; }, /** * @param {() => Effect | null} fn */ -ri = function(e) { - var n = U, r = Y, i = Jt; - De(v(this, Ne)), fe(v(this, Ne)), ur(v(this, Ne).ctx); +ni = function(e) { + var n = W, r = Y, i = ee; + De(v(this, Ne)), ce(v(this, Ne)), ur(v(this, Ne).ctx); try { return e(); } catch (s) { - return za(s), null; + return Xa(s), null; } finally { - De(n), fe(r), ur(i); + De(n), ce(r), ur(i); } -}, ii = function() { +}, ri = function() { const e = ( /** @type {(anchor: Node) => void} */ v(this, Te).pending ); - v(this, ie) !== null && (F(this, Ge, document.createDocumentFragment()), v(this, Ge).append( + v(this, se) !== null && (O(this, Be, document.createDocumentFragment()), v(this, Be).append( /** @type {TemplateNode} */ - v(this, un) - ), mo(v(this, ie), v(this, Ge))), v(this, qt) === null && F(this, qt, ae(() => e(v(this, Kt)))); + v(this, on) + ), yo(v(this, se), v(this, Be))), v(this, qt) === null && O(this, qt, oe(() => e(v(this, jt)))); }, /** * 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 @@ -832,37 +832,37 @@ ri = function(e) { as = function(e) { var n; if (!this.has_pending_snippet()) { - this.parent && gt(n = this.parent, ct, as).call(n, e); + this.parent && _t(n = this.parent, ct, as).call(n, e); return; } - if (F(this, Ke, v(this, Ke) + e), v(this, Ke) === 0) { + if (O(this, We, v(this, We) + e), v(this, We) === 0) { this.is_pending = !1; for (const r of v(this, ir)) - ot(r, Rt), ye(r); + at(r, Rt), me(r); for (const r of v(this, sr)) - ot(r, xe), ye(r); - v(this, ir).clear(), v(this, sr).clear(), v(this, qt) && Mn(v(this, qt), () => { - F(this, qt, null); - }), v(this, Ge) && (v(this, Kt).before(v(this, Ge)), F(this, Ge, null)); + at(r, we), me(r); + v(this, ir).clear(), v(this, sr).clear(), v(this, qt) && Pn(v(this, qt), () => { + O(this, qt, null); + }), v(this, Be) && (v(this, jt).before(v(this, Be)), O(this, Be, null)); } }; function ou(t, e, n, r) { - const i = Mi; + const i = ki; var s = t.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { r(e.map(i)); return; } - var a = B, o = ( + var a = X, o = ( /** @type {Effect} */ - U + W ), l = lu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; function f(c) { l(); try { r(c); } catch (p) { - (o.f & Qe) === 0 && fr(p, o); + (o.f & Je) === 0 && fr(p, o); } a == null || a.deactivate(), os(); } @@ -876,25 +876,25 @@ function ou(t, e, n, r) { u ? u.then(h) : h(); } function lu() { - var t = U, e = Y, n = Jt, r = B; + var t = W, e = Y, n = ee, r = X; return function(s = !0) { - De(t), fe(e), ur(n), s && (r == null || r.activate()); + De(t), ce(e), ur(n), s && (r == null || r.activate()); }; } function os() { - De(null), fe(null), ur(null); + De(null), ce(null), ur(null); } // @__NO_SIDE_EFFECTS__ -function Mi(t) { +function ki(t) { var e = Et | Rt, n = Y !== null && (Y.f & Et) !== 0 ? ( /** @type {Derived} */ Y ) : null; - return U !== null && (U.f |= Yn), { - ctx: Jt, + return W !== null && (W.f |= Yn), { + ctx: ee, deps: null, effects: null, - equals: qa, + equals: Va, f: e, fn: t, reactions: null, @@ -904,7 +904,7 @@ function Mi(t) { $t ), wv: 0, - parent: n ?? U, + parent: n ?? W, ac: null }; } @@ -912,7 +912,7 @@ function Mi(t) { function uu(t, e, n) { let r = ( /** @type {Effect | null} */ - U + W ); r === null && ql(); var i = ( @@ -928,31 +928,31 @@ function uu(t, e, n) { ), o = !Y, l = /* @__PURE__ */ new Map(); return yu(() => { var p; - var u = Pa(); + var u = Da(); s = u.promise; try { Promise.resolve(t()).then(u.resolve, u.reject).then(() => { - f === B && f.committed && f.deactivate(), os(); + f === X && f.committed && f.deactivate(), os(); }); } catch (g) { u.reject(g), os(); } var f = ( /** @type {Batch} */ - B + X ); if (o) { var h = i.is_rendered(); i.update_pending_count(1), f.increment(h), (p = l.get(f)) == null || p.reject(yn), l.delete(f), l.set(f, u); } - const c = (g, m = void 0) => { - if (f.activate(), m) - m !== yn && (a.f |= cn, cr(a, m)); + const c = (g, y = void 0) => { + if (f.activate(), y) + y !== yn && (a.f |= un, cr(a, y)); else { - (a.f & cn) !== 0 && (a.f ^= cn), cr(a, g); - for (const [b, $] of l) { - if (l.delete(b), b === f) break; - $.reject(yn); + (a.f & un) !== 0 && (a.f ^= un), cr(a, g); + for (const [$, E] of l) { + if (l.delete($), $ === f) break; + E.reject(yn); } } o && (i.update_pending_count(-1), f.decrement(h)); @@ -973,20 +973,20 @@ function uu(t, e, n) { } // @__NO_SIDE_EFFECTS__ function Gn(t) { - const e = /* @__PURE__ */ Mi(t); - return yo(e), e; + const e = /* @__PURE__ */ ki(t); + return wo(e), e; } // @__NO_SIDE_EFFECTS__ -function Qa(t) { - const e = /* @__PURE__ */ Mi(t); - return e.equals = Va, e; +function to(t) { + const e = /* @__PURE__ */ ki(t); + return e.equals = Ya, e; } function fu(t) { var e = t.effects; if (e !== null) { t.effects = null; for (var n = 0; n < e.length; n += 1) - Dt( + Ft( /** @type {Effect} */ e[n] ); @@ -995,7 +995,7 @@ function fu(t) { function cu(t) { for (var e = t.parent; e !== null; ) { if ((e.f & Et) === 0) - return (e.f & Qe) === 0 ? ( + return (e.f & Je) === 0 ? ( /** @type {Effect} */ e ) : null; @@ -1004,22 +1004,22 @@ function cu(t) { return null; } function Ts(t) { - var e, n = U; + var e, n = W; De(cu(t)); try { - t.f &= ~Fn, fu(t), e = $o(t); + t.f &= ~Fn, fu(t), e = Ao(t); } finally { De(n); } return e; } -function to(t) { +function eo(t) { var e = Ts(t); - if (!t.equals(e) && (t.wv = xo(), (!(B != null && B.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { - ot(t, yt); + if (!t.equals(e) && (t.wv = bo(), (!(X != null && X.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { + at(t, yt); return; } - dn || (At !== null ? (Ss() || B != null && B.is_fork) && At.set(t, e) : Cs(t)); + cn || (At !== null ? (Ss() || X != null && X.is_fork) && At.set(t, e) : Cs(t)); } function hu(t) { var e, n; @@ -1027,21 +1027,21 @@ function hu(t) { for (const r of t.effects) (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(yn), r.teardown = Dl, r.ac = null, Dr(r, 0), Ds(r)); } -function eo(t) { +function no(t) { if (t.effects !== null) for (const e of t.effects) e.teardown && hr(e); } let ls = /* @__PURE__ */ new Set(); -const hn = /* @__PURE__ */ new Map(); -let no = !1; +const fn = /* @__PURE__ */ new Map(); +let ro = !1; function In(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: t, reactions: null, - equals: qa, + equals: Va, rv: 0, wv: 0 }; @@ -1050,25 +1050,25 @@ function In(t, e) { // @__NO_SIDE_EFFECTS__ function mt(t, e) { const n = In(t); - return yo(n), n; + return wo(n), n; } // @__NO_SIDE_EFFECTS__ -function ro(t, e = !1, n = !0) { +function io(t, e = !1, n = !0) { const r = In(t); - return e || (r.equals = Va), r; + return e || (r.equals = Ya), r; } -function at(t, e, n = !1) { +function st(t, e, n = !1) { Y !== 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 - (!we || (Y.f & Qs) !== 0) && Ya() && (Y.f & (Et | nn | As | Qs)) !== 0 && (le === null || !or.call(le, t)) && Kl(); + (!ye || (Y.f & ea) !== 0) && Ha() && (Y.f & (Et | Qe | As | ea)) !== 0 && (ue === null || !or.call(ue, t)) && Kl(); let r = n ? xn(e) : e; return cr(t, r); } function cr(t, e) { if (!t.equals(e)) { var n = t.v; - dn ? hn.set(t, e) : hn.set(t, n), t.v = e; - var r = tn.ensure(); + cn ? fn.set(t, e) : fn.set(t, n), t.v = e; + var r = Ze.ensure(); if (r.capture(t, n), (t.f & Et) !== 0) { const i = ( /** @type {Derived} */ @@ -1076,34 +1076,34 @@ function cr(t, e) { ); (t.f & Rt) !== 0 && Ts(i), Cs(i); } - t.wv = xo(), io(t, Rt), U !== null && (U.f & yt) !== 0 && (U.f & (be | pn)) === 0 && (re === null ? bu([t]) : re.push(t)), !r.is_fork && ls.size > 0 && !no && du(); + t.wv = bo(), so(t, Rt), W !== null && (W.f & yt) !== 0 && (W.f & (xe | hn)) === 0 && (ie === null ? bu([t]) : ie.push(t)), !r.is_fork && ls.size > 0 && !ro && du(); } return e; } function du() { - no = !1; + ro = !1; for (const t of ls) - (t.f & yt) !== 0 && ot(t, xe), Br(t) && hr(t); + (t.f & yt) !== 0 && at(t, we), Br(t) && hr(t); ls.clear(); } -function Mr(t) { - at(t, t.v + 1); +function Pr(t) { + st(t, t.v + 1); } -function io(t, e) { +function so(t, e) { var n = t.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { var s = n[i], a = s.f, o = (a & Rt) === 0; - if (o && ot(s, e), (a & Et) !== 0) { + if (o && at(s, e), (a & Et) !== 0) { var l = ( /** @type {Derived} */ s ); - At == null || At.delete(l), (a & Fn) === 0 && (a & oe && (s.f |= Fn), io(l, xe)); - } else o && ((a & nn) !== 0 && ve !== null && ve.add( + At == null || At.delete(l), (a & Fn) === 0 && (a & le && (s.f |= Fn), so(l, we)); + } else o && ((a & Qe) !== 0 && pe !== null && pe.add( /** @type {Effect} */ s - ), ye( + ), me( /** @type {Effect} */ s )); @@ -1112,16 +1112,16 @@ function io(t, e) { function xn(t) { if (typeof t != "object" || t === null || Sr in t) return t; - const e = Pl(t); - if (e !== kl && e !== Ml) + const e = Ml(t); + if (e !== kl && e !== Pl) return t; - var n = /* @__PURE__ */ new Map(), r = Ma(t), i = /* @__PURE__ */ mt(0), s = Pn, a = (o) => { - if (Pn === s) + var n = /* @__PURE__ */ new Map(), r = Ma(t), i = /* @__PURE__ */ mt(0), s = Mn, a = (o) => { + if (Mn === s) return o(); - var l = Y, u = Pn; - fe(null), ra(s); + var l = Y, u = Mn; + ce(null), sa(s); var f = o(); - return fe(l), ra(u), f; + return ce(l), sa(u), f; }; return r && n.set("length", /* @__PURE__ */ mt( /** @type {any[]} */ @@ -1136,17 +1136,17 @@ function xn(t) { return f === void 0 ? a(() => { var h = /* @__PURE__ */ mt(u.value); return n.set(l, h), h; - }) : at(f, u.value, !0), !0; + }) : st(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__ */ mt($t)); - n.set(l, f), Mr(i); + n.set(l, f), Pr(i); } } else - at(u, $t), Mr(i); + st(u, $t), Pr(i); return !0; }, get(o, l, u) { @@ -1155,8 +1155,8 @@ function xn(t) { return t; var f = n.get(l), h = l in o; if (f === void 0 && (!h || (p = Sn(o, l)) != null && p.writable) && (f = a(() => { - var g = xn(h ? o[l] : $t), m = /* @__PURE__ */ mt(g); - return m; + var g = xn(h ? o[l] : $t), y = /* @__PURE__ */ mt(g); + return y; }), n.set(l, f)), f !== void 0) { var c = x(f); return c === $t ? void 0 : c; @@ -1185,7 +1185,7 @@ function xn(t) { if (l === Sr) return !0; var u = n.get(l), f = u !== void 0 && u.v !== $t || Reflect.has(o, l); - if (u !== void 0 || U !== null && (!f || (c = Sn(o, l)) != null && c.writable)) { + if (u !== void 0 || W !== null && (!f || (c = Sn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { var p = f ? xn(o[l]) : $t, g = /* @__PURE__ */ mt(p); return g; @@ -1197,31 +1197,31 @@ function xn(t) { return f; }, set(o, l, u, f) { - var E; + var C; var h = n.get(l), c = l in o; if (r && l === "length") for (var p = u; p < /** @type {Source} */ h.v; p += 1) { var g = n.get(p + ""); - g !== void 0 ? at(g, $t) : p in o && (g = a(() => /* @__PURE__ */ mt($t)), n.set(p + "", g)); + g !== void 0 ? st(g, $t) : p in o && (g = a(() => /* @__PURE__ */ mt($t)), n.set(p + "", g)); } if (h === void 0) - (!c || (E = Sn(o, l)) != null && E.writable) && (h = a(() => /* @__PURE__ */ mt(void 0)), at(h, xn(u)), n.set(l, h)); + (!c || (C = Sn(o, l)) != null && C.writable) && (h = a(() => /* @__PURE__ */ mt(void 0)), st(h, xn(u)), n.set(l, h)); else { c = h.v !== $t; - var m = a(() => xn(u)); - at(h, m); + var y = a(() => xn(u)); + st(h, y); } - var b = Reflect.getOwnPropertyDescriptor(o, l); - if (b != null && b.set && b.set.call(f, u), !c) { + var $ = Reflect.getOwnPropertyDescriptor(o, l); + if ($ != null && $.set && $.set.call(f, u), !c) { if (r && typeof l == "string") { - var $ = ( + var E = ( /** @type {Source} */ n.get("length") - ), C = Number(l); - Number.isInteger(C) && C >= $.v && at($, C + 1); + ), S = Number(l); + Number.isInteger(S) && S >= E.v && st(E, S + 1); } - Mr(i); + Pr(i); } return !0; }, @@ -1241,39 +1241,39 @@ function xn(t) { } ); } -var ea, so, ao, oo; +var ra, ao, oo, lo; function us() { - if (ea === void 0) { - ea = window, so = /Firefox/.test(navigator.userAgent); + if (ra === void 0) { + ra = window, ao = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype, n = Text.prototype; - ao = Sn(e, "firstChild").get, oo = Sn(e, "nextSibling").get, Js(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), Js(n) && (n.__t = void 0); + oo = Sn(e, "firstChild").get, lo = Sn(e, "nextSibling").get, ta(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), ta(n) && (n.__t = void 0); } } -function ue(t = "") { +function fe(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ function On(t) { return ( /** @type {TemplateNode | null} */ - ao.call(t) + oo.call(t) ); } // @__NO_SIDE_EFFECTS__ function Ie(t) { return ( /** @type {TemplateNode | null} */ - oo.call(t) + lo.call(t) ); } -function Ut(t, e) { - if (!Z) +function Jt(t, e) { + if (!J) return /* @__PURE__ */ On(t); var n = /* @__PURE__ */ On(H); if (n === null) - n = H.appendChild(ue()); + n = H.appendChild(fe()); else if (e && n.nodeType !== Xr) { - var r = ue(); + var r = fe(); return n == null || n.before(r), zt(r), r; } return e && Pi( @@ -1282,13 +1282,13 @@ function Ut(t, e) { ), zt(n), n; } function gn(t, e = !1) { - if (!Z) { + if (!J) { var n = /* @__PURE__ */ On(t); return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ie(n) : n; } if (e) { if ((H == null ? void 0 : H.nodeType) !== Xr) { - var r = ue(); + var r = fe(); return H == null || H.before(r), zt(r), r; } Pi( @@ -1298,16 +1298,16 @@ function gn(t, e = !1) { } return H; } -function pe(t, e = 1, n = !1) { - let r = Z ? H : t; +function de(t, e = 1, n = !1) { + let r = J ? H : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ /* @__PURE__ */ Ie(r); - if (!Z) + if (!J) return r; if (n) { if ((r == null ? void 0 : r.nodeType) !== Xr) { - var s = ue(); + var s = fe(); return r === null ? i == null || i.after(s) : r.before(s), zt(s), s; } Pi( @@ -1317,10 +1317,10 @@ function pe(t, e = 1, n = !1) { } return zt(r), r; } -function lo(t) { +function uo(t) { t.textContent = ""; } -function uo() { +function fo() { return !1; } function Ns(t, e, n) { @@ -1340,30 +1340,30 @@ function Pi(t) { e.remove(), t.nodeValue += /** @type {string} */ e.nodeValue, e = t.nextSibling; } -function fo(t) { - var e = Y, n = U; - fe(null), De(null); +function co(t) { + var e = Y, n = W; + ce(null), De(null); try { return t(); } finally { - fe(e), De(n); + ce(e), De(n); } } function pu(t) { - U === null && (Y === null && zl(), Hl()), dn && Yl(); + W === null && (Y === null && zl(), Hl()), cn && Yl(); } function vu(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } function Oe(t, e, n) { - var r = U; - r !== null && (r.f & jt) !== 0 && (t |= jt); + var r = W; + r !== null && (r.f & te) !== 0 && (t |= te); var i = { - ctx: Jt, + ctx: ee, deps: null, nodes: null, - f: t | Rt | oe, + f: t | Rt | le, first: null, fn: e, last: null, @@ -1379,12 +1379,12 @@ function Oe(t, e, n) { try { hr(i); } catch (o) { - throw Dt(i), o; + throw Ft(i), o; } - else e !== null && ye(i); + else e !== null && me(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 & Yn) === 0 && (s = s.first, (t & nn) !== 0 && (t & lr) !== 0 && s !== null && (s.f |= lr)), s !== null && (s.parent = r, r !== null && vu(s, r), Y !== null && (Y.f & Et) !== 0 && (t & pn) === 0)) { + (s.f & Yn) === 0 && (s = s.first, (t & Qe) !== 0 && (t & lr) !== 0 && s !== null && (s.f |= lr)), s !== null && (s.parent = r, r !== null && vu(s, r), Y !== null && (Y.f & Et) !== 0 && (t & hn) === 0)) { var a = ( /** @type {Derived} */ Y @@ -1394,76 +1394,76 @@ function Oe(t, e, n) { return i; } function Ss() { - return Y !== null && !we; + return Y !== null && !ye; } function gu(t) { - const e = Oe(Ti, null, !1); - return ot(e, yt), e.teardown = t, e; + const e = Oe(Ci, null, !1); + return at(e, yt), e.teardown = t, e; } function ks(t) { pu(); var e = ( /** @type {Effect} */ - U.f - ), n = !Y && (e & be) !== 0 && (e & vr) === 0; + W.f + ), n = !Y && (e & xe) !== 0 && (e & vr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - Jt + ee ); (r.e ?? (r.e = [])).push(t); } else - return co(t); + return ho(t); } -function co(t) { - return Oe(Pr | Ol, t, !1); +function ho(t) { + return Oe(Mr | Ol, t, !1); } function _u(t) { - tn.ensure(); - const e = Oe(pn | Yn, t, !0); + Ze.ensure(); + const e = Oe(hn | Yn, t, !0); return () => { - Dt(e); + Ft(e); }; } function mu(t) { - tn.ensure(); - const e = Oe(pn | Yn, t, !0); + Ze.ensure(); + const e = Oe(hn | Yn, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Mn(e, () => { - Dt(e), r(void 0); - }) : (Dt(e), r(void 0)); + n.outro ? Pn(e, () => { + Ft(e), r(void 0); + }) : (Ft(e), r(void 0)); }); } -function ho(t) { - return Oe(Pr, t, !1); +function po(t) { + return Oe(Mr, t, !1); } function yu(t) { return Oe(As | Yn, t, !0); } -function Ms(t, e = 0) { - return Oe(Ti | e, t, !0); +function Ps(t, e = 0) { + return Oe(Ci | e, t, !0); } function Kn(t, e = [], n = [], r = []) { ou(r, e, n, (i) => { - Oe(Ti, () => t(...i.map(x)), !0); + Oe(Ci, () => t(...i.map(x)), !0); }); } -function Ps(t, e = 0) { - var n = Oe(nn | e, t, !0); +function Ms(t, e = 0) { + var n = Oe(Qe | e, t, !0); return n; } -function ae(t) { - return Oe(be | Yn, t, !0); +function oe(t) { + return Oe(xe | Yn, t, !0); } -function po(t) { +function vo(t) { var e = t.teardown; if (e !== null) { - const n = dn, r = Y; - na(!0), fe(null); + const n = cn, r = Y; + ia(!0), ce(null); try { e.call(null); } finally { - na(n), fe(r); + ia(n), ce(r); } } } @@ -1471,33 +1471,33 @@ function Ds(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { const i = n.ac; - i !== null && fo(() => { + i !== null && co(() => { i.abort(yn); }); var r = n.next; - (n.f & pn) !== 0 ? n.parent = null : Dt(n, e), n = r; + (n.f & hn) !== 0 ? n.parent = null : Ft(n, e), n = r; } } function wu(t) { for (var e = t.first; e !== null; ) { var n = e.next; - (e.f & be) === 0 && Dt(e), e = n; + (e.f & xe) === 0 && Ft(e), e = n; } } -function Dt(t, e = !0) { +function Ft(t, e = !0) { var n = !1; - (e || (t.f & Ia) !== 0) && t.nodes !== null && t.nodes.end !== null && (xu( + (e || (t.f & Oa) !== 0) && t.nodes !== null && t.nodes.end !== null && (xu( t.nodes.start, /** @type {TemplateNode} */ t.nodes.end - ), n = !0), Ds(t, e && !n), Dr(t, 0), ot(t, Qe); + ), n = !0), Ds(t, e && !n), Dr(t, 0), at(t, Je); var r = t.nodes && t.nodes.t; if (r !== null) for (const s of r) s.stop(); - po(t); + vo(t); var i = t.parent; - i !== null && i.first !== null && vo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; + i !== null && i.first !== null && go(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; } function xu(t, e) { for (; t !== null; ) { @@ -1505,15 +1505,15 @@ function xu(t, e) { t.remove(), t = n; } } -function vo(t) { +function go(t) { var e = t.parent, n = t.prev, r = t.next; n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); } -function Mn(t, e, n = !0) { +function Pn(t, e, n = !0) { var r = []; - go(t, r, !0); + _o(t, r, !0); var i = () => { - n && Dt(t), e && e(); + n && Ft(t), e && e(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1522,9 +1522,9 @@ function Mn(t, e, n = !0) { } else i(); } -function go(t, e, n) { - if ((t.f & jt) === 0) { - t.f ^= jt; +function _o(t, e, n) { + if ((t.f & te) === 0) { + t.f ^= te; var r = t.nodes && t.nodes.t; if (r !== null) for (const o of r) @@ -1533,20 +1533,20 @@ function go(t, e, n) { var s = i.next, a = (i.f & lr) !== 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 & be) !== 0 && (t.f & nn) !== 0; - go(i, e, a ? n : !1), i = s; + (i.f & xe) !== 0 && (t.f & Qe) !== 0; + _o(i, e, a ? n : !1), i = s; } } } function Fs(t) { - _o(t, !0); + mo(t, !0); } -function _o(t, e) { - if ((t.f & jt) !== 0) { - t.f ^= jt, (t.f & yt) === 0 && (ot(t, Rt), ye(t)); +function mo(t, e) { + if ((t.f & te) !== 0) { + t.f ^= te, (t.f & yt) === 0 && (at(t, Rt), me(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & lr) !== 0 || (n.f & be) !== 0; - _o(n, i ? e : !1), n = r; + var r = n.next, i = (n.f & lr) !== 0 || (n.f & xe) !== 0; + mo(n, i ? e : !1), n = r; } var s = t.nodes && t.nodes.t; if (s !== null) @@ -1554,45 +1554,45 @@ function _o(t, e) { (a.is_global || e) && a.in(); } } -function mo(t, e) { +function yo(t, e) { if (t.nodes) for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { var i = n === r ? null : /* @__PURE__ */ Ie(n); e.append(n), n = i; } } -let si = !1, dn = !1; -function na(t) { - dn = t; +let ii = !1, cn = !1; +function ia(t) { + cn = t; } -let Y = null, we = !1; -function fe(t) { +let Y = null, ye = !1; +function ce(t) { Y = t; } -let U = null; +let W = null; function De(t) { - U = t; + W = t; } -let le = null; -function yo(t) { - Y !== null && (le === null ? le = [t] : le.push(t)); +let ue = null; +function wo(t) { + Y !== null && (ue === null ? ue = [t] : ue.push(t)); } -let Yt = null, Gt = 0, re = null; +let Yt = null, Zt = 0, ie = null; function bu(t) { - re = t; + ie = t; } -let wo = 1, bn = 0, Pn = bn; -function ra(t) { - Pn = t; +let xo = 1, bn = 0, Mn = bn; +function sa(t) { + Mn = t; } -function xo() { - return ++wo; +function bo() { + return ++xo; } function Br(t) { var e = t.f; if ((e & Rt) !== 0) return !0; - if (e & Et && (t.f &= ~Fn), (e & xe) !== 0) { + if (e & Et && (t.f &= ~Fn), (e & we) !== 0) { for (var n = ( /** @type {Value[]} */ t.deps @@ -1601,39 +1601,39 @@ function Br(t) { if (Br( /** @type {Derived} */ s - ) && to( + ) && eo( /** @type {Derived} */ s ), s.wv > t.wv) return !0; } - (e & oe) !== 0 && // During time traveling we don't want to reset the status so that + (e & le) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - At === null && ot(t, yt); + At === null && at(t, yt); } return !1; } -function bo(t, e, n = !0) { +function $o(t, e, n = !0) { var r = t.reactions; - if (r !== null && !(le !== null && or.call(le, t))) + if (r !== null && !(ue !== null && or.call(ue, t))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Et) !== 0 ? bo( + (s.f & Et) !== 0 ? $o( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? ot(s, Rt) : (s.f & yt) !== 0 && ot(s, xe), ye( + ) : e === s && (n ? at(s, Rt) : (s.f & yt) !== 0 && at(s, we), me( /** @type {Effect} */ s )); } } -function $o(t) { - var m; - var e = Yt, n = Gt, r = re, i = Y, s = le, a = Jt, o = we, l = Pn, u = t.f; +function Ao(t) { + var y; + var e = Yt, n = Zt, r = ie, i = Y, s = ue, a = ee, o = ye, l = Mn, u = t.f; Yt = /** @type {null | Value[]} */ - null, Gt = 0, re = null, Y = (u & (be | pn)) === 0 ? t : null, le = null, ur(t.ctx), we = !1, Pn = ++bn, t.ac !== null && (fo(() => { + null, Zt = 0, ie = null, Y = (u & (xe | hn)) === 0 ? t : null, ue = null, ur(t.ctx), ye = !1, Mn = ++bn, t.ac !== null && (co(() => { t.ac.abort(yn); }), t.ac = null); try { @@ -1643,41 +1643,41 @@ function $o(t) { t.fn ), h = f(); t.f |= vr; - var c = t.deps, p = B == null ? void 0 : B.is_fork; + var c = t.deps, p = X == null ? void 0 : X.is_fork; if (Yt !== null) { var g; - if (p || Dr(t, Gt), c !== null && Gt > 0) - for (c.length = Gt + Yt.length, g = 0; g < Yt.length; g++) - c[Gt + g] = Yt[g]; + if (p || Dr(t, Zt), c !== null && Zt > 0) + for (c.length = Zt + Yt.length, g = 0; g < Yt.length; g++) + c[Zt + g] = Yt[g]; else t.deps = c = Yt; - if (Ss() && (t.f & oe) !== 0) - for (g = Gt; g < c.length; g++) - ((m = c[g]).reactions ?? (m.reactions = [])).push(t); - } else !p && c !== null && Gt < c.length && (Dr(t, Gt), c.length = Gt); - if (Ya() && re !== null && !we && c !== null && (t.f & (Et | xe | Rt)) === 0) + if (Ss() && (t.f & le) !== 0) + for (g = Zt; g < c.length; g++) + ((y = c[g]).reactions ?? (y.reactions = [])).push(t); + } else !p && c !== null && Zt < c.length && (Dr(t, Zt), c.length = Zt); + if (Ha() && ie !== null && !ye && c !== null && (t.f & (Et | we | Rt)) === 0) for (g = 0; g < /** @type {Source[]} */ - re.length; g++) - bo( - re[g], + ie.length; g++) + $o( + ie[g], /** @type {Effect} */ t ); if (i !== null && i !== t) { if (bn++, i.deps !== null) - for (let b = 0; b < n; b += 1) - i.deps[b].rv = bn; + for (let $ = 0; $ < n; $ += 1) + i.deps[$].rv = bn; if (e !== null) - for (const b of e) - b.rv = bn; - re !== null && (r === null ? r = re : r.push(.../** @type {Source[]} */ - re)); + for (const $ of e) + $.rv = bn; + ie !== null && (r === null ? r = ie : r.push(.../** @type {Source[]} */ + ie)); } - return (t.f & cn) !== 0 && (t.f ^= cn), h; - } catch (b) { - return za(b); + return (t.f & un) !== 0 && (t.f ^= un), h; + } catch ($) { + return Xa($); } finally { - t.f ^= ts, Yt = e, Gt = n, re = r, Y = i, le = s, ur(a), we = o, Pn = l; + t.f ^= ts, Yt = e, Zt = n, ie = r, Y = i, ue = s, ur(a), ye = o, Mn = l; } } function $u(t, e) { @@ -1697,7 +1697,7 @@ function $u(t, e) { /** @type {Derived} */ e ); - (s.f & oe) !== 0 && (s.f ^= oe, s.f &= ~Fn), Cs(s), hu(s), Dr(s, 0); + (s.f & le) !== 0 && (s.f ^= le, s.f &= ~Fn), Cs(s), hu(s), Dr(s, 0); } } function Dr(t, e) { @@ -1708,29 +1708,29 @@ function Dr(t, e) { } function hr(t) { var e = t.f; - if ((e & Qe) === 0) { - ot(t, yt); - var n = U, r = si; - U = t, si = !0; + if ((e & Je) === 0) { + at(t, yt); + var n = W, r = ii; + W = t, ii = !0; try { - (e & (nn | Da)) !== 0 ? wu(t) : Ds(t), po(t); - var i = $o(t); - t.teardown = typeof i == "function" ? i : null, t.wv = wo; + (e & (Qe | Fa)) !== 0 ? wu(t) : Ds(t), vo(t); + var i = Ao(t); + t.teardown = typeof i == "function" ? i : null, t.wv = xo; var s; Qi && Ql && (t.f & Rt) !== 0 && t.deps; } finally { - si = r, U = n; + ii = r, W = n; } } } function x(t) { var e = t.f, n = (e & Et) !== 0; - if (Y !== null && !we) { - var r = U !== null && (U.f & Qe) !== 0; - if (!r && (le === null || !or.call(le, t))) { + if (Y !== null && !ye) { + var r = W !== null && (W.f & Je) !== 0; + if (!r && (ue === null || !or.call(ue, t))) { var i = Y.deps; if ((Y.f & ts) !== 0) - t.rv < bn && (t.rv = bn, Yt === null && i !== null && i[Gt] === t ? Gt++ : Yt === null ? Yt = [t] : Yt.push(t)); + t.rv < bn && (t.rv = bn, Yt === null && i !== null && i[Zt] === t ? Zt++ : Yt === null ? Yt = [t] : Yt.push(t)); else { (Y.deps ?? (Y.deps = [])).push(t); var s = t.reactions; @@ -1738,75 +1738,75 @@ function x(t) { } } } - if (dn && hn.has(t)) - return hn.get(t); + if (cn && fn.has(t)) + return fn.get(t); if (n) { var a = ( /** @type {Derived} */ t ); - if (dn) { + if (cn) { var o = a.v; - return ((a.f & yt) === 0 && a.reactions !== null || Eo(a)) && (o = Ts(a)), hn.set(a, o), o; + return ((a.f & yt) === 0 && a.reactions !== null || Ro(a)) && (o = Ts(a)), fn.set(a, o), o; } - var l = (a.f & oe) === 0 && !we && Y !== null && (si || (Y.f & oe) !== 0), u = (a.f & vr) === 0; - Br(a) && (l && (a.f |= oe), to(a)), l && !u && (eo(a), Ao(a)); + var l = (a.f & le) === 0 && !ye && Y !== null && (ii || (Y.f & le) !== 0), u = (a.f & vr) === 0; + Br(a) && (l && (a.f |= le), eo(a)), l && !u && (no(a), Eo(a)); } if (At != null && At.has(t)) return At.get(t); - if ((t.f & cn) !== 0) + if ((t.f & un) !== 0) throw t.v; return t.v; } -function Ao(t) { - if (t.f |= oe, t.deps !== null) +function Eo(t) { + if (t.f |= le, t.deps !== null) for (const e of t.deps) - (e.reactions ?? (e.reactions = [])).push(t), (e.f & Et) !== 0 && (e.f & oe) === 0 && (eo( + (e.reactions ?? (e.reactions = [])).push(t), (e.f & Et) !== 0 && (e.f & le) === 0 && (no( /** @type {Derived} */ e - ), Ao( + ), Eo( /** @type {Derived} */ e )); } -function Eo(t) { +function Ro(t) { if (t.v === $t) return !0; if (t.deps === null) return !1; for (const e of t.deps) - if (hn.has(e) || (e.f & Et) !== 0 && Eo( + if (fn.has(e) || (e.f & Et) !== 0 && Ro( /** @type {Derived} */ e )) return !0; return !1; } -function Di(t) { - var e = we; +function Mi(t) { + var e = ye; try { - return we = !0, t(); + return ye = !0, t(); } finally { - we = e; + ye = e; } } -const Ro = /* @__PURE__ */ new Set(), fs = /* @__PURE__ */ new Set(); +const Co = /* @__PURE__ */ new Set(), fs = /* @__PURE__ */ new Set(); function Au(t) { for (var e = 0; e < t.length; e++) - Ro.add(t[e]); + Co.add(t[e]); for (var n of fs) n(t); } -let ia = null; -function sa(t) { - var b; +let aa = null; +function oa(t) { + var $; var e = this, n = ( /** @type {Node} */ e.ownerDocument - ), r = t.type, i = ((b = t.composedPath) == null ? void 0 : b.call(t)) || [], s = ( + ), r = t.type, i = (($ = t.composedPath) == null ? void 0 : $.call(t)) || [], s = ( /** @type {null | Element} */ i[0] || t.target ); - ia = t; - var a = 0, o = ia === t && t.__root; + aa = t; + var a = 0, o = aa === t && t.__root; if (o) { var l = i.indexOf(o); if (l !== -1 && (e === document || e === /** @type {any} */ @@ -1821,45 +1821,45 @@ function sa(t) { } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - pi(t, "currentTarget", { + di(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = Y, h = U; - fe(null), De(null); + var f = Y, h = W; + ce(null), De(null); try { for (var c, p = []; s !== null; ) { var g = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { - var m = s["__" + r]; - m != null && (!/** @type {any} */ + var y = s["__" + r]; + y != 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 - t.target === s) && m.call(s, t); - } catch ($) { - c ? p.push($) : c = $; + t.target === s) && y.call(s, t); + } catch (E) { + c ? p.push(E) : c = E; } if (t.cancelBubble || g === e || g === null) break; s = g; } if (c) { - for (let $ of p) + for (let E of p) queueMicrotask(() => { - throw $; + throw E; }); throw c; } } finally { - t.__root = e, delete t.currentTarget, fe(f), De(h); + t.__root = e, delete t.currentTarget, ce(f), De(h); } } } -var Sa, ka; -const Wi = (ka = (Sa = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Sa.trustedTypes) == null ? void 0 : /* @__PURE__ */ ka.createPolicy( +var ka, Pa; +const Bi = (Pa = (ka = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : ka.trustedTypes) == null ? void 0 : /* @__PURE__ */ Pa.createPolicy( "svelte-trusted-html", { /** @param {string} html */ @@ -1869,17 +1869,17 @@ const Wi = (ka = (Sa = globalThis == null ? void 0 : globalThis.window) == null function Eu(t) { return ( /** @type {string} */ - (Wi == null ? void 0 : Wi.createHTML(t)) ?? t + (Bi == null ? void 0 : Bi.createHTML(t)) ?? t ); } -function Co(t, e = !1) { +function To(t, e = !1) { var n = Ns("template"); return t = t.replaceAll("", ""), n.innerHTML = e ? Eu(t) : t, n.content; } function Ln(t, e) { var n = ( /** @type {Effect} */ - U + W ); n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); } @@ -1887,12 +1887,12 @@ function Ln(t, e) { function Hn(t, e) { var n = (e & Tl) !== 0, r, i = !t.startsWith(""); return () => { - if (Z) + if (J) return Ln(H, null), H; - r === void 0 && (r = Co(i ? t : "" + t, !0)); + r === void 0 && (r = To(i ? t : "" + t, !0)); var s = ( /** @type {TemplateNode} */ - n || so ? document.importNode(r, !0) : r.cloneNode(!0) + n || ao ? document.importNode(r, !0) : r.cloneNode(!0) ); { var a = ( @@ -1911,12 +1911,12 @@ function Hn(t, e) { function Ru(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { - if (Z) + if (J) return Ln(H, null), H; if (!s) { var a = ( /** @type {DocumentFragment} */ - Co(i, !0) + To(i, !0) ), o = ( /** @type {Element} */ /* @__PURE__ */ On(a) @@ -1935,24 +1935,24 @@ function Ru(t, e, n = "svg") { function Cu(t, e) { return /* @__PURE__ */ Ru(t, e, "svg"); } -function aa(t = "") { - if (!Z) { - var e = ue(t + ""); +function la(t = "") { + if (!J) { + var e = fe(t + ""); return Ln(e, e), e; } var n = H; - return n.nodeType !== Xr ? (n.before(n = ue()), zt(n)) : Pi( + return n.nodeType !== Xr ? (n.before(n = fe()), zt(n)) : Pi( /** @type {Text} */ n ), Ln(n, n), n; } -function ge(t, e) { - if (Z) { +function ve(t, e) { + if (J) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ - U + W ); - ((n.f & vr) === 0 || n.nodes.end === null) && (n.nodes.end = H), Si(); + ((n.f & vr) === 0 || n.nodes.end === null) && (n.nodes.end = H), Ni(); return; } t !== null && t.before( @@ -1964,40 +1964,40 @@ const Tu = ["touchstart", "touchmove"]; function Nu(t) { return Tu.includes(t); } -function on(t, e) { +function sn(t, e) { var n = e == null ? "" : typeof e == "object" ? e + "" : e; n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); } -function To(t, e) { - return No(t, e); +function No(t, e) { + return So(t, e); } function Su(t, e) { us(), e.intro = e.intro ?? !1; - const n = e.target, r = Z, i = H; + const n = e.target, r = J, i = H; try { for (var s = /* @__PURE__ */ On(n); s && (s.nodeType !== gr || /** @type {Comment} */ s.data !== bs); ) s = /* @__PURE__ */ Ie(s); if (!s) throw ar; - Je(!0), zt( + Ke(!0), zt( /** @type {Comment} */ s ); - const a = No(t, { ...e, anchor: s }); - return Je(!1), /** @type {Exports} */ + const a = So(t, { ...e, anchor: s }); + return Ke(!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 !== ar && console.warn("Failed to hydrate: ", a), e.recover === !1 && Bl(), us(), lo(n), Je(!1), To(t, e); + return a !== ar && console.warn("Failed to hydrate: ", a), e.recover === !1 && Bl(), us(), uo(n), Ke(!1), No(t, e); } finally { - Je(r), zt(i); + Ke(r), zt(i); } } -const jr = /* @__PURE__ */ new Map(); -function No(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { +const Jr = /* @__PURE__ */ new Map(); +function So(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { us(); var o = /* @__PURE__ */ new Set(), l = (h) => { for (var c = 0; c < h.length; c++) { @@ -2005,18 +2005,18 @@ function No(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int if (!o.has(p)) { o.add(p); var g = Nu(p); - for (const $ of [e, document]) { - var m = jr.get($); - m === void 0 && (m = /* @__PURE__ */ new Map(), jr.set($, m)); - var b = m.get(p); - b === void 0 ? ($.addEventListener(p, sa, { passive: g }), m.set(p, 1)) : m.set(p, b + 1); + for (const E of [e, document]) { + var y = Jr.get(E); + y === void 0 && (y = /* @__PURE__ */ new Map(), Jr.set(E, y)); + var $ = y.get(p); + $ === void 0 ? (E.addEventListener(p, oa, { passive: g }), y.set(p, 1)) : y.set(p, $ + 1); } } } }; - l(Ci(Ro)), fs.add(l); + l(Ri(Co)), fs.add(l); var u = void 0, f = mu(() => { - var h = n ?? e.appendChild(ue()); + var h = n ?? e.appendChild(fe()); return su( /** @type {TemplateNode} */ h, @@ -2028,31 +2028,31 @@ function No(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int Es({}); var p = ( /** @type {ComponentContext} */ - Jt + ee ); - if (s && (p.c = s), i && (r.$$events = i), Z && Ln( + if (s && (p.c = s), i && (r.$$events = i), J && Ln( /** @type {TemplateNode} */ c, null - ), u = t(c, r) || {}, Z && (U.nodes.end = H, H === null || H.nodeType !== gr || /** @type {Comment} */ + ), u = t(c, r) || {}, J && (W.nodes.end = H, H === null || H.nodeType !== gr || /** @type {Comment} */ H.data !== $s)) - throw Ni(), ar; + throw Ti(), ar; Rs(); } ), () => { - var m; + var y; for (var c of o) - for (const b of [e, document]) { + for (const $ of [e, document]) { var p = ( /** @type {Map} */ - jr.get(b) + Jr.get($) ), g = ( /** @type {number} */ p.get(c) ); - --g == 0 ? (b.removeEventListener(c, sa), p.delete(c), p.size === 0 && jr.delete(b)) : p.set(c, g); + --g == 0 ? ($.removeEventListener(c, oa), p.delete(c), p.size === 0 && Jr.delete($)) : p.set(c, g); } - fs.delete(l), h !== n && ((m = h.parentNode) == null || m.removeChild(h)); + fs.delete(l), h !== n && ((y = h.parentNode) == null || y.removeChild(h)); }; }); return cs.set(u, f), u; @@ -2062,17 +2062,17 @@ function ku(t, e) { const n = cs.get(t); return n ? (cs.delete(t), n(e)) : Promise.resolve(); } -var _e, ke, Zt, Nn, Hr, zr, Ei; -class Mu { +var ge, ke, Qt, Nn, Hr, zr, Ai; +class Pu { /** * @param {TemplateNode} anchor * @param {boolean} transition */ constructor(e, n = !0) { /** @type {TemplateNode} */ - st(this, "anchor"); + it(this, "anchor"); /** @type {Map} */ - q(this, _e, /* @__PURE__ */ new Map()); + L(this, ge, /* @__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. @@ -2087,69 +2087,69 @@ class Mu { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - q(this, ke, /* @__PURE__ */ new Map()); + L(this, ke, /* @__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} */ - q(this, Zt, /* @__PURE__ */ new Map()); + L(this, Qt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - q(this, Nn, /* @__PURE__ */ new Set()); + L(this, Nn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - q(this, Hr, !0); - q(this, zr, () => { + L(this, Hr, !0); + L(this, zr, () => { var e = ( /** @type {Batch} */ - B + X ); - if (v(this, _e).has(e)) { + if (v(this, ge).has(e)) { var n = ( /** @type {Key} */ - v(this, _e).get(e) + v(this, ge).get(e) ), r = v(this, ke).get(n); if (r) Fs(r), v(this, Nn).delete(n); else { - var i = v(this, Zt).get(n); - i && (v(this, ke).set(n, i.effect), v(this, Zt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, Qt).get(n); + i && (v(this, ke).set(n, i.effect), v(this, Qt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, _e)) { - if (v(this, _e).delete(s), s === e) + for (const [s, a] of v(this, ge)) { + if (v(this, ge).delete(s), s === e) break; - const o = v(this, Zt).get(a); - o && (Dt(o.effect), v(this, Zt).delete(a)); + const o = v(this, Qt).get(a); + o && (Ft(o.effect), v(this, Qt).delete(a)); } for (const [s, a] of v(this, ke)) { if (s === n || v(this, Nn).has(s)) continue; const o = () => { - if (Array.from(v(this, _e).values()).includes(s)) { + if (Array.from(v(this, ge).values()).includes(s)) { var u = document.createDocumentFragment(); - mo(a, u), u.append(ue()), v(this, Zt).set(s, { effect: a, fragment: u }); + yo(a, u), u.append(fe()), v(this, Qt).set(s, { effect: a, fragment: u }); } else - Dt(a); + Ft(a); v(this, Nn).delete(s), v(this, ke).delete(s); }; - v(this, Hr) || !r ? (v(this, Nn).add(s), Mn(a, o, !1)) : o(); + v(this, Hr) || !r ? (v(this, Nn).add(s), Pn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - q(this, Ei, (e) => { - v(this, _e).delete(e); - const n = Array.from(v(this, _e).values()); - for (const [r, i] of v(this, Zt)) - n.includes(r) || (Dt(i.effect), v(this, Zt).delete(r)); + L(this, Ai, (e) => { + v(this, ge).delete(e); + const n = Array.from(v(this, ge).values()); + for (const [r, i] of v(this, Qt)) + n.includes(r) || (Ft(i.effect), v(this, Qt).delete(r)); }); - this.anchor = e, F(this, Hr, n); + this.anchor = e, O(this, Hr, n); } /** * @@ -2159,34 +2159,34 @@ class Mu { ensure(e, n) { var r = ( /** @type {Batch} */ - B - ), i = uo(); - if (n && !v(this, ke).has(e) && !v(this, Zt).has(e)) + X + ), i = fo(); + if (n && !v(this, ke).has(e) && !v(this, Qt).has(e)) if (i) { - var s = document.createDocumentFragment(), a = ue(); - s.append(a), v(this, Zt).set(e, { - effect: ae(() => n(a)), + var s = document.createDocumentFragment(), a = fe(); + s.append(a), v(this, Qt).set(e, { + effect: oe(() => n(a)), fragment: s }); } else v(this, ke).set( e, - ae(() => n(this.anchor)) + oe(() => n(this.anchor)) ); - if (v(this, _e).set(r, e), i) { + if (v(this, ge).set(r, e), i) { for (const [o, l] of v(this, ke)) o === e ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, Zt)) + for (const [o, l] of v(this, Qt)) o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, zr)), r.ondiscard(v(this, Ei)); + r.oncommit(v(this, zr)), r.ondiscard(v(this, Ai)); } else - Z && (this.anchor = H), v(this, zr).call(this); + J && (this.anchor = H), v(this, zr).call(this); } } -_e = new WeakMap(), ke = new WeakMap(), Zt = new WeakMap(), Nn = new WeakMap(), Hr = new WeakMap(), zr = new WeakMap(), Ei = new WeakMap(); -function Pu(t) { - Jt === null && Ll(), ks(() => { - const e = Di(t); +ge = new WeakMap(), ke = new WeakMap(), Qt = new WeakMap(), Nn = new WeakMap(), Hr = new WeakMap(), zr = new WeakMap(), Ai = new WeakMap(); +function Mu(t) { + ee === null && Ll(), ks(() => { + const e = Mi(t); if (typeof e == "function") return ( /** @type {() => void} */ e @@ -2194,34 +2194,34 @@ function Pu(t) { }); } function $r(t, e, n = !1) { - Z && Si(); - var r = new Mu(t), i = n ? lr : 0; + J && Ni(); + var r = new Pu(t), i = n ? lr : 0; function s(a, o) { - if (Z) { - const f = La(t); + if (J) { + const f = qa(t); var l; - if (f === bs ? l = 0 : f === Ri ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = vi(); - zt(u), r.anchor = u, Je(!1), r.ensure(a, o), Je(!0); + if (f === bs ? l = 0 : f === Ei ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = pi(); + zt(u), r.anchor = u, Ke(!1), r.ensure(a, o), Ke(!0); return; } } r.ensure(a, o); } - Ps(() => { + Ms(() => { var a = !1; e((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function Ui(t, e) { +function Wi(t, e) { return e; } function Du(t, e, n) { for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { let h = e[o]; - Mn( + Pn( h, () => { if (s) { @@ -2230,7 +2230,7 @@ function Du(t, e, n) { /** @type {Set} */ t.outrogroups ); - hs(Ci(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); + hs(Ri(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); } } else a -= 1; @@ -2248,7 +2248,7 @@ function Du(t, e, n) { /** @type {Element} */ u.parentNode ); - lo(f), f.append(u), t.items.clear(); + uo(f), f.append(u), t.items.clear(); } hs(e, !l); } else @@ -2259,95 +2259,95 @@ function Du(t, e, n) { } function hs(t, e = !0) { for (var n = 0; n < t.length; n++) - Dt(t[n], e); + Ft(t[n], e); } -var oa; -function Gi(t, e, n, r, i, s = null) { +var ua; +function Ui(t, e, n, r, i, s = null) { var a = t, o = /* @__PURE__ */ new Map(); - Z && Si(); - var l = null, u = /* @__PURE__ */ Qa(() => { - var m = n(); - return Ma(m) ? m : m == null ? [] : Ci(m); + J && Ni(); + var l = null, u = /* @__PURE__ */ to(() => { + var y = n(); + return Ma(y) ? y : y == null ? [] : Ri(y); }), f, h = !0; function c() { - g.fallback = l, Fu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & fn) === 0 ? Fs(l) : (l.f ^= fn, Rr(l, null, a)) : Mn(l, () => { + g.fallback = l, Fu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & ln) === 0 ? Fs(l) : (l.f ^= ln, Rr(l, null, a)) : Pn(l, () => { l = null; })); } - var p = Ps(() => { + var p = Ms(() => { f = /** @type {V[]} */ x(u); - var m = f.length; - let b = !1; - if (Z) { - var $ = La(a) === Ri; - $ !== (m === 0) && (a = vi(), zt(a), Je(!1), b = !0); + var y = f.length; + let $ = !1; + if (J) { + var E = qa(a) === Ei; + E !== (y === 0) && (a = pi(), zt(a), Ke(!1), $ = !0); } - for (var C = /* @__PURE__ */ new Set(), E = ( + for (var S = /* @__PURE__ */ new Set(), C = ( /** @type {Batch} */ - B - ), S = uo(), T = 0; T < m; T += 1) { - Z && H.nodeType === gr && /** @type {Comment} */ + X + ), P = fo(), k = 0; k < y; k += 1) { + J && H.nodeType === gr && /** @type {Comment} */ H.data === $s && (a = /** @type {Comment} */ - H, b = !0, Je(!1)); - var G = f[T], lt = r(G, T), K = h ? null : o.get(lt); - K ? (K.v && cr(K.v, G), K.i && cr(K.i, T), S && E.unskip_effect(K.e)) : (K = Iu( + H, $ = !0, Ke(!1)); + var G = f[k], ot = r(G, k), K = h ? null : o.get(ot); + K ? (K.v && cr(K.v, G), K.i && cr(K.i, k), P && C.unskip_effect(K.e)) : (K = Iu( o, - h ? a : oa ?? (oa = ue()), + h ? a : ua ?? (ua = fe()), G, - lt, - T, + ot, + k, i, e, n - ), h || (K.e.f |= fn), o.set(lt, K)), C.add(lt); + ), h || (K.e.f |= ln), o.set(ot, K)), S.add(ot); } - if (m === 0 && s && !l && (h ? l = ae(() => s(a)) : (l = ae(() => s(oa ?? (oa = ue()))), l.f |= fn)), m > C.size && Vl(), Z && m > 0 && zt(vi()), !h) - if (S) { - for (const [rt, Q] of o) - C.has(rt) || E.skip_effect(Q.e); - E.oncommit(c), E.ondiscard(() => { + if (y === 0 && s && !l && (h ? l = oe(() => s(a)) : (l = oe(() => s(ua ?? (ua = fe()))), l.f |= ln)), y > S.size && Vl(), J && y > 0 && zt(pi()), !h) + if (P) { + for (const [nt, Q] of o) + S.has(nt) || C.skip_effect(Q.e); + C.oncommit(c), C.ondiscard(() => { }); } else c(); - b && Je(!0), x(u); + $ && Ke(!0), x(u); }), g = { effect: p, items: o, outrogroups: null, fallback: l }; - h = !1, Z && (a = H); + h = !1, J && (a = H); } function Ar(t) { - for (; t !== null && (t.f & be) === 0; ) + for (; t !== null && (t.f & xe) === 0; ) t = t.next; return t; } function Fu(t, e, n, r, i) { var K; - var s = e.length, a = t.items, o = Ar(t.effect.first), l, u = null, f = [], h = [], c, p, g, m; - for (m = 0; m < s; m += 1) { - if (c = e[m], p = i(c, m), g = /** @type {EachItem} */ + var s = e.length, a = t.items, o = Ar(t.effect.first), l, u = null, f = [], h = [], c, p, g, y; + for (y = 0; y < s; y += 1) { + if (c = e[y], p = i(c, y), g = /** @type {EachItem} */ a.get(p).e, t.outrogroups !== null) - for (const rt of t.outrogroups) - rt.pending.delete(g), rt.done.delete(g); - if ((g.f & fn) !== 0) - if (g.f ^= fn, g === o) + for (const nt of t.outrogroups) + nt.pending.delete(g), nt.done.delete(g); + if ((g.f & ln) !== 0) + if (g.f ^= ln, g === o) Rr(g, null, n); else { - var b = u ? u.next : o; - g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), ln(t, u, g), ln(t, g, b), Rr(g, b, n), u = g, f = [], h = [], o = Ar(u.next); + var $ = u ? u.next : o; + g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), an(t, u, g), an(t, g, $), Rr(g, $, n), u = g, f = [], h = [], o = Ar(u.next); continue; } - if ((g.f & jt) !== 0 && Fs(g), g !== o) { + if ((g.f & te) !== 0 && Fs(g), g !== o) { if (l !== void 0 && l.has(g)) { if (f.length < h.length) { - var $ = h[0], C; - u = $.prev; - var E = f[0], S = f[f.length - 1]; - for (C = 0; C < f.length; C += 1) - Rr(f[C], $, n); - for (C = 0; C < h.length; C += 1) - l.delete(h[C]); - ln(t, E.prev, S.next), ln(t, u, E), ln(t, S, $), o = $, u = S, m -= 1, f = [], h = []; + var E = h[0], S; + u = E.prev; + var C = f[0], P = f[f.length - 1]; + for (S = 0; S < f.length; S += 1) + Rr(f[S], E, n); + for (S = 0; S < h.length; S += 1) + l.delete(h[S]); + an(t, C.prev, P.next), an(t, u, C), an(t, P, E), o = E, u = P, y -= 1, f = [], h = []; } else - l.delete(g), Rr(g, o, n), ln(t, g.prev, g.next), ln(t, g, u === null ? t.effect.first : u.next), ln(t, u, g), u = g; + l.delete(g), Rr(g, o, n), an(t, g.prev, g.next), an(t, g, u === null ? t.effect.first : u.next), an(t, u, g), u = g; continue; } for (f = [], h = []; o !== null && o !== g; ) @@ -2355,40 +2355,40 @@ function Fu(t, e, n, r, i) { if (o === null) continue; } - (g.f & fn) === 0 && f.push(g), u = g, o = Ar(g.next); + (g.f & ln) === 0 && f.push(g), u = g, o = Ar(g.next); } if (t.outrogroups !== null) { - for (const rt of t.outrogroups) - rt.pending.size === 0 && (hs(Ci(rt.done)), (K = t.outrogroups) == null || K.delete(rt)); + for (const nt of t.outrogroups) + nt.pending.size === 0 && (hs(Ri(nt.done)), (K = t.outrogroups) == null || K.delete(nt)); t.outrogroups.size === 0 && (t.outrogroups = null); } if (o !== null || l !== void 0) { - var T = []; + var k = []; if (l !== void 0) for (g of l) - (g.f & jt) === 0 && T.push(g); + (g.f & te) === 0 && k.push(g); for (; o !== null; ) - (o.f & jt) === 0 && o !== t.fallback && T.push(o), o = Ar(o.next); - var G = T.length; + (o.f & te) === 0 && o !== t.fallback && k.push(o), o = Ar(o.next); + var G = k.length; if (G > 0) { - var lt = null; - Du(t, T, lt); + var ot = null; + Du(t, k, ot); } } } function Iu(t, e, n, r, i, s, a, o) { - var l = (a & xl) !== 0 ? (a & $l) === 0 ? /* @__PURE__ */ ro(n, !1, !1) : In(n) : null, u = (a & bl) !== 0 ? In(i) : null; + var l = (a & xl) !== 0 ? (a & $l) === 0 ? /* @__PURE__ */ io(n, !1, !1) : In(n) : null, u = (a & bl) !== 0 ? In(i) : null; return { v: l, i: u, - e: ae(() => (s(e, l ?? n, u ?? i, o), () => { + e: oe(() => (s(e, l ?? n, u ?? i, o), () => { t.delete(r); })) }; } function Rr(t, e, n) { if (t.nodes) - for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & fn) === 0 ? ( + for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & ln) === 0 ? ( /** @type {EffectNodes} */ e.nodes.start ) : n; r !== null; ) { @@ -2401,11 +2401,11 @@ function Rr(t, e, n) { r = a; } } -function ln(t, e, n) { +function an(t, e, n) { e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; } -function So(t, e) { - ho(() => { +function ko(t, e) { + po(() => { var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -2423,7 +2423,7 @@ function So(t, e) { } }); } -function la(t, e = !1) { +function fa(t, e = !1) { var n = e ? " !important;" : ";", r = ""; for (var i in t) { var s = t[i]; @@ -2434,56 +2434,56 @@ function la(t, e = !1) { function Ou(t, e) { if (e) { var n = "", r, i; - return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += la(r)), i && (n += la(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += fa(r)), i && (n += fa(i, !0)), n = n.trim(), n === "" ? null : n; } return String(t); } -function Ki(t, e = {}, n, r) { +function Gi(t, e = {}, n, r) { for (var i in n) { var s = n[i]; e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); } } -function ua(t, e, n, r) { +function ca(t, e, n, r) { var i = t.__style; - if (Z || i !== e) { + if (J || i !== e) { var s = Ou(e, r); - (!Z || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; - } else r && (Array.isArray(r) ? (Ki(t, n == null ? void 0 : n[0], r[0]), Ki(t, n == null ? void 0 : n[1], r[1], "important")) : Ki(t, n, r)); + (!J || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; + } else r && (Array.isArray(r) ? (Gi(t, n == null ? void 0 : n[0], r[0]), Gi(t, n == null ? void 0 : n[1], r[1], "important")) : Gi(t, n, r)); return r; } -function fa(t, e) { +function ha(t, e) { return t === e || (t == null ? void 0 : t[Sr]) === e; } -function ai(t = {}, e, n, r) { - return ho(() => { +function si(t = {}, e, n, r) { + return po(() => { var i, s; - return Ms(() => { - i = s, s = [], Di(() => { - t !== n(...s) && (e(t, ...s), i && fa(n(...i), t) && e(null, ...i)); + return Ps(() => { + i = s, s = [], Mi(() => { + t !== n(...s) && (e(t, ...s), i && ha(n(...i), t) && e(null, ...i)); }); }), () => { kn(() => { - s && fa(n(...s), t) && e(null, ...s); + s && ha(n(...s), t) && e(null, ...s); }); }; }), t; } -let Jr = !1; +let Zr = !1; function Lu(t) { - var e = Jr; + var e = Zr; try { - return Jr = !1, [t(), Jr]; + return Zr = !1, [t(), Zr]; } finally { - Jr = e; + Zr = e; } } -function ht(t, e, n, r) { - var C; +function pt(t, e, n, r) { + var S; var i = (n & Rl) !== 0, s = (n & Cl) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? Di( + ), o = !0, l = () => (o && (o = !1, a = s ? Mi( /** @type {() => V} */ r ) : ( @@ -2491,8 +2491,8 @@ function ht(t, e, n, r) { r )), a), u; if (i) { - var f = Sr in t || Oa in t; - u = ((C = Sn(t, e)) == null ? void 0 : C.set) ?? (f && e in t ? (E) => t[e] = E : void 0); + var f = Sr in t || La in t; + u = ((S = Sn(t, e)) == null ? void 0 : S.set) ?? (f && e in t ? (C) => t[e] = C : void 0); } var h, c = !1; i ? [h, c] = Lu(() => ( @@ -2502,43 +2502,43 @@ function ht(t, e, n, r) { t[e], h === void 0 && r !== void 0 && (h = l(), u && (Wl(), u(h))); var p; if (p = () => { - var E = ( + var C = ( /** @type {V} */ t[e] ); - return E === void 0 ? l() : (o = !0, E); + return C === void 0 ? l() : (o = !0, C); }, (n & El) === 0) return p; if (u) { var g = t.$$legacy; return ( /** @type {() => V} */ - (function(E, S) { - return arguments.length > 0 ? ((!S || g || c) && u(S ? p() : E), E) : p(); + (function(C, P) { + return arguments.length > 0 ? ((!P || g || c) && u(P ? p() : C), C) : p(); }) ); } - var m = !1, b = ((n & Al) !== 0 ? Mi : Qa)(() => (m = !1, p())); - i && x(b); - var $ = ( + var y = !1, $ = ((n & Al) !== 0 ? ki : to)(() => (y = !1, p())); + i && x($); + var E = ( /** @type {Effect} */ - U + W ); return ( /** @type {() => V} */ - (function(E, S) { + (function(C, P) { if (arguments.length > 0) { - const T = S ? x(b) : i ? xn(E) : E; - return at(b, T), m = !0, a !== void 0 && (a = T), E; + const k = P ? x($) : i ? xn(C) : C; + return st($, k), y = !0, a !== void 0 && (a = k), C; } - return dn && m || ($.f & Qe) !== 0 ? b.v : x(b); + return cn && y || (E.f & Je) !== 0 ? $.v : x($); }) ); } function qu(t) { return new Vu(t); } -var je, se; +var Ge, ae; class Vu { /** * @param {ComponentConstructorOptions & { @@ -2547,12 +2547,12 @@ class Vu { */ constructor(e) { /** @type {any} */ - q(this, je); + L(this, Ge); /** @type {Record} */ - q(this, se); + L(this, ae); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ ro(o, !1, !1); + var l = /* @__PURE__ */ io(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( @@ -2562,42 +2562,42 @@ class Vu { return x(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === Oa ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === La ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return at(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return st(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - F(this, se, (e.hydrate ? Su : To)(e.component, { + O(this, ae, (e.hydrate ? Su : No)(e.component, { target: e.target, anchor: e.anchor, props: i, context: e.context, intro: e.intro ?? !1, recover: e.recover - })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && ft(), F(this, je, i.$$events); - for (const a of Object.keys(v(this, se))) - a === "$set" || a === "$destroy" || a === "$on" || pi(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && ft(), O(this, Ge, i.$$events); + for (const a of Object.keys(v(this, ae))) + a === "$set" || a === "$destroy" || a === "$on" || di(this, a, { get() { - return v(this, se)[a]; + return v(this, ae)[a]; }, /** @param {any} value */ set(o) { - v(this, se)[a] = o; + v(this, ae)[a] = o; }, enumerable: !0 }); - v(this, se).$set = /** @param {Record} next */ + v(this, ae).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, se).$destroy = () => { - ku(v(this, se)); + }, v(this, ae).$destroy = () => { + ku(v(this, ae)); }; } /** @param {Record} props */ $set(e) { - v(this, se).$set(e); + v(this, ae).$set(e); } /** * @param {string} event @@ -2605,22 +2605,22 @@ class Vu { * @returns {any} */ $on(e, n) { - v(this, je)[e] = v(this, je)[e] || []; + v(this, Ge)[e] = v(this, Ge)[e] || []; const r = (...i) => n.call(this, ...i); - return v(this, je)[e].push(r), () => { - v(this, je)[e] = v(this, je)[e].filter( + return v(this, Ge)[e].push(r), () => { + v(this, Ge)[e] = v(this, Ge)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, se).$destroy(); + v(this, ae).$destroy(); } } -je = new WeakMap(), se = new WeakMap(); -let ko; -typeof HTMLElement == "function" && (ko = class extends HTMLElement { +Ge = new WeakMap(), ae = new WeakMap(); +let Po; +typeof HTMLElement == "function" && (Po = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -2629,27 +2629,27 @@ typeof HTMLElement == "function" && (ko = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - st(this, "$$ctor"); + it(this, "$$ctor"); /** Slots */ - st(this, "$$s"); + it(this, "$$s"); /** @type {any} The Svelte component instance */ - st(this, "$$c"); + it(this, "$$c"); /** Whether or not the custom element is connected */ - st(this, "$$cn", !1); + it(this, "$$cn", !1); /** @type {Record} Component props data */ - st(this, "$$d", {}); + it(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - st(this, "$$r", !1); + it(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - st(this, "$$p_d", {}); + it(this, "$$p_d", {}); /** @type {Record} Event listeners */ - st(this, "$$l", {}); + it(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - st(this, "$$l_u", /* @__PURE__ */ new Map()); + it(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - st(this, "$$me"); + it(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - st(this, "$$shadowRoot", null); + it(this, "$$shadowRoot", null); this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** @@ -2680,7 +2680,7 @@ typeof HTMLElement == "function" && (ko = class extends HTMLElement { let n = function(s) { return (a) => { const o = Ns("slot"); - s !== "default" && (o.name = s), ge(a, o); + s !== "default" && (o.name = s), ve(a, o); }; }; var e = n; @@ -2691,7 +2691,7 @@ typeof HTMLElement == "function" && (ko = class extends HTMLElement { 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] = oi(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = ai(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]); @@ -2704,13 +2704,13 @@ typeof HTMLElement == "function" && (ko = class extends HTMLElement { $$host: this } }), this.$$me = _u(() => { - Ms(() => { + Ps(() => { var s; this.$$r = !0; - for (const a of di(this.$$c)) { + for (const a of hi(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = oi( + const o = ai( a, this.$$d[a], this.$$p_d, @@ -2738,7 +2738,7 @@ typeof HTMLElement == "function" && (ko = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = oi(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + this.$$r || (e = this.$$g_p(e), this.$$d[e] = ai(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2749,12 +2749,12 @@ typeof HTMLElement == "function" && (ko = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return di(this.$$p_d).find( + return hi(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function oi(t, e, n, r) { +function ai(t, e, n, r) { var s; const i = (s = n[t]) == null ? void 0 : s.type; if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) @@ -2795,24 +2795,24 @@ function Yu(t) { }), e; } function Mo(t, e, n, r, i, s) { - let a = class extends ko { + let a = class extends Po { constructor() { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return di(e).map( + return hi(e).map( (o) => (e[o].attribute || o).toLowerCase() ); } }; - return di(e).forEach((o) => { - pi(a.prototype, o, { + return hi(e).forEach((o) => { + di(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { var h; - l = oi(o, l, e), this.$$d[o] = l; + l = ai(o, l, e), this.$$d[o] = l; var u = this.$$c; if (u) { var f = (h = Sn(u, o)) == null ? void 0 : h.get; @@ -2821,7 +2821,7 @@ function Mo(t, e, n, r, i, s) { } }); }), r.forEach((o) => { - pi(a.prototype, o, { + di(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; @@ -2832,14 +2832,14 @@ function Mo(t, e, n, r, i, s) { } var Hu = { value: () => { } }; -function Po() { +function Do() { for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } - return new li(n); + return new oi(n); } -function li(t) { +function oi(t) { this._ = t; } function zu(t, e) { @@ -2849,8 +2849,8 @@ function zu(t, e) { return { type: n, name: r }; }); } -li.prototype = Po.prototype = { - constructor: li, +oi.prototype = Do.prototype = { + constructor: oi, on: function(t, e) { var n = this._, r = zu(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { @@ -2859,14 +2859,14 @@ li.prototype = Po.prototype = { } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++s < a; ) - if (i = (t = r[s]).type) n[i] = ca(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = ca(n[i], t.name, null); + if (i = (t = r[s]).type) n[i] = da(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = da(n[i], t.name, null); return this; }, copy: function() { var t = {}, e = this._; for (var n in e) t[n] = e[n].slice(); - return new li(t); + return new oi(t); }, call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; @@ -2883,7 +2883,7 @@ function Xu(t, e) { if ((i = t[n]).name === e) return i.value; } -function ca(t, e, n) { +function da(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { t[r] = Hu, t = t.slice(0, r).concat(t.slice(r + 1)); @@ -2892,16 +2892,16 @@ function ca(t, e, n) { return n != null && t.push({ name: e, value: n }), t; } var ds = "http://www.w3.org/1999/xhtml"; -const ha = { +const pa = { svg: "http://www.w3.org/2000/svg", xhtml: ds, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Fi(t) { +function Di(t) { var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), ha.hasOwnProperty(e) ? { space: ha[e], local: t } : t; + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), pa.hasOwnProperty(e) ? { space: pa[e], local: t } : t; } function Bu(t) { return function() { @@ -2914,8 +2914,8 @@ function Wu(t) { return this.ownerDocument.createElementNS(t.space, t.local); }; } -function Do(t) { - var e = Fi(t); +function Fo(t) { + var e = Di(t); return (e.local ? Wu : Bu)(e); } function Uu() { @@ -2930,37 +2930,37 @@ function Gu(t) { for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new Qt(r, this._parents); + return new ne(r, this._parents); } function Ku(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function Zu() { +function Ju() { return []; } -function Fo(t) { - return t == null ? Zu : function() { +function Io(t) { + return t == null ? Ju : function() { return this.querySelectorAll(t); }; } -function ju(t) { +function Zu(t) { return function() { return Ku(t.apply(this, arguments)); }; } -function Ju(t) { - typeof t == "function" ? t = ju(t) : t = Fo(t); +function ju(t) { + typeof t == "function" ? t = Zu(t) : t = Io(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); - return new Qt(r, i); + return new ne(r, i); } -function Io(t) { +function Oo(t) { return function() { return this.matches(t); }; } -function Oo(t) { +function Lo(t) { return function(e) { return e.matches(t); }; @@ -2975,7 +2975,7 @@ function ef() { return this.firstElementChild; } function nf(t) { - return this.select(t == null ? ef : tf(typeof t == "function" ? t : Oo(t))); + return this.select(t == null ? ef : tf(typeof t == "function" ? t : Lo(t))); } var rf = Array.prototype.filter; function sf() { @@ -2987,26 +2987,26 @@ function af(t) { }; } function of(t) { - return this.selectAll(t == null ? sf : af(typeof t == "function" ? t : Oo(t))); + return this.selectAll(t == null ? sf : af(typeof t == "function" ? t : Lo(t))); } function lf(t) { - typeof t != "function" && (t = Io(t)); + typeof t != "function" && (t = Oo(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new Qt(r, this._parents); + return new ne(r, this._parents); } -function Lo(t) { +function qo(t) { return new Array(t.length); } function uf() { - return new Qt(this._enter || this._groups.map(Lo), this._parents); + return new ne(this._enter || this._groups.map(qo), this._parents); } -function gi(t, e) { +function vi(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -gi.prototype = { - constructor: gi, +vi.prototype = { + constructor: vi, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -3027,7 +3027,7 @@ function ff(t) { } function cf(t, e, n, r, i, s) { for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new gi(t, s[a]); + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new vi(t, s[a]); for (; a < l; ++a) (o = e[a]) && (i[a] = o); } @@ -3036,7 +3036,7 @@ function hf(t, e, n, r, i, s, a) { for (o = 0; o < f; ++o) (l = e[o]) && (c[o] = p = a.call(l, l.__data__, o, e) + "", u.has(p) ? i[o] = l : u.set(p, l)); for (o = 0; o < h; ++o) - p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new gi(t, s[o]); + p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new vi(t, s[o]); for (o = 0; o < f; ++o) (l = e[o]) && u.get(c[o]) === l && (i[o] = l); } @@ -3048,21 +3048,21 @@ function pf(t, e) { var n = e ? hf : cf, r = this._parents, i = this._groups; typeof t != "function" && (t = ff(t)); 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], h = i[u], c = h.length, p = vf(t.call(f, f && f.__data__, u, r)), g = p.length, m = o[u] = new Array(g), b = a[u] = new Array(g), $ = l[u] = new Array(c); - n(f, h, m, b, $, p, e); - for (var C = 0, E = 0, S, T; C < g; ++C) - if (S = m[C]) { - for (C >= E && (E = C + 1); !(T = b[E]) && ++E < g; ) ; - S._next = T || null; + var f = r[u], h = i[u], c = h.length, p = vf(t.call(f, f && f.__data__, u, r)), g = p.length, y = o[u] = new Array(g), $ = a[u] = new Array(g), E = l[u] = new Array(c); + n(f, h, y, $, E, p, e); + for (var S = 0, C = 0, P, k; S < g; ++S) + if (P = y[S]) { + for (S >= C && (C = S + 1); !(k = $[C]) && ++C < g; ) ; + P._next = k || null; } } - return a = new Qt(a, r), a._enter = o, a._exit = l, a; + return a = new ne(a, r), a._enter = o, a._exit = l, a; } function vf(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } function gf() { - return new Qt(this._exit || this._groups.map(Lo), this._parents); + return new ne(this._exit || this._groups.map(qo), this._parents); } function _f(t, e, n) { var r = this.enter(), i = this, s = this.exit(); @@ -3074,7 +3074,7 @@ function mf(t) { (p = u[g] || f[g]) && (c[g] = p); for (; l < i; ++l) o[l] = n[l]; - return new Qt(o, this._parents); + return new ne(o, this._parents); } function yf() { for (var t = this._groups, e = -1, n = t.length; ++e < n; ) @@ -3092,7 +3092,7 @@ function wf(t) { (u = a[f]) && (l[f] = u); l.sort(e); } - return new Qt(i, this._parents).order(); + return new ne(i, this._parents).order(); } function xf(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; @@ -3146,27 +3146,27 @@ function kf(t, e) { this.setAttributeNS(t.space, t.local, e); }; } -function Mf(t, e) { +function Pf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function Pf(t, e) { +function Mf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); }; } function Df(t, e) { - var n = Fi(t); + var n = Di(t); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((e == null ? n.local ? Nf : Tf : typeof e == "function" ? n.local ? Pf : Mf : n.local ? kf : Sf)(n, e)); + return this.each((e == null ? n.local ? Nf : Tf : typeof e == "function" ? n.local ? Mf : Pf : n.local ? kf : Sf)(n, e)); } -function qo(t) { +function Vo(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function Ff(t) { @@ -3189,7 +3189,7 @@ function Lf(t, e, n) { return arguments.length > 1 ? this.each((e == null ? Ff : typeof e == "function" ? Of : If)(t, e, n ?? "")) : dr(this.node(), t); } function dr(t, e) { - return t.style.getPropertyValue(e) || qo(t).getComputedStyle(t, null).getPropertyValue(e); + return t.style.getPropertyValue(e) || Vo(t).getComputedStyle(t, null).getPropertyValue(e); } function qf(t) { return function() { @@ -3210,16 +3210,16 @@ function Yf(t, e) { function Hf(t, e) { return arguments.length > 1 ? this.each((e == null ? qf : typeof e == "function" ? Yf : Vf)(t, e)) : this.node()[t]; } -function Vo(t) { +function Yo(t) { return t.trim().split(/^|\s+/); } function Os(t) { - return t.classList || new Yo(t); + return t.classList || new Ho(t); } -function Yo(t) { - this._node = t, this._names = Vo(t.getAttribute("class") || ""); +function Ho(t) { + this._node = t, this._names = Yo(t.getAttribute("class") || ""); } -Yo.prototype = { +Ho.prototype = { add: function(t) { var e = this._names.indexOf(t); e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); @@ -3232,29 +3232,29 @@ Yo.prototype = { return this._names.indexOf(t) >= 0; } }; -function Ho(t, e) { +function zo(t, e) { for (var n = Os(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function zo(t, e) { +function Xo(t, e) { for (var n = Os(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } function zf(t) { return function() { - Ho(this, t); + zo(this, t); }; } function Xf(t) { return function() { - zo(this, t); + Xo(this, t); }; } function Bf(t, e) { return function() { - (e.apply(this, arguments) ? Ho : zo)(this, t); + (e.apply(this, arguments) ? zo : Xo)(this, t); }; } function Wf(t, e) { - var n = Vo(t + ""); + var n = Yo(t + ""); if (arguments.length < 2) { for (var r = Os(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; @@ -3275,13 +3275,13 @@ function Kf(t) { this.textContent = e ?? ""; }; } -function Zf(t) { +function Jf(t) { return arguments.length ? this.each(t == null ? Uf : (typeof t == "function" ? Kf : Gf)(t)) : this.node().textContent; } -function jf() { +function Zf() { this.innerHTML = ""; } -function Jf(t) { +function jf(t) { return function() { this.innerHTML = t; }; @@ -3293,7 +3293,7 @@ function Qf(t) { }; } function tc(t) { - return arguments.length ? this.each(t == null ? jf : (typeof t == "function" ? Qf : Jf)(t)) : this.node().innerHTML; + return arguments.length ? this.each(t == null ? Zf : (typeof t == "function" ? Qf : jf)(t)) : this.node().innerHTML; } function ec() { this.nextSibling && this.parentNode.appendChild(this); @@ -3308,7 +3308,7 @@ function ic() { return this.each(rc); } function sc(t) { - var e = typeof t == "function" ? t : Do(t); + var e = typeof t == "function" ? t : Fo(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); @@ -3317,7 +3317,7 @@ function ac() { return null; } function oc(t, e) { - var n = typeof t == "function" ? t : Do(t), r = e == null ? ac : typeof e == "function" ? e : Is(e); + var n = typeof t == "function" ? t : Fo(t), r = e == null ? ac : typeof e == "function" ? e : Is(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); @@ -3392,18 +3392,18 @@ function mc(t, e, n) { for (o = e ? _c : gc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); return this; } -function Xo(t, e, n) { - var r = qo(t), i = r.CustomEvent; +function Bo(t, e, n) { + var r = Vo(t), i = r.CustomEvent; typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); } function yc(t, e) { return function() { - return Xo(this, t, e); + return Bo(this, t, e); }; } function wc(t, e) { return function() { - return Xo(this, t, e.apply(this, arguments)); + return Bo(this, t, e.apply(this, arguments)); }; } function xc(t, e) { @@ -3414,20 +3414,20 @@ function* bc() { for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var Bo = [null]; -function Qt(t, e) { +var Wo = [null]; +function ne(t, e) { this._groups = t, this._parents = e; } function _r() { - return new Qt([[document.documentElement]], Bo); + return new ne([[document.documentElement]], Wo); } function $c() { return this; } -Qt.prototype = _r.prototype = { - constructor: Qt, +ne.prototype = _r.prototype = { + constructor: ne, select: Gu, - selectAll: Ju, + selectAll: ju, selectChild: nf, selectChildren: of, filter: lf, @@ -3449,7 +3449,7 @@ Qt.prototype = _r.prototype = { style: Lf, property: Hf, classed: Wf, - text: Zf, + text: Jf, html: tc, raise: nc, lower: ic, @@ -3462,20 +3462,20 @@ Qt.prototype = _r.prototype = { dispatch: xc, [Symbol.iterator]: bc }; -function _t(t) { - return typeof t == "string" ? new Qt([[document.querySelector(t)]], [document.documentElement]) : new Qt([[t]], Bo); +function ut(t) { + return typeof t == "string" ? new ne([[document.querySelector(t)]], [document.documentElement]) : new ne([[t]], Wo); } function Ls(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } -function Wo(t, e) { +function Uo(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } function Wr() { } -var Fr = 0.7, _i = 1 / Fr, Jn = "\\s*([+-]?\\d+)\\s*", Ir = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Pe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Ac = /^#([0-9a-f]{3,8})$/, Ec = new RegExp(`^rgb\\(${Jn},${Jn},${Jn}\\)$`), Rc = new RegExp(`^rgb\\(${Pe},${Pe},${Pe}\\)$`), Cc = new RegExp(`^rgba\\(${Jn},${Jn},${Jn},${Ir}\\)$`), Tc = new RegExp(`^rgba\\(${Pe},${Pe},${Pe},${Ir}\\)$`), Nc = new RegExp(`^hsl\\(${Ir},${Pe},${Pe}\\)$`), Sc = new RegExp(`^hsla\\(${Ir},${Pe},${Pe},${Ir}\\)$`), da = { +var Fr = 0.7, gi = 1 / Fr, jn = "\\s*([+-]?\\d+)\\s*", Ir = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Me = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Ac = /^#([0-9a-f]{3,8})$/, Ec = new RegExp(`^rgb\\(${jn},${jn},${jn}\\)$`), Rc = new RegExp(`^rgb\\(${Me},${Me},${Me}\\)$`), Cc = new RegExp(`^rgba\\(${jn},${jn},${jn},${Ir}\\)$`), Tc = new RegExp(`^rgba\\(${Me},${Me},${Me},${Ir}\\)$`), Nc = new RegExp(`^hsl\\(${Ir},${Me},${Me}\\)$`), Sc = new RegExp(`^hsla\\(${Ir},${Me},${Me},${Ir}\\)$`), va = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3632,48 +3632,48 @@ Ls(Wr, qn, { displayable() { return this.rgb().displayable(); }, - hex: pa, + hex: ga, // Deprecated! Use color.formatHex. - formatHex: pa, + formatHex: ga, formatHex8: kc, - formatHsl: Mc, - formatRgb: va, - toString: va + formatHsl: Pc, + formatRgb: _a, + toString: _a }); -function pa() { +function ga() { return this.rgb().formatHex(); } function kc() { return this.rgb().formatHex8(); } -function Mc() { - return Uo(this).formatHsl(); +function Pc() { + return Go(this).formatHsl(); } -function va() { +function _a() { return this.rgb().formatRgb(); } function qn(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = Ac.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? ga(e) : n === 3 ? new Ht(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Qr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Qr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Ec.exec(t)) ? new Ht(e[1], e[2], e[3], 1) : (e = Rc.exec(t)) ? new Ht(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Cc.exec(t)) ? Qr(e[1], e[2], e[3], e[4]) : (e = Tc.exec(t)) ? Qr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Nc.exec(t)) ? ya(e[1], e[2] / 100, e[3] / 100, 1) : (e = Sc.exec(t)) ? ya(e[1], e[2] / 100, e[3] / 100, e[4]) : da.hasOwnProperty(t) ? ga(da[t]) : t === "transparent" ? new Ht(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = Ac.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? ma(e) : n === 3 ? new Ht(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? jr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? jr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Ec.exec(t)) ? new Ht(e[1], e[2], e[3], 1) : (e = Rc.exec(t)) ? new Ht(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Cc.exec(t)) ? jr(e[1], e[2], e[3], e[4]) : (e = Tc.exec(t)) ? jr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Nc.exec(t)) ? xa(e[1], e[2] / 100, e[3] / 100, 1) : (e = Sc.exec(t)) ? xa(e[1], e[2] / 100, e[3] / 100, e[4]) : va.hasOwnProperty(t) ? ma(va[t]) : t === "transparent" ? new Ht(NaN, NaN, NaN, 0) : null; } -function ga(t) { +function ma(t) { return new Ht(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function Qr(t, e, n, r) { +function jr(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new Ht(t, e, n, r); } -function Pc(t) { +function Mc(t) { return t instanceof Wr || (t = qn(t)), t ? (t = t.rgb(), new Ht(t.r, t.g, t.b, t.opacity)) : new Ht(); } function ps(t, e, n, r) { - return arguments.length === 1 ? Pc(t) : new Ht(t, e, n, r ?? 1); + return arguments.length === 1 ? Mc(t) : new Ht(t, e, n, r ?? 1); } function Ht(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -Ls(Ht, ps, Wo(Wr, { +Ls(Ht, ps, Uo(Wr, { brighter(t) { - return t = t == null ? _i : Math.pow(_i, t), new Ht(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? gi : Math.pow(gi, t), new Ht(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { return t = t == null ? Fr : Math.pow(Fr, t), new Ht(this.r * t, this.g * t, this.b * t, this.opacity); @@ -3682,29 +3682,29 @@ Ls(Ht, ps, Wo(Wr, { return this; }, clamp() { - return new Ht(Dn(this.r), Dn(this.g), Dn(this.b), mi(this.opacity)); + return new Ht(Dn(this.r), Dn(this.g), Dn(this.b), _i(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: _a, + hex: ya, // Deprecated! Use color.formatHex. - formatHex: _a, + formatHex: ya, formatHex8: Dc, - formatRgb: ma, - toString: ma + formatRgb: wa, + toString: wa })); -function _a() { +function ya() { return `#${$n(this.r)}${$n(this.g)}${$n(this.b)}`; } function Dc() { return `#${$n(this.r)}${$n(this.g)}${$n(this.b)}${$n((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function ma() { - const t = mi(this.opacity); +function wa() { + const t = _i(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${Dn(this.r)}, ${Dn(this.g)}, ${Dn(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function mi(t) { +function _i(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function Dn(t) { @@ -3713,57 +3713,57 @@ function Dn(t) { function $n(t) { return t = Dn(t), (t < 16 ? "0" : "") + t.toString(16); } -function ya(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new me(t, e, n, r); +function xa(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new _e(t, e, n, r); } -function Uo(t) { - if (t instanceof me) return new me(t.h, t.s, t.l, t.opacity); - if (t instanceof Wr || (t = qn(t)), !t) return new me(); - if (t instanceof me) return t; +function Go(t) { + if (t instanceof _e) return new _e(t.h, t.s, t.l, t.opacity); + if (t instanceof Wr || (t = qn(t)), !t) return new _e(); + if (t instanceof _e) return t; t = t.rgb(); var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new me(a, o, l, t.opacity); + return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new _e(a, o, l, t.opacity); } function Fc(t, e, n, r) { - return arguments.length === 1 ? Uo(t) : new me(t, e, n, r ?? 1); + return arguments.length === 1 ? Go(t) : new _e(t, e, n, r ?? 1); } -function me(t, e, n, r) { +function _e(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -Ls(me, Fc, Wo(Wr, { +Ls(_e, Fc, Uo(Wr, { brighter(t) { - return t = t == null ? _i : Math.pow(_i, t), new me(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? gi : Math.pow(gi, t), new _e(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? Fr : Math.pow(Fr, t), new me(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Fr : Math.pow(Fr, t), new _e(this.h, this.s, this.l * t, this.opacity); }, rgb() { var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; return new Ht( - Zi(t >= 240 ? t - 240 : t + 120, i, r), - Zi(t, i, r), - Zi(t < 120 ? t + 240 : t - 120, i, r), + Ki(t >= 240 ? t - 240 : t + 120, i, r), + Ki(t, i, r), + Ki(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new me(wa(this.h), ti(this.s), ti(this.l), mi(this.opacity)); + return new _e(ba(this.h), Qr(this.s), Qr(this.l), _i(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 t = mi(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${wa(this.h)}, ${ti(this.s) * 100}%, ${ti(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = _i(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${ba(this.h)}, ${Qr(this.s) * 100}%, ${Qr(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function wa(t) { +function ba(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function ti(t) { +function Qr(t) { return Math.max(0, Math.min(1, t || 0)); } -function Zi(t, e, n) { +function Ki(t, e, n) { return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; } const qs = (t) => () => t; @@ -3778,18 +3778,18 @@ function Oc(t, e, n) { }; } function Lc(t) { - return (t = +t) == 1 ? Go : function(e, n) { + return (t = +t) == 1 ? Ko : function(e, n) { return n - e ? Oc(e, n, t) : qs(isNaN(e) ? n : e); }; } -function Go(t, e) { +function Ko(t, e) { var n = e - t; return n ? Ic(t, n) : qs(isNaN(t) ? e : t); } -const yi = (function t(e) { +const mi = (function t(e) { var n = Lc(e); function r(i, s) { - var a = n((i = ps(i)).r, (s = ps(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Go(i.opacity, s.opacity); + var a = n((i = ps(i)).r, (s = ps(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Ko(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 + ""; }; @@ -3809,7 +3809,7 @@ function Vc(t) { } function Yc(t, e) { var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Zn(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = Jn(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); @@ -3822,7 +3822,7 @@ function Hc(t, e) { return n.setTime(t * (1 - r) + e * r), n; }; } -function Me(t, e) { +function Pe(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; @@ -3831,13 +3831,13 @@ function zc(t, e) { var n = {}, r = {}, i; (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); for (i in e) - i in t ? n[i] = Zn(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = Jn(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var vs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ji = new RegExp(vs.source, "g"); +var vs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Ji = new RegExp(vs.source, "g"); function Xc(t) { return function() { return t; @@ -3848,20 +3848,20 @@ function Bc(t) { return t(e) + ""; }; } -function Ko(t, e) { - var n = vs.lastIndex = ji.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = vs.exec(t)) && (i = ji.exec(e)); ) - (s = i.index) > n && (s = e.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: Me(r, i) })), n = ji.lastIndex; +function Jo(t, e) { + var n = vs.lastIndex = Ji.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (t = t + "", e = e + ""; (r = vs.exec(t)) && (i = Ji.exec(e)); ) + (s = i.index) > n && (s = e.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: Pe(r, i) })), n = Ji.lastIndex; return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Bc(l[0].x) : Xc(e) : (e = l.length, function(u) { for (var f = 0, h; f < e; ++f) o[(h = l[f]).i] = h.x(u); return o.join(""); }); } -function Zn(t, e) { +function Jn(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? qs(e) : (n === "number" ? Me : n === "string" ? (r = qn(e)) ? (e = r, yi) : Ko : e instanceof qn ? yi : e instanceof Date ? Hc : Vc(e) ? qc : Array.isArray(e) ? Yc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? zc : Me)(t, e); + return e == null || n === "boolean" ? qs(e) : (n === "number" ? Pe : n === "string" ? (r = qn(e)) ? (e = r, mi) : Jo : e instanceof qn ? mi : e instanceof Date ? Hc : Vc(e) ? qc : Array.isArray(e) ? Yc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? zc : Pe)(t, e); } -var xa = 180 / Math.PI, gs = { +var $a = 180 / Math.PI, gs = { translateX: 0, translateY: 0, rotate: 0, @@ -3874,19 +3874,19 @@ function Zo(t, e, n, r, i, s) { return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(e, t) * xa, - skewX: Math.atan(l) * xa, + rotate: Math.atan2(e, t) * $a, + skewX: Math.atan(l) * $a, scaleX: a, scaleY: o }; } -var ei; +var ti; function Wc(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); return e.isIdentity ? gs : Zo(e.a, e.b, e.c, e.d, e.e, e.f); } function Uc(t) { - return t == null || (ei || (ei = document.createElementNS("http://www.w3.org/2000/svg", "g")), ei.setAttribute("transform", t), !(t = ei.transform.baseVal.consolidate())) ? gs : (t = t.matrix, Zo(t.a, t.b, t.c, t.d, t.e, t.f)); + return t == null || (ti || (ti = document.createElementNS("http://www.w3.org/2000/svg", "g")), ti.setAttribute("transform", t), !(t = ti.transform.baseVal.consolidate())) ? gs : (t = t.matrix, Zo(t.a, t.b, t.c, t.d, t.e, t.f)); } function jo(t, e, n, r) { function i(u) { @@ -3894,94 +3894,94 @@ function jo(t, e, n, r) { } function s(u, f, h, c, p, g) { if (u !== h || f !== c) { - var m = p.push("translate(", null, e, null, n); - g.push({ i: m - 4, x: Me(u, h) }, { i: m - 2, x: Me(f, c) }); + var y = p.push("translate(", null, e, null, n); + g.push({ i: y - 4, x: Pe(u, h) }, { i: y - 2, x: Pe(f, c) }); } else (h || c) && p.push("translate(" + h + e + c + n); } function a(u, f, h, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Me(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Pe(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); } function o(u, f, h, c) { - u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Me(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); + u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Pe(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); } function l(u, f, h, c, p, g) { if (u !== h || f !== c) { - var m = p.push(i(p) + "scale(", null, ",", null, ")"); - g.push({ i: m - 4, x: Me(u, h) }, { i: m - 2, x: Me(f, c) }); + var y = p.push(i(p) + "scale(", null, ",", null, ")"); + g.push({ i: y - 4, x: Pe(u, h) }, { i: y - 2, x: Pe(f, c) }); } else (h !== 1 || c !== 1) && p.push(i(p) + "scale(" + h + "," + c + ")"); } return function(u, f) { var h = [], c = []; return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, h, c), a(u.rotate, f.rotate, h, c), o(u.skewX, f.skewX, h, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, h, c), u = f = null, function(p) { - for (var g = -1, m = c.length, b; ++g < m; ) h[(b = c[g]).i] = b.x(p); + for (var g = -1, y = c.length, $; ++g < y; ) h[($ = c[g]).i] = $.x(p); return h.join(""); }; }; } -var Gc = jo(Wc, "px, ", "px)", "deg)"), Kc = jo(Uc, ", ", ")", ")"), pr = 0, Cr = 0, Er = 0, Jo = 1e3, wi, Tr, xi = 0, Vn = 0, Ii = 0, Or = typeof performance == "object" && performance.now ? performance : Date, Qo = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Gc = jo(Wc, "px, ", "px)", "deg)"), Kc = jo(Uc, ", ", ")", ")"), pr = 0, Cr = 0, Er = 0, Qo = 1e3, yi, Tr, wi = 0, Vn = 0, Fi = 0, Or = typeof performance == "object" && performance.now ? performance : Date, tl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function Vs() { - return Vn || (Qo(Zc), Vn = Or.now() + Ii); + return Vn || (tl(Jc), Vn = Or.now() + Fi); } -function Zc() { +function Jc() { Vn = 0; } -function bi() { +function xi() { this._call = this._time = this._next = null; } -bi.prototype = tl.prototype = { - constructor: bi, +xi.prototype = el.prototype = { + constructor: xi, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Vs() : +n) + (e == null ? 0 : +e), !this._next && Tr !== this && (Tr ? Tr._next = this : wi = this, Tr = this), this._call = t, this._time = n, _s(); + n = (n == null ? Vs() : +n) + (e == null ? 0 : +e), !this._next && Tr !== this && (Tr ? Tr._next = this : yi = this, Tr = this), this._call = t, this._time = n, _s(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, _s()); } }; -function tl(t, e, n) { - var r = new bi(); +function el(t, e, n) { + var r = new xi(); return r.restart(t, e, n), r; } -function jc() { +function Zc() { Vs(), ++pr; - for (var t = wi, e; t; ) + for (var t = yi, e; t; ) (e = Vn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; --pr; } -function ba() { - Vn = (xi = Or.now()) + Ii, pr = Cr = 0; +function Aa() { + Vn = (wi = Or.now()) + Fi, pr = Cr = 0; try { - jc(); + Zc(); } finally { pr = 0, Qc(), Vn = 0; } } -function Jc() { - var t = Or.now(), e = t - xi; - e > Jo && (Ii -= e, xi = t); +function jc() { + var t = Or.now(), e = t - wi; + e > Qo && (Fi -= e, wi = t); } function Qc() { - for (var t, e = wi, n, r = 1 / 0; e; ) - e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : wi = n); + for (var t, e = yi, n, r = 1 / 0; e; ) + e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : yi = n); Tr = t, _s(r); } function _s(t) { if (!pr) { Cr && (Cr = clearTimeout(Cr)); var e = t - Vn; - e > 24 ? (t < 1 / 0 && (Cr = setTimeout(ba, t - Or.now() - Ii)), Er && (Er = clearInterval(Er))) : (Er || (xi = Or.now(), Er = setInterval(Jc, Jo)), pr = 1, Qo(ba)); + e > 24 ? (t < 1 / 0 && (Cr = setTimeout(Aa, t - Or.now() - Fi)), Er && (Er = clearInterval(Er))) : (Er || (wi = Or.now(), Er = setInterval(jc, Qo)), pr = 1, tl(Aa)); } } -function $a(t, e, n) { - var r = new bi(); +function Ea(t, e, n) { + var r = new xi(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var th = Po("start", "end", "cancel", "interrupt"), eh = [], el = 0, Aa = 1, ms = 2, ui = 3, Ea = 4, ys = 5, fi = 6; -function Oi(t, e, n, r, i, s) { +var th = Do("start", "end", "cancel", "interrupt"), eh = [], nl = 0, Ra = 1, ms = 2, li = 3, Ca = 4, ys = 5, ui = 6; +function Ii(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; @@ -3998,42 +3998,42 @@ function Oi(t, e, n, r, i, s) { duration: s.duration, ease: s.ease, timer: null, - state: el + state: nl }); } function Ys(t, e) { - var n = $e(t, e); - if (n.state > el) throw new Error("too late; already scheduled"); + var n = be(t, e); + if (n.state > nl) throw new Error("too late; already scheduled"); return n; } function Le(t, e) { - var n = $e(t, e); - if (n.state > ui) throw new Error("too late; already running"); + var n = be(t, e); + if (n.state > li) throw new Error("too late; already running"); return n; } -function $e(t, e) { +function be(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } function nh(t, e, n) { var r = t.__transition, i; - r[e] = n, n.timer = tl(s, 0, n.time); + r[e] = n, n.timer = el(s, 0, n.time); function s(u) { - n.state = Aa, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = Ra, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { var f, h, c, p; - if (n.state !== Aa) return l(); + if (n.state !== Ra) return l(); for (f in r) if (p = r[f], p.name === n.name) { - if (p.state === ui) return $a(a); - p.state === Ea ? (p.state = fi, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = fi, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); + if (p.state === li) return Ea(a); + p.state === Ca ? (p.state = ui, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = ui, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); } - if ($a(function() { - n.state === ui && (n.state = Ea, n.timer.restart(o, n.delay, n.time), o(u)); + if (Ea(function() { + n.state === li && (n.state = Ca, n.timer.restart(o, n.delay, n.time), o(u)); }), n.state = ms, n.on.call("start", t, t.__data__, n.index, n.group), n.state === ms) { - for (n.state = ui, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) + for (n.state = li, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) (p = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = p); i.length = h + 1; } @@ -4044,7 +4044,7 @@ function nh(t, e, n) { n.state === ys && (n.on.call("end", t, t.__data__, n.index, n.group), l()); } function l() { - n.state = fi, n.timer.stop(), delete r[e]; + n.state = ui, n.timer.stop(), delete r[e]; for (var u in r) return; delete t.__transition; } @@ -4058,7 +4058,7 @@ function rh(t, e) { s = !1; continue; } - i = r.state > ms && r.state < ys, r.state = fi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > ms && r.state < ys, r.state = ui, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } @@ -4103,7 +4103,7 @@ function ah(t, e, n) { function oh(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = $e(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = be(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) if ((a = r[i]).name === t) return a.value; return null; @@ -4116,12 +4116,12 @@ function Hs(t, e, n) { var i = Le(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return $e(i, r).value[e]; + return be(i, r).value[e]; }; } -function nl(t, e) { +function rl(t, e) { var n; - return (typeof e == "number" ? Me : e instanceof qn ? yi : (n = qn(e)) ? (e = n, yi) : Ko)(t, e); + return (typeof e == "number" ? Pe : e instanceof qn ? mi : (n = qn(e)) ? (e = n, mi) : Jo)(t, e); } function lh(t) { return function() { @@ -4162,7 +4162,7 @@ function dh(t, e, n) { }; } function ph(t, e) { - var n = Fi(t), r = n === "transform" ? Kc : nl; + var n = Di(t), r = n === "transform" ? Kc : rl; return this.attrTween(t, typeof e == "function" ? (n.local ? dh : hh)(n, r, Hs(this, "attr." + t, e)) : e == null ? (n.local ? uh : lh)(n) : (n.local ? ch : fh)(n, r, e)); } function vh(t, e) { @@ -4196,7 +4196,7 @@ function yh(t, e) { if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (e == null) return this.tween(n, null); if (typeof e != "function") throw new Error(); - var r = Fi(t); + var r = Di(t); return this.tween(n, (r.local ? _h : mh)(r, e)); } function wh(t, e) { @@ -4211,7 +4211,7 @@ function xh(t, e) { } function bh(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? wh : xh)(e, t)) : $e(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? wh : xh)(e, t)) : be(this.node(), e).delay; } function $h(t, e) { return function() { @@ -4225,7 +4225,7 @@ function Ah(t, e) { } function Eh(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? $h : Ah)(e, t)) : $e(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? $h : Ah)(e, t)) : be(this.node(), e).duration; } function Rh(t, e) { if (typeof e != "function") throw new Error(); @@ -4235,7 +4235,7 @@ function Rh(t, e) { } function Ch(t) { var e = this._id; - return arguments.length ? this.each(Rh(e, t)) : $e(this.node(), e).ease; + return arguments.length ? this.each(Rh(e, t)) : be(this.node(), e).ease; } function Th(t, e) { return function() { @@ -4249,11 +4249,11 @@ function Nh(t) { return this.each(Th(this._id, t)); } function Sh(t) { - typeof t != "function" && (t = Io(t)); + typeof t != "function" && (t = Oo(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new en(r, this._parents, this._name, this._id); + return new je(r, this._parents, this._name, this._id); } function kh(t) { if (t._id !== this._id) throw new Error(); @@ -4262,16 +4262,16 @@ function kh(t) { (c = l[p] || u[p]) && (h[p] = c); for (; o < r; ++o) a[o] = e[o]; - return new en(a, this._parents, this._name, this._id); + return new je(a, this._parents, this._name, this._id); } -function Mh(t) { +function Ph(t) { return (t + "").trim().split(/^|\s+/).every(function(e) { var n = e.indexOf("."); return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; }); } -function Ph(t, e, n) { - var r, i, s = Mh(e) ? Ys : Le; +function Mh(t, e, n) { + var r, i, s = Ph(e) ? Ys : Le; return function() { var a = s(this, t), o = a.on; o !== r && (i = (r = o).copy()).on(e, n), a.on = i; @@ -4279,7 +4279,7 @@ function Ph(t, e, n) { } function Dh(t, e) { var n = this._id; - return arguments.length < 2 ? $e(this.node(), n).on.on(t) : this.each(Ph(n, t, e)); + return arguments.length < 2 ? be(this.node(), n).on.on(t) : this.each(Mh(n, t, e)); } function Fh(t) { return function() { @@ -4296,20 +4296,20 @@ function Oh(t) { typeof t != "function" && (t = Is(t)); 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, h, c = 0; c < l; ++c) - (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Oi(u[c], e, n, c, u, $e(f, n))); - return new en(s, this._parents, e, n); + (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Ii(u[c], e, n, c, u, be(f, n))); + return new je(s, this._parents, e, n); } function Lh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = Fo(t)); + typeof t != "function" && (t = Io(t)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) for (var l = r[o], u = l.length, f, h = 0; h < u; ++h) if (f = l[h]) { - for (var c = t.call(f, f.__data__, h, l), p, g = $e(f, n), m = 0, b = c.length; m < b; ++m) - (p = c[m]) && Oi(p, e, n, m, c, g); + for (var c = t.call(f, f.__data__, h, l), p, g = be(f, n), y = 0, $ = c.length; y < $; ++y) + (p = c[y]) && Ii(p, e, n, y, c, g); s.push(c), a.push(f); } - return new en(s, a, e, n); + return new je(s, a, e, n); } var qh = _r.prototype.constructor; function Vh() { @@ -4322,7 +4322,7 @@ function Yh(t, e) { return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function rl(t) { +function il(t) { return function() { this.style.removeProperty(t); }; @@ -4344,13 +4344,13 @@ function zh(t, e, n) { function Xh(t, e) { var n, r, i, s = "style." + e, a = "end." + s, o; return function() { - var l = Le(this, t), u = l.on, f = l.value[s] == null ? o || (o = rl(e)) : void 0; + var l = Le(this, t), u = l.on, f = l.value[s] == null ? o || (o = il(e)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } function Bh(t, e, n) { - var r = (t += "") == "transform" ? Gc : nl; - return e == null ? this.styleTween(t, Yh(t, r)).on("end.style." + t, rl(t)) : typeof e == "function" ? this.styleTween(t, zh(t, r, Hs(this, "style." + t, e))).each(Xh(this._id, t)) : this.styleTween(t, Hh(t, r, e), n).on("end.style." + t, null); + var r = (t += "") == "transform" ? Gc : rl; + return e == null ? this.styleTween(t, Yh(t, r)).on("end.style." + t, il(t)) : typeof e == "function" ? this.styleTween(t, zh(t, r, Hs(this, "style." + t, e))).each(Xh(this._id, t)) : this.styleTween(t, Hh(t, r, e), n).on("end.style." + t, null); } function Wh(t, e, n) { return function(r) { @@ -4377,16 +4377,16 @@ function Kh(t) { this.textContent = t; }; } -function Zh(t) { +function Jh(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function jh(t) { - return this.tween("text", typeof t == "function" ? Zh(Hs(this, "text", t)) : Kh(t == null ? "" : t + "")); +function Zh(t) { + return this.tween("text", typeof t == "function" ? Jh(Hs(this, "text", t)) : Kh(t == null ? "" : t + "")); } -function Jh(t) { +function jh(t) { return function(e) { this.textContent = t.call(this, e); }; @@ -4395,7 +4395,7 @@ function Qh(t) { var e, n; function r() { var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && Jh(i)), e; + return i !== n && (e = (n = i) && jh(i)), e; } return r._value = t, r; } @@ -4407,18 +4407,18 @@ function td(t) { return this.tween(e, Qh(t)); } function ed() { - for (var t = this._name, e = this._id, n = il(), r = this._groups, i = r.length, s = 0; s < i; ++s) + for (var t = this._name, e = this._id, n = sl(), 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 = $e(l, e); - Oi(l, t, n, u, a, { + var f = be(l, e); + Ii(l, t, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new en(r, this._parents, t, n); + return new je(r, this._parents, t, n); } function nd() { var t, e, n = this, r = n._id, i = n.size(); @@ -4433,38 +4433,38 @@ function nd() { }); } var rd = 0; -function en(t, e, n, r) { +function je(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function ci(t) { +function fi(t) { return _r().transition(t); } -function il() { +function sl() { return ++rd; } -var Be = _r.prototype; -en.prototype = ci.prototype = { - constructor: en, +var ze = _r.prototype; +je.prototype = fi.prototype = { + constructor: je, select: Oh, selectAll: Lh, - selectChild: Be.selectChild, - selectChildren: Be.selectChildren, + selectChild: ze.selectChild, + selectChildren: ze.selectChildren, filter: Sh, merge: kh, selection: Vh, transition: ed, - call: Be.call, - nodes: Be.nodes, - node: Be.node, - size: Be.size, - empty: Be.empty, - each: Be.each, + call: ze.call, + nodes: ze.nodes, + node: ze.node, + size: ze.size, + empty: ze.empty, + each: ze.each, on: Dh, attr: ph, attrTween: yh, style: Bh, styleTween: Gh, - text: jh, + text: Zh, textTween: td, remove: Ih, tween: oh, @@ -4473,7 +4473,7 @@ en.prototype = ci.prototype = { ease: Ch, easeVarying: Nh, end: nd, - [Symbol.iterator]: Be[Symbol.iterator] + [Symbol.iterator]: ze[Symbol.iterator] }; function id(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; @@ -4493,16 +4493,16 @@ function ad(t, e) { } function od(t) { var e, n; - t instanceof en ? (e = t._id, t = t._name) : (e = il(), (n = sd).time = Vs(), t = t == null ? null : t + ""); + t instanceof je ? (e = t._id, t = t._name) : (e = sl(), (n = sd).time = Vs(), t = t == null ? null : t + ""); 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]) && Oi(l, t, e, u, a, n || ad(l, e)); - return new en(r, this._parents, t, e); + (l = a[u]) && Ii(l, t, e, u, a, n || ad(l, e)); + return new je(r, this._parents, t, e); } _r.prototype.interrupt = ih; _r.prototype.transition = od; const ws = Math.PI, xs = 2 * ws, mn = 1e-6, ld = xs - mn; -function sl(t) { +function al(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; @@ -4510,7 +4510,7 @@ function sl(t) { function ud(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return sl; + if (e > 15) return al; const n = 10 ** e; return function(r) { this._ += r[0]; @@ -4521,7 +4521,7 @@ function ud(t) { class fd { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? sl : ud(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? al : ud(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -4546,8 +4546,8 @@ class fd { else if (c > mn) if (!(Math.abs(h * l - u * f) > mn) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let p = r - a, g = i - o, m = l * l + u * u, b = p * p + g * g, $ = Math.sqrt(m), C = Math.sqrt(c), E = s * Math.tan((ws - Math.acos((m + c - b) / (2 * $ * C))) / 2), S = E / C, T = E / $; - Math.abs(S - 1) > mn && this._append`L${e + S * f},${n + S * h}`, this._append`A${s},${s},0,0,${+(h * p > f * g)},${this._x1 = e + T * l},${this._y1 = n + T * u}`; + let p = r - a, g = i - o, y = l * l + u * u, $ = p * p + g * g, E = Math.sqrt(y), S = Math.sqrt(c), C = s * Math.tan((ws - Math.acos((y + c - $) / (2 * E * S))) / 2), P = C / S, k = C / E; + Math.abs(P - 1) > mn && this._append`L${e + P * f},${n + P * h}`, this._append`A${s},${s},0,0,${+(h * p > f * g)},${this._x1 = e + k * l},${this._y1 = n + k * u}`; } } arc(e, n, r, i, s, a) { @@ -4567,17 +4567,17 @@ function cd(t) { return n; } const hd = cd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Pt(t) { +function Dt(t) { return function() { return t; }; } -const Ra = Math.abs, Nt = Math.atan2, _n = Math.cos, dd = Math.max, Ji = Math.min, Ce = Math.sin, jn = Math.sqrt, Lt = 1e-12, Lr = Math.PI, $i = Lr / 2, hi = 2 * Lr; +const Ta = Math.abs, St = Math.atan2, _n = Math.cos, dd = Math.max, Zi = Math.min, Re = Math.sin, Zn = Math.sqrt, Lt = 1e-12, Lr = Math.PI, bi = Lr / 2, ci = 2 * Lr; function pd(t) { return t > 1 ? 0 : t < -1 ? Lr : Math.acos(t); } -function Ca(t) { - return t >= 1 ? $i : t <= -1 ? -$i : Math.asin(t); +function Na(t) { + return t >= 1 ? bi : t <= -1 ? -bi : Math.asin(t); } function vd(t) { let e = 3; @@ -4613,61 +4613,61 @@ function xd(t, e, n, r, i, s, a, o) { if (!(c * c < Lt)) return c = (f * (e - s) - h * (t - i)) / c, [t + c * l, e + c * u]; } -function ni(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / jn(o * o + l * l), f = u * l, h = -u * o, c = t + f, p = e + h, g = n + f, m = r + h, b = (c + g) / 2, $ = (p + m) / 2, C = g - c, E = m - p, S = C * C + E * E, T = i - s, G = c * m - g * p, lt = (E < 0 ? -1 : 1) * jn(dd(0, T * T * S - G * G)), K = (G * E - C * lt) / S, rt = (-G * C - E * lt) / S, Q = (G * E + C * lt) / S, dt = (-G * C + E * lt) / S, pt = K - b, M = rt - $, P = Q - b, Xt = dt - $; - return pt * pt + M * M > P * P + Xt * Xt && (K = Q, rt = dt), { +function ei(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / Zn(o * o + l * l), f = u * l, h = -u * o, c = t + f, p = e + h, g = n + f, y = r + h, $ = (c + g) / 2, E = (p + y) / 2, S = g - c, C = y - p, P = S * S + C * C, k = i - s, G = c * y - g * p, ot = (C < 0 ? -1 : 1) * Zn(dd(0, k * k * P - G * G)), K = (G * C - S * ot) / P, nt = (-G * S - C * ot) / P, Q = (G * C + S * ot) / P, vt = (-G * S + C * ot) / P, gt = K - $, M = nt - E, D = Q - $, Xt = vt - E; + return gt * gt + M * M > D * D + Xt * Xt && (K = Q, nt = vt), { cx: K, - cy: rt, + cy: nt, x01: -f, y01: -h, - x11: K * (i / T - 1), - y11: rt * (i / T - 1) + x11: K * (i / k - 1), + y11: nt * (i / k - 1) }; } -function We() { - var t = gd, e = _d, n = Pt(0), r = null, i = md, s = yd, a = wd, o = null, l = vd(u); +function Ce() { + var t = gd, e = _d, n = Dt(0), r = null, i = md, s = yd, a = wd, o = null, l = vd(u); function u() { - var f, h, c = +t.apply(this, arguments), p = +e.apply(this, arguments), g = i.apply(this, arguments) - $i, m = s.apply(this, arguments) - $i, b = Ra(m - g), $ = m > g; + var f, h, c = +t.apply(this, arguments), p = +e.apply(this, arguments), g = i.apply(this, arguments) - bi, y = s.apply(this, arguments) - bi, $ = Ta(y - g), E = y > g; if (o || (o = f = l()), p < c && (h = p, p = c, c = h), !(p > Lt)) o.moveTo(0, 0); - else if (b > hi - Lt) - o.moveTo(p * _n(g), p * Ce(g)), o.arc(0, 0, p, g, m, !$), c > Lt && (o.moveTo(c * _n(m), c * Ce(m)), o.arc(0, 0, c, m, g, $)); + else if ($ > ci - Lt) + o.moveTo(p * _n(g), p * Re(g)), o.arc(0, 0, p, g, y, !E), c > Lt && (o.moveTo(c * _n(y), c * Re(y)), o.arc(0, 0, c, y, g, E)); else { - var C = g, E = m, S = g, T = m, G = b, lt = b, K = a.apply(this, arguments) / 2, rt = K > Lt && (r ? +r.apply(this, arguments) : jn(c * c + p * p)), Q = Ji(Ra(p - c) / 2, +n.apply(this, arguments)), dt = Q, pt = Q, M, P; - if (rt > Lt) { - var Xt = Ca(rt / c * Ce(K)), te = Ca(rt / p * Ce(K)); - (G -= Xt * 2) > Lt ? (Xt *= $ ? 1 : -1, S += Xt, T -= Xt) : (G = 0, S = T = (g + m) / 2), (lt -= te * 2) > Lt ? (te *= $ ? 1 : -1, C += te, E -= te) : (lt = 0, C = E = (g + m) / 2); + var S = g, C = y, P = g, k = y, G = $, ot = $, K = a.apply(this, arguments) / 2, nt = K > Lt && (r ? +r.apply(this, arguments) : Zn(c * c + p * p)), Q = Zi(Ta(p - c) / 2, +n.apply(this, arguments)), vt = Q, gt = Q, M, D; + if (nt > Lt) { + var Xt = Na(nt / c * Re(K)), re = Na(nt / p * Re(K)); + (G -= Xt * 2) > Lt ? (Xt *= E ? 1 : -1, P += Xt, k -= Xt) : (G = 0, P = k = (g + y) / 2), (ot -= re * 2) > Lt ? (re *= E ? 1 : -1, S += re, C -= re) : (ot = 0, S = C = (g + y) / 2); } - var St = p * _n(C), Ft = p * Ce(C), It = c * _n(T), ce = c * Ce(T); + var Ct = p * _n(S), It = p * Re(S), Tt = c * _n(k), he = c * Re(k); if (Q > Lt) { - var z = p * _n(E), Ct = p * Ce(E), rn = c * _n(S), tt = c * Ce(S), kt; - if (b < Lr) - if (kt = xd(St, Ft, rn, tt, z, Ct, It, ce)) { - var Ae = St - kt[0], Ee = Ft - kt[1], qe = z - kt[0], wt = Ct - kt[1], sn = 1 / Ce(pd((Ae * qe + Ee * wt) / (jn(Ae * Ae + Ee * Ee) * jn(qe * qe + wt * wt))) / 2), an = jn(kt[0] * kt[0] + kt[1] * kt[1]); - dt = Ji(Q, (c - an) / (sn - 1)), pt = Ji(Q, (p - an) / (sn + 1)); + var z = p * _n(C), Nt = p * Re(C), tn = c * _n(P), Z = c * Re(P), kt; + if ($ < Lr) + if (kt = xd(Ct, It, tn, Z, z, Nt, Tt, he)) { + var $e = Ct - kt[0], Ae = It - kt[1], qe = z - kt[0], ht = Nt - kt[1], en = 1 / Re(pd(($e * qe + Ae * ht) / (Zn($e * $e + Ae * Ae) * Zn(qe * qe + ht * ht))) / 2), nn = Zn(kt[0] * kt[0] + kt[1] * kt[1]); + vt = Zi(Q, (c - nn) / (en - 1)), gt = Zi(Q, (p - nn) / (en + 1)); } else - dt = pt = 0; + vt = gt = 0; } - lt > Lt ? pt > Lt ? (M = ni(rn, tt, St, Ft, p, pt, $), P = ni(z, Ct, It, ce, p, pt, $), o.moveTo(M.cx + M.x01, M.cy + M.y01), pt < Q ? o.arc(M.cx, M.cy, pt, Nt(M.y01, M.x01), Nt(P.y01, P.x01), !$) : (o.arc(M.cx, M.cy, pt, Nt(M.y01, M.x01), Nt(M.y11, M.x11), !$), o.arc(0, 0, p, Nt(M.cy + M.y11, M.cx + M.x11), Nt(P.cy + P.y11, P.cx + P.x11), !$), o.arc(P.cx, P.cy, pt, Nt(P.y11, P.x11), Nt(P.y01, P.x01), !$))) : (o.moveTo(St, Ft), o.arc(0, 0, p, C, E, !$)) : o.moveTo(St, Ft), !(c > Lt) || !(G > Lt) ? o.lineTo(It, ce) : dt > Lt ? (M = ni(It, ce, z, Ct, c, -dt, $), P = ni(St, Ft, rn, tt, c, -dt, $), o.lineTo(M.cx + M.x01, M.cy + M.y01), dt < Q ? o.arc(M.cx, M.cy, dt, Nt(M.y01, M.x01), Nt(P.y01, P.x01), !$) : (o.arc(M.cx, M.cy, dt, Nt(M.y01, M.x01), Nt(M.y11, M.x11), !$), o.arc(0, 0, c, Nt(M.cy + M.y11, M.cx + M.x11), Nt(P.cy + P.y11, P.cx + P.x11), $), o.arc(P.cx, P.cy, dt, Nt(P.y11, P.x11), Nt(P.y01, P.x01), !$))) : o.arc(0, 0, c, T, S, $); + ot > Lt ? gt > Lt ? (M = ei(tn, Z, Ct, It, p, gt, E), D = ei(z, Nt, Tt, he, p, gt, E), o.moveTo(M.cx + M.x01, M.cy + M.y01), gt < Q ? o.arc(M.cx, M.cy, gt, St(M.y01, M.x01), St(D.y01, D.x01), !E) : (o.arc(M.cx, M.cy, gt, St(M.y01, M.x01), St(M.y11, M.x11), !E), o.arc(0, 0, p, St(M.cy + M.y11, M.cx + M.x11), St(D.cy + D.y11, D.cx + D.x11), !E), o.arc(D.cx, D.cy, gt, St(D.y11, D.x11), St(D.y01, D.x01), !E))) : (o.moveTo(Ct, It), o.arc(0, 0, p, S, C, !E)) : o.moveTo(Ct, It), !(c > Lt) || !(G > Lt) ? o.lineTo(Tt, he) : vt > Lt ? (M = ei(Tt, he, z, Nt, c, -vt, E), D = ei(Ct, It, tn, Z, c, -vt, E), o.lineTo(M.cx + M.x01, M.cy + M.y01), vt < Q ? o.arc(M.cx, M.cy, vt, St(M.y01, M.x01), St(D.y01, D.x01), !E) : (o.arc(M.cx, M.cy, vt, St(M.y01, M.x01), St(M.y11, M.x11), !E), o.arc(0, 0, c, St(M.cy + M.y11, M.cx + M.x11), St(D.cy + D.y11, D.cx + D.x11), E), o.arc(D.cx, D.cy, vt, St(D.y11, D.x11), St(D.y01, D.x01), !E))) : o.arc(0, 0, c, k, P, E); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Lr / 2; - return [_n(h) * f, Ce(h) * f]; + return [_n(h) * f, Re(h) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Pt(+f), u) : t; + return arguments.length ? (t = typeof f == "function" ? f : Dt(+f), u) : t; }, u.outerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Pt(+f), u) : e; + return arguments.length ? (e = typeof f == "function" ? f : Dt(+f), u) : e; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Pt(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Dt(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Pt(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Dt(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Pt(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Dt(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Pt(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Dt(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Pt(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Dt(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; @@ -4681,39 +4681,39 @@ function $d(t, e) { function Ad(t) { return t; } -function Ta() { - var t = Ad, e = $d, n = null, r = Pt(0), i = Pt(hi), s = Pt(0); +function ji() { + var t = Ad, e = $d, n = null, r = Dt(0), i = Dt(ci), s = Dt(0); function a(o) { - var l, u = (o = bd(o)).length, f, h, c = 0, p = new Array(u), g = new Array(u), m = +r.apply(this, arguments), b = Math.min(hi, Math.max(-hi, i.apply(this, arguments) - m)), $, C = Math.min(Math.abs(b) / u, s.apply(this, arguments)), E = C * (b < 0 ? -1 : 1), S; + var l, u = (o = bd(o)).length, f, h, c = 0, p = new Array(u), g = new Array(u), y = +r.apply(this, arguments), $ = Math.min(ci, Math.max(-ci, i.apply(this, arguments) - y)), E, S = Math.min(Math.abs($) / u, s.apply(this, arguments)), C = S * ($ < 0 ? -1 : 1), P; for (l = 0; l < u; ++l) - (S = g[p[l] = l] = +t(o[l], l, o)) > 0 && (c += S); - for (e != null ? p.sort(function(T, G) { - return e(g[T], g[G]); - }) : n != null && p.sort(function(T, G) { - return n(o[T], o[G]); - }), l = 0, h = c ? (b - u * E) / c : 0; l < u; ++l, m = $) - f = p[l], S = g[f], $ = m + (S > 0 ? S * h : 0) + E, g[f] = { + (P = g[p[l] = l] = +t(o[l], l, o)) > 0 && (c += P); + for (e != null ? p.sort(function(k, G) { + return e(g[k], g[G]); + }) : n != null && p.sort(function(k, G) { + return n(o[k], o[G]); + }), l = 0, h = c ? ($ - u * C) / c : 0; l < u; ++l, y = E) + f = p[l], P = g[f], E = y + (P > 0 ? P * h : 0) + C, g[f] = { data: o[f], index: l, - value: S, - startAngle: m, - endAngle: $, - padAngle: C + value: P, + startAngle: y, + endAngle: E, + padAngle: S }; return g; } return a.value = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : Pt(+o), a) : t; + return arguments.length ? (t = typeof o == "function" ? o : Dt(+o), a) : t; }, a.sortValues = function(o) { return arguments.length ? (e = o, n = null, a) : e; }, a.sort = function(o) { return arguments.length ? (n = o, e = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Pt(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Dt(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Pt(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Dt(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Pt(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Dt(+o), a) : s; }, a; } function Nr(t, e, n) { @@ -4764,243 +4764,255 @@ const Rd = { @media (max-width: 768px) {.pie-chart-svg.svelte-80ulj4 {max-height:60vh;} }` }; -function al(t, e) { - Es(e, !0), So(t, Rd); - let n = ht(e, "jsonData", 7), r = ht(e, "currentRound", 7, 1), i = ht(e, "mouseEventType", 15), s = ht(e, "mouseData", 15), a = ht(e, "mouseX", 15), o = ht(e, "mouseY", 15), l = ht(e, "requestRoundChange", 7, (d) => { - }), u = ht(e, "candidateColors", 23, () => []), f = ht(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = ht(e, "firstRoundDeterminesPercentages", 7, !1), c = ht(e, "displayPhase", 15, 0); +function ol(t, e) { + Es(e, !0), ko(t, Rd); + let n = pt(e, "jsonData", 7), r = pt(e, "currentRound", 7, 1), i = pt(e, "mouseEventType", 15), s = pt(e, "mouseData", 15), a = pt(e, "mouseX", 15), o = pt(e, "mouseY", 15), l = pt(e, "requestRoundChange", 7, (d) => { + }), u = pt(e, "candidateColors", 23, () => []), f = pt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = pt(e, "firstRoundDeterminesPercentages", 7, !1), c = pt(e, "displayPhase", 15, 0); function p(d) { return d.isTransfer ? `${d.label}__transfer` : d.transferIndex != null ? `${d.label}__${d.transferIndex}` : d.label; } - const g = 800, m = 800, b = Math.min(g, m) * 0.3, $ = g / 2, C = m / 2, E = "Pie", S = "PieOutline", T = "Donut", G = "TextLayer", lt = "url(#cross-hatch)", K = 1.15, rt = 0.1, Q = 750, dt = 800, pt = "white", M = 1, P = "#ff00ff", Xt = 3; - function te(d) { + const g = 800, y = 800, $ = Math.min(g, y) * 0.3, E = g / 2, S = y / 2, C = "Pie", P = "PieOutline", k = "Donut", G = "TextLayer", ot = "url(#cross-hatch)", K = 1.15, nt = 0.1, Q = 750, vt = 800, gt = "white", M = 1, D = "#ff00ff", Xt = 3; + function re(d) { return "hatch-" + d.replace(/[^a-zA-Z0-9]/g, "-"); } - let St = [], Ft = [], It = [], ce = 0, z = 0; - const Ct = {}, rn = "No Further Rankings"; - let tt = /* @__PURE__ */ mt(null); + let Ct = [], It = [], Tt = [], he = 0, z = 0; + const Nt = {}, tn = "No Further Rankings"; + let Z = /* @__PURE__ */ mt(null); function kt() { - const d = _t(x(tt)); - d.select("#" + E).remove(), d.select("#" + S).remove(), d.select("#" + T).remove(), d.select("#" + G).remove(); + const d = ut(x(Z)); + d.select("#" + C).remove(), d.select("#" + P).remove(), d.select("#" + k).remove(), d.select("#" + G).remove(); } - function Ae(d) { - l() && (ut = d, l()(d)); + function $e(d) { + l() && (lt = d, l()(d)); } - function Ee(d) { - kt(), It = qe(d), St = Bs(d, E, It, $, C, 0, wt()), Bs(d, S, It, $, C, 0, wt(), !1, !1, !0); + function Ae(d) { + kt(), Tt = qe(d), Ct = Bs(d, C, Tt, E, S, 0, ht()), Bs(d, P, Tt, E, S, 0, ht(), !1, !1, !0), br(); } - Pu(() => { - xt(), setTimeout( + Mu(() => { + Pt(), setTimeout( () => { - Ee(r()); + Ae(r()); }, 0 ); }); function qe(d) { - const _ = J(d); - return ce = mr(d), _; + const _ = j(d); + return he = mr(d), _; } - function wt() { - return b; + function ht() { + return $; } - function sn() { - return wt() * 1.41; + function en() { + return ht() * 1.41; } - function an(d) { + function nn(d) { let _ = 0; - for (let y = 1; y < d; y++) { - const k = n().results[y - 1].tallyResults; - for (let A = 0; A < k.length; A++) { - const N = k[A].transfers; - if (N) { - const R = N.exhausted; - R && (_ += Number(R)); + for (let m = 1; m < d; m++) { + const A = n().results[m - 1].tallyResults; + for (let b = 0; b < A.length; b++) { + const R = A[b].transfers; + if (R) { + const N = R.exhausted; + N && (_ += Number(N)); } } } return _; } function Ur(d, _) { - if (d === "exhausted") return an(_); + if (d === "exhausted") return nn(_); { - const y = n().results[_ - 1].tally; - return Number(y[d]); + const m = n().results[_ - 1].tally; + return Number(m[d]); } } - function Li(d, _) { + function Oi(d, _) { return Ur(d, _).toLocaleString("en-US"); } function zn(d, _) { - const y = h() ? ce : qi(_); - return (Ur(d, _) / y).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + const m = h() ? he : Li(_); + return (Ur(d, _) / m).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } function mr(d) { const _ = n().results[d - 1].tally; - let y = 0; - for (let [k, A] of Object.entries(_)) - y += Number(A); - return y; + let m = 0; + for (let [A, b] of Object.entries(_)) + m += Number(b); + return m; } function Gr(d) { return d === "exhausted" || d === "Inactive Ballots"; } - function qi(d) { + function Li(d) { const _ = n().results[d - 1].tally; - let y = 0; - for (let [k, A] of Object.entries(_)) - Gr(k) || (y += Number(A)); - return y; + let m = 0; + for (let [A, b] of Object.entries(_)) + Gr(A) || (m += Number(b)); + return m; } function Xn(d, _) { if (!d || d < 1 || d > n().results.length) return console.warn("In chsoenCandidates: round ${round} is out of range."), []; if (f() && d === n().results.length) return []; - const y = n().results[d - 1].tallyResults, k = []; - for (let A = 0; A < y.length; A++) { - const N = y[A][_]; - N != null && k.push(N); + const m = n().results[d - 1].tallyResults, A = []; + for (let b = 0; b < m.length; b++) { + const R = m[b][_]; + R != null && A.push(R); } - return k; + return A; } - function yr(d) { + function Bn(d) { return Xn(d, "eliminated"); } function w(d) { let _ = []; - for (let y = 1; y <= d; y++) _ = _.concat(Xn(y, "elected")); - return _; - } - function W(d, _) { - const y = n().results[_ - 1].tallyResults; - let k = 0; - const A = y.findIndex((N) => (N == null ? void 0 : N.elected) && d == N.elected); - if (A >= 0) { - const N = y[A].transfers; - if (N) - for (let [R, L] of Object.entries(N)) k += Number(L); + for (let m = 1; m <= d; m++) _ = _.concat(Xn(m, "elected")); + return [...new Set(_)]; + } + function B(d, _) { + const m = n().results[_ - 1].tallyResults; + let A = 0; + const b = m.findIndex((R) => (R == null ? void 0 : R.elected) && d == R.elected); + if (b >= 0) { + const R = m[b].transfers; + if (R) + for (let [N, q] of Object.entries(R)) A += Number(q); } else return 0; - return k; + return A; } - function J(d) { + function j(d) { const _ = n().results; - let y = _[Math.max(0, d - 2)].tally; - const k = [], A = []; - for (let [R, L] of Object.entries(y)) - k.push({ label: R, value: 0 }); - y = _[d - 1].tally; - for (let R of k) { - const L = Number(y[R.label]), V = W(R.label, d); - V > 0 ? (A.push({ - label: R.label, - value: V, + let m = _[Math.max(0, d - 2)].tally; + const A = [], b = []; + for (let [N, q] of Object.entries(m)) + A.push({ label: N, value: 0 }); + m = _[d - 1].tally; + for (let N of A) + N.value = Number(m[N.label]), b.push(N); + const R = nn(d); + return b.push({ label: "exhausted", value: R }), b; + } + function wt(d, _) { + const m = []; + for (const A of d) { + if (A.label === "exhausted" || A.isTransfer) { + m.push(A); + continue; + } + const b = B(A.label, _); + b > 0 ? (m.push({ + label: A.label, + value: b, isTransfer: !0 - }), R.value = L - V, A.push(R)) : (R.value = L, A.push(R)); + }), m.push({ ...A, value: A.value - b })) : m.push(A); } - const N = an(d); - return A.push({ label: "exhausted", value: N }), A; + return m; } - function xt() { - const d = _t(x(tt)).select("defs").select("#cross-hatch"); + function Pt() { + const d = ut(x(Z)).select("defs").select("#cross-hatch"); let _ = 0; - for (let [y, k] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? _ < 10 ? Ct[y] = hd[_] : Ct[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ct[y] = u()[_ % u().length], _++; + for (let [m, A] of Object.entries(n().results[0].tally)) { + !u() || u().length === 0 ? _ < 10 ? Nt[m] = hd[_] : Nt[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Nt[m] = u()[_ % u().length], _++; { - const A = d.clone(!0); - A.attr("id", te(y)).select("rect").attr("fill", Ct[y]), A.selectAll("circle").attr("fill", "#383838"); + const b = d.clone(!0); + b.attr("id", re(m)).select("rect").attr("fill", Nt[m]), b.selectAll("circle").attr("fill", "#383838"); } } - Ct.exhausted = lt, Ct["Inactive Ballots"] = lt; + Nt.exhausted = ot, Nt["Inactive Ballots"] = ot; } - function Mt() { - _t(x(tt)).select("#" + T).remove(); + function tt() { + ut(x(Z)).select("#" + k).remove(); } - function j(d, _) { - const y = ci("global").duration(dt); - _ && y.on("end", _), Mt(), xr(d), fl(), hl(0, wt()), Kr(); + function xt(d, _) { + const m = fi("global").duration(vt); + _ && m.on("end", _); + const A = wt(Tt, d), R = ji().sort(null).value((N) => N.value)(A); + Ks(d, C, R, 0, ht()), Ks(d, P, R, 0, ht(), !0), Tt = A, Ct = R, tt(), xr(d), hl(), pl(0, ht()), br(); } - function vt(d, _) { - const y = ci("global").duration(dt); - _ && y.on("end", _), br(d); + function Bt(d, _) { + const m = fi("global").duration(vt); + _ && m.on("end", _), He(d); } - function Ot(d, _) { - const y = ci("global").duration(dt); - _ && y.on("end", _), Un(d), wr(wt()); + function Mt(d, _) { + const m = fi("global").duration(vt); + _ && m.on("end", _), yr(d), wr(ht()); } - let nt = !1, Bt = []; - function Tt() { - Kr(), nt = !1, bt(); + let dt = !1, Ot = []; + function et() { + br(), dt = !1, Wt(); } - function bt() { - if (Bt.length === 0) { - ut !== r() && (r() === ut + 1 && ut > 0 && r() <= n().results.length ? (ut = r(), he(r())) : r() >= 1 && r() <= n().results.length && (ut = r(), c(0), Ee(r()))); + function Wt() { + if (Ot.length === 0) { + lt !== r() && (r() === lt + 1 && lt > 0 && r() <= n().results.length ? (lt = r(), Ut(r())) : r() >= 1 && r() <= n().results.length && (lt = r(), c(0), Ae(r()))); return; } - const d = Bt.shift(); + const d = Ot.shift(); switch (d.type) { case "round": { const _ = d.round; - _ === ut + 1 && ut > 0 && _ <= n().results.length ? (ut = _, he(_)) : (_ !== ut && _ >= 1 && _ <= n().results.length && (ut = _, c(0), Ee(_)), bt()); + _ === lt + 1 && lt > 0 && _ <= n().results.length ? (lt = _, Ut(_)) : (_ !== lt && _ >= 1 && _ <= n().results.length && (lt = _, c(0), Ae(_)), Wt()); break; } case "step": - Re(); + pn(); break; } } - function he(d) { + function Ut(d) { if (d <= 1 || d > n().results.length) { - bt(); + Wt(); return; } - nt = !0, z = d, c(0), j(z - 1, () => { - vt(z - 1, () => { - Ot(z, Tt); + dt = !0, z = d, c(0), xt(z - 1, () => { + Bt(z - 1, () => { + Mt(z, et); }); }); } - function ee() { - nt || (nt = !0, z = r(), Ve()); + function rn() { + dt || (dt = !0, z = r(), dn()); } - function Ve() { + function dn() { if (c( 0 // if in the middle of "one small step" animation, reset to 0. - ), Bt.length > 0) { - Tt(); + ), Ot.length > 0) { + et(); return; } - const d = z < n().results.length - 1 ? Ve : Tt; - j(z, () => { - vt(z, () => { - z++, Ae(z), Ot(z, d); + const d = z < n().results.length - 1 ? dn : et; + xt(z, () => { + Bt(z, () => { + z++, $e(z), Mt(z, d); }); }); } ks(() => { - Bn(); + Wn(); }); - let ut = 0; - function Bn() { - if (ut != r()) { - if (nt) { - Bt.push({ type: "round", round: r() }); + let lt = 0; + function Wn() { + if (lt != r()) { + if (dt) { + Ot.push({ type: "round", round: r() }); return; } - ut == r() - 1 && ut > 0 ? Ye() : Wn(r()), ut = r(); + lt == r() - 1 && lt > 0 ? Ye() : Ve(r()), lt = r(); } } - function Wn(d) { - if (nt) { - Bt.push({ type: "round", round: d }); + function Ve(d) { + if (dt) { + Ot.push({ type: "round", round: d }); return; } - c(0), Ee(d); + c(0), Ae(d); } function Ye() { - if (nt) { - Bt.push({ type: "round", round: r() }); + if (dt) { + Ot.push({ type: "round", round: r() }); return; } if (r() <= 1) { @@ -5008,99 +5020,99 @@ function al(t, e) { return; } if (z = r(), z > n().results.length) { - Kr(), nt = !1; + br(), dt = !1; return; } - nt = !0, c() === 0 ? j(z - 1, () => { - vt(z - 1, () => { - Ot(z, Tt); + dt = !0, c() === 0 ? xt(z - 1, () => { + Bt(z - 1, () => { + Mt(z, et); }); - }) : c() === 1 ? vt(z - 1, () => { - Ot(z, Tt); - }) : c() === 2 && Ot(z, Tt), c(0); + }) : c() === 1 ? Bt(z - 1, () => { + Mt(z, et); + }) : c() === 2 && Mt(z, et), c(0); } - function Re() { + function pn() { if (r() > n().results.length) { - Kr(), nt = !1; + br(), dt = !1; return; } - if (nt) { - Bt.push({ type: "step" }); + if (dt) { + Ot.push({ type: "step" }); return; } - nt = !0, c((c() + 1) % 3), z = r(), c() === 1 ? j(z, Tt) : c() === 2 ? vt(z, Tt) : c() === 0 ? (z++, Ae(z), Ot(z, Tt)) : (nt = !1, console.warn("displayPhase out of range at ", c())); + dt = !0, c((c() + 1) % 3), z = r(), c() === 1 ? xt(z, et) : c() === 2 ? Bt(z, et) : c() === 0 ? (z++, $e(z), Mt(z, et)) : (dt = !1, console.warn("displayPhase out of range at ", c())); } - function Un(d) { - It = J(d), St = Us(d, E, It, 0, wt(), !0), Us(d, S, It, 0, wt(), !1, !0); + function yr(d) { + Tt = j(d), Ct = Us(d, C, Tt, 0, ht(), !0), Us(d, P, Tt, 0, ht(), !1, !0), ut(x(Z)).select("#" + P).selectAll(".eliminated").remove(); } function wr(d, _) { - const y = _t(x(tt)).select("#" + T), k = We().outerRadius(d).innerRadius(d - 1), A = y.selectAll(".slice"); - let N = A.size(); - function R() { - N--, N === 0 && cl(); + const m = ut(x(Z)).select("#" + k), A = Ce().outerRadius(d).innerRadius(d - 1), b = m.selectAll(".slice"); + let R = b.size(); + function N() { + R--, R === 0 && dl(); } - A.select("path").transition("global").duration(Q).attr("d", (L) => k(L)).on("end", (L) => R()); + b.select("path").transition("global").duration(Q).attr("d", (q) => A(q)).on("end", (q) => N()); } function xr(d) { - const _ = Vi(d, St); - Ft = Ws(d, T, _, $, C, wt(), sn(), !1, !0); - const y = _t(x(tt)); - y.select("#" + E).raise(), y.select("#" + S).raise(); + const _ = ll(d, Ct); + It = Ws(d, k, _, E, S, ht(), en(), !1, !0); + const m = ut(x(Z)); + m.select("#" + C).raise(), m.select("#" + P).raise(); } - function br(d) { - const _ = ll(d, Ft, St); - Ft = Gs(d, T, _, wt(), sn(), !1); + function He(d) { + const _ = fl(d, It, Ct); + It = Js(d, k, _, ht(), en(), !1); } - function ne(d) { - return Ct[d.data.label]; + function Gt(d) { + return Nt[d.data.label]; } - function He(d) { - const _ = {}, y = n().results[d - 1].tallyResults; - for (let k = 0; k < y.length; k++) { - let A = y[k].eliminated; - if (A === void 0 && (A = y[k].elected), A === void 0) { + function qi(d) { + const _ = {}, m = n().results[d - 1].tallyResults; + for (let A = 0; A < m.length; A++) { + let b = m[A].eliminated; + if (b === void 0 && (b = m[A].elected), b === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const N = y[k].transfers; - if (N === void 0) { + const R = m[A].transfers; + if (R === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [R, L] of Object.entries(N)) - _[R] === void 0 ? _[R] = Number(L) : _[R] += Number(L); + for (let [N, q] of Object.entries(R)) + _[N] === void 0 ? _[N] = Number(q) : _[N] += Number(q); } return _; } - function Vi(d, _) { - const y = [], k = ce, A = n().results[d - 1].tallyResults; - for (let N = 0; N < A.length; N++) { - let R = A[N].eliminated; - if (R === void 0 && (R = A[N].elected), R === void 0) { + function ll(d, _) { + const m = [], A = he, b = n().results[d - 1].tallyResults; + for (let R = 0; R < b.length; R++) { + let N = b[R].eliminated; + if (N === void 0 && (N = b[R].elected), N === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const L = A[N].transfers; - if (L === void 0) { + const q = b[R].transfers; + if (q === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let V = _.find((I) => I.data.label == R && I.data.isTransfer); - V === void 0 && (V = _.find((I) => I.data.label == R && !I.data.isTransfer)); - let D = 0; - if (V) D = V.startAngle; + let V = _.find((I) => I.data.label == N && I.data.isTransfer); + V === void 0 && (V = _.find((I) => I.data.label == N && !I.data.isTransfer)); + let F = 0; + if (V) F = V.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [I, X] of Object.entries(L)) { - let et; - const de = _.find((it) => it.data.label == I); - if (de) - et = structuredClone(de); + for (let [I, T] of Object.entries(q)) { + let U; + const vn = _.find((rt) => rt.data.label == I); + if (vn) + U = structuredClone(vn); else if (I == "exhausted") - et = { - data: { label: I, value: Number(X) }, + U = { + data: { label: I, value: Number(T) }, value: 0, index: 0, startAngle: 0, @@ -5108,157 +5120,164 @@ function al(t, e) { padAngle: 0 }; else if (I == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", X); + console.warn("makeDonutInfo: residual surplus = ", T); continue; } else { console.warn("makeDonutInfo: unrecognized name in transfers ", I); continue; } - const vn = Number(X) / k * 2 * Math.PI; - et.startAngle = D, D = et.endAngle = D + vn, et.index = N, et.data.transferIndex = N, y.push(et); + const Un = Number(T) / A * 2 * Math.PI; + U.startAngle = F, F = U.endAngle = F + Un, U.index = R, U.data.transferIndex = R, m.push(U); } } - return y; + return m; } - function ol(d, _, y) { - const k = {}; - for (let [A, N] of Object.entries(d)) { - const R = y.find((D) => A == D.data.label); - if (R === void 0) { - console.warn("getTransferStartAngles: mainPieObj not found for ", A); + function ul(d, _, m) { + const A = {}; + for (let [b, R] of Object.entries(d)) { + const N = m.find((F) => b == F.data.label); + if (N === void 0) { + console.warn("getTransferStartAngles: mainPieObj not found for ", b); continue; } - const L = (R.startAngle + R.endAngle) / 2, V = d[R.data.label] / _ * 2 * Math.PI; - k[R.data.label] = L - V / 2; + const q = (N.startAngle + N.endAngle) / 2, V = d[N.data.label] / _ * 2 * Math.PI; + A[N.data.label] = q - V / 2; } - return k; - } - function ll(d, _, y) { - const k = [], A = ce, N = He(d), R = ol(N, A, y); - for (let [L, V] of _.entries()) { - const D = structuredClone(V), I = V.endAngle - V.startAngle, X = y.find((et) => V.data.label === et.data.label && !et.data.isTransfer); - if (X) { - const et = X.data.label; - D.startAngle = R[et], R[et] += I, D.endAngle = D.startAngle + I; + return A; + } + function fl(d, _, m) { + const A = [], b = he, R = qi(d), N = ul(R, b, m); + for (let [q, V] of _.entries()) { + const F = structuredClone(V), I = V.endAngle - V.startAngle, T = m.find((U) => V.data.label === U.data.label && !U.data.isTransfer); + if (T) { + const U = T.data.label; + F.startAngle = N[U], N[U] += I, F.endAngle = F.startAngle + I; } else if (V.data.label === "exhausted") - D.startAngle = V.startAngle, D.endAngle = V.endAngle; + F.startAngle = V.startAngle, F.endAngle = V.endAngle; else { console.warn("updateDonutInfo: unrecognized slice name ", V.data.label); continue; } - D.index = L, k.push(D); + F.index = q, A.push(F); } - return k; - } - function Xs(d, _, y, k, A, N) { - const L = _t(x(tt)).append("g").attr("id", G).attr("transform", `translate(${y}, ${k})`), V = We().innerRadius(A * K).outerRadius(A * K); - L.selectAll("text").data(_).enter().each(function(D) { - D.endAngle - D.startAngle < rt || D.data.isTransfer || _t(this).append("g").attr("id", (I) => p(I.data)).classed("eliminated", (I) => N.includes(I.data.label) || I.data.isTransfer === !0).each(function(I, X) { - I.data.label === "exhausted" && _t(this).on("mouseenter", (et, de) => dl(et)).on("mouseleave", (et, de) => pl()); - }).append("text").attr("transform", (I) => `translate(${V.centroid(I)})`).attr("text-anchor", (I) => Yi(I.startAngle, I.endAngle)).text((I) => I.data.label === "exhausted" ? rn : I.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((I) => { - const X = Li(I.data.label, d); - return !h() && Gr(I.data.label) ? X : X + " (" + zn(I.data.label, d) + ")"; + return A; + } + function Xs(d, _, m, A, b, R) { + const q = ut(x(Z)).append("g").attr("id", G).attr("transform", `translate(${m}, ${A})`), V = Ce().innerRadius(b * K).outerRadius(b * K); + q.selectAll("text").data(_).enter().each(function(F) { + F.endAngle - F.startAngle < nt || F.data.isTransfer || ut(this).append("g").attr("id", (I) => p(I.data)).classed("eliminated", (I) => R.includes(I.data.label) || I.data.isTransfer === !0).each(function(I, T) { + I.data.label === "exhausted" && ut(this).on("mouseenter", (U, vn) => vl(U)).on("mouseleave", (U, vn) => gl()); + }).append("text").attr("transform", (I) => `translate(${V.centroid(I)})`).attr("text-anchor", (I) => Vi(I.startAngle, I.endAngle)).text((I) => I.data.label === "exhausted" ? tn : I.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((I) => { + const T = Oi(I.data.label, d); + return !h() && Gr(I.data.label) ? T : T + " (" + zn(I.data.label, d) + ")"; }); }); } - function ul(d, _, y, k) { - const N = _t(x(tt)).select("#" + G), R = N.selectAll("tspan"), L = N.selectAll("g").data(_, (X) => p(X.data)).classed("eliminated", (X) => k.includes(X.data.label) || X.data.isTransfer === !0), V = We().innerRadius(y * K).outerRadius(y * K + 1); - R.transition("global").duration(Q).attr("transform", (X) => `translate(${V.centroid(X)})`).attr("text-anchor", (X) => Yi(X.startAngle, X.endAngle)), L.select("text").transition("global").duration(Q).attr("transform", (X) => `translate(${V.centroid(X)})`).attr("text-anchor", (X) => Yi(X.startAngle, X.endAngle)).on("end", (X) => I()); - let D = L.size(); - function I(X) { - D--, D === 0 && (N.remove(), Xs(d, _, $, C, y, k)); + function cl(d, _, m, A) { + const R = ut(x(Z)).select("#" + G), N = R.selectAll("tspan"), q = R.selectAll("g").data(_, (T) => p(T.data)).classed("eliminated", (T) => A.includes(T.data.label) || T.data.isTransfer === !0), V = Ce().innerRadius(m * K).outerRadius(m * K + 1); + N.transition("global").duration(Q).attr("transform", (T) => `translate(${V.centroid(T)})`).attr("text-anchor", (T) => Vi(T.startAngle, T.endAngle)), q.select("text").transition("global").duration(Q).attr("transform", (T) => `translate(${V.centroid(T)})`).attr("text-anchor", (T) => Vi(T.startAngle, T.endAngle)).on("end", (T) => I()); + let F = q.size(); + function I(T) { + F--, F === 0 && (R.remove(), Xs(d, _, E, S, m, A)); } } - function Bs(d, _, y, k, A, N, R, L = !0, V = !1, D = !1) { - const X = Ta().sort(null).value((et) => et.value)(y); - return Ws(d, _, X, k, A, N, R, L, V, D), X; + function Bs(d, _, m, A, b, R, N, q = !0, V = !1, F = !1) { + const T = ji().sort(null).value((U) => U.value)(m); + return Ws(d, _, T, A, b, R, N, q, V, F), T; } - function Kr() { - _t(x(tt)).select("#" + S).selectAll(".elected").select("path").style("stroke", P).style("stroke-width", `${Xt}px`); + function br() { + ut(x(Z)).select("#" + P).selectAll(".elected").select("path").style("stroke", D).style("stroke-width", `${Xt}px`); } - function Ws(d, _, y, k, A, N, R, L, V, D = !1) { - const I = yr(d), X = w(d), ze = _t(x(tt)).attr("viewBox", `0 0 ${g} ${m}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${k}, ${A})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (it) => I.includes(it.data.label) || it.data.isTransfer === !0).classed("elected", (it) => X.includes(it.data.label) && !it.data.isTransfer).attr("id", (it) => p(it.data)); - D ? ze.style("pointer-events", "none") : ze.on("mouseenter", (it, O) => zi(it, O)).on("mouseleave", (it, O) => Xi(it, O)); - const vn = We().outerRadius(R).innerRadius(N); + function Ws(d, _, m, A, b, R, N, q, V, F = !1) { + const I = Bn(d), T = w(d), bt = ut(x(Z)).attr("viewBox", `0 0 ${g} ${y}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${A}, ${b})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (rt) => I.includes(rt.data.label) || rt.data.isTransfer === !0).classed("elected", (rt) => T.includes(rt.data.label) && !rt.data.isTransfer).attr("id", (rt) => p(rt.data)); + F ? bt.style("pointer-events", "none") : bt.on("mouseenter", (rt, Ee) => Hi(rt, Ee)).on("mouseleave", (rt, Ee) => zi(rt, Ee)); + const Un = Ce().outerRadius(N).innerRadius(R); if (V) { - const it = We().outerRadius(N + 1).innerRadius(N); - ze.append("path").attr("d", it).attr("stroke", D ? "none" : pt).attr("stroke-width", D ? 0 : M).attr("fill", "none").transition("global").duration(Q).attr("d", (O) => vn(O)).attr("fill", D ? "none" : (O) => ne(O)).on("end", (O) => { - D || Hi(); + const rt = Ce().outerRadius(R + 1).innerRadius(R); + bt.append("path").attr("d", rt).attr("stroke", F ? "none" : gt).attr("stroke-width", F ? 0 : M).attr("fill", "none").transition("global").duration(Q).attr("d", (Ee) => Un(Ee)).attr("fill", F ? "none" : (Ee) => Gt(Ee)).on("end", (Ee) => { + F || Yi(); }); } else - ze.append("path").attr("d", (it) => vn(it)).attr("fill", D ? "none" : (it) => ne(it)).attr("stroke", D ? "none" : pt).attr("stroke-width", D ? 0 : M), D || Hi(); - return L && !D && Xs(d, y, k, A, R, I), y; - } - function fl() { - const y = _t(x(tt)).select("#" + G).selectAll(".eliminated"); - y.size() > 0 && y.classed("finished", !0); - } - function cl() { - const y = _t(x(tt)).select("#" + G).selectAll(".finished"); - y.size() > 0 && y.remove(); - } - function hl(d, _) { - const A = _t(x(tt)).select("#" + E).selectAll(".eliminated"), N = We().innerRadius(d), R = We().outerRadius(_); - A.classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(L) { - const V = Zn(_, d); - return function(D) { - return R.innerRadius(V(D)), R(L); + bt.append("path").attr("d", (rt) => Un(rt)).attr("fill", F ? "none" : (rt) => Gt(rt)).attr("stroke", F ? "none" : gt).attr("stroke-width", F ? 0 : M), F || Yi(); + return q && !F && Xs(d, m, A, b, N, I), m; + } + function hl() { + const m = ut(x(Z)).select("#" + G).selectAll(".eliminated"); + m.size() > 0 && m.classed("finished", !0); + } + function dl() { + const m = ut(x(Z)).select("#" + G).selectAll(".finished"); + m.size() > 0 && m.remove(); + } + function pl(d, _) { + const b = ut(x(Z)).select("#" + C).selectAll(".eliminated"), R = Ce().innerRadius(d), N = Ce().outerRadius(_); + b.classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(q) { + const V = Jn(_, d); + return function(F) { + return N.innerRadius(V(F)), N(q); }; - }).attr("fill", (L) => `url(#${te(L.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(L) { - const V = Zn(_, d); - return function(D) { - return N.outerRadius(V(D)), N(L); + }).attr("fill", (q) => `url(#${re(q.data.label)})`), b.clone(!0).classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(q) { + const V = Jn(_, d); + return function(F) { + return R.outerRadius(V(F)), R(q); }; - }).attr("fill", (L) => ne(L)); + }).attr("fill", (q) => Gt(q)); } - function Yi(d, _) { - const y = (d + _) / 2; - return y > Math.PI * 11 / 6 || y < Math.PI * 1 / 6 || y > Math.PI * 5 / 6 && y < Math.PI * 7 / 6 ? "middle" : y < Math.PI ? "start" : "end"; + function Vi(d, _) { + const m = (d + _) / 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 Hi() { - _t(x( - tt + function Yi() { + ut(x( + Z // force redisplay of text labels )).select("#" + G).raise().append("g").remove(); } - function Us(d, _, y, k, A, N, R = !1) { - const V = Ta().sort(null).value((D) => D.value)(y); - return Gs(d, _, V, k, A, N, R), V; - } - function Gs(d, _, y, k, A, N, R = !1) { - const L = yr(d), V = w(d), D = We().outerRadius(A).innerRadius(k).startAngle((O) => O.startAngle).endAngle((O) => O.endAngle), I = We().outerRadius(A).innerRadius(k), et = _t(x(tt)).select("#" + _); - et.selectAll(".slice").attr("prevStart", (O) => O.startAngle).attr("prevEnd", (O) => O.endAngle); - const de = et.selectAll(".slice").data(y, (O) => p(O.data)), ze = de.enter().append("g").attr("class", "slice").attr("id", (O) => p(O.data)).classed("eliminated", !0); - R ? ze.style("pointer-events", "none") : ze.on("mouseenter", (O, Xe) => zi(O, Xe)).on("mouseleave", (O, Xe) => Xi(O, Xe)), ze.append("path").attr("d", (O) => I(O)).attr("fill", R ? "none" : (O) => ne(O)).attr("stroke", R ? "none" : pt).attr("stroke-width", R ? 0 : M), de.classed("eliminated", (O) => L.includes(O.data.label)).classed("elected", (O) => V.includes(O.data.label)), R || de.on("mouseenter", (O, Xe) => zi(O, Xe)).on("mouseleave", (O, Xe) => Xi(O, Xe)); - let vn = de.size(); - function it() { - vn--, vn <= 0 && (R || Hi(), et.selectAll(".finished").remove()); + function Us(d, _, m, A, b, R, N = !1) { + const V = ji().sort(null).value((F) => F.value)(m); + return Js(d, _, V, A, b, R, N), V; + } + function Gs(d, _, m, A, b = !1) { + const R = Bn(d), N = w(d), F = ut(x(Z)).select("#" + _).selectAll(".slice").data(m, (T) => p(T.data)), I = F.enter().append("g").attr("class", "slice").attr("id", (T) => p(T.data)).classed("eliminated", !0); + return b ? I.style("pointer-events", "none") : I.on("mouseenter", (T, U) => Hi(T, U)).on("mouseleave", (T, U) => zi(T, U)), I.append("path").attr("d", (T) => A(T)).attr("fill", b ? "none" : (T) => Gt(T)).attr("stroke", b ? "none" : gt).attr("stroke-width", b ? 0 : M), F.classed("eliminated", (T) => R.includes(T.data.label)).classed("elected", (T) => N.includes(T.data.label)), b || F.on("mouseenter", (T, U) => Hi(T, U)).on("mouseleave", (T, U) => zi(T, U)), F; + } + function Ks(d, _, m, A, b, R = !1) { + const N = Ce().outerRadius(b).innerRadius(A); + Gs(d, _, m, N, R).select("path").attr("d", (V) => N(V)).attr("fill", R ? "none" : (V) => Gt(V)); + } + function Js(d, _, m, A, b, R, N = !1) { + const q = Ce().outerRadius(b).innerRadius(A).startAngle((bt) => bt.startAngle).endAngle((bt) => bt.endAngle), V = Ce().outerRadius(b).innerRadius(A), I = ut(x(Z)).select("#" + _); + I.selectAll(".slice").attr("prevStart", (bt) => bt.startAngle).attr("prevEnd", (bt) => bt.endAngle); + const T = Gs(d, _, m, V, N); + let U = T.size(); + function vn() { + U--, U <= 0 && (N || Yi(), I.selectAll(".finished").remove()); } - return de.select("path").transition("global").duration(Q).attrTween("d", function(O) { - const Xe = Number(_t(this.parentNode).attr("prevStart")), gl = Number(_t(this.parentNode).attr("prevEnd")), _l = Zn(Xe, O.startAngle), ml = Zn(gl, O.endAngle); - return (Zs) => (D.startAngle(_l(Zs)).endAngle(ml(Zs)), D(O)); - }).on("end", it), N && !R && ul(d, y, A, L), y; + return T.select("path").transition("global").duration(Q).attrTween("d", function(bt) { + const Un = Number(ut(this.parentNode).attr("prevStart")), rt = Number(ut(this.parentNode).attr("prevEnd")), Ee = Jn(Un, bt.startAngle), ml = Jn(rt, bt.endAngle); + return (js) => (q.startAngle(Ee(js)).endAngle(ml(js)), q(bt)); + }).on("end", vn), R && !N && cl(d, m, b, Bn(d)), m; } - function zi(d, _) { + function Hi(d, _) { s(_.data.label), i("enter"), a(d.clientX), o(d.clientY); } - function Xi(d, _) { + function zi(d, _) { s(_.data.label), i("leave"); } - function dl(d, _) { + function vl(d, _) { i("show-exhausted"), a(d.clientX), o(d.clientY); } - function pl(d, _) { + function gl(d, _) { i("hide-exhausted"); } - var vl = { - pieColors: Ct, - exhaustedLabel: rn, - countExhaustedVotes: an, - getEliminatedCandidates: yr, + var _l = { + pieColors: Nt, + exhaustedLabel: tn, + countExhaustedVotes: nn, + getEliminatedCandidates: Bn, getElectedCandidates: w, - runFullAnimationFn: ee, - animateOnePhaseFn: Re, + runFullAnimationFn: rn, + animateOnePhaseFn: pn, get jsonData() { return n(); }, @@ -5326,11 +5345,11 @@ function al(t, e) { set displayPhase(d = 0) { c(d), ft(); } - }, Ks = Ed(); - return ai(Ks, (d) => at(tt, d), () => x(tt)), ge(t, Ks), Rs(vl); + }, Zs = Ed(); + return si(Zs, (d) => st(Z, d), () => x(Z)), ve(t, Zs), Rs(_l); } Mo( - al, + ol, { jsonData: {}, currentRound: {}, @@ -5356,7 +5375,7 @@ Mo( ], { mode: "open" } ); -var Cd = /* @__PURE__ */ Hn(" ", 1), Td = /* @__PURE__ */ Hn("About to eliminate: ", 1), Nd = /* @__PURE__ */ Hn(" ", 1), Sd = /* @__PURE__ */ Hn(" ", 1), kd = /* @__PURE__ */ Hn('

', 1), Md = /* @__PURE__ */ Hn("
", 1), Pd = /* @__PURE__ */ Hn('


these ballots have already been eliminated.
', 1); +var Cd = /* @__PURE__ */ Hn(" ", 1), Td = /* @__PURE__ */ Hn("About to eliminate: ", 1), Nd = /* @__PURE__ */ Hn(" ", 1), Sd = /* @__PURE__ */ Hn(" ", 1), kd = /* @__PURE__ */ Hn('

', 1), Pd = /* @__PURE__ */ Hn("
", 1), Md = /* @__PURE__ */ Hn('


these ballots have already been eliminated.
', 1); const Dd = { 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;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl) {background-color:#4747ff;color:#fff;padding:1px 7px;font-size:0.67rem;min-width:107px;border:none;border-radius:3px;cursor:pointer;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl):hover {background-color:#4747c2;}.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;} @@ -5373,10 +5392,10 @@ const Dd = { }` }; function Fd(t, e) { - Es(e, !0), So(t, Dd); + Es(e, !0), ko(t, Dd); const n = 0.85; - let r = ht(e, "electionSummary", 7), i = ht(e, "currentRound", 7, 1), s = ht(e, "requestRoundChange", 7, (w) => { - }), a = ht(e, "candidateColors", 23, () => []), o = ht(e, "textForWinner", 7, "elected"), l = ht(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = ht(e, "firstRoundDeterminesPercentages", 7, !1), f = ht(e, "showCaptions", 7, !1); + let r = pt(e, "electionSummary", 7), i = pt(e, "currentRound", 7, 1), s = pt(e, "requestRoundChange", 7, (w) => { + }), a = pt(e, "candidateColors", 23, () => []), o = pt(e, "textForWinner", 7, "elected"), l = pt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = pt(e, "firstRoundDeterminesPercentages", 7, !1), f = pt(e, "showCaptions", 7, !1); const h = { elected: { caption: "Elected", @@ -5395,111 +5414,111 @@ function Fd(t, e) { infinitive: "to take the lead" } }; - let c = /* @__PURE__ */ Gn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ mt(null), g = /* @__PURE__ */ mt(null), m = /* @__PURE__ */ mt(""), b = /* @__PURE__ */ mt(xn([])), $ = /* @__PURE__ */ mt(""), C = /* @__PURE__ */ mt(""), E = /* @__PURE__ */ mt(0), S = /* @__PURE__ */ mt(0), T = /* @__PURE__ */ Gn(() => G(r())); + let c = /* @__PURE__ */ Gn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ mt(null), g = /* @__PURE__ */ mt(null), y = /* @__PURE__ */ mt(""), $ = /* @__PURE__ */ mt(xn([])), E = /* @__PURE__ */ mt(""), S = /* @__PURE__ */ mt(""), C = /* @__PURE__ */ mt(0), P = /* @__PURE__ */ mt(0), k = /* @__PURE__ */ Gn(() => G(r())); function G(w) { if (typeof w == "string") try { w = JSON.parse(w); - } catch (W) { - return console.error("Failed to parse JSON string:", W), {}; + } catch (B) { + return console.error("Failed to parse JSON string:", B), {}; } return w || {}; } - function lt(w) { + function ot(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function K(w, W, J) { - w.style.left = W + "px", w.style.top = J + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const j = w.getBoundingClientRect(); - let vt = W, Ot = J + 20; - vt + j.width > window.innerWidth - 12 && (vt = window.innerWidth - j.width - 12), vt < 12 && (vt = 12), Ot + j.height > window.innerHeight - 12 && (Ot = J - j.height - 12), w.style.left = vt + "px", w.style.top = Ot + "px"; + function K(w, B, j) { + w.style.left = B + "px", w.style.top = j + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const tt = w.getBoundingClientRect(); + let xt = B, Bt = j + 20; + xt + tt.width > window.innerWidth - 12 && (xt = window.innerWidth - tt.width - 12), xt < 12 && (xt = 12), Bt + tt.height > window.innerHeight - 12 && (Bt = j - tt.height - 12), w.style.left = xt + "px", w.style.top = Bt + "px"; }); } - function rt() { - switch (x($)) { + function nt() { + switch (x(E)) { case "enter": ((w) => { - var W = Il(w, 2); - at(b, W[0], !0), at(m, W[1], !0); - })(dt(x(C), i())), x(p) && (K(x(p), x(E) || 0, x(S) || 0), x(p).style.opacity = String(n)); + var B = Il(w, 2); + st($, B[0], !0), st(y, B[1], !0); + })(vt(x(S), i())), x(p) && (K(x(p), x(C) || 0, x(P) || 0), x(p).style.opacity = String(n)); break; case "leave": - x(p) && (x(p).style.opacity = "0"), at(b, [], !0), at(m, ""); + x(p) && (x(p).style.opacity = "0"), st($, [], !0), st(y, ""); break; case "show-exhausted": - x(g) && (K(x(g), x(E) || 0, x(S) || 0), x(g).style.opacity = String(n)); + x(g) && (K(x(g), x(C) || 0, x(P) || 0), x(g).style.opacity = String(n)); break; case "hide-exhausted": x(g) && (x(g).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", x($)); + console.log("Unknown mouse event: ", x(E)); break; } } - ks(() => rt()); - function Q(w, W) { - return w == 1 ? W ? "vote was" : "vote will be" : W ? "votes were" : "votes will be"; - } - function dt(w, W) { - const J = [], xt = w === "exhausted" ? z() : w; - let Mt; - w == "exhausted" ? Mt = It(1) : Mt = x(T).results[0].tally[w], J.push(`${xt} started with ${Mt} votes.`); - for (let j = 1; j <= W; j++) { - j === W && (w == "exhausted" ? Mt = It(W) : Mt = x(T).results[W - 1].tally[w], J.push(`${xt} has ${Mt} votes at round ${W}.`)); - const vt = x(T).results[j - 1].tallyResults, Ot = te(j); - for (let nt = 0; nt < vt.length; nt++) { - const Bt = vt[nt].transfers, Tt = vt[nt].eliminated, bt = vt[nt].elected; - if (!Ot) { - if (Tt) - Tt === w && J.push(`${xt} will be eliminated on round ${j}.`); - else if (w === bt && (J.push(`${xt} ${x(c).event} on round ${j}.`), Bt)) - for (let [ee, Ve] of Object.entries(Bt)) - J.push(`${Ve} ${Q(Number(Ve), j < W)} transferred to ${ee} on round ${j}.`); + ks(() => nt()); + function Q(w, B) { + return w == 1 ? B ? "vote was" : "vote will be" : B ? "votes were" : "votes will be"; + } + function vt(w, B) { + const j = [], wt = w === "exhausted" ? z() : w; + let Pt; + w == "exhausted" ? Pt = Tt(1) : Pt = x(k).results[0].tally[w], j.push(`${wt} started with ${Pt} votes.`); + for (let tt = 1; tt <= B; tt++) { + tt === B && (w == "exhausted" ? Pt = Tt(B) : Pt = x(k).results[B - 1].tally[w], j.push(`${wt} has ${Pt} votes at round ${B}.`)); + const xt = x(k).results[tt - 1].tallyResults, Bt = re(tt); + for (let Mt = 0; Mt < xt.length; Mt++) { + const dt = xt[Mt].transfers, Ot = xt[Mt].eliminated, et = xt[Mt].elected; + if (!Bt) { + if (Ot) + Ot === w && j.push(`${wt} will be eliminated on round ${tt}.`); + else if (w === et && (j.push(`${wt} ${x(c).event} on round ${tt}.`), dt)) + for (let [Ut, rn] of Object.entries(dt)) + j.push(`${rn} ${Q(Number(rn), tt < B)} transferred to ${Ut} on round ${tt}.`); } - const he = Tt || bt; - if (he) { - const ee = Number(Bt[w]); - ee && J.push(`${ee} ${Q(ee, j < W)} transferred from ${he} on round ${j}.`); + const Wt = Ot || et; + if (Wt) { + const Ut = Number(dt[w]); + Ut && j.push(`${Ut} ${Q(Ut, tt < B)} transferred from ${Wt} on round ${tt}.`); } } } - return [J, xt]; + return [j, wt]; } - function pt() { + function gt() { let w = 0; - for (let W = 1; W <= x(T).results.length; W++) { - if (te(W)) continue; - const J = x(T).results[W - 1].tallyResults; - for (let xt = 0; xt < J.length; xt++) - J[xt].elected && w++; + for (let B = 1; B <= x(k).results.length; B++) { + if (re(B)) continue; + const j = x(k).results[B - 1].tallyResults; + for (let wt = 0; wt < j.length; wt++) + j[wt].elected && w++; } return w; } const M = ["Eliminate", "Transfer", "Consolidate"]; - let P, Xt = /* @__PURE__ */ mt(0); - function te(w) { - return l() && x(T).results && w === x(T).results.length; - } - function St(w) { - return te(w) ? [] : P ? P.getEliminatedCandidates(w) : []; + let D, Xt = /* @__PURE__ */ mt(0); + function re(w) { + return l() && x(k).results && w === x(k).results.length; } - function Ft(w) { - return te(w) ? [] : P ? P.getElectedCandidates(w) : []; + function Ct(w) { + return re(w) ? [] : D ? D.getEliminatedCandidates(w) : []; } function It(w) { - return P ? P.countExhaustedVotes(w) : 0; + return re(w) ? [] : D ? D.getElectedCandidates(w) : []; } - function ce() { - P && P.animateOnePhaseFn && P.animateOnePhaseFn(); + function Tt(w) { + return D ? D.countExhaustedVotes(w) : 0; + } + function he() { + D && D.animateOnePhaseFn && D.animateOnePhaseFn(); } function z() { - return P ? P.exhaustedLabel : ""; + return D ? D.exhaustedLabel : ""; } - function Ct() { - return P ? P.pieColors : {}; + function Nt() { + return D ? D.pieColors : {}; } - var rn = { + var tn = { get electionSummary() { return r(); }, @@ -5515,7 +5534,7 @@ function Fd(t, e) { get requestRoundChange() { return s(); }, - set requestRoundChange(w = (W) => { + set requestRoundChange(w = (B) => { }) { s(w), ft(); }, @@ -5549,20 +5568,20 @@ function Fd(t, e) { set showCaptions(w = !1) { f(w), ft(); } - }, tt = Pd(), kt = gn(tt), Ae = Ut(kt); - Ae.__click = ce; - var Ee = Ut(Ae, !0); - Wt(Ae), Wt(kt); - var qe = pe(kt, 4), wt = Ut(qe), sn = Ut(wt), an = Ut(sn); - ai( - al(an, { + }, Z = Md(), kt = gn(Z), $e = Jt(kt); + $e.__click = he; + var Ae = Jt($e, !0); + Kt($e), Kt(kt); + var qe = de(kt, 4), ht = Jt(qe), en = Jt(ht), nn = Jt(en); + si( + ol(nn, { get jsonData() { - return x(T); + return x(k); }, get currentRound() { return i(); }, - requestRoundChange: lt, + requestRoundChange: ot, get candidateColors() { return a(); }, @@ -5573,127 +5592,127 @@ function Fd(t, e) { return u(); }, get mouseEventType() { - return x($); + return x(E); }, set mouseEventType(w) { - at($, w, !0); + st(E, w, !0); }, get mouseData() { - return x(C); + return x(S); }, set mouseData(w) { - at(C, w, !0); + st(S, w, !0); }, get mouseX() { - return x(E); + return x(C); }, set mouseX(w) { - at(E, w, !0); + st(C, w, !0); }, get mouseY() { - return x(S); + return x(P); }, set mouseY(w) { - at(S, w, !0); + st(P, w, !0); }, get displayPhase() { return x(Xt); }, set displayPhase(w) { - at(Xt, w, !0); + st(Xt, w, !0); } }), - (w) => P = w, - () => P - ), Wt(sn), Wt(wt); - var Ur = pe(wt, 2); + (w) => D = w, + () => D + ), Kt(en), Kt(ht); + var Ur = de(ht, 2); { - var Li = (w) => { - var W = kd(), J = gn(W), xt = Ut(J); - Wt(J); - var Mt = pe(J, 2), j = Ut(Mt); + var Oi = (w) => { + var B = kd(), j = gn(B), wt = Jt(j); + Kt(j); + var Pt = de(j, 2), tt = Jt(Pt); { - var vt = (bt) => { - var he = Td(), ee = pe(gn(he)); - Gi(ee, 17, () => St(i()), Ui, (Ve, ut, Bn) => { - var Wn = Cd(), Ye = gn(Wn); - let Re; - var Un = Ut(Ye, !0); - Wt(Ye); - var wr = pe(Ye, 2); + var xt = (et) => { + var Wt = Td(), Ut = de(gn(Wt)); + Ui(Ut, 17, () => Ct(i()), Wi, (rn, dn, lt) => { + var Wn = Cd(), Ve = gn(Wn); + let Ye; + var pn = Jt(Ve, !0); + Kt(Ve); + var yr = de(Ve, 2); { - var xr = (ne) => { - var He = aa(", "); - ge(ne, He); - }, br = /* @__PURE__ */ Gn(() => Bn < St(i()).length - 1); - $r(wr, (ne) => { - x(br) && ne(xr); + var wr = (He) => { + var Gt = la(", "); + ve(He, Gt); + }, xr = /* @__PURE__ */ Gn(() => lt < Ct(i()).length - 1); + $r(yr, (He) => { + x(xr) && He(wr); }); } Kn( - (ne) => { - Re = ua(Ye, "", Re, ne), on(Un, x(ut)); + (He) => { + Ye = ca(Ve, "", Ye, He), sn(pn, x(dn)); }, - [() => ({ color: Ct()[x(ut)] })] - ), ge(Ve, Wn); - }), ge(bt, he); - }, Ot = /* @__PURE__ */ Gn(() => St(i()).length > 0); - $r(j, (bt) => { - x(Ot) && bt(vt); + [() => ({ color: Nt()[x(dn)] })] + ), ve(rn, Wn); + }), ve(et, Wt); + }, Bt = /* @__PURE__ */ Gn(() => Ct(i()).length > 0); + $r(tt, (et) => { + x(Bt) && et(xt); }); } - var nt = pe(j, 2); + var Mt = de(tt, 2); { - var Bt = (bt) => { - var he = Sd(), ee = gn(he), Ve = pe(ee); - Gi(Ve, 17, () => Ft(i()), Ui, (ut, Bn, Wn) => { - var Ye = Nd(), Re = gn(Ye); - let Un; - var wr = Ut(Re, !0); - Wt(Re); - var xr = pe(Re, 2); + var dt = (et) => { + var Wt = Sd(), Ut = gn(Wt), rn = de(Ut); + Ui(rn, 17, () => It(i()), Wi, (dn, lt, Wn) => { + var Ve = Nd(), Ye = gn(Ve); + let pn; + var yr = Jt(Ye, !0); + Kt(Ye); + var wr = de(Ye, 2); { - var br = (He) => { - var Vi = aa(", "); - ge(He, Vi); - }, ne = /* @__PURE__ */ Gn(() => Wn < Ft(i()).length - 1); - $r(xr, (He) => { - x(ne) && He(br); + var xr = (Gt) => { + var qi = la(", "); + ve(Gt, qi); + }, He = /* @__PURE__ */ Gn(() => Wn < It(i()).length - 1); + $r(wr, (Gt) => { + x(He) && Gt(xr); }); } Kn( - (He) => { - Un = ua(Re, "", Un, He), on(wr, x(Bn)); + (Gt) => { + pn = ca(Ye, "", pn, Gt), sn(yr, x(lt)); }, - [() => ({ color: Ct()[x(Bn)] })] - ), ge(ut, Ye); - }), Kn(() => on(ee, `${x(c).caption ?? ""}: `)), ge(bt, he); - }, Tt = /* @__PURE__ */ Gn(() => Ft(i()).length > 0); - $r(nt, (bt) => { - x(Tt) && bt(Bt); + [() => ({ color: Nt()[x(lt)] })] + ), ve(dn, Ve); + }), Kn(() => sn(Ut, `${x(c).caption ?? ""}: `)), ve(et, Wt); + }, Ot = /* @__PURE__ */ Gn(() => It(i()).length > 0); + $r(Mt, (et) => { + x(Ot) && et(dt); }); } - Wt(Mt), Kn((bt) => on(xt, `${x(T).config.contest ?? ""}, ${bt ?? ""} ${x(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [pt]), ge(w, W); + Kt(Pt), Kn((et) => sn(wt, `${x(k).config.contest ?? ""}, ${et ?? ""} ${x(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [gt]), ve(w, B); }; $r(Ur, (w) => { - f() && w(Li); + f() && w(Oi); }); } - Wt(qe); - var zn = pe(qe, 2), mr = Ut(zn), Gr = Ut(mr, !0); - Wt(mr); - var qi = pe(mr, 2); - Gi(qi, 17, () => x(b), Ui, (w, W) => { - var J = Md(), xt = gn(J), Mt = Ut(xt, !0); - Wt(xt), es(2), Kn(() => on(Mt, x(W))), ge(w, J); - }), Wt(zn), ai(zn, (w) => at(p, w), () => x(p)); - var Xn = pe(zn, 2), yr = Ut(Xn); - return es(2), Wt(Xn), ai(Xn, (w) => at(g, w), () => x(g)), Kn( + Kt(qe); + var zn = de(qe, 2), mr = Jt(zn), Gr = Jt(mr, !0); + Kt(mr); + var Li = de(mr, 2); + Ui(Li, 17, () => x($), Wi, (w, B) => { + var j = Pd(), wt = gn(j), Pt = Jt(wt, !0); + Kt(wt), es(2), Kn(() => sn(Pt, x(B))), ve(w, j); + }), Kt(zn), si(zn, (w) => st(p, w), () => x(p)); + var Xn = de(zn, 2), Bn = Jt(Xn); + return es(2), Kt(Xn), si(Xn, (w) => st(g, w), () => x(g)), Kn( (w) => { - on(Ee, M[x(Xt)]), on(Gr, x(m)), on(yr, `"${w ?? ""}" means all the candidates ranked on `); + sn(Ae, M[x(Xt)]), sn(Gr, x(y)), sn(Bn, `"${w ?? ""}" means all the candidates ranked on `); }, [z] - ), ge(t, tt), Rs(rn); + ), ve(t, Z), Rs(tn); } Au(["click"]); customElements.define("pie-chart", Mo( From 34186e0de784ce7349fe28e82babb6f006d1dd7b Mon Sep 17 00:00:00 2001 From: skaphan Date: Tue, 24 Mar 2026 18:03:02 +0000 Subject: [PATCH 18/31] Update pie chart bundle: donut shrink follows moving slices Co-Authored-By: Claude Opus 4.6 --- static/pie/pie-chart.es.js | 4148 ++++++++++++++++++------------------ 1 file changed, 2086 insertions(+), 2062 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index c9c49905..675780e5 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,27 +1,27 @@ -var yl = Object.defineProperty; -var Qs = (t) => { +var bl = Object.defineProperty; +var ea = (t) => { throw TypeError(t); }; -var wl = (t, e, n) => e in t ? yl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var it = (t, e, n) => wl(t, typeof e != "symbol" ? e + "" : e, n), Xi = (t, e, n) => e.has(t) || Qs("Cannot " + n); -var v = (t, e, n) => (Xi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), L = (t, e, n) => e.has(t) ? Qs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), O = (t, e, n, r) => (Xi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), _t = (t, e, n) => (Xi(t, e, "access private method"), n); -var Sa; -typeof window < "u" && ((Sa = window.__svelte ?? (window.__svelte = {})).v ?? (Sa.v = /* @__PURE__ */ new Set())).add("5"); -const xl = 1, bl = 2, $l = 16, Al = 1, El = 4, Rl = 8, Cl = 16, Tl = 2, bs = "[", Ei = "[!", $s = "]", ar = {}, $t = Symbol(), Nl = "http://www.w3.org/1999/xhtml", Qi = !1; -var Ma = Array.isArray, Sl = Array.prototype.indexOf, or = Array.prototype.includes, Ri = Array.from, hi = Object.keys, di = Object.defineProperty, Sn = Object.getOwnPropertyDescriptor, kl = Object.prototype, Pl = Array.prototype, Ml = Object.getPrototypeOf, ta = Object.isExtensible; -const Dl = () => { +var $l = (t, e, n) => e in t ? bl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var st = (t, e, n) => $l(t, typeof e != "symbol" ? e + "" : e, n), Ui = (t, e, n) => e.has(t) || ea("Cannot " + n); +var v = (t, e, n) => (Ui(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? ea("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), O = (t, e, n, r) => (Ui(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), mt = (t, e, n) => (Ui(t, e, "access private method"), n); +var Ma; +typeof window < "u" && ((Ma = window.__svelte ?? (window.__svelte = {})).v ?? (Ma.v = /* @__PURE__ */ new Set())).add("5"); +const Al = 1, El = 2, Rl = 16, Cl = 1, Tl = 4, Sl = 8, Nl = 16, kl = 2, Es = "[", Ti = "[!", Rs = "]", or = {}, At = Symbol(), Ml = "http://www.w3.org/1999/xhtml", ns = !1; +var Fa = Array.isArray, Pl = Array.prototype.indexOf, lr = Array.prototype.includes, Si = Array.from, vi = Object.keys, gi = Object.defineProperty, Mn = Object.getOwnPropertyDescriptor, Dl = Object.prototype, Fl = Array.prototype, Il = Object.getPrototypeOf, na = Object.isExtensible; +const Ol = () => { }; -function Fl(t) { +function Ll(t) { for (var e = 0; e < t.length; e++) t[e](); } -function Da() { +function Ia() { var t, e, n = new Promise((r, i) => { t = r, e = i; }); return { promise: n, resolve: t, reject: e }; } -function Il(t, e) { +function ql(t, e) { if (Array.isArray(t)) return t; if (!(Symbol.iterator in t)) @@ -31,130 +31,130 @@ function Il(t, e) { if (n.push(r), n.length === e) break; return n; } -const Et = 2, Mr = 4, Ci = 8, Fa = 1 << 24, Qe = 16, xe = 32, hn = 64, Ia = 128, le = 512, yt = 1024, Rt = 2048, we = 4096, te = 8192, Je = 16384, vr = 32768, lr = 65536, ea = 1 << 17, Oa = 1 << 18, Yn = 1 << 19, Ol = 1 << 20, ln = 1 << 25, Fn = 65536, ts = 1 << 21, As = 1 << 22, un = 1 << 23, Sr = Symbol("$state"), La = Symbol("legacy props"), yn = new class extends Error { +const Rt = 2, Fr = 4, Ni = 8, Oa = 1 << 24, rn = 16, $e = 32, vn = 64, La = 128, fe = 512, wt = 1024, Ct = 2048, be = 4096, ee = 8192, tn = 16384, gr = 32768, ur = 65536, ra = 1 << 17, qa = 1 << 18, zn = 1 << 19, Vl = 1 << 20, cn = 1 << 25, On = 65536, rs = 1 << 21, Cs = 1 << 22, hn = 1 << 23, Mr = Symbol("$state"), Va = Symbol("legacy props"), xn = new class extends Error { constructor() { super(...arguments); - it(this, "name", "StaleReactionError"); - it(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + st(this, "name", "StaleReactionError"); + st(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } -}(), Xr = 3, gr = 8; -function Ll(t) { +}(), Wr = 3, _r = 8; +function Yl(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function ql() { +function Hl() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function Vl(t, e, n) { +function zl(t, e, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function Yl(t) { +function Xl(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function Hl() { +function Bl() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function zl(t) { +function Wl(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function Xl() { +function Ul() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Bl() { +function Gl() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function Wl(t) { +function Kl(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function Ul() { +function Jl() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Gl() { +function Zl() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function Kl() { +function jl() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function Jl() { +function Ql() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Ti(t) { +function ki(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function Zl() { +function tu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } let J = !1; -function Ke(t) { +function Qe(t) { J = t; } let H; function zt(t) { if (t === null) - throw Ti(), ar; + throw ki(), or; return H = t; } -function Ni() { - return zt(/* @__PURE__ */ Ie(H)); +function Mi() { + return zt(/* @__PURE__ */ Le(H)); } -function Kt(t) { +function Jt(t) { if (J) { - if (/* @__PURE__ */ Ie(H) !== null) - throw Ti(), ar; + if (/* @__PURE__ */ Le(H) !== null) + throw ki(), or; H = t; } } -function es(t = 1) { +function is(t = 1) { if (J) { for (var e = t, n = H; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Ie(n); + /* @__PURE__ */ Le(n); H = n; } } -function pi(t = !0) { +function _i(t = !0) { for (var e = 0, n = H; ; ) { - if (n.nodeType === gr) { + if (n.nodeType === _r) { var r = ( /** @type {Comment} */ n.data ); - if (r === $s) { + if (r === Rs) { if (e === 0) return n; e -= 1; - } else (r === bs || r === Ei || // "[1", "[2", etc. for if blocks + } else (r === Es || r === Ti || // "[1", "[2", etc. for if blocks r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Ie(n) + /* @__PURE__ */ Le(n) ); t && n.remove(), n = i; } } -function qa(t) { - if (!t || t.nodeType !== gr) - throw Ti(), ar; +function Ya(t) { + if (!t || t.nodeType !== _r) + throw ki(), or; return ( /** @type {Comment} */ t.data ); } -function Va(t) { +function Ha(t) { return t === this.v; } -function jl(t, e) { +function eu(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function Ya(t) { - return !jl(t, this.v); +function za(t) { + return !eu(t, this.v); } -let Ql = !1, ee = null; -function ur(t) { - ee = t; +let nu = !1, ne = null; +function fr(t) { + ne = t; } -function Es(t, e = !1, n) { - ee = { - p: ee, +function Ts(t, e = !1, n) { + ne = { + p: ne, i: !1, c: null, e: null, @@ -163,52 +163,52 @@ function Es(t, e = !1, n) { l: null }; } -function Rs(t) { +function Ss(t) { var e = ( /** @type {ComponentContext} */ - ee + ne ), n = e.e; if (n !== null) { e.e = null; for (var r of n) - ho(r); + vo(r); } - return t !== void 0 && (e.x = t), e.i = !0, ee = e.p, t ?? /** @type {T} */ + return t !== void 0 && (e.x = t), e.i = !0, ne = e.p, t ?? /** @type {T} */ {}; } -function Ha() { +function Xa() { return !0; } -let wn = []; -function za() { - var t = wn; - wn = [], Fl(t); +let bn = []; +function Ba() { + var t = bn; + bn = [], Ll(t); } -function kn(t) { - if (wn.length === 0 && !kr) { - var e = wn; +function Pn(t) { + if (bn.length === 0 && !Pr) { + var e = bn; queueMicrotask(() => { - e === wn && za(); + e === bn && Ba(); }); } - wn.push(t); + bn.push(t); } -function tu() { - for (; wn.length > 0; ) - za(); +function ru() { + for (; bn.length > 0; ) + Ba(); } -function Xa(t) { - var e = W; +function Wa(t) { + var e = U; if (e === null) - return Y.f |= un, t; - if ((e.f & vr) === 0 && (e.f & Mr) === 0) + return Y.f |= hn, t; + if ((e.f & gr) === 0 && (e.f & Fr) === 0) throw t; - fr(t, e); + cr(t, e); } -function fr(t, e) { +function cr(t, e) { for (; e !== null; ) { - if ((e.f & Ia) !== 0) { - if ((e.f & vr) === 0) + if ((e.f & La) !== 0) { + if ((e.f & gr) === 0) throw t; try { e.b.error(t); @@ -221,78 +221,78 @@ function fr(t, e) { } throw t; } -const eu = -7169; -function at(t, e) { - t.f = t.f & eu | e; +const iu = -7169; +function lt(t, e) { + t.f = t.f & iu | e; } -function Cs(t) { - (t.f & le) !== 0 || t.deps === null ? at(t, yt) : at(t, we); +function Ns(t) { + (t.f & fe) !== 0 || t.deps === null ? lt(t, wt) : lt(t, be); } -function Ba(t) { +function Ua(t) { if (t !== null) for (const e of t) - (e.f & Et) === 0 || (e.f & Fn) === 0 || (e.f ^= Fn, Ba( + (e.f & Rt) === 0 || (e.f & On) === 0 || (e.f ^= On, Ua( /** @type {Derived} */ e.deps )); } -function Wa(t, e, n) { - (t.f & Rt) !== 0 ? e.add(t) : (t.f & we) !== 0 && n.add(t), Ba(t.deps), at(t, yt); +function Ga(t, e, n) { + (t.f & Ct) !== 0 ? e.add(t) : (t.f & be) !== 0 && n.add(t), Ua(t.deps), lt(t, wt); } -const Kr = /* @__PURE__ */ new Set(); -let X = null, At = null, Vt = [], Si = null, ns = !1, kr = !1; -var Qn, tr, An, er, qr, Vr, En, Xe, nr, Fe, rs, is, Ua; -const zs = class zs { +const jr = /* @__PURE__ */ new Set(); +let B = null, Et = null, Vt = [], Pi = null, ss = !1, Pr = !1; +var tr, er, Rn, nr, Yr, Hr, Cn, Ge, rr, Oe, as, os, Ka; +const Ws = class Ws { constructor() { - L(this, Fe); - it(this, "committed", !1); + q(this, Oe); + st(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} */ - it(this, "current", /* @__PURE__ */ new Map()); + st(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} */ - it(this, "previous", /* @__PURE__ */ new Map()); + st(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>} */ - L(this, Qn, /* @__PURE__ */ new Set()); + q(this, tr, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - L(this, tr, /* @__PURE__ */ new Set()); + q(this, er, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - L(this, An, 0); + q(this, Rn, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - L(this, er, 0); + q(this, nr, 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} */ - L(this, qr, null); + q(this, Yr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - L(this, Vr, /* @__PURE__ */ new Set()); + q(this, Hr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - L(this, En, /* @__PURE__ */ new Set()); + q(this, Cn, /* @__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`. @@ -300,19 +300,19 @@ const zs = class zs { * so they can be rescheduled if the branch survives. * @type {Map} */ - L(this, Xe, /* @__PURE__ */ new Map()); - it(this, "is_fork", !1); - L(this, nr, !1); + q(this, Ge, /* @__PURE__ */ new Map()); + st(this, "is_fork", !1); + q(this, rr, !1); } is_deferred() { - return this.is_fork || v(this, er) > 0; + return this.is_fork || v(this, nr) > 0; } /** * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ skip_effect(e) { - v(this, Xe).has(e) || v(this, Xe).set(e, { d: [], m: [] }); + v(this, Ge).has(e) || v(this, Ge).set(e, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule @@ -320,13 +320,13 @@ const zs = class zs { * @param {Effect} effect */ unskip_effect(e) { - var n = v(this, Xe).get(e); + var n = v(this, Ge).get(e); if (n) { - v(this, Xe).delete(e); + v(this, Ge).delete(e); for (var r of n.d) - at(r, Rt), me(r); + lt(r, Ct), we(r); for (r of n.m) - at(r, we), me(r); + lt(r, be), we(r); } } /** @@ -338,16 +338,16 @@ const zs = class zs { Vt = [], this.apply(); var n = [], r = []; for (const s of e) - _t(this, Fe, rs).call(this, s, n, r); + mt(this, Oe, as).call(this, s, n, r); if (this.is_deferred()) { - _t(this, Fe, is).call(this, r), _t(this, Fe, is).call(this, n); - for (const [s, a] of v(this, Xe)) - Za(s, a); + mt(this, Oe, os).call(this, r), mt(this, Oe, os).call(this, n); + for (const [s, a] of v(this, Ge)) + Qa(s, a); } else { - for (const s of v(this, Qn)) s(); - v(this, Qn).clear(), v(this, An) === 0 && _t(this, Fe, Ua).call(this), X = null, na(r), na(n), (i = v(this, qr)) == null || i.resolve(); + for (const s of v(this, tr)) s(); + v(this, tr).clear(), v(this, Rn) === 0 && mt(this, Oe, Ka).call(this), B = null, ia(r), ia(n), (i = v(this, Yr)) == null || i.resolve(); } - At = null; + Et = null; } /** * Associate a change to a given source with the current @@ -356,84 +356,84 @@ const zs = class zs { * @param {any} value */ capture(e, n) { - n !== $t && !this.previous.has(e) && this.previous.set(e, n), (e.f & un) === 0 && (this.current.set(e, e.v), At == null || At.set(e, e.v)); + n !== At && !this.previous.has(e) && this.previous.set(e, n), (e.f & hn) === 0 && (this.current.set(e, e.v), Et == null || Et.set(e, e.v)); } activate() { - X = this, this.apply(); + B = this, this.apply(); } deactivate() { - X === this && (X = null, At = null); + B === this && (B = null, Et = null); } flush() { if (this.activate(), Vt.length > 0) { - if (Ga(), X !== null && X !== this) + if (Ja(), B !== null && B !== this) return; - } else v(this, An) === 0 && this.process([]); + } else v(this, Rn) === 0 && this.process([]); this.deactivate(); } discard() { - for (const e of v(this, tr)) e(this); - v(this, tr).clear(); + for (const e of v(this, er)) e(this); + v(this, er).clear(); } /** * * @param {boolean} blocking */ increment(e) { - O(this, An, v(this, An) + 1), e && O(this, er, v(this, er) + 1); + O(this, Rn, v(this, Rn) + 1), e && O(this, nr, v(this, nr) + 1); } /** * * @param {boolean} blocking */ decrement(e) { - O(this, An, v(this, An) - 1), e && O(this, er, v(this, er) - 1), !v(this, nr) && (O(this, nr, !0), kn(() => { - O(this, nr, !1), this.is_deferred() ? Vt.length > 0 && this.flush() : this.revive(); + O(this, Rn, v(this, Rn) - 1), e && O(this, nr, v(this, nr) - 1), !v(this, rr) && (O(this, rr, !0), Pn(() => { + O(this, rr, !1), this.is_deferred() ? Vt.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const e of v(this, Vr)) - v(this, En).delete(e), at(e, Rt), me(e); - for (const e of v(this, En)) - at(e, we), me(e); + for (const e of v(this, Hr)) + v(this, Cn).delete(e), lt(e, Ct), we(e); + for (const e of v(this, Cn)) + lt(e, be), we(e); this.flush(); } /** @param {() => void} fn */ oncommit(e) { - v(this, Qn).add(e); + v(this, tr).add(e); } /** @param {(batch: Batch) => void} fn */ ondiscard(e) { - v(this, tr).add(e); + v(this, er).add(e); } settled() { - return (v(this, qr) ?? O(this, qr, Da())).promise; + return (v(this, Yr) ?? O(this, Yr, Ia())).promise; } static ensure() { - if (X === null) { - const e = X = new zs(); - Kr.add(X), kr || kn(() => { - X === e && e.flush(); + if (B === null) { + const e = B = new Ws(); + jr.add(B), Pr || Pn(() => { + B === e && e.flush(); }); } - return X; + return B; } apply() { } }; -Qn = new WeakMap(), tr = new WeakMap(), An = new WeakMap(), er = new WeakMap(), qr = new WeakMap(), Vr = new WeakMap(), En = new WeakMap(), Xe = new WeakMap(), nr = new WeakMap(), Fe = new WeakSet(), /** +tr = new WeakMap(), er = new WeakMap(), Rn = new WeakMap(), nr = new WeakMap(), Yr = new WeakMap(), Hr = new WeakMap(), Cn = new WeakMap(), Ge = new WeakMap(), rr = new WeakMap(), Oe = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -rs = function(e, n, r) { - e.f ^= yt; +as = function(e, n, r) { + e.f ^= wt; for (var i = e.first, s = null; i !== null; ) { - var a = i.f, o = (a & (xe | hn)) !== 0, l = o && (a & yt) !== 0, u = l || (a & te) !== 0 || v(this, Xe).has(i); + var a = i.f, o = (a & ($e | vn)) !== 0, l = o && (a & wt) !== 0, u = l || (a & ee) !== 0 || v(this, Ge).has(i); if (!u && i.fn !== null) { - o ? i.f ^= yt : s !== null && (a & (Mr | Ci | Fa)) !== 0 ? s.b.defer_effect(i) : (a & Mr) !== 0 ? n.push(i) : Br(i) && ((a & Qe) !== 0 && v(this, En).add(i), hr(i)); + o ? i.f ^= wt : s !== null && (a & (Fr | Ni | Oa)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Ur(i) && ((a & rn) !== 0 && v(this, Cn).add(i), dr(i)); var f = i.first; if (f !== null) { i = f; @@ -447,15 +447,15 @@ rs = function(e, n, r) { }, /** * @param {Effect[]} effects */ -is = function(e) { +os = function(e) { for (var n = 0; n < e.length; n += 1) - Wa(e[n], v(this, Vr), v(this, En)); -}, Ua = function() { + Ga(e[n], v(this, Hr), v(this, Cn)); +}, Ka = function() { var i; - if (Kr.size > 1) { + if (jr.size > 1) { this.previous.clear(); - var e = At, n = !0; - for (const s of Kr) { + var e = Et, n = !0; + for (const s of jr) { if (s === this) { n = !1; continue; @@ -477,107 +477,107 @@ is = function(e) { Vt = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - Ka(f, o, l, u); + Za(f, o, l, u); if (Vt.length > 0) { - X = s, s.apply(); + B = s, s.apply(); for (const f of Vt) - _t(i = s, Fe, rs).call(i, f, [], []); + mt(i = s, Oe, as).call(i, f, [], []); s.deactivate(); } Vt = r; } } - X = null, At = e; + B = null, Et = e; } - this.committed = !0, Kr.delete(this); + this.committed = !0, jr.delete(this); }; -let Ze = zs; -function ft(t) { - var e = kr; - kr = !0; +let en = Ws; +function ct(t) { + var e = Pr; + Pr = !0; try { for (var n; ; ) { - if (tu(), Vt.length === 0 && (X == null || X.flush(), Vt.length === 0)) - return Si = null, /** @type {T} */ + if (ru(), Vt.length === 0 && (B == null || B.flush(), Vt.length === 0)) + return Pi = null, /** @type {T} */ n; - Ga(); + Ja(); } } finally { - kr = e; + Pr = e; } } -function Ga() { - ns = !0; +function Ja() { + ss = !0; var t = null; try { for (var e = 0; Vt.length > 0; ) { - var n = Ze.ensure(); + var n = en.ensure(); if (e++ > 1e3) { var r, i; - nu(); + su(); } - n.process(Vt), fn.clear(); + n.process(Vt), dn.clear(); } } finally { - Vt = [], ns = !1, Si = null; + Vt = [], ss = !1, Pi = null; } } -function nu() { +function su() { try { - Xl(); + Ul(); } catch (t) { - fr(t, Si); + cr(t, Pi); } } -let pe = null; -function na(t) { +let ge = null; +function ia(t) { var e = t.length; if (e !== 0) { for (var n = 0; n < e; ) { var r = t[n++]; - if ((r.f & (Je | te)) === 0 && Br(r) && (pe = /* @__PURE__ */ new Set(), hr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && go(r), (pe == null ? void 0 : pe.size) > 0)) { - fn.clear(); - for (const i of pe) { - if ((i.f & (Je | te)) !== 0) continue; + if ((r.f & (tn | ee)) === 0 && Ur(r) && (ge = /* @__PURE__ */ new Set(), dr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && mo(r), (ge == null ? void 0 : ge.size) > 0)) { + dn.clear(); + for (const i of ge) { + if ((i.f & (tn | ee)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - pe.has(a) && (pe.delete(a), s.push(a)), a = a.parent; + ge.has(a) && (ge.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (Je | te)) === 0 && hr(l); + (l.f & (tn | ee)) === 0 && dr(l); } } - pe.clear(); + ge.clear(); } } - pe = null; + ge = null; } } -function Ka(t, e, n, r) { +function Za(t, e, n, r) { if (!n.has(t) && (n.add(t), t.reactions !== null)) for (const i of t.reactions) { const s = i.f; - (s & Et) !== 0 ? Ka( + (s & Rt) !== 0 ? Za( /** @type {Derived} */ i, e, n, r - ) : (s & (As | Qe)) !== 0 && (s & Rt) === 0 && Ja(i, e, r) && (at(i, Rt), me( + ) : (s & (Cs | rn)) !== 0 && (s & Ct) === 0 && ja(i, e, r) && (lt(i, Ct), we( /** @type {Effect} */ i )); } } -function Ja(t, e, n) { +function ja(t, e, n) { const r = n.get(t); if (r !== void 0) return r; if (t.deps !== null) for (const i of t.deps) { - if (or.call(e, i)) + if (lr.call(e, i)) return !0; - if ((i.f & Et) !== 0 && Ja( + if ((i.f & Rt) !== 0 && ja( /** @type {Derived} */ i, e, @@ -591,80 +591,80 @@ function Ja(t, e, n) { } return n.set(t, !1), !1; } -function me(t) { - for (var e = Si = t; e.parent !== null; ) { +function we(t) { + for (var e = Pi = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (ns && e === W && (n & Qe) !== 0 && (n & Oa) === 0) + if (ss && e === U && (n & rn) !== 0 && (n & qa) === 0) return; - if ((n & (hn | xe)) !== 0) { - if ((n & yt) === 0) return; - e.f ^= yt; + if ((n & (vn | $e)) !== 0) { + if ((n & wt) === 0) return; + e.f ^= wt; } } Vt.push(e); } -function Za(t, e) { - if (!((t.f & xe) !== 0 && (t.f & yt) !== 0)) { - (t.f & Rt) !== 0 ? e.d.push(t) : (t.f & we) !== 0 && e.m.push(t), at(t, yt); +function Qa(t, e) { + if (!((t.f & $e) !== 0 && (t.f & wt) !== 0)) { + (t.f & Ct) !== 0 ? e.d.push(t) : (t.f & be) !== 0 && e.m.push(t), lt(t, wt); for (var n = t.first; n !== null; ) - Za(n, e), n = n.next; + Qa(n, e), n = n.next; } } -function ru(t) { - let e = 0, n = In(0), r; +function au(t) { + let e = 0, n = Ln(0), r; return () => { - Ss() && (x(n), Ps(() => (e === 0 && (r = Mi(() => t(() => Pr(n)))), e += 1, () => { - kn(() => { - e -= 1, e === 0 && (r == null || r(), r = void 0, Pr(n)); + Ps() && (x(n), Fs(() => (e === 0 && (r = Ii(() => t(() => Dr(n)))), e += 1, () => { + Pn(() => { + e -= 1, e === 0 && (r == null || r(), r = void 0, Dr(n)); }); }))); }; } -var iu = lr | Yn | Ia; -function su(t, e, n) { - new au(t, e, n); +var ou = ur | zn | La; +function lu(t, e, n) { + new uu(t, e, n); } -var jt, Yr, Te, Rn, Ne, se, qt, Se, Be, on, Cn, We, rr, Tn, ir, sr, Ue, $i, ct, ja, Qa, ss, ni, ri, as; -class au { +var Qt, zr, Ne, Tn, ke, oe, qt, Me, Ke, fn, Sn, Je, ir, Nn, sr, ar, Ze, Ri, ht, to, eo, ls, si, ai, us; +class uu { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ constructor(e, n, r) { - L(this, ct); + q(this, ht); /** @type {Boundary | null} */ - it(this, "parent"); - it(this, "is_pending", !1); + st(this, "parent"); + st(this, "is_pending", !1); /** @type {TemplateNode} */ - L(this, jt); + q(this, Qt); /** @type {TemplateNode | null} */ - L(this, Yr, J ? H : null); + q(this, zr, J ? H : null); /** @type {BoundaryProps} */ - L(this, Te); + q(this, Ne); /** @type {((anchor: Node) => void)} */ - L(this, Rn); + q(this, Tn); /** @type {Effect} */ - L(this, Ne); + q(this, ke); /** @type {Effect | null} */ - L(this, se, null); + q(this, oe, null); /** @type {Effect | null} */ - L(this, qt, null); + q(this, qt, null); /** @type {Effect | null} */ - L(this, Se, null); + q(this, Me, null); /** @type {DocumentFragment | null} */ - L(this, Be, null); + q(this, Ke, null); /** @type {TemplateNode | null} */ - L(this, on, null); - L(this, Cn, 0); - L(this, We, 0); - L(this, rr, !1); - L(this, Tn, !1); + q(this, fn, null); + q(this, Sn, 0); + q(this, Je, 0); + q(this, ir, !1); + q(this, Nn, !1); /** @type {Set} */ - L(this, ir, /* @__PURE__ */ new Set()); + q(this, sr, /* @__PURE__ */ new Set()); /** @type {Set} */ - L(this, sr, /* @__PURE__ */ new Set()); + q(this, ar, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -672,38 +672,38 @@ class au { * calls followed by no-op flushes * @type {Source | null} */ - L(this, Ue, null); - L(this, $i, ru(() => (O(this, Ue, In(v(this, Cn))), () => { - O(this, Ue, null); + q(this, Ze, null); + q(this, Ri, au(() => (O(this, Ze, Ln(v(this, Sn))), () => { + O(this, Ze, null); }))); - O(this, jt, e), O(this, Te, n), O(this, Rn, r), this.parent = /** @type {Effect} */ - W.b, this.is_pending = !!v(this, Te).pending, O(this, Ne, Ms(() => { - if (W.b = this, J) { - const s = v(this, Yr); - Ni(), /** @type {Comment} */ - s.nodeType === gr && /** @type {Comment} */ - s.data === Ei ? _t(this, ct, Qa).call(this) : (_t(this, ct, ja).call(this), v(this, We) === 0 && (this.is_pending = !1)); + O(this, Qt, e), O(this, Ne, n), O(this, Tn, r), this.parent = /** @type {Effect} */ + U.b, this.is_pending = !!v(this, Ne).pending, O(this, ke, Is(() => { + if (U.b = this, J) { + const s = v(this, zr); + Mi(), /** @type {Comment} */ + s.nodeType === _r && /** @type {Comment} */ + s.data === Ti ? mt(this, ht, eo).call(this) : (mt(this, ht, to).call(this), v(this, Je) === 0 && (this.is_pending = !1)); } else { - var i = _t(this, ct, ss).call(this); + var i = mt(this, ht, ls).call(this); try { - O(this, se, oe(() => r(i))); + O(this, oe, ue(() => r(i))); } catch (s) { this.error(s); } - v(this, We) > 0 ? _t(this, ct, ri).call(this) : this.is_pending = !1; + v(this, Je) > 0 ? mt(this, ht, ai).call(this) : this.is_pending = !1; } return () => { var s; - (s = v(this, on)) == null || s.remove(); + (s = v(this, fn)) == null || s.remove(); }; - }, iu)), J && O(this, jt, H); + }, ou)), J && O(this, Qt, H); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ defer_effect(e) { - Wa(e, v(this, ir), v(this, sr)); + Ga(e, v(this, sr), v(this, ar)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -713,7 +713,7 @@ class au { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, Te).pending; + return !!v(this, Ne).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -722,76 +722,76 @@ class au { * @param {1 | -1} d */ update_pending_count(e) { - _t(this, ct, as).call(this, e), O(this, Cn, v(this, Cn) + e), !(!v(this, Ue) || v(this, rr)) && (O(this, rr, !0), kn(() => { - O(this, rr, !1), v(this, Ue) && cr(v(this, Ue), v(this, Cn)); + mt(this, ht, us).call(this, e), O(this, Sn, v(this, Sn) + e), !(!v(this, Ze) || v(this, ir)) && (O(this, ir, !0), Pn(() => { + O(this, ir, !1), v(this, Ze) && hr(v(this, Ze), v(this, Sn)); })); } get_effect_pending() { - return v(this, $i).call(this), x( + return v(this, Ri).call(this), x( /** @type {Source} */ - v(this, Ue) + v(this, Ze) ); } /** @param {unknown} error */ error(e) { - var n = v(this, Te).onerror; - let r = v(this, Te).failed; - if (v(this, Tn) || !n && !r) + var n = v(this, Ne).onerror; + let r = v(this, Ne).failed; + if (v(this, Nn) || !n && !r) throw e; - v(this, se) && (Ft(v(this, se)), O(this, se, null)), v(this, qt) && (Ft(v(this, qt)), O(this, qt, null)), v(this, Se) && (Ft(v(this, Se)), O(this, Se, null)), J && (zt( + v(this, oe) && (Ft(v(this, oe)), O(this, oe, null)), v(this, qt) && (Ft(v(this, qt)), O(this, qt, null)), v(this, Me) && (Ft(v(this, Me)), O(this, Me, null)), J && (zt( /** @type {TemplateNode} */ - v(this, Yr) - ), es(), zt(pi())); + v(this, zr) + ), is(), zt(_i())); var i = !1, s = !1; const a = () => { if (i) { - Zl(); + tu(); return; } - i = !0, s && Jl(), Ze.ensure(), O(this, Cn, 0), v(this, Se) !== null && Pn(v(this, Se), () => { - O(this, Se, null); - }), this.is_pending = this.has_pending_snippet(), O(this, se, _t(this, ct, ni).call(this, () => (O(this, Tn, !1), oe(() => v(this, Rn).call(this, v(this, jt)))))), v(this, We) > 0 ? _t(this, ct, ri).call(this) : this.is_pending = !1; + i = !0, s && Ql(), en.ensure(), O(this, Sn, 0), v(this, Me) !== null && Dn(v(this, Me), () => { + O(this, Me, null); + }), this.is_pending = this.has_pending_snippet(), O(this, oe, mt(this, ht, si).call(this, () => (O(this, Nn, !1), ue(() => v(this, Tn).call(this, v(this, Qt)))))), v(this, Je) > 0 ? mt(this, ht, ai).call(this) : this.is_pending = !1; }; - kn(() => { + Pn(() => { try { s = !0, n == null || n(e, a), s = !1; } catch (o) { - fr(o, v(this, Ne) && v(this, Ne).parent); + cr(o, v(this, ke) && v(this, ke).parent); } - r && O(this, Se, _t(this, ct, ni).call(this, () => { - Ze.ensure(), O(this, Tn, !0); + r && O(this, Me, mt(this, ht, si).call(this, () => { + en.ensure(), O(this, Nn, !0); try { - return oe(() => { + return ue(() => { r( - v(this, jt), + v(this, Qt), () => e, () => a ); }); } catch (o) { - return fr( + return cr( o, /** @type {Effect} */ - v(this, Ne).parent + v(this, ke).parent ), null; } finally { - O(this, Tn, !1); + O(this, Nn, !1); } })); }); } } -jt = new WeakMap(), Yr = new WeakMap(), Te = new WeakMap(), Rn = new WeakMap(), Ne = new WeakMap(), se = new WeakMap(), qt = new WeakMap(), Se = new WeakMap(), Be = new WeakMap(), on = new WeakMap(), Cn = new WeakMap(), We = new WeakMap(), rr = new WeakMap(), Tn = new WeakMap(), ir = new WeakMap(), sr = new WeakMap(), Ue = new WeakMap(), $i = new WeakMap(), ct = new WeakSet(), ja = function() { +Qt = new WeakMap(), zr = new WeakMap(), Ne = new WeakMap(), Tn = new WeakMap(), ke = new WeakMap(), oe = new WeakMap(), qt = new WeakMap(), Me = new WeakMap(), Ke = new WeakMap(), fn = new WeakMap(), Sn = new WeakMap(), Je = new WeakMap(), ir = new WeakMap(), Nn = new WeakMap(), sr = new WeakMap(), ar = new WeakMap(), Ze = new WeakMap(), Ri = new WeakMap(), ht = new WeakSet(), to = function() { try { - O(this, se, oe(() => v(this, Rn).call(this, v(this, jt)))); + O(this, oe, ue(() => v(this, Tn).call(this, v(this, Qt)))); } catch (e) { this.error(e); } -}, Qa = function() { - const e = v(this, Te).pending; - e && (O(this, qt, oe(() => e(v(this, jt)))), kn(() => { - var n = _t(this, ct, ss).call(this); - O(this, se, _t(this, ct, ni).call(this, () => (Ze.ensure(), oe(() => v(this, Rn).call(this, n))))), v(this, We) > 0 ? _t(this, ct, ri).call(this) : (Pn( +}, eo = function() { + const e = v(this, Ne).pending; + e && (O(this, qt, ue(() => e(v(this, Qt)))), Pn(() => { + var n = mt(this, ht, ls).call(this); + O(this, oe, mt(this, ht, si).call(this, () => (en.ensure(), ue(() => v(this, Tn).call(this, n))))), v(this, Je) > 0 ? mt(this, ht, ai).call(this) : (Dn( /** @type {Effect} */ v(this, qt), () => { @@ -799,122 +799,122 @@ jt = new WeakMap(), Yr = new WeakMap(), Te = new WeakMap(), Rn = new WeakMap(), } ), this.is_pending = !1); })); -}, ss = function() { - var e = v(this, jt); - return this.is_pending && (O(this, on, fe()), v(this, jt).before(v(this, on)), e = v(this, on)), e; +}, ls = function() { + var e = v(this, Qt); + return this.is_pending && (O(this, fn, he()), v(this, Qt).before(v(this, fn)), e = v(this, fn)), e; }, /** * @param {() => Effect | null} fn */ -ni = function(e) { - var n = W, r = Y, i = ee; - De(v(this, Ne)), ce(v(this, Ne)), ur(v(this, Ne).ctx); +si = function(e) { + var n = U, r = Y, i = ne; + Ie(v(this, ke)), de(v(this, ke)), fr(v(this, ke).ctx); try { return e(); } catch (s) { - return Xa(s), null; + return Wa(s), null; } finally { - De(n), ce(r), ur(i); + Ie(n), de(r), fr(i); } -}, ri = function() { +}, ai = function() { const e = ( /** @type {(anchor: Node) => void} */ - v(this, Te).pending + v(this, Ne).pending ); - v(this, se) !== null && (O(this, Be, document.createDocumentFragment()), v(this, Be).append( + v(this, oe) !== null && (O(this, Ke, document.createDocumentFragment()), v(this, Ke).append( /** @type {TemplateNode} */ - v(this, on) - ), yo(v(this, se), v(this, Be))), v(this, qt) === null && O(this, qt, oe(() => e(v(this, jt)))); + v(this, fn) + ), xo(v(this, oe), v(this, Ke))), v(this, qt) === null && O(this, qt, ue(() => e(v(this, Qt)))); }, /** * 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 * @param {1 | -1} d */ -as = function(e) { +us = function(e) { var n; if (!this.has_pending_snippet()) { - this.parent && _t(n = this.parent, ct, as).call(n, e); + this.parent && mt(n = this.parent, ht, us).call(n, e); return; } - if (O(this, We, v(this, We) + e), v(this, We) === 0) { + if (O(this, Je, v(this, Je) + e), v(this, Je) === 0) { this.is_pending = !1; - for (const r of v(this, ir)) - at(r, Rt), me(r); for (const r of v(this, sr)) - at(r, we), me(r); - v(this, ir).clear(), v(this, sr).clear(), v(this, qt) && Pn(v(this, qt), () => { + lt(r, Ct), we(r); + for (const r of v(this, ar)) + lt(r, be), we(r); + v(this, sr).clear(), v(this, ar).clear(), v(this, qt) && Dn(v(this, qt), () => { O(this, qt, null); - }), v(this, Be) && (v(this, jt).before(v(this, Be)), O(this, Be, null)); + }), v(this, Ke) && (v(this, Qt).before(v(this, Ke)), O(this, Ke, null)); } }; -function ou(t, e, n, r) { - const i = ki; +function fu(t, e, n, r) { + const i = Di; var s = t.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { r(e.map(i)); return; } - var a = X, o = ( + var a = B, o = ( /** @type {Effect} */ - W - ), l = lu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + U + ), l = cu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; function f(c) { l(); try { r(c); } catch (p) { - (o.f & Je) === 0 && fr(p, o); + (o.f & tn) === 0 && cr(p, o); } - a == null || a.deactivate(), os(); + a == null || a.deactivate(), fs(); } if (n.length === 0) { u.then(() => f(e.map(i))); return; } function h() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ uu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => fr(c, o)); + l(), Promise.all(n.map((c) => /* @__PURE__ */ hu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => cr(c, o)); } u ? u.then(h) : h(); } -function lu() { - var t = W, e = Y, n = ee, r = X; +function cu() { + var t = U, e = Y, n = ne, r = B; return function(s = !0) { - De(t), ce(e), ur(n), s && (r == null || r.activate()); + Ie(t), de(e), fr(n), s && (r == null || r.activate()); }; } -function os() { - De(null), ce(null), ur(null); +function fs() { + Ie(null), de(null), fr(null); } // @__NO_SIDE_EFFECTS__ -function ki(t) { - var e = Et | Rt, n = Y !== null && (Y.f & Et) !== 0 ? ( +function Di(t) { + var e = Rt | Ct, n = Y !== null && (Y.f & Rt) !== 0 ? ( /** @type {Derived} */ Y ) : null; - return W !== null && (W.f |= Yn), { - ctx: ee, + return U !== null && (U.f |= zn), { + ctx: ne, deps: null, effects: null, - equals: Va, + equals: Ha, f: e, fn: t, reactions: null, rv: 0, v: ( /** @type {V} */ - $t + At ), wv: 0, - parent: n ?? W, + parent: n ?? U, ac: null }; } // @__NO_SIDE_EFFECTS__ -function uu(t, e, n) { +function hu(t, e, n) { let r = ( /** @type {Effect | null} */ - W + U ); - r === null && ql(); + r === null && Hl(); var i = ( /** @type {Boundary} */ r.b @@ -922,45 +922,45 @@ function uu(t, e, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = In( + ), a = Ln( /** @type {V} */ - $t + At ), o = !Y, l = /* @__PURE__ */ new Map(); - return yu(() => { + return bu(() => { var p; - var u = Da(); + var u = Ia(); s = u.promise; try { Promise.resolve(t()).then(u.resolve, u.reject).then(() => { - f === X && f.committed && f.deactivate(), os(); + f === B && f.committed && f.deactivate(), fs(); }); } catch (g) { - u.reject(g), os(); + u.reject(g), fs(); } var f = ( /** @type {Batch} */ - X + B ); if (o) { var h = i.is_rendered(); - i.update_pending_count(1), f.increment(h), (p = l.get(f)) == null || p.reject(yn), l.delete(f), l.set(f, u); + i.update_pending_count(1), f.increment(h), (p = l.get(f)) == null || p.reject(xn), l.delete(f), l.set(f, u); } const c = (g, y = void 0) => { if (f.activate(), y) - y !== yn && (a.f |= un, cr(a, y)); + y !== xn && (a.f |= hn, hr(a, y)); else { - (a.f & un) !== 0 && (a.f ^= un), cr(a, g); - for (const [$, E] of l) { + (a.f & hn) !== 0 && (a.f ^= hn), hr(a, g); + for (const [$, A] of l) { if (l.delete($), $ === f) break; - E.reject(yn); + A.reject(xn); } } o && (i.update_pending_count(-1), f.decrement(h)); }; u.promise.then(c, (g) => c(null, g || "unknown")); - }), gu(() => { + }), yu(() => { for (const u of l.values()) - u.reject(yn); + u.reject(xn); }), new Promise((u) => { function f(h) { function c() { @@ -972,16 +972,16 @@ function uu(t, e, n) { }); } // @__NO_SIDE_EFFECTS__ -function Gn(t) { - const e = /* @__PURE__ */ ki(t); - return wo(e), e; +function Jn(t) { + const e = /* @__PURE__ */ Di(t); + return bo(e), e; } // @__NO_SIDE_EFFECTS__ -function to(t) { - const e = /* @__PURE__ */ ki(t); - return e.equals = Ya, e; +function no(t) { + const e = /* @__PURE__ */ Di(t); + return e.equals = za, e; } -function fu(t) { +function du(t) { var e = t.effects; if (e !== null) { t.effects = null; @@ -992,10 +992,10 @@ function fu(t) { ); } } -function cu(t) { +function pu(t) { for (var e = t.parent; e !== null; ) { - if ((e.f & Et) === 0) - return (e.f & Je) === 0 ? ( + if ((e.f & Rt) === 0) + return (e.f & tn) === 0 ? ( /** @type {Effect} */ e ) : null; @@ -1003,127 +1003,127 @@ function cu(t) { } return null; } -function Ts(t) { - var e, n = W; - De(cu(t)); +function ks(t) { + var e, n = U; + Ie(pu(t)); try { - t.f &= ~Fn, fu(t), e = Ao(t); + t.f &= ~On, du(t), e = Ro(t); } finally { - De(n); + Ie(n); } return e; } -function eo(t) { - var e = Ts(t); - if (!t.equals(e) && (t.wv = bo(), (!(X != null && X.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { - at(t, yt); +function ro(t) { + var e = ks(t); + if (!t.equals(e) && (t.wv = Ao(), (!(B != null && B.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { + lt(t, wt); return; } - cn || (At !== null ? (Ss() || X != null && X.is_fork) && At.set(t, e) : Cs(t)); + pn || (Et !== null ? (Ps() || B != null && B.is_fork) && Et.set(t, e) : Ns(t)); } -function hu(t) { +function vu(t) { var e, n; if (t.effects !== null) for (const r of t.effects) - (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(yn), r.teardown = Dl, r.ac = null, Dr(r, 0), Ds(r)); + (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(xn), r.teardown = Ol, r.ac = null, Ir(r, 0), Os(r)); } -function no(t) { +function io(t) { if (t.effects !== null) for (const e of t.effects) - e.teardown && hr(e); + e.teardown && dr(e); } -let ls = /* @__PURE__ */ new Set(); -const fn = /* @__PURE__ */ new Map(); -let ro = !1; -function In(t, e) { +let cs = /* @__PURE__ */ new Set(); +const dn = /* @__PURE__ */ new Map(); +let so = !1; +function Ln(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: t, reactions: null, - equals: Va, + equals: Ha, rv: 0, wv: 0 }; return n; } // @__NO_SIDE_EFFECTS__ -function mt(t, e) { - const n = In(t); - return wo(n), n; +function yt(t, e) { + const n = Ln(t); + return bo(n), n; } // @__NO_SIDE_EFFECTS__ -function io(t, e = !1, n = !0) { - const r = In(t); - return e || (r.equals = Ya), r; +function ao(t, e = !1, n = !0) { + const r = Ln(t); + return e || (r.equals = za), r; } -function st(t, e, n = !1) { +function ot(t, e, n = !1) { Y !== 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 - (!ye || (Y.f & ea) !== 0) && Ha() && (Y.f & (Et | Qe | As | ea)) !== 0 && (ue === null || !or.call(ue, t)) && Kl(); - let r = n ? xn(e) : e; - return cr(t, r); + (!xe || (Y.f & ra) !== 0) && Xa() && (Y.f & (Rt | rn | Cs | ra)) !== 0 && (ce === null || !lr.call(ce, t)) && jl(); + let r = n ? $n(e) : e; + return hr(t, r); } -function cr(t, e) { +function hr(t, e) { if (!t.equals(e)) { var n = t.v; - cn ? fn.set(t, e) : fn.set(t, n), t.v = e; - var r = Ze.ensure(); - if (r.capture(t, n), (t.f & Et) !== 0) { + pn ? dn.set(t, e) : dn.set(t, n), t.v = e; + var r = en.ensure(); + if (r.capture(t, n), (t.f & Rt) !== 0) { const i = ( /** @type {Derived} */ t ); - (t.f & Rt) !== 0 && Ts(i), Cs(i); + (t.f & Ct) !== 0 && ks(i), Ns(i); } - t.wv = bo(), so(t, Rt), W !== null && (W.f & yt) !== 0 && (W.f & (xe | hn)) === 0 && (ie === null ? bu([t]) : ie.push(t)), !r.is_fork && ls.size > 0 && !ro && du(); + t.wv = Ao(), oo(t, Ct), U !== null && (U.f & wt) !== 0 && (U.f & ($e | vn)) === 0 && (ae === null ? Eu([t]) : ae.push(t)), !r.is_fork && cs.size > 0 && !so && gu(); } return e; } -function du() { - ro = !1; - for (const t of ls) - (t.f & yt) !== 0 && at(t, we), Br(t) && hr(t); - ls.clear(); +function gu() { + so = !1; + for (const t of cs) + (t.f & wt) !== 0 && lt(t, be), Ur(t) && dr(t); + cs.clear(); } -function Pr(t) { - st(t, t.v + 1); +function Dr(t) { + ot(t, t.v + 1); } -function so(t, e) { +function oo(t, e) { var n = t.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & Rt) === 0; - if (o && at(s, e), (a & Et) !== 0) { + var s = n[i], a = s.f, o = (a & Ct) === 0; + if (o && lt(s, e), (a & Rt) !== 0) { var l = ( /** @type {Derived} */ s ); - At == null || At.delete(l), (a & Fn) === 0 && (a & le && (s.f |= Fn), so(l, we)); - } else o && ((a & Qe) !== 0 && pe !== null && pe.add( + Et == null || Et.delete(l), (a & On) === 0 && (a & fe && (s.f |= On), oo(l, be)); + } else o && ((a & rn) !== 0 && ge !== null && ge.add( /** @type {Effect} */ s - ), me( + ), we( /** @type {Effect} */ s )); } } -function xn(t) { - if (typeof t != "object" || t === null || Sr in t) +function $n(t) { + if (typeof t != "object" || t === null || Mr in t) return t; - const e = Ml(t); - if (e !== kl && e !== Pl) + const e = Il(t); + if (e !== Dl && e !== Fl) return t; - var n = /* @__PURE__ */ new Map(), r = Ma(t), i = /* @__PURE__ */ mt(0), s = Mn, a = (o) => { - if (Mn === s) + var n = /* @__PURE__ */ new Map(), r = Fa(t), i = /* @__PURE__ */ yt(0), s = Fn, a = (o) => { + if (Fn === s) return o(); - var l = Y, u = Mn; - ce(null), sa(s); + var l = Y, u = Fn; + de(null), oa(s); var f = o(); - return ce(l), sa(u), f; + return de(l), oa(u), f; }; - return r && n.set("length", /* @__PURE__ */ mt( + return r && n.set("length", /* @__PURE__ */ yt( /** @type {any[]} */ t.length )), new Proxy( @@ -1131,35 +1131,35 @@ function xn(t) { t, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ul(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Jl(); var f = n.get(l); return f === void 0 ? a(() => { - var h = /* @__PURE__ */ mt(u.value); + var h = /* @__PURE__ */ yt(u.value); return n.set(l, h), h; - }) : st(f, u.value, !0), !0; + }) : ot(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__ */ mt($t)); - n.set(l, f), Pr(i); + const f = a(() => /* @__PURE__ */ yt(At)); + n.set(l, f), Dr(i); } } else - st(u, $t), Pr(i); + ot(u, At), Dr(i); return !0; }, get(o, l, u) { var p; - if (l === Sr) + if (l === Mr) return t; var f = n.get(l), h = l in o; - if (f === void 0 && (!h || (p = Sn(o, l)) != null && p.writable) && (f = a(() => { - var g = xn(h ? o[l] : $t), y = /* @__PURE__ */ mt(g); + if (f === void 0 && (!h || (p = Mn(o, l)) != null && p.writable) && (f = a(() => { + var g = $n(h ? o[l] : At), y = /* @__PURE__ */ yt(g); return y; }), n.set(l, f)), f !== void 0) { var c = x(f); - return c === $t ? void 0 : c; + return c === At ? void 0 : c; } return Reflect.get(o, l, u); }, @@ -1170,7 +1170,7 @@ function xn(t) { f && (u.value = x(f)); } else if (u === void 0) { var h = n.get(l), c = h == null ? void 0 : h.v; - if (h !== void 0 && c !== $t) + if (h !== void 0 && c !== At) return { enumerable: !0, configurable: !0, @@ -1182,16 +1182,16 @@ function xn(t) { }, has(o, l) { var c; - if (l === Sr) + if (l === Mr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== $t || Reflect.has(o, l); - if (u !== void 0 || W !== null && (!f || (c = Sn(o, l)) != null && c.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== At || Reflect.has(o, l); + if (u !== void 0 || U !== null && (!f || (c = Mn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { - var p = f ? xn(o[l]) : $t, g = /* @__PURE__ */ mt(p); + var p = f ? $n(o[l]) : At, g = /* @__PURE__ */ yt(p); return g; }), n.set(l, u)); var h = x(u); - if (h === $t) + if (h === At) return !1; } return f; @@ -1203,25 +1203,25 @@ function xn(t) { for (var p = u; p < /** @type {Source} */ h.v; p += 1) { var g = n.get(p + ""); - g !== void 0 ? st(g, $t) : p in o && (g = a(() => /* @__PURE__ */ mt($t)), n.set(p + "", g)); + g !== void 0 ? ot(g, At) : p in o && (g = a(() => /* @__PURE__ */ yt(At)), n.set(p + "", g)); } if (h === void 0) - (!c || (C = Sn(o, l)) != null && C.writable) && (h = a(() => /* @__PURE__ */ mt(void 0)), st(h, xn(u)), n.set(l, h)); + (!c || (C = Mn(o, l)) != null && C.writable) && (h = a(() => /* @__PURE__ */ yt(void 0)), ot(h, $n(u)), n.set(l, h)); else { - c = h.v !== $t; - var y = a(() => xn(u)); - st(h, y); + c = h.v !== At; + var y = a(() => $n(u)); + ot(h, y); } var $ = Reflect.getOwnPropertyDescriptor(o, l); if ($ != null && $.set && $.set.call(f, u), !c) { if (r && typeof l == "string") { - var E = ( + var A = ( /** @type {Source} */ n.get("length") - ), S = Number(l); - Number.isInteger(S) && S >= E.v && st(E, S + 1); + ), k = Number(l); + Number.isInteger(k) && k >= A.v && ot(A, k + 1); } - Pr(i); + Dr(i); } return !0; }, @@ -1229,141 +1229,141 @@ function xn(t) { x(i); var l = Reflect.ownKeys(o).filter((h) => { var c = n.get(h); - return c === void 0 || c.v !== $t; + return c === void 0 || c.v !== At; }); for (var [u, f] of n) - f.v !== $t && !(u in o) && l.push(u); + f.v !== At && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - Gl(); + Zl(); } } ); } -var ra, ao, oo, lo; -function us() { - if (ra === void 0) { - ra = window, ao = /Firefox/.test(navigator.userAgent); +var sa, lo, uo, fo; +function hs() { + if (sa === void 0) { + sa = window, lo = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype, n = Text.prototype; - oo = Sn(e, "firstChild").get, lo = Sn(e, "nextSibling").get, ta(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), ta(n) && (n.__t = void 0); + uo = Mn(e, "firstChild").get, fo = Mn(e, "nextSibling").get, na(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), na(n) && (n.__t = void 0); } } -function fe(t = "") { +function he(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function On(t) { +function qn(t) { return ( /** @type {TemplateNode | null} */ - oo.call(t) + uo.call(t) ); } // @__NO_SIDE_EFFECTS__ -function Ie(t) { +function Le(t) { return ( /** @type {TemplateNode | null} */ - lo.call(t) + fo.call(t) ); } -function Jt(t, e) { +function Zt(t, e) { if (!J) - return /* @__PURE__ */ On(t); - var n = /* @__PURE__ */ On(H); + return /* @__PURE__ */ qn(t); + var n = /* @__PURE__ */ qn(H); if (n === null) - n = H.appendChild(fe()); - else if (e && n.nodeType !== Xr) { - var r = fe(); + n = H.appendChild(he()); + else if (e && n.nodeType !== Wr) { + var r = he(); return n == null || n.before(r), zt(r), r; } - return e && Pi( + return e && Fi( /** @type {Text} */ n ), zt(n), n; } -function gn(t, e = !1) { +function mn(t, e = !1) { if (!J) { - var n = /* @__PURE__ */ On(t); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ie(n) : n; + var n = /* @__PURE__ */ qn(t); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Le(n) : n; } if (e) { - if ((H == null ? void 0 : H.nodeType) !== Xr) { - var r = fe(); + if ((H == null ? void 0 : H.nodeType) !== Wr) { + var r = he(); return H == null || H.before(r), zt(r), r; } - Pi( + Fi( /** @type {Text} */ H ); } return H; } -function de(t, e = 1, n = !1) { +function ve(t, e = 1, n = !1) { let r = J ? H : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Ie(r); + /* @__PURE__ */ Le(r); if (!J) return r; if (n) { - if ((r == null ? void 0 : r.nodeType) !== Xr) { - var s = fe(); + if ((r == null ? void 0 : r.nodeType) !== Wr) { + var s = he(); return r === null ? i == null || i.after(s) : r.before(s), zt(s), s; } - Pi( + Fi( /** @type {Text} */ r ); } return zt(r), r; } -function uo(t) { +function co(t) { t.textContent = ""; } -function fo() { +function ho() { return !1; } -function Ns(t, e, n) { +function Ms(t, e, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Nl, t, void 0) + document.createElementNS(Ml, t, void 0) ); } -function Pi(t) { +function Fi(t) { if ( /** @type {string} */ t.nodeValue.length < 65536 ) return; let e = t.nextSibling; - for (; e !== null && e.nodeType === Xr; ) + for (; e !== null && e.nodeType === Wr; ) e.remove(), t.nodeValue += /** @type {string} */ e.nodeValue, e = t.nextSibling; } -function co(t) { - var e = Y, n = W; - ce(null), De(null); +function po(t) { + var e = Y, n = U; + de(null), Ie(null); try { return t(); } finally { - ce(e), De(n); + de(e), Ie(n); } } -function pu(t) { - W === null && (Y === null && zl(), Hl()), cn && Yl(); +function _u(t) { + U === null && (Y === null && Wl(), Bl()), pn && Xl(); } -function vu(t, e) { +function mu(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function Oe(t, e, n) { - var r = W; - r !== null && (r.f & te) !== 0 && (t |= te); +function qe(t, e, n) { + var r = U; + r !== null && (r.f & ee) !== 0 && (t |= ee); var i = { - ctx: ee, + ctx: ne, deps: null, nodes: null, - f: t | Rt | le, + f: t | Ct | fe, first: null, fn: e, last: null, @@ -1377,14 +1377,14 @@ function Oe(t, e, n) { }; if (n) try { - hr(i); + dr(i); } catch (o) { throw Ft(i), o; } - else e !== null && me(i); + else e !== null && we(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 & Yn) === 0 && (s = s.first, (t & Qe) !== 0 && (t & lr) !== 0 && s !== null && (s.f |= lr)), s !== null && (s.parent = r, r !== null && vu(s, r), Y !== null && (Y.f & Et) !== 0 && (t & hn) === 0)) { + (s.f & zn) === 0 && (s = s.first, (t & rn) !== 0 && (t & ur) !== 0 && s !== null && (s.f |= ur)), s !== null && (s.parent = r, r !== null && mu(s, r), Y !== null && (Y.f & Rt) !== 0 && (t & vn) === 0)) { var a = ( /** @type {Derived} */ Y @@ -1393,125 +1393,125 @@ function Oe(t, e, n) { } return i; } -function Ss() { - return Y !== null && !ye; +function Ps() { + return Y !== null && !xe; } -function gu(t) { - const e = Oe(Ci, null, !1); - return at(e, yt), e.teardown = t, e; +function yu(t) { + const e = qe(Ni, null, !1); + return lt(e, wt), e.teardown = t, e; } -function ks(t) { - pu(); +function Ds(t) { + _u(); var e = ( /** @type {Effect} */ - W.f - ), n = !Y && (e & xe) !== 0 && (e & vr) === 0; + U.f + ), n = !Y && (e & $e) !== 0 && (e & gr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - ee + ne ); (r.e ?? (r.e = [])).push(t); } else - return ho(t); + return vo(t); } -function ho(t) { - return Oe(Mr | Ol, t, !1); +function vo(t) { + return qe(Fr | Vl, t, !1); } -function _u(t) { - Ze.ensure(); - const e = Oe(hn | Yn, t, !0); +function wu(t) { + en.ensure(); + const e = qe(vn | zn, t, !0); return () => { Ft(e); }; } -function mu(t) { - Ze.ensure(); - const e = Oe(hn | Yn, t, !0); +function xu(t) { + en.ensure(); + const e = qe(vn | zn, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Pn(e, () => { + n.outro ? Dn(e, () => { Ft(e), r(void 0); }) : (Ft(e), r(void 0)); }); } -function po(t) { - return Oe(Mr, t, !1); +function go(t) { + return qe(Fr, t, !1); } -function yu(t) { - return Oe(As | Yn, t, !0); +function bu(t) { + return qe(Cs | zn, t, !0); } -function Ps(t, e = 0) { - return Oe(Ci | e, t, !0); +function Fs(t, e = 0) { + return qe(Ni | e, t, !0); } -function Kn(t, e = [], n = [], r = []) { - ou(r, e, n, (i) => { - Oe(Ci, () => t(...i.map(x)), !0); +function Zn(t, e = [], n = [], r = []) { + fu(r, e, n, (i) => { + qe(Ni, () => t(...i.map(x)), !0); }); } -function Ms(t, e = 0) { - var n = Oe(Qe | e, t, !0); +function Is(t, e = 0) { + var n = qe(rn | e, t, !0); return n; } -function oe(t) { - return Oe(xe | Yn, t, !0); +function ue(t) { + return qe($e | zn, t, !0); } -function vo(t) { +function _o(t) { var e = t.teardown; if (e !== null) { - const n = cn, r = Y; - ia(!0), ce(null); + const n = pn, r = Y; + aa(!0), de(null); try { e.call(null); } finally { - ia(n), ce(r); + aa(n), de(r); } } } -function Ds(t, e = !1) { +function Os(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { const i = n.ac; - i !== null && co(() => { - i.abort(yn); + i !== null && po(() => { + i.abort(xn); }); var r = n.next; - (n.f & hn) !== 0 ? n.parent = null : Ft(n, e), n = r; + (n.f & vn) !== 0 ? n.parent = null : Ft(n, e), n = r; } } -function wu(t) { +function $u(t) { for (var e = t.first; e !== null; ) { var n = e.next; - (e.f & xe) === 0 && Ft(e), e = n; + (e.f & $e) === 0 && Ft(e), e = n; } } function Ft(t, e = !0) { var n = !1; - (e || (t.f & Oa) !== 0) && t.nodes !== null && t.nodes.end !== null && (xu( + (e || (t.f & qa) !== 0) && t.nodes !== null && t.nodes.end !== null && (Au( t.nodes.start, /** @type {TemplateNode} */ t.nodes.end - ), n = !0), Ds(t, e && !n), Dr(t, 0), at(t, Je); + ), n = !0), Os(t, e && !n), Ir(t, 0), lt(t, tn); var r = t.nodes && t.nodes.t; if (r !== null) for (const s of r) s.stop(); - vo(t); + _o(t); var i = t.parent; - i !== null && i.first !== null && go(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; + i !== null && i.first !== null && mo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; } -function xu(t, e) { +function Au(t, e) { for (; t !== null; ) { - var n = t === e ? null : /* @__PURE__ */ Ie(t); + var n = t === e ? null : /* @__PURE__ */ Le(t); t.remove(), t = n; } } -function go(t) { +function mo(t) { var e = t.parent, n = t.prev, r = t.next; n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); } -function Pn(t, e, n = !0) { +function Dn(t, e, n = !0) { var r = []; - _o(t, r, !0); + yo(t, r, !0); var i = () => { n && Ft(t), e && e(); }, s = r.length; @@ -1522,31 +1522,31 @@ function Pn(t, e, n = !0) { } else i(); } -function _o(t, e, n) { - if ((t.f & te) === 0) { - t.f ^= te; +function yo(t, e, n) { + if ((t.f & ee) === 0) { + t.f ^= ee; var r = t.nodes && t.nodes.t; if (r !== null) for (const o of r) (o.is_global || n) && e.push(o); for (var i = t.first; i !== null; ) { - var s = i.next, a = (i.f & lr) !== 0 || // If this is a branch effect without a block effect parent, + var s = i.next, a = (i.f & ur) !== 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 & xe) !== 0 && (t.f & Qe) !== 0; - _o(i, e, a ? n : !1), i = s; + (i.f & $e) !== 0 && (t.f & rn) !== 0; + yo(i, e, a ? n : !1), i = s; } } } -function Fs(t) { - mo(t, !0); +function Ls(t) { + wo(t, !0); } -function mo(t, e) { - if ((t.f & te) !== 0) { - t.f ^= te, (t.f & yt) === 0 && (at(t, Rt), me(t)); +function wo(t, e) { + if ((t.f & ee) !== 0) { + t.f ^= ee, (t.f & wt) === 0 && (lt(t, Ct), we(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & lr) !== 0 || (n.f & xe) !== 0; - mo(n, i ? e : !1), n = r; + var r = n.next, i = (n.f & ur) !== 0 || (n.f & $e) !== 0; + wo(n, i ? e : !1), n = r; } var s = t.nodes && t.nodes.t; if (s !== null) @@ -1554,249 +1554,249 @@ function mo(t, e) { (a.is_global || e) && a.in(); } } -function yo(t, e) { +function xo(t, e) { if (t.nodes) for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Ie(n); + var i = n === r ? null : /* @__PURE__ */ Le(n); e.append(n), n = i; } } -let ii = !1, cn = !1; -function ia(t) { - cn = t; +let oi = !1, pn = !1; +function aa(t) { + pn = t; } -let Y = null, ye = !1; -function ce(t) { +let Y = null, xe = !1; +function de(t) { Y = t; } -let W = null; -function De(t) { - W = t; +let U = null; +function Ie(t) { + U = t; } -let ue = null; -function wo(t) { - Y !== null && (ue === null ? ue = [t] : ue.push(t)); +let ce = null; +function bo(t) { + Y !== null && (ce === null ? ce = [t] : ce.push(t)); } -let Yt = null, Zt = 0, ie = null; -function bu(t) { - ie = t; +let Yt = null, jt = 0, ae = null; +function Eu(t) { + ae = t; } -let xo = 1, bn = 0, Mn = bn; -function sa(t) { - Mn = t; +let $o = 1, An = 0, Fn = An; +function oa(t) { + Fn = t; } -function bo() { - return ++xo; +function Ao() { + return ++$o; } -function Br(t) { +function Ur(t) { var e = t.f; - if ((e & Rt) !== 0) + if ((e & Ct) !== 0) return !0; - if (e & Et && (t.f &= ~Fn), (e & we) !== 0) { + if (e & Rt && (t.f &= ~On), (e & be) !== 0) { for (var n = ( /** @type {Value[]} */ t.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (Br( + if (Ur( /** @type {Derived} */ s - ) && eo( + ) && ro( /** @type {Derived} */ s ), s.wv > t.wv) return !0; } - (e & le) !== 0 && // During time traveling we don't want to reset the status so that + (e & fe) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - At === null && at(t, yt); + Et === null && lt(t, wt); } return !1; } -function $o(t, e, n = !0) { +function Eo(t, e, n = !0) { var r = t.reactions; - if (r !== null && !(ue !== null && or.call(ue, t))) + if (r !== null && !(ce !== null && lr.call(ce, t))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Et) !== 0 ? $o( + (s.f & Rt) !== 0 ? Eo( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? at(s, Rt) : (s.f & yt) !== 0 && at(s, we), me( + ) : e === s && (n ? lt(s, Ct) : (s.f & wt) !== 0 && lt(s, be), we( /** @type {Effect} */ s )); } } -function Ao(t) { +function Ro(t) { var y; - var e = Yt, n = Zt, r = ie, i = Y, s = ue, a = ee, o = ye, l = Mn, u = t.f; + var e = Yt, n = jt, r = ae, i = Y, s = ce, a = ne, o = xe, l = Fn, u = t.f; Yt = /** @type {null | Value[]} */ - null, Zt = 0, ie = null, Y = (u & (xe | hn)) === 0 ? t : null, ue = null, ur(t.ctx), ye = !1, Mn = ++bn, t.ac !== null && (co(() => { - t.ac.abort(yn); + null, jt = 0, ae = null, Y = (u & ($e | vn)) === 0 ? t : null, ce = null, fr(t.ctx), xe = !1, Fn = ++An, t.ac !== null && (po(() => { + t.ac.abort(xn); }), t.ac = null); try { - t.f |= ts; + t.f |= rs; var f = ( /** @type {Function} */ t.fn ), h = f(); - t.f |= vr; - var c = t.deps, p = X == null ? void 0 : X.is_fork; + t.f |= gr; + var c = t.deps, p = B == null ? void 0 : B.is_fork; if (Yt !== null) { var g; - if (p || Dr(t, Zt), c !== null && Zt > 0) - for (c.length = Zt + Yt.length, g = 0; g < Yt.length; g++) - c[Zt + g] = Yt[g]; + if (p || Ir(t, jt), c !== null && jt > 0) + for (c.length = jt + Yt.length, g = 0; g < Yt.length; g++) + c[jt + g] = Yt[g]; else t.deps = c = Yt; - if (Ss() && (t.f & le) !== 0) - for (g = Zt; g < c.length; g++) + if (Ps() && (t.f & fe) !== 0) + for (g = jt; g < c.length; g++) ((y = c[g]).reactions ?? (y.reactions = [])).push(t); - } else !p && c !== null && Zt < c.length && (Dr(t, Zt), c.length = Zt); - if (Ha() && ie !== null && !ye && c !== null && (t.f & (Et | we | Rt)) === 0) + } else !p && c !== null && jt < c.length && (Ir(t, jt), c.length = jt); + if (Xa() && ae !== null && !xe && c !== null && (t.f & (Rt | be | Ct)) === 0) for (g = 0; g < /** @type {Source[]} */ - ie.length; g++) - $o( - ie[g], + ae.length; g++) + Eo( + ae[g], /** @type {Effect} */ t ); if (i !== null && i !== t) { - if (bn++, i.deps !== null) + if (An++, i.deps !== null) for (let $ = 0; $ < n; $ += 1) - i.deps[$].rv = bn; + i.deps[$].rv = An; if (e !== null) for (const $ of e) - $.rv = bn; - ie !== null && (r === null ? r = ie : r.push(.../** @type {Source[]} */ - ie)); + $.rv = An; + ae !== null && (r === null ? r = ae : r.push(.../** @type {Source[]} */ + ae)); } - return (t.f & un) !== 0 && (t.f ^= un), h; + return (t.f & hn) !== 0 && (t.f ^= hn), h; } catch ($) { - return Xa($); + return Wa($); } finally { - t.f ^= ts, Yt = e, Zt = n, ie = r, Y = i, ue = s, ur(a), ye = o, Mn = l; + t.f ^= rs, Yt = e, jt = n, ae = r, Y = i, ce = s, fr(a), xe = o, Fn = l; } } -function $u(t, e) { +function Ru(t, e) { let n = e.reactions; if (n !== null) { - var r = Sl.call(n, t); + var r = Pl.call(n, t); if (r !== -1) { var i = n.length - 1; i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (e.f & Et) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (e.f & Rt) !== 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 - (Yt === null || !or.call(Yt, e))) { + (Yt === null || !lr.call(Yt, e))) { var s = ( /** @type {Derived} */ e ); - (s.f & le) !== 0 && (s.f ^= le, s.f &= ~Fn), Cs(s), hu(s), Dr(s, 0); + (s.f & fe) !== 0 && (s.f ^= fe, s.f &= ~On), Ns(s), vu(s), Ir(s, 0); } } -function Dr(t, e) { +function Ir(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - $u(t, n[r]); + Ru(t, n[r]); } -function hr(t) { +function dr(t) { var e = t.f; - if ((e & Je) === 0) { - at(t, yt); - var n = W, r = ii; - W = t, ii = !0; + if ((e & tn) === 0) { + lt(t, wt); + var n = U, r = oi; + U = t, oi = !0; try { - (e & (Qe | Fa)) !== 0 ? wu(t) : Ds(t), vo(t); - var i = Ao(t); - t.teardown = typeof i == "function" ? i : null, t.wv = xo; + (e & (rn | Oa)) !== 0 ? $u(t) : Os(t), _o(t); + var i = Ro(t); + t.teardown = typeof i == "function" ? i : null, t.wv = $o; var s; - Qi && Ql && (t.f & Rt) !== 0 && t.deps; + ns && nu && (t.f & Ct) !== 0 && t.deps; } finally { - ii = r, W = n; + oi = r, U = n; } } } function x(t) { - var e = t.f, n = (e & Et) !== 0; - if (Y !== null && !ye) { - var r = W !== null && (W.f & Je) !== 0; - if (!r && (ue === null || !or.call(ue, t))) { + var e = t.f, n = (e & Rt) !== 0; + if (Y !== null && !xe) { + var r = U !== null && (U.f & tn) !== 0; + if (!r && (ce === null || !lr.call(ce, t))) { var i = Y.deps; - if ((Y.f & ts) !== 0) - t.rv < bn && (t.rv = bn, Yt === null && i !== null && i[Zt] === t ? Zt++ : Yt === null ? Yt = [t] : Yt.push(t)); + if ((Y.f & rs) !== 0) + t.rv < An && (t.rv = An, Yt === null && i !== null && i[jt] === t ? jt++ : Yt === null ? Yt = [t] : Yt.push(t)); else { (Y.deps ?? (Y.deps = [])).push(t); var s = t.reactions; - s === null ? t.reactions = [Y] : or.call(s, Y) || s.push(Y); + s === null ? t.reactions = [Y] : lr.call(s, Y) || s.push(Y); } } } - if (cn && fn.has(t)) - return fn.get(t); + if (pn && dn.has(t)) + return dn.get(t); if (n) { var a = ( /** @type {Derived} */ t ); - if (cn) { + if (pn) { var o = a.v; - return ((a.f & yt) === 0 && a.reactions !== null || Ro(a)) && (o = Ts(a)), fn.set(a, o), o; + return ((a.f & wt) === 0 && a.reactions !== null || To(a)) && (o = ks(a)), dn.set(a, o), o; } - var l = (a.f & le) === 0 && !ye && Y !== null && (ii || (Y.f & le) !== 0), u = (a.f & vr) === 0; - Br(a) && (l && (a.f |= le), eo(a)), l && !u && (no(a), Eo(a)); + var l = (a.f & fe) === 0 && !xe && Y !== null && (oi || (Y.f & fe) !== 0), u = (a.f & gr) === 0; + Ur(a) && (l && (a.f |= fe), ro(a)), l && !u && (io(a), Co(a)); } - if (At != null && At.has(t)) - return At.get(t); - if ((t.f & un) !== 0) + if (Et != null && Et.has(t)) + return Et.get(t); + if ((t.f & hn) !== 0) throw t.v; return t.v; } -function Eo(t) { - if (t.f |= le, t.deps !== null) +function Co(t) { + if (t.f |= fe, t.deps !== null) for (const e of t.deps) - (e.reactions ?? (e.reactions = [])).push(t), (e.f & Et) !== 0 && (e.f & le) === 0 && (no( + (e.reactions ?? (e.reactions = [])).push(t), (e.f & Rt) !== 0 && (e.f & fe) === 0 && (io( /** @type {Derived} */ e - ), Eo( + ), Co( /** @type {Derived} */ e )); } -function Ro(t) { - if (t.v === $t) return !0; +function To(t) { + if (t.v === At) return !0; if (t.deps === null) return !1; for (const e of t.deps) - if (fn.has(e) || (e.f & Et) !== 0 && Ro( + if (dn.has(e) || (e.f & Rt) !== 0 && To( /** @type {Derived} */ e )) return !0; return !1; } -function Mi(t) { - var e = ye; +function Ii(t) { + var e = xe; try { - return ye = !0, t(); + return xe = !0, t(); } finally { - ye = e; + xe = e; } } -const Co = /* @__PURE__ */ new Set(), fs = /* @__PURE__ */ new Set(); -function Au(t) { +const So = /* @__PURE__ */ new Set(), ds = /* @__PURE__ */ new Set(); +function Cu(t) { for (var e = 0; e < t.length; e++) - Co.add(t[e]); - for (var n of fs) + So.add(t[e]); + for (var n of ds) n(t); } -let aa = null; -function oa(t) { +let la = null; +function ua(t) { var $; var e = this, n = ( /** @type {Node} */ @@ -1805,8 +1805,8 @@ function oa(t) { /** @type {null | Element} */ i[0] || t.target ); - aa = t; - var a = 0, o = aa === t && t.__root; + la = t; + var a = 0, o = la === t && t.__root; if (o) { var l = i.indexOf(o); if (l !== -1 && (e === document || e === /** @type {any} */ @@ -1821,14 +1821,14 @@ function oa(t) { } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - di(t, "currentTarget", { + gi(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = Y, h = W; - ce(null), De(null); + var f = Y, h = U; + de(null), Ie(null); try { for (var c, p = []; s !== null; ) { var g = s.assignedSlot || s.parentNode || /** @type {any} */ @@ -1839,120 +1839,120 @@ function oa(t) { 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 t.target === s) && y.call(s, t); - } catch (E) { - c ? p.push(E) : c = E; + } catch (A) { + c ? p.push(A) : c = A; } if (t.cancelBubble || g === e || g === null) break; s = g; } if (c) { - for (let E of p) + for (let A of p) queueMicrotask(() => { - throw E; + throw A; }); throw c; } } finally { - t.__root = e, delete t.currentTarget, ce(f), De(h); + t.__root = e, delete t.currentTarget, de(f), Ie(h); } } } -var ka, Pa; -const Bi = (Pa = (ka = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : ka.trustedTypes) == null ? void 0 : /* @__PURE__ */ Pa.createPolicy( +var Pa, Da; +const Gi = (Da = (Pa = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Pa.trustedTypes) == null ? void 0 : /* @__PURE__ */ Da.createPolicy( "svelte-trusted-html", { /** @param {string} html */ createHTML: (t) => t } ); -function Eu(t) { +function Tu(t) { return ( /** @type {string} */ - (Bi == null ? void 0 : Bi.createHTML(t)) ?? t + (Gi == null ? void 0 : Gi.createHTML(t)) ?? t ); } -function To(t, e = !1) { - var n = Ns("template"); - return t = t.replaceAll("", ""), n.innerHTML = e ? Eu(t) : t, n.content; +function No(t, e = !1) { + var n = Ms("template"); + return t = t.replaceAll("", ""), n.innerHTML = e ? Tu(t) : t, n.content; } -function Ln(t, e) { +function Vn(t, e) { var n = ( /** @type {Effect} */ - W + U ); n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function Hn(t, e) { - var n = (e & Tl) !== 0, r, i = !t.startsWith(""); +function Xn(t, e) { + var n = (e & kl) !== 0, r, i = !t.startsWith(""); return () => { if (J) - return Ln(H, null), H; - r === void 0 && (r = To(i ? t : "" + t, !0)); + return Vn(H, null), H; + r === void 0 && (r = No(i ? t : "" + t, !0)); var s = ( /** @type {TemplateNode} */ - n || ao ? document.importNode(r, !0) : r.cloneNode(!0) + n || lo ? document.importNode(r, !0) : r.cloneNode(!0) ); { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ On(s) + /* @__PURE__ */ qn(s) ), o = ( /** @type {TemplateNode} */ s.lastChild ); - Ln(a, o); + Vn(a, o); } return s; }; } // @__NO_SIDE_EFFECTS__ -function Ru(t, e, n = "svg") { +function Su(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { if (J) - return Ln(H, null), H; + return Vn(H, null), H; if (!s) { var a = ( /** @type {DocumentFragment} */ - To(i, !0) + No(i, !0) ), o = ( /** @type {Element} */ - /* @__PURE__ */ On(a) + /* @__PURE__ */ qn(a) ); s = /** @type {Element} */ - /* @__PURE__ */ On(o); + /* @__PURE__ */ qn(o); } var l = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return Ln(l, l), l; + return Vn(l, l), l; }; } // @__NO_SIDE_EFFECTS__ -function Cu(t, e) { - return /* @__PURE__ */ Ru(t, e, "svg"); +function Nu(t, e) { + return /* @__PURE__ */ Su(t, e, "svg"); } -function la(t = "") { +function fa(t = "") { if (!J) { - var e = fe(t + ""); - return Ln(e, e), e; + var e = he(t + ""); + return Vn(e, e), e; } var n = H; - return n.nodeType !== Xr ? (n.before(n = fe()), zt(n)) : Pi( + return n.nodeType !== Wr ? (n.before(n = he()), zt(n)) : Fi( /** @type {Text} */ n - ), Ln(n, n), n; + ), Vn(n, n), n; } -function ve(t, e) { +function _e(t, e) { if (J) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ - W + U ); - ((n.f & vr) === 0 || n.nodes.end === null) && (n.nodes.end = H), Ni(); + ((n.f & gr) === 0 || n.nodes.end === null) && (n.nodes.end = H), Mi(); return; } t !== null && t.before( @@ -1960,64 +1960,64 @@ function ve(t, e) { e ); } -const Tu = ["touchstart", "touchmove"]; -function Nu(t) { - return Tu.includes(t); +const ku = ["touchstart", "touchmove"]; +function Mu(t) { + return ku.includes(t); } -function sn(t, e) { +function ln(t, e) { var n = e == null ? "" : typeof e == "object" ? e + "" : e; n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); } -function No(t, e) { - return So(t, e); +function ko(t, e) { + return Mo(t, e); } -function Su(t, e) { - us(), e.intro = e.intro ?? !1; +function Pu(t, e) { + hs(), e.intro = e.intro ?? !1; const n = e.target, r = J, i = H; try { - for (var s = /* @__PURE__ */ On(n); s && (s.nodeType !== gr || /** @type {Comment} */ - s.data !== bs); ) - s = /* @__PURE__ */ Ie(s); + for (var s = /* @__PURE__ */ qn(n); s && (s.nodeType !== _r || /** @type {Comment} */ + s.data !== Es); ) + s = /* @__PURE__ */ Le(s); if (!s) - throw ar; - Ke(!0), zt( + throw or; + Qe(!0), zt( /** @type {Comment} */ s ); - const a = So(t, { ...e, anchor: s }); - return Ke(!1), /** @type {Exports} */ + const a = Mo(t, { ...e, anchor: s }); + return Qe(!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 !== ar && console.warn("Failed to hydrate: ", a), e.recover === !1 && Bl(), us(), uo(n), Ke(!1), No(t, e); + return a !== or && console.warn("Failed to hydrate: ", a), e.recover === !1 && Gl(), hs(), co(n), Qe(!1), ko(t, e); } finally { - Ke(r), zt(i); + Qe(r), zt(i); } } -const Jr = /* @__PURE__ */ new Map(); -function So(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - us(); +const Qr = /* @__PURE__ */ new Map(); +function Mo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + hs(); var o = /* @__PURE__ */ new Set(), l = (h) => { for (var c = 0; c < h.length; c++) { var p = h[c]; if (!o.has(p)) { o.add(p); - var g = Nu(p); - for (const E of [e, document]) { - var y = Jr.get(E); - y === void 0 && (y = /* @__PURE__ */ new Map(), Jr.set(E, y)); + var g = Mu(p); + for (const A of [e, document]) { + var y = Qr.get(A); + y === void 0 && (y = /* @__PURE__ */ new Map(), Qr.set(A, y)); var $ = y.get(p); - $ === void 0 ? (E.addEventListener(p, oa, { passive: g }), y.set(p, 1)) : y.set(p, $ + 1); + $ === void 0 ? (A.addEventListener(p, ua, { passive: g }), y.set(p, 1)) : y.set(p, $ + 1); } } } }; - l(Ri(Co)), fs.add(l); - var u = void 0, f = mu(() => { - var h = n ?? e.appendChild(fe()); - return su( + l(Si(So)), ds.add(l); + var u = void 0, f = xu(() => { + var h = n ?? e.appendChild(he()); + return lu( /** @type {TemplateNode} */ h, { @@ -2025,19 +2025,19 @@ function So(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int } }, (c) => { - Es({}); + Ts({}); var p = ( /** @type {ComponentContext} */ - ee + ne ); - if (s && (p.c = s), i && (r.$$events = i), J && Ln( + if (s && (p.c = s), i && (r.$$events = i), J && Vn( /** @type {TemplateNode} */ c, null - ), u = t(c, r) || {}, J && (W.nodes.end = H, H === null || H.nodeType !== gr || /** @type {Comment} */ - H.data !== $s)) - throw Ti(), ar; - Rs(); + ), u = t(c, r) || {}, J && (U.nodes.end = H, H === null || H.nodeType !== _r || /** @type {Comment} */ + H.data !== Rs)) + throw ki(), or; + Ss(); } ), () => { var y; @@ -2045,34 +2045,34 @@ function So(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int for (const $ of [e, document]) { var p = ( /** @type {Map} */ - Jr.get($) + Qr.get($) ), g = ( /** @type {number} */ p.get(c) ); - --g == 0 ? ($.removeEventListener(c, oa), p.delete(c), p.size === 0 && Jr.delete($)) : p.set(c, g); + --g == 0 ? ($.removeEventListener(c, ua), p.delete(c), p.size === 0 && Qr.delete($)) : p.set(c, g); } - fs.delete(l), h !== n && ((y = h.parentNode) == null || y.removeChild(h)); + ds.delete(l), h !== n && ((y = h.parentNode) == null || y.removeChild(h)); }; }); - return cs.set(u, f), u; + return ps.set(u, f), u; } -let cs = /* @__PURE__ */ new WeakMap(); -function ku(t, e) { - const n = cs.get(t); - return n ? (cs.delete(t), n(e)) : Promise.resolve(); +let ps = /* @__PURE__ */ new WeakMap(); +function Du(t, e) { + const n = ps.get(t); + return n ? (ps.delete(t), n(e)) : Promise.resolve(); } -var ge, ke, Qt, Nn, Hr, zr, Ai; -class Pu { +var me, Pe, te, kn, Xr, Br, Ci; +class Fu { /** * @param {TemplateNode} anchor * @param {boolean} transition */ constructor(e, n = !0) { /** @type {TemplateNode} */ - it(this, "anchor"); + st(this, "anchor"); /** @type {Map} */ - L(this, ge, /* @__PURE__ */ new Map()); + q(this, me, /* @__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. @@ -2087,69 +2087,69 @@ class Pu { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - L(this, ke, /* @__PURE__ */ new Map()); + q(this, Pe, /* @__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} */ - L(this, Qt, /* @__PURE__ */ new Map()); + q(this, te, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - L(this, Nn, /* @__PURE__ */ new Set()); + q(this, kn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - L(this, Hr, !0); - L(this, zr, () => { + q(this, Xr, !0); + q(this, Br, () => { var e = ( /** @type {Batch} */ - X + B ); - if (v(this, ge).has(e)) { + if (v(this, me).has(e)) { var n = ( /** @type {Key} */ - v(this, ge).get(e) - ), r = v(this, ke).get(n); + v(this, me).get(e) + ), r = v(this, Pe).get(n); if (r) - Fs(r), v(this, Nn).delete(n); + Ls(r), v(this, kn).delete(n); else { - var i = v(this, Qt).get(n); - i && (v(this, ke).set(n, i.effect), v(this, Qt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, te).get(n); + i && (v(this, Pe).set(n, i.effect), v(this, te).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, ge)) { - if (v(this, ge).delete(s), s === e) + for (const [s, a] of v(this, me)) { + if (v(this, me).delete(s), s === e) break; - const o = v(this, Qt).get(a); - o && (Ft(o.effect), v(this, Qt).delete(a)); + const o = v(this, te).get(a); + o && (Ft(o.effect), v(this, te).delete(a)); } - for (const [s, a] of v(this, ke)) { - if (s === n || v(this, Nn).has(s)) continue; + for (const [s, a] of v(this, Pe)) { + if (s === n || v(this, kn).has(s)) continue; const o = () => { - if (Array.from(v(this, ge).values()).includes(s)) { + if (Array.from(v(this, me).values()).includes(s)) { var u = document.createDocumentFragment(); - yo(a, u), u.append(fe()), v(this, Qt).set(s, { effect: a, fragment: u }); + xo(a, u), u.append(he()), v(this, te).set(s, { effect: a, fragment: u }); } else Ft(a); - v(this, Nn).delete(s), v(this, ke).delete(s); + v(this, kn).delete(s), v(this, Pe).delete(s); }; - v(this, Hr) || !r ? (v(this, Nn).add(s), Pn(a, o, !1)) : o(); + v(this, Xr) || !r ? (v(this, kn).add(s), Dn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - L(this, Ai, (e) => { - v(this, ge).delete(e); - const n = Array.from(v(this, ge).values()); - for (const [r, i] of v(this, Qt)) - n.includes(r) || (Ft(i.effect), v(this, Qt).delete(r)); + q(this, Ci, (e) => { + v(this, me).delete(e); + const n = Array.from(v(this, me).values()); + for (const [r, i] of v(this, te)) + n.includes(r) || (Ft(i.effect), v(this, te).delete(r)); }); - this.anchor = e, O(this, Hr, n); + this.anchor = e, O(this, Xr, n); } /** * @@ -2159,69 +2159,69 @@ class Pu { ensure(e, n) { var r = ( /** @type {Batch} */ - X - ), i = fo(); - if (n && !v(this, ke).has(e) && !v(this, Qt).has(e)) + B + ), i = ho(); + if (n && !v(this, Pe).has(e) && !v(this, te).has(e)) if (i) { - var s = document.createDocumentFragment(), a = fe(); - s.append(a), v(this, Qt).set(e, { - effect: oe(() => n(a)), + var s = document.createDocumentFragment(), a = he(); + s.append(a), v(this, te).set(e, { + effect: ue(() => n(a)), fragment: s }); } else - v(this, ke).set( + v(this, Pe).set( e, - oe(() => n(this.anchor)) + ue(() => n(this.anchor)) ); - if (v(this, ge).set(r, e), i) { - for (const [o, l] of v(this, ke)) + if (v(this, me).set(r, e), i) { + for (const [o, l] of v(this, Pe)) o === e ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, Qt)) + for (const [o, l] of v(this, te)) o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, zr)), r.ondiscard(v(this, Ai)); + r.oncommit(v(this, Br)), r.ondiscard(v(this, Ci)); } else - J && (this.anchor = H), v(this, zr).call(this); + J && (this.anchor = H), v(this, Br).call(this); } } -ge = new WeakMap(), ke = new WeakMap(), Qt = new WeakMap(), Nn = new WeakMap(), Hr = new WeakMap(), zr = new WeakMap(), Ai = new WeakMap(); -function Mu(t) { - ee === null && Ll(), ks(() => { - const e = Mi(t); +me = new WeakMap(), Pe = new WeakMap(), te = new WeakMap(), kn = new WeakMap(), Xr = new WeakMap(), Br = new WeakMap(), Ci = new WeakMap(); +function Iu(t) { + ne === null && Yl(), Ds(() => { + const e = Ii(t); if (typeof e == "function") return ( /** @type {() => void} */ e ); }); } -function $r(t, e, n = !1) { - J && Ni(); - var r = new Pu(t), i = n ? lr : 0; +function Er(t, e, n = !1) { + J && Mi(); + var r = new Fu(t), i = n ? ur : 0; function s(a, o) { if (J) { - const f = qa(t); + const f = Ya(t); var l; - if (f === bs ? l = 0 : f === Ei ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = pi(); - zt(u), r.anchor = u, Ke(!1), r.ensure(a, o), Ke(!0); + if (f === Es ? l = 0 : f === Ti ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = _i(); + zt(u), r.anchor = u, Qe(!1), r.ensure(a, o), Qe(!0); return; } } r.ensure(a, o); } - Ms(() => { + Is(() => { var a = !1; e((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function Wi(t, e) { +function Ki(t, e) { return e; } -function Du(t, e, n) { +function Ou(t, e, n) { for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { let h = e[o]; - Pn( + Dn( h, () => { if (s) { @@ -2230,7 +2230,7 @@ function Du(t, e, n) { /** @type {Set} */ t.outrogroups ); - hs(Ri(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); + vs(Si(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); } } else a -= 1; @@ -2248,164 +2248,164 @@ function Du(t, e, n) { /** @type {Element} */ u.parentNode ); - uo(f), f.append(u), t.items.clear(); + co(f), f.append(u), t.items.clear(); } - hs(e, !l); + vs(e, !l); } else s = { pending: new Set(e), done: /* @__PURE__ */ new Set() }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function hs(t, e = !0) { +function vs(t, e = !0) { for (var n = 0; n < t.length; n++) Ft(t[n], e); } -var ua; -function Ui(t, e, n, r, i, s = null) { +var ca; +function Ji(t, e, n, r, i, s = null) { var a = t, o = /* @__PURE__ */ new Map(); - J && Ni(); - var l = null, u = /* @__PURE__ */ to(() => { + J && Mi(); + var l = null, u = /* @__PURE__ */ no(() => { var y = n(); - return Ma(y) ? y : y == null ? [] : Ri(y); + return Fa(y) ? y : y == null ? [] : Si(y); }), f, h = !0; function c() { - g.fallback = l, Fu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & ln) === 0 ? Fs(l) : (l.f ^= ln, Rr(l, null, a)) : Pn(l, () => { + g.fallback = l, Lu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & cn) === 0 ? Ls(l) : (l.f ^= cn, Tr(l, null, a)) : Dn(l, () => { l = null; })); } - var p = Ms(() => { + var p = Is(() => { f = /** @type {V[]} */ x(u); var y = f.length; let $ = !1; if (J) { - var E = qa(a) === Ei; - E !== (y === 0) && (a = pi(), zt(a), Ke(!1), $ = !0); + var A = Ya(a) === Ti; + A !== (y === 0) && (a = _i(), zt(a), Qe(!1), $ = !0); } - for (var S = /* @__PURE__ */ new Set(), C = ( + for (var k = /* @__PURE__ */ new Set(), C = ( /** @type {Batch} */ - X - ), P = fo(), k = 0; k < y; k += 1) { - J && H.nodeType === gr && /** @type {Comment} */ - H.data === $s && (a = /** @type {Comment} */ - H, $ = !0, Ke(!1)); - var G = f[k], ot = r(G, k), K = h ? null : o.get(ot); - K ? (K.v && cr(K.v, G), K.i && cr(K.i, k), P && C.unskip_effect(K.e)) : (K = Iu( + B + ), D = ho(), P = 0; P < y; P += 1) { + J && H.nodeType === _r && /** @type {Comment} */ + H.data === Rs && (a = /** @type {Comment} */ + H, $ = !0, Qe(!1)); + var G = f[P], ut = r(G, P), K = h ? null : o.get(ut); + K ? (K.v && hr(K.v, G), K.i && hr(K.i, P), D && C.unskip_effect(K.e)) : (K = qu( o, - h ? a : ua ?? (ua = fe()), + h ? a : ca ?? (ca = he()), G, - ot, - k, + ut, + P, i, e, n - ), h || (K.e.f |= ln), o.set(ot, K)), S.add(ot); + ), h || (K.e.f |= cn), o.set(ut, K)), k.add(ut); } - if (y === 0 && s && !l && (h ? l = oe(() => s(a)) : (l = oe(() => s(ua ?? (ua = fe()))), l.f |= ln)), y > S.size && Vl(), J && y > 0 && zt(pi()), !h) - if (P) { - for (const [nt, Q] of o) - S.has(nt) || C.skip_effect(Q.e); + if (y === 0 && s && !l && (h ? l = ue(() => s(a)) : (l = ue(() => s(ca ?? (ca = he()))), l.f |= cn)), y > k.size && zl(), J && y > 0 && zt(_i()), !h) + if (D) { + for (const [it, Q] of o) + k.has(it) || C.skip_effect(Q.e); C.oncommit(c), C.ondiscard(() => { }); } else c(); - $ && Ke(!0), x(u); + $ && Qe(!0), x(u); }), g = { effect: p, items: o, outrogroups: null, fallback: l }; h = !1, J && (a = H); } -function Ar(t) { - for (; t !== null && (t.f & xe) === 0; ) +function Rr(t) { + for (; t !== null && (t.f & $e) === 0; ) t = t.next; return t; } -function Fu(t, e, n, r, i) { +function Lu(t, e, n, r, i) { var K; - var s = e.length, a = t.items, o = Ar(t.effect.first), l, u = null, f = [], h = [], c, p, g, y; + var s = e.length, a = t.items, o = Rr(t.effect.first), l, u = null, f = [], h = [], c, p, g, y; for (y = 0; y < s; y += 1) { if (c = e[y], p = i(c, y), g = /** @type {EachItem} */ a.get(p).e, t.outrogroups !== null) - for (const nt of t.outrogroups) - nt.pending.delete(g), nt.done.delete(g); - if ((g.f & ln) !== 0) - if (g.f ^= ln, g === o) - Rr(g, null, n); + for (const it of t.outrogroups) + it.pending.delete(g), it.done.delete(g); + if ((g.f & cn) !== 0) + if (g.f ^= cn, g === o) + Tr(g, null, n); else { var $ = u ? u.next : o; - g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), an(t, u, g), an(t, g, $), Rr(g, $, n), u = g, f = [], h = [], o = Ar(u.next); + g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), un(t, u, g), un(t, g, $), Tr(g, $, n), u = g, f = [], h = [], o = Rr(u.next); continue; } - if ((g.f & te) !== 0 && Fs(g), g !== o) { + if ((g.f & ee) !== 0 && Ls(g), g !== o) { if (l !== void 0 && l.has(g)) { if (f.length < h.length) { - var E = h[0], S; - u = E.prev; - var C = f[0], P = f[f.length - 1]; - for (S = 0; S < f.length; S += 1) - Rr(f[S], E, n); - for (S = 0; S < h.length; S += 1) - l.delete(h[S]); - an(t, C.prev, P.next), an(t, u, C), an(t, P, E), o = E, u = P, y -= 1, f = [], h = []; + var A = h[0], k; + u = A.prev; + var C = f[0], D = f[f.length - 1]; + for (k = 0; k < f.length; k += 1) + Tr(f[k], A, n); + for (k = 0; k < h.length; k += 1) + l.delete(h[k]); + un(t, C.prev, D.next), un(t, u, C), un(t, D, A), o = A, u = D, y -= 1, f = [], h = []; } else - l.delete(g), Rr(g, o, n), an(t, g.prev, g.next), an(t, g, u === null ? t.effect.first : u.next), an(t, u, g), u = g; + l.delete(g), Tr(g, o, n), un(t, g.prev, g.next), un(t, g, u === null ? t.effect.first : u.next), un(t, u, g), u = g; continue; } for (f = [], h = []; o !== null && o !== g; ) - (l ?? (l = /* @__PURE__ */ new Set())).add(o), h.push(o), o = Ar(o.next); + (l ?? (l = /* @__PURE__ */ new Set())).add(o), h.push(o), o = Rr(o.next); if (o === null) continue; } - (g.f & ln) === 0 && f.push(g), u = g, o = Ar(g.next); + (g.f & cn) === 0 && f.push(g), u = g, o = Rr(g.next); } if (t.outrogroups !== null) { - for (const nt of t.outrogroups) - nt.pending.size === 0 && (hs(Ri(nt.done)), (K = t.outrogroups) == null || K.delete(nt)); + for (const it of t.outrogroups) + it.pending.size === 0 && (vs(Si(it.done)), (K = t.outrogroups) == null || K.delete(it)); t.outrogroups.size === 0 && (t.outrogroups = null); } if (o !== null || l !== void 0) { - var k = []; + var P = []; if (l !== void 0) for (g of l) - (g.f & te) === 0 && k.push(g); + (g.f & ee) === 0 && P.push(g); for (; o !== null; ) - (o.f & te) === 0 && o !== t.fallback && k.push(o), o = Ar(o.next); - var G = k.length; + (o.f & ee) === 0 && o !== t.fallback && P.push(o), o = Rr(o.next); + var G = P.length; if (G > 0) { - var ot = null; - Du(t, k, ot); + var ut = null; + Ou(t, P, ut); } } } -function Iu(t, e, n, r, i, s, a, o) { - var l = (a & xl) !== 0 ? (a & $l) === 0 ? /* @__PURE__ */ io(n, !1, !1) : In(n) : null, u = (a & bl) !== 0 ? In(i) : null; +function qu(t, e, n, r, i, s, a, o) { + var l = (a & Al) !== 0 ? (a & Rl) === 0 ? /* @__PURE__ */ ao(n, !1, !1) : Ln(n) : null, u = (a & El) !== 0 ? Ln(i) : null; return { v: l, i: u, - e: oe(() => (s(e, l ?? n, u ?? i, o), () => { + e: ue(() => (s(e, l ?? n, u ?? i, o), () => { t.delete(r); })) }; } -function Rr(t, e, n) { +function Tr(t, e, n) { if (t.nodes) - for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & ln) === 0 ? ( + for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & cn) === 0 ? ( /** @type {EffectNodes} */ e.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Ie(r) + /* @__PURE__ */ Le(r) ); if (s.before(r), r === i) return; r = a; } } -function an(t, e, n) { +function un(t, e, n) { e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; } -function ko(t, e) { - po(() => { +function Po(t, e) { + go(() => { var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -2418,12 +2418,12 @@ function ko(t, e) { ) ); if (!r.querySelector("#" + e.hash)) { - const i = Ns("style"); + const i = Ms("style"); i.id = e.hash, i.textContent = e.code, r.appendChild(i); } }); } -function fa(t, e = !1) { +function ha(t, e = !1) { var n = e ? " !important;" : ";", r = ""; for (var i in t) { var s = t[i]; @@ -2431,59 +2431,59 @@ function fa(t, e = !1) { } return r; } -function Ou(t, e) { +function Vu(t, e) { if (e) { var n = "", r, i; - return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += fa(r)), i && (n += fa(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += ha(r)), i && (n += ha(i, !0)), n = n.trim(), n === "" ? null : n; } return String(t); } -function Gi(t, e = {}, n, r) { +function Zi(t, e = {}, n, r) { for (var i in n) { var s = n[i]; e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); } } -function ca(t, e, n, r) { +function da(t, e, n, r) { var i = t.__style; if (J || i !== e) { - var s = Ou(e, r); + var s = Vu(e, r); (!J || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; - } else r && (Array.isArray(r) ? (Gi(t, n == null ? void 0 : n[0], r[0]), Gi(t, n == null ? void 0 : n[1], r[1], "important")) : Gi(t, n, r)); + } else r && (Array.isArray(r) ? (Zi(t, n == null ? void 0 : n[0], r[0]), Zi(t, n == null ? void 0 : n[1], r[1], "important")) : Zi(t, n, r)); return r; } -function ha(t, e) { - return t === e || (t == null ? void 0 : t[Sr]) === e; +function pa(t, e) { + return t === e || (t == null ? void 0 : t[Mr]) === e; } -function si(t = {}, e, n, r) { - return po(() => { +function li(t = {}, e, n, r) { + return go(() => { var i, s; - return Ps(() => { - i = s, s = [], Mi(() => { - t !== n(...s) && (e(t, ...s), i && ha(n(...i), t) && e(null, ...i)); + return Fs(() => { + i = s, s = [], Ii(() => { + t !== n(...s) && (e(t, ...s), i && pa(n(...i), t) && e(null, ...i)); }); }), () => { - kn(() => { - s && ha(n(...s), t) && e(null, ...s); + Pn(() => { + s && pa(n(...s), t) && e(null, ...s); }); }; }), t; } -let Zr = !1; -function Lu(t) { - var e = Zr; +let ti = !1; +function Yu(t) { + var e = ti; try { - return Zr = !1, [t(), Zr]; + return ti = !1, [t(), ti]; } finally { - Zr = e; + ti = e; } } -function pt(t, e, n, r) { - var S; - var i = (n & Rl) !== 0, s = (n & Cl) !== 0, a = ( +function vt(t, e, n, r) { + var k; + var i = (n & Sl) !== 0, s = (n & Nl) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? Mi( + ), o = !0, l = () => (o && (o = !1, a = s ? Ii( /** @type {() => V} */ r ) : ( @@ -2491,15 +2491,15 @@ function pt(t, e, n, r) { r )), a), u; if (i) { - var f = Sr in t || La in t; - u = ((S = Sn(t, e)) == null ? void 0 : S.set) ?? (f && e in t ? (C) => t[e] = C : void 0); + var f = Mr in t || Va in t; + u = ((k = Mn(t, e)) == null ? void 0 : k.set) ?? (f && e in t ? (C) => t[e] = C : void 0); } var h, c = !1; - i ? [h, c] = Lu(() => ( + i ? [h, c] = Yu(() => ( /** @type {V} */ t[e] )) : h = /** @type {V} */ - t[e], h === void 0 && r !== void 0 && (h = l(), u && (Wl(), u(h))); + t[e], h === void 0 && r !== void 0 && (h = l(), u && (Kl(), u(h))); var p; if (p = () => { var C = ( @@ -2507,39 +2507,39 @@ function pt(t, e, n, r) { t[e] ); return C === void 0 ? l() : (o = !0, C); - }, (n & El) === 0) + }, (n & Tl) === 0) return p; if (u) { var g = t.$$legacy; return ( /** @type {() => V} */ - (function(C, P) { - return arguments.length > 0 ? ((!P || g || c) && u(P ? p() : C), C) : p(); + (function(C, D) { + return arguments.length > 0 ? ((!D || g || c) && u(D ? p() : C), C) : p(); }) ); } - var y = !1, $ = ((n & Al) !== 0 ? ki : to)(() => (y = !1, p())); + var y = !1, $ = ((n & Cl) !== 0 ? Di : no)(() => (y = !1, p())); i && x($); - var E = ( + var A = ( /** @type {Effect} */ - W + U ); return ( /** @type {() => V} */ - (function(C, P) { + (function(C, D) { if (arguments.length > 0) { - const k = P ? x($) : i ? xn(C) : C; - return st($, k), y = !0, a !== void 0 && (a = k), C; + const P = D ? x($) : i ? $n(C) : C; + return ot($, P), y = !0, a !== void 0 && (a = P), C; } - return cn && y || (E.f & Je) !== 0 ? $.v : x($); + return pn && y || (A.f & tn) !== 0 ? $.v : x($); }) ); } -function qu(t) { - return new Vu(t); +function Hu(t) { + return new zu(t); } -var Ge, ae; -class Vu { +var je, le; +class zu { /** * @param {ComponentConstructorOptions & { * component: any; @@ -2547,12 +2547,12 @@ class Vu { */ constructor(e) { /** @type {any} */ - L(this, Ge); + q(this, je); /** @type {Record} */ - L(this, ae); + q(this, le); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ io(o, !1, !1); + var l = /* @__PURE__ */ ao(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( @@ -2562,42 +2562,42 @@ class Vu { return x(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === La ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === Va ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return st(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return ot(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - O(this, ae, (e.hydrate ? Su : No)(e.component, { + O(this, le, (e.hydrate ? Pu : ko)(e.component, { target: e.target, anchor: e.anchor, props: i, context: e.context, intro: e.intro ?? !1, recover: e.recover - })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && ft(), O(this, Ge, i.$$events); - for (const a of Object.keys(v(this, ae))) - a === "$set" || a === "$destroy" || a === "$on" || di(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && ct(), O(this, je, i.$$events); + for (const a of Object.keys(v(this, le))) + a === "$set" || a === "$destroy" || a === "$on" || gi(this, a, { get() { - return v(this, ae)[a]; + return v(this, le)[a]; }, /** @param {any} value */ set(o) { - v(this, ae)[a] = o; + v(this, le)[a] = o; }, enumerable: !0 }); - v(this, ae).$set = /** @param {Record} next */ + v(this, le).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, ae).$destroy = () => { - ku(v(this, ae)); + }, v(this, le).$destroy = () => { + Du(v(this, le)); }; } /** @param {Record} props */ $set(e) { - v(this, ae).$set(e); + v(this, le).$set(e); } /** * @param {string} event @@ -2605,22 +2605,22 @@ class Vu { * @returns {any} */ $on(e, n) { - v(this, Ge)[e] = v(this, Ge)[e] || []; + v(this, je)[e] = v(this, je)[e] || []; const r = (...i) => n.call(this, ...i); - return v(this, Ge)[e].push(r), () => { - v(this, Ge)[e] = v(this, Ge)[e].filter( + return v(this, je)[e].push(r), () => { + v(this, je)[e] = v(this, je)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, ae).$destroy(); + v(this, le).$destroy(); } } -Ge = new WeakMap(), ae = new WeakMap(); -let Po; -typeof HTMLElement == "function" && (Po = class extends HTMLElement { +je = new WeakMap(), le = new WeakMap(); +let Do; +typeof HTMLElement == "function" && (Do = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -2629,27 +2629,27 @@ typeof HTMLElement == "function" && (Po = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - it(this, "$$ctor"); + st(this, "$$ctor"); /** Slots */ - it(this, "$$s"); + st(this, "$$s"); /** @type {any} The Svelte component instance */ - it(this, "$$c"); + st(this, "$$c"); /** Whether or not the custom element is connected */ - it(this, "$$cn", !1); + st(this, "$$cn", !1); /** @type {Record} Component props data */ - it(this, "$$d", {}); + st(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - it(this, "$$r", !1); + st(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - it(this, "$$p_d", {}); + st(this, "$$p_d", {}); /** @type {Record} Event listeners */ - it(this, "$$l", {}); + st(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - it(this, "$$l_u", /* @__PURE__ */ new Map()); + st(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - it(this, "$$me"); + st(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - it(this, "$$shadowRoot", null); + st(this, "$$shadowRoot", null); this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** @@ -2679,23 +2679,23 @@ typeof HTMLElement == "function" && (Po = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const o = Ns("slot"); - s !== "default" && (o.name = s), ve(a, o); + const o = Ms("slot"); + s !== "default" && (o.name = s), _e(a, o); }; }; var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = Yu(this); + const r = {}, i = Xu(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] = ai(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = ui(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 = qu({ + this.$$c = Hu({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2703,14 +2703,14 @@ typeof HTMLElement == "function" && (Po = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = _u(() => { - Ps(() => { + }), this.$$me = wu(() => { + Fs(() => { var s; this.$$r = !0; - for (const a of hi(this.$$c)) { + for (const a of vi(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = ai( + const o = ui( a, this.$$d[a], this.$$p_d, @@ -2738,7 +2738,7 @@ typeof HTMLElement == "function" && (Po = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = ai(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + this.$$r || (e = this.$$g_p(e), this.$$d[e] = ui(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2749,12 +2749,12 @@ typeof HTMLElement == "function" && (Po = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return hi(this.$$p_d).find( + return vi(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function ai(t, e, n, r) { +function ui(t, e, n, r) { var s; const i = (s = n[t]) == null ? void 0 : s.type; if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) @@ -2785,7 +2785,7 @@ function ai(t, e, n, r) { return e; } } -function Yu(t) { +function Xu(t) { const e = {}; return t.childNodes.forEach((n) => { e[ @@ -2794,34 +2794,34 @@ function Yu(t) { ] = !0; }), e; } -function Mo(t, e, n, r, i, s) { - let a = class extends Po { +function Fo(t, e, n, r, i, s) { + let a = class extends Do { constructor() { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return hi(e).map( + return vi(e).map( (o) => (e[o].attribute || o).toLowerCase() ); } }; - return hi(e).forEach((o) => { - di(a.prototype, o, { + return vi(e).forEach((o) => { + gi(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { var h; - l = ai(o, l, e), this.$$d[o] = l; + l = ui(o, l, e), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (h = Sn(u, o)) == null ? void 0 : h.get; + var f = (h = Mn(u, o)) == null ? void 0 : h.get; f ? u[o] = l : u.$set({ [o]: l }); } } }); }), r.forEach((o) => { - di(a.prototype, o, { + gi(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; @@ -2830,43 +2830,43 @@ function Mo(t, e, n, r, i, s) { }), t.element = /** @type {any} */ a, a; } -var Hu = { value: () => { +var Bu = { value: () => { } }; -function Do() { +function Io() { for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } - return new oi(n); + return new fi(n); } -function oi(t) { +function fi(t) { this._ = t; } -function zu(t, e) { +function Wu(t, e) { return t.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 && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } -oi.prototype = Do.prototype = { - constructor: oi, +fi.prototype = Io.prototype = { + constructor: fi, on: function(t, e) { - var n = this._, r = zu(t + "", n), i, s = -1, a = r.length; + var n = this._, r = Wu(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Xu(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Uu(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++s < a; ) - if (i = (t = r[s]).type) n[i] = da(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = da(n[i], t.name, null); + if (i = (t = r[s]).type) n[i] = va(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = va(n[i], t.name, null); return this; }, copy: function() { var t = {}, e = this._; for (var n in e) t[n] = e[n].slice(); - return new oi(t); + return new fi(t); }, call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; @@ -2878,135 +2878,135 @@ oi.prototype = Do.prototype = { for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function Xu(t, e) { +function Uu(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } -function da(t, e, n) { +function va(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { - t[r] = Hu, t = t.slice(0, r).concat(t.slice(r + 1)); + t[r] = Bu, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } -var ds = "http://www.w3.org/1999/xhtml"; -const pa = { +var gs = "http://www.w3.org/1999/xhtml"; +const ga = { svg: "http://www.w3.org/2000/svg", - xhtml: ds, + xhtml: gs, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Di(t) { +function Oi(t) { var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), pa.hasOwnProperty(e) ? { space: pa[e], local: t } : t; + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), ga.hasOwnProperty(e) ? { space: ga[e], local: t } : t; } -function Bu(t) { +function Gu(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; - return n === ds && e.documentElement.namespaceURI === ds ? e.createElement(t) : e.createElementNS(n, t); + return n === gs && e.documentElement.namespaceURI === gs ? e.createElement(t) : e.createElementNS(n, t); }; } -function Wu(t) { +function Ku(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } -function Fo(t) { - var e = Di(t); - return (e.local ? Wu : Bu)(e); +function Oo(t) { + var e = Oi(t); + return (e.local ? Ku : Gu)(e); } -function Uu() { +function Ju() { } -function Is(t) { - return t == null ? Uu : function() { +function qs(t) { + return t == null ? Ju : function() { return this.querySelector(t); }; } -function Gu(t) { - typeof t != "function" && (t = Is(t)); +function Zu(t) { + typeof t != "function" && (t = qs(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new ne(r, this._parents); + return new re(r, this._parents); } -function Ku(t) { +function ju(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function Ju() { +function Qu() { return []; } -function Io(t) { - return t == null ? Ju : function() { +function Lo(t) { + return t == null ? Qu : function() { return this.querySelectorAll(t); }; } -function Zu(t) { +function tf(t) { return function() { - return Ku(t.apply(this, arguments)); + return ju(t.apply(this, arguments)); }; } -function ju(t) { - typeof t == "function" ? t = Zu(t) : t = Io(t); +function ef(t) { + typeof t == "function" ? t = tf(t) : t = Lo(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); - return new ne(r, i); + return new re(r, i); } -function Oo(t) { +function qo(t) { return function() { return this.matches(t); }; } -function Lo(t) { +function Vo(t) { return function(e) { return e.matches(t); }; } -var Qu = Array.prototype.find; -function tf(t) { +var nf = Array.prototype.find; +function rf(t) { return function() { - return Qu.call(this.children, t); + return nf.call(this.children, t); }; } -function ef() { +function sf() { return this.firstElementChild; } -function nf(t) { - return this.select(t == null ? ef : tf(typeof t == "function" ? t : Lo(t))); +function af(t) { + return this.select(t == null ? sf : rf(typeof t == "function" ? t : Vo(t))); } -var rf = Array.prototype.filter; -function sf() { +var of = Array.prototype.filter; +function lf() { return Array.from(this.children); } -function af(t) { +function uf(t) { return function() { - return rf.call(this.children, t); + return of.call(this.children, t); }; } -function of(t) { - return this.selectAll(t == null ? sf : af(typeof t == "function" ? t : Lo(t))); +function ff(t) { + return this.selectAll(t == null ? lf : uf(typeof t == "function" ? t : Vo(t))); } -function lf(t) { - typeof t != "function" && (t = Oo(t)); +function cf(t) { + typeof t != "function" && (t = qo(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new ne(r, this._parents); + return new re(r, this._parents); } -function qo(t) { +function Yo(t) { return new Array(t.length); } -function uf() { - return new ne(this._enter || this._groups.map(qo), this._parents); +function hf() { + return new re(this._enter || this._groups.map(Yo), this._parents); } -function vi(t, e) { +function mi(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -vi.prototype = { - constructor: vi, +mi.prototype = { + constructor: mi, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -3020,70 +3020,70 @@ vi.prototype = { return this._parent.querySelectorAll(t); } }; -function ff(t) { +function df(t) { return function() { return t; }; } -function cf(t, e, n, r, i, s) { +function pf(t, e, n, r, i, s) { for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new vi(t, s[a]); + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new mi(t, s[a]); for (; a < l; ++a) (o = e[a]) && (i[a] = o); } -function hf(t, e, n, r, i, s, a) { +function vf(t, e, n, r, i, s, a) { var o, l, u = /* @__PURE__ */ new Map(), f = e.length, h = s.length, c = new Array(f), p; for (o = 0; o < f; ++o) (l = e[o]) && (c[o] = p = a.call(l, l.__data__, o, e) + "", u.has(p) ? i[o] = l : u.set(p, l)); for (o = 0; o < h; ++o) - p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new vi(t, s[o]); + p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new mi(t, s[o]); for (o = 0; o < f; ++o) (l = e[o]) && u.get(c[o]) === l && (i[o] = l); } -function df(t) { +function gf(t) { return t.__data__; } -function pf(t, e) { - if (!arguments.length) return Array.from(this, df); - var n = e ? hf : cf, r = this._parents, i = this._groups; - typeof t != "function" && (t = ff(t)); +function _f(t, e) { + if (!arguments.length) return Array.from(this, gf); + var n = e ? vf : pf, r = this._parents, i = this._groups; + typeof t != "function" && (t = df(t)); 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], h = i[u], c = h.length, p = vf(t.call(f, f && f.__data__, u, r)), g = p.length, y = o[u] = new Array(g), $ = a[u] = new Array(g), E = l[u] = new Array(c); - n(f, h, y, $, E, p, e); - for (var S = 0, C = 0, P, k; S < g; ++S) - if (P = y[S]) { - for (S >= C && (C = S + 1); !(k = $[C]) && ++C < g; ) ; - P._next = k || null; + var f = r[u], h = i[u], c = h.length, p = mf(t.call(f, f && f.__data__, u, r)), g = p.length, y = o[u] = new Array(g), $ = a[u] = new Array(g), A = l[u] = new Array(c); + n(f, h, y, $, A, p, e); + for (var k = 0, C = 0, D, P; k < g; ++k) + if (D = y[k]) { + for (k >= C && (C = k + 1); !(P = $[C]) && ++C < g; ) ; + D._next = P || null; } } - return a = new ne(a, r), a._enter = o, a._exit = l, a; + return a = new re(a, r), a._enter = o, a._exit = l, a; } -function vf(t) { +function mf(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function gf() { - return new ne(this._exit || this._groups.map(qo), this._parents); +function yf() { + return new re(this._exit || this._groups.map(Yo), this._parents); } -function _f(t, e, n) { +function wf(t, e, n) { var r = this.enter(), i = this, s = this.exit(); return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function mf(t) { +function xf(t) { for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._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], h = u.length, c = o[l] = new Array(h), p, g = 0; g < h; ++g) (p = u[g] || f[g]) && (c[g] = p); for (; l < i; ++l) o[l] = n[l]; - return new ne(o, this._parents); + return new re(o, this._parents); } -function yf() { +function bf() { for (var t = this._groups, e = -1, n = t.length; ++e < n; ) for (var r = t[e], 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 wf(t) { - t || (t = xf); +function $f(t) { + t || (t = Af); function e(h, c) { return h && c ? t(h.__data__, c.__data__) : !h - !c; } @@ -3092,19 +3092,19 @@ function wf(t) { (u = a[f]) && (l[f] = u); l.sort(e); } - return new ne(i, this._parents).order(); + return new re(i, this._parents).order(); } -function xf(t, e) { +function Af(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function bf() { +function Ef() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } -function $f() { +function Rf() { return Array.from(this); } -function Af() { +function Cf() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length; i < s; ++i) { var a = r[i]; @@ -3112,114 +3112,114 @@ function Af() { } return null; } -function Ef() { +function Tf() { let t = 0; for (const e of this) ++t; return t; } -function Rf() { +function Sf() { return !this.node(); } -function Cf(t) { +function Nf(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) (o = i[s]) && t.call(o, o.__data__, s, i); return this; } -function Tf(t) { +function kf(t) { return function() { this.removeAttribute(t); }; } -function Nf(t) { +function Mf(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function Sf(t, e) { +function Pf(t, e) { return function() { this.setAttribute(t, e); }; } -function kf(t, e) { +function Df(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } -function Pf(t, e) { +function Ff(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function Mf(t, e) { +function If(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); }; } -function Df(t, e) { - var n = Di(t); +function Of(t, e) { + var n = Oi(t); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((e == null ? n.local ? Nf : Tf : typeof e == "function" ? n.local ? Mf : Pf : n.local ? kf : Sf)(n, e)); + return this.each((e == null ? n.local ? Mf : kf : typeof e == "function" ? n.local ? If : Ff : n.local ? Df : Pf)(n, e)); } -function Vo(t) { +function Ho(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function Ff(t) { +function Lf(t) { return function() { this.style.removeProperty(t); }; } -function If(t, e, n) { +function qf(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } -function Of(t, e, n) { +function Vf(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function Lf(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? Ff : typeof e == "function" ? Of : If)(t, e, n ?? "")) : dr(this.node(), t); +function Yf(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? Lf : typeof e == "function" ? Vf : qf)(t, e, n ?? "")) : pr(this.node(), t); } -function dr(t, e) { - return t.style.getPropertyValue(e) || Vo(t).getComputedStyle(t, null).getPropertyValue(e); +function pr(t, e) { + return t.style.getPropertyValue(e) || Ho(t).getComputedStyle(t, null).getPropertyValue(e); } -function qf(t) { +function Hf(t) { return function() { delete this[t]; }; } -function Vf(t, e) { +function zf(t, e) { return function() { this[t] = e; }; } -function Yf(t, e) { +function Xf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } -function Hf(t, e) { - return arguments.length > 1 ? this.each((e == null ? qf : typeof e == "function" ? Yf : Vf)(t, e)) : this.node()[t]; +function Bf(t, e) { + return arguments.length > 1 ? this.each((e == null ? Hf : typeof e == "function" ? Xf : zf)(t, e)) : this.node()[t]; } -function Yo(t) { +function zo(t) { return t.trim().split(/^|\s+/); } -function Os(t) { - return t.classList || new Ho(t); +function Vs(t) { + return t.classList || new Xo(t); } -function Ho(t) { - this._node = t, this._names = Yo(t.getAttribute("class") || ""); +function Xo(t) { + this._node = t, this._names = zo(t.getAttribute("class") || ""); } -Ho.prototype = { +Xo.prototype = { add: function(t) { var e = this._names.indexOf(t); e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); @@ -3232,129 +3232,129 @@ Ho.prototype = { return this._names.indexOf(t) >= 0; } }; -function zo(t, e) { - for (var n = Os(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +function Bo(t, e) { + for (var n = Vs(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function Xo(t, e) { - for (var n = Os(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +function Wo(t, e) { + for (var n = Vs(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function zf(t) { +function Wf(t) { return function() { - zo(this, t); + Bo(this, t); }; } -function Xf(t) { +function Uf(t) { return function() { - Xo(this, t); + Wo(this, t); }; } -function Bf(t, e) { +function Gf(t, e) { return function() { - (e.apply(this, arguments) ? zo : Xo)(this, t); + (e.apply(this, arguments) ? Bo : Wo)(this, t); }; } -function Wf(t, e) { - var n = Yo(t + ""); +function Kf(t, e) { + var n = zo(t + ""); if (arguments.length < 2) { - for (var r = Os(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Vs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? Bf : e ? zf : Xf)(n, e)); + return this.each((typeof e == "function" ? Gf : e ? Wf : Uf)(n, e)); } -function Uf() { +function Jf() { this.textContent = ""; } -function Gf(t) { +function Zf(t) { return function() { this.textContent = t; }; } -function Kf(t) { +function jf(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } -function Jf(t) { - return arguments.length ? this.each(t == null ? Uf : (typeof t == "function" ? Kf : Gf)(t)) : this.node().textContent; +function Qf(t) { + return arguments.length ? this.each(t == null ? Jf : (typeof t == "function" ? jf : Zf)(t)) : this.node().textContent; } -function Zf() { +function tc() { this.innerHTML = ""; } -function jf(t) { +function ec(t) { return function() { this.innerHTML = t; }; } -function Qf(t) { +function nc(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } -function tc(t) { - return arguments.length ? this.each(t == null ? Zf : (typeof t == "function" ? Qf : jf)(t)) : this.node().innerHTML; +function rc(t) { + return arguments.length ? this.each(t == null ? tc : (typeof t == "function" ? nc : ec)(t)) : this.node().innerHTML; } -function ec() { +function ic() { this.nextSibling && this.parentNode.appendChild(this); } -function nc() { - return this.each(ec); +function sc() { + return this.each(ic); } -function rc() { +function ac() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function ic() { - return this.each(rc); +function oc() { + return this.each(ac); } -function sc(t) { - var e = typeof t == "function" ? t : Fo(t); +function lc(t) { + var e = typeof t == "function" ? t : Oo(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function ac() { +function uc() { return null; } -function oc(t, e) { - var n = typeof t == "function" ? t : Fo(t), r = e == null ? ac : typeof e == "function" ? e : Is(e); +function fc(t, e) { + var n = typeof t == "function" ? t : Oo(t), r = e == null ? uc : typeof e == "function" ? e : qs(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function lc() { +function cc() { var t = this.parentNode; t && t.removeChild(this); } -function uc() { - return this.each(lc); +function hc() { + return this.each(cc); } -function fc() { +function dc() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function cc() { +function pc() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function hc(t) { - return this.select(t ? cc : fc); +function vc(t) { + return this.select(t ? pc : dc); } -function dc(t) { +function gc(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } -function pc(t) { +function _c(t) { return function(e) { t.call(this, e, this.__data__); }; } -function vc(t) { +function mc(t) { return t.trim().split(/^|\s+/).map(function(e) { var n = "", r = e.indexOf("."); return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n }; }); } -function gc(t) { +function yc(t) { return function() { var e = this.__on; if (e) { @@ -3364,9 +3364,9 @@ function gc(t) { } }; } -function _c(t, e, n) { +function wc(t, e, n) { return function() { - var r = this.__on, i, s = pc(e); + var r = this.__on, i, s = _c(e); if (r) { for (var a = 0, o = r.length; a < o; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { @@ -3377,8 +3377,8 @@ function _c(t, e, n) { this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function mc(t, e, n) { - var r = vc(t + ""), i, s = r.length, a; +function xc(t, e, n) { + var r = mc(t + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3389,93 +3389,93 @@ function mc(t, e, n) { } return; } - for (o = e ? _c : gc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + for (o = e ? wc : yc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); return this; } -function Bo(t, e, n) { - var r = Vo(t), i = r.CustomEvent; +function Uo(t, e, n) { + var r = Ho(t), i = r.CustomEvent; typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); } -function yc(t, e) { +function bc(t, e) { return function() { - return Bo(this, t, e); + return Uo(this, t, e); }; } -function wc(t, e) { +function $c(t, e) { return function() { - return Bo(this, t, e.apply(this, arguments)); + return Uo(this, t, e.apply(this, arguments)); }; } -function xc(t, e) { - return this.each((typeof e == "function" ? wc : yc)(t, e)); +function Ac(t, e) { + return this.each((typeof e == "function" ? $c : bc)(t, e)); } -function* bc() { +function* Ec() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var Wo = [null]; -function ne(t, e) { +var Go = [null]; +function re(t, e) { this._groups = t, this._parents = e; } -function _r() { - return new ne([[document.documentElement]], Wo); +function mr() { + return new re([[document.documentElement]], Go); } -function $c() { +function Rc() { return this; } -ne.prototype = _r.prototype = { - constructor: ne, - select: Gu, - selectAll: ju, - selectChild: nf, - selectChildren: of, - filter: lf, - data: pf, - enter: uf, - exit: gf, - join: _f, - merge: mf, - selection: $c, - order: yf, - sort: wf, - call: bf, - nodes: $f, - node: Af, - size: Ef, - empty: Rf, - each: Cf, - attr: Df, - style: Lf, - property: Hf, - classed: Wf, - text: Jf, - html: tc, - raise: nc, - lower: ic, - append: sc, - insert: oc, - remove: uc, - clone: hc, - datum: dc, - on: mc, - dispatch: xc, - [Symbol.iterator]: bc +re.prototype = mr.prototype = { + constructor: re, + select: Zu, + selectAll: ef, + selectChild: af, + selectChildren: ff, + filter: cf, + data: _f, + enter: hf, + exit: yf, + join: wf, + merge: xf, + selection: Rc, + order: bf, + sort: $f, + call: Ef, + nodes: Rf, + node: Cf, + size: Tf, + empty: Sf, + each: Nf, + attr: Of, + style: Yf, + property: Bf, + classed: Kf, + text: Qf, + html: rc, + raise: sc, + lower: oc, + append: lc, + insert: fc, + remove: hc, + clone: vc, + datum: gc, + on: xc, + dispatch: Ac, + [Symbol.iterator]: Ec }; -function ut(t) { - return typeof t == "string" ? new ne([[document.querySelector(t)]], [document.documentElement]) : new ne([[t]], Wo); +function at(t) { + return typeof t == "string" ? new re([[document.querySelector(t)]], [document.documentElement]) : new re([[t]], Go); } -function Ls(t, e, n) { +function Ys(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } -function Uo(t, e) { +function Ko(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } -function Wr() { +function Gr() { } -var Fr = 0.7, gi = 1 / Fr, jn = "\\s*([+-]?\\d+)\\s*", Ir = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Me = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Ac = /^#([0-9a-f]{3,8})$/, Ec = new RegExp(`^rgb\\(${jn},${jn},${jn}\\)$`), Rc = new RegExp(`^rgb\\(${Me},${Me},${Me}\\)$`), Cc = new RegExp(`^rgba\\(${jn},${jn},${jn},${Ir}\\)$`), Tc = new RegExp(`^rgba\\(${Me},${Me},${Me},${Ir}\\)$`), Nc = new RegExp(`^hsl\\(${Ir},${Me},${Me}\\)$`), Sc = new RegExp(`^hsla\\(${Ir},${Me},${Me},${Ir}\\)$`), va = { +var Or = 0.7, yi = 1 / Or, Qn = "\\s*([+-]?\\d+)\\s*", Lr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Fe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Cc = /^#([0-9a-f]{3,8})$/, Tc = new RegExp(`^rgb\\(${Qn},${Qn},${Qn}\\)$`), Sc = new RegExp(`^rgb\\(${Fe},${Fe},${Fe}\\)$`), Nc = new RegExp(`^rgba\\(${Qn},${Qn},${Qn},${Lr}\\)$`), kc = new RegExp(`^rgba\\(${Fe},${Fe},${Fe},${Lr}\\)$`), Mc = new RegExp(`^hsl\\(${Lr},${Fe},${Fe}\\)$`), Pc = new RegExp(`^hsla\\(${Lr},${Fe},${Fe},${Lr}\\)$`), _a = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3625,178 +3625,178 @@ var Fr = 0.7, gi = 1 / Fr, jn = "\\s*([+-]?\\d+)\\s*", Ir = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Ls(Wr, qn, { +Ys(Gr, Yn, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, - hex: ga, + hex: ma, // Deprecated! Use color.formatHex. - formatHex: ga, - formatHex8: kc, - formatHsl: Pc, - formatRgb: _a, - toString: _a + formatHex: ma, + formatHex8: Dc, + formatHsl: Fc, + formatRgb: ya, + toString: ya }); -function ga() { +function ma() { return this.rgb().formatHex(); } -function kc() { +function Dc() { return this.rgb().formatHex8(); } -function Pc() { - return Go(this).formatHsl(); +function Fc() { + return Jo(this).formatHsl(); } -function _a() { +function ya() { return this.rgb().formatRgb(); } -function qn(t) { +function Yn(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = Ac.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? ma(e) : n === 3 ? new Ht(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? jr(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? jr(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Ec.exec(t)) ? new Ht(e[1], e[2], e[3], 1) : (e = Rc.exec(t)) ? new Ht(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Cc.exec(t)) ? jr(e[1], e[2], e[3], e[4]) : (e = Tc.exec(t)) ? jr(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Nc.exec(t)) ? xa(e[1], e[2] / 100, e[3] / 100, 1) : (e = Sc.exec(t)) ? xa(e[1], e[2] / 100, e[3] / 100, e[4]) : va.hasOwnProperty(t) ? ma(va[t]) : t === "transparent" ? new Ht(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = Cc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? wa(e) : n === 3 ? new Ht(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? ei(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? ei(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Tc.exec(t)) ? new Ht(e[1], e[2], e[3], 1) : (e = Sc.exec(t)) ? new Ht(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Nc.exec(t)) ? ei(e[1], e[2], e[3], e[4]) : (e = kc.exec(t)) ? ei(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Mc.exec(t)) ? $a(e[1], e[2] / 100, e[3] / 100, 1) : (e = Pc.exec(t)) ? $a(e[1], e[2] / 100, e[3] / 100, e[4]) : _a.hasOwnProperty(t) ? wa(_a[t]) : t === "transparent" ? new Ht(NaN, NaN, NaN, 0) : null; } -function ma(t) { +function wa(t) { return new Ht(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function jr(t, e, n, r) { +function ei(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new Ht(t, e, n, r); } -function Mc(t) { - return t instanceof Wr || (t = qn(t)), t ? (t = t.rgb(), new Ht(t.r, t.g, t.b, t.opacity)) : new Ht(); +function Ic(t) { + return t instanceof Gr || (t = Yn(t)), t ? (t = t.rgb(), new Ht(t.r, t.g, t.b, t.opacity)) : new Ht(); } -function ps(t, e, n, r) { - return arguments.length === 1 ? Mc(t) : new Ht(t, e, n, r ?? 1); +function _s(t, e, n, r) { + return arguments.length === 1 ? Ic(t) : new Ht(t, e, n, r ?? 1); } function Ht(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -Ls(Ht, ps, Uo(Wr, { +Ys(Ht, _s, Ko(Gr, { brighter(t) { - return t = t == null ? gi : Math.pow(gi, t), new Ht(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? yi : Math.pow(yi, t), new Ht(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? Fr : Math.pow(Fr, t), new Ht(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Or : Math.pow(Or, t), new Ht(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new Ht(Dn(this.r), Dn(this.g), Dn(this.b), _i(this.opacity)); + return new Ht(In(this.r), In(this.g), In(this.b), wi(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: ya, + hex: xa, // Deprecated! Use color.formatHex. - formatHex: ya, - formatHex8: Dc, - formatRgb: wa, - toString: wa + formatHex: xa, + formatHex8: Oc, + formatRgb: ba, + toString: ba })); -function ya() { - return `#${$n(this.r)}${$n(this.g)}${$n(this.b)}`; +function xa() { + return `#${En(this.r)}${En(this.g)}${En(this.b)}`; } -function Dc() { - return `#${$n(this.r)}${$n(this.g)}${$n(this.b)}${$n((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function Oc() { + return `#${En(this.r)}${En(this.g)}${En(this.b)}${En((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function wa() { - const t = _i(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${Dn(this.r)}, ${Dn(this.g)}, ${Dn(this.b)}${t === 1 ? ")" : `, ${t})`}`; +function ba() { + const t = wi(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${In(this.r)}, ${In(this.g)}, ${In(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function _i(t) { +function wi(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function Dn(t) { +function In(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function $n(t) { - return t = Dn(t), (t < 16 ? "0" : "") + t.toString(16); +function En(t) { + return t = In(t), (t < 16 ? "0" : "") + t.toString(16); } -function xa(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new _e(t, e, n, r); +function $a(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new ye(t, e, n, r); } -function Go(t) { - if (t instanceof _e) return new _e(t.h, t.s, t.l, t.opacity); - if (t instanceof Wr || (t = qn(t)), !t) return new _e(); - if (t instanceof _e) return t; +function Jo(t) { + if (t instanceof ye) return new ye(t.h, t.s, t.l, t.opacity); + if (t instanceof Gr || (t = Yn(t)), !t) return new ye(); + if (t instanceof ye) return t; t = t.rgb(); var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new _e(a, o, l, t.opacity); + return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new ye(a, o, l, t.opacity); } -function Fc(t, e, n, r) { - return arguments.length === 1 ? Go(t) : new _e(t, e, n, r ?? 1); +function Lc(t, e, n, r) { + return arguments.length === 1 ? Jo(t) : new ye(t, e, n, r ?? 1); } -function _e(t, e, n, r) { +function ye(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -Ls(_e, Fc, Uo(Wr, { +Ys(ye, Lc, Ko(Gr, { brighter(t) { - return t = t == null ? gi : Math.pow(gi, t), new _e(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? yi : Math.pow(yi, t), new ye(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? Fr : Math.pow(Fr, t), new _e(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Or : Math.pow(Or, t), new ye(this.h, this.s, this.l * t, this.opacity); }, rgb() { var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; return new Ht( - Ki(t >= 240 ? t - 240 : t + 120, i, r), - Ki(t, i, r), - Ki(t < 120 ? t + 240 : t - 120, i, r), + ji(t >= 240 ? t - 240 : t + 120, i, r), + ji(t, i, r), + ji(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new _e(ba(this.h), Qr(this.s), Qr(this.l), _i(this.opacity)); + return new ye(Aa(this.h), ni(this.s), ni(this.l), wi(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 t = _i(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${ba(this.h)}, ${Qr(this.s) * 100}%, ${Qr(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = wi(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${Aa(this.h)}, ${ni(this.s) * 100}%, ${ni(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function ba(t) { +function Aa(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function Qr(t) { +function ni(t) { return Math.max(0, Math.min(1, t || 0)); } -function Ki(t, e, n) { +function ji(t, e, n) { return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; } -const qs = (t) => () => t; -function Ic(t, e) { +const Hs = (t) => () => t; +function qc(t, e) { return function(n) { return t + n * e; }; } -function Oc(t, e, n) { +function Vc(t, e, n) { return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) { return Math.pow(t + r * e, n); }; } -function Lc(t) { - return (t = +t) == 1 ? Ko : function(e, n) { - return n - e ? Oc(e, n, t) : qs(isNaN(e) ? n : e); +function Yc(t) { + return (t = +t) == 1 ? Zo : function(e, n) { + return n - e ? Vc(e, n, t) : Hs(isNaN(e) ? n : e); }; } -function Ko(t, e) { +function Zo(t, e) { var n = e - t; - return n ? Ic(t, n) : qs(isNaN(t) ? e : t); + return n ? qc(t, n) : Hs(isNaN(t) ? e : t); } -const mi = (function t(e) { - var n = Lc(e); +const xi = (function t(e) { + var n = Yc(e); function r(i, s) { - var a = n((i = ps(i)).r, (s = ps(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Ko(i.opacity, s.opacity); + var a = n((i = _s(i)).r, (s = _s(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Zo(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 = t, r; })(1); -function qc(t, e) { +function Hc(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { @@ -3804,64 +3804,64 @@ function qc(t, e) { return r; }; } -function Vc(t) { +function zc(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function Yc(t, e) { +function Xc(t, e) { var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Jn(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = Ue(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function Hc(t, e) { +function Bc(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; }; } -function Pe(t, e) { +function De(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } -function zc(t, e) { +function Wc(t, e) { var n = {}, r = {}, i; (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); for (i in e) - i in t ? n[i] = Jn(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = Ue(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var vs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Ji = new RegExp(vs.source, "g"); -function Xc(t) { +var ms = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Qi = new RegExp(ms.source, "g"); +function Uc(t) { return function() { return t; }; } -function Bc(t) { +function Gc(t) { return function(e) { return t(e) + ""; }; } -function Jo(t, e) { - var n = vs.lastIndex = Ji.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = vs.exec(t)) && (i = Ji.exec(e)); ) - (s = i.index) > n && (s = e.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: Pe(r, i) })), n = Ji.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Bc(l[0].x) : Xc(e) : (e = l.length, function(u) { +function jo(t, e) { + var n = ms.lastIndex = Qi.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (t = t + "", e = e + ""; (r = ms.exec(t)) && (i = Qi.exec(e)); ) + (s = i.index) > n && (s = e.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: De(r, i) })), n = Qi.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Gc(l[0].x) : Uc(e) : (e = l.length, function(u) { for (var f = 0, h; f < e; ++f) o[(h = l[f]).i] = h.x(u); return o.join(""); }); } -function Jn(t, e) { +function Ue(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? qs(e) : (n === "number" ? Pe : n === "string" ? (r = qn(e)) ? (e = r, mi) : Jo : e instanceof qn ? mi : e instanceof Date ? Hc : Vc(e) ? qc : Array.isArray(e) ? Yc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? zc : Pe)(t, e); + return e == null || n === "boolean" ? Hs(e) : (n === "number" ? De : n === "string" ? (r = Yn(e)) ? (e = r, xi) : jo : e instanceof Yn ? xi : e instanceof Date ? Bc : zc(e) ? Hc : Array.isArray(e) ? Xc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Wc : De)(t, e); } -var $a = 180 / Math.PI, gs = { +var Ea = 180 / Math.PI, ys = { translateX: 0, translateY: 0, rotate: 0, @@ -3869,45 +3869,45 @@ var $a = 180 / Math.PI, gs = { scaleX: 1, scaleY: 1 }; -function Zo(t, e, n, r, i, s) { +function Qo(t, e, n, r, i, s) { var a, o, l; return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(e, t) * $a, - skewX: Math.atan(l) * $a, + rotate: Math.atan2(e, t) * Ea, + skewX: Math.atan(l) * Ea, scaleX: a, scaleY: o }; } -var ti; -function Wc(t) { +var ri; +function Kc(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? gs : Zo(e.a, e.b, e.c, e.d, e.e, e.f); + return e.isIdentity ? ys : Qo(e.a, e.b, e.c, e.d, e.e, e.f); } -function Uc(t) { - return t == null || (ti || (ti = document.createElementNS("http://www.w3.org/2000/svg", "g")), ti.setAttribute("transform", t), !(t = ti.transform.baseVal.consolidate())) ? gs : (t = t.matrix, Zo(t.a, t.b, t.c, t.d, t.e, t.f)); +function Jc(t) { + return t == null || (ri || (ri = document.createElementNS("http://www.w3.org/2000/svg", "g")), ri.setAttribute("transform", t), !(t = ri.transform.baseVal.consolidate())) ? ys : (t = t.matrix, Qo(t.a, t.b, t.c, t.d, t.e, t.f)); } -function jo(t, e, n, r) { +function tl(t, e, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } function s(u, f, h, c, p, g) { if (u !== h || f !== c) { var y = p.push("translate(", null, e, null, n); - g.push({ i: y - 4, x: Pe(u, h) }, { i: y - 2, x: Pe(f, c) }); + g.push({ i: y - 4, x: De(u, h) }, { i: y - 2, x: De(f, c) }); } else (h || c) && p.push("translate(" + h + e + c + n); } function a(u, f, h, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Pe(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: De(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); } function o(u, f, h, c) { - u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Pe(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); + u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: De(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); } function l(u, f, h, c, p, g) { if (u !== h || f !== c) { var y = p.push(i(p) + "scale(", null, ",", null, ")"); - g.push({ i: y - 4, x: Pe(u, h) }, { i: y - 2, x: Pe(f, c) }); + g.push({ i: y - 4, x: De(u, h) }, { i: y - 2, x: De(f, c) }); } else (h !== 1 || c !== 1) && p.push(i(p) + "scale(" + h + "," + c + ")"); } return function(u, f) { @@ -3918,138 +3918,138 @@ function jo(t, e, n, r) { }; }; } -var Gc = jo(Wc, "px, ", "px)", "deg)"), Kc = jo(Uc, ", ", ")", ")"), pr = 0, Cr = 0, Er = 0, Qo = 1e3, yi, Tr, wi = 0, Vn = 0, Fi = 0, Or = typeof performance == "object" && performance.now ? performance : Date, tl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Zc = tl(Kc, "px, ", "px)", "deg)"), jc = tl(Jc, ", ", ")", ")"), vr = 0, Sr = 0, Cr = 0, el = 1e3, bi, Nr, $i = 0, Hn = 0, Li = 0, qr = typeof performance == "object" && performance.now ? performance : Date, nl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; -function Vs() { - return Vn || (tl(Jc), Vn = Or.now() + Fi); +function zs() { + return Hn || (nl(Qc), Hn = qr.now() + Li); } -function Jc() { - Vn = 0; +function Qc() { + Hn = 0; } -function xi() { +function Ai() { this._call = this._time = this._next = null; } -xi.prototype = el.prototype = { - constructor: xi, +Ai.prototype = rl.prototype = { + constructor: Ai, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Vs() : +n) + (e == null ? 0 : +e), !this._next && Tr !== this && (Tr ? Tr._next = this : yi = this, Tr = this), this._call = t, this._time = n, _s(); + n = (n == null ? zs() : +n) + (e == null ? 0 : +e), !this._next && Nr !== this && (Nr ? Nr._next = this : bi = this, Nr = this), this._call = t, this._time = n, ws(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, _s()); + this._call && (this._call = null, this._time = 1 / 0, ws()); } }; -function el(t, e, n) { - var r = new xi(); +function rl(t, e, n) { + var r = new Ai(); return r.restart(t, e, n), r; } -function Zc() { - Vs(), ++pr; - for (var t = yi, e; t; ) - (e = Vn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --pr; +function th() { + zs(), ++vr; + for (var t = bi, e; t; ) + (e = Hn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --vr; } -function Aa() { - Vn = (wi = Or.now()) + Fi, pr = Cr = 0; +function Ra() { + Hn = ($i = qr.now()) + Li, vr = Sr = 0; try { - Zc(); + th(); } finally { - pr = 0, Qc(), Vn = 0; + vr = 0, nh(), Hn = 0; } } -function jc() { - var t = Or.now(), e = t - wi; - e > Qo && (Fi -= e, wi = t); +function eh() { + var t = qr.now(), e = t - $i; + e > el && (Li -= e, $i = t); } -function Qc() { - for (var t, e = yi, n, r = 1 / 0; e; ) - e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : yi = n); - Tr = t, _s(r); +function nh() { + for (var t, e = bi, n, r = 1 / 0; e; ) + e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : bi = n); + Nr = t, ws(r); } -function _s(t) { - if (!pr) { - Cr && (Cr = clearTimeout(Cr)); - var e = t - Vn; - e > 24 ? (t < 1 / 0 && (Cr = setTimeout(Aa, t - Or.now() - Fi)), Er && (Er = clearInterval(Er))) : (Er || (wi = Or.now(), Er = setInterval(jc, Qo)), pr = 1, tl(Aa)); +function ws(t) { + if (!vr) { + Sr && (Sr = clearTimeout(Sr)); + var e = t - Hn; + e > 24 ? (t < 1 / 0 && (Sr = setTimeout(Ra, t - qr.now() - Li)), Cr && (Cr = clearInterval(Cr))) : (Cr || ($i = qr.now(), Cr = setInterval(eh, el)), vr = 1, nl(Ra)); } } -function Ea(t, e, n) { - var r = new xi(); +function Ca(t, e, n) { + var r = new Ai(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var th = Do("start", "end", "cancel", "interrupt"), eh = [], nl = 0, Ra = 1, ms = 2, li = 3, Ca = 4, ys = 5, ui = 6; -function Ii(t, e, n, r, i, s) { +var rh = Io("start", "end", "cancel", "interrupt"), ih = [], il = 0, Ta = 1, xs = 2, ci = 3, Sa = 4, bs = 5, hi = 6; +function qi(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - nh(t, n, { + sh(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. - on: th, - tween: eh, + on: rh, + tween: ih, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: nl + state: il }); } -function Ys(t, e) { - var n = be(t, e); - if (n.state > nl) throw new Error("too late; already scheduled"); +function Xs(t, e) { + var n = Ae(t, e); + if (n.state > il) throw new Error("too late; already scheduled"); return n; } -function Le(t, e) { - var n = be(t, e); - if (n.state > li) throw new Error("too late; already running"); +function Ve(t, e) { + var n = Ae(t, e); + if (n.state > ci) throw new Error("too late; already running"); return n; } -function be(t, e) { +function Ae(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function nh(t, e, n) { +function sh(t, e, n) { var r = t.__transition, i; - r[e] = n, n.timer = el(s, 0, n.time); + r[e] = n, n.timer = rl(s, 0, n.time); function s(u) { - n.state = Ra, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = Ta, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { var f, h, c, p; - if (n.state !== Ra) return l(); + if (n.state !== Ta) return l(); for (f in r) if (p = r[f], p.name === n.name) { - if (p.state === li) return Ea(a); - p.state === Ca ? (p.state = ui, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = ui, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); + if (p.state === ci) return Ca(a); + p.state === Sa ? (p.state = hi, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = hi, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); } - if (Ea(function() { - n.state === li && (n.state = Ca, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = ms, n.on.call("start", t, t.__data__, n.index, n.group), n.state === ms) { - for (n.state = li, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) + if (Ca(function() { + n.state === ci && (n.state = Sa, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = xs, n.on.call("start", t, t.__data__, n.index, n.group), n.state === xs) { + for (n.state = ci, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) (p = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = p); i.length = h + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = ys, 1), h = -1, c = i.length; ++h < c; ) + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = bs, 1), h = -1, c = i.length; ++h < c; ) i[h].call(t, f); - n.state === ys && (n.on.call("end", t, t.__data__, n.index, n.group), l()); + n.state === bs && (n.on.call("end", t, t.__data__, n.index, n.group), l()); } function l() { - n.state = ui, n.timer.stop(), delete r[e]; + n.state = hi, n.timer.stop(), delete r[e]; for (var u in r) return; delete t.__transition; } } -function rh(t, e) { +function ah(t, e) { var n = t.__transition, r, i, s = !0, a; if (n) { e = e == null ? null : e + ""; @@ -4058,20 +4058,20 @@ function rh(t, e) { s = !1; continue; } - i = r.state > ms && r.state < ys, r.state = ui, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > xs && r.state < bs, r.state = hi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } -function ih(t) { +function oh(t) { return this.each(function() { - rh(this, t); + ah(this, t); }); } -function sh(t, e) { +function lh(t, e) { var n, r; return function() { - var i = Le(this, t), s = i.tween; + var i = Ve(this, t), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) @@ -4083,11 +4083,11 @@ function sh(t, e) { i.tween = r; }; } -function ah(t, e, n) { +function uh(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Le(this, t), a = s.tween; + var s = Ve(this, t), a = s.tween; if (a !== r) { i = (r = a).slice(); for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) @@ -4100,417 +4100,417 @@ function ah(t, e, n) { s.tween = i; }; } -function oh(t, e) { +function fh(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = be(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = Ae(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) if ((a = r[i]).name === t) return a.value; return null; } - return this.each((e == null ? sh : ah)(n, t, e)); + return this.each((e == null ? lh : uh)(n, t, e)); } -function Hs(t, e, n) { +function Bs(t, e, n) { var r = t._id; return t.each(function() { - var i = Le(this, r); + var i = Ve(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return be(i, r).value[e]; + return Ae(i, r).value[e]; }; } -function rl(t, e) { +function sl(t, e) { var n; - return (typeof e == "number" ? Pe : e instanceof qn ? mi : (n = qn(e)) ? (e = n, mi) : Jo)(t, e); + return (typeof e == "number" ? De : e instanceof Yn ? xi : (n = Yn(e)) ? (e = n, xi) : jo)(t, e); } -function lh(t) { +function ch(t) { return function() { this.removeAttribute(t); }; } -function uh(t) { +function hh(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function fh(t, e, n) { +function dh(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttribute(t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function ch(t, e, n) { +function ph(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttributeNS(t.space, t.local); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function hh(t, e, n) { +function vh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function dh(t, e, n) { +function gh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function ph(t, e) { - var n = Di(t), r = n === "transform" ? Kc : rl; - return this.attrTween(t, typeof e == "function" ? (n.local ? dh : hh)(n, r, Hs(this, "attr." + t, e)) : e == null ? (n.local ? uh : lh)(n) : (n.local ? ch : fh)(n, r, e)); +function _h(t, e) { + var n = Oi(t), r = n === "transform" ? jc : sl; + return this.attrTween(t, typeof e == "function" ? (n.local ? gh : vh)(n, r, Bs(this, "attr." + t, e)) : e == null ? (n.local ? hh : ch)(n) : (n.local ? ph : dh)(n, r, e)); } -function vh(t, e) { +function mh(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function gh(t, e) { +function yh(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function _h(t, e) { +function wh(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && gh(t, s)), n; + return s !== r && (n = (r = s) && yh(t, s)), n; } return i._value = e, i; } -function mh(t, e) { +function xh(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && vh(t, s)), n; + return s !== r && (n = (r = s) && mh(t, s)), n; } return i._value = e, i; } -function yh(t, e) { +function bh(t, e) { var n = "attr." + t; if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (e == null) return this.tween(n, null); if (typeof e != "function") throw new Error(); - var r = Di(t); - return this.tween(n, (r.local ? _h : mh)(r, e)); + var r = Oi(t); + return this.tween(n, (r.local ? wh : xh)(r, e)); } -function wh(t, e) { +function $h(t, e) { return function() { - Ys(this, t).delay = +e.apply(this, arguments); + Xs(this, t).delay = +e.apply(this, arguments); }; } -function xh(t, e) { +function Ah(t, e) { return e = +e, function() { - Ys(this, t).delay = e; + Xs(this, t).delay = e; }; } -function bh(t) { +function Eh(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? wh : xh)(e, t)) : be(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? $h : Ah)(e, t)) : Ae(this.node(), e).delay; } -function $h(t, e) { +function Rh(t, e) { return function() { - Le(this, t).duration = +e.apply(this, arguments); + Ve(this, t).duration = +e.apply(this, arguments); }; } -function Ah(t, e) { +function Ch(t, e) { return e = +e, function() { - Le(this, t).duration = e; + Ve(this, t).duration = e; }; } -function Eh(t) { +function Th(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? $h : Ah)(e, t)) : be(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? Rh : Ch)(e, t)) : Ae(this.node(), e).duration; } -function Rh(t, e) { +function Sh(t, e) { if (typeof e != "function") throw new Error(); return function() { - Le(this, t).ease = e; + Ve(this, t).ease = e; }; } -function Ch(t) { +function Nh(t) { var e = this._id; - return arguments.length ? this.each(Rh(e, t)) : be(this.node(), e).ease; + return arguments.length ? this.each(Sh(e, t)) : Ae(this.node(), e).ease; } -function Th(t, e) { +function kh(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - Le(this, t).ease = n; + Ve(this, t).ease = n; }; } -function Nh(t) { +function Mh(t) { if (typeof t != "function") throw new Error(); - return this.each(Th(this._id, t)); + return this.each(kh(this._id, t)); } -function Sh(t) { - typeof t != "function" && (t = Oo(t)); +function Ph(t) { + typeof t != "function" && (t = qo(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new je(r, this._parents, this._name, this._id); + return new nn(r, this._parents, this._name, this._id); } -function kh(t) { +function Dh(t) { if (t._id !== this._id) throw new Error(); for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) for (var l = e[o], u = n[o], f = l.length, h = a[o] = new Array(f), c, p = 0; p < f; ++p) (c = l[p] || u[p]) && (h[p] = c); for (; o < r; ++o) a[o] = e[o]; - return new je(a, this._parents, this._name, this._id); + return new nn(a, this._parents, this._name, this._id); } -function Ph(t) { +function Fh(t) { return (t + "").trim().split(/^|\s+/).every(function(e) { var n = e.indexOf("."); return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; }); } -function Mh(t, e, n) { - var r, i, s = Ph(e) ? Ys : Le; +function Ih(t, e, n) { + var r, i, s = Fh(e) ? Xs : Ve; return function() { var a = s(this, t), o = a.on; o !== r && (i = (r = o).copy()).on(e, n), a.on = i; }; } -function Dh(t, e) { +function Oh(t, e) { var n = this._id; - return arguments.length < 2 ? be(this.node(), n).on.on(t) : this.each(Mh(n, t, e)); + return arguments.length < 2 ? Ae(this.node(), n).on.on(t) : this.each(Ih(n, t, e)); } -function Fh(t) { +function Lh(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } -function Ih() { - return this.on("end.remove", Fh(this._id)); +function qh() { + return this.on("end.remove", Lh(this._id)); } -function Oh(t) { +function Vh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = Is(t)); + typeof t != "function" && (t = qs(t)); 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, h, c = 0; c < l; ++c) - (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Ii(u[c], e, n, c, u, be(f, n))); - return new je(s, this._parents, e, n); + (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, qi(u[c], e, n, c, u, Ae(f, n))); + return new nn(s, this._parents, e, n); } -function Lh(t) { +function Yh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = Io(t)); + typeof t != "function" && (t = Lo(t)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) for (var l = r[o], u = l.length, f, h = 0; h < u; ++h) if (f = l[h]) { - for (var c = t.call(f, f.__data__, h, l), p, g = be(f, n), y = 0, $ = c.length; y < $; ++y) - (p = c[y]) && Ii(p, e, n, y, c, g); + for (var c = t.call(f, f.__data__, h, l), p, g = Ae(f, n), y = 0, $ = c.length; y < $; ++y) + (p = c[y]) && qi(p, e, n, y, c, g); s.push(c), a.push(f); } - return new je(s, a, e, n); + return new nn(s, a, e, n); } -var qh = _r.prototype.constructor; -function Vh() { - return new qh(this._groups, this._parents); +var Hh = mr.prototype.constructor; +function zh() { + return new Hh(this._groups, this._parents); } -function Yh(t, e) { +function Xh(t, e) { var n, r, i; return function() { - var s = dr(this, t), a = (this.style.removeProperty(t), dr(this, t)); + var s = pr(this, t), a = (this.style.removeProperty(t), pr(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function il(t) { +function al(t) { return function() { this.style.removeProperty(t); }; } -function Hh(t, e, n) { +function Bh(t, e, n) { var r, i = n + "", s; return function() { - var a = dr(this, t); + var a = pr(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function zh(t, e, n) { +function Wh(t, e, n) { var r, i, s; return function() { - var a = dr(this, t), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(t), dr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + var a = pr(this, t), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(t), pr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); }; } -function Xh(t, e) { +function Uh(t, e) { var n, r, i, s = "style." + e, a = "end." + s, o; return function() { - var l = Le(this, t), u = l.on, f = l.value[s] == null ? o || (o = il(e)) : void 0; + var l = Ve(this, t), u = l.on, f = l.value[s] == null ? o || (o = al(e)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function Bh(t, e, n) { - var r = (t += "") == "transform" ? Gc : rl; - return e == null ? this.styleTween(t, Yh(t, r)).on("end.style." + t, il(t)) : typeof e == "function" ? this.styleTween(t, zh(t, r, Hs(this, "style." + t, e))).each(Xh(this._id, t)) : this.styleTween(t, Hh(t, r, e), n).on("end.style." + t, null); +function Gh(t, e, n) { + var r = (t += "") == "transform" ? Zc : sl; + return e == null ? this.styleTween(t, Xh(t, r)).on("end.style." + t, al(t)) : typeof e == "function" ? this.styleTween(t, Wh(t, r, Bs(this, "style." + t, e))).each(Uh(this._id, t)) : this.styleTween(t, Bh(t, r, e), n).on("end.style." + t, null); } -function Wh(t, e, n) { +function Kh(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } -function Uh(t, e, n) { +function Jh(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && Wh(t, a, n)), r; + return a !== i && (r = (i = a) && Kh(t, a, n)), r; } return s._value = e, s; } -function Gh(t, e, n) { +function Zh(t, e, n) { var r = "style." + (t += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; if (e == null) return this.tween(r, null); if (typeof e != "function") throw new Error(); - return this.tween(r, Uh(t, e, n ?? "")); + return this.tween(r, Jh(t, e, n ?? "")); } -function Kh(t) { +function jh(t) { return function() { this.textContent = t; }; } -function Jh(t) { +function Qh(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function Zh(t) { - return this.tween("text", typeof t == "function" ? Jh(Hs(this, "text", t)) : Kh(t == null ? "" : t + "")); +function td(t) { + return this.tween("text", typeof t == "function" ? Qh(Bs(this, "text", t)) : jh(t == null ? "" : t + "")); } -function jh(t) { +function ed(t) { return function(e) { this.textContent = t.call(this, e); }; } -function Qh(t) { +function nd(t) { var e, n; function r() { var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && jh(i)), e; + return i !== n && (e = (n = i) && ed(i)), e; } return r._value = t, r; } -function td(t) { +function rd(t) { var e = "text"; if (arguments.length < 1) return (e = this.tween(e)) && e._value; if (t == null) return this.tween(e, null); if (typeof t != "function") throw new Error(); - return this.tween(e, Qh(t)); + return this.tween(e, nd(t)); } -function ed() { - for (var t = this._name, e = this._id, n = sl(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function id() { + for (var t = this._name, e = this._id, n = ol(), 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 = be(l, e); - Ii(l, t, n, u, a, { + var f = Ae(l, e); + qi(l, t, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new je(r, this._parents, t, n); + return new nn(r, this._parents, t, n); } -function nd() { +function sd() { var t, e, 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 = Le(this, r), f = u.on; + var u = Ve(this, r), f = u.on; f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; }), i === 0 && s(); }); } -var rd = 0; -function je(t, e, n, r) { +var ad = 0; +function nn(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function fi(t) { - return _r().transition(t); -} -function sl() { - return ++rd; -} -var ze = _r.prototype; -je.prototype = fi.prototype = { - constructor: je, - select: Oh, - selectAll: Lh, - selectChild: ze.selectChild, - selectChildren: ze.selectChildren, - filter: Sh, - merge: kh, - selection: Vh, - transition: ed, - call: ze.call, - nodes: ze.nodes, - node: ze.node, - size: ze.size, - empty: ze.empty, - each: ze.each, - on: Dh, - attr: ph, - attrTween: yh, - style: Bh, - styleTween: Gh, - text: Zh, - textTween: td, - remove: Ih, - tween: oh, - delay: bh, - duration: Eh, - ease: Ch, - easeVarying: Nh, - end: nd, - [Symbol.iterator]: ze[Symbol.iterator] +function di(t) { + return mr().transition(t); +} +function ol() { + return ++ad; +} +var We = mr.prototype; +nn.prototype = di.prototype = { + constructor: nn, + select: Vh, + selectAll: Yh, + selectChild: We.selectChild, + selectChildren: We.selectChildren, + filter: Ph, + merge: Dh, + selection: zh, + transition: id, + call: We.call, + nodes: We.nodes, + node: We.node, + size: We.size, + empty: We.empty, + each: We.each, + on: Oh, + attr: _h, + attrTween: bh, + style: Gh, + styleTween: Zh, + text: td, + textTween: rd, + remove: qh, + tween: fh, + delay: Eh, + duration: Th, + ease: Nh, + easeVarying: Mh, + end: sd, + [Symbol.iterator]: We[Symbol.iterator] }; -function id(t) { +function od(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var sd = { +var ld = { time: null, // Set on use. delay: 0, duration: 250, - ease: id + ease: od }; -function ad(t, e) { +function ud(t, e) { for (var n; !(n = t.__transition) || !(n = n[e]); ) if (!(t = t.parentNode)) throw new Error(`transition ${e} not found`); return n; } -function od(t) { +function fd(t) { var e, n; - t instanceof je ? (e = t._id, t = t._name) : (e = sl(), (n = sd).time = Vs(), t = t == null ? null : t + ""); + t instanceof nn ? (e = t._id, t = t._name) : (e = ol(), (n = ld).time = zs(), t = t == null ? null : t + ""); 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]) && Ii(l, t, e, u, a, n || ad(l, e)); - return new je(r, this._parents, t, e); + (l = a[u]) && qi(l, t, e, u, a, n || ud(l, e)); + return new nn(r, this._parents, t, e); } -_r.prototype.interrupt = ih; -_r.prototype.transition = od; -const ws = Math.PI, xs = 2 * ws, mn = 1e-6, ld = xs - mn; -function al(t) { +mr.prototype.interrupt = oh; +mr.prototype.transition = fd; +const $s = Math.PI, As = 2 * $s, wn = 1e-6, cd = As - wn; +function ll(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function ud(t) { +function hd(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return al; + if (e > 15) return ll; const n = 10 ** e; return function(r) { this._ += r[0]; @@ -4518,10 +4518,10 @@ function ud(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class fd { +class dd { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? al : ud(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? ll : hd(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -4543,17 +4543,17 @@ class fd { let a = this._x1, o = this._y1, l = r - e, u = i - n, f = a - e, h = o - n, c = f * f + h * h; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > mn) if (!(Math.abs(h * l - u * f) > mn) || !s) + else if (c > wn) if (!(Math.abs(h * l - u * f) > wn) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let p = r - a, g = i - o, y = l * l + u * u, $ = p * p + g * g, E = Math.sqrt(y), S = Math.sqrt(c), C = s * Math.tan((ws - Math.acos((y + c - $) / (2 * E * S))) / 2), P = C / S, k = C / E; - Math.abs(P - 1) > mn && this._append`L${e + P * f},${n + P * h}`, this._append`A${s},${s},0,0,${+(h * p > f * g)},${this._x1 = e + k * l},${this._y1 = n + k * u}`; + let p = r - a, g = i - o, y = l * l + u * u, $ = p * p + g * g, A = Math.sqrt(y), k = Math.sqrt(c), C = s * Math.tan(($s - Math.acos((y + c - $) / (2 * A * k))) / 2), D = C / k, P = C / A; + Math.abs(D - 1) > wn && this._append`L${e + D * f},${n + D * h}`, this._append`A${s},${s},0,0,${+(h * p > f * g)},${this._x1 = e + P * l},${this._y1 = n + P * u}`; } } arc(e, n, r, i, s, a) { if (e = +e, 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 = e + o, f = n + l, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > mn || Math.abs(this._y1 - f) > mn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % xs + xs), c > ld ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > mn && this._append`A${r},${r},0,${+(c >= ws)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > wn || Math.abs(this._y1 - f) > wn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % As + As), c > cd ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > wn && this._append`A${r},${r},0,${+(c >= $s)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } rect(e, n, r, i) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; @@ -4562,24 +4562,24 @@ class fd { return this._; } } -function cd(t) { +function pd(t) { for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); return n; } -const hd = cd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +const vd = pd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); function Dt(t) { return function() { return t; }; } -const Ta = Math.abs, St = Math.atan2, _n = Math.cos, dd = Math.max, Zi = Math.min, Re = Math.sin, Zn = Math.sqrt, Lt = 1e-12, Lr = Math.PI, bi = Lr / 2, ci = 2 * Lr; -function pd(t) { - return t > 1 ? 0 : t < -1 ? Lr : Math.acos(t); +const Na = Math.abs, Nt = Math.atan2, yn = Math.cos, gd = Math.max, ts = Math.min, Te = Math.sin, jn = Math.sqrt, Lt = 1e-12, Vr = Math.PI, Ei = Vr / 2, pi = 2 * Vr; +function _d(t) { + return t > 1 ? 0 : t < -1 ? Vr : Math.acos(t); } -function Na(t) { - return t >= 1 ? bi : t <= -1 ? -bi : Math.asin(t); +function ka(t) { + return t >= 1 ? Ei : t <= -1 ? -Ei : Math.asin(t); } -function vd(t) { +function md(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -4591,69 +4591,69 @@ function vd(t) { e = r; } return t; - }, () => new fd(e); + }, () => new dd(e); } -function gd(t) { +function yd(t) { return t.innerRadius; } -function _d(t) { +function wd(t) { return t.outerRadius; } -function md(t) { +function xd(t) { return t.startAngle; } -function yd(t) { +function bd(t) { return t.endAngle; } -function wd(t) { +function $d(t) { return t && t.padAngle; } -function xd(t, e, n, r, i, s, a, o) { +function Ad(t, e, n, r, i, s, a, o) { var l = n - t, u = r - e, f = a - i, h = o - s, c = h * l - f * u; if (!(c * c < Lt)) return c = (f * (e - s) - h * (t - i)) / c, [t + c * l, e + c * u]; } -function ei(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / Zn(o * o + l * l), f = u * l, h = -u * o, c = t + f, p = e + h, g = n + f, y = r + h, $ = (c + g) / 2, E = (p + y) / 2, S = g - c, C = y - p, P = S * S + C * C, k = i - s, G = c * y - g * p, ot = (C < 0 ? -1 : 1) * Zn(dd(0, k * k * P - G * G)), K = (G * C - S * ot) / P, nt = (-G * S - C * ot) / P, Q = (G * C + S * ot) / P, vt = (-G * S + C * ot) / P, gt = K - $, M = nt - E, D = Q - $, Xt = vt - E; - return gt * gt + M * M > D * D + Xt * Xt && (K = Q, nt = vt), { +function ii(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / jn(o * o + l * l), f = u * l, h = -u * o, c = t + f, p = e + h, g = n + f, y = r + h, $ = (c + g) / 2, A = (p + y) / 2, k = g - c, C = y - p, D = k * k + C * C, P = i - s, G = c * y - g * p, ut = (C < 0 ? -1 : 1) * jn(gd(0, P * P * D - G * G)), K = (G * C - k * ut) / D, it = (-G * k - C * ut) / D, Q = (G * C + k * ut) / D, gt = (-G * k + C * ut) / D, _t = K - $, F = it - A, I = Q - $, Xt = gt - A; + return _t * _t + F * F > I * I + Xt * Xt && (K = Q, it = gt), { cx: K, - cy: nt, + cy: it, x01: -f, y01: -h, - x11: K * (i / k - 1), - y11: nt * (i / k - 1) + x11: K * (i / P - 1), + y11: it * (i / P - 1) }; } -function Ce() { - var t = gd, e = _d, n = Dt(0), r = null, i = md, s = yd, a = wd, o = null, l = vd(u); +function Se() { + var t = yd, e = wd, n = Dt(0), r = null, i = xd, s = bd, a = $d, o = null, l = md(u); function u() { - var f, h, c = +t.apply(this, arguments), p = +e.apply(this, arguments), g = i.apply(this, arguments) - bi, y = s.apply(this, arguments) - bi, $ = Ta(y - g), E = y > g; + var f, h, c = +t.apply(this, arguments), p = +e.apply(this, arguments), g = i.apply(this, arguments) - Ei, y = s.apply(this, arguments) - Ei, $ = Na(y - g), A = y > g; if (o || (o = f = l()), p < c && (h = p, p = c, c = h), !(p > Lt)) o.moveTo(0, 0); - else if ($ > ci - Lt) - o.moveTo(p * _n(g), p * Re(g)), o.arc(0, 0, p, g, y, !E), c > Lt && (o.moveTo(c * _n(y), c * Re(y)), o.arc(0, 0, c, y, g, E)); + else if ($ > pi - Lt) + o.moveTo(p * yn(g), p * Te(g)), o.arc(0, 0, p, g, y, !A), c > Lt && (o.moveTo(c * yn(y), c * Te(y)), o.arc(0, 0, c, y, g, A)); else { - var S = g, C = y, P = g, k = y, G = $, ot = $, K = a.apply(this, arguments) / 2, nt = K > Lt && (r ? +r.apply(this, arguments) : Zn(c * c + p * p)), Q = Zi(Ta(p - c) / 2, +n.apply(this, arguments)), vt = Q, gt = Q, M, D; - if (nt > Lt) { - var Xt = Na(nt / c * Re(K)), re = Na(nt / p * Re(K)); - (G -= Xt * 2) > Lt ? (Xt *= E ? 1 : -1, P += Xt, k -= Xt) : (G = 0, P = k = (g + y) / 2), (ot -= re * 2) > Lt ? (re *= E ? 1 : -1, S += re, C -= re) : (ot = 0, S = C = (g + y) / 2); + var k = g, C = y, D = g, P = y, G = $, ut = $, K = a.apply(this, arguments) / 2, it = K > Lt && (r ? +r.apply(this, arguments) : jn(c * c + p * p)), Q = ts(Na(p - c) / 2, +n.apply(this, arguments)), gt = Q, _t = Q, F, I; + if (it > Lt) { + var Xt = ka(it / c * Te(K)), ie = ka(it / p * Te(K)); + (G -= Xt * 2) > Lt ? (Xt *= A ? 1 : -1, D += Xt, P -= Xt) : (G = 0, D = P = (g + y) / 2), (ut -= ie * 2) > Lt ? (ie *= A ? 1 : -1, k += ie, C -= ie) : (ut = 0, k = C = (g + y) / 2); } - var Ct = p * _n(S), It = p * Re(S), Tt = c * _n(k), he = c * Re(k); + var xt = p * yn(k), It = p * Te(k), Tt = c * yn(P), pe = c * Te(P); if (Q > Lt) { - var z = p * _n(C), Nt = p * Re(C), tn = c * _n(P), Z = c * Re(P), kt; - if ($ < Lr) - if (kt = xd(Ct, It, tn, Z, z, Nt, Tt, he)) { - var $e = Ct - kt[0], Ae = It - kt[1], qe = z - kt[0], ht = Nt - kt[1], en = 1 / Re(pd(($e * qe + Ae * ht) / (Zn($e * $e + Ae * Ae) * Zn(qe * qe + ht * ht))) / 2), nn = Zn(kt[0] * kt[0] + kt[1] * kt[1]); - vt = Zi(Q, (c - nn) / (en - 1)), gt = Zi(Q, (p - nn) / (en + 1)); + var z = p * yn(C), St = p * Te(C), sn = c * yn(D), Z = c * Te(D), kt; + if ($ < Vr) + if (kt = Ad(xt, It, sn, Z, z, St, Tt, pe)) { + var Ee = xt - kt[0], Re = It - kt[1], Ye = z - kt[0], dt = St - kt[1], He = 1 / Te(_d((Ee * Ye + Re * dt) / (jn(Ee * Ee + Re * Re) * jn(Ye * Ye + dt * dt))) / 2), an = jn(kt[0] * kt[0] + kt[1] * kt[1]); + gt = ts(Q, (c - an) / (He - 1)), _t = ts(Q, (p - an) / (He + 1)); } else - vt = gt = 0; + gt = _t = 0; } - ot > Lt ? gt > Lt ? (M = ei(tn, Z, Ct, It, p, gt, E), D = ei(z, Nt, Tt, he, p, gt, E), o.moveTo(M.cx + M.x01, M.cy + M.y01), gt < Q ? o.arc(M.cx, M.cy, gt, St(M.y01, M.x01), St(D.y01, D.x01), !E) : (o.arc(M.cx, M.cy, gt, St(M.y01, M.x01), St(M.y11, M.x11), !E), o.arc(0, 0, p, St(M.cy + M.y11, M.cx + M.x11), St(D.cy + D.y11, D.cx + D.x11), !E), o.arc(D.cx, D.cy, gt, St(D.y11, D.x11), St(D.y01, D.x01), !E))) : (o.moveTo(Ct, It), o.arc(0, 0, p, S, C, !E)) : o.moveTo(Ct, It), !(c > Lt) || !(G > Lt) ? o.lineTo(Tt, he) : vt > Lt ? (M = ei(Tt, he, z, Nt, c, -vt, E), D = ei(Ct, It, tn, Z, c, -vt, E), o.lineTo(M.cx + M.x01, M.cy + M.y01), vt < Q ? o.arc(M.cx, M.cy, vt, St(M.y01, M.x01), St(D.y01, D.x01), !E) : (o.arc(M.cx, M.cy, vt, St(M.y01, M.x01), St(M.y11, M.x11), !E), o.arc(0, 0, c, St(M.cy + M.y11, M.cx + M.x11), St(D.cy + D.y11, D.cx + D.x11), E), o.arc(D.cx, D.cy, vt, St(D.y11, D.x11), St(D.y01, D.x01), !E))) : o.arc(0, 0, c, k, P, E); + ut > Lt ? _t > Lt ? (F = ii(sn, Z, xt, It, p, _t, A), I = ii(z, St, Tt, pe, p, _t, A), o.moveTo(F.cx + F.x01, F.cy + F.y01), _t < Q ? o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !A) : (o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !A), o.arc(0, 0, p, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), !A), o.arc(I.cx, I.cy, _t, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !A))) : (o.moveTo(xt, It), o.arc(0, 0, p, k, C, !A)) : o.moveTo(xt, It), !(c > Lt) || !(G > Lt) ? o.lineTo(Tt, pe) : gt > Lt ? (F = ii(Tt, pe, z, St, c, -gt, A), I = ii(xt, It, sn, Z, c, -gt, A), o.lineTo(F.cx + F.x01, F.cy + F.y01), gt < Q ? o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !A) : (o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !A), o.arc(0, 0, c, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), A), o.arc(I.cx, I.cy, gt, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !A))) : o.arc(0, 0, c, P, D, A); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Lr / 2; - return [_n(h) * f, Re(h) * f]; + var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Vr / 2; + return [yn(h) * f, Te(h) * f]; }, u.innerRadius = function(f) { return arguments.length ? (t = typeof f == "function" ? f : Dt(+f), u) : t; }, u.outerRadius = function(f) { @@ -4672,33 +4672,33 @@ function Ce() { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function bd(t) { +function Ed(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function $d(t, e) { +function Rd(t, e) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function Ad(t) { +function Cd(t) { return t; } -function ji() { - var t = Ad, e = $d, n = null, r = Dt(0), i = Dt(ci), s = Dt(0); +function es() { + var t = Cd, e = Rd, n = null, r = Dt(0), i = Dt(pi), s = Dt(0); function a(o) { - var l, u = (o = bd(o)).length, f, h, c = 0, p = new Array(u), g = new Array(u), y = +r.apply(this, arguments), $ = Math.min(ci, Math.max(-ci, i.apply(this, arguments) - y)), E, S = Math.min(Math.abs($) / u, s.apply(this, arguments)), C = S * ($ < 0 ? -1 : 1), P; + var l, u = (o = Ed(o)).length, f, h, c = 0, p = new Array(u), g = new Array(u), y = +r.apply(this, arguments), $ = Math.min(pi, Math.max(-pi, i.apply(this, arguments) - y)), A, k = Math.min(Math.abs($) / u, s.apply(this, arguments)), C = k * ($ < 0 ? -1 : 1), D; for (l = 0; l < u; ++l) - (P = g[p[l] = l] = +t(o[l], l, o)) > 0 && (c += P); - for (e != null ? p.sort(function(k, G) { - return e(g[k], g[G]); - }) : n != null && p.sort(function(k, G) { - return n(o[k], o[G]); - }), l = 0, h = c ? ($ - u * C) / c : 0; l < u; ++l, y = E) - f = p[l], P = g[f], E = y + (P > 0 ? P * h : 0) + C, g[f] = { + (D = g[p[l] = l] = +t(o[l], l, o)) > 0 && (c += D); + for (e != null ? p.sort(function(P, G) { + return e(g[P], g[G]); + }) : n != null && p.sort(function(P, G) { + return n(o[P], o[G]); + }), l = 0, h = c ? ($ - u * C) / c : 0; l < u; ++l, y = A) + f = p[l], D = g[f], A = y + (D > 0 ? D * h : 0) + C, g[f] = { data: o[f], index: l, - value: P, + value: D, startAngle: y, - endAngle: E, - padAngle: S + endAngle: A, + padAngle: k }; return g; } @@ -4716,16 +4716,16 @@ function ji() { return arguments.length ? (s = typeof o == "function" ? o : Dt(+o), a) : s; }, a; } -function Nr(t, e, n) { +function kr(t, e, n) { this.k = t, this.x = e, this.y = n; } -Nr.prototype = { - constructor: Nr, +kr.prototype = { + constructor: kr, scale: function(t) { - return t === 1 ? this : new Nr(this.k * t, this.x, this.y); + return t === 1 ? this : new kr(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new Nr(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new kr(this.k, this.x + this.k * t, this.y + this.k * e); }, apply: function(t) { return [t[0] * this.k + this.x, t[1] * this.k + this.y]; @@ -4755,209 +4755,209 @@ Nr.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Nr.prototype; -var Ed = /* @__PURE__ */ Cu(''); -const Rd = { +kr.prototype; +var Td = /* @__PURE__ */ Nu(''); +const Sd = { 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 ol(t, e) { - Es(e, !0), ko(t, Rd); - let n = pt(e, "jsonData", 7), r = pt(e, "currentRound", 7, 1), i = pt(e, "mouseEventType", 15), s = pt(e, "mouseData", 15), a = pt(e, "mouseX", 15), o = pt(e, "mouseY", 15), l = pt(e, "requestRoundChange", 7, (d) => { - }), u = pt(e, "candidateColors", 23, () => []), f = pt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = pt(e, "firstRoundDeterminesPercentages", 7, !1), c = pt(e, "displayPhase", 15, 0); +function ul(t, e) { + Ts(e, !0), Po(t, Sd); + let n = vt(e, "jsonData", 7), r = vt(e, "currentRound", 7, 1), i = vt(e, "mouseEventType", 15), s = vt(e, "mouseData", 15), a = vt(e, "mouseX", 15), o = vt(e, "mouseY", 15), l = vt(e, "requestRoundChange", 7, (d) => { + }), u = vt(e, "candidateColors", 23, () => []), f = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = vt(e, "firstRoundDeterminesPercentages", 7, !1), c = vt(e, "displayPhase", 15, 0); function p(d) { return d.isTransfer ? `${d.label}__transfer` : d.transferIndex != null ? `${d.label}__${d.transferIndex}` : d.label; } - const g = 800, y = 800, $ = Math.min(g, y) * 0.3, E = g / 2, S = y / 2, C = "Pie", P = "PieOutline", k = "Donut", G = "TextLayer", ot = "url(#cross-hatch)", K = 1.15, nt = 0.1, Q = 750, vt = 800, gt = "white", M = 1, D = "#ff00ff", Xt = 3; - function re(d) { + const g = 800, y = 800, $ = Math.min(g, y) * 0.3, A = g / 2, k = y / 2, C = "Pie", D = "PieOutline", P = "Donut", G = "TextLayer", ut = "url(#cross-hatch)", K = 1.15, it = 0.1, Q = 750, gt = 800, _t = "white", F = 1, I = "#ff00ff", Xt = 3; + function ie(d) { return "hatch-" + d.replace(/[^a-zA-Z0-9]/g, "-"); } - let Ct = [], It = [], Tt = [], he = 0, z = 0; - const Nt = {}, tn = "No Further Rankings"; - let Z = /* @__PURE__ */ mt(null); + let xt = [], It = [], Tt = [], pe = 0, z = 0; + const St = {}, sn = "No Further Rankings"; + let Z = /* @__PURE__ */ yt(null); function kt() { - const d = ut(x(Z)); - d.select("#" + C).remove(), d.select("#" + P).remove(), d.select("#" + k).remove(), d.select("#" + G).remove(); + const d = at(x(Z)); + d.select("#" + C).remove(), d.select("#" + D).remove(), d.select("#" + P).remove(), d.select("#" + G).remove(); } - function $e(d) { - l() && (lt = d, l()(d)); + function Ee(d) { + l() && (ft = d, l()(d)); } - function Ae(d) { - kt(), Tt = qe(d), Ct = Bs(d, C, Tt, E, S, 0, ht()), Bs(d, P, Tt, E, S, 0, ht(), !1, !1, !0), br(); + function Re(d) { + kt(), Tt = Ye(d), xt = Gs(d, C, Tt, A, k, 0, dt()), Gs(d, D, Tt, A, k, 0, dt(), !1, !1, !0), $r(); } - Mu(() => { - Pt(), setTimeout( + Iu(() => { + Mt(), setTimeout( () => { - Ae(r()); + Re(r()); }, 0 ); }); - function qe(d) { + function Ye(d) { const _ = j(d); - return he = mr(d), _; + return pe = yr(d), _; } - function ht() { + function dt() { return $; } - function en() { - return ht() * 1.41; + function He() { + return dt() * 1.41; } - function nn(d) { + function an(d) { let _ = 0; for (let m = 1; m < d; m++) { - const A = n().results[m - 1].tallyResults; - for (let b = 0; b < A.length; b++) { - const R = A[b].transfers; - if (R) { - const N = R.exhausted; + const E = n().results[m - 1].tallyResults; + for (let b = 0; b < E.length; b++) { + const T = E[b].transfers; + if (T) { + const N = T.exhausted; N && (_ += Number(N)); } } } return _; } - function Ur(d, _) { - if (d === "exhausted") return nn(_); + function Kr(d, _) { + if (d === "exhausted") return an(_); { const m = n().results[_ - 1].tally; return Number(m[d]); } } - function Oi(d, _) { - return Ur(d, _).toLocaleString("en-US"); + function Vi(d, _) { + return Kr(d, _).toLocaleString("en-US"); } - function zn(d, _) { - const m = h() ? he : Li(_); - return (Ur(d, _) / m).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Bn(d, _) { + const m = h() ? pe : Yi(_); + return (Kr(d, _) / m).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function mr(d) { + function yr(d) { const _ = n().results[d - 1].tally; let m = 0; - for (let [A, b] of Object.entries(_)) + for (let [E, b] of Object.entries(_)) m += Number(b); return m; } - function Gr(d) { + function Jr(d) { return d === "exhausted" || d === "Inactive Ballots"; } - function Li(d) { + function Yi(d) { const _ = n().results[d - 1].tally; let m = 0; - for (let [A, b] of Object.entries(_)) - Gr(A) || (m += Number(b)); + for (let [E, b] of Object.entries(_)) + Jr(E) || (m += Number(b)); return m; } - function Xn(d, _) { + function Wn(d, _) { if (!d || d < 1 || d > n().results.length) - return console.warn("In chsoenCandidates: round ${round} is out of range."), []; + return console.warn("In chosenCandidates: round ${round} is out of range."), []; if (f() && d === n().results.length) return []; - const m = n().results[d - 1].tallyResults, A = []; + const m = n().results[d - 1].tallyResults, E = []; for (let b = 0; b < m.length; b++) { - const R = m[b][_]; - R != null && A.push(R); + const T = m[b][_]; + T != null && E.push(T); } - return A; + return E; } - function Bn(d) { - return Xn(d, "eliminated"); + function Un(d) { + return Wn(d, "eliminated"); } function w(d) { let _ = []; - for (let m = 1; m <= d; m++) _ = _.concat(Xn(m, "elected")); + for (let m = 1; m <= d; m++) _ = _.concat(Wn(m, "elected")); return [...new Set(_)]; } - function B(d, _) { + function W(d, _) { const m = n().results[_ - 1].tallyResults; - let A = 0; - const b = m.findIndex((R) => (R == null ? void 0 : R.elected) && d == R.elected); + let E = 0; + const b = m.findIndex((T) => (T == null ? void 0 : T.elected) && d == T.elected); if (b >= 0) { - const R = m[b].transfers; - if (R) - for (let [N, q] of Object.entries(R)) A += Number(q); + const T = m[b].transfers; + if (T) + for (let [N, V] of Object.entries(T)) E += Number(V); } else return 0; - return A; + return E; } function j(d) { const _ = n().results; let m = _[Math.max(0, d - 2)].tally; - const A = [], b = []; - for (let [N, q] of Object.entries(m)) - A.push({ label: N, value: 0 }); + const E = [], b = []; + for (let [N, V] of Object.entries(m)) + E.push({ label: N, value: 0 }); m = _[d - 1].tally; - for (let N of A) + for (let N of E) N.value = Number(m[N.label]), b.push(N); - const R = nn(d); - return b.push({ label: "exhausted", value: R }), b; + const T = an(d); + return b.push({ label: "exhausted", value: T }), b; } - function wt(d, _) { + function bt(d, _) { const m = []; - for (const A of d) { - if (A.label === "exhausted" || A.isTransfer) { - m.push(A); + for (const E of d) { + if (E.label === "exhausted" || E.isTransfer) { + m.push(E); continue; } - const b = B(A.label, _); + const b = W(E.label, _); b > 0 ? (m.push({ - label: A.label, + label: E.label, value: b, isTransfer: !0 - }), m.push({ ...A, value: A.value - b })) : m.push(A); + }), m.push({ ...E, value: E.value - b })) : m.push(E); } return m; } - function Pt() { - const d = ut(x(Z)).select("defs").select("#cross-hatch"); + function Mt() { + const d = at(x(Z)).select("defs").select("#cross-hatch"); let _ = 0; - for (let [m, A] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? _ < 10 ? Nt[m] = hd[_] : Nt[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Nt[m] = u()[_ % u().length], _++; + for (let [m, E] of Object.entries(n().results[0].tally)) { + !u() || u().length === 0 ? _ < 10 ? St[m] = vd[_] : St[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : St[m] = u()[_ % u().length], _++; { const b = d.clone(!0); - b.attr("id", re(m)).select("rect").attr("fill", Nt[m]), b.selectAll("circle").attr("fill", "#383838"); + b.attr("id", ie(m)).select("rect").attr("fill", St[m]), b.selectAll("circle").attr("fill", "#383838"); } } - Nt.exhausted = ot, Nt["Inactive Ballots"] = ot; + St.exhausted = ut, St["Inactive Ballots"] = ut; } - function tt() { - ut(x(Z)).select("#" + k).remove(); + function et() { + at(x(Z)).select("#" + P).remove(); } - function xt(d, _) { - const m = fi("global").duration(vt); + function $t(d, _) { + const m = di("global").duration(gt); _ && m.on("end", _); - const A = wt(Tt, d), R = ji().sort(null).value((N) => N.value)(A); - Ks(d, C, R, 0, ht()), Ks(d, P, R, 0, ht(), !0), Tt = A, Ct = R, tt(), xr(d), hl(), pl(0, ht()), br(); + const E = bt(Tt, d), T = es().sort(null).value((N) => N.value)(E); + js(d, C, T, 0, dt()), js(d, D, T, 0, dt(), !0), Tt = E, xt = T, et(), br(d), pl(), gl(0, dt()), $r(); } function Bt(d, _) { - const m = fi("global").duration(vt); - _ && m.on("end", _), He(d); + const m = di("global").duration(gt); + _ && m.on("end", _), Be(d); } - function Mt(d, _) { - const m = fi("global").duration(vt); - _ && m.on("end", _), yr(d), wr(ht()); + function Pt(d, _) { + const m = di("global").duration(gt); + _ && m.on("end", _), wr(d), xr(dt(), He()); } - let dt = !1, Ot = []; - function et() { - br(), dt = !1, Wt(); + let pt = !1, Ot = []; + function nt() { + $r(), pt = !1, Wt(); } function Wt() { if (Ot.length === 0) { - lt !== r() && (r() === lt + 1 && lt > 0 && r() <= n().results.length ? (lt = r(), Ut(r())) : r() >= 1 && r() <= n().results.length && (lt = r(), c(0), Ae(r()))); + ft !== r() && (r() === ft + 1 && ft > 0 && r() <= n().results.length ? (ft = r(), Ut(r())) : r() >= 1 && r() <= n().results.length && (ft = r(), c(0), Re(r()))); return; } const d = Ot.shift(); switch (d.type) { case "round": { const _ = d.round; - _ === lt + 1 && lt > 0 && _ <= n().results.length ? (lt = _, Ut(_)) : (_ !== lt && _ >= 1 && _ <= n().results.length && (lt = _, c(0), Ae(_)), Wt()); + _ === ft + 1 && ft > 0 && _ <= n().results.length ? (ft = _, Ut(_)) : (_ !== ft && _ >= 1 && _ <= n().results.length && (ft = _, c(0), Re(_)), Wt()); break; } case "step": - pn(); + _n(); break; } } @@ -4966,52 +4966,52 @@ function ol(t, e) { Wt(); return; } - dt = !0, z = d, c(0), xt(z - 1, () => { + pt = !0, z = d, c(0), $t(z - 1, () => { Bt(z - 1, () => { - Mt(z, et); + Pt(z, nt); }); }); } - function rn() { - dt || (dt = !0, z = r(), dn()); + function on() { + pt || (pt = !0, z = r(), gn()); } - function dn() { + function gn() { if (c( 0 // if in the middle of "one small step" animation, reset to 0. ), Ot.length > 0) { - et(); + nt(); return; } - const d = z < n().results.length - 1 ? dn : et; - xt(z, () => { + const d = z < n().results.length - 1 ? gn : nt; + $t(z, () => { Bt(z, () => { - z++, $e(z), Mt(z, d); + z++, Ee(z), Pt(z, d); }); }); } - ks(() => { - Wn(); + Ds(() => { + Gn(); }); - let lt = 0; - function Wn() { - if (lt != r()) { - if (dt) { + let ft = 0; + function Gn() { + if (ft != r()) { + if (pt) { Ot.push({ type: "round", round: r() }); return; } - lt == r() - 1 && lt > 0 ? Ye() : Ve(r()), lt = r(); + ft == r() - 1 && ft > 0 ? Xe() : ze(r()), ft = r(); } } - function Ve(d) { - if (dt) { + function ze(d) { + if (pt) { Ot.push({ type: "round", round: d }); return; } - c(0), Ae(d); + c(0), Re(d); } - function Ye() { - if (dt) { + function Xe() { + if (pt) { Ot.push({ type: "round", round: r() }); return; } @@ -5020,336 +5020,360 @@ function ol(t, e) { return; } if (z = r(), z > n().results.length) { - br(), dt = !1; + $r(), pt = !1; return; } - dt = !0, c() === 0 ? xt(z - 1, () => { + pt = !0, c() === 0 ? $t(z - 1, () => { Bt(z - 1, () => { - Mt(z, et); + Pt(z, nt); }); }) : c() === 1 ? Bt(z - 1, () => { - Mt(z, et); - }) : c() === 2 && Mt(z, et), c(0); + Pt(z, nt); + }) : c() === 2 && Pt(z, nt), c(0); } - function pn() { + function _n() { if (r() > n().results.length) { - br(), dt = !1; + $r(), pt = !1; return; } - if (dt) { + if (pt) { Ot.push({ type: "step" }); return; } - dt = !0, c((c() + 1) % 3), z = r(), c() === 1 ? xt(z, et) : c() === 2 ? Bt(z, et) : c() === 0 ? (z++, $e(z), Mt(z, et)) : (dt = !1, console.warn("displayPhase out of range at ", c())); - } - function yr(d) { - Tt = j(d), Ct = Us(d, C, Tt, 0, ht(), !0), Us(d, P, Tt, 0, ht(), !1, !0), ut(x(Z)).select("#" + P).selectAll(".eliminated").remove(); - } - function wr(d, _) { - const m = ut(x(Z)).select("#" + k), A = Ce().outerRadius(d).innerRadius(d - 1), b = m.selectAll(".slice"); - let R = b.size(); - function N() { - R--, R === 0 && dl(); + pt = !0, c((c() + 1) % 3), z = r(), c() === 1 ? $t(z, nt) : c() === 2 ? Bt(z, nt) : c() === 0 ? (z++, Ee(z), Pt(z, nt)) : (pt = !1, console.warn("displayPhase out of range at ", c())); + } + function wr(d) { + Tt = j(d), xt = Js(d, C, Tt, 0, dt(), !0), Js(d, D, Tt, 0, dt(), !1, !0), at(x(Z)).select("#" + D).selectAll(".eliminated").remove(); + } + function xr(d, _) { + const m = at(x(Z)).select("#" + P), b = at(x(Z)).select("#" + C), T = {}; + for (const S of xt) { + const M = S.data.label; + if (S.data.isTransfer) continue; + const R = b.select("#" + CSS.escape(p(S.data))); + R.empty() || (T[M] = { + oldStart: Number(R.attr("prevStart")), + oldEnd: Number(R.attr("prevEnd")), + newStart: S.startAngle, + newEnd: S.endAngle + }); } - b.select("path").transition("global").duration(Q).attr("d", (q) => A(q)).on("end", (q) => N()); + const N = m.selectAll(".slice"); + let V = N.size(); + function L() { + V--, V === 0 && vl(); + } + N.select("path").transition("global").duration(Q).attrTween("d", function(S) { + const M = S.startAngle, R = S.endAngle, X = R - M, Kt = T[S.data.label]; + let rt, Ce; + if (Kt) { + const Kn = (Kt.oldStart + Kt.oldEnd) / 2, wl = (Kt.newStart + Kt.newEnd) / 2, xl = M - Kn; + rt = wl + xl, Ce = rt + X; + } else + rt = M, Ce = R; + const tt = Ue(M, rt), se = Ue(R, Ce), Zr = Ue(_, d), Ar = Se(); + return function(Kn) { + return Ar.innerRadius(Math.min(Zr(Kn), d) - 1).outerRadius(Zr(Kn)).startAngle(tt(Kn)).endAngle(se(Kn)), Ar(S); + }; + }).on("end", (S) => L()); } - function xr(d) { - const _ = ll(d, Ct); - It = Ws(d, k, _, E, S, ht(), en(), !1, !0); - const m = ut(x(Z)); - m.select("#" + C).raise(), m.select("#" + P).raise(); + function br(d) { + const _ = fl(d, xt); + It = Ks(d, P, _, A, k, dt(), He(), !1, !0); + const m = at(x(Z)); + m.select("#" + C).raise(), m.select("#" + D).raise(); } - function He(d) { - const _ = fl(d, It, Ct); - It = Js(d, k, _, ht(), en(), !1); + function Be(d) { + const _ = hl(d, It, xt); + It = Qs(d, P, _, dt(), He(), !1); } function Gt(d) { - return Nt[d.data.label]; + return St[d.data.label]; } - function qi(d) { + function Hi(d) { const _ = {}, m = n().results[d - 1].tallyResults; - for (let A = 0; A < m.length; A++) { - let b = m[A].eliminated; - if (b === void 0 && (b = m[A].elected), b === void 0) { + for (let E = 0; E < m.length; E++) { + let b = m[E].eliminated; + if (b === void 0 && (b = m[E].elected), b === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const R = m[A].transfers; - if (R === void 0) { + const T = m[E].transfers; + if (T === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [N, q] of Object.entries(R)) - _[N] === void 0 ? _[N] = Number(q) : _[N] += Number(q); + for (let [N, V] of Object.entries(T)) + _[N] === void 0 ? _[N] = Number(V) : _[N] += Number(V); } return _; } - function ll(d, _) { - const m = [], A = he, b = n().results[d - 1].tallyResults; - for (let R = 0; R < b.length; R++) { - let N = b[R].eliminated; - if (N === void 0 && (N = b[R].elected), N === void 0) { + function fl(d, _) { + const m = [], E = pe, b = n().results[d - 1].tallyResults; + for (let T = 0; T < b.length; T++) { + let N = b[T].eliminated; + if (N === void 0 && (N = b[T].elected), N === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const q = b[R].transfers; - if (q === void 0) { + const V = b[T].transfers; + if (V === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let V = _.find((I) => I.data.label == N && I.data.isTransfer); - V === void 0 && (V = _.find((I) => I.data.label == N && !I.data.isTransfer)); - let F = 0; - if (V) F = V.startAngle; + let L = _.find((M) => M.data.label == N && M.data.isTransfer); + L === void 0 && (L = _.find((M) => M.data.label == N && !M.data.isTransfer)); + let S = 0; + if (L) S = L.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [I, T] of Object.entries(q)) { - let U; - const vn = _.find((rt) => rt.data.label == I); - if (vn) - U = structuredClone(vn); - else if (I == "exhausted") - U = { - data: { label: I, value: Number(T) }, + for (let [M, R] of Object.entries(V)) { + let X; + const Kt = _.find((tt) => tt.data.label == M); + if (Kt) + X = structuredClone(Kt); + else if (M == "exhausted") + X = { + data: { label: M, value: Number(R) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (I == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", T); + else if (M == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", R); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", I); + console.warn("makeDonutInfo: unrecognized name in transfers ", M); continue; } - const Un = Number(T) / A * 2 * Math.PI; - U.startAngle = F, F = U.endAngle = F + Un, U.index = R, U.data.transferIndex = R, m.push(U); + const Ce = Number(R) / E * 2 * Math.PI; + X.startAngle = S, S = X.endAngle = S + Ce, X.index = T, X.data.transferIndex = T, m.push(X); } } return m; } - function ul(d, _, m) { - const A = {}; - for (let [b, R] of Object.entries(d)) { - const N = m.find((F) => b == F.data.label); + function cl(d, _, m) { + const E = {}; + for (let [b, T] of Object.entries(d)) { + const N = m.find((S) => b == S.data.label); if (N === void 0) { console.warn("getTransferStartAngles: mainPieObj not found for ", b); continue; } - const q = (N.startAngle + N.endAngle) / 2, V = d[N.data.label] / _ * 2 * Math.PI; - A[N.data.label] = q - V / 2; + const V = (N.startAngle + N.endAngle) / 2, L = d[N.data.label] / _ * 2 * Math.PI; + E[N.data.label] = V - L / 2; } - return A; - } - function fl(d, _, m) { - const A = [], b = he, R = qi(d), N = ul(R, b, m); - for (let [q, V] of _.entries()) { - const F = structuredClone(V), I = V.endAngle - V.startAngle, T = m.find((U) => V.data.label === U.data.label && !U.data.isTransfer); - if (T) { - const U = T.data.label; - F.startAngle = N[U], N[U] += I, F.endAngle = F.startAngle + I; - } else if (V.data.label === "exhausted") - F.startAngle = V.startAngle, F.endAngle = V.endAngle; + return E; + } + function hl(d, _, m) { + const E = [], b = pe, T = Hi(d), N = cl(T, b, m); + for (let [V, L] of _.entries()) { + const S = structuredClone(L), M = L.endAngle - L.startAngle, R = m.find((X) => L.data.label === X.data.label && !X.data.isTransfer); + if (R) { + const X = R.data.label; + S.startAngle = N[X], N[X] += M, S.endAngle = S.startAngle + M; + } else if (L.data.label === "exhausted") + S.startAngle = L.startAngle, S.endAngle = L.endAngle; else { - console.warn("updateDonutInfo: unrecognized slice name ", V.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", L.data.label); continue; } - F.index = q, A.push(F); + S.index = V, E.push(S); } - return A; - } - function Xs(d, _, m, A, b, R) { - const q = ut(x(Z)).append("g").attr("id", G).attr("transform", `translate(${m}, ${A})`), V = Ce().innerRadius(b * K).outerRadius(b * K); - q.selectAll("text").data(_).enter().each(function(F) { - F.endAngle - F.startAngle < nt || F.data.isTransfer || ut(this).append("g").attr("id", (I) => p(I.data)).classed("eliminated", (I) => R.includes(I.data.label) || I.data.isTransfer === !0).each(function(I, T) { - I.data.label === "exhausted" && ut(this).on("mouseenter", (U, vn) => vl(U)).on("mouseleave", (U, vn) => gl()); - }).append("text").attr("transform", (I) => `translate(${V.centroid(I)})`).attr("text-anchor", (I) => Vi(I.startAngle, I.endAngle)).text((I) => I.data.label === "exhausted" ? tn : I.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((I) => { - const T = Oi(I.data.label, d); - return !h() && Gr(I.data.label) ? T : T + " (" + zn(I.data.label, d) + ")"; + return E; + } + function Us(d, _, m, E, b, T) { + const V = at(x(Z)).append("g").attr("id", G).attr("transform", `translate(${m}, ${E})`), L = Se().innerRadius(b * K).outerRadius(b * K); + V.selectAll("text").data(_).enter().each(function(S) { + S.endAngle - S.startAngle < it || S.data.isTransfer || at(this).append("g").attr("id", (M) => p(M.data)).classed("eliminated", (M) => T.includes(M.data.label) || M.data.isTransfer === !0).each(function(M, R) { + M.data.label === "exhausted" && at(this).on("mouseenter", (X, Kt) => _l(X)).on("mouseleave", (X, Kt) => ml()); + }).append("text").attr("transform", (M) => `translate(${L.centroid(M)})`).attr("text-anchor", (M) => zi(M.startAngle, M.endAngle)).text((M) => M.data.label === "exhausted" ? sn : M.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((M) => { + const R = Vi(M.data.label, d); + return !h() && Jr(M.data.label) ? R : R + " (" + Bn(M.data.label, d) + ")"; }); }); } - function cl(d, _, m, A) { - const R = ut(x(Z)).select("#" + G), N = R.selectAll("tspan"), q = R.selectAll("g").data(_, (T) => p(T.data)).classed("eliminated", (T) => A.includes(T.data.label) || T.data.isTransfer === !0), V = Ce().innerRadius(m * K).outerRadius(m * K + 1); - N.transition("global").duration(Q).attr("transform", (T) => `translate(${V.centroid(T)})`).attr("text-anchor", (T) => Vi(T.startAngle, T.endAngle)), q.select("text").transition("global").duration(Q).attr("transform", (T) => `translate(${V.centroid(T)})`).attr("text-anchor", (T) => Vi(T.startAngle, T.endAngle)).on("end", (T) => I()); - let F = q.size(); - function I(T) { - F--, F === 0 && (R.remove(), Xs(d, _, E, S, m, A)); + function dl(d, _, m, E) { + const T = at(x(Z)).select("#" + G), N = T.selectAll("tspan"), V = T.selectAll("g").data(_, (R) => p(R.data)).classed("eliminated", (R) => E.includes(R.data.label) || R.data.isTransfer === !0), L = Se().innerRadius(m * K).outerRadius(m * K + 1); + N.transition("global").duration(Q).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => zi(R.startAngle, R.endAngle)), V.select("text").transition("global").duration(Q).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => zi(R.startAngle, R.endAngle)).on("end", (R) => M()); + let S = V.size(); + function M(R) { + S--, S === 0 && (T.remove(), Us(d, _, A, k, m, E)); } } - function Bs(d, _, m, A, b, R, N, q = !0, V = !1, F = !1) { - const T = ji().sort(null).value((U) => U.value)(m); - return Ws(d, _, T, A, b, R, N, q, V, F), T; - } - function br() { - ut(x(Z)).select("#" + P).selectAll(".elected").select("path").style("stroke", D).style("stroke-width", `${Xt}px`); - } - function Ws(d, _, m, A, b, R, N, q, V, F = !1) { - const I = Bn(d), T = w(d), bt = ut(x(Z)).attr("viewBox", `0 0 ${g} ${y}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${A}, ${b})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (rt) => I.includes(rt.data.label) || rt.data.isTransfer === !0).classed("elected", (rt) => T.includes(rt.data.label) && !rt.data.isTransfer).attr("id", (rt) => p(rt.data)); - F ? bt.style("pointer-events", "none") : bt.on("mouseenter", (rt, Ee) => Hi(rt, Ee)).on("mouseleave", (rt, Ee) => zi(rt, Ee)); - const Un = Ce().outerRadius(N).innerRadius(R); - if (V) { - const rt = Ce().outerRadius(R + 1).innerRadius(R); - bt.append("path").attr("d", rt).attr("stroke", F ? "none" : gt).attr("stroke-width", F ? 0 : M).attr("fill", "none").transition("global").duration(Q).attr("d", (Ee) => Un(Ee)).attr("fill", F ? "none" : (Ee) => Gt(Ee)).on("end", (Ee) => { - F || Yi(); + function Gs(d, _, m, E, b, T, N, V = !0, L = !1, S = !1) { + const R = es().sort(null).value((X) => X.value)(m); + return Ks(d, _, R, E, b, T, N, V, L, S), R; + } + function $r() { + at(x(Z)).select("#" + D).selectAll(".elected").select("path").style("stroke", I).style("stroke-width", `${Xt}px`); + } + function Ks(d, _, m, E, b, T, N, V, L, S = !1) { + const M = Un(d), R = w(d), rt = at(x(Z)).attr("viewBox", `0 0 ${g} ${y}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${E}, ${b})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (tt) => M.includes(tt.data.label) || tt.data.isTransfer === !0).classed("elected", (tt) => R.includes(tt.data.label) && !tt.data.isTransfer).attr("id", (tt) => p(tt.data)); + S ? rt.style("pointer-events", "none") : rt.on("mouseenter", (tt, se) => Bi(tt, se)).on("mouseleave", (tt, se) => Wi(tt, se)); + const Ce = Se().outerRadius(N).innerRadius(T); + if (L) { + const tt = Se().outerRadius(T + 1).innerRadius(T); + rt.append("path").attr("d", tt).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F).attr("fill", "none").transition("global").duration(Q).attr("d", (se) => Ce(se)).attr("fill", S ? "none" : (se) => Gt(se)).on("end", (se) => { + S || Xi(); }); } else - bt.append("path").attr("d", (rt) => Un(rt)).attr("fill", F ? "none" : (rt) => Gt(rt)).attr("stroke", F ? "none" : gt).attr("stroke-width", F ? 0 : M), F || Yi(); - return q && !F && Xs(d, m, A, b, N, I), m; + rt.append("path").attr("d", (tt) => Ce(tt)).attr("fill", S ? "none" : (tt) => Gt(tt)).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F), S || Xi(); + return V && !S && Us(d, m, E, b, N, M), m; } - function hl() { - const m = ut(x(Z)).select("#" + G).selectAll(".eliminated"); + function pl() { + const m = at(x(Z)).select("#" + G).selectAll(".eliminated"); m.size() > 0 && m.classed("finished", !0); } - function dl() { - const m = ut(x(Z)).select("#" + G).selectAll(".finished"); + function vl() { + const m = at(x(Z)).select("#" + G).selectAll(".finished"); m.size() > 0 && m.remove(); } - function pl(d, _) { - const b = ut(x(Z)).select("#" + C).selectAll(".eliminated"), R = Ce().innerRadius(d), N = Ce().outerRadius(_); - b.classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(q) { - const V = Jn(_, d); - return function(F) { - return N.innerRadius(V(F)), N(q); + function gl(d, _) { + const b = at(x(Z)).select("#" + C).selectAll(".eliminated"), T = Se().innerRadius(d), N = Se().outerRadius(_); + b.classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(V) { + const L = Ue(_, d); + return function(S) { + return N.innerRadius(L(S)), N(V); }; - }).attr("fill", (q) => `url(#${re(q.data.label)})`), b.clone(!0).classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(q) { - const V = Jn(_, d); - return function(F) { - return R.outerRadius(V(F)), R(q); + }).attr("fill", (V) => `url(#${ie(V.data.label)})`), b.clone(!0).classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(V) { + const L = Ue(_, d); + return function(S) { + return T.outerRadius(L(S)), T(V); }; - }).attr("fill", (q) => Gt(q)); + }).attr("fill", (V) => Gt(V)); } - function Vi(d, _) { + function zi(d, _) { const m = (d + _) / 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 Yi() { - ut(x( + function Xi() { + at(x( Z // force redisplay of text labels )).select("#" + G).raise().append("g").remove(); } - function Us(d, _, m, A, b, R, N = !1) { - const V = ji().sort(null).value((F) => F.value)(m); - return Js(d, _, V, A, b, R, N), V; - } - function Gs(d, _, m, A, b = !1) { - const R = Bn(d), N = w(d), F = ut(x(Z)).select("#" + _).selectAll(".slice").data(m, (T) => p(T.data)), I = F.enter().append("g").attr("class", "slice").attr("id", (T) => p(T.data)).classed("eliminated", !0); - return b ? I.style("pointer-events", "none") : I.on("mouseenter", (T, U) => Hi(T, U)).on("mouseleave", (T, U) => zi(T, U)), I.append("path").attr("d", (T) => A(T)).attr("fill", b ? "none" : (T) => Gt(T)).attr("stroke", b ? "none" : gt).attr("stroke-width", b ? 0 : M), F.classed("eliminated", (T) => R.includes(T.data.label)).classed("elected", (T) => N.includes(T.data.label)), b || F.on("mouseenter", (T, U) => Hi(T, U)).on("mouseleave", (T, U) => zi(T, U)), F; - } - function Ks(d, _, m, A, b, R = !1) { - const N = Ce().outerRadius(b).innerRadius(A); - Gs(d, _, m, N, R).select("path").attr("d", (V) => N(V)).attr("fill", R ? "none" : (V) => Gt(V)); - } - function Js(d, _, m, A, b, R, N = !1) { - const q = Ce().outerRadius(b).innerRadius(A).startAngle((bt) => bt.startAngle).endAngle((bt) => bt.endAngle), V = Ce().outerRadius(b).innerRadius(A), I = ut(x(Z)).select("#" + _); - I.selectAll(".slice").attr("prevStart", (bt) => bt.startAngle).attr("prevEnd", (bt) => bt.endAngle); - const T = Gs(d, _, m, V, N); - let U = T.size(); - function vn() { - U--, U <= 0 && (N || Yi(), I.selectAll(".finished").remove()); + function Js(d, _, m, E, b, T, N = !1) { + const L = es().sort(null).value((S) => S.value)(m); + return Qs(d, _, L, E, b, T, N), L; + } + function Zs(d, _, m, E, b = !1) { + const T = Un(d), N = w(d), S = at(x(Z)).select("#" + _).selectAll(".slice").data(m, (R) => p(R.data)), M = S.enter().append("g").attr("class", "slice").attr("id", (R) => p(R.data)).classed("eliminated", !0); + return b ? M.style("pointer-events", "none") : M.on("mouseenter", (R, X) => Bi(R, X)).on("mouseleave", (R, X) => Wi(R, X)), M.append("path").attr("d", (R) => E(R)).attr("fill", b ? "none" : (R) => Gt(R)).attr("stroke", b ? "none" : _t).attr("stroke-width", b ? 0 : F), S.classed("eliminated", (R) => T.includes(R.data.label)).classed("elected", (R) => N.includes(R.data.label)), b || S.on("mouseenter", (R, X) => Bi(R, X)).on("mouseleave", (R, X) => Wi(R, X)), S; + } + function js(d, _, m, E, b, T = !1) { + const N = Se().outerRadius(b).innerRadius(E); + Zs(d, _, m, N, T).select("path").attr("d", (L) => N(L)).attr("fill", T ? "none" : (L) => Gt(L)); + } + function Qs(d, _, m, E, b, T, N = !1) { + const V = Se().outerRadius(b).innerRadius(E).startAngle((rt) => rt.startAngle).endAngle((rt) => rt.endAngle), L = Se().outerRadius(b).innerRadius(E), M = at(x(Z)).select("#" + _); + M.selectAll(".slice").attr("prevStart", (rt) => rt.startAngle).attr("prevEnd", (rt) => rt.endAngle); + const R = Zs(d, _, m, L, N); + let X = R.size(); + function Kt() { + X--, X <= 0 && (N || Xi(), M.selectAll(".finished").remove()); } - return T.select("path").transition("global").duration(Q).attrTween("d", function(bt) { - const Un = Number(ut(this.parentNode).attr("prevStart")), rt = Number(ut(this.parentNode).attr("prevEnd")), Ee = Jn(Un, bt.startAngle), ml = Jn(rt, bt.endAngle); - return (js) => (q.startAngle(Ee(js)).endAngle(ml(js)), q(bt)); - }).on("end", vn), R && !N && cl(d, m, b, Bn(d)), m; + return R.select("path").transition("global").duration(Q).attrTween("d", function(rt) { + const Ce = Number(at(this.parentNode).attr("prevStart")), tt = Number(at(this.parentNode).attr("prevEnd")), se = Ue(Ce, rt.startAngle), Zr = Ue(tt, rt.endAngle); + return (Ar) => (V.startAngle(se(Ar)).endAngle(Zr(Ar)), V(rt)); + }).on("end", Kt), T && !N && dl(d, m, b, Un(d)), m; } - function Hi(d, _) { + function Bi(d, _) { s(_.data.label), i("enter"), a(d.clientX), o(d.clientY); } - function zi(d, _) { + function Wi(d, _) { s(_.data.label), i("leave"); } - function vl(d, _) { + function _l(d, _) { i("show-exhausted"), a(d.clientX), o(d.clientY); } - function gl(d, _) { + function ml(d, _) { i("hide-exhausted"); } - var _l = { - pieColors: Nt, - exhaustedLabel: tn, - countExhaustedVotes: nn, - getEliminatedCandidates: Bn, + var yl = { + pieColors: St, + exhaustedLabel: sn, + countExhaustedVotes: an, + getEliminatedCandidates: Un, getElectedCandidates: w, - runFullAnimationFn: rn, - animateOnePhaseFn: pn, + runFullAnimationFn: on, + animateOnePhaseFn: _n, get jsonData() { return n(); }, set jsonData(d) { - n(d), ft(); + n(d), ct(); }, get currentRound() { return r(); }, set currentRound(d = 1) { - r(d), ft(); + r(d), ct(); }, get mouseEventType() { return i(); }, set mouseEventType(d) { - i(d), ft(); + i(d), ct(); }, get mouseData() { return s(); }, set mouseData(d) { - s(d), ft(); + s(d), ct(); }, get mouseX() { return a(); }, set mouseX(d) { - a(d), ft(); + a(d), ct(); }, get mouseY() { return o(); }, set mouseY(d) { - o(d), ft(); + o(d), ct(); }, get requestRoundChange() { return l(); }, set requestRoundChange(d = (_) => { }) { - l(d), ft(); + l(d), ct(); }, get candidateColors() { return u(); }, set candidateColors(d = []) { - u(d), ft(); + u(d), ct(); }, get excludeFinalWinnerAndEliminatedCandidate() { return f(); }, set excludeFinalWinnerAndEliminatedCandidate(d = !1) { - f(d), ft(); + f(d), ct(); }, get firstRoundDeterminesPercentages() { return h(); }, set firstRoundDeterminesPercentages(d = !1) { - h(d), ft(); + h(d), ct(); }, get displayPhase() { return c(); }, set displayPhase(d = 0) { - c(d), ft(); + c(d), ct(); } - }, Zs = Ed(); - return si(Zs, (d) => st(Z, d), () => x(Z)), ve(t, Zs), Rs(_l); + }, ta = Td(); + return li(ta, (d) => ot(Z, d), () => x(Z)), _e(t, ta), Ss(yl); } -Mo( - ol, +Fo( + ul, { jsonData: {}, currentRound: {}, @@ -5375,8 +5399,8 @@ Mo( ], { mode: "open" } ); -var Cd = /* @__PURE__ */ Hn(" ", 1), Td = /* @__PURE__ */ Hn("About to eliminate: ", 1), Nd = /* @__PURE__ */ Hn(" ", 1), Sd = /* @__PURE__ */ Hn(" ", 1), kd = /* @__PURE__ */ Hn('

', 1), Pd = /* @__PURE__ */ Hn("
", 1), Md = /* @__PURE__ */ Hn('


these ballots have already been eliminated.
', 1); -const Dd = { +var Nd = /* @__PURE__ */ Xn(" ", 1), kd = /* @__PURE__ */ Xn("About to eliminate: ", 1), Md = /* @__PURE__ */ Xn(" ", 1), Pd = /* @__PURE__ */ Xn(" ", 1), Dd = /* @__PURE__ */ Xn('

', 1), Fd = /* @__PURE__ */ Xn("
", 1), Id = /* @__PURE__ */ Xn('


these ballots have already been eliminated.
', 1); +const Od = { 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;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl) {background-color:#4747ff;color:#fff;padding:1px 7px;font-size:0.67rem;min-width:107px;border:none;border-radius:3px;cursor:pointer;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl):hover {background-color:#4747c2;}.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;} @@ -5391,11 +5415,11 @@ const Dd = { }` }; -function Fd(t, e) { - Es(e, !0), ko(t, Dd); +function Ld(t, e) { + Ts(e, !0), Po(t, Od); const n = 0.85; - let r = pt(e, "electionSummary", 7), i = pt(e, "currentRound", 7, 1), s = pt(e, "requestRoundChange", 7, (w) => { - }), a = pt(e, "candidateColors", 23, () => []), o = pt(e, "textForWinner", 7, "elected"), l = pt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = pt(e, "firstRoundDeterminesPercentages", 7, !1), f = pt(e, "showCaptions", 7, !1); + let r = vt(e, "electionSummary", 7), i = vt(e, "currentRound", 7, 1), s = vt(e, "requestRoundChange", 7, (w) => { + }), a = vt(e, "candidateColors", 23, () => []), o = vt(e, "textForWinner", 7, "elected"), l = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = vt(e, "firstRoundDeterminesPercentages", 7, !1), f = vt(e, "showCaptions", 7, !1); const h = { elected: { caption: "Elected", @@ -5414,174 +5438,174 @@ function Fd(t, e) { infinitive: "to take the lead" } }; - let c = /* @__PURE__ */ Gn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ mt(null), g = /* @__PURE__ */ mt(null), y = /* @__PURE__ */ mt(""), $ = /* @__PURE__ */ mt(xn([])), E = /* @__PURE__ */ mt(""), S = /* @__PURE__ */ mt(""), C = /* @__PURE__ */ mt(0), P = /* @__PURE__ */ mt(0), k = /* @__PURE__ */ Gn(() => G(r())); + let c = /* @__PURE__ */ Jn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ yt(null), g = /* @__PURE__ */ yt(null), y = /* @__PURE__ */ yt(""), $ = /* @__PURE__ */ yt($n([])), A = /* @__PURE__ */ yt(""), k = /* @__PURE__ */ yt(""), C = /* @__PURE__ */ yt(0), D = /* @__PURE__ */ yt(0), P = /* @__PURE__ */ Jn(() => G(r())); function G(w) { if (typeof w == "string") try { w = JSON.parse(w); - } catch (B) { - return console.error("Failed to parse JSON string:", B), {}; + } catch (W) { + return console.error("Failed to parse JSON string:", W), {}; } return w || {}; } - function ot(w) { + function ut(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function K(w, B, j) { - w.style.left = B + "px", w.style.top = j + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const tt = w.getBoundingClientRect(); - let xt = B, Bt = j + 20; - xt + tt.width > window.innerWidth - 12 && (xt = window.innerWidth - tt.width - 12), xt < 12 && (xt = 12), Bt + tt.height > window.innerHeight - 12 && (Bt = j - tt.height - 12), w.style.left = xt + "px", w.style.top = Bt + "px"; + function K(w, W, j) { + w.style.left = W + "px", w.style.top = j + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const et = w.getBoundingClientRect(); + let $t = W, Bt = j + 20; + $t + et.width > window.innerWidth - 12 && ($t = window.innerWidth - et.width - 12), $t < 12 && ($t = 12), Bt + et.height > window.innerHeight - 12 && (Bt = j - et.height - 12), w.style.left = $t + "px", w.style.top = Bt + "px"; }); } - function nt() { - switch (x(E)) { + function it() { + switch (x(A)) { case "enter": ((w) => { - var B = Il(w, 2); - st($, B[0], !0), st(y, B[1], !0); - })(vt(x(S), i())), x(p) && (K(x(p), x(C) || 0, x(P) || 0), x(p).style.opacity = String(n)); + var W = ql(w, 2); + ot($, W[0], !0), ot(y, W[1], !0); + })(gt(x(k), i())), x(p) && (K(x(p), x(C) || 0, x(D) || 0), x(p).style.opacity = String(n)); break; case "leave": - x(p) && (x(p).style.opacity = "0"), st($, [], !0), st(y, ""); + x(p) && (x(p).style.opacity = "0"), ot($, [], !0), ot(y, ""); break; case "show-exhausted": - x(g) && (K(x(g), x(C) || 0, x(P) || 0), x(g).style.opacity = String(n)); + x(g) && (K(x(g), x(C) || 0, x(D) || 0), x(g).style.opacity = String(n)); break; case "hide-exhausted": x(g) && (x(g).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", x(E)); + console.log("Unknown mouse event: ", x(A)); break; } } - ks(() => nt()); - function Q(w, B) { - return w == 1 ? B ? "vote was" : "vote will be" : B ? "votes were" : "votes will be"; - } - function vt(w, B) { - const j = [], wt = w === "exhausted" ? z() : w; - let Pt; - w == "exhausted" ? Pt = Tt(1) : Pt = x(k).results[0].tally[w], j.push(`${wt} started with ${Pt} votes.`); - for (let tt = 1; tt <= B; tt++) { - tt === B && (w == "exhausted" ? Pt = Tt(B) : Pt = x(k).results[B - 1].tally[w], j.push(`${wt} has ${Pt} votes at round ${B}.`)); - const xt = x(k).results[tt - 1].tallyResults, Bt = re(tt); - for (let Mt = 0; Mt < xt.length; Mt++) { - const dt = xt[Mt].transfers, Ot = xt[Mt].eliminated, et = xt[Mt].elected; + Ds(() => it()); + function Q(w, W) { + return w === 1 ? W ? "vote was" : "vote will be" : W ? "votes were" : "votes will be"; + } + function gt(w, W) { + const j = [], bt = w === "exhausted" ? z() : w; + let Mt; + w === "exhausted" ? Mt = Tt(1) : Mt = x(P).results[0].tally[w], j.push(`${bt} started with ${Mt} votes.`); + for (let et = 1; et <= W; et++) { + et === W && (w === "exhausted" ? Mt = Tt(W) : Mt = x(P).results[W - 1].tally[w], j.push(`${bt} has ${Mt} votes at round ${W}.`)); + const $t = x(P).results[et - 1].tallyResults, Bt = ie(et); + for (let Pt = 0; Pt < $t.length; Pt++) { + const pt = $t[Pt].transfers, Ot = $t[Pt].eliminated, nt = $t[Pt].elected; if (!Bt) { if (Ot) - Ot === w && j.push(`${wt} will be eliminated on round ${tt}.`); - else if (w === et && (j.push(`${wt} ${x(c).event} on round ${tt}.`), dt)) - for (let [Ut, rn] of Object.entries(dt)) - j.push(`${rn} ${Q(Number(rn), tt < B)} transferred to ${Ut} on round ${tt}.`); + Ot === w && j.push(`${bt} will be eliminated on round ${et}.`); + else if (w === nt && (j.push(`${bt} ${x(c).event} on round ${et}.`), pt)) + for (let [Ut, on] of Object.entries(pt)) + j.push(`${on} ${Q(Number(on), et < W)} transferred to ${Ut} on round ${et}.`); } - const Wt = Ot || et; + const Wt = Ot || nt; if (Wt) { - const Ut = Number(dt[w]); - Ut && j.push(`${Ut} ${Q(Ut, tt < B)} transferred from ${Wt} on round ${tt}.`); + const Ut = Number(pt[w]); + Ut && j.push(`${Ut} ${Q(Ut, et < W)} transferred from ${Wt} on round ${et}.`); } } } - return [j, wt]; + return [j, bt]; } - function gt() { + function _t() { let w = 0; - for (let B = 1; B <= x(k).results.length; B++) { - if (re(B)) continue; - const j = x(k).results[B - 1].tallyResults; - for (let wt = 0; wt < j.length; wt++) - j[wt].elected && w++; + for (let W = 1; W <= x(P).results.length; W++) { + if (ie(W)) continue; + const j = x(P).results[W - 1].tallyResults; + for (let bt = 0; bt < j.length; bt++) + j[bt].elected && w++; } return w; } - const M = ["Eliminate", "Transfer", "Consolidate"]; - let D, Xt = /* @__PURE__ */ mt(0); - function re(w) { - return l() && x(k).results && w === x(k).results.length; + const F = ["Eliminate", "Transfer", "Consolidate"]; + let I, Xt = /* @__PURE__ */ yt(0); + function ie(w) { + return l() && x(P).results && w === x(P).results.length; } - function Ct(w) { - return re(w) ? [] : D ? D.getEliminatedCandidates(w) : []; + function xt(w) { + return ie(w) ? [] : I ? I.getEliminatedCandidates(w) : []; } function It(w) { - return re(w) ? [] : D ? D.getElectedCandidates(w) : []; + return ie(w) ? [] : I ? I.getElectedCandidates(w) : []; } function Tt(w) { - return D ? D.countExhaustedVotes(w) : 0; + return I ? I.countExhaustedVotes(w) : 0; } - function he() { - D && D.animateOnePhaseFn && D.animateOnePhaseFn(); + function pe() { + I && I.animateOnePhaseFn && I.animateOnePhaseFn(); } function z() { - return D ? D.exhaustedLabel : ""; + return I ? I.exhaustedLabel : ""; } - function Nt() { - return D ? D.pieColors : {}; + function St() { + return I ? I.pieColors : {}; } - var tn = { + var sn = { get electionSummary() { return r(); }, set electionSummary(w) { - r(w), ft(); + r(w), ct(); }, get currentRound() { return i(); }, set currentRound(w = 1) { - i(w), ft(); + i(w), ct(); }, get requestRoundChange() { return s(); }, - set requestRoundChange(w = (B) => { + set requestRoundChange(w = (W) => { }) { - s(w), ft(); + s(w), ct(); }, get candidateColors() { return a(); }, set candidateColors(w = []) { - a(w), ft(); + a(w), ct(); }, get textForWinner() { return o(); }, set textForWinner(w = "elected") { - o(w), ft(); + o(w), ct(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - l(w), ft(); + l(w), ct(); }, get firstRoundDeterminesPercentages() { return u(); }, set firstRoundDeterminesPercentages(w = !1) { - u(w), ft(); + u(w), ct(); }, get showCaptions() { return f(); }, set showCaptions(w = !1) { - f(w), ft(); + f(w), ct(); } - }, Z = Md(), kt = gn(Z), $e = Jt(kt); - $e.__click = he; - var Ae = Jt($e, !0); - Kt($e), Kt(kt); - var qe = de(kt, 4), ht = Jt(qe), en = Jt(ht), nn = Jt(en); - si( - ol(nn, { + }, Z = Id(), kt = mn(Z), Ee = Zt(kt); + Ee.__click = pe; + var Re = Zt(Ee, !0); + Jt(Ee), Jt(kt); + var Ye = ve(kt, 4), dt = Zt(Ye), He = Zt(dt), an = Zt(He); + li( + ul(an, { get jsonData() { - return x(k); + return x(P); }, get currentRound() { return i(); }, - requestRoundChange: ot, + requestRoundChange: ut, get candidateColors() { return a(); }, @@ -5592,131 +5616,131 @@ function Fd(t, e) { return u(); }, get mouseEventType() { - return x(E); + return x(A); }, set mouseEventType(w) { - st(E, w, !0); + ot(A, w, !0); }, get mouseData() { - return x(S); + return x(k); }, set mouseData(w) { - st(S, w, !0); + ot(k, w, !0); }, get mouseX() { return x(C); }, set mouseX(w) { - st(C, w, !0); + ot(C, w, !0); }, get mouseY() { - return x(P); + return x(D); }, set mouseY(w) { - st(P, w, !0); + ot(D, w, !0); }, get displayPhase() { return x(Xt); }, set displayPhase(w) { - st(Xt, w, !0); + ot(Xt, w, !0); } }), - (w) => D = w, - () => D - ), Kt(en), Kt(ht); - var Ur = de(ht, 2); + (w) => I = w, + () => I + ), Jt(He), Jt(dt); + var Kr = ve(dt, 2); { - var Oi = (w) => { - var B = kd(), j = gn(B), wt = Jt(j); - Kt(j); - var Pt = de(j, 2), tt = Jt(Pt); + var Vi = (w) => { + var W = Dd(), j = mn(W), bt = Zt(j); + Jt(j); + var Mt = ve(j, 2), et = Zt(Mt); { - var xt = (et) => { - var Wt = Td(), Ut = de(gn(Wt)); - Ui(Ut, 17, () => Ct(i()), Wi, (rn, dn, lt) => { - var Wn = Cd(), Ve = gn(Wn); - let Ye; - var pn = Jt(Ve, !0); - Kt(Ve); - var yr = de(Ve, 2); + var $t = (nt) => { + var Wt = kd(), Ut = ve(mn(Wt)); + Ji(Ut, 17, () => xt(i()), Ki, (on, gn, ft) => { + var Gn = Nd(), ze = mn(Gn); + let Xe; + var _n = Zt(ze, !0); + Jt(ze); + var wr = ve(ze, 2); { - var wr = (He) => { - var Gt = la(", "); - ve(He, Gt); - }, xr = /* @__PURE__ */ Gn(() => lt < Ct(i()).length - 1); - $r(yr, (He) => { - x(xr) && He(wr); + var xr = (Be) => { + var Gt = fa(", "); + _e(Be, Gt); + }, br = /* @__PURE__ */ Jn(() => ft < xt(i()).length - 1); + Er(wr, (Be) => { + x(br) && Be(xr); }); } - Kn( - (He) => { - Ye = ca(Ve, "", Ye, He), sn(pn, x(dn)); + Zn( + (Be) => { + Xe = da(ze, "", Xe, Be), ln(_n, x(gn)); }, - [() => ({ color: Nt()[x(dn)] })] - ), ve(rn, Wn); - }), ve(et, Wt); - }, Bt = /* @__PURE__ */ Gn(() => Ct(i()).length > 0); - $r(tt, (et) => { - x(Bt) && et(xt); + [() => ({ color: St()[x(gn)] })] + ), _e(on, Gn); + }), _e(nt, Wt); + }, Bt = /* @__PURE__ */ Jn(() => xt(i()).length > 0); + Er(et, (nt) => { + x(Bt) && nt($t); }); } - var Mt = de(tt, 2); + var Pt = ve(et, 2); { - var dt = (et) => { - var Wt = Sd(), Ut = gn(Wt), rn = de(Ut); - Ui(rn, 17, () => It(i()), Wi, (dn, lt, Wn) => { - var Ve = Nd(), Ye = gn(Ve); - let pn; - var yr = Jt(Ye, !0); - Kt(Ye); - var wr = de(Ye, 2); + var pt = (nt) => { + var Wt = Pd(), Ut = mn(Wt), on = ve(Ut); + Ji(on, 17, () => It(i()), Ki, (gn, ft, Gn) => { + var ze = Md(), Xe = mn(ze); + let _n; + var wr = Zt(Xe, !0); + Jt(Xe); + var xr = ve(Xe, 2); { - var xr = (Gt) => { - var qi = la(", "); - ve(Gt, qi); - }, He = /* @__PURE__ */ Gn(() => Wn < It(i()).length - 1); - $r(wr, (Gt) => { - x(He) && Gt(xr); + var br = (Gt) => { + var Hi = fa(", "); + _e(Gt, Hi); + }, Be = /* @__PURE__ */ Jn(() => Gn < It(i()).length - 1); + Er(xr, (Gt) => { + x(Be) && Gt(br); }); } - Kn( + Zn( (Gt) => { - pn = ca(Ye, "", pn, Gt), sn(yr, x(lt)); + _n = da(Xe, "", _n, Gt), ln(wr, x(ft)); }, - [() => ({ color: Nt()[x(lt)] })] - ), ve(dn, Ve); - }), Kn(() => sn(Ut, `${x(c).caption ?? ""}: `)), ve(et, Wt); - }, Ot = /* @__PURE__ */ Gn(() => It(i()).length > 0); - $r(Mt, (et) => { - x(Ot) && et(dt); + [() => ({ color: St()[x(ft)] })] + ), _e(gn, ze); + }), Zn(() => ln(Ut, `${x(c).caption ?? ""}: `)), _e(nt, Wt); + }, Ot = /* @__PURE__ */ Jn(() => It(i()).length > 0); + Er(Pt, (nt) => { + x(Ot) && nt(pt); }); } - Kt(Pt), Kn((et) => sn(wt, `${x(k).config.contest ?? ""}, ${et ?? ""} ${x(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [gt]), ve(w, B); + Jt(Mt), Zn((nt) => ln(bt, `${x(P).config.contest ?? ""}, ${nt ?? ""} ${x(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [_t]), _e(w, W); }; - $r(Ur, (w) => { - f() && w(Oi); + Er(Kr, (w) => { + f() && w(Vi); }); } - Kt(qe); - var zn = de(qe, 2), mr = Jt(zn), Gr = Jt(mr, !0); - Kt(mr); - var Li = de(mr, 2); - Ui(Li, 17, () => x($), Wi, (w, B) => { - var j = Pd(), wt = gn(j), Pt = Jt(wt, !0); - Kt(wt), es(2), Kn(() => sn(Pt, x(B))), ve(w, j); - }), Kt(zn), si(zn, (w) => st(p, w), () => x(p)); - var Xn = de(zn, 2), Bn = Jt(Xn); - return es(2), Kt(Xn), si(Xn, (w) => st(g, w), () => x(g)), Kn( + Jt(Ye); + var Bn = ve(Ye, 2), yr = Zt(Bn), Jr = Zt(yr, !0); + Jt(yr); + var Yi = ve(yr, 2); + Ji(Yi, 17, () => x($), Ki, (w, W) => { + var j = Fd(), bt = mn(j), Mt = Zt(bt, !0); + Jt(bt), is(2), Zn(() => ln(Mt, x(W))), _e(w, j); + }), Jt(Bn), li(Bn, (w) => ot(p, w), () => x(p)); + var Wn = ve(Bn, 2), Un = Zt(Wn); + return is(2), Jt(Wn), li(Wn, (w) => ot(g, w), () => x(g)), Zn( (w) => { - sn(Ae, M[x(Xt)]), sn(Gr, x(y)), sn(Bn, `"${w ?? ""}" means all the candidates ranked on `); + ln(Re, F[x(Xt)]), ln(Jr, x(y)), ln(Un, `"${w ?? ""}" means all the candidates ranked on `); }, [z] - ), ve(t, Z), Rs(tn); + ), _e(t, Z), Ss(sn); } -Au(["click"]); -customElements.define("pie-chart", Mo( - Fd, +Cu(["click"]); +customElements.define("pie-chart", Fo( + Ld, { electionSummary: {}, currentRound: {}, From f6e3de85e3fcb0402433ffab4ba38d4d00930d97 Mon Sep 17 00:00:00 2001 From: skaphan Date: Tue, 24 Mar 2026 20:12:29 +0000 Subject: [PATCH 19/31] Address PR review feedback - Make pie_chart_no_cache conditional on DEBUG - Remove TODO comment from pie.css - Renumber hidePie migration to 0034 (avoids conflict with caching PR) - Move _stringify to common.stringify (public API) - Improve testGraphToRCtab docstring explaining its purpose - Remove scripts/reset-db.sh from .gitignore - Add pie chart round-change Selenium test Co-Authored-By: Claude Opus 4.6 --- .gitignore | 1 - rcvis/settings.py | 4 +- static/pie/pie.css | 1 - visualizer/common.py | 8 ++++ ..._hidepie.py => 0034_jsonconfig_hidepie.py} | 2 +- visualizer/pie/graphToRCtab.py | 20 +++------- visualizer/tests/testGraphToRCtab.py | 20 ++++++---- visualizer/tests/testLiveBrowserHeadless.py | 37 +++++++++++++++++++ 8 files changed, 66 insertions(+), 27 deletions(-) rename visualizer/migrations/{0033_jsonconfig_hidepie.py => 0034_jsonconfig_hidepie.py} (80%) diff --git a/.gitignore b/.gitignore index 6159c8fa..ab1ce312 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,3 @@ staticfiles/ !.elasticbeanstalk/*.global.yml **/**/dist/ -scripts/reset-db.sh diff --git a/rcvis/settings.py b/rcvis/settings.py index e288d61f..d723f6d5 100644 --- a/rcvis/settings.py +++ b/rcvis/settings.py @@ -194,8 +194,8 @@ def pie_chart_no_cache(headers, path, url): - """Ensure browsers revalidate the pie chart component on every load.""" - if url.endswith('pie-chart.es.js'): + """In development, ensure browsers revalidate the pie chart component on every load.""" + if DEBUG and url.endswith('pie-chart.es.js'): headers['Cache-Control'] = 'no-cache' diff --git a/static/pie/pie.css b/static/pie/pie.css index a767859d..6b712c7c 100644 --- a/static/pie/pie.css +++ b/static/pie/pie.css @@ -1,4 +1,3 @@ -/* TODO -- SHEL -- Pie CSS here */ #pie-body { max-width: 800px; width: 100%; diff --git a/visualizer/common.py b/visualizer/common.py index 1772bccb..96edf434 100644 --- a/visualizer/common.py +++ b/visualizer/common.py @@ -34,6 +34,14 @@ def percentify(numerator, denominator): return str(round(10000.0 * floatVal) / 100.0) + "%" +def stringify(value): + """ Convert a number to string, matching RCTab JSON convention. + Integers are formatted without decimals. """ + if isinstance(value, float) and value == int(value): + return str(int(value)) + return str(value) + + def candidate_renames(): """ A dictionary mapping how we should rename candidate names """ return { diff --git a/visualizer/migrations/0033_jsonconfig_hidepie.py b/visualizer/migrations/0034_jsonconfig_hidepie.py similarity index 80% rename from visualizer/migrations/0033_jsonconfig_hidepie.py rename to visualizer/migrations/0034_jsonconfig_hidepie.py index 9beb3559..11a38a61 100644 --- a/visualizer/migrations/0033_jsonconfig_hidepie.py +++ b/visualizer/migrations/0034_jsonconfig_hidepie.py @@ -6,7 +6,7 @@ class Migration(migrations.Migration): dependencies = [ - ('visualizer', '0032_jsonconfig_forcefirstrounddeterminespercentages'), + ('visualizer', '0033_add_updated_at'), ] operations = [ diff --git a/visualizer/pie/graphToRCtab.py b/visualizer/pie/graphToRCtab.py index 174931a7..26f0960c 100644 --- a/visualizer/pie/graphToRCtab.py +++ b/visualizer/pie/graphToRCtab.py @@ -13,14 +13,6 @@ from visualizer.graph.rcvResult import Elimination, WinTransfer -def _stringify(value): - """ Convert a number to string, matching RCTab JSON convention. - Integers are formatted without decimals. """ - if isinstance(value, float) and value == int(value): - return str(int(value)) - return str(value) - - def graph_to_rctab_json(graph): """ Build an RCTab-compatible JSON dict from a processed Graph. @@ -76,7 +68,7 @@ def graph_to_rctab_json(graph): for name in interleaved_order: if name in names_this_round: candidate, node = names_this_round[name] - tally[name] = _stringify(node.count) + tally[name] = common.stringify(node.count) # Build tallyResults from transfersPerRound tally_results = [] @@ -95,7 +87,7 @@ def graph_to_rctab_json(graph): transfers = {} for target_candidate, count in transfer.transfersByCandidate.items(): if count != 0: - transfers[target_candidate.name] = _stringify(count) + transfers[target_candidate.name] = common.stringify(count) tally_result['transfers'] = transfers tally_results.append(tally_result) @@ -106,11 +98,11 @@ def graph_to_rctab_json(graph): if candidate.name == common.INACTIVE_TEXT and candidate in nodes_this_round: exhausted = nodes_this_round[candidate].count if exhausted > 0: - inactive_ballots['exhaustedChoices'] = _stringify(exhausted) + inactive_ballots['exhaustedChoices'] = common.stringify(exhausted) break # Threshold: RCTab has per-round threshold, rcvis stores a single value - threshold = _stringify(graph.threshold) if graph.threshold is not None else "0" + threshold = common.stringify(graph.threshold) if graph.threshold is not None else "0" results.append({ 'round': round_i + 1, @@ -130,10 +122,10 @@ def graph_to_rctab_json(graph): 'jsonFormatVersion': '1', 'results': results, 'summary': { - 'finalThreshold': _stringify(graph.threshold) if graph.threshold is not None else "0", + 'finalThreshold': common.stringify(graph.threshold) if graph.threshold is not None else "0", 'numCandidates': num_active_candidates, 'numWinners': summary.numWinners, - 'totalNumBallots': _stringify(first_round_total), + 'totalNumBallots': common.stringify(first_round_total), }, } diff --git a/visualizer/tests/testGraphToRCtab.py b/visualizer/tests/testGraphToRCtab.py index cddfa37a..6b5dc83f 100644 --- a/visualizer/tests/testGraphToRCtab.py +++ b/visualizer/tests/testGraphToRCtab.py @@ -1,13 +1,17 @@ """ Tests for the graphToRCtab converter that builds RCTab-compatible JSON -from processed Graph objects for the pie chart component. +from processed Graph objects. The converter bridges rcvis's internal Graph +representation to the RCTab JSON format consumed by the pie chart component. +These tests verify the conversion logic (structure, types, candidate handling), +not the pie chart rendering itself. """ from django.test import TestCase from visualizer import common from visualizer.graph.graphCreator import make_graph_with_file -from visualizer.pie.graphToRCtab import graph_to_rctab_json, _stringify +from visualizer.common import stringify +from visualizer.pie.graphToRCtab import graph_to_rctab_json from visualizer.tests import filenames @@ -15,23 +19,23 @@ class StringifyTests(TestCase): """ Tests for the _stringify helper """ def test_integer_unchanged(self): - self.assertEqual(_stringify(42), "42") + self.assertEqual(stringify(42), "42") def test_integer_float_drops_decimal(self): - self.assertEqual(_stringify(42.0), "42") + self.assertEqual(stringify(42.0), "42") def test_actual_float_kept(self): - self.assertEqual(_stringify(42.5), "42.5") + self.assertEqual(stringify(42.5), "42.5") def test_zero(self): - self.assertEqual(_stringify(0), "0") + self.assertEqual(stringify(0), "0") def test_zero_float(self): - self.assertEqual(_stringify(0.0), "0") + self.assertEqual(stringify(0.0), "0") def test_string_passthrough(self): """ RCTab JSON sometimes has string values already """ - self.assertEqual(_stringify("100"), "100") + self.assertEqual(stringify("100"), "100") class OneRoundTests(TestCase): diff --git a/visualizer/tests/testLiveBrowserHeadless.py b/visualizer/tests/testLiveBrowserHeadless.py index 2cb7d144..000b2b27 100644 --- a/visualizer/tests/testLiveBrowserHeadless.py +++ b/visualizer/tests/testLiveBrowserHeadless.py @@ -705,3 +705,40 @@ def get_content(forceFirstRoundDeterminesPercentages): # total of 9 matches. self.assertEqual(contentTrue.count("How do you calculate percentages"), 9) self.assertEqual(contentFalse.count("How do you calculate percentages"), 0) + + def _get_pie_svg_text(self): + """ + Read text content from the pie chart's SVG, which lives inside + the custom element's shadow DOM. + """ + return self.browser.execute_script( + "const el = document.querySelector('pie-chart');" + "if (!el || !el.shadowRoot) return '';" + "const svg = el.shadowRoot.querySelector('svg');" + "return svg ? svg.textContent : '';") + + def test_pie_chart_round_change(self): + """ + Changing rounds in the pie chart's round player should update + the visible candidate labels in the SVG. + """ + self._upload(filenames.THREE_ROUND) + + # Switch to the pie chart tab + self._go_to_tab('pie-tab') + + # Wait for the pie chart to render + self._ensure_eventually_asserts( + lambda: self.assertTrue(len(self._get_pie_svg_text()) > 0)) + + # Change to round 1 via the pie's round player select. + # Round 1 should have all candidates including Banana, + # which is eliminated in later rounds. + container = self.browser.find_element(By.ID, 'pie-slider-container') + selectEl = container.find_element(By.CSS_SELECTOR, '.round-player-select') + select = Select(selectEl) + select.select_by_value('0') # Round 1 (0-indexed) + + # The SVG text lives inside the pie-chart custom element's shadow DOM + self._ensure_eventually_asserts( + lambda: self.assertIn('Banana', self._get_pie_svg_text())) From 95bcdf187dfdc2ee9209fba0945cfd70b46a6143 Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 25 Mar 2026 08:04:16 +0000 Subject: [PATCH 20/31] Update pie chart: fix ghost slices, button size --- static/pie/pie-chart.es.js | 4167 ++++++++++++++++++------------------ 1 file changed, 2085 insertions(+), 2082 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 675780e5..cbc9efb5 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,27 +1,27 @@ -var bl = Object.defineProperty; -var ea = (t) => { +var Al = Object.defineProperty; +var na = (t) => { throw TypeError(t); }; -var $l = (t, e, n) => e in t ? bl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var st = (t, e, n) => $l(t, typeof e != "symbol" ? e + "" : e, n), Ui = (t, e, n) => e.has(t) || ea("Cannot " + n); -var v = (t, e, n) => (Ui(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? ea("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), O = (t, e, n, r) => (Ui(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), mt = (t, e, n) => (Ui(t, e, "access private method"), n); -var Ma; -typeof window < "u" && ((Ma = window.__svelte ?? (window.__svelte = {})).v ?? (Ma.v = /* @__PURE__ */ new Set())).add("5"); -const Al = 1, El = 2, Rl = 16, Cl = 1, Tl = 4, Sl = 8, Nl = 16, kl = 2, Es = "[", Ti = "[!", Rs = "]", or = {}, At = Symbol(), Ml = "http://www.w3.org/1999/xhtml", ns = !1; -var Fa = Array.isArray, Pl = Array.prototype.indexOf, lr = Array.prototype.includes, Si = Array.from, vi = Object.keys, gi = Object.defineProperty, Mn = Object.getOwnPropertyDescriptor, Dl = Object.prototype, Fl = Array.prototype, Il = Object.getPrototypeOf, na = Object.isExtensible; -const Ol = () => { +var El = (t, e, n) => e in t ? Al(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var at = (t, e, n) => El(t, typeof e != "symbol" ? e + "" : e, n), Gi = (t, e, n) => e.has(t) || na("Cannot " + n); +var v = (t, e, n) => (Gi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? na("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), O = (t, e, n, r) => (Gi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), mt = (t, e, n) => (Gi(t, e, "access private method"), n); +var Pa; +typeof window < "u" && ((Pa = window.__svelte ?? (window.__svelte = {})).v ?? (Pa.v = /* @__PURE__ */ new Set())).add("5"); +const Rl = 1, Cl = 2, Tl = 16, Sl = 1, Nl = 4, kl = 8, Ml = 16, Pl = 2, Rs = "[", Si = "[!", Cs = "]", ur = {}, $t = Symbol(), Dl = "http://www.w3.org/1999/xhtml", rs = !1; +var Ia = Array.isArray, Fl = Array.prototype.indexOf, fr = Array.prototype.includes, Ni = Array.from, gi = Object.keys, _i = Object.defineProperty, Mn = Object.getOwnPropertyDescriptor, Il = Object.prototype, Ol = Array.prototype, Ll = Object.getPrototypeOf, ra = Object.isExtensible; +const ql = () => { }; -function Ll(t) { +function Vl(t) { for (var e = 0; e < t.length; e++) t[e](); } -function Ia() { +function Oa() { var t, e, n = new Promise((r, i) => { t = r, e = i; }); return { promise: n, resolve: t, reject: e }; } -function ql(t, e) { +function Yl(t, e) { if (Array.isArray(t)) return t; if (!(Symbol.iterator in t)) @@ -31,130 +31,130 @@ function ql(t, e) { if (n.push(r), n.length === e) break; return n; } -const Rt = 2, Fr = 4, Ni = 8, Oa = 1 << 24, rn = 16, $e = 32, vn = 64, La = 128, fe = 512, wt = 1024, Ct = 2048, be = 4096, ee = 8192, tn = 16384, gr = 32768, ur = 65536, ra = 1 << 17, qa = 1 << 18, zn = 1 << 19, Vl = 1 << 20, cn = 1 << 25, On = 65536, rs = 1 << 21, Cs = 1 << 22, hn = 1 << 23, Mr = Symbol("$state"), Va = Symbol("legacy props"), xn = new class extends Error { +const Et = 2, Lr = 4, ki = 8, La = 1 << 24, sn = 16, xe = 32, vn = 64, qa = 128, ae = 512, wt = 1024, Rt = 2048, we = 4096, jt = 8192, en = 16384, mr = 32768, cr = 65536, ia = 1 << 17, Va = 1 << 18, zn = 1 << 19, Hl = 1 << 20, cn = 1 << 25, On = 65536, is = 1 << 21, Ts = 1 << 22, hn = 1 << 23, Fr = Symbol("$state"), Ya = Symbol("legacy props"), xn = new class extends Error { constructor() { super(...arguments); - st(this, "name", "StaleReactionError"); - st(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + at(this, "name", "StaleReactionError"); + at(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } -}(), Wr = 3, _r = 8; -function Yl(t) { +}(), Kr = 3, yr = 8; +function zl(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function Hl() { +function Xl() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function zl(t, e, n) { +function Bl(t, e, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function Xl(t) { +function Wl(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function Bl() { +function Ul() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function Wl(t) { +function Gl(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function Ul() { +function Kl() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Gl() { +function Jl() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function Kl(t) { +function Zl(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function Jl() { +function jl() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Zl() { +function Ql() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function jl() { +function tu() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function Ql() { +function eu() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function ki(t) { +function Mi(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function tu() { +function nu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } let J = !1; -function Qe(t) { +function tn(t) { J = t; } let H; -function zt(t) { +function Ht(t) { if (t === null) - throw ki(), or; + throw Mi(), ur; return H = t; } -function Mi() { - return zt(/* @__PURE__ */ Le(H)); +function Pi() { + return Ht(/* @__PURE__ */ Oe(H)); } -function Jt(t) { +function Ut(t) { if (J) { - if (/* @__PURE__ */ Le(H) !== null) - throw ki(), or; + if (/* @__PURE__ */ Oe(H) !== null) + throw Mi(), ur; H = t; } } -function is(t = 1) { +function ss(t = 1) { if (J) { for (var e = t, n = H; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Le(n); + /* @__PURE__ */ Oe(n); H = n; } } -function _i(t = !0) { +function mi(t = !0) { for (var e = 0, n = H; ; ) { - if (n.nodeType === _r) { + if (n.nodeType === yr) { var r = ( /** @type {Comment} */ n.data ); - if (r === Rs) { + if (r === Cs) { if (e === 0) return n; e -= 1; - } else (r === Es || r === Ti || // "[1", "[2", etc. for if blocks + } else (r === Rs || r === Si || // "[1", "[2", etc. for if blocks r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Le(n) + /* @__PURE__ */ Oe(n) ); t && n.remove(), n = i; } } -function Ya(t) { - if (!t || t.nodeType !== _r) - throw ki(), or; +function Ha(t) { + if (!t || t.nodeType !== yr) + throw Mi(), ur; return ( /** @type {Comment} */ t.data ); } -function Ha(t) { +function za(t) { return t === this.v; } -function eu(t, e) { +function ru(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function za(t) { - return !eu(t, this.v); +function Xa(t) { + return !ru(t, this.v); } -let nu = !1, ne = null; -function fr(t) { - ne = t; +let iu = !1, Qt = null; +function hr(t) { + Qt = t; } -function Ts(t, e = !1, n) { - ne = { - p: ne, +function Ss(t, e = !1, n) { + Qt = { + p: Qt, i: !1, c: null, e: null, @@ -163,52 +163,52 @@ function Ts(t, e = !1, n) { l: null }; } -function Ss(t) { +function Ns(t) { var e = ( /** @type {ComponentContext} */ - ne + Qt ), n = e.e; if (n !== null) { e.e = null; for (var r of n) - vo(r); + go(r); } - return t !== void 0 && (e.x = t), e.i = !0, ne = e.p, t ?? /** @type {T} */ + return t !== void 0 && (e.x = t), e.i = !0, Qt = e.p, t ?? /** @type {T} */ {}; } -function Xa() { +function Ba() { return !0; } let bn = []; -function Ba() { +function Wa() { var t = bn; - bn = [], Ll(t); + bn = [], Vl(t); } function Pn(t) { - if (bn.length === 0 && !Pr) { + if (bn.length === 0 && !Ir) { var e = bn; queueMicrotask(() => { - e === bn && Ba(); + e === bn && Wa(); }); } bn.push(t); } -function ru() { +function su() { for (; bn.length > 0; ) - Ba(); + Wa(); } -function Wa(t) { +function Ua(t) { var e = U; if (e === null) return Y.f |= hn, t; - if ((e.f & gr) === 0 && (e.f & Fr) === 0) + if ((e.f & mr) === 0 && (e.f & Lr) === 0) throw t; - cr(t, e); + dr(t, e); } -function cr(t, e) { +function dr(t, e) { for (; e !== null; ) { - if ((e.f & La) !== 0) { - if ((e.f & gr) === 0) + if ((e.f & qa) !== 0) { + if ((e.f & mr) === 0) throw t; try { e.b.error(t); @@ -221,54 +221,54 @@ function cr(t, e) { } throw t; } -const iu = -7169; -function lt(t, e) { - t.f = t.f & iu | e; +const au = -7169; +function ut(t, e) { + t.f = t.f & au | e; } -function Ns(t) { - (t.f & fe) !== 0 || t.deps === null ? lt(t, wt) : lt(t, be); +function ks(t) { + (t.f & ae) !== 0 || t.deps === null ? ut(t, wt) : ut(t, we); } -function Ua(t) { +function Ga(t) { if (t !== null) for (const e of t) - (e.f & Rt) === 0 || (e.f & On) === 0 || (e.f ^= On, Ua( + (e.f & Et) === 0 || (e.f & On) === 0 || (e.f ^= On, Ga( /** @type {Derived} */ e.deps )); } -function Ga(t, e, n) { - (t.f & Ct) !== 0 ? e.add(t) : (t.f & be) !== 0 && n.add(t), Ua(t.deps), lt(t, wt); +function Ka(t, e, n) { + (t.f & Rt) !== 0 ? e.add(t) : (t.f & we) !== 0 && n.add(t), Ga(t.deps), ut(t, wt); } -const jr = /* @__PURE__ */ new Set(); -let B = null, Et = null, Vt = [], Pi = null, ss = !1, Pr = !1; -var tr, er, Rn, nr, Yr, Hr, Cn, Ge, rr, Oe, as, os, Ka; -const Ws = class Ws { +const Qr = /* @__PURE__ */ new Set(); +let B = null, At = null, qt = [], Di = null, as = !1, Ir = !1; +var nr, rr, Rn, ir, Xr, Br, Cn, Ke, sr, Ie, os, ls, Ja; +const Us = class Us { constructor() { - q(this, Oe); - st(this, "committed", !1); + q(this, Ie); + at(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} */ - st(this, "current", /* @__PURE__ */ new Map()); + at(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} */ - st(this, "previous", /* @__PURE__ */ new Map()); + at(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>} */ - q(this, tr, /* @__PURE__ */ new Set()); + q(this, nr, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - q(this, er, /* @__PURE__ */ new Set()); + q(this, rr, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ @@ -276,18 +276,18 @@ const Ws = class Ws { /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - q(this, nr, 0); + q(this, ir, 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} */ - q(this, Yr, null); + q(this, Xr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - q(this, Hr, /* @__PURE__ */ new Set()); + q(this, Br, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} @@ -300,19 +300,19 @@ const Ws = class Ws { * so they can be rescheduled if the branch survives. * @type {Map} */ - q(this, Ge, /* @__PURE__ */ new Map()); - st(this, "is_fork", !1); - q(this, rr, !1); + q(this, Ke, /* @__PURE__ */ new Map()); + at(this, "is_fork", !1); + q(this, sr, !1); } is_deferred() { - return this.is_fork || v(this, nr) > 0; + return this.is_fork || v(this, ir) > 0; } /** * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ skip_effect(e) { - v(this, Ge).has(e) || v(this, Ge).set(e, { d: [], m: [] }); + v(this, Ke).has(e) || v(this, Ke).set(e, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule @@ -320,13 +320,13 @@ const Ws = class Ws { * @param {Effect} effect */ unskip_effect(e) { - var n = v(this, Ge).get(e); + var n = v(this, Ke).get(e); if (n) { - v(this, Ge).delete(e); + v(this, Ke).delete(e); for (var r of n.d) - lt(r, Ct), we(r); + ut(r, Rt), me(r); for (r of n.m) - lt(r, be), we(r); + ut(r, we), me(r); } } /** @@ -335,19 +335,19 @@ const Ws = class Ws { */ process(e) { var i; - Vt = [], this.apply(); + qt = [], this.apply(); var n = [], r = []; for (const s of e) - mt(this, Oe, as).call(this, s, n, r); + mt(this, Ie, os).call(this, s, n, r); if (this.is_deferred()) { - mt(this, Oe, os).call(this, r), mt(this, Oe, os).call(this, n); - for (const [s, a] of v(this, Ge)) - Qa(s, a); + mt(this, Ie, ls).call(this, r), mt(this, Ie, ls).call(this, n); + for (const [s, a] of v(this, Ke)) + to(s, a); } else { - for (const s of v(this, tr)) s(); - v(this, tr).clear(), v(this, Rn) === 0 && mt(this, Oe, Ka).call(this), B = null, ia(r), ia(n), (i = v(this, Yr)) == null || i.resolve(); + for (const s of v(this, nr)) s(); + v(this, nr).clear(), v(this, Rn) === 0 && mt(this, Ie, Ja).call(this), B = null, sa(r), sa(n), (i = v(this, Xr)) == null || i.resolve(); } - Et = null; + At = null; } /** * Associate a change to a given source with the current @@ -356,63 +356,63 @@ const Ws = class Ws { * @param {any} value */ capture(e, n) { - n !== At && !this.previous.has(e) && this.previous.set(e, n), (e.f & hn) === 0 && (this.current.set(e, e.v), Et == null || Et.set(e, e.v)); + n !== $t && !this.previous.has(e) && this.previous.set(e, n), (e.f & hn) === 0 && (this.current.set(e, e.v), At == null || At.set(e, e.v)); } activate() { B = this, this.apply(); } deactivate() { - B === this && (B = null, Et = null); + B === this && (B = null, At = null); } flush() { - if (this.activate(), Vt.length > 0) { - if (Ja(), B !== null && B !== this) + if (this.activate(), qt.length > 0) { + if (Za(), B !== null && B !== this) return; } else v(this, Rn) === 0 && this.process([]); this.deactivate(); } discard() { - for (const e of v(this, er)) e(this); - v(this, er).clear(); + for (const e of v(this, rr)) e(this); + v(this, rr).clear(); } /** * * @param {boolean} blocking */ increment(e) { - O(this, Rn, v(this, Rn) + 1), e && O(this, nr, v(this, nr) + 1); + O(this, Rn, v(this, Rn) + 1), e && O(this, ir, v(this, ir) + 1); } /** * * @param {boolean} blocking */ decrement(e) { - O(this, Rn, v(this, Rn) - 1), e && O(this, nr, v(this, nr) - 1), !v(this, rr) && (O(this, rr, !0), Pn(() => { - O(this, rr, !1), this.is_deferred() ? Vt.length > 0 && this.flush() : this.revive(); + O(this, Rn, v(this, Rn) - 1), e && O(this, ir, v(this, ir) - 1), !v(this, sr) && (O(this, sr, !0), Pn(() => { + O(this, sr, !1), this.is_deferred() ? qt.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const e of v(this, Hr)) - v(this, Cn).delete(e), lt(e, Ct), we(e); + for (const e of v(this, Br)) + v(this, Cn).delete(e), ut(e, Rt), me(e); for (const e of v(this, Cn)) - lt(e, be), we(e); + ut(e, we), me(e); this.flush(); } /** @param {() => void} fn */ oncommit(e) { - v(this, tr).add(e); + v(this, nr).add(e); } /** @param {(batch: Batch) => void} fn */ ondiscard(e) { - v(this, er).add(e); + v(this, rr).add(e); } settled() { - return (v(this, Yr) ?? O(this, Yr, Ia())).promise; + return (v(this, Xr) ?? O(this, Xr, Oa())).promise; } static ensure() { if (B === null) { - const e = B = new Ws(); - jr.add(B), Pr || Pn(() => { + const e = B = new Us(); + Qr.add(B), Ir || Pn(() => { B === e && e.flush(); }); } @@ -421,41 +421,41 @@ const Ws = class Ws { apply() { } }; -tr = new WeakMap(), er = new WeakMap(), Rn = new WeakMap(), nr = new WeakMap(), Yr = new WeakMap(), Hr = new WeakMap(), Cn = new WeakMap(), Ge = new WeakMap(), rr = new WeakMap(), Oe = new WeakSet(), /** +nr = new WeakMap(), rr = new WeakMap(), Rn = new WeakMap(), ir = new WeakMap(), Xr = new WeakMap(), Br = new WeakMap(), Cn = new WeakMap(), Ke = new WeakMap(), sr = new WeakMap(), Ie = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -as = function(e, n, r) { +os = function(e, n, r) { e.f ^= wt; for (var i = e.first, s = null; i !== null; ) { - var a = i.f, o = (a & ($e | vn)) !== 0, l = o && (a & wt) !== 0, u = l || (a & ee) !== 0 || v(this, Ge).has(i); + var a = i.f, o = (a & (xe | vn)) !== 0, l = o && (a & wt) !== 0, u = l || (a & jt) !== 0 || v(this, Ke).has(i); if (!u && i.fn !== null) { - o ? i.f ^= wt : s !== null && (a & (Fr | Ni | Oa)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Ur(i) && ((a & rn) !== 0 && v(this, Cn).add(i), dr(i)); + o ? i.f ^= wt : s !== null && (a & (Lr | ki | La)) !== 0 ? s.b.defer_effect(i) : (a & Lr) !== 0 ? n.push(i) : Jr(i) && ((a & sn) !== 0 && v(this, Cn).add(i), vr(i)); var f = i.first; if (f !== null) { i = f; continue; } } - var h = i.parent; - for (i = i.next; i === null && h !== null; ) - h === s && (s = null), i = h.next, h = h.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 */ -os = function(e) { +ls = function(e) { for (var n = 0; n < e.length; n += 1) - Ga(e[n], v(this, Hr), v(this, Cn)); -}, Ka = function() { + Ka(e[n], v(this, Br), v(this, Cn)); +}, Ja = function() { var i; - if (jr.size > 1) { + if (Qr.size > 1) { this.previous.clear(); - var e = Et, n = !0; - for (const s of jr) { + var e = At, n = !0; + for (const s of Qr) { if (s === this) { n = !1; continue; @@ -473,111 +473,111 @@ os = function(e) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = Vt; - Vt = []; + var r = qt; + qt = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - Za(f, o, l, u); - if (Vt.length > 0) { + ja(f, o, l, u); + if (qt.length > 0) { B = s, s.apply(); - for (const f of Vt) - mt(i = s, Oe, as).call(i, f, [], []); + for (const f of qt) + mt(i = s, Ie, os).call(i, f, [], []); s.deactivate(); } - Vt = r; + qt = r; } } - B = null, Et = e; + B = null, At = e; } - this.committed = !0, jr.delete(this); + this.committed = !0, Qr.delete(this); }; -let en = Ws; -function ct(t) { - var e = Pr; - Pr = !0; +let nn = Us; +function ht(t) { + var e = Ir; + Ir = !0; try { for (var n; ; ) { - if (ru(), Vt.length === 0 && (B == null || B.flush(), Vt.length === 0)) - return Pi = null, /** @type {T} */ + if (su(), qt.length === 0 && (B == null || B.flush(), qt.length === 0)) + return Di = null, /** @type {T} */ n; - Ja(); + Za(); } } finally { - Pr = e; + Ir = e; } } -function Ja() { - ss = !0; +function Za() { + as = !0; var t = null; try { - for (var e = 0; Vt.length > 0; ) { - var n = en.ensure(); + for (var e = 0; qt.length > 0; ) { + var n = nn.ensure(); if (e++ > 1e3) { var r, i; - su(); + ou(); } - n.process(Vt), dn.clear(); + n.process(qt), dn.clear(); } } finally { - Vt = [], ss = !1, Pi = null; + qt = [], as = !1, Di = null; } } -function su() { +function ou() { try { - Ul(); + Kl(); } catch (t) { - cr(t, Pi); + dr(t, Di); } } -let ge = null; -function ia(t) { +let pe = null; +function sa(t) { var e = t.length; if (e !== 0) { for (var n = 0; n < e; ) { var r = t[n++]; - if ((r.f & (tn | ee)) === 0 && Ur(r) && (ge = /* @__PURE__ */ new Set(), dr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && mo(r), (ge == null ? void 0 : ge.size) > 0)) { + if ((r.f & (en | jt)) === 0 && Jr(r) && (pe = /* @__PURE__ */ new Set(), vr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && yo(r), (pe == null ? void 0 : pe.size) > 0)) { dn.clear(); - for (const i of ge) { - if ((i.f & (tn | ee)) !== 0) continue; + for (const i of pe) { + if ((i.f & (en | jt)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - ge.has(a) && (ge.delete(a), s.push(a)), a = a.parent; + pe.has(a) && (pe.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (tn | ee)) === 0 && dr(l); + (l.f & (en | jt)) === 0 && vr(l); } } - ge.clear(); + pe.clear(); } } - ge = null; + pe = null; } } -function Za(t, e, n, r) { +function ja(t, e, n, r) { if (!n.has(t) && (n.add(t), t.reactions !== null)) for (const i of t.reactions) { const s = i.f; - (s & Rt) !== 0 ? Za( + (s & Et) !== 0 ? ja( /** @type {Derived} */ i, e, n, r - ) : (s & (Cs | rn)) !== 0 && (s & Ct) === 0 && ja(i, e, r) && (lt(i, Ct), we( + ) : (s & (Ts | sn)) !== 0 && (s & Rt) === 0 && Qa(i, e, r) && (ut(i, Rt), me( /** @type {Effect} */ i )); } } -function ja(t, e, n) { +function Qa(t, e, n) { const r = n.get(t); if (r !== void 0) return r; if (t.deps !== null) for (const i of t.deps) { - if (lr.call(e, i)) + if (fr.call(e, i)) return !0; - if ((i.f & Rt) !== 0 && ja( + if ((i.f & Et) !== 0 && Qa( /** @type {Derived} */ i, e, @@ -591,80 +591,80 @@ function ja(t, e, n) { } return n.set(t, !1), !1; } -function we(t) { - for (var e = Pi = t; e.parent !== null; ) { +function me(t) { + for (var e = Di = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (ss && e === U && (n & rn) !== 0 && (n & qa) === 0) + if (as && e === U && (n & sn) !== 0 && (n & Va) === 0) return; - if ((n & (vn | $e)) !== 0) { + if ((n & (vn | xe)) !== 0) { if ((n & wt) === 0) return; e.f ^= wt; } } - Vt.push(e); + qt.push(e); } -function Qa(t, e) { - if (!((t.f & $e) !== 0 && (t.f & wt) !== 0)) { - (t.f & Ct) !== 0 ? e.d.push(t) : (t.f & be) !== 0 && e.m.push(t), lt(t, wt); +function to(t, e) { + if (!((t.f & xe) !== 0 && (t.f & wt) !== 0)) { + (t.f & Rt) !== 0 ? e.d.push(t) : (t.f & we) !== 0 && e.m.push(t), ut(t, wt); for (var n = t.first; n !== null; ) - Qa(n, e), n = n.next; + to(n, e), n = n.next; } } -function au(t) { +function lu(t) { let e = 0, n = Ln(0), r; return () => { - Ps() && (x(n), Fs(() => (e === 0 && (r = Ii(() => t(() => Dr(n)))), e += 1, () => { + Ds() && (x(n), Is(() => (e === 0 && (r = Oi(() => t(() => Or(n)))), e += 1, () => { Pn(() => { - e -= 1, e === 0 && (r == null || r(), r = void 0, Dr(n)); + e -= 1, e === 0 && (r == null || r(), r = void 0, Or(n)); }); }))); }; } -var ou = ur | zn | La; -function lu(t, e, n) { - new uu(t, e, n); +var uu = cr | zn | qa; +function fu(t, e, n) { + new cu(t, e, n); } -var Qt, zr, Ne, Tn, ke, oe, qt, Me, Ke, fn, Sn, Je, ir, Nn, sr, ar, Ze, Ri, ht, to, eo, ls, si, ai, us; -class uu { +var Jt, Wr, Se, Tn, Ne, re, Lt, ke, Je, fn, Sn, Ze, ar, Nn, or, lr, je, Ci, dt, eo, no, us, ai, oi, fs; +class cu { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ constructor(e, n, r) { - q(this, ht); + q(this, dt); /** @type {Boundary | null} */ - st(this, "parent"); - st(this, "is_pending", !1); + at(this, "parent"); + at(this, "is_pending", !1); /** @type {TemplateNode} */ - q(this, Qt); + q(this, Jt); /** @type {TemplateNode | null} */ - q(this, zr, J ? H : null); + q(this, Wr, J ? H : null); /** @type {BoundaryProps} */ - q(this, Ne); + q(this, Se); /** @type {((anchor: Node) => void)} */ q(this, Tn); /** @type {Effect} */ - q(this, ke); + q(this, Ne); /** @type {Effect | null} */ - q(this, oe, null); + q(this, re, null); /** @type {Effect | null} */ - q(this, qt, null); + q(this, Lt, null); /** @type {Effect | null} */ - q(this, Me, null); + q(this, ke, null); /** @type {DocumentFragment | null} */ - q(this, Ke, null); + q(this, Je, null); /** @type {TemplateNode | null} */ q(this, fn, null); q(this, Sn, 0); - q(this, Je, 0); - q(this, ir, !1); + q(this, Ze, 0); + q(this, ar, !1); q(this, Nn, !1); /** @type {Set} */ - q(this, sr, /* @__PURE__ */ new Set()); + q(this, or, /* @__PURE__ */ new Set()); /** @type {Set} */ - q(this, ar, /* @__PURE__ */ new Set()); + q(this, lr, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -672,38 +672,38 @@ class uu { * calls followed by no-op flushes * @type {Source | null} */ - q(this, Ze, null); - q(this, Ri, au(() => (O(this, Ze, Ln(v(this, Sn))), () => { - O(this, Ze, null); + q(this, je, null); + q(this, Ci, lu(() => (O(this, je, Ln(v(this, Sn))), () => { + O(this, je, null); }))); - O(this, Qt, e), O(this, Ne, n), O(this, Tn, r), this.parent = /** @type {Effect} */ - U.b, this.is_pending = !!v(this, Ne).pending, O(this, ke, Is(() => { + O(this, Jt, e), O(this, Se, n), O(this, Tn, r), this.parent = /** @type {Effect} */ + U.b, this.is_pending = !!v(this, Se).pending, O(this, Ne, Os(() => { if (U.b = this, J) { - const s = v(this, zr); - Mi(), /** @type {Comment} */ - s.nodeType === _r && /** @type {Comment} */ - s.data === Ti ? mt(this, ht, eo).call(this) : (mt(this, ht, to).call(this), v(this, Je) === 0 && (this.is_pending = !1)); + const s = v(this, Wr); + Pi(), /** @type {Comment} */ + s.nodeType === yr && /** @type {Comment} */ + s.data === Si ? mt(this, dt, no).call(this) : (mt(this, dt, eo).call(this), v(this, Ze) === 0 && (this.is_pending = !1)); } else { - var i = mt(this, ht, ls).call(this); + var i = mt(this, dt, us).call(this); try { - O(this, oe, ue(() => r(i))); + O(this, re, se(() => r(i))); } catch (s) { this.error(s); } - v(this, Je) > 0 ? mt(this, ht, ai).call(this) : this.is_pending = !1; + v(this, Ze) > 0 ? mt(this, dt, oi).call(this) : this.is_pending = !1; } return () => { var s; (s = v(this, fn)) == null || s.remove(); }; - }, ou)), J && O(this, Qt, H); + }, uu)), J && O(this, Jt, H); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ defer_effect(e) { - Ga(e, v(this, sr), v(this, ar)); + Ka(e, v(this, or), v(this, lr)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -713,7 +713,7 @@ class uu { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, Ne).pending; + return !!v(this, Se).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -722,57 +722,57 @@ class uu { * @param {1 | -1} d */ update_pending_count(e) { - mt(this, ht, us).call(this, e), O(this, Sn, v(this, Sn) + e), !(!v(this, Ze) || v(this, ir)) && (O(this, ir, !0), Pn(() => { - O(this, ir, !1), v(this, Ze) && hr(v(this, Ze), v(this, Sn)); + mt(this, dt, fs).call(this, e), O(this, Sn, v(this, Sn) + e), !(!v(this, je) || v(this, ar)) && (O(this, ar, !0), Pn(() => { + O(this, ar, !1), v(this, je) && pr(v(this, je), v(this, Sn)); })); } get_effect_pending() { - return v(this, Ri).call(this), x( + return v(this, Ci).call(this), x( /** @type {Source} */ - v(this, Ze) + v(this, je) ); } /** @param {unknown} error */ error(e) { - var n = v(this, Ne).onerror; - let r = v(this, Ne).failed; + var n = v(this, Se).onerror; + let r = v(this, Se).failed; if (v(this, Nn) || !n && !r) throw e; - v(this, oe) && (Ft(v(this, oe)), O(this, oe, null)), v(this, qt) && (Ft(v(this, qt)), O(this, qt, null)), v(this, Me) && (Ft(v(this, Me)), O(this, Me, null)), J && (zt( + v(this, re) && (Dt(v(this, re)), O(this, re, null)), v(this, Lt) && (Dt(v(this, Lt)), O(this, Lt, null)), v(this, ke) && (Dt(v(this, ke)), O(this, ke, null)), J && (Ht( /** @type {TemplateNode} */ - v(this, zr) - ), is(), zt(_i())); + v(this, Wr) + ), ss(), Ht(mi())); var i = !1, s = !1; const a = () => { if (i) { - tu(); + nu(); return; } - i = !0, s && Ql(), en.ensure(), O(this, Sn, 0), v(this, Me) !== null && Dn(v(this, Me), () => { - O(this, Me, null); - }), this.is_pending = this.has_pending_snippet(), O(this, oe, mt(this, ht, si).call(this, () => (O(this, Nn, !1), ue(() => v(this, Tn).call(this, v(this, Qt)))))), v(this, Je) > 0 ? mt(this, ht, ai).call(this) : this.is_pending = !1; + i = !0, s && eu(), nn.ensure(), O(this, Sn, 0), v(this, ke) !== null && Dn(v(this, ke), () => { + O(this, ke, null); + }), this.is_pending = this.has_pending_snippet(), O(this, re, mt(this, dt, ai).call(this, () => (O(this, Nn, !1), se(() => v(this, Tn).call(this, v(this, Jt)))))), v(this, Ze) > 0 ? mt(this, dt, oi).call(this) : this.is_pending = !1; }; Pn(() => { try { s = !0, n == null || n(e, a), s = !1; } catch (o) { - cr(o, v(this, ke) && v(this, ke).parent); + dr(o, v(this, Ne) && v(this, Ne).parent); } - r && O(this, Me, mt(this, ht, si).call(this, () => { - en.ensure(), O(this, Nn, !0); + r && O(this, ke, mt(this, dt, ai).call(this, () => { + nn.ensure(), O(this, Nn, !0); try { - return ue(() => { + return se(() => { r( - v(this, Qt), + v(this, Jt), () => e, () => a ); }); } catch (o) { - return cr( + return dr( o, /** @type {Effect} */ - v(this, ke).parent + v(this, Ne).parent ), null; } finally { O(this, Nn, !1); @@ -781,73 +781,73 @@ class uu { }); } } -Qt = new WeakMap(), zr = new WeakMap(), Ne = new WeakMap(), Tn = new WeakMap(), ke = new WeakMap(), oe = new WeakMap(), qt = new WeakMap(), Me = new WeakMap(), Ke = new WeakMap(), fn = new WeakMap(), Sn = new WeakMap(), Je = new WeakMap(), ir = new WeakMap(), Nn = new WeakMap(), sr = new WeakMap(), ar = new WeakMap(), Ze = new WeakMap(), Ri = new WeakMap(), ht = new WeakSet(), to = function() { +Jt = new WeakMap(), Wr = new WeakMap(), Se = new WeakMap(), Tn = new WeakMap(), Ne = new WeakMap(), re = new WeakMap(), Lt = new WeakMap(), ke = new WeakMap(), Je = new WeakMap(), fn = new WeakMap(), Sn = new WeakMap(), Ze = new WeakMap(), ar = new WeakMap(), Nn = new WeakMap(), or = new WeakMap(), lr = new WeakMap(), je = new WeakMap(), Ci = new WeakMap(), dt = new WeakSet(), eo = function() { try { - O(this, oe, ue(() => v(this, Tn).call(this, v(this, Qt)))); + O(this, re, se(() => v(this, Tn).call(this, v(this, Jt)))); } catch (e) { this.error(e); } -}, eo = function() { - const e = v(this, Ne).pending; - e && (O(this, qt, ue(() => e(v(this, Qt)))), Pn(() => { - var n = mt(this, ht, ls).call(this); - O(this, oe, mt(this, ht, si).call(this, () => (en.ensure(), ue(() => v(this, Tn).call(this, n))))), v(this, Je) > 0 ? mt(this, ht, ai).call(this) : (Dn( +}, no = function() { + const e = v(this, Se).pending; + e && (O(this, Lt, se(() => e(v(this, Jt)))), Pn(() => { + var n = mt(this, dt, us).call(this); + O(this, re, mt(this, dt, ai).call(this, () => (nn.ensure(), se(() => v(this, Tn).call(this, n))))), v(this, Ze) > 0 ? mt(this, dt, oi).call(this) : (Dn( /** @type {Effect} */ - v(this, qt), + v(this, Lt), () => { - O(this, qt, null); + O(this, Lt, null); } ), this.is_pending = !1); })); -}, ls = function() { - var e = v(this, Qt); - return this.is_pending && (O(this, fn, he()), v(this, Qt).before(v(this, fn)), e = v(this, fn)), e; +}, us = function() { + var e = v(this, Jt); + return this.is_pending && (O(this, fn, le()), v(this, Jt).before(v(this, fn)), e = v(this, fn)), e; }, /** * @param {() => Effect | null} fn */ -si = function(e) { - var n = U, r = Y, i = ne; - Ie(v(this, ke)), de(v(this, ke)), fr(v(this, ke).ctx); +ai = function(e) { + var n = U, r = Y, i = Qt; + Fe(v(this, Ne)), ue(v(this, Ne)), hr(v(this, Ne).ctx); try { return e(); } catch (s) { - return Wa(s), null; + return Ua(s), null; } finally { - Ie(n), de(r), fr(i); + Fe(n), ue(r), hr(i); } -}, ai = function() { +}, oi = function() { const e = ( /** @type {(anchor: Node) => void} */ - v(this, Ne).pending + v(this, Se).pending ); - v(this, oe) !== null && (O(this, Ke, document.createDocumentFragment()), v(this, Ke).append( + v(this, re) !== null && (O(this, Je, document.createDocumentFragment()), v(this, Je).append( /** @type {TemplateNode} */ v(this, fn) - ), xo(v(this, oe), v(this, Ke))), v(this, qt) === null && O(this, qt, ue(() => e(v(this, Qt)))); + ), bo(v(this, re), v(this, Je))), v(this, Lt) === null && O(this, Lt, se(() => e(v(this, Jt)))); }, /** * 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 * @param {1 | -1} d */ -us = function(e) { +fs = function(e) { var n; if (!this.has_pending_snippet()) { - this.parent && mt(n = this.parent, ht, us).call(n, e); + this.parent && mt(n = this.parent, dt, fs).call(n, e); return; } - if (O(this, Je, v(this, Je) + e), v(this, Je) === 0) { + if (O(this, Ze, v(this, Ze) + e), v(this, Ze) === 0) { this.is_pending = !1; - for (const r of v(this, sr)) - lt(r, Ct), we(r); - for (const r of v(this, ar)) - lt(r, be), we(r); - v(this, sr).clear(), v(this, ar).clear(), v(this, qt) && Dn(v(this, qt), () => { - O(this, qt, null); - }), v(this, Ke) && (v(this, Qt).before(v(this, Ke)), O(this, Ke, null)); + for (const r of v(this, or)) + ut(r, Rt), me(r); + for (const r of v(this, lr)) + ut(r, we), me(r); + v(this, or).clear(), v(this, lr).clear(), v(this, Lt) && Dn(v(this, Lt), () => { + O(this, Lt, null); + }), v(this, Je) && (v(this, Jt).before(v(this, Je)), O(this, Je, null)); } }; -function fu(t, e, n, r) { - const i = Di; +function hu(t, e, n, r) { + const i = Fi; var s = t.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { r(e.map(i)); @@ -856,52 +856,52 @@ function fu(t, e, n, r) { var a = B, o = ( /** @type {Effect} */ U - ), l = cu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + ), l = du(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; function f(c) { l(); try { r(c); } catch (p) { - (o.f & tn) === 0 && cr(p, o); + (o.f & en) === 0 && dr(p, o); } - a == null || a.deactivate(), fs(); + a == null || a.deactivate(), cs(); } if (n.length === 0) { u.then(() => f(e.map(i))); return; } - function h() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ hu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => cr(c, o)); + function d() { + l(), Promise.all(n.map((c) => /* @__PURE__ */ pu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => dr(c, o)); } - u ? u.then(h) : h(); + u ? u.then(d) : d(); } -function cu() { - var t = U, e = Y, n = ne, r = B; +function du() { + var t = U, e = Y, n = Qt, r = B; return function(s = !0) { - Ie(t), de(e), fr(n), s && (r == null || r.activate()); + Fe(t), ue(e), hr(n), s && (r == null || r.activate()); }; } -function fs() { - Ie(null), de(null), fr(null); +function cs() { + Fe(null), ue(null), hr(null); } // @__NO_SIDE_EFFECTS__ -function Di(t) { - var e = Rt | Ct, n = Y !== null && (Y.f & Rt) !== 0 ? ( +function Fi(t) { + var e = Et | Rt, n = Y !== null && (Y.f & Et) !== 0 ? ( /** @type {Derived} */ Y ) : null; return U !== null && (U.f |= zn), { - ctx: ne, + ctx: Qt, deps: null, effects: null, - equals: Ha, + equals: za, f: e, fn: t, reactions: null, rv: 0, v: ( /** @type {V} */ - At + $t ), wv: 0, parent: n ?? U, @@ -909,12 +909,12 @@ function Di(t) { }; } // @__NO_SIDE_EFFECTS__ -function hu(t, e, n) { +function pu(t, e, n) { let r = ( /** @type {Effect | null} */ U ); - r === null && Hl(); + r === null && Xl(); var i = ( /** @type {Boundary} */ r.b @@ -924,78 +924,78 @@ function hu(t, e, n) { void 0 ), a = Ln( /** @type {V} */ - At + $t ), o = !Y, l = /* @__PURE__ */ new Map(); - return bu(() => { + return Au(() => { var p; - var u = Ia(); + var u = Oa(); s = u.promise; try { Promise.resolve(t()).then(u.resolve, u.reject).then(() => { - f === B && f.committed && f.deactivate(), fs(); + f === B && f.committed && f.deactivate(), cs(); }); } catch (g) { - u.reject(g), fs(); + u.reject(g), cs(); } var f = ( /** @type {Batch} */ B ); if (o) { - var h = i.is_rendered(); - i.update_pending_count(1), f.increment(h), (p = l.get(f)) == null || p.reject(xn), 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(xn), l.delete(f), l.set(f, u); } const c = (g, y = void 0) => { if (f.activate(), y) - y !== xn && (a.f |= hn, hr(a, y)); + y !== xn && (a.f |= hn, pr(a, y)); else { - (a.f & hn) !== 0 && (a.f ^= hn), hr(a, g); - for (const [$, A] of l) { + (a.f & hn) !== 0 && (a.f ^= hn), pr(a, g); + for (const [$, E] of l) { if (l.delete($), $ === f) break; - A.reject(xn); + E.reject(xn); } } - o && (i.update_pending_count(-1), f.decrement(h)); + o && (i.update_pending_count(-1), f.decrement(d)); }; u.promise.then(c, (g) => c(null, g || "unknown")); - }), yu(() => { + }), xu(() => { for (const u of l.values()) u.reject(xn); }), new Promise((u) => { - function f(h) { + function f(d) { function c() { - h === s ? u(a) : f(s); + d === s ? u(a) : f(s); } - h.then(c, c); + d.then(c, c); } f(s); }); } // @__NO_SIDE_EFFECTS__ -function Jn(t) { - const e = /* @__PURE__ */ Di(t); - return bo(e), e; +function jn(t) { + const e = /* @__PURE__ */ Fi(t); + return $o(e), e; } // @__NO_SIDE_EFFECTS__ -function no(t) { - const e = /* @__PURE__ */ Di(t); - return e.equals = za, e; +function ro(t) { + const e = /* @__PURE__ */ Fi(t); + return e.equals = Xa, e; } -function du(t) { +function vu(t) { var e = t.effects; if (e !== null) { t.effects = null; for (var n = 0; n < e.length; n += 1) - Ft( + Dt( /** @type {Effect} */ e[n] ); } } -function pu(t) { +function gu(t) { for (var e = t.parent; e !== null; ) { - if ((e.f & Rt) === 0) - return (e.f & tn) === 0 ? ( + if ((e.f & Et) === 0) + return (e.f & en) === 0 ? ( /** @type {Effect} */ e ) : null; @@ -1003,45 +1003,45 @@ function pu(t) { } return null; } -function ks(t) { +function Ms(t) { var e, n = U; - Ie(pu(t)); + Fe(gu(t)); try { - t.f &= ~On, du(t), e = Ro(t); + t.f &= ~On, vu(t), e = Co(t); } finally { - Ie(n); + Fe(n); } return e; } -function ro(t) { - var e = ks(t); - if (!t.equals(e) && (t.wv = Ao(), (!(B != null && B.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { - lt(t, wt); +function io(t) { + var e = Ms(t); + if (!t.equals(e) && (t.wv = Eo(), (!(B != null && B.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { + ut(t, wt); return; } - pn || (Et !== null ? (Ps() || B != null && B.is_fork) && Et.set(t, e) : Ns(t)); + pn || (At !== null ? (Ds() || B != null && B.is_fork) && At.set(t, e) : ks(t)); } -function vu(t) { +function _u(t) { var e, n; if (t.effects !== null) for (const r of t.effects) - (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(xn), r.teardown = Ol, r.ac = null, Ir(r, 0), Os(r)); + (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(xn), r.teardown = ql, r.ac = null, qr(r, 0), Ls(r)); } -function io(t) { +function so(t) { if (t.effects !== null) for (const e of t.effects) - e.teardown && dr(e); + e.teardown && vr(e); } -let cs = /* @__PURE__ */ new Set(); +let hs = /* @__PURE__ */ new Set(); const dn = /* @__PURE__ */ new Map(); -let so = !1; +let ao = !1; function Ln(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: t, reactions: null, - equals: Ha, + equals: za, rv: 0, wv: 0 }; @@ -1050,78 +1050,78 @@ function Ln(t, e) { // @__NO_SIDE_EFFECTS__ function yt(t, e) { const n = Ln(t); - return bo(n), n; + return $o(n), n; } // @__NO_SIDE_EFFECTS__ -function ao(t, e = !1, n = !0) { +function oo(t, e = !1, n = !0) { const r = Ln(t); - return e || (r.equals = za), r; + return e || (r.equals = Xa), r; } -function ot(t, e, n = !1) { +function lt(t, e, n = !1) { Y !== 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 - (!xe || (Y.f & ra) !== 0) && Xa() && (Y.f & (Rt | rn | Cs | ra)) !== 0 && (ce === null || !lr.call(ce, t)) && jl(); + (!ye || (Y.f & ia) !== 0) && Ba() && (Y.f & (Et | sn | Ts | ia)) !== 0 && (oe === null || !fr.call(oe, t)) && tu(); let r = n ? $n(e) : e; - return hr(t, r); + return pr(t, r); } -function hr(t, e) { +function pr(t, e) { if (!t.equals(e)) { var n = t.v; pn ? dn.set(t, e) : dn.set(t, n), t.v = e; - var r = en.ensure(); - if (r.capture(t, n), (t.f & Rt) !== 0) { + var r = nn.ensure(); + if (r.capture(t, n), (t.f & Et) !== 0) { const i = ( /** @type {Derived} */ t ); - (t.f & Ct) !== 0 && ks(i), Ns(i); + (t.f & Rt) !== 0 && Ms(i), ks(i); } - t.wv = Ao(), oo(t, Ct), U !== null && (U.f & wt) !== 0 && (U.f & ($e | vn)) === 0 && (ae === null ? Eu([t]) : ae.push(t)), !r.is_fork && cs.size > 0 && !so && gu(); + t.wv = Eo(), lo(t, Rt), U !== null && (U.f & wt) !== 0 && (U.f & (xe | vn)) === 0 && (ne === null ? Cu([t]) : ne.push(t)), !r.is_fork && hs.size > 0 && !ao && mu(); } return e; } -function gu() { - so = !1; - for (const t of cs) - (t.f & wt) !== 0 && lt(t, be), Ur(t) && dr(t); - cs.clear(); +function mu() { + ao = !1; + for (const t of hs) + (t.f & wt) !== 0 && ut(t, we), Jr(t) && vr(t); + hs.clear(); } -function Dr(t) { - ot(t, t.v + 1); +function Or(t) { + lt(t, t.v + 1); } -function oo(t, e) { +function lo(t, e) { var n = t.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & Ct) === 0; - if (o && lt(s, e), (a & Rt) !== 0) { + var s = n[i], a = s.f, o = (a & Rt) === 0; + if (o && ut(s, e), (a & Et) !== 0) { var l = ( /** @type {Derived} */ s ); - Et == null || Et.delete(l), (a & On) === 0 && (a & fe && (s.f |= On), oo(l, be)); - } else o && ((a & rn) !== 0 && ge !== null && ge.add( + At == null || At.delete(l), (a & On) === 0 && (a & ae && (s.f |= On), lo(l, we)); + } else o && ((a & sn) !== 0 && pe !== null && pe.add( /** @type {Effect} */ s - ), we( + ), me( /** @type {Effect} */ s )); } } function $n(t) { - if (typeof t != "object" || t === null || Mr in t) + if (typeof t != "object" || t === null || Fr in t) return t; - const e = Il(t); - if (e !== Dl && e !== Fl) + const e = Ll(t); + if (e !== Il && e !== Ol) return t; - var n = /* @__PURE__ */ new Map(), r = Fa(t), i = /* @__PURE__ */ yt(0), s = Fn, a = (o) => { + var n = /* @__PURE__ */ new Map(), r = Ia(t), i = /* @__PURE__ */ yt(0), s = Fn, a = (o) => { if (Fn === s) return o(); var l = Y, u = Fn; - de(null), oa(s); + ue(null), la(s); var f = o(); - return de(l), oa(u), f; + return ue(l), la(u), f; }; return r && n.set("length", /* @__PURE__ */ yt( /** @type {any[]} */ @@ -1131,35 +1131,35 @@ function $n(t) { t, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Jl(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && jl(); var f = n.get(l); return f === void 0 ? a(() => { - var h = /* @__PURE__ */ yt(u.value); - return n.set(l, h), h; - }) : ot(f, u.value, !0), !0; + var d = /* @__PURE__ */ yt(u.value); + return n.set(l, d), d; + }) : lt(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__ */ yt(At)); - n.set(l, f), Dr(i); + const f = a(() => /* @__PURE__ */ yt($t)); + n.set(l, f), Or(i); } } else - ot(u, At), Dr(i); + lt(u, $t), Or(i); return !0; }, get(o, l, u) { var p; - if (l === Mr) + if (l === Fr) return t; - var f = n.get(l), h = l in o; - if (f === void 0 && (!h || (p = Mn(o, l)) != null && p.writable) && (f = a(() => { - var g = $n(h ? o[l] : At), y = /* @__PURE__ */ yt(g); + var f = n.get(l), d = l in o; + if (f === void 0 && (!d || (p = Mn(o, l)) != null && p.writable) && (f = a(() => { + var g = $n(d ? o[l] : $t), y = /* @__PURE__ */ yt(g); return y; }), n.set(l, f)), f !== void 0) { var c = x(f); - return c === At ? void 0 : c; + return c === $t ? void 0 : c; } return Reflect.get(o, l, u); }, @@ -1169,8 +1169,8 @@ function $n(t) { var f = n.get(l); f && (u.value = x(f)); } else if (u === void 0) { - var h = n.get(l), c = h == null ? void 0 : h.v; - if (h !== void 0 && c !== At) + var d = n.get(l), c = d == null ? void 0 : d.v; + if (d !== void 0 && c !== $t) return { enumerable: !0, configurable: !0, @@ -1182,188 +1182,188 @@ function $n(t) { }, has(o, l) { var c; - if (l === Mr) + if (l === Fr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== At || Reflect.has(o, l); + var u = n.get(l), f = u !== void 0 && u.v !== $t || Reflect.has(o, l); if (u !== void 0 || U !== null && (!f || (c = Mn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { - var p = f ? $n(o[l]) : At, g = /* @__PURE__ */ yt(p); + var p = f ? $n(o[l]) : $t, g = /* @__PURE__ */ yt(p); return g; }), n.set(l, u)); - var h = x(u); - if (h === At) + var d = x(u); + if (d === $t) return !1; } return f; }, set(o, l, u, f) { var C; - var h = n.get(l), c = l in o; + var d = n.get(l), c = l in o; if (r && l === "length") for (var p = u; p < /** @type {Source} */ - h.v; p += 1) { + d.v; p += 1) { var g = n.get(p + ""); - g !== void 0 ? ot(g, At) : p in o && (g = a(() => /* @__PURE__ */ yt(At)), n.set(p + "", g)); + g !== void 0 ? lt(g, $t) : p in o && (g = a(() => /* @__PURE__ */ yt($t)), n.set(p + "", g)); } - if (h === void 0) - (!c || (C = Mn(o, l)) != null && C.writable) && (h = a(() => /* @__PURE__ */ yt(void 0)), ot(h, $n(u)), n.set(l, h)); + if (d === void 0) + (!c || (C = Mn(o, l)) != null && C.writable) && (d = a(() => /* @__PURE__ */ yt(void 0)), lt(d, $n(u)), n.set(l, d)); else { - c = h.v !== At; + c = d.v !== $t; var y = a(() => $n(u)); - ot(h, y); + lt(d, y); } var $ = Reflect.getOwnPropertyDescriptor(o, l); if ($ != null && $.set && $.set.call(f, u), !c) { if (r && typeof l == "string") { - var A = ( + var E = ( /** @type {Source} */ n.get("length") - ), k = Number(l); - Number.isInteger(k) && k >= A.v && ot(A, k + 1); + ), N = Number(l); + Number.isInteger(N) && N >= E.v && lt(E, N + 1); } - Dr(i); + Or(i); } return !0; }, ownKeys(o) { x(i); - var l = Reflect.ownKeys(o).filter((h) => { - var c = n.get(h); - return c === void 0 || c.v !== At; + var l = Reflect.ownKeys(o).filter((d) => { + var c = n.get(d); + return c === void 0 || c.v !== $t; }); for (var [u, f] of n) - f.v !== At && !(u in o) && l.push(u); + f.v !== $t && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - Zl(); + Ql(); } } ); } -var sa, lo, uo, fo; -function hs() { - if (sa === void 0) { - sa = window, lo = /Firefox/.test(navigator.userAgent); +var aa, uo, fo, co; +function ds() { + if (aa === void 0) { + aa = window, uo = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype, n = Text.prototype; - uo = Mn(e, "firstChild").get, fo = Mn(e, "nextSibling").get, na(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), na(n) && (n.__t = void 0); + fo = Mn(e, "firstChild").get, co = Mn(e, "nextSibling").get, ra(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), ra(n) && (n.__t = void 0); } } -function he(t = "") { +function le(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ function qn(t) { return ( /** @type {TemplateNode | null} */ - uo.call(t) + fo.call(t) ); } // @__NO_SIDE_EFFECTS__ -function Le(t) { +function Oe(t) { return ( /** @type {TemplateNode | null} */ - fo.call(t) + co.call(t) ); } -function Zt(t, e) { +function Gt(t, e) { if (!J) return /* @__PURE__ */ qn(t); var n = /* @__PURE__ */ qn(H); if (n === null) - n = H.appendChild(he()); - else if (e && n.nodeType !== Wr) { - var r = he(); - return n == null || n.before(r), zt(r), r; + n = H.appendChild(le()); + else if (e && n.nodeType !== Kr) { + var r = le(); + return n == null || n.before(r), Ht(r), r; } - return e && Fi( + return e && Ii( /** @type {Text} */ n - ), zt(n), n; + ), Ht(n), n; } function mn(t, e = !1) { if (!J) { var n = /* @__PURE__ */ qn(t); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Le(n) : n; + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Oe(n) : n; } if (e) { - if ((H == null ? void 0 : H.nodeType) !== Wr) { - var r = he(); - return H == null || H.before(r), zt(r), r; + if ((H == null ? void 0 : H.nodeType) !== Kr) { + var r = le(); + return H == null || H.before(r), Ht(r), r; } - Fi( + Ii( /** @type {Text} */ H ); } return H; } -function ve(t, e = 1, n = !1) { +function de(t, e = 1, n = !1) { let r = J ? H : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Le(r); + /* @__PURE__ */ Oe(r); if (!J) return r; if (n) { - if ((r == null ? void 0 : r.nodeType) !== Wr) { - var s = he(); - return r === null ? i == null || i.after(s) : r.before(s), zt(s), s; + if ((r == null ? void 0 : r.nodeType) !== Kr) { + var s = le(); + return r === null ? i == null || i.after(s) : r.before(s), Ht(s), s; } - Fi( + Ii( /** @type {Text} */ r ); } - return zt(r), r; + return Ht(r), r; } -function co(t) { +function ho(t) { t.textContent = ""; } -function ho() { +function po() { return !1; } -function Ms(t, e, n) { +function Ps(t, e, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Ml, t, void 0) + document.createElementNS(Dl, t, void 0) ); } -function Fi(t) { +function Ii(t) { if ( /** @type {string} */ t.nodeValue.length < 65536 ) return; let e = t.nextSibling; - for (; e !== null && e.nodeType === Wr; ) + for (; e !== null && e.nodeType === Kr; ) e.remove(), t.nodeValue += /** @type {string} */ e.nodeValue, e = t.nextSibling; } -function po(t) { +function vo(t) { var e = Y, n = U; - de(null), Ie(null); + ue(null), Fe(null); try { return t(); } finally { - de(e), Ie(n); + ue(e), Fe(n); } } -function _u(t) { - U === null && (Y === null && Wl(), Bl()), pn && Xl(); +function yu(t) { + U === null && (Y === null && Gl(), Ul()), pn && Wl(); } -function mu(t, e) { +function wu(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function qe(t, e, n) { +function Le(t, e, n) { var r = U; - r !== null && (r.f & ee) !== 0 && (t |= ee); + r !== null && (r.f & jt) !== 0 && (t |= jt); var i = { - ctx: ne, + ctx: Qt, deps: null, nodes: null, - f: t | Ct | fe, + f: t | Rt | ae, first: null, fn: e, last: null, @@ -1377,14 +1377,14 @@ function qe(t, e, n) { }; if (n) try { - dr(i); + vr(i); } catch (o) { - throw Ft(i), o; + throw Dt(i), o; } - else e !== null && we(i); + else e !== null && me(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 & zn) === 0 && (s = s.first, (t & rn) !== 0 && (t & ur) !== 0 && s !== null && (s.f |= ur)), s !== null && (s.parent = r, r !== null && mu(s, r), Y !== null && (Y.f & Rt) !== 0 && (t & vn) === 0)) { + (s.f & zn) === 0 && (s = s.first, (t & sn) !== 0 && (t & cr) !== 0 && s !== null && (s.f |= cr)), s !== null && (s.parent = r, r !== null && wu(s, r), Y !== null && (Y.f & Et) !== 0 && (t & vn) === 0)) { var a = ( /** @type {Derived} */ Y @@ -1393,127 +1393,127 @@ function qe(t, e, n) { } return i; } -function Ps() { - return Y !== null && !xe; +function Ds() { + return Y !== null && !ye; } -function yu(t) { - const e = qe(Ni, null, !1); - return lt(e, wt), e.teardown = t, e; +function xu(t) { + const e = Le(ki, null, !1); + return ut(e, wt), e.teardown = t, e; } -function Ds(t) { - _u(); +function Fs(t) { + yu(); var e = ( /** @type {Effect} */ U.f - ), n = !Y && (e & $e) !== 0 && (e & gr) === 0; + ), n = !Y && (e & xe) !== 0 && (e & mr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - ne + Qt ); (r.e ?? (r.e = [])).push(t); } else - return vo(t); + return go(t); } -function vo(t) { - return qe(Fr | Vl, t, !1); +function go(t) { + return Le(Lr | Hl, t, !1); } -function wu(t) { - en.ensure(); - const e = qe(vn | zn, t, !0); +function bu(t) { + nn.ensure(); + const e = Le(vn | zn, t, !0); return () => { - Ft(e); + Dt(e); }; } -function xu(t) { - en.ensure(); - const e = qe(vn | zn, t, !0); +function $u(t) { + nn.ensure(); + const e = Le(vn | zn, t, !0); return (n = {}) => new Promise((r) => { n.outro ? Dn(e, () => { - Ft(e), r(void 0); - }) : (Ft(e), r(void 0)); + Dt(e), r(void 0); + }) : (Dt(e), r(void 0)); }); } -function go(t) { - return qe(Fr, t, !1); +function _o(t) { + return Le(Lr, t, !1); } -function bu(t) { - return qe(Cs | zn, t, !0); +function Au(t) { + return Le(Ts | zn, t, !0); } -function Fs(t, e = 0) { - return qe(Ni | e, t, !0); +function Is(t, e = 0) { + return Le(ki | e, t, !0); } -function Zn(t, e = [], n = [], r = []) { - fu(r, e, n, (i) => { - qe(Ni, () => t(...i.map(x)), !0); +function Qn(t, e = [], n = [], r = []) { + hu(r, e, n, (i) => { + Le(ki, () => t(...i.map(x)), !0); }); } -function Is(t, e = 0) { - var n = qe(rn | e, t, !0); +function Os(t, e = 0) { + var n = Le(sn | e, t, !0); return n; } -function ue(t) { - return qe($e | zn, t, !0); +function se(t) { + return Le(xe | zn, t, !0); } -function _o(t) { +function mo(t) { var e = t.teardown; if (e !== null) { const n = pn, r = Y; - aa(!0), de(null); + oa(!0), ue(null); try { e.call(null); } finally { - aa(n), de(r); + oa(n), ue(r); } } } -function Os(t, e = !1) { +function Ls(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { const i = n.ac; - i !== null && po(() => { + i !== null && vo(() => { i.abort(xn); }); var r = n.next; - (n.f & vn) !== 0 ? n.parent = null : Ft(n, e), n = r; + (n.f & vn) !== 0 ? n.parent = null : Dt(n, e), n = r; } } -function $u(t) { +function Eu(t) { for (var e = t.first; e !== null; ) { var n = e.next; - (e.f & $e) === 0 && Ft(e), e = n; + (e.f & xe) === 0 && Dt(e), e = n; } } -function Ft(t, e = !0) { +function Dt(t, e = !0) { var n = !1; - (e || (t.f & qa) !== 0) && t.nodes !== null && t.nodes.end !== null && (Au( + (e || (t.f & Va) !== 0) && t.nodes !== null && t.nodes.end !== null && (Ru( t.nodes.start, /** @type {TemplateNode} */ t.nodes.end - ), n = !0), Os(t, e && !n), Ir(t, 0), lt(t, tn); + ), n = !0), Ls(t, e && !n), qr(t, 0), ut(t, en); var r = t.nodes && t.nodes.t; if (r !== null) for (const s of r) s.stop(); - _o(t); + mo(t); var i = t.parent; - i !== null && i.first !== null && mo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; + i !== null && i.first !== null && yo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; } -function Au(t, e) { +function Ru(t, e) { for (; t !== null; ) { - var n = t === e ? null : /* @__PURE__ */ Le(t); + var n = t === e ? null : /* @__PURE__ */ Oe(t); t.remove(), t = n; } } -function mo(t) { +function yo(t) { var e = t.parent, n = t.prev, r = t.next; n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); } function Dn(t, e, n = !0) { var r = []; - yo(t, r, !0); + wo(t, r, !0); var i = () => { - n && Ft(t), e && e(); + n && Dt(t), e && e(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1522,31 +1522,31 @@ function Dn(t, e, n = !0) { } else i(); } -function yo(t, e, n) { - if ((t.f & ee) === 0) { - t.f ^= ee; +function wo(t, e, n) { + if ((t.f & jt) === 0) { + t.f ^= jt; var r = t.nodes && t.nodes.t; if (r !== null) for (const o of r) (o.is_global || n) && e.push(o); for (var i = t.first; i !== null; ) { - var s = i.next, a = (i.f & ur) !== 0 || // If this is a branch effect without a block effect parent, + var s = i.next, a = (i.f & cr) !== 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 & $e) !== 0 && (t.f & rn) !== 0; - yo(i, e, a ? n : !1), i = s; + (i.f & xe) !== 0 && (t.f & sn) !== 0; + wo(i, e, a ? n : !1), i = s; } } } -function Ls(t) { - wo(t, !0); +function qs(t) { + xo(t, !0); } -function wo(t, e) { - if ((t.f & ee) !== 0) { - t.f ^= ee, (t.f & wt) === 0 && (lt(t, Ct), we(t)); +function xo(t, e) { + if ((t.f & jt) !== 0) { + t.f ^= jt, (t.f & wt) === 0 && (ut(t, Rt), me(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & ur) !== 0 || (n.f & $e) !== 0; - wo(n, i ? e : !1), n = r; + var r = n.next, i = (n.f & cr) !== 0 || (n.f & xe) !== 0; + xo(n, i ? e : !1), n = r; } var s = t.nodes && t.nodes.t; if (s !== null) @@ -1554,112 +1554,112 @@ function wo(t, e) { (a.is_global || e) && a.in(); } } -function xo(t, e) { +function bo(t, e) { if (t.nodes) for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Le(n); + var i = n === r ? null : /* @__PURE__ */ Oe(n); e.append(n), n = i; } } -let oi = !1, pn = !1; -function aa(t) { +let li = !1, pn = !1; +function oa(t) { pn = t; } -let Y = null, xe = !1; -function de(t) { +let Y = null, ye = !1; +function ue(t) { Y = t; } let U = null; -function Ie(t) { +function Fe(t) { U = t; } -let ce = null; -function bo(t) { - Y !== null && (ce === null ? ce = [t] : ce.push(t)); +let oe = null; +function $o(t) { + Y !== null && (oe === null ? oe = [t] : oe.push(t)); } -let Yt = null, jt = 0, ae = null; -function Eu(t) { - ae = t; +let Vt = null, Kt = 0, ne = null; +function Cu(t) { + ne = t; } -let $o = 1, An = 0, Fn = An; -function oa(t) { +let Ao = 1, An = 0, Fn = An; +function la(t) { Fn = t; } -function Ao() { - return ++$o; +function Eo() { + return ++Ao; } -function Ur(t) { +function Jr(t) { var e = t.f; - if ((e & Ct) !== 0) + if ((e & Rt) !== 0) return !0; - if (e & Rt && (t.f &= ~On), (e & be) !== 0) { + if (e & Et && (t.f &= ~On), (e & we) !== 0) { for (var n = ( /** @type {Value[]} */ t.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (Ur( + if (Jr( /** @type {Derived} */ s - ) && ro( + ) && io( /** @type {Derived} */ s ), s.wv > t.wv) return !0; } - (e & fe) !== 0 && // During time traveling we don't want to reset the status so that + (e & ae) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - Et === null && lt(t, wt); + At === null && ut(t, wt); } return !1; } -function Eo(t, e, n = !0) { +function Ro(t, e, n = !0) { var r = t.reactions; - if (r !== null && !(ce !== null && lr.call(ce, t))) + if (r !== null && !(oe !== null && fr.call(oe, t))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Rt) !== 0 ? Eo( + (s.f & Et) !== 0 ? Ro( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? lt(s, Ct) : (s.f & wt) !== 0 && lt(s, be), we( + ) : e === s && (n ? ut(s, Rt) : (s.f & wt) !== 0 && ut(s, we), me( /** @type {Effect} */ s )); } } -function Ro(t) { +function Co(t) { var y; - var e = Yt, n = jt, r = ae, i = Y, s = ce, a = ne, o = xe, l = Fn, u = t.f; - Yt = /** @type {null | Value[]} */ - null, jt = 0, ae = null, Y = (u & ($e | vn)) === 0 ? t : null, ce = null, fr(t.ctx), xe = !1, Fn = ++An, t.ac !== null && (po(() => { + var e = Vt, n = Kt, r = ne, i = Y, s = oe, a = Qt, o = ye, l = Fn, u = t.f; + Vt = /** @type {null | Value[]} */ + null, Kt = 0, ne = null, Y = (u & (xe | vn)) === 0 ? t : null, oe = null, hr(t.ctx), ye = !1, Fn = ++An, t.ac !== null && (vo(() => { t.ac.abort(xn); }), t.ac = null); try { - t.f |= rs; + t.f |= is; var f = ( /** @type {Function} */ t.fn - ), h = f(); - t.f |= gr; + ), d = f(); + t.f |= mr; var c = t.deps, p = B == null ? void 0 : B.is_fork; - if (Yt !== null) { + if (Vt !== null) { var g; - if (p || Ir(t, jt), c !== null && jt > 0) - for (c.length = jt + Yt.length, g = 0; g < Yt.length; g++) - c[jt + g] = Yt[g]; + if (p || qr(t, Kt), c !== null && Kt > 0) + for (c.length = Kt + Vt.length, g = 0; g < Vt.length; g++) + c[Kt + g] = Vt[g]; else - t.deps = c = Yt; - if (Ps() && (t.f & fe) !== 0) - for (g = jt; g < c.length; g++) + t.deps = c = Vt; + if (Ds() && (t.f & ae) !== 0) + for (g = Kt; g < c.length; g++) ((y = c[g]).reactions ?? (y.reactions = [])).push(t); - } else !p && c !== null && jt < c.length && (Ir(t, jt), c.length = jt); - if (Xa() && ae !== null && !xe && c !== null && (t.f & (Rt | be | Ct)) === 0) + } else !p && c !== null && Kt < c.length && (qr(t, Kt), c.length = Kt); + if (Ba() && ne !== null && !ye && c !== null && (t.f & (Et | we | Rt)) === 0) for (g = 0; g < /** @type {Source[]} */ - ae.length; g++) - Eo( - ae[g], + ne.length; g++) + Ro( + ne[g], /** @type {Effect} */ t ); @@ -1670,71 +1670,71 @@ function Ro(t) { if (e !== null) for (const $ of e) $.rv = An; - ae !== null && (r === null ? r = ae : r.push(.../** @type {Source[]} */ - ae)); + ne !== null && (r === null ? r = ne : r.push(.../** @type {Source[]} */ + ne)); } - return (t.f & hn) !== 0 && (t.f ^= hn), h; + return (t.f & hn) !== 0 && (t.f ^= hn), d; } catch ($) { - return Wa($); + return Ua($); } finally { - t.f ^= rs, Yt = e, jt = n, ae = r, Y = i, ce = s, fr(a), xe = o, Fn = l; + t.f ^= is, Vt = e, Kt = n, ne = r, Y = i, oe = s, hr(a), ye = o, Fn = l; } } -function Ru(t, e) { +function Tu(t, e) { let n = e.reactions; if (n !== null) { - var r = Pl.call(n, t); + var r = Fl.call(n, t); if (r !== -1) { var i = n.length - 1; i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (e.f & Rt) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (e.f & Et) !== 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 - (Yt === null || !lr.call(Yt, e))) { + (Vt === null || !fr.call(Vt, e))) { var s = ( /** @type {Derived} */ e ); - (s.f & fe) !== 0 && (s.f ^= fe, s.f &= ~On), Ns(s), vu(s), Ir(s, 0); + (s.f & ae) !== 0 && (s.f ^= ae, s.f &= ~On), ks(s), _u(s), qr(s, 0); } } -function Ir(t, e) { +function qr(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - Ru(t, n[r]); + Tu(t, n[r]); } -function dr(t) { +function vr(t) { var e = t.f; - if ((e & tn) === 0) { - lt(t, wt); - var n = U, r = oi; - U = t, oi = !0; + if ((e & en) === 0) { + ut(t, wt); + var n = U, r = li; + U = t, li = !0; try { - (e & (rn | Oa)) !== 0 ? $u(t) : Os(t), _o(t); - var i = Ro(t); - t.teardown = typeof i == "function" ? i : null, t.wv = $o; + (e & (sn | La)) !== 0 ? Eu(t) : Ls(t), mo(t); + var i = Co(t); + t.teardown = typeof i == "function" ? i : null, t.wv = Ao; var s; - ns && nu && (t.f & Ct) !== 0 && t.deps; + rs && iu && (t.f & Rt) !== 0 && t.deps; } finally { - oi = r, U = n; + li = r, U = n; } } } function x(t) { - var e = t.f, n = (e & Rt) !== 0; - if (Y !== null && !xe) { - var r = U !== null && (U.f & tn) !== 0; - if (!r && (ce === null || !lr.call(ce, t))) { + var e = t.f, n = (e & Et) !== 0; + if (Y !== null && !ye) { + var r = U !== null && (U.f & en) !== 0; + if (!r && (oe === null || !fr.call(oe, t))) { var i = Y.deps; - if ((Y.f & rs) !== 0) - t.rv < An && (t.rv = An, Yt === null && i !== null && i[jt] === t ? jt++ : Yt === null ? Yt = [t] : Yt.push(t)); + if ((Y.f & is) !== 0) + t.rv < An && (t.rv = An, Vt === null && i !== null && i[Kt] === t ? Kt++ : Vt === null ? Vt = [t] : Vt.push(t)); else { (Y.deps ?? (Y.deps = [])).push(t); var s = t.reactions; - s === null ? t.reactions = [Y] : lr.call(s, Y) || s.push(Y); + s === null ? t.reactions = [Y] : fr.call(s, Y) || s.push(Y); } } } @@ -1747,56 +1747,56 @@ function x(t) { ); if (pn) { var o = a.v; - return ((a.f & wt) === 0 && a.reactions !== null || To(a)) && (o = ks(a)), dn.set(a, o), o; + return ((a.f & wt) === 0 && a.reactions !== null || So(a)) && (o = Ms(a)), dn.set(a, o), o; } - var l = (a.f & fe) === 0 && !xe && Y !== null && (oi || (Y.f & fe) !== 0), u = (a.f & gr) === 0; - Ur(a) && (l && (a.f |= fe), ro(a)), l && !u && (io(a), Co(a)); + var l = (a.f & ae) === 0 && !ye && Y !== null && (li || (Y.f & ae) !== 0), u = (a.f & mr) === 0; + Jr(a) && (l && (a.f |= ae), io(a)), l && !u && (so(a), To(a)); } - if (Et != null && Et.has(t)) - return Et.get(t); + if (At != null && At.has(t)) + return At.get(t); if ((t.f & hn) !== 0) throw t.v; return t.v; } -function Co(t) { - if (t.f |= fe, t.deps !== null) +function To(t) { + if (t.f |= ae, t.deps !== null) for (const e of t.deps) - (e.reactions ?? (e.reactions = [])).push(t), (e.f & Rt) !== 0 && (e.f & fe) === 0 && (io( + (e.reactions ?? (e.reactions = [])).push(t), (e.f & Et) !== 0 && (e.f & ae) === 0 && (so( /** @type {Derived} */ e - ), Co( + ), To( /** @type {Derived} */ e )); } -function To(t) { - if (t.v === At) return !0; +function So(t) { + if (t.v === $t) return !0; if (t.deps === null) return !1; for (const e of t.deps) - if (dn.has(e) || (e.f & Rt) !== 0 && To( + if (dn.has(e) || (e.f & Et) !== 0 && So( /** @type {Derived} */ e )) return !0; return !1; } -function Ii(t) { - var e = xe; +function Oi(t) { + var e = ye; try { - return xe = !0, t(); + return ye = !0, t(); } finally { - xe = e; + ye = e; } } -const So = /* @__PURE__ */ new Set(), ds = /* @__PURE__ */ new Set(); -function Cu(t) { +const No = /* @__PURE__ */ new Set(), ps = /* @__PURE__ */ new Set(); +function Su(t) { for (var e = 0; e < t.length; e++) - So.add(t[e]); - for (var n of ds) + No.add(t[e]); + for (var n of ps) n(t); } -let la = null; -function ua(t) { +let ua = null; +function fa(t) { var $; var e = this, n = ( /** @type {Node} */ @@ -1805,8 +1805,8 @@ function ua(t) { /** @type {null | Element} */ i[0] || t.target ); - la = t; - var a = 0, o = la === t && t.__root; + ua = t; + var a = 0, o = ua === t && t.__root; if (o) { var l = i.indexOf(o); if (l !== -1 && (e === document || e === /** @type {any} */ @@ -1821,14 +1821,14 @@ function ua(t) { } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - gi(t, "currentTarget", { + _i(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = Y, h = U; - de(null), Ie(null); + var f = Y, d = U; + ue(null), Fe(null); try { for (var c, p = []; s !== null; ) { var g = s.assignedSlot || s.parentNode || /** @type {any} */ @@ -1839,42 +1839,42 @@ function ua(t) { 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 t.target === s) && y.call(s, t); - } catch (A) { - c ? p.push(A) : c = A; + } catch (E) { + c ? p.push(E) : c = E; } if (t.cancelBubble || g === e || g === null) break; s = g; } if (c) { - for (let A of p) + for (let E of p) queueMicrotask(() => { - throw A; + throw E; }); throw c; } } finally { - t.__root = e, delete t.currentTarget, de(f), Ie(h); + t.__root = e, delete t.currentTarget, ue(f), Fe(d); } } } -var Pa, Da; -const Gi = (Da = (Pa = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Pa.trustedTypes) == null ? void 0 : /* @__PURE__ */ Da.createPolicy( +var Da, Fa; +const Ki = (Fa = (Da = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Da.trustedTypes) == null ? void 0 : /* @__PURE__ */ Fa.createPolicy( "svelte-trusted-html", { /** @param {string} html */ createHTML: (t) => t } ); -function Tu(t) { +function Nu(t) { return ( /** @type {string} */ - (Gi == null ? void 0 : Gi.createHTML(t)) ?? t + (Ki == null ? void 0 : Ki.createHTML(t)) ?? t ); } -function No(t, e = !1) { - var n = Ms("template"); - return t = t.replaceAll("", ""), n.innerHTML = e ? Tu(t) : t, n.content; +function ko(t, e = !1) { + var n = Ps("template"); + return t = t.replaceAll("", ""), n.innerHTML = e ? Nu(t) : t, n.content; } function Vn(t, e) { var n = ( @@ -1885,14 +1885,14 @@ function Vn(t, e) { } // @__NO_SIDE_EFFECTS__ function Xn(t, e) { - var n = (e & kl) !== 0, r, i = !t.startsWith(""); + var n = (e & Pl) !== 0, r, i = !t.startsWith(""); return () => { if (J) return Vn(H, null), H; - r === void 0 && (r = No(i ? t : "" + t, !0)); + r === void 0 && (r = ko(i ? t : "" + t, !0)); var s = ( /** @type {TemplateNode} */ - n || lo ? document.importNode(r, !0) : r.cloneNode(!0) + n || uo ? document.importNode(r, !0) : r.cloneNode(!0) ); { var a = ( @@ -1908,7 +1908,7 @@ function Xn(t, e) { }; } // @__NO_SIDE_EFFECTS__ -function Su(t, e, n = "svg") { +function ku(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { if (J) @@ -1916,7 +1916,7 @@ function Su(t, e, n = "svg") { if (!s) { var a = ( /** @type {DocumentFragment} */ - No(i, !0) + ko(i, !0) ), o = ( /** @type {Element} */ /* @__PURE__ */ qn(a) @@ -1932,27 +1932,27 @@ function Su(t, e, n = "svg") { }; } // @__NO_SIDE_EFFECTS__ -function Nu(t, e) { - return /* @__PURE__ */ Su(t, e, "svg"); +function Mu(t, e) { + return /* @__PURE__ */ ku(t, e, "svg"); } -function fa(t = "") { +function ca(t = "") { if (!J) { - var e = he(t + ""); + var e = le(t + ""); return Vn(e, e), e; } var n = H; - return n.nodeType !== Wr ? (n.before(n = he()), zt(n)) : Fi( + return n.nodeType !== Kr ? (n.before(n = le()), Ht(n)) : Ii( /** @type {Text} */ n ), Vn(n, n), n; } -function _e(t, e) { +function ve(t, e) { if (J) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ U ); - ((n.f & gr) === 0 || n.nodes.end === null) && (n.nodes.end = H), Mi(); + ((n.f & mr) === 0 || n.nodes.end === null) && (n.nodes.end = H), Pi(); return; } t !== null && t.before( @@ -1960,84 +1960,84 @@ function _e(t, e) { e ); } -const ku = ["touchstart", "touchmove"]; -function Mu(t) { - return ku.includes(t); +const Pu = ["touchstart", "touchmove"]; +function Du(t) { + return Pu.includes(t); } function ln(t, e) { var n = e == null ? "" : typeof e == "object" ? e + "" : e; n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); } -function ko(t, e) { - return Mo(t, e); +function Mo(t, e) { + return Po(t, e); } -function Pu(t, e) { - hs(), e.intro = e.intro ?? !1; +function Fu(t, e) { + ds(), e.intro = e.intro ?? !1; const n = e.target, r = J, i = H; try { - for (var s = /* @__PURE__ */ qn(n); s && (s.nodeType !== _r || /** @type {Comment} */ - s.data !== Es); ) - s = /* @__PURE__ */ Le(s); + for (var s = /* @__PURE__ */ qn(n); s && (s.nodeType !== yr || /** @type {Comment} */ + s.data !== Rs); ) + s = /* @__PURE__ */ Oe(s); if (!s) - throw or; - Qe(!0), zt( + throw ur; + tn(!0), Ht( /** @type {Comment} */ s ); - const a = Mo(t, { ...e, anchor: s }); - return Qe(!1), /** @type {Exports} */ + const a = Po(t, { ...e, anchor: s }); + return tn(!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 !== or && console.warn("Failed to hydrate: ", a), e.recover === !1 && Gl(), hs(), co(n), Qe(!1), ko(t, e); + return a !== ur && console.warn("Failed to hydrate: ", a), e.recover === !1 && Jl(), ds(), ho(n), tn(!1), Mo(t, e); } finally { - Qe(r), zt(i); + tn(r), Ht(i); } } -const Qr = /* @__PURE__ */ new Map(); -function Mo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - hs(); - var o = /* @__PURE__ */ new Set(), l = (h) => { - for (var c = 0; c < h.length; c++) { - var p = h[c]; +const ti = /* @__PURE__ */ new Map(); +function Po(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + ds(); + var o = /* @__PURE__ */ new Set(), l = (d) => { + for (var c = 0; c < d.length; c++) { + var p = d[c]; if (!o.has(p)) { o.add(p); - var g = Mu(p); - for (const A of [e, document]) { - var y = Qr.get(A); - y === void 0 && (y = /* @__PURE__ */ new Map(), Qr.set(A, y)); + var g = Du(p); + for (const E of [e, document]) { + var y = ti.get(E); + y === void 0 && (y = /* @__PURE__ */ new Map(), ti.set(E, y)); var $ = y.get(p); - $ === void 0 ? (A.addEventListener(p, ua, { passive: g }), y.set(p, 1)) : y.set(p, $ + 1); + $ === void 0 ? (E.addEventListener(p, fa, { passive: g }), y.set(p, 1)) : y.set(p, $ + 1); } } } }; - l(Si(So)), ds.add(l); - var u = void 0, f = xu(() => { - var h = n ?? e.appendChild(he()); - return lu( + l(Ni(No)), ps.add(l); + var u = void 0, f = $u(() => { + var d = n ?? e.appendChild(le()); + return fu( /** @type {TemplateNode} */ - h, + d, { pending: () => { } }, (c) => { - Ts({}); + Ss({}); var p = ( /** @type {ComponentContext} */ - ne + Qt ); if (s && (p.c = s), i && (r.$$events = i), J && Vn( /** @type {TemplateNode} */ c, null - ), u = t(c, r) || {}, J && (U.nodes.end = H, H === null || H.nodeType !== _r || /** @type {Comment} */ - H.data !== Rs)) - throw ki(), or; - Ss(); + ), u = t(c, r) || {}, J && (U.nodes.end = H, H === null || H.nodeType !== yr || /** @type {Comment} */ + H.data !== Cs)) + throw Mi(), ur; + Ns(); } ), () => { var y; @@ -2045,34 +2045,34 @@ function Mo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, int for (const $ of [e, document]) { var p = ( /** @type {Map} */ - Qr.get($) + ti.get($) ), g = ( /** @type {number} */ p.get(c) ); - --g == 0 ? ($.removeEventListener(c, ua), p.delete(c), p.size === 0 && Qr.delete($)) : p.set(c, g); + --g == 0 ? ($.removeEventListener(c, fa), p.delete(c), p.size === 0 && ti.delete($)) : p.set(c, g); } - ds.delete(l), h !== n && ((y = h.parentNode) == null || y.removeChild(h)); + ps.delete(l), d !== n && ((y = d.parentNode) == null || y.removeChild(d)); }; }); - return ps.set(u, f), u; + return vs.set(u, f), u; } -let ps = /* @__PURE__ */ new WeakMap(); -function Du(t, e) { - const n = ps.get(t); - return n ? (ps.delete(t), n(e)) : Promise.resolve(); +let vs = /* @__PURE__ */ new WeakMap(); +function Iu(t, e) { + const n = vs.get(t); + return n ? (vs.delete(t), n(e)) : Promise.resolve(); } -var me, Pe, te, kn, Xr, Br, Ci; -class Fu { +var ge, Me, Zt, kn, Ur, Gr, Ti; +class Ou { /** * @param {TemplateNode} anchor * @param {boolean} transition */ constructor(e, n = !0) { /** @type {TemplateNode} */ - st(this, "anchor"); + at(this, "anchor"); /** @type {Map} */ - q(this, me, /* @__PURE__ */ new Map()); + q(this, ge, /* @__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. @@ -2087,13 +2087,13 @@ class Fu { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - q(this, Pe, /* @__PURE__ */ new Map()); + q(this, Me, /* @__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} */ - q(this, te, /* @__PURE__ */ new Map()); + q(this, Zt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} @@ -2103,53 +2103,53 @@ class Fu { * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - q(this, Xr, !0); - q(this, Br, () => { + q(this, Ur, !0); + q(this, Gr, () => { var e = ( /** @type {Batch} */ B ); - if (v(this, me).has(e)) { + if (v(this, ge).has(e)) { var n = ( /** @type {Key} */ - v(this, me).get(e) - ), r = v(this, Pe).get(n); + v(this, ge).get(e) + ), r = v(this, Me).get(n); if (r) - Ls(r), v(this, kn).delete(n); + qs(r), v(this, kn).delete(n); else { - var i = v(this, te).get(n); - i && (v(this, Pe).set(n, i.effect), v(this, te).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, Zt).get(n); + i && (v(this, Me).set(n, i.effect), v(this, Zt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, me)) { - if (v(this, me).delete(s), s === e) + for (const [s, a] of v(this, ge)) { + if (v(this, ge).delete(s), s === e) break; - const o = v(this, te).get(a); - o && (Ft(o.effect), v(this, te).delete(a)); + const o = v(this, Zt).get(a); + o && (Dt(o.effect), v(this, Zt).delete(a)); } - for (const [s, a] of v(this, Pe)) { + for (const [s, a] of v(this, Me)) { if (s === n || v(this, kn).has(s)) continue; const o = () => { - if (Array.from(v(this, me).values()).includes(s)) { + if (Array.from(v(this, ge).values()).includes(s)) { var u = document.createDocumentFragment(); - xo(a, u), u.append(he()), v(this, te).set(s, { effect: a, fragment: u }); + bo(a, u), u.append(le()), v(this, Zt).set(s, { effect: a, fragment: u }); } else - Ft(a); - v(this, kn).delete(s), v(this, Pe).delete(s); + Dt(a); + v(this, kn).delete(s), v(this, Me).delete(s); }; - v(this, Xr) || !r ? (v(this, kn).add(s), Dn(a, o, !1)) : o(); + v(this, Ur) || !r ? (v(this, kn).add(s), Dn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - q(this, Ci, (e) => { - v(this, me).delete(e); - const n = Array.from(v(this, me).values()); - for (const [r, i] of v(this, te)) - n.includes(r) || (Ft(i.effect), v(this, te).delete(r)); + q(this, Ti, (e) => { + v(this, ge).delete(e); + const n = Array.from(v(this, ge).values()); + for (const [r, i] of v(this, Zt)) + n.includes(r) || (Dt(i.effect), v(this, Zt).delete(r)); }); - this.anchor = e, O(this, Xr, n); + this.anchor = e, O(this, Ur, n); } /** * @@ -2160,77 +2160,77 @@ class Fu { var r = ( /** @type {Batch} */ B - ), i = ho(); - if (n && !v(this, Pe).has(e) && !v(this, te).has(e)) + ), i = po(); + if (n && !v(this, Me).has(e) && !v(this, Zt).has(e)) if (i) { - var s = document.createDocumentFragment(), a = he(); - s.append(a), v(this, te).set(e, { - effect: ue(() => n(a)), + var s = document.createDocumentFragment(), a = le(); + s.append(a), v(this, Zt).set(e, { + effect: se(() => n(a)), fragment: s }); } else - v(this, Pe).set( + v(this, Me).set( e, - ue(() => n(this.anchor)) + se(() => n(this.anchor)) ); - if (v(this, me).set(r, e), i) { - for (const [o, l] of v(this, Pe)) + if (v(this, ge).set(r, e), i) { + for (const [o, l] of v(this, Me)) o === e ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, te)) + for (const [o, l] of v(this, Zt)) o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, Br)), r.ondiscard(v(this, Ci)); + r.oncommit(v(this, Gr)), r.ondiscard(v(this, Ti)); } else - J && (this.anchor = H), v(this, Br).call(this); + J && (this.anchor = H), v(this, Gr).call(this); } } -me = new WeakMap(), Pe = new WeakMap(), te = new WeakMap(), kn = new WeakMap(), Xr = new WeakMap(), Br = new WeakMap(), Ci = new WeakMap(); -function Iu(t) { - ne === null && Yl(), Ds(() => { - const e = Ii(t); +ge = new WeakMap(), Me = new WeakMap(), Zt = new WeakMap(), kn = new WeakMap(), Ur = new WeakMap(), Gr = new WeakMap(), Ti = new WeakMap(); +function Lu(t) { + Qt === null && zl(), Fs(() => { + const e = Oi(t); if (typeof e == "function") return ( /** @type {() => void} */ e ); }); } -function Er(t, e, n = !1) { - J && Mi(); - var r = new Fu(t), i = n ? ur : 0; +function Tr(t, e, n = !1) { + J && Pi(); + var r = new Ou(t), i = n ? cr : 0; function s(a, o) { if (J) { - const f = Ya(t); + const f = Ha(t); var l; - if (f === Es ? l = 0 : f === Ti ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = _i(); - zt(u), r.anchor = u, Qe(!1), r.ensure(a, o), Qe(!0); + if (f === Rs ? l = 0 : f === Si ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = mi(); + Ht(u), r.anchor = u, tn(!1), r.ensure(a, o), tn(!0); return; } } r.ensure(a, o); } - Is(() => { + Os(() => { var a = !1; e((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function Ki(t, e) { +function Ji(t, e) { return e; } -function Ou(t, e, n) { +function qu(t, e, n) { for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { - let h = e[o]; + let d = e[o]; Dn( - h, + d, () => { if (s) { - if (s.pending.delete(h), s.done.add(h), s.pending.size === 0) { + if (s.pending.delete(d), s.done.add(d), s.pending.size === 0) { var c = ( /** @type {Set} */ t.outrogroups ); - vs(Si(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); + gs(Ni(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); } } else a -= 1; @@ -2248,145 +2248,145 @@ function Ou(t, e, n) { /** @type {Element} */ u.parentNode ); - co(f), f.append(u), t.items.clear(); + ho(f), f.append(u), t.items.clear(); } - vs(e, !l); + gs(e, !l); } else s = { pending: new Set(e), done: /* @__PURE__ */ new Set() }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function vs(t, e = !0) { +function gs(t, e = !0) { for (var n = 0; n < t.length; n++) - Ft(t[n], e); + Dt(t[n], e); } -var ca; -function Ji(t, e, n, r, i, s = null) { +var ha; +function Zi(t, e, n, r, i, s = null) { var a = t, o = /* @__PURE__ */ new Map(); - J && Mi(); - var l = null, u = /* @__PURE__ */ no(() => { + J && Pi(); + var l = null, u = /* @__PURE__ */ ro(() => { var y = n(); - return Fa(y) ? y : y == null ? [] : Si(y); - }), f, h = !0; + return Ia(y) ? y : y == null ? [] : Ni(y); + }), f, d = !0; function c() { - g.fallback = l, Lu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & cn) === 0 ? Ls(l) : (l.f ^= cn, Tr(l, null, a)) : Dn(l, () => { + g.fallback = l, Vu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & cn) === 0 ? qs(l) : (l.f ^= cn, kr(l, null, a)) : Dn(l, () => { l = null; })); } - var p = Is(() => { + var p = Os(() => { f = /** @type {V[]} */ x(u); var y = f.length; let $ = !1; if (J) { - var A = Ya(a) === Ti; - A !== (y === 0) && (a = _i(), zt(a), Qe(!1), $ = !0); + var E = Ha(a) === Si; + E !== (y === 0) && (a = mi(), Ht(a), tn(!1), $ = !0); } - for (var k = /* @__PURE__ */ new Set(), C = ( + for (var N = /* @__PURE__ */ new Set(), C = ( /** @type {Batch} */ B - ), D = ho(), P = 0; P < y; P += 1) { - J && H.nodeType === _r && /** @type {Comment} */ - H.data === Rs && (a = /** @type {Comment} */ - H, $ = !0, Qe(!1)); - var G = f[P], ut = r(G, P), K = h ? null : o.get(ut); - K ? (K.v && hr(K.v, G), K.i && hr(K.i, P), D && C.unskip_effect(K.e)) : (K = qu( + ), P = po(), M = 0; M < y; M += 1) { + J && H.nodeType === yr && /** @type {Comment} */ + H.data === Cs && (a = /** @type {Comment} */ + H, $ = !0, tn(!1)); + var G = f[M], ft = r(G, M), K = d ? null : o.get(ft); + K ? (K.v && pr(K.v, G), K.i && pr(K.i, M), P && C.unskip_effect(K.e)) : (K = Yu( o, - h ? a : ca ?? (ca = he()), + d ? a : ha ?? (ha = le()), G, - ut, - P, + ft, + M, i, e, n - ), h || (K.e.f |= cn), o.set(ut, K)), k.add(ut); + ), d || (K.e.f |= cn), o.set(ft, K)), N.add(ft); } - if (y === 0 && s && !l && (h ? l = ue(() => s(a)) : (l = ue(() => s(ca ?? (ca = he()))), l.f |= cn)), y > k.size && zl(), J && y > 0 && zt(_i()), !h) - if (D) { - for (const [it, Q] of o) - k.has(it) || C.skip_effect(Q.e); + if (y === 0 && s && !l && (d ? l = se(() => s(a)) : (l = se(() => s(ha ?? (ha = le()))), l.f |= cn)), y > N.size && Bl(), J && y > 0 && Ht(mi()), !d) + if (P) { + for (const [st, tt] of o) + N.has(st) || C.skip_effect(tt.e); C.oncommit(c), C.ondiscard(() => { }); } else c(); - $ && Qe(!0), x(u); + $ && tn(!0), x(u); }), g = { effect: p, items: o, outrogroups: null, fallback: l }; - h = !1, J && (a = H); + d = !1, J && (a = H); } -function Rr(t) { - for (; t !== null && (t.f & $e) === 0; ) +function Sr(t) { + for (; t !== null && (t.f & xe) === 0; ) t = t.next; return t; } -function Lu(t, e, n, r, i) { +function Vu(t, e, n, r, i) { var K; - var s = e.length, a = t.items, o = Rr(t.effect.first), l, u = null, f = [], h = [], c, p, g, y; + var s = e.length, a = t.items, o = Sr(t.effect.first), l, u = null, f = [], d = [], c, p, g, y; for (y = 0; y < s; y += 1) { if (c = e[y], p = i(c, y), g = /** @type {EachItem} */ a.get(p).e, t.outrogroups !== null) - for (const it of t.outrogroups) - it.pending.delete(g), it.done.delete(g); + for (const st of t.outrogroups) + st.pending.delete(g), st.done.delete(g); if ((g.f & cn) !== 0) if (g.f ^= cn, g === o) - Tr(g, null, n); + kr(g, null, n); else { var $ = u ? u.next : o; - g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), un(t, u, g), un(t, g, $), Tr(g, $, n), u = g, f = [], h = [], o = Rr(u.next); + g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), un(t, u, g), un(t, g, $), kr(g, $, n), u = g, f = [], d = [], o = Sr(u.next); continue; } - if ((g.f & ee) !== 0 && Ls(g), g !== o) { + if ((g.f & jt) !== 0 && qs(g), g !== o) { if (l !== void 0 && l.has(g)) { - if (f.length < h.length) { - var A = h[0], k; - u = A.prev; - var C = f[0], D = f[f.length - 1]; - for (k = 0; k < f.length; k += 1) - Tr(f[k], A, n); - for (k = 0; k < h.length; k += 1) - l.delete(h[k]); - un(t, C.prev, D.next), un(t, u, C), un(t, D, A), o = A, u = D, y -= 1, f = [], h = []; + if (f.length < d.length) { + var E = d[0], N; + u = E.prev; + var C = f[0], P = f[f.length - 1]; + for (N = 0; N < f.length; N += 1) + kr(f[N], E, n); + for (N = 0; N < d.length; N += 1) + l.delete(d[N]); + un(t, C.prev, P.next), un(t, u, C), un(t, P, E), o = E, u = P, y -= 1, f = [], d = []; } else - l.delete(g), Tr(g, o, n), un(t, g.prev, g.next), un(t, g, u === null ? t.effect.first : u.next), un(t, u, g), u = g; + l.delete(g), kr(g, o, n), un(t, g.prev, g.next), un(t, g, u === null ? t.effect.first : u.next), un(t, u, g), u = g; continue; } - for (f = [], h = []; o !== null && o !== g; ) - (l ?? (l = /* @__PURE__ */ new Set())).add(o), h.push(o), o = Rr(o.next); + for (f = [], d = []; o !== null && o !== g; ) + (l ?? (l = /* @__PURE__ */ new Set())).add(o), d.push(o), o = Sr(o.next); if (o === null) continue; } - (g.f & cn) === 0 && f.push(g), u = g, o = Rr(g.next); + (g.f & cn) === 0 && f.push(g), u = g, o = Sr(g.next); } if (t.outrogroups !== null) { - for (const it of t.outrogroups) - it.pending.size === 0 && (vs(Si(it.done)), (K = t.outrogroups) == null || K.delete(it)); + for (const st of t.outrogroups) + st.pending.size === 0 && (gs(Ni(st.done)), (K = t.outrogroups) == null || K.delete(st)); t.outrogroups.size === 0 && (t.outrogroups = null); } if (o !== null || l !== void 0) { - var P = []; + var M = []; if (l !== void 0) for (g of l) - (g.f & ee) === 0 && P.push(g); + (g.f & jt) === 0 && M.push(g); for (; o !== null; ) - (o.f & ee) === 0 && o !== t.fallback && P.push(o), o = Rr(o.next); - var G = P.length; + (o.f & jt) === 0 && o !== t.fallback && M.push(o), o = Sr(o.next); + var G = M.length; if (G > 0) { - var ut = null; - Ou(t, P, ut); + var ft = null; + qu(t, M, ft); } } } -function qu(t, e, n, r, i, s, a, o) { - var l = (a & Al) !== 0 ? (a & Rl) === 0 ? /* @__PURE__ */ ao(n, !1, !1) : Ln(n) : null, u = (a & El) !== 0 ? Ln(i) : null; +function Yu(t, e, n, r, i, s, a, o) { + var l = (a & Rl) !== 0 ? (a & Tl) === 0 ? /* @__PURE__ */ oo(n, !1, !1) : Ln(n) : null, u = (a & Cl) !== 0 ? Ln(i) : null; return { v: l, i: u, - e: ue(() => (s(e, l ?? n, u ?? i, o), () => { + e: se(() => (s(e, l ?? n, u ?? i, o), () => { t.delete(r); })) }; } -function Tr(t, e, n) { +function kr(t, e, n) { if (t.nodes) for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & cn) === 0 ? ( /** @type {EffectNodes} */ @@ -2394,7 +2394,7 @@ function Tr(t, e, n) { ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Le(r) + /* @__PURE__ */ Oe(r) ); if (s.before(r), r === i) return; @@ -2404,8 +2404,8 @@ function Tr(t, e, n) { function un(t, e, n) { e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; } -function Po(t, e) { - go(() => { +function Do(t, e) { + _o(() => { var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -2418,12 +2418,12 @@ function Po(t, e) { ) ); if (!r.querySelector("#" + e.hash)) { - const i = Ms("style"); + const i = Ps("style"); i.id = e.hash, i.textContent = e.code, r.appendChild(i); } }); } -function ha(t, e = !1) { +function da(t, e = !1) { var n = e ? " !important;" : ";", r = ""; for (var i in t) { var s = t[i]; @@ -2431,59 +2431,59 @@ function ha(t, e = !1) { } return r; } -function Vu(t, e) { +function Hu(t, e) { if (e) { var n = "", r, i; - return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += ha(r)), i && (n += ha(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += da(r)), i && (n += da(i, !0)), n = n.trim(), n === "" ? null : n; } return String(t); } -function Zi(t, e = {}, n, r) { +function ji(t, e = {}, n, r) { for (var i in n) { var s = n[i]; e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); } } -function da(t, e, n, r) { +function pa(t, e, n, r) { var i = t.__style; if (J || i !== e) { - var s = Vu(e, r); + var s = Hu(e, r); (!J || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; - } else r && (Array.isArray(r) ? (Zi(t, n == null ? void 0 : n[0], r[0]), Zi(t, n == null ? void 0 : n[1], r[1], "important")) : Zi(t, n, r)); + } else r && (Array.isArray(r) ? (ji(t, n == null ? void 0 : n[0], r[0]), ji(t, n == null ? void 0 : n[1], r[1], "important")) : ji(t, n, r)); return r; } -function pa(t, e) { - return t === e || (t == null ? void 0 : t[Mr]) === e; +function va(t, e) { + return t === e || (t == null ? void 0 : t[Fr]) === e; } -function li(t = {}, e, n, r) { - return go(() => { +function ui(t = {}, e, n, r) { + return _o(() => { var i, s; - return Fs(() => { - i = s, s = [], Ii(() => { - t !== n(...s) && (e(t, ...s), i && pa(n(...i), t) && e(null, ...i)); + return Is(() => { + i = s, s = [], Oi(() => { + t !== n(...s) && (e(t, ...s), i && va(n(...i), t) && e(null, ...i)); }); }), () => { Pn(() => { - s && pa(n(...s), t) && e(null, ...s); + s && va(n(...s), t) && e(null, ...s); }); }; }), t; } -let ti = !1; -function Yu(t) { - var e = ti; +let ei = !1; +function zu(t) { + var e = ei; try { - return ti = !1, [t(), ti]; + return ei = !1, [t(), ei]; } finally { - ti = e; + ei = e; } } function vt(t, e, n, r) { - var k; - var i = (n & Sl) !== 0, s = (n & Nl) !== 0, a = ( + var N; + var i = (n & kl) !== 0, s = (n & Ml) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? Ii( + ), o = !0, l = () => (o && (o = !1, a = s ? Oi( /** @type {() => V} */ r ) : ( @@ -2491,15 +2491,15 @@ function vt(t, e, n, r) { r )), a), u; if (i) { - var f = Mr in t || Va in t; - u = ((k = Mn(t, e)) == null ? void 0 : k.set) ?? (f && e in t ? (C) => t[e] = C : void 0); + var f = Fr in t || Ya in t; + u = ((N = Mn(t, e)) == null ? void 0 : N.set) ?? (f && e in t ? (C) => t[e] = C : void 0); } - var h, c = !1; - i ? [h, c] = Yu(() => ( + var d, c = !1; + i ? [d, c] = zu(() => ( /** @type {V} */ t[e] - )) : h = /** @type {V} */ - t[e], h === void 0 && r !== void 0 && (h = l(), u && (Kl(), u(h))); + )) : d = /** @type {V} */ + t[e], d === void 0 && r !== void 0 && (d = l(), u && (Zl(), u(d))); var p; if (p = () => { var C = ( @@ -2507,39 +2507,39 @@ function vt(t, e, n, r) { t[e] ); return C === void 0 ? l() : (o = !0, C); - }, (n & Tl) === 0) + }, (n & Nl) === 0) return p; if (u) { var g = t.$$legacy; return ( /** @type {() => V} */ - (function(C, D) { - return arguments.length > 0 ? ((!D || g || c) && u(D ? p() : C), C) : p(); + (function(C, P) { + return arguments.length > 0 ? ((!P || g || c) && u(P ? p() : C), C) : p(); }) ); } - var y = !1, $ = ((n & Cl) !== 0 ? Di : no)(() => (y = !1, p())); + var y = !1, $ = ((n & Sl) !== 0 ? Fi : ro)(() => (y = !1, p())); i && x($); - var A = ( + var E = ( /** @type {Effect} */ U ); return ( /** @type {() => V} */ - (function(C, D) { + (function(C, P) { if (arguments.length > 0) { - const P = D ? x($) : i ? $n(C) : C; - return ot($, P), y = !0, a !== void 0 && (a = P), C; + const M = P ? x($) : i ? $n(C) : C; + return lt($, M), y = !0, a !== void 0 && (a = M), C; } - return pn && y || (A.f & tn) !== 0 ? $.v : x($); + return pn && y || (E.f & en) !== 0 ? $.v : x($); }) ); } -function Hu(t) { - return new zu(t); +function Xu(t) { + return new Bu(t); } -var je, le; -class zu { +var Qe, ie; +class Bu { /** * @param {ComponentConstructorOptions & { * component: any; @@ -2547,12 +2547,12 @@ class zu { */ constructor(e) { /** @type {any} */ - q(this, je); + q(this, Qe); /** @type {Record} */ - q(this, le); + q(this, ie); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ ao(o, !1, !1); + var l = /* @__PURE__ */ oo(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( @@ -2562,42 +2562,42 @@ class zu { return x(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === Va ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === Ya ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return ot(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return lt(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - O(this, le, (e.hydrate ? Pu : ko)(e.component, { + O(this, ie, (e.hydrate ? Fu : Mo)(e.component, { target: e.target, anchor: e.anchor, props: i, context: e.context, intro: e.intro ?? !1, recover: e.recover - })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && ct(), O(this, je, i.$$events); - for (const a of Object.keys(v(this, le))) - a === "$set" || a === "$destroy" || a === "$on" || gi(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && ht(), O(this, Qe, i.$$events); + for (const a of Object.keys(v(this, ie))) + a === "$set" || a === "$destroy" || a === "$on" || _i(this, a, { get() { - return v(this, le)[a]; + return v(this, ie)[a]; }, /** @param {any} value */ set(o) { - v(this, le)[a] = o; + v(this, ie)[a] = o; }, enumerable: !0 }); - v(this, le).$set = /** @param {Record} next */ + v(this, ie).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, le).$destroy = () => { - Du(v(this, le)); + }, v(this, ie).$destroy = () => { + Iu(v(this, ie)); }; } /** @param {Record} props */ $set(e) { - v(this, le).$set(e); + v(this, ie).$set(e); } /** * @param {string} event @@ -2605,22 +2605,22 @@ class zu { * @returns {any} */ $on(e, n) { - v(this, je)[e] = v(this, je)[e] || []; + v(this, Qe)[e] = v(this, Qe)[e] || []; const r = (...i) => n.call(this, ...i); - return v(this, je)[e].push(r), () => { - v(this, je)[e] = v(this, je)[e].filter( + return v(this, Qe)[e].push(r), () => { + v(this, Qe)[e] = v(this, Qe)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, le).$destroy(); + v(this, ie).$destroy(); } } -je = new WeakMap(), le = new WeakMap(); -let Do; -typeof HTMLElement == "function" && (Do = class extends HTMLElement { +Qe = new WeakMap(), ie = new WeakMap(); +let Fo; +typeof HTMLElement == "function" && (Fo = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -2629,27 +2629,27 @@ typeof HTMLElement == "function" && (Do = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - st(this, "$$ctor"); + at(this, "$$ctor"); /** Slots */ - st(this, "$$s"); + at(this, "$$s"); /** @type {any} The Svelte component instance */ - st(this, "$$c"); + at(this, "$$c"); /** Whether or not the custom element is connected */ - st(this, "$$cn", !1); + at(this, "$$cn", !1); /** @type {Record} Component props data */ - st(this, "$$d", {}); + at(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - st(this, "$$r", !1); + at(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - st(this, "$$p_d", {}); + at(this, "$$p_d", {}); /** @type {Record} Event listeners */ - st(this, "$$l", {}); + at(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - st(this, "$$l_u", /* @__PURE__ */ new Map()); + at(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - st(this, "$$me"); + at(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - st(this, "$$shadowRoot", null); + at(this, "$$shadowRoot", null); this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** @@ -2679,23 +2679,23 @@ typeof HTMLElement == "function" && (Do = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const o = Ms("slot"); - s !== "default" && (o.name = s), _e(a, o); + const o = Ps("slot"); + s !== "default" && (o.name = s), ve(a, o); }; }; var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = Xu(this); + const r = {}, i = Wu(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] = ui(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = fi(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 = Hu({ + this.$$c = Xu({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2703,14 +2703,14 @@ typeof HTMLElement == "function" && (Do = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = wu(() => { - Fs(() => { + }), this.$$me = bu(() => { + Is(() => { var s; this.$$r = !0; - for (const a of vi(this.$$c)) { + for (const a of gi(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = ui( + const o = fi( a, this.$$d[a], this.$$p_d, @@ -2738,7 +2738,7 @@ typeof HTMLElement == "function" && (Do = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = ui(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + this.$$r || (e = this.$$g_p(e), this.$$d[e] = fi(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2749,12 +2749,12 @@ typeof HTMLElement == "function" && (Do = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return vi(this.$$p_d).find( + return gi(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function ui(t, e, n, r) { +function fi(t, e, n, r) { var s; const i = (s = n[t]) == null ? void 0 : s.type; if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) @@ -2785,7 +2785,7 @@ function ui(t, e, n, r) { return e; } } -function Xu(t) { +function Wu(t) { const e = {}; return t.childNodes.forEach((n) => { e[ @@ -2794,34 +2794,34 @@ function Xu(t) { ] = !0; }), e; } -function Fo(t, e, n, r, i, s) { - let a = class extends Do { +function Io(t, e, n, r, i, s) { + let a = class extends Fo { constructor() { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return vi(e).map( + return gi(e).map( (o) => (e[o].attribute || o).toLowerCase() ); } }; - return vi(e).forEach((o) => { - gi(a.prototype, o, { + return gi(e).forEach((o) => { + _i(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { - var h; - l = ui(o, l, e), this.$$d[o] = l; + var d; + l = fi(o, l, e), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (h = Mn(u, o)) == null ? void 0 : h.get; + var f = (d = Mn(u, o)) == null ? void 0 : d.get; f ? u[o] = l : u.$set({ [o]: l }); } } }); }), r.forEach((o) => { - gi(a.prototype, o, { + _i(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; @@ -2830,43 +2830,43 @@ function Fo(t, e, n, r, i, s) { }), t.element = /** @type {any} */ a, a; } -var Bu = { value: () => { +var Uu = { value: () => { } }; -function Io() { +function Oo() { for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } - return new fi(n); + return new ci(n); } -function fi(t) { +function ci(t) { this._ = t; } -function Wu(t, e) { +function Gu(t, e) { return t.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 && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } -fi.prototype = Io.prototype = { - constructor: fi, +ci.prototype = Oo.prototype = { + constructor: ci, on: function(t, e) { - var n = this._, r = Wu(t + "", n), i, s = -1, a = r.length; + var n = this._, r = Gu(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Uu(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Ku(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++s < a; ) - if (i = (t = r[s]).type) n[i] = va(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = va(n[i], t.name, null); + if (i = (t = r[s]).type) n[i] = ga(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = ga(n[i], t.name, null); return this; }, copy: function() { var t = {}, e = this._; for (var n in e) t[n] = e[n].slice(); - return new fi(t); + return new ci(t); }, call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; @@ -2878,135 +2878,135 @@ fi.prototype = Io.prototype = { for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function Uu(t, e) { +function Ku(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } -function va(t, e, n) { +function ga(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { - t[r] = Bu, t = t.slice(0, r).concat(t.slice(r + 1)); + t[r] = Uu, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } -var gs = "http://www.w3.org/1999/xhtml"; -const ga = { +var _s = "http://www.w3.org/1999/xhtml"; +const _a = { svg: "http://www.w3.org/2000/svg", - xhtml: gs, + xhtml: _s, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Oi(t) { +function Li(t) { var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), ga.hasOwnProperty(e) ? { space: ga[e], local: t } : t; + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), _a.hasOwnProperty(e) ? { space: _a[e], local: t } : t; } -function Gu(t) { +function Ju(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; - return n === gs && e.documentElement.namespaceURI === gs ? e.createElement(t) : e.createElementNS(n, t); + return n === _s && e.documentElement.namespaceURI === _s ? e.createElement(t) : e.createElementNS(n, t); }; } -function Ku(t) { +function Zu(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } -function Oo(t) { - var e = Oi(t); - return (e.local ? Ku : Gu)(e); +function Lo(t) { + var e = Li(t); + return (e.local ? Zu : Ju)(e); } -function Ju() { +function ju() { } -function qs(t) { - return t == null ? Ju : function() { +function Vs(t) { + return t == null ? ju : function() { return this.querySelector(t); }; } -function Zu(t) { - typeof t != "function" && (t = qs(t)); +function Qu(t) { + typeof t != "function" && (t = Vs(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new re(r, this._parents); + return new te(r, this._parents); } -function ju(t) { +function tf(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function Qu() { +function ef() { return []; } -function Lo(t) { - return t == null ? Qu : function() { +function qo(t) { + return t == null ? ef : function() { return this.querySelectorAll(t); }; } -function tf(t) { +function nf(t) { return function() { - return ju(t.apply(this, arguments)); + return tf(t.apply(this, arguments)); }; } -function ef(t) { - typeof t == "function" ? t = tf(t) : t = Lo(t); +function rf(t) { + typeof t == "function" ? t = nf(t) : t = qo(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); - return new re(r, i); + return new te(r, i); } -function qo(t) { +function Vo(t) { return function() { return this.matches(t); }; } -function Vo(t) { +function Yo(t) { return function(e) { return e.matches(t); }; } -var nf = Array.prototype.find; -function rf(t) { +var sf = Array.prototype.find; +function af(t) { return function() { - return nf.call(this.children, t); + return sf.call(this.children, t); }; } -function sf() { +function of() { return this.firstElementChild; } -function af(t) { - return this.select(t == null ? sf : rf(typeof t == "function" ? t : Vo(t))); +function lf(t) { + return this.select(t == null ? of : af(typeof t == "function" ? t : Yo(t))); } -var of = Array.prototype.filter; -function lf() { +var uf = Array.prototype.filter; +function ff() { return Array.from(this.children); } -function uf(t) { +function cf(t) { return function() { - return of.call(this.children, t); + return uf.call(this.children, t); }; } -function ff(t) { - return this.selectAll(t == null ? lf : uf(typeof t == "function" ? t : Vo(t))); +function hf(t) { + return this.selectAll(t == null ? ff : cf(typeof t == "function" ? t : Yo(t))); } -function cf(t) { - typeof t != "function" && (t = qo(t)); +function df(t) { + typeof t != "function" && (t = Vo(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new re(r, this._parents); + return new te(r, this._parents); } -function Yo(t) { +function Ho(t) { return new Array(t.length); } -function hf() { - return new re(this._enter || this._groups.map(Yo), this._parents); +function pf() { + return new te(this._enter || this._groups.map(Ho), this._parents); } -function mi(t, e) { +function yi(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -mi.prototype = { - constructor: mi, +yi.prototype = { + constructor: yi, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -3020,91 +3020,91 @@ mi.prototype = { return this._parent.querySelectorAll(t); } }; -function df(t) { +function vf(t) { return function() { return t; }; } -function pf(t, e, n, r, i, s) { +function gf(t, e, n, r, i, s) { for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new mi(t, s[a]); + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new yi(t, s[a]); for (; a < l; ++a) (o = e[a]) && (i[a] = o); } -function vf(t, e, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = e.length, h = s.length, c = new Array(f), p; +function _f(t, e, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = e.length, d = s.length, c = new Array(f), p; for (o = 0; o < f; ++o) (l = e[o]) && (c[o] = p = a.call(l, l.__data__, o, e) + "", u.has(p) ? i[o] = l : u.set(p, l)); - for (o = 0; o < h; ++o) - p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new mi(t, s[o]); + for (o = 0; o < d; ++o) + p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new yi(t, s[o]); for (o = 0; o < f; ++o) (l = e[o]) && u.get(c[o]) === l && (i[o] = l); } -function gf(t) { +function mf(t) { return t.__data__; } -function _f(t, e) { - if (!arguments.length) return Array.from(this, gf); - var n = e ? vf : pf, r = this._parents, i = this._groups; - typeof t != "function" && (t = df(t)); +function yf(t, e) { + if (!arguments.length) return Array.from(this, mf); + var n = e ? _f : gf, r = this._parents, i = this._groups; + typeof t != "function" && (t = vf(t)); 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], h = i[u], c = h.length, p = mf(t.call(f, f && f.__data__, u, r)), g = p.length, y = o[u] = new Array(g), $ = a[u] = new Array(g), A = l[u] = new Array(c); - n(f, h, y, $, A, p, e); - for (var k = 0, C = 0, D, P; k < g; ++k) - if (D = y[k]) { - for (k >= C && (C = k + 1); !(P = $[C]) && ++C < g; ) ; - D._next = P || null; + var f = r[u], d = i[u], c = d.length, p = wf(t.call(f, f && f.__data__, u, r)), g = p.length, y = o[u] = new Array(g), $ = a[u] = new Array(g), E = l[u] = new Array(c); + n(f, d, y, $, E, p, e); + for (var N = 0, C = 0, P, M; N < g; ++N) + if (P = y[N]) { + for (N >= C && (C = N + 1); !(M = $[C]) && ++C < g; ) ; + P._next = M || null; } } - return a = new re(a, r), a._enter = o, a._exit = l, a; + return a = new te(a, r), a._enter = o, a._exit = l, a; } -function mf(t) { +function wf(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function yf() { - return new re(this._exit || this._groups.map(Yo), this._parents); +function xf() { + return new te(this._exit || this._groups.map(Ho), this._parents); } -function wf(t, e, n) { +function bf(t, e, n) { var r = this.enter(), i = this, s = this.exit(); return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function xf(t) { +function $f(t) { for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._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], h = u.length, c = o[l] = new Array(h), p, g = 0; g < h; ++g) + for (var u = n[l], f = r[l], d = u.length, c = o[l] = new Array(d), p, g = 0; g < d; ++g) (p = u[g] || f[g]) && (c[g] = p); for (; l < i; ++l) o[l] = n[l]; - return new re(o, this._parents); + return new te(o, this._parents); } -function bf() { +function Af() { for (var t = this._groups, e = -1, n = t.length; ++e < n; ) for (var r = t[e], 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 $f(t) { - t || (t = Af); - function e(h, c) { - return h && c ? t(h.__data__, c.__data__) : !h - !c; +function Ef(t) { + t || (t = Rf); + function e(d, c) { + return d && c ? t(d.__data__, c.__data__) : !d - !c; } 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(e); } - return new re(i, this._parents).order(); + return new te(i, this._parents).order(); } -function Af(t, e) { +function Rf(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function Ef() { +function Cf() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } -function Rf() { +function Tf() { return Array.from(this); } -function Cf() { +function Sf() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length; i < s; ++i) { var a = r[i]; @@ -3112,114 +3112,114 @@ function Cf() { } return null; } -function Tf() { +function Nf() { let t = 0; for (const e of this) ++t; return t; } -function Sf() { +function kf() { return !this.node(); } -function Nf(t) { +function Mf(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) (o = i[s]) && t.call(o, o.__data__, s, i); return this; } -function kf(t) { +function Pf(t) { return function() { this.removeAttribute(t); }; } -function Mf(t) { +function Df(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function Pf(t, e) { +function Ff(t, e) { return function() { this.setAttribute(t, e); }; } -function Df(t, e) { +function If(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } -function Ff(t, e) { +function Of(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function If(t, e) { +function Lf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); }; } -function Of(t, e) { - var n = Oi(t); +function qf(t, e) { + var n = Li(t); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((e == null ? n.local ? Mf : kf : typeof e == "function" ? n.local ? If : Ff : n.local ? Df : Pf)(n, e)); + return this.each((e == null ? n.local ? Df : Pf : typeof e == "function" ? n.local ? Lf : Of : n.local ? If : Ff)(n, e)); } -function Ho(t) { +function zo(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function Lf(t) { +function Vf(t) { return function() { this.style.removeProperty(t); }; } -function qf(t, e, n) { +function Yf(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } -function Vf(t, e, n) { +function Hf(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function Yf(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? Lf : typeof e == "function" ? Vf : qf)(t, e, n ?? "")) : pr(this.node(), t); +function zf(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? Vf : typeof e == "function" ? Hf : Yf)(t, e, n ?? "")) : gr(this.node(), t); } -function pr(t, e) { - return t.style.getPropertyValue(e) || Ho(t).getComputedStyle(t, null).getPropertyValue(e); +function gr(t, e) { + return t.style.getPropertyValue(e) || zo(t).getComputedStyle(t, null).getPropertyValue(e); } -function Hf(t) { +function Xf(t) { return function() { delete this[t]; }; } -function zf(t, e) { +function Bf(t, e) { return function() { this[t] = e; }; } -function Xf(t, e) { +function Wf(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } -function Bf(t, e) { - return arguments.length > 1 ? this.each((e == null ? Hf : typeof e == "function" ? Xf : zf)(t, e)) : this.node()[t]; +function Uf(t, e) { + return arguments.length > 1 ? this.each((e == null ? Xf : typeof e == "function" ? Wf : Bf)(t, e)) : this.node()[t]; } -function zo(t) { +function Xo(t) { return t.trim().split(/^|\s+/); } -function Vs(t) { - return t.classList || new Xo(t); +function Ys(t) { + return t.classList || new Bo(t); } -function Xo(t) { - this._node = t, this._names = zo(t.getAttribute("class") || ""); +function Bo(t) { + this._node = t, this._names = Xo(t.getAttribute("class") || ""); } -Xo.prototype = { +Bo.prototype = { add: function(t) { var e = this._names.indexOf(t); e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); @@ -3232,129 +3232,129 @@ Xo.prototype = { return this._names.indexOf(t) >= 0; } }; -function Bo(t, e) { - for (var n = Vs(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); -} function Wo(t, e) { - for (var n = Vs(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); + for (var n = Ys(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +} +function Uo(t, e) { + for (var n = Ys(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function Wf(t) { +function Gf(t) { return function() { - Bo(this, t); + Wo(this, t); }; } -function Uf(t) { +function Kf(t) { return function() { - Wo(this, t); + Uo(this, t); }; } -function Gf(t, e) { +function Jf(t, e) { return function() { - (e.apply(this, arguments) ? Bo : Wo)(this, t); + (e.apply(this, arguments) ? Wo : Uo)(this, t); }; } -function Kf(t, e) { - var n = zo(t + ""); +function Zf(t, e) { + var n = Xo(t + ""); if (arguments.length < 2) { - for (var r = Vs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Ys(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? Gf : e ? Wf : Uf)(n, e)); + return this.each((typeof e == "function" ? Jf : e ? Gf : Kf)(n, e)); } -function Jf() { +function jf() { this.textContent = ""; } -function Zf(t) { +function Qf(t) { return function() { this.textContent = t; }; } -function jf(t) { +function tc(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } -function Qf(t) { - return arguments.length ? this.each(t == null ? Jf : (typeof t == "function" ? jf : Zf)(t)) : this.node().textContent; +function ec(t) { + return arguments.length ? this.each(t == null ? jf : (typeof t == "function" ? tc : Qf)(t)) : this.node().textContent; } -function tc() { +function nc() { this.innerHTML = ""; } -function ec(t) { +function rc(t) { return function() { this.innerHTML = t; }; } -function nc(t) { +function ic(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } -function rc(t) { - return arguments.length ? this.each(t == null ? tc : (typeof t == "function" ? nc : ec)(t)) : this.node().innerHTML; +function sc(t) { + return arguments.length ? this.each(t == null ? nc : (typeof t == "function" ? ic : rc)(t)) : this.node().innerHTML; } -function ic() { +function ac() { this.nextSibling && this.parentNode.appendChild(this); } -function sc() { - return this.each(ic); +function oc() { + return this.each(ac); } -function ac() { +function lc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function oc() { - return this.each(ac); +function uc() { + return this.each(lc); } -function lc(t) { - var e = typeof t == "function" ? t : Oo(t); +function fc(t) { + var e = typeof t == "function" ? t : Lo(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function uc() { +function cc() { return null; } -function fc(t, e) { - var n = typeof t == "function" ? t : Oo(t), r = e == null ? uc : typeof e == "function" ? e : qs(e); +function hc(t, e) { + var n = typeof t == "function" ? t : Lo(t), r = e == null ? cc : typeof e == "function" ? e : Vs(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function cc() { +function dc() { var t = this.parentNode; t && t.removeChild(this); } -function hc() { - return this.each(cc); +function pc() { + return this.each(dc); } -function dc() { +function vc() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function pc() { +function gc() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function vc(t) { - return this.select(t ? pc : dc); +function _c(t) { + return this.select(t ? gc : vc); } -function gc(t) { +function mc(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } -function _c(t) { +function yc(t) { return function(e) { t.call(this, e, this.__data__); }; } -function mc(t) { +function wc(t) { return t.trim().split(/^|\s+/).map(function(e) { var n = "", r = e.indexOf("."); return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n }; }); } -function yc(t) { +function xc(t) { return function() { var e = this.__on; if (e) { @@ -3364,9 +3364,9 @@ function yc(t) { } }; } -function wc(t, e, n) { +function bc(t, e, n) { return function() { - var r = this.__on, i, s = _c(e); + var r = this.__on, i, s = yc(e); if (r) { for (var a = 0, o = r.length; a < o; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { @@ -3377,8 +3377,8 @@ function wc(t, e, n) { this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function xc(t, e, n) { - var r = mc(t + ""), i, s = r.length, a; +function $c(t, e, n) { + var r = wc(t + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3389,93 +3389,93 @@ function xc(t, e, n) { } return; } - for (o = e ? wc : yc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + for (o = e ? bc : xc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); return this; } -function Uo(t, e, n) { - var r = Ho(t), i = r.CustomEvent; +function Go(t, e, n) { + var r = zo(t), i = r.CustomEvent; typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); } -function bc(t, e) { +function Ac(t, e) { return function() { - return Uo(this, t, e); + return Go(this, t, e); }; } -function $c(t, e) { +function Ec(t, e) { return function() { - return Uo(this, t, e.apply(this, arguments)); + return Go(this, t, e.apply(this, arguments)); }; } -function Ac(t, e) { - return this.each((typeof e == "function" ? $c : bc)(t, e)); +function Rc(t, e) { + return this.each((typeof e == "function" ? Ec : Ac)(t, e)); } -function* Ec() { +function* Cc() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } -var Go = [null]; -function re(t, e) { +var Ko = [null]; +function te(t, e) { this._groups = t, this._parents = e; } -function mr() { - return new re([[document.documentElement]], Go); +function wr() { + return new te([[document.documentElement]], Ko); } -function Rc() { +function Tc() { return this; } -re.prototype = mr.prototype = { - constructor: re, - select: Zu, - selectAll: ef, - selectChild: af, - selectChildren: ff, - filter: cf, - data: _f, - enter: hf, - exit: yf, - join: wf, - merge: xf, - selection: Rc, - order: bf, - sort: $f, - call: Ef, - nodes: Rf, - node: Cf, - size: Tf, - empty: Sf, - each: Nf, - attr: Of, - style: Yf, - property: Bf, - classed: Kf, - text: Qf, - html: rc, - raise: sc, - lower: oc, - append: lc, - insert: fc, - remove: hc, - clone: vc, - datum: gc, - on: xc, - dispatch: Ac, - [Symbol.iterator]: Ec +te.prototype = wr.prototype = { + constructor: te, + select: Qu, + selectAll: rf, + selectChild: lf, + selectChildren: hf, + filter: df, + data: yf, + enter: pf, + exit: xf, + join: bf, + merge: $f, + selection: Tc, + order: Af, + sort: Ef, + call: Cf, + nodes: Tf, + node: Sf, + size: Nf, + empty: kf, + each: Mf, + attr: qf, + style: zf, + property: Uf, + classed: Zf, + text: ec, + html: sc, + raise: oc, + lower: uc, + append: fc, + insert: hc, + remove: pc, + clone: _c, + datum: mc, + on: $c, + dispatch: Rc, + [Symbol.iterator]: Cc }; -function at(t) { - return typeof t == "string" ? new re([[document.querySelector(t)]], [document.documentElement]) : new re([[t]], Go); +function ot(t) { + return typeof t == "string" ? new te([[document.querySelector(t)]], [document.documentElement]) : new te([[t]], Ko); } -function Ys(t, e, n) { +function Hs(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } -function Ko(t, e) { +function Jo(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } -function Gr() { +function Zr() { } -var Or = 0.7, yi = 1 / Or, Qn = "\\s*([+-]?\\d+)\\s*", Lr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Fe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Cc = /^#([0-9a-f]{3,8})$/, Tc = new RegExp(`^rgb\\(${Qn},${Qn},${Qn}\\)$`), Sc = new RegExp(`^rgb\\(${Fe},${Fe},${Fe}\\)$`), Nc = new RegExp(`^rgba\\(${Qn},${Qn},${Qn},${Lr}\\)$`), kc = new RegExp(`^rgba\\(${Fe},${Fe},${Fe},${Lr}\\)$`), Mc = new RegExp(`^hsl\\(${Lr},${Fe},${Fe}\\)$`), Pc = new RegExp(`^hsla\\(${Lr},${Fe},${Fe},${Lr}\\)$`), _a = { +var Vr = 0.7, wi = 1 / Vr, er = "\\s*([+-]?\\d+)\\s*", Yr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", De = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Sc = /^#([0-9a-f]{3,8})$/, Nc = new RegExp(`^rgb\\(${er},${er},${er}\\)$`), kc = new RegExp(`^rgb\\(${De},${De},${De}\\)$`), Mc = new RegExp(`^rgba\\(${er},${er},${er},${Yr}\\)$`), Pc = new RegExp(`^rgba\\(${De},${De},${De},${Yr}\\)$`), Dc = new RegExp(`^hsl\\(${Yr},${De},${De}\\)$`), Fc = new RegExp(`^hsla\\(${Yr},${De},${De},${Yr}\\)$`), ma = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3625,86 +3625,86 @@ var Or = 0.7, yi = 1 / Or, Qn = "\\s*([+-]?\\d+)\\s*", Lr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Ys(Gr, Yn, { +Hs(Zr, Yn, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, - hex: ma, + hex: ya, // Deprecated! Use color.formatHex. - formatHex: ma, - formatHex8: Dc, - formatHsl: Fc, - formatRgb: ya, - toString: ya + formatHex: ya, + formatHex8: Ic, + formatHsl: Oc, + formatRgb: wa, + toString: wa }); -function ma() { +function ya() { return this.rgb().formatHex(); } -function Dc() { +function Ic() { return this.rgb().formatHex8(); } -function Fc() { - return Jo(this).formatHsl(); +function Oc() { + return Zo(this).formatHsl(); } -function ya() { +function wa() { return this.rgb().formatRgb(); } function Yn(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = Cc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? wa(e) : n === 3 ? new Ht(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? ei(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? ei(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Tc.exec(t)) ? new Ht(e[1], e[2], e[3], 1) : (e = Sc.exec(t)) ? new Ht(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Nc.exec(t)) ? ei(e[1], e[2], e[3], e[4]) : (e = kc.exec(t)) ? ei(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Mc.exec(t)) ? $a(e[1], e[2] / 100, e[3] / 100, 1) : (e = Pc.exec(t)) ? $a(e[1], e[2] / 100, e[3] / 100, e[4]) : _a.hasOwnProperty(t) ? wa(_a[t]) : t === "transparent" ? new Ht(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = Sc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? xa(e) : n === 3 ? new Yt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? ni(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? ni(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Nc.exec(t)) ? new Yt(e[1], e[2], e[3], 1) : (e = kc.exec(t)) ? new Yt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Mc.exec(t)) ? ni(e[1], e[2], e[3], e[4]) : (e = Pc.exec(t)) ? ni(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Dc.exec(t)) ? Aa(e[1], e[2] / 100, e[3] / 100, 1) : (e = Fc.exec(t)) ? Aa(e[1], e[2] / 100, e[3] / 100, e[4]) : ma.hasOwnProperty(t) ? xa(ma[t]) : t === "transparent" ? new Yt(NaN, NaN, NaN, 0) : null; } -function wa(t) { - return new Ht(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +function xa(t) { + return new Yt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function ei(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new Ht(t, e, n, r); +function ni(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new Yt(t, e, n, r); } -function Ic(t) { - return t instanceof Gr || (t = Yn(t)), t ? (t = t.rgb(), new Ht(t.r, t.g, t.b, t.opacity)) : new Ht(); +function Lc(t) { + return t instanceof Zr || (t = Yn(t)), t ? (t = t.rgb(), new Yt(t.r, t.g, t.b, t.opacity)) : new Yt(); } -function _s(t, e, n, r) { - return arguments.length === 1 ? Ic(t) : new Ht(t, e, n, r ?? 1); +function ms(t, e, n, r) { + return arguments.length === 1 ? Lc(t) : new Yt(t, e, n, r ?? 1); } -function Ht(t, e, n, r) { +function Yt(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -Ys(Ht, _s, Ko(Gr, { +Hs(Yt, ms, Jo(Zr, { brighter(t) { - return t = t == null ? yi : Math.pow(yi, t), new Ht(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? wi : Math.pow(wi, t), new Yt(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? Or : Math.pow(Or, t), new Ht(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Vr : Math.pow(Vr, t), new Yt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new Ht(In(this.r), In(this.g), In(this.b), wi(this.opacity)); + return new Yt(In(this.r), In(this.g), In(this.b), xi(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: xa, + hex: ba, // Deprecated! Use color.formatHex. - formatHex: xa, - formatHex8: Oc, - formatRgb: ba, - toString: ba + formatHex: ba, + formatHex8: qc, + formatRgb: $a, + toString: $a })); -function xa() { +function ba() { return `#${En(this.r)}${En(this.g)}${En(this.b)}`; } -function Oc() { +function qc() { return `#${En(this.r)}${En(this.g)}${En(this.b)}${En((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function ba() { - const t = wi(this.opacity); +function $a() { + const t = xi(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${In(this.r)}, ${In(this.g)}, ${In(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function wi(t) { +function xi(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function In(t) { @@ -3713,90 +3713,90 @@ function In(t) { function En(t) { return t = In(t), (t < 16 ? "0" : "") + t.toString(16); } -function $a(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new ye(t, e, n, r); +function Aa(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new _e(t, e, n, r); } -function Jo(t) { - if (t instanceof ye) return new ye(t.h, t.s, t.l, t.opacity); - if (t instanceof Gr || (t = Yn(t)), !t) return new ye(); - if (t instanceof ye) return t; +function Zo(t) { + if (t instanceof _e) return new _e(t.h, t.s, t.l, t.opacity); + if (t instanceof Zr || (t = Yn(t)), !t) return new _e(); + if (t instanceof _e) return t; t = t.rgb(); var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new ye(a, o, l, t.opacity); + return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new _e(a, o, l, t.opacity); } -function Lc(t, e, n, r) { - return arguments.length === 1 ? Jo(t) : new ye(t, e, n, r ?? 1); +function Vc(t, e, n, r) { + return arguments.length === 1 ? Zo(t) : new _e(t, e, n, r ?? 1); } -function ye(t, e, n, r) { +function _e(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -Ys(ye, Lc, Ko(Gr, { +Hs(_e, Vc, Jo(Zr, { brighter(t) { - return t = t == null ? yi : Math.pow(yi, t), new ye(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? wi : Math.pow(wi, t), new _e(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? Or : Math.pow(Or, t), new ye(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Vr : Math.pow(Vr, t), new _e(this.h, this.s, this.l * t, this.opacity); }, rgb() { var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; - return new Ht( - ji(t >= 240 ? t - 240 : t + 120, i, r), - ji(t, i, r), - ji(t < 120 ? t + 240 : t - 120, i, r), + return new Yt( + Qi(t >= 240 ? t - 240 : t + 120, i, r), + Qi(t, i, r), + Qi(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new ye(Aa(this.h), ni(this.s), ni(this.l), wi(this.opacity)); + return new _e(Ea(this.h), ri(this.s), ri(this.l), xi(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 t = wi(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${Aa(this.h)}, ${ni(this.s) * 100}%, ${ni(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = xi(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${Ea(this.h)}, ${ri(this.s) * 100}%, ${ri(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function Aa(t) { +function Ea(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function ni(t) { +function ri(t) { return Math.max(0, Math.min(1, t || 0)); } -function ji(t, e, n) { +function Qi(t, e, n) { return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; } -const Hs = (t) => () => t; -function qc(t, e) { +const zs = (t) => () => t; +function Yc(t, e) { return function(n) { return t + n * e; }; } -function Vc(t, e, n) { +function Hc(t, e, n) { return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) { return Math.pow(t + r * e, n); }; } -function Yc(t) { - return (t = +t) == 1 ? Zo : function(e, n) { - return n - e ? Vc(e, n, t) : Hs(isNaN(e) ? n : e); +function zc(t) { + return (t = +t) == 1 ? jo : function(e, n) { + return n - e ? Hc(e, n, t) : zs(isNaN(e) ? n : e); }; } -function Zo(t, e) { +function jo(t, e) { var n = e - t; - return n ? qc(t, n) : Hs(isNaN(t) ? e : t); + return n ? Yc(t, n) : zs(isNaN(t) ? e : t); } -const xi = (function t(e) { - var n = Yc(e); +const bi = (function t(e) { + var n = zc(e); function r(i, s) { - var a = n((i = _s(i)).r, (s = _s(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Zo(i.opacity, s.opacity); + var a = n((i = ms(i)).r, (s = ms(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = jo(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 = t, r; })(1); -function Hc(t, e) { +function Xc(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { @@ -3804,64 +3804,64 @@ function Hc(t, e) { return r; }; } -function zc(t) { +function Bc(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function Xc(t, e) { +function Wc(t, e) { var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Ue(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = Ge(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function Bc(t, e) { +function Uc(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; }; } -function De(t, e) { +function Pe(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } -function Wc(t, e) { +function Gc(t, e) { var n = {}, r = {}, i; (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); for (i in e) - i in t ? n[i] = Ue(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = Ge(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var ms = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Qi = new RegExp(ms.source, "g"); -function Uc(t) { +var ys = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ts = new RegExp(ys.source, "g"); +function Kc(t) { return function() { return t; }; } -function Gc(t) { +function Jc(t) { return function(e) { return t(e) + ""; }; } -function jo(t, e) { - var n = ms.lastIndex = Qi.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = ms.exec(t)) && (i = Qi.exec(e)); ) - (s = i.index) > n && (s = e.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: De(r, i) })), n = Qi.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Gc(l[0].x) : Uc(e) : (e = l.length, function(u) { - for (var f = 0, h; f < e; ++f) o[(h = l[f]).i] = h.x(u); +function Qo(t, e) { + var n = ys.lastIndex = ts.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (t = t + "", e = e + ""; (r = ys.exec(t)) && (i = ts.exec(e)); ) + (s = i.index) > n && (s = e.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: Pe(r, i) })), n = ts.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Jc(l[0].x) : Kc(e) : (e = l.length, function(u) { + for (var f = 0, d; f < e; ++f) o[(d = l[f]).i] = d.x(u); return o.join(""); }); } -function Ue(t, e) { +function Ge(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? Hs(e) : (n === "number" ? De : n === "string" ? (r = Yn(e)) ? (e = r, xi) : jo : e instanceof Yn ? xi : e instanceof Date ? Bc : zc(e) ? Hc : Array.isArray(e) ? Xc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Wc : De)(t, e); + return e == null || n === "boolean" ? zs(e) : (n === "number" ? Pe : n === "string" ? (r = Yn(e)) ? (e = r, bi) : Qo : e instanceof Yn ? bi : e instanceof Date ? Uc : Bc(e) ? Xc : Array.isArray(e) ? Wc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Gc : Pe)(t, e); } -var Ea = 180 / Math.PI, ys = { +var Ra = 180 / Math.PI, ws = { translateX: 0, translateY: 0, rotate: 0, @@ -3869,187 +3869,187 @@ var Ea = 180 / Math.PI, ys = { scaleX: 1, scaleY: 1 }; -function Qo(t, e, n, r, i, s) { +function tl(t, e, n, r, i, s) { var a, o, l; return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(e, t) * Ea, - skewX: Math.atan(l) * Ea, + rotate: Math.atan2(e, t) * Ra, + skewX: Math.atan(l) * Ra, scaleX: a, scaleY: o }; } -var ri; -function Kc(t) { +var ii; +function Zc(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? ys : Qo(e.a, e.b, e.c, e.d, e.e, e.f); + return e.isIdentity ? ws : tl(e.a, e.b, e.c, e.d, e.e, e.f); } -function Jc(t) { - return t == null || (ri || (ri = document.createElementNS("http://www.w3.org/2000/svg", "g")), ri.setAttribute("transform", t), !(t = ri.transform.baseVal.consolidate())) ? ys : (t = t.matrix, Qo(t.a, t.b, t.c, t.d, t.e, t.f)); +function jc(t) { + return t == null || (ii || (ii = document.createElementNS("http://www.w3.org/2000/svg", "g")), ii.setAttribute("transform", t), !(t = ii.transform.baseVal.consolidate())) ? ws : (t = t.matrix, tl(t.a, t.b, t.c, t.d, t.e, t.f)); } -function tl(t, e, n, r) { +function el(t, e, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } - function s(u, f, h, c, p, g) { - if (u !== h || f !== c) { + function s(u, f, d, c, p, g) { + if (u !== d || f !== c) { var y = p.push("translate(", null, e, null, n); - g.push({ i: y - 4, x: De(u, h) }, { i: y - 2, x: De(f, c) }); - } else (h || c) && p.push("translate(" + h + e + c + n); + g.push({ i: y - 4, x: Pe(u, d) }, { i: y - 2, x: Pe(f, c) }); + } else (d || c) && p.push("translate(" + d + e + c + n); } - function a(u, f, h, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: De(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); + function a(u, f, d, c) { + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: d.push(i(d) + "rotate(", null, r) - 2, x: Pe(u, f) })) : f && d.push(i(d) + "rotate(" + f + r); } - function o(u, f, h, c) { - u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: De(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); + function o(u, f, d, c) { + u !== f ? c.push({ i: d.push(i(d) + "skewX(", null, r) - 2, x: Pe(u, f) }) : f && d.push(i(d) + "skewX(" + f + r); } - function l(u, f, h, c, p, g) { - if (u !== h || f !== c) { + function l(u, f, d, c, p, g) { + if (u !== d || f !== c) { var y = p.push(i(p) + "scale(", null, ",", null, ")"); - g.push({ i: y - 4, x: De(u, h) }, { i: y - 2, x: De(f, c) }); - } else (h !== 1 || c !== 1) && p.push(i(p) + "scale(" + h + "," + c + ")"); + g.push({ i: y - 4, x: Pe(u, d) }, { i: y - 2, x: Pe(f, c) }); + } else (d !== 1 || c !== 1) && p.push(i(p) + "scale(" + d + "," + c + ")"); } return function(u, f) { - var h = [], c = []; - return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, h, c), a(u.rotate, f.rotate, h, c), o(u.skewX, f.skewX, h, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, h, c), u = f = null, function(p) { - for (var g = -1, y = c.length, $; ++g < y; ) h[($ = c[g]).i] = $.x(p); - return h.join(""); + var d = [], c = []; + return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, d, c), a(u.rotate, f.rotate, d, c), o(u.skewX, f.skewX, d, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, d, c), u = f = null, function(p) { + for (var g = -1, y = c.length, $; ++g < y; ) d[($ = c[g]).i] = $.x(p); + return d.join(""); }; }; } -var Zc = tl(Kc, "px, ", "px)", "deg)"), jc = tl(Jc, ", ", ")", ")"), vr = 0, Sr = 0, Cr = 0, el = 1e3, bi, Nr, $i = 0, Hn = 0, Li = 0, qr = typeof performance == "object" && performance.now ? performance : Date, nl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Qc = el(Zc, "px, ", "px)", "deg)"), th = el(jc, ", ", ")", ")"), _r = 0, Mr = 0, Nr = 0, nl = 1e3, $i, Pr, Ai = 0, Hn = 0, qi = 0, Hr = typeof performance == "object" && performance.now ? performance : Date, rl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; -function zs() { - return Hn || (nl(Qc), Hn = qr.now() + Li); +function Xs() { + return Hn || (rl(eh), Hn = Hr.now() + qi); } -function Qc() { +function eh() { Hn = 0; } -function Ai() { +function Ei() { this._call = this._time = this._next = null; } -Ai.prototype = rl.prototype = { - constructor: Ai, +Ei.prototype = il.prototype = { + constructor: Ei, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? zs() : +n) + (e == null ? 0 : +e), !this._next && Nr !== this && (Nr ? Nr._next = this : bi = this, Nr = this), this._call = t, this._time = n, ws(); + n = (n == null ? Xs() : +n) + (e == null ? 0 : +e), !this._next && Pr !== this && (Pr ? Pr._next = this : $i = this, Pr = this), this._call = t, this._time = n, xs(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, ws()); + this._call && (this._call = null, this._time = 1 / 0, xs()); } }; -function rl(t, e, n) { - var r = new Ai(); +function il(t, e, n) { + var r = new Ei(); return r.restart(t, e, n), r; } -function th() { - zs(), ++vr; - for (var t = bi, e; t; ) +function nh() { + Xs(), ++_r; + for (var t = $i, e; t; ) (e = Hn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --vr; + --_r; } -function Ra() { - Hn = ($i = qr.now()) + Li, vr = Sr = 0; +function Ca() { + Hn = (Ai = Hr.now()) + qi, _r = Mr = 0; try { - th(); + nh(); } finally { - vr = 0, nh(), Hn = 0; + _r = 0, ih(), Hn = 0; } } -function eh() { - var t = qr.now(), e = t - $i; - e > el && (Li -= e, $i = t); +function rh() { + var t = Hr.now(), e = t - Ai; + e > nl && (qi -= e, Ai = t); } -function nh() { - for (var t, e = bi, n, r = 1 / 0; e; ) - e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : bi = n); - Nr = t, ws(r); +function ih() { + for (var t, e = $i, n, r = 1 / 0; e; ) + e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : $i = n); + Pr = t, xs(r); } -function ws(t) { - if (!vr) { - Sr && (Sr = clearTimeout(Sr)); +function xs(t) { + if (!_r) { + Mr && (Mr = clearTimeout(Mr)); var e = t - Hn; - e > 24 ? (t < 1 / 0 && (Sr = setTimeout(Ra, t - qr.now() - Li)), Cr && (Cr = clearInterval(Cr))) : (Cr || ($i = qr.now(), Cr = setInterval(eh, el)), vr = 1, nl(Ra)); + e > 24 ? (t < 1 / 0 && (Mr = setTimeout(Ca, t - Hr.now() - qi)), Nr && (Nr = clearInterval(Nr))) : (Nr || (Ai = Hr.now(), Nr = setInterval(rh, nl)), _r = 1, rl(Ca)); } } -function Ca(t, e, n) { - var r = new Ai(); +function Ta(t, e, n) { + var r = new Ei(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var rh = Io("start", "end", "cancel", "interrupt"), ih = [], il = 0, Ta = 1, xs = 2, ci = 3, Sa = 4, bs = 5, hi = 6; -function qi(t, e, n, r, i, s) { +var sh = Oo("start", "end", "cancel", "interrupt"), ah = [], sl = 0, Sa = 1, bs = 2, hi = 3, Na = 4, $s = 5, di = 6; +function Vi(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - sh(t, n, { + oh(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. - on: rh, - tween: ih, + on: sh, + tween: ah, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: il + state: sl }); } -function Xs(t, e) { - var n = Ae(t, e); - if (n.state > il) throw new Error("too late; already scheduled"); +function Bs(t, e) { + var n = be(t, e); + if (n.state > sl) throw new Error("too late; already scheduled"); return n; } -function Ve(t, e) { - var n = Ae(t, e); - if (n.state > ci) throw new Error("too late; already running"); +function qe(t, e) { + var n = be(t, e); + if (n.state > hi) throw new Error("too late; already running"); return n; } -function Ae(t, e) { +function be(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function sh(t, e, n) { +function oh(t, e, n) { var r = t.__transition, i; - r[e] = n, n.timer = rl(s, 0, n.time); + r[e] = n, n.timer = il(s, 0, n.time); function s(u) { - n.state = Ta, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = Sa, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { - var f, h, c, p; - if (n.state !== Ta) return l(); + var f, d, c, p; + if (n.state !== Sa) return l(); for (f in r) if (p = r[f], p.name === n.name) { - if (p.state === ci) return Ca(a); - p.state === Sa ? (p.state = hi, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = hi, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); + if (p.state === hi) return Ta(a); + p.state === Na ? (p.state = di, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = di, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); } - if (Ca(function() { - n.state === ci && (n.state = Sa, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = xs, n.on.call("start", t, t.__data__, n.index, n.group), n.state === xs) { - for (n.state = ci, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) - (p = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = p); - i.length = h + 1; + if (Ta(function() { + n.state === hi && (n.state = Na, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = bs, n.on.call("start", t, t.__data__, n.index, n.group), n.state === bs) { + for (n.state = hi, i = new Array(c = n.tween.length), f = 0, d = -1; f < c; ++f) + (p = n.tween[f].value.call(t, t.__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 = bs, 1), h = -1, c = i.length; ++h < c; ) - i[h].call(t, f); - n.state === bs && (n.on.call("end", t, t.__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 = $s, 1), d = -1, c = i.length; ++d < c; ) + i[d].call(t, f); + n.state === $s && (n.on.call("end", t, t.__data__, n.index, n.group), l()); } function l() { - n.state = hi, n.timer.stop(), delete r[e]; + n.state = di, n.timer.stop(), delete r[e]; for (var u in r) return; delete t.__transition; } } -function ah(t, e) { +function lh(t, e) { var n = t.__transition, r, i, s = !0, a; if (n) { e = e == null ? null : e + ""; @@ -4058,20 +4058,20 @@ function ah(t, e) { s = !1; continue; } - i = r.state > xs && r.state < bs, r.state = hi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > bs && r.state < $s, r.state = di, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } -function oh(t) { +function uh(t) { return this.each(function() { - ah(this, t); + lh(this, t); }); } -function lh(t, e) { +function fh(t, e) { var n, r; return function() { - var i = Ve(this, t), s = i.tween; + var i = qe(this, t), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) @@ -4083,11 +4083,11 @@ function lh(t, e) { i.tween = r; }; } -function uh(t, e, n) { +function ch(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Ve(this, t), a = s.tween; + var s = qe(this, t), a = s.tween; if (a !== r) { i = (r = a).slice(); for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) @@ -4100,417 +4100,417 @@ function uh(t, e, n) { s.tween = i; }; } -function fh(t, e) { +function hh(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = Ae(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = be(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) if ((a = r[i]).name === t) return a.value; return null; } - return this.each((e == null ? lh : uh)(n, t, e)); + return this.each((e == null ? fh : ch)(n, t, e)); } -function Bs(t, e, n) { +function Ws(t, e, n) { var r = t._id; return t.each(function() { - var i = Ve(this, r); + var i = qe(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return Ae(i, r).value[e]; + return be(i, r).value[e]; }; } -function sl(t, e) { +function al(t, e) { var n; - return (typeof e == "number" ? De : e instanceof Yn ? xi : (n = Yn(e)) ? (e = n, xi) : jo)(t, e); + return (typeof e == "number" ? Pe : e instanceof Yn ? bi : (n = Yn(e)) ? (e = n, bi) : Qo)(t, e); } -function ch(t) { +function dh(t) { return function() { this.removeAttribute(t); }; } -function hh(t) { +function ph(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function dh(t, e, n) { +function vh(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttribute(t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function ph(t, e, n) { +function gh(t, e, n) { var r, i = n + "", s; return function() { var a = this.getAttributeNS(t.space, t.local); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function vh(t, e, n) { +function _h(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function gh(t, e, n) { +function mh(t, e, n) { var r, i, s; return function() { var a, o = n(this), l; return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function _h(t, e) { - var n = Oi(t), r = n === "transform" ? jc : sl; - return this.attrTween(t, typeof e == "function" ? (n.local ? gh : vh)(n, r, Bs(this, "attr." + t, e)) : e == null ? (n.local ? hh : ch)(n) : (n.local ? ph : dh)(n, r, e)); +function yh(t, e) { + var n = Li(t), r = n === "transform" ? th : al; + return this.attrTween(t, typeof e == "function" ? (n.local ? mh : _h)(n, r, Ws(this, "attr." + t, e)) : e == null ? (n.local ? ph : dh)(n) : (n.local ? gh : vh)(n, r, e)); } -function mh(t, e) { +function wh(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function yh(t, e) { +function xh(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function wh(t, e) { +function bh(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && yh(t, s)), n; + return s !== r && (n = (r = s) && xh(t, s)), n; } return i._value = e, i; } -function xh(t, e) { +function $h(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && mh(t, s)), n; + return s !== r && (n = (r = s) && wh(t, s)), n; } return i._value = e, i; } -function bh(t, e) { +function Ah(t, e) { var n = "attr." + t; if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (e == null) return this.tween(n, null); if (typeof e != "function") throw new Error(); - var r = Oi(t); - return this.tween(n, (r.local ? wh : xh)(r, e)); + var r = Li(t); + return this.tween(n, (r.local ? bh : $h)(r, e)); } -function $h(t, e) { +function Eh(t, e) { return function() { - Xs(this, t).delay = +e.apply(this, arguments); + Bs(this, t).delay = +e.apply(this, arguments); }; } -function Ah(t, e) { +function Rh(t, e) { return e = +e, function() { - Xs(this, t).delay = e; + Bs(this, t).delay = e; }; } -function Eh(t) { +function Ch(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? $h : Ah)(e, t)) : Ae(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? Eh : Rh)(e, t)) : be(this.node(), e).delay; } -function Rh(t, e) { +function Th(t, e) { return function() { - Ve(this, t).duration = +e.apply(this, arguments); + qe(this, t).duration = +e.apply(this, arguments); }; } -function Ch(t, e) { +function Sh(t, e) { return e = +e, function() { - Ve(this, t).duration = e; + qe(this, t).duration = e; }; } -function Th(t) { +function Nh(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Rh : Ch)(e, t)) : Ae(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? Th : Sh)(e, t)) : be(this.node(), e).duration; } -function Sh(t, e) { +function kh(t, e) { if (typeof e != "function") throw new Error(); return function() { - Ve(this, t).ease = e; + qe(this, t).ease = e; }; } -function Nh(t) { +function Mh(t) { var e = this._id; - return arguments.length ? this.each(Sh(e, t)) : Ae(this.node(), e).ease; + return arguments.length ? this.each(kh(e, t)) : be(this.node(), e).ease; } -function kh(t, e) { +function Ph(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - Ve(this, t).ease = n; + qe(this, t).ease = n; }; } -function Mh(t) { +function Dh(t) { if (typeof t != "function") throw new Error(); - return this.each(kh(this._id, t)); + return this.each(Ph(this._id, t)); } -function Ph(t) { - typeof t != "function" && (t = qo(t)); +function Fh(t) { + typeof t != "function" && (t = Vo(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new nn(r, this._parents, this._name, this._id); + return new rn(r, this._parents, this._name, this._id); } -function Dh(t) { +function Ih(t) { if (t._id !== this._id) throw new Error(); for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) - for (var l = e[o], u = n[o], f = l.length, h = a[o] = new Array(f), c, p = 0; p < f; ++p) - (c = l[p] || u[p]) && (h[p] = c); + for (var l = e[o], u = n[o], f = l.length, d = a[o] = new Array(f), c, p = 0; p < f; ++p) + (c = l[p] || u[p]) && (d[p] = c); for (; o < r; ++o) a[o] = e[o]; - return new nn(a, this._parents, this._name, this._id); + return new rn(a, this._parents, this._name, this._id); } -function Fh(t) { +function Oh(t) { return (t + "").trim().split(/^|\s+/).every(function(e) { var n = e.indexOf("."); return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; }); } -function Ih(t, e, n) { - var r, i, s = Fh(e) ? Xs : Ve; +function Lh(t, e, n) { + var r, i, s = Oh(e) ? Bs : qe; return function() { var a = s(this, t), o = a.on; o !== r && (i = (r = o).copy()).on(e, n), a.on = i; }; } -function Oh(t, e) { +function qh(t, e) { var n = this._id; - return arguments.length < 2 ? Ae(this.node(), n).on.on(t) : this.each(Ih(n, t, e)); + return arguments.length < 2 ? be(this.node(), n).on.on(t) : this.each(Lh(n, t, e)); } -function Lh(t) { +function Vh(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } -function qh() { - return this.on("end.remove", Lh(this._id)); +function Yh() { + return this.on("end.remove", Vh(this._id)); } -function Vh(t) { +function Hh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = qs(t)); + typeof t != "function" && (t = Vs(t)); 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, h, c = 0; c < l; ++c) - (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, qi(u[c], e, n, c, u, Ae(f, n))); - return new nn(s, this._parents, e, n); + for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, d, c = 0; c < l; ++c) + (f = o[c]) && (d = t.call(f, f.__data__, c, o)) && ("__data__" in f && (d.__data__ = f.__data__), u[c] = d, Vi(u[c], e, n, c, u, be(f, n))); + return new rn(s, this._parents, e, n); } -function Yh(t) { +function zh(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = Lo(t)); + typeof t != "function" && (t = qo(t)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) - for (var l = r[o], u = l.length, f, h = 0; h < u; ++h) - if (f = l[h]) { - for (var c = t.call(f, f.__data__, h, l), p, g = Ae(f, n), y = 0, $ = c.length; y < $; ++y) - (p = c[y]) && qi(p, e, n, y, c, g); + for (var l = r[o], u = l.length, f, d = 0; d < u; ++d) + if (f = l[d]) { + for (var c = t.call(f, f.__data__, d, l), p, g = be(f, n), y = 0, $ = c.length; y < $; ++y) + (p = c[y]) && Vi(p, e, n, y, c, g); s.push(c), a.push(f); } - return new nn(s, a, e, n); + return new rn(s, a, e, n); } -var Hh = mr.prototype.constructor; -function zh() { - return new Hh(this._groups, this._parents); +var Xh = wr.prototype.constructor; +function Bh() { + return new Xh(this._groups, this._parents); } -function Xh(t, e) { +function Wh(t, e) { var n, r, i; return function() { - var s = pr(this, t), a = (this.style.removeProperty(t), pr(this, t)); + var s = gr(this, t), a = (this.style.removeProperty(t), gr(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function al(t) { +function ol(t) { return function() { this.style.removeProperty(t); }; } -function Bh(t, e, n) { +function Uh(t, e, n) { var r, i = n + "", s; return function() { - var a = pr(this, t); + var a = gr(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function Wh(t, e, n) { +function Gh(t, e, n) { var r, i, s; return function() { - var a = pr(this, t), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(t), pr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + var a = gr(this, t), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(t), gr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); }; } -function Uh(t, e) { +function Kh(t, e) { var n, r, i, s = "style." + e, a = "end." + s, o; return function() { - var l = Ve(this, t), u = l.on, f = l.value[s] == null ? o || (o = al(e)) : void 0; + var l = qe(this, t), u = l.on, f = l.value[s] == null ? o || (o = ol(e)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function Gh(t, e, n) { - var r = (t += "") == "transform" ? Zc : sl; - return e == null ? this.styleTween(t, Xh(t, r)).on("end.style." + t, al(t)) : typeof e == "function" ? this.styleTween(t, Wh(t, r, Bs(this, "style." + t, e))).each(Uh(this._id, t)) : this.styleTween(t, Bh(t, r, e), n).on("end.style." + t, null); +function Jh(t, e, n) { + var r = (t += "") == "transform" ? Qc : al; + return e == null ? this.styleTween(t, Wh(t, r)).on("end.style." + t, ol(t)) : typeof e == "function" ? this.styleTween(t, Gh(t, r, Ws(this, "style." + t, e))).each(Kh(this._id, t)) : this.styleTween(t, Uh(t, r, e), n).on("end.style." + t, null); } -function Kh(t, e, n) { +function Zh(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } -function Jh(t, e, n) { +function jh(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && Kh(t, a, n)), r; + return a !== i && (r = (i = a) && Zh(t, a, n)), r; } return s._value = e, s; } -function Zh(t, e, n) { +function Qh(t, e, n) { var r = "style." + (t += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; if (e == null) return this.tween(r, null); if (typeof e != "function") throw new Error(); - return this.tween(r, Jh(t, e, n ?? "")); + return this.tween(r, jh(t, e, n ?? "")); } -function jh(t) { +function td(t) { return function() { this.textContent = t; }; } -function Qh(t) { +function ed(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function td(t) { - return this.tween("text", typeof t == "function" ? Qh(Bs(this, "text", t)) : jh(t == null ? "" : t + "")); +function nd(t) { + return this.tween("text", typeof t == "function" ? ed(Ws(this, "text", t)) : td(t == null ? "" : t + "")); } -function ed(t) { +function rd(t) { return function(e) { this.textContent = t.call(this, e); }; } -function nd(t) { +function id(t) { var e, n; function r() { var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && ed(i)), e; + return i !== n && (e = (n = i) && rd(i)), e; } return r._value = t, r; } -function rd(t) { +function sd(t) { var e = "text"; if (arguments.length < 1) return (e = this.tween(e)) && e._value; if (t == null) return this.tween(e, null); if (typeof t != "function") throw new Error(); - return this.tween(e, nd(t)); + return this.tween(e, id(t)); } -function id() { - for (var t = this._name, e = this._id, n = ol(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function ad() { + for (var t = this._name, e = this._id, n = ll(), 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 = Ae(l, e); - qi(l, t, n, u, a, { + var f = be(l, e); + Vi(l, t, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new nn(r, this._parents, t, n); + return new rn(r, this._parents, t, n); } -function sd() { +function od() { var t, e, 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 = Ve(this, r), f = u.on; + var u = qe(this, r), f = u.on; f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; }), i === 0 && s(); }); } -var ad = 0; -function nn(t, e, n, r) { +var ld = 0; +function rn(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function di(t) { - return mr().transition(t); -} -function ol() { - return ++ad; -} -var We = mr.prototype; -nn.prototype = di.prototype = { - constructor: nn, - select: Vh, - selectAll: Yh, - selectChild: We.selectChild, - selectChildren: We.selectChildren, - filter: Ph, - merge: Dh, - selection: zh, - transition: id, - call: We.call, - nodes: We.nodes, - node: We.node, - size: We.size, - empty: We.empty, - each: We.each, - on: Oh, - attr: _h, - attrTween: bh, - style: Gh, - styleTween: Zh, - text: td, - textTween: rd, - remove: qh, - tween: fh, - delay: Eh, - duration: Th, - ease: Nh, - easeVarying: Mh, - end: sd, - [Symbol.iterator]: We[Symbol.iterator] +function pi(t) { + return wr().transition(t); +} +function ll() { + return ++ld; +} +var Ue = wr.prototype; +rn.prototype = pi.prototype = { + constructor: rn, + select: Hh, + selectAll: zh, + selectChild: Ue.selectChild, + selectChildren: Ue.selectChildren, + filter: Fh, + merge: Ih, + selection: Bh, + transition: ad, + call: Ue.call, + nodes: Ue.nodes, + node: Ue.node, + size: Ue.size, + empty: Ue.empty, + each: Ue.each, + on: qh, + attr: yh, + attrTween: Ah, + style: Jh, + styleTween: Qh, + text: nd, + textTween: sd, + remove: Yh, + tween: hh, + delay: Ch, + duration: Nh, + ease: Mh, + easeVarying: Dh, + end: od, + [Symbol.iterator]: Ue[Symbol.iterator] }; -function od(t) { +function ud(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var ld = { +var fd = { time: null, // Set on use. delay: 0, duration: 250, - ease: od + ease: ud }; -function ud(t, e) { +function cd(t, e) { for (var n; !(n = t.__transition) || !(n = n[e]); ) if (!(t = t.parentNode)) throw new Error(`transition ${e} not found`); return n; } -function fd(t) { +function hd(t) { var e, n; - t instanceof nn ? (e = t._id, t = t._name) : (e = ol(), (n = ld).time = zs(), t = t == null ? null : t + ""); + t instanceof rn ? (e = t._id, t = t._name) : (e = ll(), (n = fd).time = Xs(), t = t == null ? null : t + ""); 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]) && qi(l, t, e, u, a, n || ud(l, e)); - return new nn(r, this._parents, t, e); + (l = a[u]) && Vi(l, t, e, u, a, n || cd(l, e)); + return new rn(r, this._parents, t, e); } -mr.prototype.interrupt = oh; -mr.prototype.transition = fd; -const $s = Math.PI, As = 2 * $s, wn = 1e-6, cd = As - wn; -function ll(t) { +wr.prototype.interrupt = uh; +wr.prototype.transition = hd; +const As = Math.PI, Es = 2 * As, wn = 1e-6, dd = Es - wn; +function ul(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function hd(t) { +function pd(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return ll; + if (e > 15) return ul; const n = 10 ** e; return function(r) { this._ += r[0]; @@ -4518,10 +4518,10 @@ function hd(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class dd { +class vd { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? ll : hd(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? ul : pd(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -4540,20 +4540,20 @@ class dd { } arcTo(e, n, r, i, s) { if (e = +e, 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 - e, u = i - n, f = a - e, h = o - n, c = f * f + h * h; + let a = this._x1, o = this._y1, l = r - e, u = i - n, f = a - e, d = o - n, c = f * f + d * d; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > wn) if (!(Math.abs(h * l - u * f) > wn) || !s) + else if (c > wn) if (!(Math.abs(d * l - u * f) > wn) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let p = r - a, g = i - o, y = l * l + u * u, $ = p * p + g * g, A = Math.sqrt(y), k = Math.sqrt(c), C = s * Math.tan(($s - Math.acos((y + c - $) / (2 * A * k))) / 2), D = C / k, P = C / A; - Math.abs(D - 1) > wn && this._append`L${e + D * f},${n + D * h}`, this._append`A${s},${s},0,0,${+(h * p > f * g)},${this._x1 = e + P * l},${this._y1 = n + P * u}`; + let p = r - a, g = i - o, y = l * l + u * u, $ = p * p + g * g, E = Math.sqrt(y), N = Math.sqrt(c), C = s * Math.tan((As - Math.acos((y + c - $) / (2 * E * N))) / 2), P = C / N, M = C / E; + Math.abs(P - 1) > wn && this._append`L${e + P * f},${n + P * d}`, this._append`A${s},${s},0,0,${+(d * p > f * g)},${this._x1 = e + M * l},${this._y1 = n + M * u}`; } } arc(e, n, r, i, s, a) { if (e = +e, 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 = e + o, f = n + l, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > wn || Math.abs(this._y1 - f) > wn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % As + As), c > cd ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > wn && this._append`A${r},${r},0,${+(c >= $s)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + let o = r * Math.cos(i), l = r * Math.sin(i), u = e + o, f = n + l, d = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > wn || Math.abs(this._y1 - f) > wn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Es + Es), c > dd ? this._append`A${r},${r},0,1,${d},${e - o},${n - l}A${r},${r},0,1,${d},${this._x1 = u},${this._y1 = f}` : c > wn && this._append`A${r},${r},0,${+(c >= As)},${d},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } rect(e, n, r, i) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; @@ -4562,24 +4562,24 @@ class dd { return this._; } } -function pd(t) { +function gd(t) { for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); return n; } -const vd = pd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Dt(t) { +const _d = gd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Pt(t) { return function() { return t; }; } -const Na = Math.abs, Nt = Math.atan2, yn = Math.cos, gd = Math.max, ts = Math.min, Te = Math.sin, jn = Math.sqrt, Lt = 1e-12, Vr = Math.PI, Ei = Vr / 2, pi = 2 * Vr; -function _d(t) { - return t > 1 ? 0 : t < -1 ? Vr : Math.acos(t); +const ka = Math.abs, Nt = Math.atan2, yn = Math.cos, md = Math.max, es = Math.min, Ce = Math.sin, tr = Math.sqrt, Ot = 1e-12, zr = Math.PI, Ri = zr / 2, vi = 2 * zr; +function yd(t) { + return t > 1 ? 0 : t < -1 ? zr : Math.acos(t); } -function ka(t) { - return t >= 1 ? Ei : t <= -1 ? -Ei : Math.asin(t); +function Ma(t) { + return t >= 1 ? Ri : t <= -1 ? -Ri : Math.asin(t); } -function md(t) { +function wd(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -4591,141 +4591,141 @@ function md(t) { e = r; } return t; - }, () => new dd(e); + }, () => new vd(e); } -function yd(t) { +function xd(t) { return t.innerRadius; } -function wd(t) { +function bd(t) { return t.outerRadius; } -function xd(t) { +function $d(t) { return t.startAngle; } -function bd(t) { +function Ad(t) { return t.endAngle; } -function $d(t) { +function Ed(t) { return t && t.padAngle; } -function Ad(t, e, n, r, i, s, a, o) { - var l = n - t, u = r - e, f = a - i, h = o - s, c = h * l - f * u; - if (!(c * c < Lt)) - return c = (f * (e - s) - h * (t - i)) / c, [t + c * l, e + c * u]; +function Rd(t, e, n, r, i, s, a, o) { + var l = n - t, u = r - e, f = a - i, d = o - s, c = d * l - f * u; + if (!(c * c < Ot)) + return c = (f * (e - s) - d * (t - i)) / c, [t + c * l, e + c * u]; } -function ii(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / jn(o * o + l * l), f = u * l, h = -u * o, c = t + f, p = e + h, g = n + f, y = r + h, $ = (c + g) / 2, A = (p + y) / 2, k = g - c, C = y - p, D = k * k + C * C, P = i - s, G = c * y - g * p, ut = (C < 0 ? -1 : 1) * jn(gd(0, P * P * D - G * G)), K = (G * C - k * ut) / D, it = (-G * k - C * ut) / D, Q = (G * C + k * ut) / D, gt = (-G * k + C * ut) / D, _t = K - $, F = it - A, I = Q - $, Xt = gt - A; - return _t * _t + F * F > I * I + Xt * Xt && (K = Q, it = gt), { +function si(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / tr(o * o + l * l), f = u * l, d = -u * o, c = t + f, p = e + d, g = n + f, y = r + d, $ = (c + g) / 2, E = (p + y) / 2, N = g - c, C = y - p, P = N * N + C * C, M = i - s, G = c * y - g * p, ft = (C < 0 ? -1 : 1) * tr(md(0, M * M * P - G * G)), K = (G * C - N * ft) / P, st = (-G * N - C * ft) / P, tt = (G * C + N * ft) / P, gt = (-G * N + C * ft) / P, _t = K - $, F = st - E, I = tt - $, zt = gt - E; + return _t * _t + F * F > I * I + zt * zt && (K = tt, st = gt), { cx: K, - cy: it, + cy: st, x01: -f, - y01: -h, - x11: K * (i / P - 1), - y11: it * (i / P - 1) + y01: -d, + x11: K * (i / M - 1), + y11: st * (i / M - 1) }; } -function Se() { - var t = yd, e = wd, n = Dt(0), r = null, i = xd, s = bd, a = $d, o = null, l = md(u); +function Te() { + var t = xd, e = bd, n = Pt(0), r = null, i = $d, s = Ad, a = Ed, o = null, l = wd(u); function u() { - var f, h, c = +t.apply(this, arguments), p = +e.apply(this, arguments), g = i.apply(this, arguments) - Ei, y = s.apply(this, arguments) - Ei, $ = Na(y - g), A = y > g; - if (o || (o = f = l()), p < c && (h = p, p = c, c = h), !(p > Lt)) o.moveTo(0, 0); - else if ($ > pi - Lt) - o.moveTo(p * yn(g), p * Te(g)), o.arc(0, 0, p, g, y, !A), c > Lt && (o.moveTo(c * yn(y), c * Te(y)), o.arc(0, 0, c, y, g, A)); + var f, d, c = +t.apply(this, arguments), p = +e.apply(this, arguments), g = i.apply(this, arguments) - Ri, y = s.apply(this, arguments) - Ri, $ = ka(y - g), E = y > g; + if (o || (o = f = l()), p < c && (d = p, p = c, c = d), !(p > Ot)) o.moveTo(0, 0); + else if ($ > vi - Ot) + o.moveTo(p * yn(g), p * Ce(g)), o.arc(0, 0, p, g, y, !E), c > Ot && (o.moveTo(c * yn(y), c * Ce(y)), o.arc(0, 0, c, y, g, E)); else { - var k = g, C = y, D = g, P = y, G = $, ut = $, K = a.apply(this, arguments) / 2, it = K > Lt && (r ? +r.apply(this, arguments) : jn(c * c + p * p)), Q = ts(Na(p - c) / 2, +n.apply(this, arguments)), gt = Q, _t = Q, F, I; - if (it > Lt) { - var Xt = ka(it / c * Te(K)), ie = ka(it / p * Te(K)); - (G -= Xt * 2) > Lt ? (Xt *= A ? 1 : -1, D += Xt, P -= Xt) : (G = 0, D = P = (g + y) / 2), (ut -= ie * 2) > Lt ? (ie *= A ? 1 : -1, k += ie, C -= ie) : (ut = 0, k = C = (g + y) / 2); + var N = g, C = y, P = g, M = y, G = $, ft = $, K = a.apply(this, arguments) / 2, st = K > Ot && (r ? +r.apply(this, arguments) : tr(c * c + p * p)), tt = es(ka(p - c) / 2, +n.apply(this, arguments)), gt = tt, _t = tt, F, I; + if (st > Ot) { + var zt = Ma(st / c * Ce(K)), ee = Ma(st / p * Ce(K)); + (G -= zt * 2) > Ot ? (zt *= E ? 1 : -1, P += zt, M -= zt) : (G = 0, P = M = (g + y) / 2), (ft -= ee * 2) > Ot ? (ee *= E ? 1 : -1, N += ee, C -= ee) : (ft = 0, N = C = (g + y) / 2); } - var xt = p * yn(k), It = p * Te(k), Tt = c * yn(P), pe = c * Te(P); - if (Q > Lt) { - var z = p * yn(C), St = p * Te(C), sn = c * yn(D), Z = c * Te(D), kt; - if ($ < Vr) - if (kt = Ad(xt, It, sn, Z, z, St, Tt, pe)) { - var Ee = xt - kt[0], Re = It - kt[1], Ye = z - kt[0], dt = St - kt[1], He = 1 / Te(_d((Ee * Ye + Re * dt) / (jn(Ee * Ee + Re * Re) * jn(Ye * Ye + dt * dt))) / 2), an = jn(kt[0] * kt[0] + kt[1] * kt[1]); - gt = ts(Q, (c - an) / (He - 1)), _t = ts(Q, (p - an) / (He + 1)); + var xt = p * yn(N), Ft = p * Ce(N), Ct = c * yn(M), fe = c * Ce(M); + if (tt > Ot) { + var z = p * yn(C), Tt = p * Ce(C), an = c * yn(P), Z = c * Ce(P), kt; + if ($ < zr) + if (kt = Rd(xt, Ft, an, Z, z, Tt, Ct, fe)) { + var $e = xt - kt[0], Ae = Ft - kt[1], Ve = z - kt[0], pt = Tt - kt[1], Ye = 1 / Ce(yd(($e * Ve + Ae * pt) / (tr($e * $e + Ae * Ae) * tr(Ve * Ve + pt * pt))) / 2), on = tr(kt[0] * kt[0] + kt[1] * kt[1]); + gt = es(tt, (c - on) / (Ye - 1)), _t = es(tt, (p - on) / (Ye + 1)); } else gt = _t = 0; } - ut > Lt ? _t > Lt ? (F = ii(sn, Z, xt, It, p, _t, A), I = ii(z, St, Tt, pe, p, _t, A), o.moveTo(F.cx + F.x01, F.cy + F.y01), _t < Q ? o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !A) : (o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !A), o.arc(0, 0, p, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), !A), o.arc(I.cx, I.cy, _t, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !A))) : (o.moveTo(xt, It), o.arc(0, 0, p, k, C, !A)) : o.moveTo(xt, It), !(c > Lt) || !(G > Lt) ? o.lineTo(Tt, pe) : gt > Lt ? (F = ii(Tt, pe, z, St, c, -gt, A), I = ii(xt, It, sn, Z, c, -gt, A), o.lineTo(F.cx + F.x01, F.cy + F.y01), gt < Q ? o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !A) : (o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !A), o.arc(0, 0, c, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), A), o.arc(I.cx, I.cy, gt, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !A))) : o.arc(0, 0, c, P, D, A); + ft > Ot ? _t > Ot ? (F = si(an, Z, xt, Ft, p, _t, E), I = si(z, Tt, Ct, fe, p, _t, E), o.moveTo(F.cx + F.x01, F.cy + F.y01), _t < tt ? o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !E) : (o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !E), o.arc(0, 0, p, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), !E), o.arc(I.cx, I.cy, _t, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !E))) : (o.moveTo(xt, Ft), o.arc(0, 0, p, N, C, !E)) : o.moveTo(xt, Ft), !(c > Ot) || !(G > Ot) ? o.lineTo(Ct, fe) : gt > Ot ? (F = si(Ct, fe, z, Tt, c, -gt, E), I = si(xt, Ft, an, Z, c, -gt, E), o.lineTo(F.cx + F.x01, F.cy + F.y01), gt < tt ? o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !E) : (o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !E), o.arc(0, 0, c, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), E), o.arc(I.cx, I.cy, gt, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !E))) : o.arc(0, 0, c, M, P, E); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Vr / 2; - return [yn(h) * f, Te(h) * f]; + var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, d = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - zr / 2; + return [yn(d) * f, Ce(d) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Dt(+f), u) : t; + return arguments.length ? (t = typeof f == "function" ? f : Pt(+f), u) : t; }, u.outerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Dt(+f), u) : e; + return arguments.length ? (e = typeof f == "function" ? f : Pt(+f), u) : e; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Dt(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Pt(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Dt(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Pt(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Dt(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Pt(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Dt(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Pt(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Dt(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Pt(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function Ed(t) { +function Cd(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function Rd(t, e) { +function Td(t, e) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function Cd(t) { +function Sd(t) { return t; } -function es() { - var t = Cd, e = Rd, n = null, r = Dt(0), i = Dt(pi), s = Dt(0); +function ns() { + var t = Sd, e = Td, n = null, r = Pt(0), i = Pt(vi), s = Pt(0); function a(o) { - var l, u = (o = Ed(o)).length, f, h, c = 0, p = new Array(u), g = new Array(u), y = +r.apply(this, arguments), $ = Math.min(pi, Math.max(-pi, i.apply(this, arguments) - y)), A, k = Math.min(Math.abs($) / u, s.apply(this, arguments)), C = k * ($ < 0 ? -1 : 1), D; + var l, u = (o = Cd(o)).length, f, d, c = 0, p = new Array(u), g = new Array(u), y = +r.apply(this, arguments), $ = Math.min(vi, Math.max(-vi, i.apply(this, arguments) - y)), E, N = Math.min(Math.abs($) / u, s.apply(this, arguments)), C = N * ($ < 0 ? -1 : 1), P; for (l = 0; l < u; ++l) - (D = g[p[l] = l] = +t(o[l], l, o)) > 0 && (c += D); - for (e != null ? p.sort(function(P, G) { - return e(g[P], g[G]); - }) : n != null && p.sort(function(P, G) { - return n(o[P], o[G]); - }), l = 0, h = c ? ($ - u * C) / c : 0; l < u; ++l, y = A) - f = p[l], D = g[f], A = y + (D > 0 ? D * h : 0) + C, g[f] = { + (P = g[p[l] = l] = +t(o[l], l, o)) > 0 && (c += P); + for (e != null ? p.sort(function(M, G) { + return e(g[M], g[G]); + }) : n != null && p.sort(function(M, G) { + return n(o[M], o[G]); + }), l = 0, d = c ? ($ - u * C) / c : 0; l < u; ++l, y = E) + f = p[l], P = g[f], E = y + (P > 0 ? P * d : 0) + C, g[f] = { data: o[f], index: l, - value: D, + value: P, startAngle: y, - endAngle: A, - padAngle: k + endAngle: E, + padAngle: N }; return g; } return a.value = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : Dt(+o), a) : t; + return arguments.length ? (t = typeof o == "function" ? o : Pt(+o), a) : t; }, a.sortValues = function(o) { return arguments.length ? (e = o, n = null, a) : e; }, a.sort = function(o) { return arguments.length ? (n = o, e = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Dt(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Pt(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Dt(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Pt(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Dt(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Pt(+o), a) : s; }, a; } -function kr(t, e, n) { +function Dr(t, e, n) { this.k = t, this.x = e, this.y = n; } -kr.prototype = { - constructor: kr, +Dr.prototype = { + constructor: Dr, scale: function(t) { - return t === 1 ? this : new kr(this.k * t, this.x, this.y); + return t === 1 ? this : new Dr(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new kr(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new Dr(this.k, this.x + this.k * t, this.y + this.k * e); }, apply: function(t) { return [t[0] * this.k + this.x, t[1] * this.k + this.y]; @@ -4755,264 +4755,267 @@ kr.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -kr.prototype; -var Td = /* @__PURE__ */ Nu(''); -const Sd = { +Dr.prototype; +var Nd = /* @__PURE__ */ Mu(''); +const kd = { 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 ul(t, e) { - Ts(e, !0), Po(t, Sd); - let n = vt(e, "jsonData", 7), r = vt(e, "currentRound", 7, 1), i = vt(e, "mouseEventType", 15), s = vt(e, "mouseData", 15), a = vt(e, "mouseX", 15), o = vt(e, "mouseY", 15), l = vt(e, "requestRoundChange", 7, (d) => { - }), u = vt(e, "candidateColors", 23, () => []), f = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = vt(e, "firstRoundDeterminesPercentages", 7, !1), c = vt(e, "displayPhase", 15, 0); - function p(d) { - return d.isTransfer ? `${d.label}__transfer` : d.transferIndex != null ? `${d.label}__${d.transferIndex}` : d.label; - } - const g = 800, y = 800, $ = Math.min(g, y) * 0.3, A = g / 2, k = y / 2, C = "Pie", D = "PieOutline", P = "Donut", G = "TextLayer", ut = "url(#cross-hatch)", K = 1.15, it = 0.1, Q = 750, gt = 800, _t = "white", F = 1, I = "#ff00ff", Xt = 3; - function ie(d) { - return "hatch-" + d.replace(/[^a-zA-Z0-9]/g, "-"); - } - let xt = [], It = [], Tt = [], pe = 0, z = 0; - const St = {}, sn = "No Further Rankings"; +function fl(t, e) { + Ss(e, !0), Do(t, kd); + let n = vt(e, "jsonData", 7), r = vt(e, "currentRound", 7, 1), i = vt(e, "mouseEventType", 15), s = vt(e, "mouseData", 15), a = vt(e, "mouseX", 15), o = vt(e, "mouseY", 15), l = vt(e, "requestRoundChange", 7, (h) => { + }), u = vt(e, "candidateColors", 23, () => []), f = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), d = vt(e, "firstRoundDeterminesPercentages", 7, !1), c = vt(e, "displayPhase", 15, 0); + function p(h) { + return h.isTransfer ? `${h.label}__transfer` : h.transferIndex != null ? `${h.label}__${h.transferIndex}` : h.label; + } + const g = 800, y = 800, $ = Math.min(g, y) * 0.3, E = g / 2, N = y / 2, C = "Pie", P = "PieOutline", M = "Donut", G = "TextLayer", ft = "url(#cross-hatch)", K = 1.15, st = 0.1, tt = 750, gt = 800, _t = "white", F = 1, I = "#ff00ff", zt = 3; + function ee(h) { + return "hatch-" + h.replace(/[^a-zA-Z0-9]/g, "-"); + } + let xt = [], Ft = [], Ct = [], fe = 0, z = 0; + const Tt = {}, an = "No Further Rankings"; let Z = /* @__PURE__ */ yt(null); function kt() { - const d = at(x(Z)); - d.select("#" + C).remove(), d.select("#" + D).remove(), d.select("#" + P).remove(), d.select("#" + G).remove(); + const h = ot(x(Z)); + h.select("#" + C).remove(), h.select("#" + P).remove(), h.select("#" + M).remove(), h.select("#" + G).remove(); } - function Ee(d) { - l() && (ft = d, l()(d)); + function $e(h) { + l() && (et = h, l()(h)); } - function Re(d) { - kt(), Tt = Ye(d), xt = Gs(d, C, Tt, A, k, 0, dt()), Gs(d, D, Tt, A, k, 0, dt(), !1, !1, !0), $r(); + function Ae(h) { + kt(), Ct = Ve(h), xt = Ks(h, C, Ct, E, N, 0, pt()), Ks(h, P, Ct, E, N, 0, pt(), !1, !1, !0), Rr(); } - Iu(() => { - Mt(), setTimeout( + Lu(() => { + It(), setTimeout( () => { - Re(r()); + Ae(r()); }, 0 ); }); - function Ye(d) { - const _ = j(d); - return pe = yr(d), _; + function Ve(h) { + const _ = bt(h); + return fe = xr(h), _; } - function dt() { + function pt() { return $; } - function He() { - return dt() * 1.41; + function Ye() { + return pt() * 1.41; } - function an(d) { + function on(h) { let _ = 0; - for (let m = 1; m < d; m++) { - const E = n().results[m - 1].tallyResults; - for (let b = 0; b < E.length; b++) { - const T = E[b].transfers; + for (let m = 1; m < h; m++) { + const A = n().results[m - 1].tallyResults; + for (let b = 0; b < A.length; b++) { + const T = A[b].transfers; if (T) { - const N = T.exhausted; - N && (_ += Number(N)); + const D = T.exhausted; + D && (_ += Number(D)); } } } return _; } - function Kr(d, _) { - if (d === "exhausted") return an(_); + function jr(h, _) { + if (h === "exhausted") return on(_); { const m = n().results[_ - 1].tally; - return Number(m[d]); + return Number(m[h]); } } - function Vi(d, _) { - return Kr(d, _).toLocaleString("en-US"); + function Yi(h, _) { + return jr(h, _).toLocaleString("en-US"); } - function Bn(d, _) { - const m = h() ? pe : Yi(_); - return (Kr(d, _) / m).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Bn(h, _) { + const m = d() ? fe : Hi(_); + return (jr(h, _) / m).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function yr(d) { - const _ = n().results[d - 1].tally; + function xr(h) { + const _ = n().results[h - 1].tally; let m = 0; - for (let [E, b] of Object.entries(_)) + for (let [A, b] of Object.entries(_)) m += Number(b); return m; } - function Jr(d) { - return d === "exhausted" || d === "Inactive Ballots"; + function br(h) { + return h === "exhausted" || h === "Inactive Ballots"; } - function Yi(d) { - const _ = n().results[d - 1].tally; + function Hi(h) { + const _ = n().results[h - 1].tally; let m = 0; - for (let [E, b] of Object.entries(_)) - Jr(E) || (m += Number(b)); + for (let [A, b] of Object.entries(_)) + br(A) || (m += Number(b)); return m; } - function Wn(d, _) { - if (!d || d < 1 || d > n().results.length) + function Wn(h, _) { + if (!h || h < 1 || h > n().results.length) return console.warn("In chosenCandidates: round ${round} is out of range."), []; - if (f() && d === n().results.length) + if (f() && h === n().results.length) return []; - const m = n().results[d - 1].tallyResults, E = []; + const m = n().results[h - 1].tallyResults, A = []; for (let b = 0; b < m.length; b++) { const T = m[b][_]; - T != null && E.push(T); + T != null && A.push(T); } - return E; + return A; } - function Un(d) { - return Wn(d, "eliminated"); + function Un(h) { + return Wn(h, "eliminated"); } - function w(d) { + function w(h) { let _ = []; - for (let m = 1; m <= d; m++) _ = _.concat(Wn(m, "elected")); + for (let m = 1; m <= h; m++) _ = _.concat(Wn(m, "elected")); return [...new Set(_)]; } - function W(d, _) { + function W(h, _) { const m = n().results[_ - 1].tallyResults; - let E = 0; - const b = m.findIndex((T) => (T == null ? void 0 : T.elected) && d == T.elected); + let A = 0; + const b = m.findIndex((T) => (T == null ? void 0 : T.elected) && h == T.elected); if (b >= 0) { const T = m[b].transfers; if (T) - for (let [N, V] of Object.entries(T)) E += Number(V); + for (let [D, V] of Object.entries(T)) A += Number(V); } else return 0; - return E; - } - function j(d) { - const _ = n().results; - let m = _[Math.max(0, d - 2)].tally; - const E = [], b = []; - for (let [N, V] of Object.entries(m)) - E.push({ label: N, value: 0 }); - m = _[d - 1].tally; - for (let N of E) - N.value = Number(m[N.label]), b.push(N); - const T = an(d); - return b.push({ label: "exhausted", value: T }), b; - } - function bt(d, _) { + return A; + } + function Q(h, _) { + h.some((m) => br(m.label)) || h.push({ label: "exhausted", value: on(_) }); + } + function bt(h) { + const _ = []; + for (let [m, A] of Object.entries(n().results[h - 1].tally)) + _.push({ label: m, value: Number(A) }); + return Q(_, h), _; + } + function Mt(h) { + const _ = n().results[Math.max(0, h - 2)].tally, m = n().results[h - 1].tally, A = []; + for (let [b] of Object.entries(_)) + A.push({ label: b, value: Number(m[b] ?? 0) }); + return Q(A, h), A; + } + function rt(h, _) { const m = []; - for (const E of d) { - if (E.label === "exhausted" || E.isTransfer) { - m.push(E); + for (const A of h) { + if (A.label === "exhausted" || A.isTransfer) { + m.push(A); continue; } - const b = W(E.label, _); + const b = W(A.label, _); b > 0 ? (m.push({ - label: E.label, + label: A.label, value: b, isTransfer: !0 - }), m.push({ ...E, value: E.value - b })) : m.push(E); + }), m.push({ ...A, value: A.value - b })) : m.push(A); } return m; } - function Mt() { - const d = at(x(Z)).select("defs").select("#cross-hatch"); + function It() { + const h = ot(x(Z)).select("defs").select("#cross-hatch"); let _ = 0; - for (let [m, E] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? _ < 10 ? St[m] = vd[_] : St[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : St[m] = u()[_ % u().length], _++; + for (let [m, A] of Object.entries(n().results[0].tally)) { + !u() || u().length === 0 ? _ < 10 ? Tt[m] = _d[_] : Tt[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Tt[m] = u()[_ % u().length], _++; { - const b = d.clone(!0); - b.attr("id", ie(m)).select("rect").attr("fill", St[m]), b.selectAll("circle").attr("fill", "#383838"); + const b = h.clone(!0); + b.attr("id", ee(m)).select("rect").attr("fill", Tt[m]), b.selectAll("circle").attr("fill", "#383838"); } } - St.exhausted = ut, St["Inactive Ballots"] = ut; + Tt.exhausted = ft, Tt["Inactive Ballots"] = ft; } - function et() { - at(x(Z)).select("#" + P).remove(); + function He() { + ot(x(Z)).select("#" + M).remove(); } - function $t(d, _) { - const m = di("global").duration(gt); + function Xt(h, _) { + const m = pi("global").duration(gt); _ && m.on("end", _); - const E = bt(Tt, d), T = es().sort(null).value((N) => N.value)(E); - js(d, C, T, 0, dt()), js(d, D, T, 0, dt(), !0), Tt = E, xt = T, et(), br(d), pl(), gl(0, dt()), $r(); + const A = rt(Ct, h), T = ns().sort(null).value((D) => D.value)(A); + Qs(h, C, T, 0, pt()), Qs(h, P, T, 0, pt(), !0), Ct = A, xt = T, He(), Be(h), gl(), ml(0, pt()), Rr(); } - function Bt(d, _) { - const m = di("global").duration(gt); - _ && m.on("end", _), Be(d); + function ce(h, _) { + const m = pi("global").duration(gt); + _ && m.on("end", _), zi(h); } - function Pt(d, _) { - const m = di("global").duration(gt); - _ && m.on("end", _), wr(d), xr(dt(), He()); + function Bt(h, _) { + const m = pi("global").duration(gt); + _ && m.on("end", _), Ar(h), Xe(pt(), Ye()); } - let pt = !1, Ot = []; - function nt() { - $r(), pt = !1, Wt(); + let j = !1, St = []; + function ct() { + Rr(), j = !1, he(); } - function Wt() { - if (Ot.length === 0) { - ft !== r() && (r() === ft + 1 && ft > 0 && r() <= n().results.length ? (ft = r(), Ut(r())) : r() >= 1 && r() <= n().results.length && (ft = r(), c(0), Re(r()))); + function he() { + if (St.length === 0) { + et !== r() && (r() === et + 1 && et > 0 && r() <= n().results.length ? (et = r(), gn(r())) : r() >= 1 && r() <= n().results.length && (et = r(), c(0), Ae(r()))); return; } - const d = Ot.shift(); - switch (d.type) { + const h = St.shift(); + switch (h.type) { case "round": { - const _ = d.round; - _ === ft + 1 && ft > 0 && _ <= n().results.length ? (ft = _, Ut(_)) : (_ !== ft && _ >= 1 && _ <= n().results.length && (ft = _, c(0), Re(_)), Wt()); + const _ = h.round; + _ === et + 1 && et > 0 && _ <= n().results.length ? (et = _, gn(_)) : (_ !== et && _ >= 1 && _ <= n().results.length && (et = _, c(0), Ae(_)), he()); break; } case "step": - _n(); + Jn(); break; } } - function Ut(d) { - if (d <= 1 || d > n().results.length) { - Wt(); + function gn(h) { + if (h <= 1 || h > n().results.length) { + he(); return; } - pt = !0, z = d, c(0), $t(z - 1, () => { - Bt(z - 1, () => { - Pt(z, nt); + j = !0, z = h, c(0), Xt(z - 1, () => { + ce(z - 1, () => { + Bt(z, ct); }); }); } - function on() { - pt || (pt = !0, z = r(), gn()); + function Gn() { + j || (j = !0, z = r(), _n()); } - function gn() { + function _n() { if (c( 0 // if in the middle of "one small step" animation, reset to 0. - ), Ot.length > 0) { - nt(); + ), St.length > 0) { + ct(); return; } - const d = z < n().results.length - 1 ? gn : nt; - $t(z, () => { - Bt(z, () => { - z++, Ee(z), Pt(z, d); + const h = z < n().results.length - 1 ? _n : ct; + Xt(z, () => { + ce(z, () => { + z++, $e(z), Bt(z, h); }); }); } - Ds(() => { - Gn(); + Fs(() => { + ze(); }); - let ft = 0; - function Gn() { - if (ft != r()) { - if (pt) { - Ot.push({ type: "round", round: r() }); + let et = 0; + function ze() { + if (et != r()) { + if (j) { + St.push({ type: "round", round: r() }); return; } - ft == r() - 1 && ft > 0 ? Xe() : ze(r()), ft = r(); + et == r() - 1 && et > 0 ? $r() : Kn(r()), et = r(); } } - function ze(d) { - if (pt) { - Ot.push({ type: "round", round: d }); + function Kn(h) { + if (j) { + St.push({ type: "round", round: h }); return; } - c(0), Re(d); + c(0), Ae(h); } - function Xe() { - if (pt) { - Ot.push({ type: "round", round: r() }); + function $r() { + if (j) { + St.push({ type: "round", round: r() }); return; } if (r() <= 1) { @@ -5020,99 +5023,99 @@ function ul(t, e) { return; } if (z = r(), z > n().results.length) { - $r(), pt = !1; + Rr(), j = !1; return; } - pt = !0, c() === 0 ? $t(z - 1, () => { - Bt(z - 1, () => { - Pt(z, nt); + j = !0, c() === 0 ? Xt(z - 1, () => { + ce(z - 1, () => { + Bt(z, ct); }); - }) : c() === 1 ? Bt(z - 1, () => { - Pt(z, nt); - }) : c() === 2 && Pt(z, nt), c(0); + }) : c() === 1 ? ce(z - 1, () => { + Bt(z, ct); + }) : c() === 2 && Bt(z, ct), c(0); } - function _n() { + function Jn() { if (r() > n().results.length) { - $r(), pt = !1; + Rr(), j = !1; return; } - if (pt) { - Ot.push({ type: "step" }); + if (j) { + St.push({ type: "step" }); return; } - pt = !0, c((c() + 1) % 3), z = r(), c() === 1 ? $t(z, nt) : c() === 2 ? Bt(z, nt) : c() === 0 ? (z++, Ee(z), Pt(z, nt)) : (pt = !1, console.warn("displayPhase out of range at ", c())); + j = !0, c((c() + 1) % 3), z = r(), c() === 1 ? Xt(z, ct) : c() === 2 ? ce(z, ct) : c() === 0 ? (z++, $e(z), Bt(z, ct)) : (j = !1, console.warn("displayPhase out of range at ", c())); } - function wr(d) { - Tt = j(d), xt = Js(d, C, Tt, 0, dt(), !0), Js(d, D, Tt, 0, dt(), !1, !0), at(x(Z)).select("#" + D).selectAll(".eliminated").remove(); + function Ar(h) { + Ct = Mt(h), xt = Zs(h, C, Ct, 0, pt(), !0), Zs(h, P, Ct, 0, pt(), !1, !0), ot(x(Z)).select("#" + P).selectAll(".eliminated").remove(); } - function xr(d, _) { - const m = at(x(Z)).select("#" + P), b = at(x(Z)).select("#" + C), T = {}; + function Xe(h, _) { + const m = ot(x(Z)).select("#" + M), b = ot(x(Z)).select("#" + C), T = {}; for (const S of xt) { - const M = S.data.label; + const k = S.data.label; if (S.data.isTransfer) continue; const R = b.select("#" + CSS.escape(p(S.data))); - R.empty() || (T[M] = { + R.empty() || (T[k] = { oldStart: Number(R.attr("prevStart")), oldEnd: Number(R.attr("prevEnd")), newStart: S.startAngle, newEnd: S.endAngle }); } - const N = m.selectAll(".slice"); - let V = N.size(); + const D = m.selectAll(".slice"); + let V = D.size(); function L() { - V--, V === 0 && vl(); + V--, V === 0 && _l(); } - N.select("path").transition("global").duration(Q).attrTween("d", function(S) { - const M = S.startAngle, R = S.endAngle, X = R - M, Kt = T[S.data.label]; - let rt, Ce; - if (Kt) { - const Kn = (Kt.oldStart + Kt.oldEnd) / 2, wl = (Kt.newStart + Kt.newEnd) / 2, xl = M - Kn; - rt = wl + xl, Ce = rt + X; + D.select("path").transition("global").duration(tt).attrTween("d", function(S) { + const k = S.startAngle, R = S.endAngle, X = R - k, Wt = T[S.data.label]; + let it, Ee; + if (Wt) { + const Zn = (Wt.oldStart + Wt.oldEnd) / 2, bl = (Wt.newStart + Wt.newEnd) / 2, $l = k - Zn; + it = bl + $l, Ee = it + X; } else - rt = M, Ce = R; - const tt = Ue(M, rt), se = Ue(R, Ce), Zr = Ue(_, d), Ar = Se(); - return function(Kn) { - return Ar.innerRadius(Math.min(Zr(Kn), d) - 1).outerRadius(Zr(Kn)).startAngle(tt(Kn)).endAngle(se(Kn)), Ar(S); + it = k, Ee = R; + const nt = Ge(k, it), Re = Ge(R, Ee), We = Ge(_, h), Cr = Te(); + return function(Zn) { + return Cr.innerRadius(Math.min(We(Zn), h) - 1).outerRadius(We(Zn)).startAngle(nt(Zn)).endAngle(Re(Zn)), Cr(S); }; }).on("end", (S) => L()); } - function br(d) { - const _ = fl(d, xt); - It = Ks(d, P, _, A, k, dt(), He(), !1, !0); - const m = at(x(Z)); - m.select("#" + C).raise(), m.select("#" + D).raise(); + function Be(h) { + const _ = hl(h, xt); + Ft = Js(h, M, _, E, N, pt(), Ye(), !1, !0); + const m = ot(x(Z)); + m.select("#" + C).raise(), m.select("#" + P).raise(); } - function Be(d) { - const _ = hl(d, It, xt); - It = Qs(d, P, _, dt(), He(), !1); + function zi(h) { + const _ = pl(h, Ft, xt); + Ft = ta(h, M, _, pt(), Ye(), !1); } - function Gt(d) { - return St[d.data.label]; + function Er(h) { + return Tt[h.data.label]; } - function Hi(d) { - const _ = {}, m = n().results[d - 1].tallyResults; - for (let E = 0; E < m.length; E++) { - let b = m[E].eliminated; - if (b === void 0 && (b = m[E].elected), b === void 0) { + function cl(h) { + const _ = {}, m = n().results[h - 1].tallyResults; + for (let A = 0; A < m.length; A++) { + let b = m[A].eliminated; + if (b === void 0 && (b = m[A].elected), b === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const T = m[E].transfers; + const T = m[A].transfers; if (T === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [N, V] of Object.entries(T)) - _[N] === void 0 ? _[N] = Number(V) : _[N] += Number(V); + for (let [D, V] of Object.entries(T)) + _[D] === void 0 ? _[D] = Number(V) : _[D] += Number(V); } return _; } - function fl(d, _) { - const m = [], E = pe, b = n().results[d - 1].tallyResults; + function hl(h, _) { + const m = [], A = fe, b = n().results[h - 1].tallyResults; for (let T = 0; T < b.length; T++) { - let N = b[T].eliminated; - if (N === void 0 && (N = b[T].elected), N === void 0) { + let D = b[T].eliminated; + if (D === void 0 && (D = b[T].elected), D === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } @@ -5121,259 +5124,259 @@ function ul(t, e) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let L = _.find((M) => M.data.label == N && M.data.isTransfer); - L === void 0 && (L = _.find((M) => M.data.label == N && !M.data.isTransfer)); + let L = _.find((k) => k.data.label == D && k.data.isTransfer); + L === void 0 && (L = _.find((k) => k.data.label == D && !k.data.isTransfer)); let S = 0; if (L) S = L.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [M, R] of Object.entries(V)) { + for (let [k, R] of Object.entries(V)) { let X; - const Kt = _.find((tt) => tt.data.label == M); - if (Kt) - X = structuredClone(Kt); - else if (M == "exhausted") + const Wt = _.find((nt) => nt.data.label == k); + if (Wt) + X = structuredClone(Wt); + else if (k == "exhausted") X = { - data: { label: M, value: Number(R) }, + data: { label: k, value: Number(R) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (M == "residual surplus") { + else if (k == "residual surplus") { console.warn("makeDonutInfo: residual surplus = ", R); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", M); + console.warn("makeDonutInfo: unrecognized name in transfers ", k); continue; } - const Ce = Number(R) / E * 2 * Math.PI; - X.startAngle = S, S = X.endAngle = S + Ce, X.index = T, X.data.transferIndex = T, m.push(X); + const Ee = Number(R) / A * 2 * Math.PI; + X.startAngle = S, S = X.endAngle = S + Ee, X.index = T, X.data.transferIndex = T, m.push(X); } } return m; } - function cl(d, _, m) { - const E = {}; - for (let [b, T] of Object.entries(d)) { - const N = m.find((S) => b == S.data.label); - if (N === void 0) { + function dl(h, _, m) { + const A = {}; + for (let [b, T] of Object.entries(h)) { + const D = m.find((S) => b == S.data.label); + if (D === void 0) { console.warn("getTransferStartAngles: mainPieObj not found for ", b); continue; } - const V = (N.startAngle + N.endAngle) / 2, L = d[N.data.label] / _ * 2 * Math.PI; - E[N.data.label] = V - L / 2; + const V = (D.startAngle + D.endAngle) / 2, L = h[D.data.label] / _ * 2 * Math.PI; + A[D.data.label] = V - L / 2; } - return E; + return A; } - function hl(d, _, m) { - const E = [], b = pe, T = Hi(d), N = cl(T, b, m); + function pl(h, _, m) { + const A = [], b = fe, T = cl(h), D = dl(T, b, m); for (let [V, L] of _.entries()) { - const S = structuredClone(L), M = L.endAngle - L.startAngle, R = m.find((X) => L.data.label === X.data.label && !X.data.isTransfer); + const S = structuredClone(L), k = L.endAngle - L.startAngle, R = m.find((X) => L.data.label === X.data.label && !X.data.isTransfer); if (R) { const X = R.data.label; - S.startAngle = N[X], N[X] += M, S.endAngle = S.startAngle + M; + S.startAngle = D[X], D[X] += k, S.endAngle = S.startAngle + k; } else if (L.data.label === "exhausted") S.startAngle = L.startAngle, S.endAngle = L.endAngle; else { console.warn("updateDonutInfo: unrecognized slice name ", L.data.label); continue; } - S.index = V, E.push(S); + S.index = V, A.push(S); } - return E; + return A; } - function Us(d, _, m, E, b, T) { - const V = at(x(Z)).append("g").attr("id", G).attr("transform", `translate(${m}, ${E})`), L = Se().innerRadius(b * K).outerRadius(b * K); + function Gs(h, _, m, A, b, T) { + const V = ot(x(Z)).append("g").attr("id", G).attr("transform", `translate(${m}, ${A})`), L = Te().innerRadius(b * K).outerRadius(b * K); V.selectAll("text").data(_).enter().each(function(S) { - S.endAngle - S.startAngle < it || S.data.isTransfer || at(this).append("g").attr("id", (M) => p(M.data)).classed("eliminated", (M) => T.includes(M.data.label) || M.data.isTransfer === !0).each(function(M, R) { - M.data.label === "exhausted" && at(this).on("mouseenter", (X, Kt) => _l(X)).on("mouseleave", (X, Kt) => ml()); - }).append("text").attr("transform", (M) => `translate(${L.centroid(M)})`).attr("text-anchor", (M) => zi(M.startAngle, M.endAngle)).text((M) => M.data.label === "exhausted" ? sn : M.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((M) => { - const R = Vi(M.data.label, d); - return !h() && Jr(M.data.label) ? R : R + " (" + Bn(M.data.label, d) + ")"; + S.endAngle - S.startAngle < st || S.data.isTransfer || ot(this).append("g").attr("id", (k) => p(k.data)).classed("eliminated", (k) => T.includes(k.data.label) || k.data.isTransfer === !0).each(function(k, R) { + k.data.label === "exhausted" && ot(this).on("mouseenter", (X, Wt) => yl(X)).on("mouseleave", (X, Wt) => wl()); + }).append("text").attr("transform", (k) => `translate(${L.centroid(k)})`).attr("text-anchor", (k) => Xi(k.startAngle, k.endAngle)).text((k) => k.data.label === "exhausted" ? an : k.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((k) => { + const R = Yi(k.data.label, h); + return !d() && br(k.data.label) ? R : R + " (" + Bn(k.data.label, h) + ")"; }); }); } - function dl(d, _, m, E) { - const T = at(x(Z)).select("#" + G), N = T.selectAll("tspan"), V = T.selectAll("g").data(_, (R) => p(R.data)).classed("eliminated", (R) => E.includes(R.data.label) || R.data.isTransfer === !0), L = Se().innerRadius(m * K).outerRadius(m * K + 1); - N.transition("global").duration(Q).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => zi(R.startAngle, R.endAngle)), V.select("text").transition("global").duration(Q).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => zi(R.startAngle, R.endAngle)).on("end", (R) => M()); + function vl(h, _, m, A) { + const T = ot(x(Z)).select("#" + G), D = T.selectAll("tspan"), V = T.selectAll("g").data(_, (R) => p(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), L = Te().innerRadius(m * K).outerRadius(m * K + 1); + D.transition("global").duration(tt).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => Xi(R.startAngle, R.endAngle)), V.select("text").transition("global").duration(tt).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => Xi(R.startAngle, R.endAngle)).on("end", (R) => k()); let S = V.size(); - function M(R) { - S--, S === 0 && (T.remove(), Us(d, _, A, k, m, E)); + function k(R) { + S--, S === 0 && (T.remove(), Gs(h, _, E, N, m, A)); } } - function Gs(d, _, m, E, b, T, N, V = !0, L = !1, S = !1) { - const R = es().sort(null).value((X) => X.value)(m); - return Ks(d, _, R, E, b, T, N, V, L, S), R; + function Ks(h, _, m, A, b, T, D, V = !0, L = !1, S = !1) { + const R = ns().sort(null).value((X) => X.value)(m); + return Js(h, _, R, A, b, T, D, V, L, S), R; } - function $r() { - at(x(Z)).select("#" + D).selectAll(".elected").select("path").style("stroke", I).style("stroke-width", `${Xt}px`); + function Rr() { + ot(x(Z)).select("#" + P).selectAll(".elected").select("path").style("stroke", I).style("stroke-width", `${zt}px`); } - function Ks(d, _, m, E, b, T, N, V, L, S = !1) { - const M = Un(d), R = w(d), rt = at(x(Z)).attr("viewBox", `0 0 ${g} ${y}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${E}, ${b})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (tt) => M.includes(tt.data.label) || tt.data.isTransfer === !0).classed("elected", (tt) => R.includes(tt.data.label) && !tt.data.isTransfer).attr("id", (tt) => p(tt.data)); - S ? rt.style("pointer-events", "none") : rt.on("mouseenter", (tt, se) => Bi(tt, se)).on("mouseleave", (tt, se) => Wi(tt, se)); - const Ce = Se().outerRadius(N).innerRadius(T); + function Js(h, _, m, A, b, T, D, V, L, S = !1) { + const k = Un(h), R = w(h), it = ot(x(Z)).attr("viewBox", `0 0 ${g} ${y}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${A}, ${b})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (nt) => k.includes(nt.data.label) || nt.data.isTransfer === !0).classed("elected", (nt) => R.includes(nt.data.label) && !nt.data.isTransfer).attr("id", (nt) => p(nt.data)); + S ? it.style("pointer-events", "none") : it.on("mouseenter", (nt, Re) => Wi(nt, Re)).on("mouseleave", (nt, Re) => Ui(nt, Re)); + const Ee = Te().outerRadius(D).innerRadius(T); if (L) { - const tt = Se().outerRadius(T + 1).innerRadius(T); - rt.append("path").attr("d", tt).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F).attr("fill", "none").transition("global").duration(Q).attr("d", (se) => Ce(se)).attr("fill", S ? "none" : (se) => Gt(se)).on("end", (se) => { - S || Xi(); + const nt = Te().outerRadius(T + 1).innerRadius(T), Re = it.append("path").attr("d", nt).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F).attr("fill", "none").transition("global").duration(tt).attr("d", (We) => Ee(We)).on("end", (We) => { + S || Bi(); }); + S ? Re.attr("fill", "none") : Re.attr("fill", (We) => Er(We)); } else - rt.append("path").attr("d", (tt) => Ce(tt)).attr("fill", S ? "none" : (tt) => Gt(tt)).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F), S || Xi(); - return V && !S && Us(d, m, E, b, N, M), m; + it.append("path").attr("d", (nt) => Ee(nt)).attr("fill", S ? "none" : (nt) => Er(nt)).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F), S || Bi(); + return V && !S && Gs(h, m, A, b, D, k), m; } - function pl() { - const m = at(x(Z)).select("#" + G).selectAll(".eliminated"); + function gl() { + const m = ot(x(Z)).select("#" + G).selectAll(".eliminated"); m.size() > 0 && m.classed("finished", !0); } - function vl() { - const m = at(x(Z)).select("#" + G).selectAll(".finished"); + function _l() { + const m = ot(x(Z)).select("#" + G).selectAll(".finished"); m.size() > 0 && m.remove(); } - function gl(d, _) { - const b = at(x(Z)).select("#" + C).selectAll(".eliminated"), T = Se().innerRadius(d), N = Se().outerRadius(_); - b.classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(V) { - const L = Ue(_, d); + function ml(h, _) { + const b = ot(x(Z)).select("#" + C).selectAll(".eliminated"), T = Te().innerRadius(h), D = Te().outerRadius(_); + b.classed("finished", !0).select("path").transition("global").duration(tt).attrTween("d", function(V) { + const L = Ge(_, h); return function(S) { - return N.innerRadius(L(S)), N(V); + return D.innerRadius(L(S)), D(V); }; - }).attr("fill", (V) => `url(#${ie(V.data.label)})`), b.clone(!0).classed("finished", !0).select("path").transition("global").duration(Q).attrTween("d", function(V) { - const L = Ue(_, d); + }).attr("fill", (V) => `url(#${ee(V.data.label)})`), b.clone(!0).classed("finished", !0).select("path").transition("global").duration(tt).attrTween("d", function(V) { + const L = Ge(_, h); return function(S) { return T.outerRadius(L(S)), T(V); }; - }).attr("fill", (V) => Gt(V)); + }).attr("fill", (V) => Er(V)); } - function zi(d, _) { - const m = (d + _) / 2; + function Xi(h, _) { + const m = (h + _) / 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 Xi() { - at(x( + function Bi() { + ot(x( Z // force redisplay of text labels )).select("#" + G).raise().append("g").remove(); } - function Js(d, _, m, E, b, T, N = !1) { - const L = es().sort(null).value((S) => S.value)(m); - return Qs(d, _, L, E, b, T, N), L; + function Zs(h, _, m, A, b, T, D = !1) { + const L = ns().sort(null).value((S) => S.value)(m); + return ta(h, _, L, A, b, T, D), L; } - function Zs(d, _, m, E, b = !1) { - const T = Un(d), N = w(d), S = at(x(Z)).select("#" + _).selectAll(".slice").data(m, (R) => p(R.data)), M = S.enter().append("g").attr("class", "slice").attr("id", (R) => p(R.data)).classed("eliminated", !0); - return b ? M.style("pointer-events", "none") : M.on("mouseenter", (R, X) => Bi(R, X)).on("mouseleave", (R, X) => Wi(R, X)), M.append("path").attr("d", (R) => E(R)).attr("fill", b ? "none" : (R) => Gt(R)).attr("stroke", b ? "none" : _t).attr("stroke-width", b ? 0 : F), S.classed("eliminated", (R) => T.includes(R.data.label)).classed("elected", (R) => N.includes(R.data.label)), b || S.on("mouseenter", (R, X) => Bi(R, X)).on("mouseleave", (R, X) => Wi(R, X)), S; + function js(h, _, m, A, b = !1) { + const T = Un(h), D = w(h), S = ot(x(Z)).select("#" + _).selectAll(".slice").data(m, (R) => p(R.data)), k = S.enter().append("g").attr("class", "slice").attr("id", (R) => p(R.data)).classed("eliminated", !0); + return b ? k.style("pointer-events", "none") : k.on("mouseenter", (R, X) => Wi(R, X)).on("mouseleave", (R, X) => Ui(R, X)), k.append("path").attr("d", (R) => A(R)).attr("fill", b ? "none" : (R) => Er(R)).attr("stroke", b ? "none" : _t).attr("stroke-width", b ? 0 : F), S.classed("eliminated", (R) => T.includes(R.data.label)).classed("elected", (R) => D.includes(R.data.label)), b || S.on("mouseenter", (R, X) => Wi(R, X)).on("mouseleave", (R, X) => Ui(R, X)), S; } - function js(d, _, m, E, b, T = !1) { - const N = Se().outerRadius(b).innerRadius(E); - Zs(d, _, m, N, T).select("path").attr("d", (L) => N(L)).attr("fill", T ? "none" : (L) => Gt(L)); + function Qs(h, _, m, A, b, T = !1) { + const D = Te().outerRadius(b).innerRadius(A); + js(h, _, m, D, T).select("path").attr("d", (L) => D(L)).attr("fill", T ? "none" : (L) => Er(L)); } - function Qs(d, _, m, E, b, T, N = !1) { - const V = Se().outerRadius(b).innerRadius(E).startAngle((rt) => rt.startAngle).endAngle((rt) => rt.endAngle), L = Se().outerRadius(b).innerRadius(E), M = at(x(Z)).select("#" + _); - M.selectAll(".slice").attr("prevStart", (rt) => rt.startAngle).attr("prevEnd", (rt) => rt.endAngle); - const R = Zs(d, _, m, L, N); + function ta(h, _, m, A, b, T, D = !1) { + const V = Te().outerRadius(b).innerRadius(A).startAngle((it) => it.startAngle).endAngle((it) => it.endAngle), L = Te().outerRadius(b).innerRadius(A), k = ot(x(Z)).select("#" + _); + k.selectAll(".slice").attr("prevStart", (it) => it.startAngle).attr("prevEnd", (it) => it.endAngle); + const R = js(h, _, m, L, D); let X = R.size(); - function Kt() { - X--, X <= 0 && (N || Xi(), M.selectAll(".finished").remove()); + function Wt() { + X--, X <= 0 && (D || Bi(), k.selectAll(".finished").remove()); } - return R.select("path").transition("global").duration(Q).attrTween("d", function(rt) { - const Ce = Number(at(this.parentNode).attr("prevStart")), tt = Number(at(this.parentNode).attr("prevEnd")), se = Ue(Ce, rt.startAngle), Zr = Ue(tt, rt.endAngle); - return (Ar) => (V.startAngle(se(Ar)).endAngle(Zr(Ar)), V(rt)); - }).on("end", Kt), T && !N && dl(d, m, b, Un(d)), m; + return R.select("path").transition("global").duration(tt).attrTween("d", function(it) { + const Ee = Number(ot(this.parentNode).attr("prevStart")), nt = Number(ot(this.parentNode).attr("prevEnd")), Re = Ge(Ee, it.startAngle), We = Ge(nt, it.endAngle); + return (Cr) => (V.startAngle(Re(Cr)).endAngle(We(Cr)), V(it)); + }).on("end", Wt), T && !D && vl(h, m, b, Un(h)), m; } - function Bi(d, _) { - s(_.data.label), i("enter"), a(d.clientX), o(d.clientY); + function Wi(h, _) { + s(_.data.label), i("enter"), a(h.clientX), o(h.clientY); } - function Wi(d, _) { + function Ui(h, _) { s(_.data.label), i("leave"); } - function _l(d, _) { - i("show-exhausted"), a(d.clientX), o(d.clientY); + function yl(h, _) { + i("show-exhausted"), a(h.clientX), o(h.clientY); } - function ml(d, _) { + function wl(h, _) { i("hide-exhausted"); } - var yl = { - pieColors: St, - exhaustedLabel: sn, - countExhaustedVotes: an, + var xl = { + pieColors: Tt, + exhaustedLabel: an, + countExhaustedVotes: on, getEliminatedCandidates: Un, getElectedCandidates: w, - runFullAnimationFn: on, - animateOnePhaseFn: _n, + runFullAnimationFn: Gn, + animateOnePhaseFn: Jn, get jsonData() { return n(); }, - set jsonData(d) { - n(d), ct(); + set jsonData(h) { + n(h), ht(); }, get currentRound() { return r(); }, - set currentRound(d = 1) { - r(d), ct(); + set currentRound(h = 1) { + r(h), ht(); }, get mouseEventType() { return i(); }, - set mouseEventType(d) { - i(d), ct(); + set mouseEventType(h) { + i(h), ht(); }, get mouseData() { return s(); }, - set mouseData(d) { - s(d), ct(); + set mouseData(h) { + s(h), ht(); }, get mouseX() { return a(); }, - set mouseX(d) { - a(d), ct(); + set mouseX(h) { + a(h), ht(); }, get mouseY() { return o(); }, - set mouseY(d) { - o(d), ct(); + set mouseY(h) { + o(h), ht(); }, get requestRoundChange() { return l(); }, - set requestRoundChange(d = (_) => { + set requestRoundChange(h = (_) => { }) { - l(d), ct(); + l(h), ht(); }, get candidateColors() { return u(); }, - set candidateColors(d = []) { - u(d), ct(); + set candidateColors(h = []) { + u(h), ht(); }, get excludeFinalWinnerAndEliminatedCandidate() { return f(); }, - set excludeFinalWinnerAndEliminatedCandidate(d = !1) { - f(d), ct(); + set excludeFinalWinnerAndEliminatedCandidate(h = !1) { + f(h), ht(); }, get firstRoundDeterminesPercentages() { - return h(); + return d(); }, - set firstRoundDeterminesPercentages(d = !1) { - h(d), ct(); + set firstRoundDeterminesPercentages(h = !1) { + d(h), ht(); }, get displayPhase() { return c(); }, - set displayPhase(d = 0) { - c(d), ct(); + set displayPhase(h = 0) { + c(h), ht(); } - }, ta = Td(); - return li(ta, (d) => ot(Z, d), () => x(Z)), _e(t, ta), Ss(yl); + }, ea = Nd(); + return ui(ea, (h) => lt(Z, h), () => x(Z)), ve(t, ea), Ns(xl); } -Fo( - ul, +Io( + fl, { jsonData: {}, currentRound: {}, @@ -5399,10 +5402,10 @@ Fo( ], { mode: "open" } ); -var Nd = /* @__PURE__ */ Xn(" ", 1), kd = /* @__PURE__ */ Xn("About to eliminate: ", 1), Md = /* @__PURE__ */ Xn(" ", 1), Pd = /* @__PURE__ */ Xn(" ", 1), Dd = /* @__PURE__ */ Xn('

', 1), Fd = /* @__PURE__ */ Xn("
", 1), Id = /* @__PURE__ */ Xn('


these ballots have already been eliminated.
', 1); -const Od = { +var Md = /* @__PURE__ */ Xn(" ", 1), Pd = /* @__PURE__ */ Xn("About to eliminate: ", 1), Dd = /* @__PURE__ */ Xn(" ", 1), Fd = /* @__PURE__ */ Xn(" ", 1), Id = /* @__PURE__ */ Xn('

', 1), Od = /* @__PURE__ */ Xn("
", 1), Ld = /* @__PURE__ */ Xn('


these ballots have already been eliminated.
', 1); +const qd = { 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;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl) {background-color:#4747ff;color:#fff;padding:1px 7px;font-size:0.67rem;min-width:107px;border:none;border-radius:3px;cursor:pointer;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl):hover {background-color:#4747c2;}.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;} + 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;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl) {background-color:#4747ff;color:#fff;padding:4px 10px;font-size:0.8rem;min-width:107px;border:none;border-radius:3px;cursor:pointer;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl):hover {background-color:#4747c2;}.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;} /* Media query for smaller screens */ @media (max-width: 1300px) {.visualizations-container.svelte-1r6y5gl {flex-direction:column;align-items:center;} @@ -5415,12 +5418,12 @@ const Od = { }` }; -function Ld(t, e) { - Ts(e, !0), Po(t, Od); +function Vd(t, e) { + Ss(e, !0), Do(t, qd); const n = 0.85; let r = vt(e, "electionSummary", 7), i = vt(e, "currentRound", 7, 1), s = vt(e, "requestRoundChange", 7, (w) => { }), a = vt(e, "candidateColors", 23, () => []), o = vt(e, "textForWinner", 7, "elected"), l = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = vt(e, "firstRoundDeterminesPercentages", 7, !1), f = vt(e, "showCaptions", 7, !1); - const h = { + const d = { elected: { caption: "Elected", event: "was elected", @@ -5438,7 +5441,7 @@ function Ld(t, e) { infinitive: "to take the lead" } }; - let c = /* @__PURE__ */ Jn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ yt(null), g = /* @__PURE__ */ yt(null), y = /* @__PURE__ */ yt(""), $ = /* @__PURE__ */ yt($n([])), A = /* @__PURE__ */ yt(""), k = /* @__PURE__ */ yt(""), C = /* @__PURE__ */ yt(0), D = /* @__PURE__ */ yt(0), P = /* @__PURE__ */ Jn(() => G(r())); + let c = /* @__PURE__ */ jn(() => d[o()] ?? d.elected), p = /* @__PURE__ */ yt(null), g = /* @__PURE__ */ yt(null), y = /* @__PURE__ */ yt(""), $ = /* @__PURE__ */ yt($n([])), E = /* @__PURE__ */ yt(""), N = /* @__PURE__ */ yt(""), C = /* @__PURE__ */ yt(0), P = /* @__PURE__ */ yt(0), M = /* @__PURE__ */ jn(() => G(r())); function G(w) { if (typeof w == "string") try { @@ -5448,164 +5451,164 @@ function Ld(t, e) { } return w || {}; } - function ut(w) { + function ft(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function K(w, W, j) { - w.style.left = W + "px", w.style.top = j + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const et = w.getBoundingClientRect(); - let $t = W, Bt = j + 20; - $t + et.width > window.innerWidth - 12 && ($t = window.innerWidth - et.width - 12), $t < 12 && ($t = 12), Bt + et.height > window.innerHeight - 12 && (Bt = j - et.height - 12), w.style.left = $t + "px", w.style.top = Bt + "px"; + function K(w, W, Q) { + w.style.left = W + "px", w.style.top = Q + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const rt = w.getBoundingClientRect(); + let It = W, He = Q + 20; + It + rt.width > window.innerWidth - 12 && (It = window.innerWidth - rt.width - 12), It < 12 && (It = 12), He + rt.height > window.innerHeight - 12 && (He = Q - rt.height - 12), w.style.left = It + "px", w.style.top = He + "px"; }); } - function it() { - switch (x(A)) { + function st() { + switch (x(E)) { case "enter": ((w) => { - var W = ql(w, 2); - ot($, W[0], !0), ot(y, W[1], !0); - })(gt(x(k), i())), x(p) && (K(x(p), x(C) || 0, x(D) || 0), x(p).style.opacity = String(n)); + var W = Yl(w, 2); + lt($, W[0], !0), lt(y, W[1], !0); + })(gt(x(N), i())), x(p) && (K(x(p), x(C) || 0, x(P) || 0), x(p).style.opacity = String(n)); break; case "leave": - x(p) && (x(p).style.opacity = "0"), ot($, [], !0), ot(y, ""); + x(p) && (x(p).style.opacity = "0"), lt($, [], !0), lt(y, ""); break; case "show-exhausted": - x(g) && (K(x(g), x(C) || 0, x(D) || 0), x(g).style.opacity = String(n)); + x(g) && (K(x(g), x(C) || 0, x(P) || 0), x(g).style.opacity = String(n)); break; case "hide-exhausted": x(g) && (x(g).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", x(A)); + console.log("Unknown mouse event: ", x(E)); break; } } - Ds(() => it()); - function Q(w, W) { + Fs(() => st()); + function tt(w, W) { return w === 1 ? W ? "vote was" : "vote will be" : W ? "votes were" : "votes will be"; } function gt(w, W) { - const j = [], bt = w === "exhausted" ? z() : w; + const Q = [], bt = w === "exhausted" ? z() : w; let Mt; - w === "exhausted" ? Mt = Tt(1) : Mt = x(P).results[0].tally[w], j.push(`${bt} started with ${Mt} votes.`); - for (let et = 1; et <= W; et++) { - et === W && (w === "exhausted" ? Mt = Tt(W) : Mt = x(P).results[W - 1].tally[w], j.push(`${bt} has ${Mt} votes at round ${W}.`)); - const $t = x(P).results[et - 1].tallyResults, Bt = ie(et); - for (let Pt = 0; Pt < $t.length; Pt++) { - const pt = $t[Pt].transfers, Ot = $t[Pt].eliminated, nt = $t[Pt].elected; - if (!Bt) { - if (Ot) - Ot === w && j.push(`${bt} will be eliminated on round ${et}.`); - else if (w === nt && (j.push(`${bt} ${x(c).event} on round ${et}.`), pt)) - for (let [Ut, on] of Object.entries(pt)) - j.push(`${on} ${Q(Number(on), et < W)} transferred to ${Ut} on round ${et}.`); + w === "exhausted" ? Mt = Ct(1) : Mt = x(M).results[0].tally[w], Q.push(`${bt} started with ${Mt} votes.`); + for (let rt = 1; rt <= W; rt++) { + rt === W && (w === "exhausted" ? Mt = Ct(W) : Mt = x(M).results[W - 1].tally[w], Q.push(`${bt} has ${Mt} votes at round ${W}.`)); + const It = x(M).results[rt - 1].tallyResults, He = ee(rt); + for (let Xt = 0; Xt < It.length; Xt++) { + const ce = It[Xt].transfers, Bt = It[Xt].eliminated, j = It[Xt].elected; + if (!He) { + if (Bt) + Bt === w && Q.push(`${bt} will be eliminated on round ${rt}.`); + else if (w === j && (Q.push(`${bt} ${x(c).event} on round ${rt}.`), ce)) + for (let [ct, he] of Object.entries(ce)) + Q.push(`${he} ${tt(Number(he), rt < W)} transferred to ${ct} on round ${rt}.`); } - const Wt = Ot || nt; - if (Wt) { - const Ut = Number(pt[w]); - Ut && j.push(`${Ut} ${Q(Ut, et < W)} transferred from ${Wt} on round ${et}.`); + const St = Bt || j; + if (St) { + const ct = Number(ce[w]); + ct && Q.push(`${ct} ${tt(ct, rt < W)} transferred from ${St} on round ${rt}.`); } } } - return [j, bt]; + return [Q, bt]; } function _t() { let w = 0; - for (let W = 1; W <= x(P).results.length; W++) { - if (ie(W)) continue; - const j = x(P).results[W - 1].tallyResults; - for (let bt = 0; bt < j.length; bt++) - j[bt].elected && w++; + for (let W = 1; W <= x(M).results.length; W++) { + if (ee(W)) continue; + const Q = x(M).results[W - 1].tallyResults; + for (let bt = 0; bt < Q.length; bt++) + Q[bt].elected && w++; } return w; } const F = ["Eliminate", "Transfer", "Consolidate"]; - let I, Xt = /* @__PURE__ */ yt(0); - function ie(w) { - return l() && x(P).results && w === x(P).results.length; + let I, zt = /* @__PURE__ */ yt(0); + function ee(w) { + return l() && x(M).results && w === x(M).results.length; } function xt(w) { - return ie(w) ? [] : I ? I.getEliminatedCandidates(w) : []; + return ee(w) ? [] : I ? I.getEliminatedCandidates(w) : []; } - function It(w) { - return ie(w) ? [] : I ? I.getElectedCandidates(w) : []; + function Ft(w) { + return ee(w) ? [] : I ? I.getElectedCandidates(w) : []; } - function Tt(w) { + function Ct(w) { return I ? I.countExhaustedVotes(w) : 0; } - function pe() { + function fe() { I && I.animateOnePhaseFn && I.animateOnePhaseFn(); } function z() { return I ? I.exhaustedLabel : ""; } - function St() { + function Tt() { return I ? I.pieColors : {}; } - var sn = { + var an = { get electionSummary() { return r(); }, set electionSummary(w) { - r(w), ct(); + r(w), ht(); }, get currentRound() { return i(); }, set currentRound(w = 1) { - i(w), ct(); + i(w), ht(); }, get requestRoundChange() { return s(); }, set requestRoundChange(w = (W) => { }) { - s(w), ct(); + s(w), ht(); }, get candidateColors() { return a(); }, set candidateColors(w = []) { - a(w), ct(); + a(w), ht(); }, get textForWinner() { return o(); }, set textForWinner(w = "elected") { - o(w), ct(); + o(w), ht(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - l(w), ct(); + l(w), ht(); }, get firstRoundDeterminesPercentages() { return u(); }, set firstRoundDeterminesPercentages(w = !1) { - u(w), ct(); + u(w), ht(); }, get showCaptions() { return f(); }, set showCaptions(w = !1) { - f(w), ct(); + f(w), ht(); } - }, Z = Id(), kt = mn(Z), Ee = Zt(kt); - Ee.__click = pe; - var Re = Zt(Ee, !0); - Jt(Ee), Jt(kt); - var Ye = ve(kt, 4), dt = Zt(Ye), He = Zt(dt), an = Zt(He); - li( - ul(an, { + }, Z = Ld(), kt = mn(Z), $e = Gt(kt); + $e.__click = fe; + var Ae = Gt($e, !0); + Ut($e), Ut(kt); + var Ve = de(kt, 4), pt = Gt(Ve), Ye = Gt(pt), on = Gt(Ye); + ui( + fl(on, { get jsonData() { - return x(P); + return x(M); }, get currentRound() { return i(); }, - requestRoundChange: ut, + requestRoundChange: ft, get candidateColors() { return a(); }, @@ -5616,131 +5619,131 @@ function Ld(t, e) { return u(); }, get mouseEventType() { - return x(A); + return x(E); }, set mouseEventType(w) { - ot(A, w, !0); + lt(E, w, !0); }, get mouseData() { - return x(k); + return x(N); }, set mouseData(w) { - ot(k, w, !0); + lt(N, w, !0); }, get mouseX() { return x(C); }, set mouseX(w) { - ot(C, w, !0); + lt(C, w, !0); }, get mouseY() { - return x(D); + return x(P); }, set mouseY(w) { - ot(D, w, !0); + lt(P, w, !0); }, get displayPhase() { - return x(Xt); + return x(zt); }, set displayPhase(w) { - ot(Xt, w, !0); + lt(zt, w, !0); } }), (w) => I = w, () => I - ), Jt(He), Jt(dt); - var Kr = ve(dt, 2); + ), Ut(Ye), Ut(pt); + var jr = de(pt, 2); { - var Vi = (w) => { - var W = Dd(), j = mn(W), bt = Zt(j); - Jt(j); - var Mt = ve(j, 2), et = Zt(Mt); + var Yi = (w) => { + var W = Id(), Q = mn(W), bt = Gt(Q); + Ut(Q); + var Mt = de(Q, 2), rt = Gt(Mt); { - var $t = (nt) => { - var Wt = kd(), Ut = ve(mn(Wt)); - Ji(Ut, 17, () => xt(i()), Ki, (on, gn, ft) => { - var Gn = Nd(), ze = mn(Gn); - let Xe; - var _n = Zt(ze, !0); - Jt(ze); - var wr = ve(ze, 2); + var It = (j) => { + var St = Pd(), ct = de(mn(St)); + Zi(ct, 17, () => xt(i()), Ji, (he, gn, Gn) => { + var _n = Md(), et = mn(_n); + let ze; + var Kn = Gt(et, !0); + Ut(et); + var $r = de(et, 2); { - var xr = (Be) => { - var Gt = fa(", "); - _e(Be, Gt); - }, br = /* @__PURE__ */ Jn(() => ft < xt(i()).length - 1); - Er(wr, (Be) => { - x(br) && Be(xr); + var Jn = (Xe) => { + var Be = ca(", "); + ve(Xe, Be); + }, Ar = /* @__PURE__ */ jn(() => Gn < xt(i()).length - 1); + Tr($r, (Xe) => { + x(Ar) && Xe(Jn); }); } - Zn( - (Be) => { - Xe = da(ze, "", Xe, Be), ln(_n, x(gn)); + Qn( + (Xe) => { + ze = pa(et, "", ze, Xe), ln(Kn, x(gn)); }, - [() => ({ color: St()[x(gn)] })] - ), _e(on, Gn); - }), _e(nt, Wt); - }, Bt = /* @__PURE__ */ Jn(() => xt(i()).length > 0); - Er(et, (nt) => { - x(Bt) && nt($t); + [() => ({ color: Tt()[x(gn)] })] + ), ve(he, _n); + }), ve(j, St); + }, He = /* @__PURE__ */ jn(() => xt(i()).length > 0); + Tr(rt, (j) => { + x(He) && j(It); }); } - var Pt = ve(et, 2); + var Xt = de(rt, 2); { - var pt = (nt) => { - var Wt = Pd(), Ut = mn(Wt), on = ve(Ut); - Ji(on, 17, () => It(i()), Ki, (gn, ft, Gn) => { - var ze = Md(), Xe = mn(ze); - let _n; - var wr = Zt(Xe, !0); - Jt(Xe); - var xr = ve(Xe, 2); + var ce = (j) => { + var St = Fd(), ct = mn(St), he = de(ct); + Zi(he, 17, () => Ft(i()), Ji, (gn, Gn, _n) => { + var et = Dd(), ze = mn(et); + let Kn; + var $r = Gt(ze, !0); + Ut(ze); + var Jn = de(ze, 2); { - var br = (Gt) => { - var Hi = fa(", "); - _e(Gt, Hi); - }, Be = /* @__PURE__ */ Jn(() => Gn < It(i()).length - 1); - Er(xr, (Gt) => { - x(Be) && Gt(br); + var Ar = (Be) => { + var zi = ca(", "); + ve(Be, zi); + }, Xe = /* @__PURE__ */ jn(() => _n < Ft(i()).length - 1); + Tr(Jn, (Be) => { + x(Xe) && Be(Ar); }); } - Zn( - (Gt) => { - _n = da(Xe, "", _n, Gt), ln(wr, x(ft)); + Qn( + (Be) => { + Kn = pa(ze, "", Kn, Be), ln($r, x(Gn)); }, - [() => ({ color: St()[x(ft)] })] - ), _e(gn, ze); - }), Zn(() => ln(Ut, `${x(c).caption ?? ""}: `)), _e(nt, Wt); - }, Ot = /* @__PURE__ */ Jn(() => It(i()).length > 0); - Er(Pt, (nt) => { - x(Ot) && nt(pt); + [() => ({ color: Tt()[x(Gn)] })] + ), ve(gn, et); + }), Qn(() => ln(ct, `${x(c).caption ?? ""}: `)), ve(j, St); + }, Bt = /* @__PURE__ */ jn(() => Ft(i()).length > 0); + Tr(Xt, (j) => { + x(Bt) && j(ce); }); } - Jt(Mt), Zn((nt) => ln(bt, `${x(P).config.contest ?? ""}, ${nt ?? ""} ${x(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [_t]), _e(w, W); + Ut(Mt), Qn((j) => ln(bt, `${x(M).config.contest ?? ""}, ${j ?? ""} ${x(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [_t]), ve(w, W); }; - Er(Kr, (w) => { - f() && w(Vi); + Tr(jr, (w) => { + f() && w(Yi); }); } - Jt(Ye); - var Bn = ve(Ye, 2), yr = Zt(Bn), Jr = Zt(yr, !0); - Jt(yr); - var Yi = ve(yr, 2); - Ji(Yi, 17, () => x($), Ki, (w, W) => { - var j = Fd(), bt = mn(j), Mt = Zt(bt, !0); - Jt(bt), is(2), Zn(() => ln(Mt, x(W))), _e(w, j); - }), Jt(Bn), li(Bn, (w) => ot(p, w), () => x(p)); - var Wn = ve(Bn, 2), Un = Zt(Wn); - return is(2), Jt(Wn), li(Wn, (w) => ot(g, w), () => x(g)), Zn( + Ut(Ve); + var Bn = de(Ve, 2), xr = Gt(Bn), br = Gt(xr, !0); + Ut(xr); + var Hi = de(xr, 2); + Zi(Hi, 17, () => x($), Ji, (w, W) => { + var Q = Od(), bt = mn(Q), Mt = Gt(bt, !0); + Ut(bt), ss(2), Qn(() => ln(Mt, x(W))), ve(w, Q); + }), Ut(Bn), ui(Bn, (w) => lt(p, w), () => x(p)); + var Wn = de(Bn, 2), Un = Gt(Wn); + return ss(2), Ut(Wn), ui(Wn, (w) => lt(g, w), () => x(g)), Qn( (w) => { - ln(Re, F[x(Xt)]), ln(Jr, x(y)), ln(Un, `"${w ?? ""}" means all the candidates ranked on `); + ln(Ae, F[x(zt)]), ln(br, x(y)), ln(Un, `"${w ?? ""}" means all the candidates ranked on `); }, [z] - ), _e(t, Z), Ss(sn); + ), ve(t, Z), Ns(an); } -Cu(["click"]); -customElements.define("pie-chart", Fo( - Ld, +Su(["click"]); +customElements.define("pie-chart", Io( + Vd, { electionSummary: {}, currentRound: {}, From 49e52dd3bff214aabf3b0913c17dcd753e6d2593 Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 25 Mar 2026 09:05:58 +0000 Subject: [PATCH 21/31] Clear stroke on zero-width slices --- static/pie/pie-chart.es.js | 244 +++++++++++++++++++------------------ 1 file changed, 123 insertions(+), 121 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index cbc9efb5..b96d487c 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -3,7 +3,7 @@ var na = (t) => { throw TypeError(t); }; var El = (t, e, n) => e in t ? Al(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var at = (t, e, n) => El(t, typeof e != "symbol" ? e + "" : e, n), Gi = (t, e, n) => e.has(t) || na("Cannot " + n); +var ot = (t, e, n) => El(t, typeof e != "symbol" ? e + "" : e, n), Gi = (t, e, n) => e.has(t) || na("Cannot " + n); var v = (t, e, n) => (Gi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? na("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), O = (t, e, n, r) => (Gi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), mt = (t, e, n) => (Gi(t, e, "access private method"), n); var Pa; typeof window < "u" && ((Pa = window.__svelte ?? (window.__svelte = {})).v ?? (Pa.v = /* @__PURE__ */ new Set())).add("5"); @@ -34,8 +34,8 @@ function Yl(t, e) { const Et = 2, Lr = 4, ki = 8, La = 1 << 24, sn = 16, xe = 32, vn = 64, qa = 128, ae = 512, wt = 1024, Rt = 2048, we = 4096, jt = 8192, en = 16384, mr = 32768, cr = 65536, ia = 1 << 17, Va = 1 << 18, zn = 1 << 19, Hl = 1 << 20, cn = 1 << 25, On = 65536, is = 1 << 21, Ts = 1 << 22, hn = 1 << 23, Fr = Symbol("$state"), Ya = Symbol("legacy props"), xn = new class extends Error { constructor() { super(...arguments); - at(this, "name", "StaleReactionError"); - at(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + ot(this, "name", "StaleReactionError"); + ot(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } }(), Kr = 3, yr = 8; function zl(t) { @@ -245,19 +245,19 @@ var nr, rr, Rn, ir, Xr, Br, Cn, Ke, sr, Ie, os, ls, Ja; const Us = class Us { constructor() { q(this, Ie); - at(this, "committed", !1); + ot(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} */ - at(this, "current", /* @__PURE__ */ new Map()); + ot(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} */ - at(this, "previous", /* @__PURE__ */ new Map()); + ot(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 @@ -301,7 +301,7 @@ const Us = class Us { * @type {Map} */ q(this, Ke, /* @__PURE__ */ new Map()); - at(this, "is_fork", !1); + ot(this, "is_fork", !1); q(this, sr, !1); } is_deferred() { @@ -635,8 +635,8 @@ class cu { constructor(e, n, r) { q(this, dt); /** @type {Boundary | null} */ - at(this, "parent"); - at(this, "is_pending", !1); + ot(this, "parent"); + ot(this, "is_pending", !1); /** @type {TemplateNode} */ q(this, Jt); /** @type {TemplateNode | null} */ @@ -2070,7 +2070,7 @@ class Ou { */ constructor(e, n = !0) { /** @type {TemplateNode} */ - at(this, "anchor"); + ot(this, "anchor"); /** @type {Map} */ q(this, ge, /* @__PURE__ */ new Map()); /** @@ -2304,8 +2304,8 @@ function Zi(t, e, n, r, i, s = null) { } if (y === 0 && s && !l && (d ? l = se(() => s(a)) : (l = se(() => s(ha ?? (ha = le()))), l.f |= cn)), y > N.size && Bl(), J && y > 0 && Ht(mi()), !d) if (P) { - for (const [st, tt] of o) - N.has(st) || C.skip_effect(tt.e); + for (const [at, et] of o) + N.has(at) || C.skip_effect(et.e); C.oncommit(c), C.ondiscard(() => { }); } else @@ -2325,8 +2325,8 @@ function Vu(t, e, n, r, i) { for (y = 0; y < s; y += 1) { if (c = e[y], p = i(c, y), g = /** @type {EachItem} */ a.get(p).e, t.outrogroups !== null) - for (const st of t.outrogroups) - st.pending.delete(g), st.done.delete(g); + for (const at of t.outrogroups) + at.pending.delete(g), at.done.delete(g); if ((g.f & cn) !== 0) if (g.f ^= cn, g === o) kr(g, null, n); @@ -2358,8 +2358,8 @@ function Vu(t, e, n, r, i) { (g.f & cn) === 0 && f.push(g), u = g, o = Sr(g.next); } if (t.outrogroups !== null) { - for (const st of t.outrogroups) - st.pending.size === 0 && (gs(Ni(st.done)), (K = t.outrogroups) == null || K.delete(st)); + for (const at of t.outrogroups) + at.pending.size === 0 && (gs(Ni(at.done)), (K = t.outrogroups) == null || K.delete(at)); t.outrogroups.size === 0 && (t.outrogroups = null); } if (o !== null || l !== void 0) { @@ -2629,27 +2629,27 @@ typeof HTMLElement == "function" && (Fo = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - at(this, "$$ctor"); + ot(this, "$$ctor"); /** Slots */ - at(this, "$$s"); + ot(this, "$$s"); /** @type {any} The Svelte component instance */ - at(this, "$$c"); + ot(this, "$$c"); /** Whether or not the custom element is connected */ - at(this, "$$cn", !1); + ot(this, "$$cn", !1); /** @type {Record} Component props data */ - at(this, "$$d", {}); + ot(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - at(this, "$$r", !1); + ot(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - at(this, "$$p_d", {}); + ot(this, "$$p_d", {}); /** @type {Record} Event listeners */ - at(this, "$$l", {}); + ot(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - at(this, "$$l_u", /* @__PURE__ */ new Map()); + ot(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - at(this, "$$me"); + ot(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - at(this, "$$shadowRoot", null); + ot(this, "$$shadowRoot", null); this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** @@ -3462,7 +3462,7 @@ te.prototype = wr.prototype = { dispatch: Rc, [Symbol.iterator]: Cc }; -function ot(t) { +function st(t) { return typeof t == "string" ? new te([[document.querySelector(t)]], [document.documentElement]) : new te([[t]], Ko); } function Hs(t, e, n) { @@ -4614,14 +4614,14 @@ function Rd(t, e, n, r, i, s, a, o) { return c = (f * (e - s) - d * (t - i)) / c, [t + c * l, e + c * u]; } function si(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / tr(o * o + l * l), f = u * l, d = -u * o, c = t + f, p = e + d, g = n + f, y = r + d, $ = (c + g) / 2, E = (p + y) / 2, N = g - c, C = y - p, P = N * N + C * C, M = i - s, G = c * y - g * p, ft = (C < 0 ? -1 : 1) * tr(md(0, M * M * P - G * G)), K = (G * C - N * ft) / P, st = (-G * N - C * ft) / P, tt = (G * C + N * ft) / P, gt = (-G * N + C * ft) / P, _t = K - $, F = st - E, I = tt - $, zt = gt - E; - return _t * _t + F * F > I * I + zt * zt && (K = tt, st = gt), { + var o = t - n, l = e - r, u = (a ? s : -s) / tr(o * o + l * l), f = u * l, d = -u * o, c = t + f, p = e + d, g = n + f, y = r + d, $ = (c + g) / 2, E = (p + y) / 2, N = g - c, C = y - p, P = N * N + C * C, M = i - s, G = c * y - g * p, ft = (C < 0 ? -1 : 1) * tr(md(0, M * M * P - G * G)), K = (G * C - N * ft) / P, at = (-G * N - C * ft) / P, et = (G * C + N * ft) / P, gt = (-G * N + C * ft) / P, _t = K - $, F = at - E, I = et - $, zt = gt - E; + return _t * _t + F * F > I * I + zt * zt && (K = et, at = gt), { cx: K, - cy: st, + cy: at, x01: -f, y01: -d, x11: K * (i / M - 1), - y11: st * (i / M - 1) + y11: at * (i / M - 1) }; } function Te() { @@ -4632,22 +4632,22 @@ function Te() { else if ($ > vi - Ot) o.moveTo(p * yn(g), p * Ce(g)), o.arc(0, 0, p, g, y, !E), c > Ot && (o.moveTo(c * yn(y), c * Ce(y)), o.arc(0, 0, c, y, g, E)); else { - var N = g, C = y, P = g, M = y, G = $, ft = $, K = a.apply(this, arguments) / 2, st = K > Ot && (r ? +r.apply(this, arguments) : tr(c * c + p * p)), tt = es(ka(p - c) / 2, +n.apply(this, arguments)), gt = tt, _t = tt, F, I; - if (st > Ot) { - var zt = Ma(st / c * Ce(K)), ee = Ma(st / p * Ce(K)); + var N = g, C = y, P = g, M = y, G = $, ft = $, K = a.apply(this, arguments) / 2, at = K > Ot && (r ? +r.apply(this, arguments) : tr(c * c + p * p)), et = es(ka(p - c) / 2, +n.apply(this, arguments)), gt = et, _t = et, F, I; + if (at > Ot) { + var zt = Ma(at / c * Ce(K)), ee = Ma(at / p * Ce(K)); (G -= zt * 2) > Ot ? (zt *= E ? 1 : -1, P += zt, M -= zt) : (G = 0, P = M = (g + y) / 2), (ft -= ee * 2) > Ot ? (ee *= E ? 1 : -1, N += ee, C -= ee) : (ft = 0, N = C = (g + y) / 2); } var xt = p * yn(N), Ft = p * Ce(N), Ct = c * yn(M), fe = c * Ce(M); - if (tt > Ot) { + if (et > Ot) { var z = p * yn(C), Tt = p * Ce(C), an = c * yn(P), Z = c * Ce(P), kt; if ($ < zr) if (kt = Rd(xt, Ft, an, Z, z, Tt, Ct, fe)) { var $e = xt - kt[0], Ae = Ft - kt[1], Ve = z - kt[0], pt = Tt - kt[1], Ye = 1 / Ce(yd(($e * Ve + Ae * pt) / (tr($e * $e + Ae * Ae) * tr(Ve * Ve + pt * pt))) / 2), on = tr(kt[0] * kt[0] + kt[1] * kt[1]); - gt = es(tt, (c - on) / (Ye - 1)), _t = es(tt, (p - on) / (Ye + 1)); + gt = es(et, (c - on) / (Ye - 1)), _t = es(et, (p - on) / (Ye + 1)); } else gt = _t = 0; } - ft > Ot ? _t > Ot ? (F = si(an, Z, xt, Ft, p, _t, E), I = si(z, Tt, Ct, fe, p, _t, E), o.moveTo(F.cx + F.x01, F.cy + F.y01), _t < tt ? o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !E) : (o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !E), o.arc(0, 0, p, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), !E), o.arc(I.cx, I.cy, _t, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !E))) : (o.moveTo(xt, Ft), o.arc(0, 0, p, N, C, !E)) : o.moveTo(xt, Ft), !(c > Ot) || !(G > Ot) ? o.lineTo(Ct, fe) : gt > Ot ? (F = si(Ct, fe, z, Tt, c, -gt, E), I = si(xt, Ft, an, Z, c, -gt, E), o.lineTo(F.cx + F.x01, F.cy + F.y01), gt < tt ? o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !E) : (o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !E), o.arc(0, 0, c, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), E), o.arc(I.cx, I.cy, gt, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !E))) : o.arc(0, 0, c, M, P, E); + ft > Ot ? _t > Ot ? (F = si(an, Z, xt, Ft, p, _t, E), I = si(z, Tt, Ct, fe, p, _t, E), o.moveTo(F.cx + F.x01, F.cy + F.y01), _t < et ? o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !E) : (o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !E), o.arc(0, 0, p, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), !E), o.arc(I.cx, I.cy, _t, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !E))) : (o.moveTo(xt, Ft), o.arc(0, 0, p, N, C, !E)) : o.moveTo(xt, Ft), !(c > Ot) || !(G > Ot) ? o.lineTo(Ct, fe) : gt > Ot ? (F = si(Ct, fe, z, Tt, c, -gt, E), I = si(xt, Ft, an, Z, c, -gt, E), o.lineTo(F.cx + F.x01, F.cy + F.y01), gt < et ? o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !E) : (o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !E), o.arc(0, 0, c, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), E), o.arc(I.cx, I.cy, gt, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !E))) : o.arc(0, 0, c, M, P, E); } if (o.closePath(), f) return o = null, f + "" || null; } @@ -4771,7 +4771,7 @@ function fl(t, e) { function p(h) { return h.isTransfer ? `${h.label}__transfer` : h.transferIndex != null ? `${h.label}__${h.transferIndex}` : h.label; } - const g = 800, y = 800, $ = Math.min(g, y) * 0.3, E = g / 2, N = y / 2, C = "Pie", P = "PieOutline", M = "Donut", G = "TextLayer", ft = "url(#cross-hatch)", K = 1.15, st = 0.1, tt = 750, gt = 800, _t = "white", F = 1, I = "#ff00ff", zt = 3; + const g = 800, y = 800, $ = Math.min(g, y) * 0.3, E = g / 2, N = y / 2, C = "Pie", P = "PieOutline", M = "Donut", G = "TextLayer", ft = "url(#cross-hatch)", K = 1.15, at = 0.1, et = 750, gt = 800, _t = "white", F = 1, I = "#ff00ff", zt = 3; function ee(h) { return "hatch-" + h.replace(/[^a-zA-Z0-9]/g, "-"); } @@ -4779,11 +4779,11 @@ function fl(t, e) { const Tt = {}, an = "No Further Rankings"; let Z = /* @__PURE__ */ yt(null); function kt() { - const h = ot(x(Z)); + const h = st(x(Z)); h.select("#" + C).remove(), h.select("#" + P).remove(), h.select("#" + M).remove(), h.select("#" + G).remove(); } function $e(h) { - l() && (et = h, l()(h)); + l() && (nt = h, l()(h)); } function Ae(h) { kt(), Ct = Ve(h), xt = Ks(h, C, Ct, E, N, 0, pt()), Ks(h, P, Ct, E, N, 0, pt(), !1, !1, !0), Rr(); @@ -4883,22 +4883,22 @@ function fl(t, e) { return 0; return A; } - function Q(h, _) { + function tt(h, _) { h.some((m) => br(m.label)) || h.push({ label: "exhausted", value: on(_) }); } function bt(h) { const _ = []; for (let [m, A] of Object.entries(n().results[h - 1].tally)) _.push({ label: m, value: Number(A) }); - return Q(_, h), _; + return tt(_, h), _; } function Mt(h) { const _ = n().results[Math.max(0, h - 2)].tally, m = n().results[h - 1].tally, A = []; for (let [b] of Object.entries(_)) A.push({ label: b, value: Number(m[b] ?? 0) }); - return Q(A, h), A; + return tt(A, h), A; } - function rt(h, _) { + function it(h, _) { const m = []; for (const A of h) { if (A.label === "exhausted" || A.isTransfer) { @@ -4915,7 +4915,7 @@ function fl(t, e) { return m; } function It() { - const h = ot(x(Z)).select("defs").select("#cross-hatch"); + const h = st(x(Z)).select("defs").select("#cross-hatch"); let _ = 0; for (let [m, A] of Object.entries(n().results[0].tally)) { !u() || u().length === 0 ? _ < 10 ? Tt[m] = _d[_] : Tt[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Tt[m] = u()[_ % u().length], _++; @@ -4927,12 +4927,12 @@ function fl(t, e) { Tt.exhausted = ft, Tt["Inactive Ballots"] = ft; } function He() { - ot(x(Z)).select("#" + M).remove(); + st(x(Z)).select("#" + M).remove(); } function Xt(h, _) { const m = pi("global").duration(gt); _ && m.on("end", _); - const A = rt(Ct, h), T = ns().sort(null).value((D) => D.value)(A); + const A = it(Ct, h), T = ns().sort(null).value((D) => D.value)(A); Qs(h, C, T, 0, pt()), Qs(h, P, T, 0, pt(), !0), Ct = A, xt = T, He(), Be(h), gl(), ml(0, pt()), Rr(); } function ce(h, _) { @@ -4949,14 +4949,14 @@ function fl(t, e) { } function he() { if (St.length === 0) { - et !== r() && (r() === et + 1 && et > 0 && r() <= n().results.length ? (et = r(), gn(r())) : r() >= 1 && r() <= n().results.length && (et = r(), c(0), Ae(r()))); + nt !== r() && (r() === nt + 1 && nt > 0 && r() <= n().results.length ? (nt = r(), gn(r())) : r() >= 1 && r() <= n().results.length && (nt = r(), c(0), Ae(r()))); return; } const h = St.shift(); switch (h.type) { case "round": { const _ = h.round; - _ === et + 1 && et > 0 && _ <= n().results.length ? (et = _, gn(_)) : (_ !== et && _ >= 1 && _ <= n().results.length && (et = _, c(0), Ae(_)), he()); + _ === nt + 1 && nt > 0 && _ <= n().results.length ? (nt = _, gn(_)) : (_ !== nt && _ >= 1 && _ <= n().results.length && (nt = _, c(0), Ae(_)), he()); break; } case "step": @@ -4996,14 +4996,14 @@ function fl(t, e) { Fs(() => { ze(); }); - let et = 0; + let nt = 0; function ze() { - if (et != r()) { + if (nt != r()) { if (j) { St.push({ type: "round", round: r() }); return; } - et == r() - 1 && et > 0 ? $r() : Kn(r()), et = r(); + nt == r() - 1 && nt > 0 ? $r() : Kn(r()), nt = r(); } } function Kn(h) { @@ -5046,10 +5046,10 @@ function fl(t, e) { j = !0, c((c() + 1) % 3), z = r(), c() === 1 ? Xt(z, ct) : c() === 2 ? ce(z, ct) : c() === 0 ? (z++, $e(z), Bt(z, ct)) : (j = !1, console.warn("displayPhase out of range at ", c())); } function Ar(h) { - Ct = Mt(h), xt = Zs(h, C, Ct, 0, pt(), !0), Zs(h, P, Ct, 0, pt(), !1, !0), ot(x(Z)).select("#" + P).selectAll(".eliminated").remove(); + Ct = Mt(h), xt = Zs(h, C, Ct, 0, pt(), !0), Zs(h, P, Ct, 0, pt(), !1, !0), st(x(Z)).select("#" + P).selectAll(".eliminated").remove(); } function Xe(h, _) { - const m = ot(x(Z)).select("#" + M), b = ot(x(Z)).select("#" + C), T = {}; + const m = st(x(Z)).select("#" + M), b = st(x(Z)).select("#" + C), T = {}; for (const S of xt) { const k = S.data.label; if (S.data.isTransfer) continue; @@ -5066,24 +5066,24 @@ function fl(t, e) { function L() { V--, V === 0 && _l(); } - D.select("path").transition("global").duration(tt).attrTween("d", function(S) { + D.select("path").transition("global").duration(et).attrTween("d", function(S) { const k = S.startAngle, R = S.endAngle, X = R - k, Wt = T[S.data.label]; - let it, Ee; + let Q, Ee; if (Wt) { const Zn = (Wt.oldStart + Wt.oldEnd) / 2, bl = (Wt.newStart + Wt.newEnd) / 2, $l = k - Zn; - it = bl + $l, Ee = it + X; + Q = bl + $l, Ee = Q + X; } else - it = k, Ee = R; - const nt = Ge(k, it), Re = Ge(R, Ee), We = Ge(_, h), Cr = Te(); + Q = k, Ee = R; + const rt = Ge(k, Q), Re = Ge(R, Ee), We = Ge(_, h), Cr = Te(); return function(Zn) { - return Cr.innerRadius(Math.min(We(Zn), h) - 1).outerRadius(We(Zn)).startAngle(nt(Zn)).endAngle(Re(Zn)), Cr(S); + return Cr.innerRadius(Math.min(We(Zn), h) - 1).outerRadius(We(Zn)).startAngle(rt(Zn)).endAngle(Re(Zn)), Cr(S); }; }).on("end", (S) => L()); } function Be(h) { const _ = hl(h, xt); Ft = Js(h, M, _, E, N, pt(), Ye(), !1, !0); - const m = ot(x(Z)); + const m = st(x(Z)); m.select("#" + C).raise(), m.select("#" + P).raise(); } function zi(h) { @@ -5134,7 +5134,7 @@ function fl(t, e) { } for (let [k, R] of Object.entries(V)) { let X; - const Wt = _.find((nt) => nt.data.label == k); + const Wt = _.find((rt) => rt.data.label == k); if (Wt) X = structuredClone(Wt); else if (k == "exhausted") @@ -5190,10 +5190,10 @@ function fl(t, e) { return A; } function Gs(h, _, m, A, b, T) { - const V = ot(x(Z)).append("g").attr("id", G).attr("transform", `translate(${m}, ${A})`), L = Te().innerRadius(b * K).outerRadius(b * K); + const V = st(x(Z)).append("g").attr("id", G).attr("transform", `translate(${m}, ${A})`), L = Te().innerRadius(b * K).outerRadius(b * K); V.selectAll("text").data(_).enter().each(function(S) { - S.endAngle - S.startAngle < st || S.data.isTransfer || ot(this).append("g").attr("id", (k) => p(k.data)).classed("eliminated", (k) => T.includes(k.data.label) || k.data.isTransfer === !0).each(function(k, R) { - k.data.label === "exhausted" && ot(this).on("mouseenter", (X, Wt) => yl(X)).on("mouseleave", (X, Wt) => wl()); + S.endAngle - S.startAngle < at || S.data.isTransfer || st(this).append("g").attr("id", (k) => p(k.data)).classed("eliminated", (k) => T.includes(k.data.label) || k.data.isTransfer === !0).each(function(k, R) { + k.data.label === "exhausted" && st(this).on("mouseenter", (X, Wt) => yl(X)).on("mouseleave", (X, Wt) => wl()); }).append("text").attr("transform", (k) => `translate(${L.centroid(k)})`).attr("text-anchor", (k) => Xi(k.startAngle, k.endAngle)).text((k) => k.data.label === "exhausted" ? an : k.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((k) => { const R = Yi(k.data.label, h); return !d() && br(k.data.label) ? R : R + " (" + Bn(k.data.label, h) + ")"; @@ -5201,8 +5201,8 @@ function fl(t, e) { }); } function vl(h, _, m, A) { - const T = ot(x(Z)).select("#" + G), D = T.selectAll("tspan"), V = T.selectAll("g").data(_, (R) => p(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), L = Te().innerRadius(m * K).outerRadius(m * K + 1); - D.transition("global").duration(tt).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => Xi(R.startAngle, R.endAngle)), V.select("text").transition("global").duration(tt).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => Xi(R.startAngle, R.endAngle)).on("end", (R) => k()); + const T = st(x(Z)).select("#" + G), D = T.selectAll("tspan"), V = T.selectAll("g").data(_, (R) => p(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), L = Te().innerRadius(m * K).outerRadius(m * K + 1); + D.transition("global").duration(et).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => Xi(R.startAngle, R.endAngle)), V.select("text").transition("global").duration(et).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => Xi(R.startAngle, R.endAngle)).on("end", (R) => k()); let S = V.size(); function k(R) { S--, S === 0 && (T.remove(), Gs(h, _, E, N, m, A)); @@ -5213,37 +5213,37 @@ function fl(t, e) { return Js(h, _, R, A, b, T, D, V, L, S), R; } function Rr() { - ot(x(Z)).select("#" + P).selectAll(".elected").select("path").style("stroke", I).style("stroke-width", `${zt}px`); + st(x(Z)).select("#" + P).selectAll(".elected").select("path").style("stroke", I).style("stroke-width", `${zt}px`); } function Js(h, _, m, A, b, T, D, V, L, S = !1) { - const k = Un(h), R = w(h), it = ot(x(Z)).attr("viewBox", `0 0 ${g} ${y}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${A}, ${b})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (nt) => k.includes(nt.data.label) || nt.data.isTransfer === !0).classed("elected", (nt) => R.includes(nt.data.label) && !nt.data.isTransfer).attr("id", (nt) => p(nt.data)); - S ? it.style("pointer-events", "none") : it.on("mouseenter", (nt, Re) => Wi(nt, Re)).on("mouseleave", (nt, Re) => Ui(nt, Re)); + const k = Un(h), R = w(h), Q = st(x(Z)).attr("viewBox", `0 0 ${g} ${y}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${A}, ${b})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (rt) => k.includes(rt.data.label) || rt.data.isTransfer === !0).classed("elected", (rt) => R.includes(rt.data.label) && !rt.data.isTransfer).attr("id", (rt) => p(rt.data)); + S ? Q.style("pointer-events", "none") : Q.on("mouseenter", (rt, Re) => Wi(rt, Re)).on("mouseleave", (rt, Re) => Ui(rt, Re)); const Ee = Te().outerRadius(D).innerRadius(T); if (L) { - const nt = Te().outerRadius(T + 1).innerRadius(T), Re = it.append("path").attr("d", nt).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F).attr("fill", "none").transition("global").duration(tt).attr("d", (We) => Ee(We)).on("end", (We) => { + const rt = Te().outerRadius(T + 1).innerRadius(T), Re = Q.append("path").attr("d", rt).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F).attr("fill", "none").transition("global").duration(et).attr("d", (We) => Ee(We)).on("end", (We) => { S || Bi(); }); S ? Re.attr("fill", "none") : Re.attr("fill", (We) => Er(We)); } else - it.append("path").attr("d", (nt) => Ee(nt)).attr("fill", S ? "none" : (nt) => Er(nt)).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F), S || Bi(); + Q.append("path").attr("d", (rt) => Ee(rt)).attr("fill", S ? "none" : (rt) => Er(rt)).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F), S || Bi(); return V && !S && Gs(h, m, A, b, D, k), m; } function gl() { - const m = ot(x(Z)).select("#" + G).selectAll(".eliminated"); + const m = st(x(Z)).select("#" + G).selectAll(".eliminated"); m.size() > 0 && m.classed("finished", !0); } function _l() { - const m = ot(x(Z)).select("#" + G).selectAll(".finished"); + const m = st(x(Z)).select("#" + G).selectAll(".finished"); m.size() > 0 && m.remove(); } function ml(h, _) { - const b = ot(x(Z)).select("#" + C).selectAll(".eliminated"), T = Te().innerRadius(h), D = Te().outerRadius(_); - b.classed("finished", !0).select("path").transition("global").duration(tt).attrTween("d", function(V) { + const b = st(x(Z)).select("#" + C).selectAll(".eliminated"), T = Te().innerRadius(h), D = Te().outerRadius(_); + b.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(et).attrTween("d", function(V) { const L = Ge(_, h); return function(S) { return D.innerRadius(L(S)), D(V); }; - }).attr("fill", (V) => `url(#${ee(V.data.label)})`), b.clone(!0).classed("finished", !0).select("path").transition("global").duration(tt).attrTween("d", function(V) { + }).attr("fill", (V) => `url(#${ee(V.data.label)})`), b.clone(!0).classed("finished", !0).select("path").transition("global").duration(et).attrTween("d", function(V) { const L = Ge(_, h); return function(S) { return T.outerRadius(L(S)), T(V); @@ -5255,7 +5255,7 @@ function fl(t, e) { 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 Bi() { - ot(x( + st(x( Z // force redisplay of text labels )).select("#" + G).raise().append("g").remove(); @@ -5265,7 +5265,7 @@ function fl(t, e) { return ta(h, _, L, A, b, T, D), L; } function js(h, _, m, A, b = !1) { - const T = Un(h), D = w(h), S = ot(x(Z)).select("#" + _).selectAll(".slice").data(m, (R) => p(R.data)), k = S.enter().append("g").attr("class", "slice").attr("id", (R) => p(R.data)).classed("eliminated", !0); + const T = Un(h), D = w(h), S = st(x(Z)).select("#" + _).selectAll(".slice").data(m, (R) => p(R.data)), k = S.enter().append("g").attr("class", "slice").attr("id", (R) => p(R.data)).classed("eliminated", !0); return b ? k.style("pointer-events", "none") : k.on("mouseenter", (R, X) => Wi(R, X)).on("mouseleave", (R, X) => Ui(R, X)), k.append("path").attr("d", (R) => A(R)).attr("fill", b ? "none" : (R) => Er(R)).attr("stroke", b ? "none" : _t).attr("stroke-width", b ? 0 : F), S.classed("eliminated", (R) => T.includes(R.data.label)).classed("elected", (R) => D.includes(R.data.label)), b || S.on("mouseenter", (R, X) => Wi(R, X)).on("mouseleave", (R, X) => Ui(R, X)), S; } function Qs(h, _, m, A, b, T = !1) { @@ -5273,17 +5273,19 @@ function fl(t, e) { js(h, _, m, D, T).select("path").attr("d", (L) => D(L)).attr("fill", T ? "none" : (L) => Er(L)); } function ta(h, _, m, A, b, T, D = !1) { - const V = Te().outerRadius(b).innerRadius(A).startAngle((it) => it.startAngle).endAngle((it) => it.endAngle), L = Te().outerRadius(b).innerRadius(A), k = ot(x(Z)).select("#" + _); - k.selectAll(".slice").attr("prevStart", (it) => it.startAngle).attr("prevEnd", (it) => it.endAngle); + const V = Te().outerRadius(b).innerRadius(A).startAngle((Q) => Q.startAngle).endAngle((Q) => Q.endAngle), L = Te().outerRadius(b).innerRadius(A), k = st(x(Z)).select("#" + _); + k.selectAll(".slice").attr("prevStart", (Q) => Q.startAngle).attr("prevEnd", (Q) => Q.endAngle); const R = js(h, _, m, L, D); let X = R.size(); function Wt() { X--, X <= 0 && (D || Bi(), k.selectAll(".finished").remove()); } - return R.select("path").transition("global").duration(tt).attrTween("d", function(it) { - const Ee = Number(ot(this.parentNode).attr("prevStart")), nt = Number(ot(this.parentNode).attr("prevEnd")), Re = Ge(Ee, it.startAngle), We = Ge(nt, it.endAngle); - return (Cr) => (V.startAngle(Re(Cr)).endAngle(We(Cr)), V(it)); - }).on("end", Wt), T && !D && vl(h, m, b, Un(h)), m; + return R.select("path").transition("global").duration(et).attrTween("d", function(Q) { + const Ee = Number(st(this.parentNode).attr("prevStart")), rt = Number(st(this.parentNode).attr("prevEnd")), Re = Ge(Ee, Q.startAngle), We = Ge(rt, Q.endAngle); + return (Cr) => (V.startAngle(Re(Cr)).endAngle(We(Cr)), V(Q)); + }).on("end", function(Q) { + Q.startAngle === Q.endAngle && st(this).attr("stroke", "none"), Wt(); + }), T && !D && vl(h, m, b, Un(h)), m; } function Wi(h, _) { s(_.data.label), i("enter"), a(h.clientX), o(h.clientY); @@ -5454,14 +5456,14 @@ function Vd(t, e) { function ft(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function K(w, W, Q) { - w.style.left = W + "px", w.style.top = Q + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const rt = w.getBoundingClientRect(); - let It = W, He = Q + 20; - It + rt.width > window.innerWidth - 12 && (It = window.innerWidth - rt.width - 12), It < 12 && (It = 12), He + rt.height > window.innerHeight - 12 && (He = Q - rt.height - 12), w.style.left = It + "px", w.style.top = He + "px"; + function K(w, W, tt) { + w.style.left = W + "px", w.style.top = tt + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const it = w.getBoundingClientRect(); + let It = W, He = tt + 20; + It + it.width > window.innerWidth - 12 && (It = window.innerWidth - it.width - 12), It < 12 && (It = 12), He + it.height > window.innerHeight - 12 && (He = tt - it.height - 12), w.style.left = It + "px", w.style.top = He + "px"; }); } - function st() { + function at() { switch (x(E)) { case "enter": ((w) => { @@ -5483,42 +5485,42 @@ function Vd(t, e) { break; } } - Fs(() => st()); - function tt(w, W) { + Fs(() => at()); + function et(w, W) { return w === 1 ? W ? "vote was" : "vote will be" : W ? "votes were" : "votes will be"; } function gt(w, W) { - const Q = [], bt = w === "exhausted" ? z() : w; + const tt = [], bt = w === "exhausted" ? z() : w; let Mt; - w === "exhausted" ? Mt = Ct(1) : Mt = x(M).results[0].tally[w], Q.push(`${bt} started with ${Mt} votes.`); - for (let rt = 1; rt <= W; rt++) { - rt === W && (w === "exhausted" ? Mt = Ct(W) : Mt = x(M).results[W - 1].tally[w], Q.push(`${bt} has ${Mt} votes at round ${W}.`)); - const It = x(M).results[rt - 1].tallyResults, He = ee(rt); + w === "exhausted" ? Mt = Ct(1) : Mt = x(M).results[0].tally[w], tt.push(`${bt} started with ${Mt} votes.`); + for (let it = 1; it <= W; it++) { + it === W && (w === "exhausted" ? Mt = Ct(W) : Mt = x(M).results[W - 1].tally[w], tt.push(`${bt} has ${Mt} votes at round ${W}.`)); + const It = x(M).results[it - 1].tallyResults, He = ee(it); for (let Xt = 0; Xt < It.length; Xt++) { const ce = It[Xt].transfers, Bt = It[Xt].eliminated, j = It[Xt].elected; if (!He) { if (Bt) - Bt === w && Q.push(`${bt} will be eliminated on round ${rt}.`); - else if (w === j && (Q.push(`${bt} ${x(c).event} on round ${rt}.`), ce)) + Bt === w && tt.push(`${bt} will be eliminated on round ${it}.`); + else if (w === j && (tt.push(`${bt} ${x(c).event} on round ${it}.`), ce)) for (let [ct, he] of Object.entries(ce)) - Q.push(`${he} ${tt(Number(he), rt < W)} transferred to ${ct} on round ${rt}.`); + tt.push(`${he} ${et(Number(he), it < W)} transferred to ${ct} on round ${it}.`); } const St = Bt || j; if (St) { const ct = Number(ce[w]); - ct && Q.push(`${ct} ${tt(ct, rt < W)} transferred from ${St} on round ${rt}.`); + ct && tt.push(`${ct} ${et(ct, it < W)} transferred from ${St} on round ${it}.`); } } } - return [Q, bt]; + return [tt, bt]; } function _t() { let w = 0; for (let W = 1; W <= x(M).results.length; W++) { if (ee(W)) continue; - const Q = x(M).results[W - 1].tallyResults; - for (let bt = 0; bt < Q.length; bt++) - Q[bt].elected && w++; + const tt = x(M).results[W - 1].tallyResults; + for (let bt = 0; bt < tt.length; bt++) + tt[bt].elected && w++; } return w; } @@ -5655,18 +5657,18 @@ function Vd(t, e) { var jr = de(pt, 2); { var Yi = (w) => { - var W = Id(), Q = mn(W), bt = Gt(Q); - Ut(Q); - var Mt = de(Q, 2), rt = Gt(Mt); + var W = Id(), tt = mn(W), bt = Gt(tt); + Ut(tt); + var Mt = de(tt, 2), it = Gt(Mt); { var It = (j) => { var St = Pd(), ct = de(mn(St)); Zi(ct, 17, () => xt(i()), Ji, (he, gn, Gn) => { - var _n = Md(), et = mn(_n); + var _n = Md(), nt = mn(_n); let ze; - var Kn = Gt(et, !0); - Ut(et); - var $r = de(et, 2); + var Kn = Gt(nt, !0); + Ut(nt); + var $r = de(nt, 2); { var Jn = (Xe) => { var Be = ca(", "); @@ -5678,22 +5680,22 @@ function Vd(t, e) { } Qn( (Xe) => { - ze = pa(et, "", ze, Xe), ln(Kn, x(gn)); + ze = pa(nt, "", ze, Xe), ln(Kn, x(gn)); }, [() => ({ color: Tt()[x(gn)] })] ), ve(he, _n); }), ve(j, St); }, He = /* @__PURE__ */ jn(() => xt(i()).length > 0); - Tr(rt, (j) => { + Tr(it, (j) => { x(He) && j(It); }); } - var Xt = de(rt, 2); + var Xt = de(it, 2); { var ce = (j) => { var St = Fd(), ct = mn(St), he = de(ct); Zi(he, 17, () => Ft(i()), Ji, (gn, Gn, _n) => { - var et = Dd(), ze = mn(et); + var nt = Dd(), ze = mn(nt); let Kn; var $r = Gt(ze, !0); Ut(ze); @@ -5712,7 +5714,7 @@ function Vd(t, e) { Kn = pa(ze, "", Kn, Be), ln($r, x(Gn)); }, [() => ({ color: Tt()[x(Gn)] })] - ), ve(gn, et); + ), ve(gn, nt); }), Qn(() => ln(ct, `${x(c).caption ?? ""}: `)), ve(j, St); }, Bt = /* @__PURE__ */ jn(() => Ft(i()).length > 0); Tr(Xt, (j) => { @@ -5730,8 +5732,8 @@ function Vd(t, e) { Ut(xr); var Hi = de(xr, 2); Zi(Hi, 17, () => x($), Ji, (w, W) => { - var Q = Od(), bt = mn(Q), Mt = Gt(bt, !0); - Ut(bt), ss(2), Qn(() => ln(Mt, x(W))), ve(w, Q); + var tt = Od(), bt = mn(tt), Mt = Gt(bt, !0); + Ut(bt), ss(2), Qn(() => ln(Mt, x(W))), ve(w, tt); }), Ut(Bn), ui(Bn, (w) => lt(p, w), () => x(p)); var Wn = de(Bn, 2), Un = Gt(Wn); return ss(2), Ut(Wn), ui(Wn, (w) => lt(g, w), () => x(g)), Qn( From 8aa7d3e47b0bc4af0e81b7306ef3d459a031deac Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 25 Mar 2026 23:07:28 +0000 Subject: [PATCH 22/31] Add phase stepper for pie chart animation --- static/pie/pie-chart.es.js | 6493 +++++++++++++++++++----------------- 1 file changed, 3344 insertions(+), 3149 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index b96d487c..be395c59 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,298 +1,300 @@ -var Al = Object.defineProperty; -var na = (t) => { - throw TypeError(t); +var Po = Object.defineProperty; +var sa = (e) => { + throw TypeError(e); }; -var El = (t, e, n) => e in t ? Al(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var ot = (t, e, n) => El(t, typeof e != "symbol" ? e + "" : e, n), Gi = (t, e, n) => e.has(t) || na("Cannot " + n); -var v = (t, e, n) => (Gi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), q = (t, e, n) => e.has(t) ? na("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), O = (t, e, n, r) => (Gi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), mt = (t, e, n) => (Gi(t, e, "access private method"), n); -var Pa; -typeof window < "u" && ((Pa = window.__svelte ?? (window.__svelte = {})).v ?? (Pa.v = /* @__PURE__ */ new Set())).add("5"); -const Rl = 1, Cl = 2, Tl = 16, Sl = 1, Nl = 4, kl = 8, Ml = 16, Pl = 2, Rs = "[", Si = "[!", Cs = "]", ur = {}, $t = Symbol(), Dl = "http://www.w3.org/1999/xhtml", rs = !1; -var Ia = Array.isArray, Fl = Array.prototype.indexOf, fr = Array.prototype.includes, Ni = Array.from, gi = Object.keys, _i = Object.defineProperty, Mn = Object.getOwnPropertyDescriptor, Il = Object.prototype, Ol = Array.prototype, Ll = Object.getPrototypeOf, ra = Object.isExtensible; -const ql = () => { +var Do = (e, t, n) => t in e ? Po(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var pe = (e, t, n) => Do(e, typeof t != "symbol" ? t + "" : t, n), Qi = (e, t, n) => t.has(e) || sa("Cannot " + n); +var v = (e, t, n) => (Qi(e, t, "read from private field"), n ? n.call(e) : t.get(e)), L = (e, t, n) => t.has(e) ? sa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), F = (e, t, n, r) => (Qi(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), be = (e, t, n) => (Qi(e, t, "access private method"), n); +var qa; +typeof window < "u" && ((qa = window.__svelte ?? (window.__svelte = {})).v ?? (qa.v = /* @__PURE__ */ new Set())).add("5"); +const Io = 1, Fo = 2, za = 4, Oo = 8, Lo = 16, qo = 1, Vo = 4, Ho = 8, Yo = 16, zo = 1, Xo = 2, Ss = "[", Mi = "[!", Ns = "]", fr = {}, Te = Symbol(), Xa = "http://www.w3.org/1999/xhtml", as = !1; +var Ba = Array.isArray, Bo = Array.prototype.indexOf, cr = Array.prototype.includes, Pi = Array.from, yi = Object.keys, wi = Object.defineProperty, Ln = Object.getOwnPropertyDescriptor, Wo = Object.getOwnPropertyDescriptors, Uo = Object.prototype, Go = Array.prototype, Wa = Object.getPrototypeOf, aa = Object.isExtensible; +const Ko = () => { }; -function Vl(t) { - for (var e = 0; e < t.length; e++) - t[e](); +function jo(e) { + for (var t = 0; t < e.length; t++) + e[t](); } -function Oa() { - var t, e, n = new Promise((r, i) => { - t = r, e = i; +function Ua() { + var e, t, n = new Promise((r, i) => { + e = r, t = i; }); - return { promise: n, resolve: t, reject: e }; + return { promise: n, resolve: e, reject: t }; } -function Yl(t, e) { - if (Array.isArray(t)) - return t; - if (!(Symbol.iterator in t)) - return Array.from(t); +function Jo(e, t) { + if (Array.isArray(e)) + return e; + if (!(Symbol.iterator in e)) + return Array.from(e); const n = []; - for (const r of t) - if (n.push(r), n.length === e) break; + for (const r of e) + if (n.push(r), n.length === t) break; return n; } -const Et = 2, Lr = 4, ki = 8, La = 1 << 24, sn = 16, xe = 32, vn = 64, qa = 128, ae = 512, wt = 1024, Rt = 2048, we = 4096, jt = 8192, en = 16384, mr = 32768, cr = 65536, ia = 1 << 17, Va = 1 << 18, zn = 1 << 19, Hl = 1 << 20, cn = 1 << 25, On = 65536, is = 1 << 21, Ts = 1 << 22, hn = 1 << 23, Fr = Symbol("$state"), Ya = Symbol("legacy props"), xn = new class extends Error { +const Ce = 2, Lr = 4, Di = 8, Ga = 1 << 24, fn = 16, xt = 32, bn = 64, Ka = 128, ft = 512, Ae = 1024, Se = 2048, wt = 4096, tt = 8192, an = 16384, yr = 32768, hr = 65536, la = 1 << 17, ja = 1 << 18, Wn = 1 << 19, Zo = 1 << 20, rn = 1 << 25, Yn = 65536, ls = 1 << 21, ks = 1 << 22, _n = 1 << 23, Ir = Symbol("$state"), Ja = Symbol("legacy props"), Qo = Symbol(""), Rn = new class extends Error { constructor() { super(...arguments); - ot(this, "name", "StaleReactionError"); - ot(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"); } -}(), Kr = 3, yr = 8; -function zl(t) { +}(); +var Va; +const eu = ((Va = globalThis.document) == null ? void 0 : /* @__PURE__ */ Va.contentType.includes("xml")) ?? !1, Kr = 3, wr = 8; +function tu(e) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function Xl() { +function nu() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function Bl(t, e, n) { +function ru(e, t, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function Wl(t) { +function iu(e) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function Ul() { +function su() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function Gl(t) { +function au(e) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function Kl() { +function lu() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Jl() { +function ou() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function Zl(t) { +function uu(e) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function jl() { +function fu() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Ql() { +function cu() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function tu() { +function hu() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function eu() { +function du() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Mi(t) { +function Ii(e) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function nu() { +function pu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } -let J = !1; -function tn(t) { - J = t; +let K = !1; +function sn(e) { + K = e; } -let H; -function Ht(t) { - if (t === null) - throw Mi(), ur; - return H = t; +let z; +function Fe(e) { + if (e === null) + throw Ii(), fr; + return z = e; } -function Pi() { - return Ht(/* @__PURE__ */ Oe(H)); +function Fi() { + return Fe(/* @__PURE__ */ Ot(z)); } -function Ut(t) { - if (J) { - if (/* @__PURE__ */ Oe(H) !== null) - throw Mi(), ur; - H = t; +function De(e) { + if (K) { + if (/* @__PURE__ */ Ot(z) !== null) + throw Ii(), fr; + z = e; } } -function ss(t = 1) { - if (J) { - for (var e = t, n = H; e--; ) +function os(e = 1) { + if (K) { + for (var t = e, n = z; t--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Oe(n); - H = n; + /* @__PURE__ */ Ot(n); + z = n; } } -function mi(t = !0) { - for (var e = 0, n = H; ; ) { - if (n.nodeType === yr) { +function xi(e = !0) { + for (var t = 0, n = z; ; ) { + if (n.nodeType === wr) { var r = ( /** @type {Comment} */ n.data ); - if (r === Cs) { - if (e === 0) return n; - e -= 1; - } else (r === Rs || r === Si || // "[1", "[2", etc. for if blocks - r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); + if (r === Ns) { + if (t === 0) return n; + t -= 1; + } else (r === Ss || r === Mi || // "[1", "[2", etc. for if blocks + r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Oe(n) + /* @__PURE__ */ Ot(n) ); - t && n.remove(), n = i; + e && n.remove(), n = i; } } -function Ha(t) { - if (!t || t.nodeType !== yr) - throw Mi(), ur; +function Za(e) { + if (!e || e.nodeType !== wr) + throw Ii(), fr; return ( /** @type {Comment} */ - t.data + e.data ); } -function za(t) { - return t === this.v; +function Qa(e) { + return e === this.v; } -function ru(t, e) { - return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; +function vu(e, t) { + return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; } -function Xa(t) { - return !ru(t, this.v); +function el(e) { + return !vu(e, this.v); } -let iu = !1, Qt = null; -function hr(t) { - Qt = t; +let gu = !1, rt = null; +function dr(e) { + rt = e; } -function Ss(t, e = !1, n) { - Qt = { - p: Qt, +function Oi(e, t = !1, n) { + rt = { + p: rt, i: !1, c: null, e: null, - s: t, + s: e, x: null, l: null }; } -function Ns(t) { - var e = ( +function Li(e) { + var t = ( /** @type {ComponentContext} */ - Qt - ), n = e.e; + rt + ), n = t.e; if (n !== null) { - e.e = null; + t.e = null; for (var r of n) - go(r); + El(r); } - return t !== void 0 && (e.x = t), e.i = !0, Qt = e.p, t ?? /** @type {T} */ + return e !== void 0 && (t.x = e), t.i = !0, rt = t.p, e ?? /** @type {T} */ {}; } -function Ba() { +function tl() { return !0; } -let bn = []; -function Wa() { - var t = bn; - bn = [], Vl(t); +let Cn = []; +function nl() { + var e = Cn; + Cn = [], jo(e); } -function Pn(t) { - if (bn.length === 0 && !Ir) { - var e = bn; +function mn(e) { + if (Cn.length === 0 && !Fr) { + var t = Cn; queueMicrotask(() => { - e === bn && Wa(); + t === Cn && nl(); }); } - bn.push(t); + Cn.push(e); } -function su() { - for (; bn.length > 0; ) - Wa(); +function _u() { + for (; Cn.length > 0; ) + nl(); } -function Ua(t) { - var e = U; - if (e === null) - return Y.f |= hn, t; - if ((e.f & mr) === 0 && (e.f & Lr) === 0) - throw t; - dr(t, e); +function rl(e) { + var t = J; + if (t === null) + return Y.f |= _n, e; + if ((t.f & yr) === 0 && (t.f & Lr) === 0) + throw e; + pr(e, t); } -function dr(t, e) { - for (; e !== null; ) { - if ((e.f & qa) !== 0) { - if ((e.f & mr) === 0) - throw t; +function pr(e, t) { + for (; t !== null; ) { + if ((t.f & Ka) !== 0) { + if ((t.f & yr) === 0) + throw e; try { - e.b.error(t); + t.b.error(e); return; } catch (n) { - t = n; + e = n; } } - e = e.parent; + t = t.parent; } - throw t; + throw e; } -const au = -7169; -function ut(t, e) { - t.f = t.f & au | e; +const mu = -7169; +function ge(e, t) { + e.f = e.f & mu | t; } -function ks(t) { - (t.f & ae) !== 0 || t.deps === null ? ut(t, wt) : ut(t, we); +function Ms(e) { + (e.f & ft) !== 0 || e.deps === null ? ge(e, Ae) : ge(e, wt); } -function Ga(t) { - if (t !== null) - for (const e of t) - (e.f & Et) === 0 || (e.f & On) === 0 || (e.f ^= On, Ga( +function il(e) { + if (e !== null) + for (const t of e) + (t.f & Ce) === 0 || (t.f & Yn) === 0 || (t.f ^= Yn, il( /** @type {Derived} */ - e.deps + t.deps )); } -function Ka(t, e, n) { - (t.f & Rt) !== 0 ? e.add(t) : (t.f & we) !== 0 && n.add(t), Ga(t.deps), ut(t, wt); +function sl(e, t, n) { + (e.f & Se) !== 0 ? t.add(e) : (e.f & wt) !== 0 && n.add(e), il(e.deps), ge(e, Ae); } const Qr = /* @__PURE__ */ new Set(); -let B = null, At = null, qt = [], Di = null, as = !1, Ir = !1; -var nr, rr, Rn, ir, Xr, Br, Cn, Ke, sr, Ie, os, ls, Ja; -const Us = class Us { +let G = null, Re = null, Be = [], qi = null, us = !1, Fr = !1; +var rr, ir, Mn, sr, Xr, Br, Pn, Zt, ar, Ft, fs, cs, al; +const js = class js { constructor() { - q(this, Ie); - ot(this, "committed", !1); + L(this, Ft); + 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} */ - ot(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} */ - ot(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>} */ - q(this, nr, /* @__PURE__ */ new Set()); + L(this, rr, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - q(this, rr, /* @__PURE__ */ new Set()); + L(this, ir, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - q(this, Rn, 0); + L(this, Mn, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - q(this, ir, 0); + L(this, sr, 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} */ - q(this, Xr, null); + L(this, Xr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - q(this, Br, /* @__PURE__ */ new Set()); + L(this, Br, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - q(this, Cn, /* @__PURE__ */ new Set()); + L(this, Pn, /* @__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`. @@ -300,54 +302,54 @@ const Us = class Us { * so they can be rescheduled if the branch survives. * @type {Map} */ - q(this, Ke, /* @__PURE__ */ new Map()); - ot(this, "is_fork", !1); - q(this, sr, !1); + L(this, Zt, /* @__PURE__ */ new Map()); + pe(this, "is_fork", !1); + L(this, ar, !1); } is_deferred() { - return this.is_fork || v(this, ir) > 0; + return this.is_fork || v(this, sr) > 0; } /** * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ - skip_effect(e) { - v(this, Ke).has(e) || v(this, Ke).set(e, { d: [], m: [] }); + skip_effect(t) { + v(this, Zt).has(t) || v(this, Zt).set(t, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule * any tracked dirty/maybe_dirty child effects * @param {Effect} effect */ - unskip_effect(e) { - var n = v(this, Ke).get(e); + unskip_effect(t) { + var n = v(this, Zt).get(t); if (n) { - v(this, Ke).delete(e); + v(this, Zt).delete(t); for (var r of n.d) - ut(r, Rt), me(r); + ge(r, Se), mt(r); for (r of n.m) - ut(r, we), me(r); + ge(r, wt), mt(r); } } /** * * @param {Effect[]} root_effects */ - process(e) { + process(t) { var i; - qt = [], this.apply(); + Be = [], this.apply(); var n = [], r = []; - for (const s of e) - mt(this, Ie, os).call(this, s, n, r); + for (const s of t) + be(this, Ft, fs).call(this, s, n, r); if (this.is_deferred()) { - mt(this, Ie, ls).call(this, r), mt(this, Ie, ls).call(this, n); - for (const [s, a] of v(this, Ke)) - to(s, a); + be(this, Ft, cs).call(this, r), be(this, Ft, cs).call(this, n); + for (const [s, a] of v(this, Zt)) + fl(s, a); } else { - for (const s of v(this, nr)) s(); - v(this, nr).clear(), v(this, Rn) === 0 && mt(this, Ie, Ja).call(this), B = null, sa(r), sa(n), (i = v(this, Xr)) == null || i.resolve(); + for (const s of v(this, rr)) s(); + v(this, rr).clear(), v(this, Mn) === 0 && be(this, Ft, al).call(this), G = null, oa(r), oa(n), (i = v(this, Xr)) == null || i.resolve(); } - At = null; + Re = null; } /** * Associate a change to a given source with the current @@ -355,232 +357,232 @@ const Us = class Us { * @param {Source} source * @param {any} value */ - capture(e, n) { - n !== $t && !this.previous.has(e) && this.previous.set(e, n), (e.f & hn) === 0 && (this.current.set(e, e.v), At == null || At.set(e, e.v)); + capture(t, n) { + n !== Te && !this.previous.has(t) && this.previous.set(t, n), (t.f & _n) === 0 && (this.current.set(t, t.v), Re == null || Re.set(t, t.v)); } activate() { - B = this, this.apply(); + G = this, this.apply(); } deactivate() { - B === this && (B = null, At = null); + G === this && (G = null, Re = null); } flush() { - if (this.activate(), qt.length > 0) { - if (Za(), B !== null && B !== this) + if (this.activate(), Be.length > 0) { + if (ll(), G !== null && G !== this) return; - } else v(this, Rn) === 0 && this.process([]); + } else v(this, Mn) === 0 && this.process([]); this.deactivate(); } discard() { - for (const e of v(this, rr)) e(this); - v(this, rr).clear(); + for (const t of v(this, ir)) t(this); + v(this, ir).clear(); } /** * * @param {boolean} blocking */ - increment(e) { - O(this, Rn, v(this, Rn) + 1), e && O(this, ir, v(this, ir) + 1); + increment(t) { + F(this, Mn, v(this, Mn) + 1), t && F(this, sr, v(this, sr) + 1); } /** * * @param {boolean} blocking */ - decrement(e) { - O(this, Rn, v(this, Rn) - 1), e && O(this, ir, v(this, ir) - 1), !v(this, sr) && (O(this, sr, !0), Pn(() => { - O(this, sr, !1), this.is_deferred() ? qt.length > 0 && this.flush() : this.revive(); + decrement(t) { + F(this, Mn, v(this, Mn) - 1), t && F(this, sr, v(this, sr) - 1), !v(this, ar) && (F(this, ar, !0), mn(() => { + F(this, ar, !1), this.is_deferred() ? Be.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const e of v(this, Br)) - v(this, Cn).delete(e), ut(e, Rt), me(e); - for (const e of v(this, Cn)) - ut(e, we), me(e); + for (const t of v(this, Br)) + v(this, Pn).delete(t), ge(t, Se), mt(t); + for (const t of v(this, Pn)) + ge(t, wt), mt(t); this.flush(); } /** @param {() => void} fn */ - oncommit(e) { - v(this, nr).add(e); + oncommit(t) { + v(this, rr).add(t); } /** @param {(batch: Batch) => void} fn */ - ondiscard(e) { - v(this, rr).add(e); + ondiscard(t) { + v(this, ir).add(t); } settled() { - return (v(this, Xr) ?? O(this, Xr, Oa())).promise; + return (v(this, Xr) ?? F(this, Xr, Ua())).promise; } static ensure() { - if (B === null) { - const e = B = new Us(); - Qr.add(B), Ir || Pn(() => { - B === e && e.flush(); + if (G === null) { + const t = G = new js(); + Qr.add(G), Fr || mn(() => { + G === t && t.flush(); }); } - return B; + return G; } apply() { } }; -nr = new WeakMap(), rr = new WeakMap(), Rn = new WeakMap(), ir = new WeakMap(), Xr = new WeakMap(), Br = new WeakMap(), Cn = new WeakMap(), Ke = new WeakMap(), sr = new WeakMap(), Ie = new WeakSet(), /** +rr = new WeakMap(), ir = new WeakMap(), Mn = new WeakMap(), sr = new WeakMap(), Xr = new WeakMap(), Br = new WeakMap(), Pn = new WeakMap(), Zt = new WeakMap(), ar = new WeakMap(), Ft = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -os = function(e, n, r) { - e.f ^= wt; - for (var i = e.first, s = null; i !== null; ) { - var a = i.f, o = (a & (xe | vn)) !== 0, l = o && (a & wt) !== 0, u = l || (a & jt) !== 0 || v(this, Ke).has(i); +fs = function(t, n, r) { + t.f ^= Ae; + for (var i = t.first, s = null; i !== null; ) { + var a = i.f, l = (a & (xt | bn)) !== 0, o = l && (a & Ae) !== 0, u = o || (a & tt) !== 0 || v(this, Zt).has(i); if (!u && i.fn !== null) { - o ? i.f ^= wt : s !== null && (a & (Lr | ki | La)) !== 0 ? s.b.defer_effect(i) : (a & Lr) !== 0 ? n.push(i) : Jr(i) && ((a & sn) !== 0 && v(this, Cn).add(i), vr(i)); + l ? i.f ^= Ae : s !== null && (a & (Lr | Di | Ga)) !== 0 ? s.b.defer_effect(i) : (a & Lr) !== 0 ? n.push(i) : jr(i) && ((a & fn) !== 0 && v(this, Pn).add(i), gr(i)); var f = i.first; if (f !== null) { i = f; continue; } } - var d = i.parent; - for (i = i.next; i === null && d !== null; ) - d === s && (s = null), i = d.next, d = d.parent; + var h = i.parent; + for (i = i.next; i === null && h !== null; ) + h === s && (s = null), i = h.next, h = h.parent; } }, /** * @param {Effect[]} effects */ -ls = function(e) { - for (var n = 0; n < e.length; n += 1) - Ka(e[n], v(this, Br), v(this, Cn)); -}, Ja = function() { +cs = function(t) { + for (var n = 0; n < t.length; n += 1) + sl(t[n], v(this, Br), v(this, Pn)); +}, al = function() { var i; if (Qr.size > 1) { this.previous.clear(); - var e = At, n = !0; + var t = Re, n = !0; for (const s of Qr) { if (s === this) { n = !1; continue; } const a = []; - for (const [l, u] of this.current) { - if (s.current.has(l)) - if (n && u !== s.current.get(l)) - s.current.set(l, u); + for (const [o, u] of this.current) { + if (s.current.has(o)) + if (n && u !== s.current.get(o)) + s.current.set(o, u); else continue; - a.push(l); + a.push(o); } if (a.length === 0) continue; - const o = [...s.current.keys()].filter((l) => !this.current.has(l)); - if (o.length > 0) { - var r = qt; - qt = []; - const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); + const l = [...s.current.keys()].filter((o) => !this.current.has(o)); + if (l.length > 0) { + var r = Be; + Be = []; + const o = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - ja(f, o, l, u); - if (qt.length > 0) { - B = s, s.apply(); - for (const f of qt) - mt(i = s, Ie, os).call(i, f, [], []); + ol(f, l, o, u); + if (Be.length > 0) { + G = s, s.apply(); + for (const f of Be) + be(i = s, Ft, fs).call(i, f, [], []); s.deactivate(); } - qt = r; + Be = r; } } - B = null, At = e; + G = null, Re = t; } this.committed = !0, Qr.delete(this); }; -let nn = Us; -function ht(t) { - var e = Ir; - Ir = !0; +let ln = js; +function se(e) { + var t = Fr; + Fr = !0; try { for (var n; ; ) { - if (su(), qt.length === 0 && (B == null || B.flush(), qt.length === 0)) - return Di = null, /** @type {T} */ + if (_u(), Be.length === 0 && (G == null || G.flush(), Be.length === 0)) + return qi = null, /** @type {T} */ n; - Za(); + ll(); } } finally { - Ir = e; + Fr = t; } } -function Za() { - as = !0; - var t = null; +function ll() { + us = !0; + var e = null; try { - for (var e = 0; qt.length > 0; ) { - var n = nn.ensure(); - if (e++ > 1e3) { + for (var t = 0; Be.length > 0; ) { + var n = ln.ensure(); + if (t++ > 1e3) { var r, i; - ou(); + yu(); } - n.process(qt), dn.clear(); + n.process(Be), yn.clear(); } } finally { - qt = [], as = !1, Di = null; + Be = [], us = !1, qi = null; } } -function ou() { +function yu() { try { - Kl(); - } catch (t) { - dr(t, Di); - } -} -let pe = null; -function sa(t) { - var e = t.length; - if (e !== 0) { - for (var n = 0; n < e; ) { - var r = t[n++]; - if ((r.f & (en | jt)) === 0 && Jr(r) && (pe = /* @__PURE__ */ new Set(), vr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && yo(r), (pe == null ? void 0 : pe.size) > 0)) { - dn.clear(); - for (const i of pe) { - if ((i.f & (en | jt)) !== 0) continue; + lu(); + } catch (e) { + pr(e, qi); + } +} +let vt = null; +function oa(e) { + var t = e.length; + if (t !== 0) { + for (var n = 0; n < t; ) { + var r = e[n++]; + if ((r.f & (an | tt)) === 0 && jr(r) && (vt = /* @__PURE__ */ new Set(), gr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Cl(r), (vt == null ? void 0 : vt.size) > 0)) { + yn.clear(); + for (const i of vt) { + if ((i.f & (an | tt)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - pe.has(a) && (pe.delete(a), s.push(a)), a = a.parent; - for (let o = s.length - 1; o >= 0; o--) { - const l = s[o]; - (l.f & (en | jt)) === 0 && vr(l); + vt.has(a) && (vt.delete(a), s.push(a)), a = a.parent; + for (let l = s.length - 1; l >= 0; l--) { + const o = s[l]; + (o.f & (an | tt)) === 0 && gr(o); } } - pe.clear(); + vt.clear(); } } - pe = null; + vt = null; } } -function ja(t, e, n, r) { - if (!n.has(t) && (n.add(t), t.reactions !== null)) - for (const i of t.reactions) { +function ol(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 & Et) !== 0 ? ja( + (s & Ce) !== 0 ? ol( /** @type {Derived} */ i, - e, + t, n, r - ) : (s & (Ts | sn)) !== 0 && (s & Rt) === 0 && Qa(i, e, r) && (ut(i, Rt), me( + ) : (s & (ks | fn)) !== 0 && (s & Se) === 0 && ul(i, t, r) && (ge(i, Se), mt( /** @type {Effect} */ i )); } } -function Qa(t, e, n) { - const r = n.get(t); +function ul(e, t, n) { + const r = n.get(e); if (r !== void 0) return r; - if (t.deps !== null) - for (const i of t.deps) { - if (fr.call(e, i)) + if (e.deps !== null) + for (const i of e.deps) { + if (cr.call(t, i)) return !0; - if ((i.f & Et) !== 0 && Qa( + if ((i.f & Ce) !== 0 && ul( /** @type {Derived} */ i, - e, + t, n )) return n.set( @@ -589,82 +591,82 @@ function Qa(t, e, n) { !0 ), !0; } - return n.set(t, !1), !1; + return n.set(e, !1), !1; } -function me(t) { - for (var e = Di = t; e.parent !== null; ) { - e = e.parent; - var n = e.f; - if (as && e === U && (n & sn) !== 0 && (n & Va) === 0) +function mt(e) { + for (var t = qi = e; t.parent !== null; ) { + t = t.parent; + var n = t.f; + if (us && t === J && (n & fn) !== 0 && (n & ja) === 0) return; - if ((n & (vn | xe)) !== 0) { - if ((n & wt) === 0) return; - e.f ^= wt; + if ((n & (bn | xt)) !== 0) { + if ((n & Ae) === 0) return; + t.f ^= Ae; } } - qt.push(e); + Be.push(t); } -function to(t, e) { - if (!((t.f & xe) !== 0 && (t.f & wt) !== 0)) { - (t.f & Rt) !== 0 ? e.d.push(t) : (t.f & we) !== 0 && e.m.push(t), ut(t, wt); - for (var n = t.first; n !== null; ) - to(n, e), n = n.next; +function fl(e, t) { + if (!((e.f & xt) !== 0 && (e.f & Ae) !== 0)) { + (e.f & Se) !== 0 ? t.d.push(e) : (e.f & wt) !== 0 && t.m.push(e), ge(e, Ae); + for (var n = e.first; n !== null; ) + fl(n, t), n = n.next; } } -function lu(t) { - let e = 0, n = Ln(0), r; +function wu(e) { + let t = 0, n = zn(0), r; return () => { - Ds() && (x(n), Is(() => (e === 0 && (r = Oi(() => t(() => Or(n)))), e += 1, () => { - Pn(() => { - e -= 1, e === 0 && (r == null || r(), r = void 0, Or(n)); + Is() && (b(n), Os(() => (t === 0 && (r = Yi(() => e(() => Or(n)))), t += 1, () => { + mn(() => { + t -= 1, t === 0 && (r == null || r(), r = void 0, Or(n)); }); }))); }; } -var uu = cr | zn | qa; -function fu(t, e, n) { - new cu(t, e, n); +var xu = hr | Wn | Ka; +function bu(e, t, n) { + new $u(e, t, n); } -var Jt, Wr, Se, Tn, Ne, re, Lt, ke, Je, fn, Sn, Ze, ar, Nn, or, lr, je, Ci, dt, eo, no, us, ai, oi, fs; -class cu { +var Qe, Wr, St, Dn, Nt, lt, ze, kt, Qt, gn, In, en, lr, Fn, or, ur, tn, Ni, ye, cl, hl, hs, li, oi, ds; +class $u { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ - constructor(e, n, r) { - q(this, dt); + constructor(t, n, r) { + L(this, ye); /** @type {Boundary | null} */ - ot(this, "parent"); - ot(this, "is_pending", !1); + pe(this, "parent"); + pe(this, "is_pending", !1); /** @type {TemplateNode} */ - q(this, Jt); + L(this, Qe); /** @type {TemplateNode | null} */ - q(this, Wr, J ? H : null); + L(this, Wr, K ? z : null); /** @type {BoundaryProps} */ - q(this, Se); + L(this, St); /** @type {((anchor: Node) => void)} */ - q(this, Tn); + L(this, Dn); /** @type {Effect} */ - q(this, Ne); + L(this, Nt); /** @type {Effect | null} */ - q(this, re, null); + L(this, lt, null); /** @type {Effect | null} */ - q(this, Lt, null); + L(this, ze, null); /** @type {Effect | null} */ - q(this, ke, null); + L(this, kt, null); /** @type {DocumentFragment | null} */ - q(this, Je, null); + L(this, Qt, null); /** @type {TemplateNode | null} */ - q(this, fn, null); - q(this, Sn, 0); - q(this, Ze, 0); - q(this, ar, !1); - q(this, Nn, !1); + L(this, gn, null); + L(this, In, 0); + L(this, en, 0); + L(this, lr, !1); + L(this, Fn, !1); /** @type {Set} */ - q(this, or, /* @__PURE__ */ new Set()); + L(this, or, /* @__PURE__ */ new Set()); /** @type {Set} */ - q(this, lr, /* @__PURE__ */ new Set()); + L(this, ur, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -672,38 +674,38 @@ class cu { * calls followed by no-op flushes * @type {Source | null} */ - q(this, je, null); - q(this, Ci, lu(() => (O(this, je, Ln(v(this, Sn))), () => { - O(this, je, null); + L(this, tn, null); + L(this, Ni, wu(() => (F(this, tn, zn(v(this, In))), () => { + F(this, tn, null); }))); - O(this, Jt, e), O(this, Se, n), O(this, Tn, r), this.parent = /** @type {Effect} */ - U.b, this.is_pending = !!v(this, Se).pending, O(this, Ne, Os(() => { - if (U.b = this, J) { + F(this, Qe, t), F(this, St, n), F(this, Dn, r), this.parent = /** @type {Effect} */ + J.b, this.is_pending = !!v(this, St).pending, F(this, Nt, Ls(() => { + if (J.b = this, K) { const s = v(this, Wr); - Pi(), /** @type {Comment} */ - s.nodeType === yr && /** @type {Comment} */ - s.data === Si ? mt(this, dt, no).call(this) : (mt(this, dt, eo).call(this), v(this, Ze) === 0 && (this.is_pending = !1)); + Fi(), /** @type {Comment} */ + s.nodeType === wr && /** @type {Comment} */ + s.data === Mi ? be(this, ye, hl).call(this) : (be(this, ye, cl).call(this), v(this, en) === 0 && (this.is_pending = !1)); } else { - var i = mt(this, dt, us).call(this); + var i = be(this, ye, hs).call(this); try { - O(this, re, se(() => r(i))); + F(this, lt, ut(() => r(i))); } catch (s) { this.error(s); } - v(this, Ze) > 0 ? mt(this, dt, oi).call(this) : this.is_pending = !1; + v(this, en) > 0 ? be(this, ye, oi).call(this) : this.is_pending = !1; } return () => { var s; - (s = v(this, fn)) == null || s.remove(); + (s = v(this, gn)) == null || s.remove(); }; - }, uu)), J && O(this, Jt, H); + }, xu)), K && F(this, Qe, z); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ - defer_effect(e) { - Ka(e, v(this, or), v(this, lr)); + defer_effect(t) { + sl(t, v(this, or), v(this, ur)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -713,7 +715,7 @@ class cu { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, Se).pending; + return !!v(this, St).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -721,200 +723,200 @@ class cu { * Do not call from inside the class * @param {1 | -1} d */ - update_pending_count(e) { - mt(this, dt, fs).call(this, e), O(this, Sn, v(this, Sn) + e), !(!v(this, je) || v(this, ar)) && (O(this, ar, !0), Pn(() => { - O(this, ar, !1), v(this, je) && pr(v(this, je), v(this, Sn)); + update_pending_count(t) { + be(this, ye, ds).call(this, t), F(this, In, v(this, In) + t), !(!v(this, tn) || v(this, lr)) && (F(this, lr, !0), mn(() => { + F(this, lr, !1), v(this, tn) && vr(v(this, tn), v(this, In)); })); } get_effect_pending() { - return v(this, Ci).call(this), x( + return v(this, Ni).call(this), b( /** @type {Source} */ - v(this, je) + v(this, tn) ); } /** @param {unknown} error */ - error(e) { - var n = v(this, Se).onerror; - let r = v(this, Se).failed; - if (v(this, Nn) || !n && !r) - throw e; - v(this, re) && (Dt(v(this, re)), O(this, re, null)), v(this, Lt) && (Dt(v(this, Lt)), O(this, Lt, null)), v(this, ke) && (Dt(v(this, ke)), O(this, ke, null)), J && (Ht( + error(t) { + var n = v(this, St).onerror; + let r = v(this, St).failed; + if (v(this, Fn) || !n && !r) + throw t; + v(this, lt) && (Oe(v(this, lt)), F(this, lt, null)), v(this, ze) && (Oe(v(this, ze)), F(this, ze, null)), v(this, kt) && (Oe(v(this, kt)), F(this, kt, null)), K && (Fe( /** @type {TemplateNode} */ v(this, Wr) - ), ss(), Ht(mi())); + ), os(), Fe(xi())); var i = !1, s = !1; const a = () => { if (i) { - nu(); + pu(); return; } - i = !0, s && eu(), nn.ensure(), O(this, Sn, 0), v(this, ke) !== null && Dn(v(this, ke), () => { - O(this, ke, null); - }), this.is_pending = this.has_pending_snippet(), O(this, re, mt(this, dt, ai).call(this, () => (O(this, Nn, !1), se(() => v(this, Tn).call(this, v(this, Jt)))))), v(this, Ze) > 0 ? mt(this, dt, oi).call(this) : this.is_pending = !1; + i = !0, s && du(), ln.ensure(), F(this, In, 0), v(this, kt) !== null && qn(v(this, kt), () => { + F(this, kt, null); + }), this.is_pending = this.has_pending_snippet(), F(this, lt, be(this, ye, li).call(this, () => (F(this, Fn, !1), ut(() => v(this, Dn).call(this, v(this, Qe)))))), v(this, en) > 0 ? be(this, ye, oi).call(this) : this.is_pending = !1; }; - Pn(() => { + mn(() => { try { - s = !0, n == null || n(e, a), s = !1; - } catch (o) { - dr(o, v(this, Ne) && v(this, Ne).parent); + s = !0, n == null || n(t, a), s = !1; + } catch (l) { + pr(l, v(this, Nt) && v(this, Nt).parent); } - r && O(this, ke, mt(this, dt, ai).call(this, () => { - nn.ensure(), O(this, Nn, !0); + r && F(this, kt, be(this, ye, li).call(this, () => { + ln.ensure(), F(this, Fn, !0); try { - return se(() => { + return ut(() => { r( - v(this, Jt), - () => e, + v(this, Qe), + () => t, () => a ); }); - } catch (o) { - return dr( - o, + } catch (l) { + return pr( + l, /** @type {Effect} */ - v(this, Ne).parent + v(this, Nt).parent ), null; } finally { - O(this, Nn, !1); + F(this, Fn, !1); } })); }); } } -Jt = new WeakMap(), Wr = new WeakMap(), Se = new WeakMap(), Tn = new WeakMap(), Ne = new WeakMap(), re = new WeakMap(), Lt = new WeakMap(), ke = new WeakMap(), Je = new WeakMap(), fn = new WeakMap(), Sn = new WeakMap(), Ze = new WeakMap(), ar = new WeakMap(), Nn = new WeakMap(), or = new WeakMap(), lr = new WeakMap(), je = new WeakMap(), Ci = new WeakMap(), dt = new WeakSet(), eo = function() { +Qe = new WeakMap(), Wr = new WeakMap(), St = new WeakMap(), Dn = new WeakMap(), Nt = new WeakMap(), lt = new WeakMap(), ze = new WeakMap(), kt = new WeakMap(), Qt = new WeakMap(), gn = new WeakMap(), In = new WeakMap(), en = new WeakMap(), lr = new WeakMap(), Fn = new WeakMap(), or = new WeakMap(), ur = new WeakMap(), tn = new WeakMap(), Ni = new WeakMap(), ye = new WeakSet(), cl = function() { try { - O(this, re, se(() => v(this, Tn).call(this, v(this, Jt)))); - } catch (e) { - this.error(e); + F(this, lt, ut(() => v(this, Dn).call(this, v(this, Qe)))); + } catch (t) { + this.error(t); } -}, no = function() { - const e = v(this, Se).pending; - e && (O(this, Lt, se(() => e(v(this, Jt)))), Pn(() => { - var n = mt(this, dt, us).call(this); - O(this, re, mt(this, dt, ai).call(this, () => (nn.ensure(), se(() => v(this, Tn).call(this, n))))), v(this, Ze) > 0 ? mt(this, dt, oi).call(this) : (Dn( +}, hl = function() { + const t = v(this, St).pending; + t && (F(this, ze, ut(() => t(v(this, Qe)))), mn(() => { + var n = be(this, ye, hs).call(this); + F(this, lt, be(this, ye, li).call(this, () => (ln.ensure(), ut(() => v(this, Dn).call(this, n))))), v(this, en) > 0 ? be(this, ye, oi).call(this) : (qn( /** @type {Effect} */ - v(this, Lt), + v(this, ze), () => { - O(this, Lt, null); + F(this, ze, null); } ), this.is_pending = !1); })); -}, us = function() { - var e = v(this, Jt); - return this.is_pending && (O(this, fn, le()), v(this, Jt).before(v(this, fn)), e = v(this, fn)), e; +}, hs = function() { + var t = v(this, Qe); + return this.is_pending && (F(this, gn, nt()), v(this, Qe).before(v(this, gn)), t = v(this, gn)), t; }, /** * @param {() => Effect | null} fn */ -ai = function(e) { - var n = U, r = Y, i = Qt; - Fe(v(this, Ne)), ue(v(this, Ne)), hr(v(this, Ne).ctx); +li = function(t) { + var n = J, r = Y, i = rt; + It(v(this, Nt)), ht(v(this, Nt)), dr(v(this, Nt).ctx); try { - return e(); + return t(); } catch (s) { - return Ua(s), null; + return rl(s), null; } finally { - Fe(n), ue(r), hr(i); + It(n), ht(r), dr(i); } }, oi = function() { - const e = ( + const t = ( /** @type {(anchor: Node) => void} */ - v(this, Se).pending + v(this, St).pending ); - v(this, re) !== null && (O(this, Je, document.createDocumentFragment()), v(this, Je).append( + v(this, lt) !== null && (F(this, Qt, document.createDocumentFragment()), v(this, Qt).append( /** @type {TemplateNode} */ - v(this, fn) - ), bo(v(this, re), v(this, Je))), v(this, Lt) === null && O(this, Lt, se(() => e(v(this, Jt)))); + v(this, gn) + ), kl(v(this, lt), v(this, Qt))), v(this, ze) === null && F(this, ze, ut(() => t(v(this, Qe)))); }, /** * 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 * @param {1 | -1} d */ -fs = function(e) { +ds = function(t) { var n; if (!this.has_pending_snippet()) { - this.parent && mt(n = this.parent, dt, fs).call(n, e); + this.parent && be(n = this.parent, ye, ds).call(n, t); return; } - if (O(this, Ze, v(this, Ze) + e), v(this, Ze) === 0) { + if (F(this, en, v(this, en) + t), v(this, en) === 0) { this.is_pending = !1; for (const r of v(this, or)) - ut(r, Rt), me(r); - for (const r of v(this, lr)) - ut(r, we), me(r); - v(this, or).clear(), v(this, lr).clear(), v(this, Lt) && Dn(v(this, Lt), () => { - O(this, Lt, null); - }), v(this, Je) && (v(this, Jt).before(v(this, Je)), O(this, Je, null)); + ge(r, Se), mt(r); + for (const r of v(this, ur)) + ge(r, wt), mt(r); + v(this, or).clear(), v(this, ur).clear(), v(this, ze) && qn(v(this, ze), () => { + F(this, ze, null); + }), v(this, Qt) && (v(this, Qe).before(v(this, Qt)), F(this, Qt, null)); } }; -function hu(t, e, n, r) { - const i = Fi; - var s = t.filter((c) => !c.settled); +function Au(e, t, n, r) { + const i = Vi; + var s = e.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { - r(e.map(i)); + r(t.map(i)); return; } - var a = B, o = ( + var a = G, l = ( /** @type {Effect} */ - U - ), l = du(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + J + ), o = Eu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; function f(c) { - l(); + o(); try { r(c); } catch (p) { - (o.f & en) === 0 && dr(p, o); + (l.f & an) === 0 && pr(p, l); } - a == null || a.deactivate(), cs(); + a == null || a.deactivate(), ps(); } if (n.length === 0) { - u.then(() => f(e.map(i))); + u.then(() => f(t.map(i))); return; } - function d() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ pu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => dr(c, o)); + function h() { + o(), Promise.all(n.map((c) => /* @__PURE__ */ Tu(c))).then((c) => f([...t.map(i), ...c])).catch((c) => pr(c, l)); } - u ? u.then(d) : d(); + u ? u.then(h) : h(); } -function du() { - var t = U, e = Y, n = Qt, r = B; +function Eu() { + var e = J, t = Y, n = rt, r = G; return function(s = !0) { - Fe(t), ue(e), hr(n), s && (r == null || r.activate()); + It(e), ht(t), dr(n), s && (r == null || r.activate()); }; } -function cs() { - Fe(null), ue(null), hr(null); +function ps() { + It(null), ht(null), dr(null); } // @__NO_SIDE_EFFECTS__ -function Fi(t) { - var e = Et | Rt, n = Y !== null && (Y.f & Et) !== 0 ? ( +function Vi(e) { + var t = Ce | Se, n = Y !== null && (Y.f & Ce) !== 0 ? ( /** @type {Derived} */ Y ) : null; - return U !== null && (U.f |= zn), { - ctx: Qt, + return J !== null && (J.f |= Wn), { + ctx: rt, deps: null, effects: null, - equals: za, - f: e, - fn: t, + equals: Qa, + f: t, + fn: e, reactions: null, rv: 0, v: ( /** @type {V} */ - $t + Te ), wv: 0, - parent: n ?? U, + parent: n ?? J, ac: null }; } // @__NO_SIDE_EFFECTS__ -function pu(t, e, n) { +function Tu(e, t, n) { let r = ( /** @type {Effect | null} */ - U + J ); - r === null && Xl(); + r === null && nu(); var i = ( /** @type {Boundary} */ r.b @@ -922,255 +924,255 @@ function pu(t, e, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = Ln( + ), a = zn( /** @type {V} */ - $t - ), o = !Y, l = /* @__PURE__ */ new Map(); - return Au(() => { + Te + ), l = !Y, o = /* @__PURE__ */ new Map(); + return Fu(() => { var p; - var u = Oa(); + var u = Ua(); s = u.promise; try { - Promise.resolve(t()).then(u.resolve, u.reject).then(() => { - f === B && f.committed && f.deactivate(), cs(); + Promise.resolve(e()).then(u.resolve, u.reject).then(() => { + f === G && f.committed && f.deactivate(), ps(); }); - } catch (g) { - u.reject(g), cs(); + } catch (m) { + u.reject(m), ps(); } var f = ( /** @type {Batch} */ - B + G ); - if (o) { - var d = i.is_rendered(); - i.update_pending_count(1), f.increment(d), (p = l.get(f)) == null || p.reject(xn), l.delete(f), l.set(f, u); + if (l) { + var h = i.is_rendered(); + i.update_pending_count(1), f.increment(h), (p = o.get(f)) == null || p.reject(Rn), o.delete(f), o.set(f, u); } - const c = (g, y = void 0) => { - if (f.activate(), y) - y !== xn && (a.f |= hn, pr(a, y)); + const c = (m, $ = void 0) => { + if (f.activate(), $) + $ !== Rn && (a.f |= _n, vr(a, $)); else { - (a.f & hn) !== 0 && (a.f ^= hn), pr(a, g); - for (const [$, E] of l) { - if (l.delete($), $ === f) break; - E.reject(xn); + (a.f & _n) !== 0 && (a.f ^= _n), vr(a, m); + for (const [_, x] of o) { + if (o.delete(_), _ === f) break; + x.reject(Rn); } } - o && (i.update_pending_count(-1), f.decrement(d)); + l && (i.update_pending_count(-1), f.decrement(h)); }; - u.promise.then(c, (g) => c(null, g || "unknown")); - }), xu(() => { - for (const u of l.values()) - u.reject(xn); + u.promise.then(c, (m) => c(null, m || "unknown")); + }), Pu(() => { + for (const u of o.values()) + u.reject(Rn); }), new Promise((u) => { - function f(d) { + function f(h) { function c() { - d === s ? u(a) : f(s); + h === s ? u(a) : f(s); } - d.then(c, c); + h.then(c, c); } f(s); }); } // @__NO_SIDE_EFFECTS__ -function jn(t) { - const e = /* @__PURE__ */ Fi(t); - return $o(e), e; +function hn(e) { + const t = /* @__PURE__ */ Vi(e); + return Ml(t), t; } // @__NO_SIDE_EFFECTS__ -function ro(t) { - const e = /* @__PURE__ */ Fi(t); - return e.equals = Xa, e; -} -function vu(t) { - var e = t.effects; - if (e !== null) { - t.effects = null; - for (var n = 0; n < e.length; n += 1) - Dt( +function dl(e) { + const t = /* @__PURE__ */ Vi(e); + return t.equals = el, t; +} +function Ru(e) { + var t = e.effects; + if (t !== null) { + e.effects = null; + for (var n = 0; n < t.length; n += 1) + Oe( /** @type {Effect} */ - e[n] + t[n] ); } } -function gu(t) { - for (var e = t.parent; e !== null; ) { - if ((e.f & Et) === 0) - return (e.f & en) === 0 ? ( +function Cu(e) { + for (var t = e.parent; t !== null; ) { + if ((t.f & Ce) === 0) + return (t.f & an) === 0 ? ( /** @type {Effect} */ - e + t ) : null; - e = e.parent; + t = t.parent; } return null; } -function Ms(t) { - var e, n = U; - Fe(gu(t)); +function Ps(e) { + var t, n = J; + It(Cu(e)); try { - t.f &= ~On, vu(t), e = Co(t); + e.f &= ~Yn, Ru(e), t = Fl(e); } finally { - Fe(n); + It(n); } - return e; + return t; } -function io(t) { - var e = Ms(t); - if (!t.equals(e) && (t.wv = Eo(), (!(B != null && B.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { - ut(t, wt); +function pl(e) { + var t = Ps(e); + if (!e.equals(t) && (e.wv = Dl(), (!(G != null && G.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { + ge(e, Ae); return; } - pn || (At !== null ? (Ds() || B != null && B.is_fork) && At.set(t, e) : ks(t)); + xn || (Re !== null ? (Is() || G != null && G.is_fork) && Re.set(e, t) : Ms(e)); } -function _u(t) { - var e, n; - if (t.effects !== null) - for (const r of t.effects) - (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(xn), r.teardown = ql, r.ac = null, qr(r, 0), Ls(r)); +function Su(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(Rn), r.teardown = Ko, r.ac = null, qr(r, 0), qs(r)); } -function so(t) { - if (t.effects !== null) - for (const e of t.effects) - e.teardown && vr(e); +function vl(e) { + if (e.effects !== null) + for (const t of e.effects) + t.teardown && gr(t); } -let hs = /* @__PURE__ */ new Set(); -const dn = /* @__PURE__ */ new Map(); -let ao = !1; -function Ln(t, e) { +let vs = /* @__PURE__ */ new Set(); +const yn = /* @__PURE__ */ new Map(); +let gl = !1; +function zn(e, t) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors - v: t, + v: e, reactions: null, - equals: za, + equals: Qa, rv: 0, wv: 0 }; return n; } // @__NO_SIDE_EFFECTS__ -function yt(t, e) { - const n = Ln(t); - return $o(n), n; +function $e(e, t) { + const n = zn(e); + return Ml(n), n; } // @__NO_SIDE_EFFECTS__ -function oo(t, e = !1, n = !0) { - const r = Ln(t); - return e || (r.equals = Xa), r; +function _l(e, t = !1, n = !0) { + const r = zn(e); + return t || (r.equals = el), r; } -function lt(t, e, n = !1) { +function ve(e, t, n = !1) { Y !== 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 - (!ye || (Y.f & ia) !== 0) && Ba() && (Y.f & (Et | sn | Ts | ia)) !== 0 && (oe === null || !fr.call(oe, t)) && tu(); - let r = n ? $n(e) : e; - return pr(t, r); -} -function pr(t, e) { - if (!t.equals(e)) { - var n = t.v; - pn ? dn.set(t, e) : dn.set(t, n), t.v = e; - var r = nn.ensure(); - if (r.capture(t, n), (t.f & Et) !== 0) { + (!yt || (Y.f & la) !== 0) && tl() && (Y.f & (Ce | fn | ks | la)) !== 0 && (ct === null || !cr.call(ct, e)) && hu(); + let r = n ? Sn(t) : t; + return vr(e, r); +} +function vr(e, t) { + if (!e.equals(t)) { + var n = e.v; + xn ? yn.set(e, t) : yn.set(e, n), e.v = t; + var r = ln.ensure(); + if (r.capture(e, n), (e.f & Ce) !== 0) { const i = ( /** @type {Derived} */ - t + e ); - (t.f & Rt) !== 0 && Ms(i), ks(i); + (e.f & Se) !== 0 && Ps(i), Ms(i); } - t.wv = Eo(), lo(t, Rt), U !== null && (U.f & wt) !== 0 && (U.f & (xe | vn)) === 0 && (ne === null ? Cu([t]) : ne.push(t)), !r.is_fork && hs.size > 0 && !ao && mu(); + e.wv = Dl(), ml(e, Se), J !== null && (J.f & Ae) !== 0 && (J.f & (xt | bn)) === 0 && (at === null ? qu([e]) : at.push(e)), !r.is_fork && vs.size > 0 && !gl && Nu(); } - return e; + return t; } -function mu() { - ao = !1; - for (const t of hs) - (t.f & wt) !== 0 && ut(t, we), Jr(t) && vr(t); - hs.clear(); +function Nu() { + gl = !1; + for (const e of vs) + (e.f & Ae) !== 0 && ge(e, wt), jr(e) && gr(e); + vs.clear(); } -function Or(t) { - lt(t, t.v + 1); +function Or(e) { + ve(e, e.v + 1); } -function lo(t, e) { - var n = t.reactions; +function ml(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 & Rt) === 0; - if (o && ut(s, e), (a & Et) !== 0) { - var l = ( + var s = n[i], a = s.f, l = (a & Se) === 0; + if (l && ge(s, t), (a & Ce) !== 0) { + var o = ( /** @type {Derived} */ s ); - At == null || At.delete(l), (a & On) === 0 && (a & ae && (s.f |= On), lo(l, we)); - } else o && ((a & sn) !== 0 && pe !== null && pe.add( + Re == null || Re.delete(o), (a & Yn) === 0 && (a & ft && (s.f |= Yn), ml(o, wt)); + } else l && ((a & fn) !== 0 && vt !== null && vt.add( /** @type {Effect} */ s - ), me( + ), mt( /** @type {Effect} */ s )); } } -function $n(t) { - if (typeof t != "object" || t === null || Fr in t) - return t; - const e = Ll(t); - if (e !== Il && e !== Ol) - return t; - var n = /* @__PURE__ */ new Map(), r = Ia(t), i = /* @__PURE__ */ yt(0), s = Fn, a = (o) => { - if (Fn === s) - return o(); - var l = Y, u = Fn; - ue(null), la(s); - var f = o(); - return ue(l), la(u), f; +function Sn(e) { + if (typeof e != "object" || e === null || Ir in e) + return e; + const t = Wa(e); + if (t !== Uo && t !== Go) + return e; + var n = /* @__PURE__ */ new Map(), r = Ba(e), i = /* @__PURE__ */ $e(0), s = Vn, a = (l) => { + if (Vn === s) + return l(); + var o = Y, u = Vn; + ht(null), ca(s); + var f = l(); + return ht(o), ca(u), f; }; - return r && n.set("length", /* @__PURE__ */ yt( + return r && n.set("length", /* @__PURE__ */ $e( /** @type {any[]} */ - t.length + e.length )), new Proxy( /** @type {any} */ - t, + e, { - defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && jl(); - var f = n.get(l); + defineProperty(l, o, u) { + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && fu(); + var f = n.get(o); return f === void 0 ? a(() => { - var d = /* @__PURE__ */ yt(u.value); - return n.set(l, d), d; - }) : lt(f, u.value, !0), !0; + var h = /* @__PURE__ */ $e(u.value); + return n.set(o, h), h; + }) : ve(f, u.value, !0), !0; }, - deleteProperty(o, l) { - var u = n.get(l); + deleteProperty(l, o) { + var u = n.get(o); if (u === void 0) { - if (l in o) { - const f = a(() => /* @__PURE__ */ yt($t)); - n.set(l, f), Or(i); + if (o in l) { + const f = a(() => /* @__PURE__ */ $e(Te)); + n.set(o, f), Or(i); } } else - lt(u, $t), Or(i); + ve(u, Te), Or(i); return !0; }, - get(o, l, u) { + get(l, o, u) { var p; - if (l === Fr) - return t; - var f = n.get(l), d = l in o; - if (f === void 0 && (!d || (p = Mn(o, l)) != null && p.writable) && (f = a(() => { - var g = $n(d ? o[l] : $t), y = /* @__PURE__ */ yt(g); - return y; - }), n.set(l, f)), f !== void 0) { - var c = x(f); - return c === $t ? void 0 : c; + if (o === Ir) + return e; + var f = n.get(o), h = o in l; + if (f === void 0 && (!h || (p = Ln(l, o)) != null && p.writable) && (f = a(() => { + var m = Sn(h ? l[o] : Te), $ = /* @__PURE__ */ $e(m); + return $; + }), n.set(o, f)), f !== void 0) { + var c = b(f); + return c === Te ? void 0 : c; } - return Reflect.get(o, l, u); + return Reflect.get(l, o, u); }, - getOwnPropertyDescriptor(o, l) { - var u = Reflect.getOwnPropertyDescriptor(o, l); + getOwnPropertyDescriptor(l, o) { + var u = Reflect.getOwnPropertyDescriptor(l, o); if (u && "value" in u) { - var f = n.get(l); - f && (u.value = x(f)); + var f = n.get(o); + f && (u.value = b(f)); } else if (u === void 0) { - var d = n.get(l), c = d == null ? void 0 : d.v; - if (d !== void 0 && c !== $t) + var h = n.get(o), c = h == null ? void 0 : h.v; + if (h !== void 0 && c !== Te) return { enumerable: !0, configurable: !0, @@ -1180,192 +1182,192 @@ function $n(t) { } return u; }, - has(o, l) { + has(l, o) { var c; - if (l === Fr) + if (o === Ir) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== $t || Reflect.has(o, l); - if (u !== void 0 || U !== null && (!f || (c = Mn(o, l)) != null && c.writable)) { + var u = n.get(o), f = u !== void 0 && u.v !== Te || Reflect.has(l, o); + if (u !== void 0 || J !== null && (!f || (c = Ln(l, o)) != null && c.writable)) { u === void 0 && (u = a(() => { - var p = f ? $n(o[l]) : $t, g = /* @__PURE__ */ yt(p); - return g; - }), n.set(l, u)); - var d = x(u); - if (d === $t) + var p = f ? Sn(l[o]) : Te, m = /* @__PURE__ */ $e(p); + return m; + }), n.set(o, u)); + var h = b(u); + if (h === Te) return !1; } return f; }, - set(o, l, u, f) { + set(l, o, u, f) { var C; - var d = n.get(l), c = l in o; - if (r && l === "length") + var h = n.get(o), c = o in l; + if (r && o === "length") for (var p = u; p < /** @type {Source} */ - d.v; p += 1) { - var g = n.get(p + ""); - g !== void 0 ? lt(g, $t) : p in o && (g = a(() => /* @__PURE__ */ yt($t)), n.set(p + "", g)); + h.v; p += 1) { + var m = n.get(p + ""); + m !== void 0 ? ve(m, Te) : p in l && (m = a(() => /* @__PURE__ */ $e(Te)), n.set(p + "", m)); } - if (d === void 0) - (!c || (C = Mn(o, l)) != null && C.writable) && (d = a(() => /* @__PURE__ */ yt(void 0)), lt(d, $n(u)), n.set(l, d)); + if (h === void 0) + (!c || (C = Ln(l, o)) != null && C.writable) && (h = a(() => /* @__PURE__ */ $e(void 0)), ve(h, Sn(u)), n.set(o, h)); else { - c = d.v !== $t; - var y = a(() => $n(u)); - lt(d, y); + c = h.v !== Te; + var $ = a(() => Sn(u)); + ve(h, $); } - var $ = Reflect.getOwnPropertyDescriptor(o, l); - if ($ != null && $.set && $.set.call(f, u), !c) { - if (r && typeof l == "string") { - var E = ( + var _ = Reflect.getOwnPropertyDescriptor(l, o); + if (_ != null && _.set && _.set.call(f, u), !c) { + if (r && typeof o == "string") { + var x = ( /** @type {Source} */ n.get("length") - ), N = Number(l); - Number.isInteger(N) && N >= E.v && lt(E, N + 1); + ), D = Number(o); + Number.isInteger(D) && D >= x.v && ve(x, D + 1); } Or(i); } return !0; }, - ownKeys(o) { - x(i); - var l = Reflect.ownKeys(o).filter((d) => { - var c = n.get(d); - return c === void 0 || c.v !== $t; + ownKeys(l) { + b(i); + var o = Reflect.ownKeys(l).filter((h) => { + var c = n.get(h); + return c === void 0 || c.v !== Te; }); for (var [u, f] of n) - f.v !== $t && !(u in o) && l.push(u); - return l; + f.v !== Te && !(u in l) && o.push(u); + return o; }, setPrototypeOf() { - Ql(); + cu(); } } ); } -var aa, uo, fo, co; -function ds() { - if (aa === void 0) { - aa = window, uo = /Firefox/.test(navigator.userAgent); - var t = Element.prototype, e = Node.prototype, n = Text.prototype; - fo = Mn(e, "firstChild").get, co = Mn(e, "nextSibling").get, ra(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), ra(n) && (n.__t = void 0); +var ua, yl, wl, xl; +function gs() { + if (ua === void 0) { + ua = window, yl = /Firefox/.test(navigator.userAgent); + var e = Element.prototype, t = Node.prototype, n = Text.prototype; + wl = Ln(t, "firstChild").get, xl = Ln(t, "nextSibling").get, aa(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), aa(n) && (n.__t = void 0); } } -function le(t = "") { - return document.createTextNode(t); +function nt(e = "") { + return document.createTextNode(e); } // @__NO_SIDE_EFFECTS__ -function qn(t) { +function on(e) { return ( /** @type {TemplateNode | null} */ - fo.call(t) + wl.call(e) ); } // @__NO_SIDE_EFFECTS__ -function Oe(t) { +function Ot(e) { return ( /** @type {TemplateNode | null} */ - co.call(t) + xl.call(e) ); } -function Gt(t, e) { - if (!J) - return /* @__PURE__ */ qn(t); - var n = /* @__PURE__ */ qn(H); +function Ye(e, t) { + if (!K) + return /* @__PURE__ */ on(e); + var n = /* @__PURE__ */ on(z); if (n === null) - n = H.appendChild(le()); - else if (e && n.nodeType !== Kr) { - var r = le(); - return n == null || n.before(r), Ht(r), r; + n = z.appendChild(nt()); + else if (t && n.nodeType !== Kr) { + var r = nt(); + return n == null || n.before(r), Fe(r), r; } - return e && Ii( + return t && Hi( /** @type {Text} */ n - ), Ht(n), n; + ), Fe(n), n; } -function mn(t, e = !1) { - if (!J) { - var n = /* @__PURE__ */ qn(t); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Oe(n) : n; +function pn(e, t = !1) { + if (!K) { + var n = /* @__PURE__ */ on(e); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ot(n) : n; } - if (e) { - if ((H == null ? void 0 : H.nodeType) !== Kr) { - var r = le(); - return H == null || H.before(r), Ht(r), r; + if (t) { + if ((z == null ? void 0 : z.nodeType) !== Kr) { + var r = nt(); + return z == null || z.before(r), Fe(r), r; } - Ii( + Hi( /** @type {Text} */ - H + z ); } - return H; + return z; } -function de(t, e = 1, n = !1) { - let r = J ? H : t; - for (var i; e--; ) +function Je(e, t = 1, n = !1) { + let r = K ? z : e; + for (var i; t--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Oe(r); - if (!J) + /* @__PURE__ */ Ot(r); + if (!K) return r; if (n) { if ((r == null ? void 0 : r.nodeType) !== Kr) { - var s = le(); - return r === null ? i == null || i.after(s) : r.before(s), Ht(s), s; + var s = nt(); + return r === null ? i == null || i.after(s) : r.before(s), Fe(s), s; } - Ii( + Hi( /** @type {Text} */ r ); } - return Ht(r), r; + return Fe(r), r; } -function ho(t) { - t.textContent = ""; +function bl(e) { + e.textContent = ""; } -function po() { +function $l() { return !1; } -function Ps(t, e, n) { +function Ds(e, t, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Dl, t, void 0) + document.createElementNS(Xa, e, void 0) ); } -function Ii(t) { +function Hi(e) { if ( /** @type {string} */ - t.nodeValue.length < 65536 + e.nodeValue.length < 65536 ) return; - let e = t.nextSibling; - for (; e !== null && e.nodeType === Kr; ) - e.remove(), t.nodeValue += /** @type {string} */ - e.nodeValue, e = t.nextSibling; -} -function vo(t) { - var e = Y, n = U; - ue(null), Fe(null); + let t = e.nextSibling; + for (; t !== null && t.nodeType === Kr; ) + t.remove(), e.nodeValue += /** @type {string} */ + t.nodeValue, t = e.nextSibling; +} +function Al(e) { + var t = Y, n = J; + ht(null), It(null); try { - return t(); + return e(); } finally { - ue(e), Fe(n); + ht(t), It(n); } } -function yu(t) { - U === null && (Y === null && Gl(), Ul()), pn && Wl(); +function ku(e) { + J === null && (Y === null && au(), su()), xn && iu(); } -function wu(t, e) { - var n = e.last; - n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); +function Mu(e, t) { + var n = t.last; + n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); } -function Le(t, e, n) { - var r = U; - r !== null && (r.f & jt) !== 0 && (t |= jt); +function Lt(e, t, n) { + var r = J; + r !== null && (r.f & tt) !== 0 && (e |= tt); var i = { - ctx: Qt, + ctx: rt, deps: null, nodes: null, - f: t | Rt | ae, + f: e | Se | ft, first: null, - fn: e, + fn: t, last: null, next: null, parent: r, @@ -1377,14 +1379,14 @@ function Le(t, e, n) { }; if (n) try { - vr(i); - } catch (o) { - throw Dt(i), o; + gr(i); + } catch (l) { + throw Oe(i), l; } - else e !== null && me(i); + else t !== null && mt(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 & zn) === 0 && (s = s.first, (t & sn) !== 0 && (t & cr) !== 0 && s !== null && (s.f |= cr)), s !== null && (s.parent = r, r !== null && wu(s, r), Y !== null && (Y.f & Et) !== 0 && (t & vn) === 0)) { + (s.f & Wn) === 0 && (s = s.first, (e & fn) !== 0 && (e & hr) !== 0 && s !== null && (s.f |= hr)), s !== null && (s.parent = r, r !== null && Mu(s, r), Y !== null && (Y.f & Ce) !== 0 && (e & bn) === 0)) { var a = ( /** @type {Derived} */ Y @@ -1393,686 +1395,688 @@ function Le(t, e, n) { } return i; } -function Ds() { - return Y !== null && !ye; +function Is() { + return Y !== null && !yt; } -function xu(t) { - const e = Le(ki, null, !1); - return ut(e, wt), e.teardown = t, e; +function Pu(e) { + const t = Lt(Di, null, !1); + return ge(t, Ae), t.teardown = e, t; } -function Fs(t) { - yu(); - var e = ( +function Fs(e) { + ku(); + var t = ( /** @type {Effect} */ - U.f - ), n = !Y && (e & xe) !== 0 && (e & mr) === 0; + J.f + ), n = !Y && (t & xt) !== 0 && (t & yr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - Qt + rt ); - (r.e ?? (r.e = [])).push(t); + (r.e ?? (r.e = [])).push(e); } else - return go(t); + return El(e); } -function go(t) { - return Le(Lr | Hl, t, !1); +function El(e) { + return Lt(Lr | Zo, e, !1); } -function bu(t) { - nn.ensure(); - const e = Le(vn | zn, t, !0); +function Du(e) { + ln.ensure(); + const t = Lt(bn | Wn, e, !0); return () => { - Dt(e); + Oe(t); }; } -function $u(t) { - nn.ensure(); - const e = Le(vn | zn, t, !0); +function Iu(e) { + ln.ensure(); + const t = Lt(bn | Wn, e, !0); return (n = {}) => new Promise((r) => { - n.outro ? Dn(e, () => { - Dt(e), r(void 0); - }) : (Dt(e), r(void 0)); + n.outro ? qn(t, () => { + Oe(t), r(void 0); + }) : (Oe(t), r(void 0)); }); } -function _o(t) { - return Le(Lr, t, !1); +function Tl(e) { + return Lt(Lr, e, !1); } -function Au(t) { - return Le(Ts | zn, t, !0); +function Fu(e) { + return Lt(ks | Wn, e, !0); } -function Is(t, e = 0) { - return Le(ki | e, t, !0); +function Os(e, t = 0) { + return Lt(Di | t, e, !0); } -function Qn(t, e = [], n = [], r = []) { - hu(r, e, n, (i) => { - Le(ki, () => t(...i.map(x)), !0); +function Jt(e, t = [], n = [], r = []) { + Au(r, t, n, (i) => { + Lt(Di, () => e(...i.map(b)), !0); }); } -function Os(t, e = 0) { - var n = Le(sn | e, t, !0); +function Ls(e, t = 0) { + var n = Lt(fn | t, e, !0); return n; } -function se(t) { - return Le(xe | zn, t, !0); +function ut(e) { + return Lt(xt | Wn, e, !0); } -function mo(t) { - var e = t.teardown; - if (e !== null) { - const n = pn, r = Y; - oa(!0), ue(null); +function Rl(e) { + var t = e.teardown; + if (t !== null) { + const n = xn, r = Y; + fa(!0), ht(null); try { - e.call(null); + t.call(null); } finally { - oa(n), ue(r); + fa(n), ht(r); } } } -function Ls(t, e = !1) { - var n = t.first; - for (t.first = t.last = null; n !== null; ) { +function qs(e, t = !1) { + var n = e.first; + for (e.first = e.last = null; n !== null; ) { const i = n.ac; - i !== null && vo(() => { - i.abort(xn); + i !== null && Al(() => { + i.abort(Rn); }); var r = n.next; - (n.f & vn) !== 0 ? n.parent = null : Dt(n, e), n = r; + (n.f & bn) !== 0 ? n.parent = null : Oe(n, t), n = r; } } -function Eu(t) { - for (var e = t.first; e !== null; ) { - var n = e.next; - (e.f & xe) === 0 && Dt(e), e = n; +function Ou(e) { + for (var t = e.first; t !== null; ) { + var n = t.next; + (t.f & xt) === 0 && Oe(t), t = n; } } -function Dt(t, e = !0) { +function Oe(e, t = !0) { var n = !1; - (e || (t.f & Va) !== 0) && t.nodes !== null && t.nodes.end !== null && (Ru( - t.nodes.start, + (t || (e.f & ja) !== 0) && e.nodes !== null && e.nodes.end !== null && (Lu( + e.nodes.start, /** @type {TemplateNode} */ - t.nodes.end - ), n = !0), Ls(t, e && !n), qr(t, 0), ut(t, en); - var r = t.nodes && t.nodes.t; + e.nodes.end + ), n = !0), qs(e, t && !n), qr(e, 0), ge(e, an); + var r = e.nodes && e.nodes.t; if (r !== null) for (const s of r) s.stop(); - mo(t); - var i = t.parent; - i !== null && i.first !== null && yo(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; + Rl(e); + var i = e.parent; + i !== null && i.first !== null && Cl(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; } -function Ru(t, e) { - for (; t !== null; ) { - var n = t === e ? null : /* @__PURE__ */ Oe(t); - t.remove(), t = n; +function Lu(e, t) { + for (; e !== null; ) { + var n = e === t ? null : /* @__PURE__ */ Ot(e); + e.remove(), e = n; } } -function yo(t) { - var e = t.parent, n = t.prev, r = t.next; - n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); +function Cl(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 Dn(t, e, n = !0) { +function qn(e, t, n = !0) { var r = []; - wo(t, r, !0); + Sl(e, r, !0); var i = () => { - n && Dt(t), e && e(); + n && Oe(e), t && t(); }, s = r.length; if (s > 0) { var a = () => --s || i(); - for (var o of r) - o.out(a); + for (var l of r) + l.out(a); } else i(); } -function wo(t, e, n) { - if ((t.f & jt) === 0) { - t.f ^= jt; - var r = t.nodes && t.nodes.t; +function Sl(e, t, n) { + if ((e.f & tt) === 0) { + e.f ^= tt; + var r = e.nodes && e.nodes.t; if (r !== null) - for (const o of r) - (o.is_global || n) && e.push(o); - for (var i = t.first; i !== null; ) { - var s = i.next, a = (i.f & cr) !== 0 || // If this is a branch effect without a block effect parent, + for (const l of r) + (l.is_global || n) && t.push(l); + 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, // it means the parent block effect was pruned. In that case, // transparency information was transferred to the branch effect. - (i.f & xe) !== 0 && (t.f & sn) !== 0; - wo(i, e, a ? n : !1), i = s; + (i.f & xt) !== 0 && (e.f & fn) !== 0; + Sl(i, t, a ? n : !1), i = s; } } } -function qs(t) { - xo(t, !0); +function Vs(e) { + Nl(e, !0); } -function xo(t, e) { - if ((t.f & jt) !== 0) { - t.f ^= jt, (t.f & wt) === 0 && (ut(t, Rt), me(t)); - for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & cr) !== 0 || (n.f & xe) !== 0; - xo(n, i ? e : !1), n = r; +function Nl(e, t) { + if ((e.f & tt) !== 0) { + e.f ^= tt, (e.f & Ae) === 0 && (ge(e, Se), mt(e)); + for (var n = e.first; n !== null; ) { + var r = n.next, i = (n.f & hr) !== 0 || (n.f & xt) !== 0; + Nl(n, i ? t : !1), n = r; } - var s = t.nodes && t.nodes.t; + var s = e.nodes && e.nodes.t; if (s !== null) for (const a of s) - (a.is_global || e) && a.in(); + (a.is_global || t) && a.in(); } } -function bo(t, e) { - if (t.nodes) - for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Oe(n); - e.append(n), n = i; +function kl(e, t) { + if (e.nodes) + for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { + var i = n === r ? null : /* @__PURE__ */ Ot(n); + t.append(n), n = i; } } -let li = !1, pn = !1; -function oa(t) { - pn = t; +let ui = !1, xn = !1; +function fa(e) { + xn = e; } -let Y = null, ye = !1; -function ue(t) { - Y = t; +let Y = null, yt = !1; +function ht(e) { + Y = e; } -let U = null; -function Fe(t) { - U = t; +let J = null; +function It(e) { + J = e; } -let oe = null; -function $o(t) { - Y !== null && (oe === null ? oe = [t] : oe.push(t)); +let ct = null; +function Ml(e) { + Y !== null && (ct === null ? ct = [e] : ct.push(e)); } -let Vt = null, Kt = 0, ne = null; -function Cu(t) { - ne = t; +let We = null, Ze = 0, at = null; +function qu(e) { + at = e; } -let Ao = 1, An = 0, Fn = An; -function la(t) { - Fn = t; +let Pl = 1, Nn = 0, Vn = Nn; +function ca(e) { + Vn = e; } -function Eo() { - return ++Ao; +function Dl() { + return ++Pl; } -function Jr(t) { - var e = t.f; - if ((e & Rt) !== 0) +function jr(e) { + var t = e.f; + if ((t & Se) !== 0) return !0; - if (e & Et && (t.f &= ~On), (e & we) !== 0) { + if (t & Ce && (e.f &= ~Yn), (t & wt) !== 0) { for (var n = ( /** @type {Value[]} */ - t.deps + e.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (Jr( + if (jr( /** @type {Derived} */ s - ) && io( + ) && pl( /** @type {Derived} */ s - ), s.wv > t.wv) + ), s.wv > e.wv) return !0; } - (e & ae) !== 0 && // During time traveling we don't want to reset the status so that + (t & ft) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - At === null && ut(t, wt); + Re === null && ge(e, Ae); } return !1; } -function Ro(t, e, n = !0) { - var r = t.reactions; - if (r !== null && !(oe !== null && fr.call(oe, t))) +function Il(e, t, n = !0) { + var r = e.reactions; + if (r !== null && !(ct !== null && cr.call(ct, e))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Et) !== 0 ? Ro( + (s.f & Ce) !== 0 ? Il( /** @type {Derived} */ s, - e, + t, !1 - ) : e === s && (n ? ut(s, Rt) : (s.f & wt) !== 0 && ut(s, we), me( + ) : t === s && (n ? ge(s, Se) : (s.f & Ae) !== 0 && ge(s, wt), mt( /** @type {Effect} */ s )); } } -function Co(t) { - var y; - var e = Vt, n = Kt, r = ne, i = Y, s = oe, a = Qt, o = ye, l = Fn, u = t.f; - Vt = /** @type {null | Value[]} */ - null, Kt = 0, ne = null, Y = (u & (xe | vn)) === 0 ? t : null, oe = null, hr(t.ctx), ye = !1, Fn = ++An, t.ac !== null && (vo(() => { - t.ac.abort(xn); - }), t.ac = null); +function Fl(e) { + var $; + var t = We, n = Ze, r = at, i = Y, s = ct, a = rt, l = yt, o = Vn, u = e.f; + We = /** @type {null | Value[]} */ + null, Ze = 0, at = null, Y = (u & (xt | bn)) === 0 ? e : null, ct = null, dr(e.ctx), yt = !1, Vn = ++Nn, e.ac !== null && (Al(() => { + e.ac.abort(Rn); + }), e.ac = null); try { - t.f |= is; + e.f |= ls; var f = ( /** @type {Function} */ - t.fn - ), d = f(); - t.f |= mr; - var c = t.deps, p = B == null ? void 0 : B.is_fork; - if (Vt !== null) { - var g; - if (p || qr(t, Kt), c !== null && Kt > 0) - for (c.length = Kt + Vt.length, g = 0; g < Vt.length; g++) - c[Kt + g] = Vt[g]; + e.fn + ), h = f(); + e.f |= yr; + var c = e.deps, p = G == null ? void 0 : G.is_fork; + if (We !== null) { + var m; + if (p || qr(e, Ze), c !== null && Ze > 0) + for (c.length = Ze + We.length, m = 0; m < We.length; m++) + c[Ze + m] = We[m]; else - t.deps = c = Vt; - if (Ds() && (t.f & ae) !== 0) - for (g = Kt; g < c.length; g++) - ((y = c[g]).reactions ?? (y.reactions = [])).push(t); - } else !p && c !== null && Kt < c.length && (qr(t, Kt), c.length = Kt); - if (Ba() && ne !== null && !ye && c !== null && (t.f & (Et | we | Rt)) === 0) - for (g = 0; g < /** @type {Source[]} */ - ne.length; g++) - Ro( - ne[g], + e.deps = c = We; + if (Is() && (e.f & ft) !== 0) + for (m = Ze; m < c.length; m++) + (($ = c[m]).reactions ?? ($.reactions = [])).push(e); + } else !p && c !== null && Ze < c.length && (qr(e, Ze), c.length = Ze); + if (tl() && at !== null && !yt && c !== null && (e.f & (Ce | wt | Se)) === 0) + for (m = 0; m < /** @type {Source[]} */ + at.length; m++) + Il( + at[m], /** @type {Effect} */ - t + e ); - if (i !== null && i !== t) { - if (An++, i.deps !== null) - for (let $ = 0; $ < n; $ += 1) - i.deps[$].rv = An; - if (e !== null) - for (const $ of e) - $.rv = An; - ne !== null && (r === null ? r = ne : r.push(.../** @type {Source[]} */ - ne)); + if (i !== null && i !== e) { + if (Nn++, i.deps !== null) + for (let _ = 0; _ < n; _ += 1) + i.deps[_].rv = Nn; + if (t !== null) + for (const _ of t) + _.rv = Nn; + at !== null && (r === null ? r = at : r.push(.../** @type {Source[]} */ + at)); } - return (t.f & hn) !== 0 && (t.f ^= hn), d; - } catch ($) { - return Ua($); + return (e.f & _n) !== 0 && (e.f ^= _n), h; + } catch (_) { + return rl(_); } finally { - t.f ^= is, Vt = e, Kt = n, ne = r, Y = i, oe = s, hr(a), ye = o, Fn = l; + e.f ^= ls, We = t, Ze = n, at = r, Y = i, ct = s, dr(a), yt = l, Vn = o; } } -function Tu(t, e) { - let n = e.reactions; +function Vu(e, t) { + let n = t.reactions; if (n !== null) { - var r = Fl.call(n, t); + var r = Bo.call(n, e); if (r !== -1) { var i = n.length - 1; - i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); + i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (e.f & Et) !== 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 - (Vt === null || !fr.call(Vt, e))) { + (We === null || !cr.call(We, t))) { var s = ( /** @type {Derived} */ - e + t ); - (s.f & ae) !== 0 && (s.f ^= ae, s.f &= ~On), ks(s), _u(s), qr(s, 0); + (s.f & ft) !== 0 && (s.f ^= ft, s.f &= ~Yn), Ms(s), Su(s), qr(s, 0); } } -function qr(t, e) { - var n = t.deps; +function qr(e, t) { + var n = e.deps; if (n !== null) - for (var r = e; r < n.length; r++) - Tu(t, n[r]); -} -function vr(t) { - var e = t.f; - if ((e & en) === 0) { - ut(t, wt); - var n = U, r = li; - U = t, li = !0; + for (var r = t; r < n.length; r++) + Vu(e, n[r]); +} +function gr(e) { + var t = e.f; + if ((t & an) === 0) { + ge(e, Ae); + var n = J, r = ui; + J = e, ui = !0; try { - (e & (sn | La)) !== 0 ? Eu(t) : Ls(t), mo(t); - var i = Co(t); - t.teardown = typeof i == "function" ? i : null, t.wv = Ao; + (t & (fn | Ga)) !== 0 ? Ou(e) : qs(e), Rl(e); + var i = Fl(e); + e.teardown = typeof i == "function" ? i : null, e.wv = Pl; var s; - rs && iu && (t.f & Rt) !== 0 && t.deps; + as && gu && (e.f & Se) !== 0 && e.deps; } finally { - li = r, U = n; + ui = r, J = n; } } } -function x(t) { - var e = t.f, n = (e & Et) !== 0; - if (Y !== null && !ye) { - var r = U !== null && (U.f & en) !== 0; - if (!r && (oe === null || !fr.call(oe, t))) { +function b(e) { + var t = e.f, n = (t & Ce) !== 0; + if (Y !== null && !yt) { + var r = J !== null && (J.f & an) !== 0; + if (!r && (ct === null || !cr.call(ct, e))) { var i = Y.deps; - if ((Y.f & is) !== 0) - t.rv < An && (t.rv = An, Vt === null && i !== null && i[Kt] === t ? Kt++ : Vt === null ? Vt = [t] : Vt.push(t)); + if ((Y.f & ls) !== 0) + e.rv < Nn && (e.rv = Nn, We === null && i !== null && i[Ze] === e ? Ze++ : We === null ? We = [e] : We.push(e)); else { - (Y.deps ?? (Y.deps = [])).push(t); - var s = t.reactions; - s === null ? t.reactions = [Y] : fr.call(s, Y) || s.push(Y); + (Y.deps ?? (Y.deps = [])).push(e); + var s = e.reactions; + s === null ? e.reactions = [Y] : cr.call(s, Y) || s.push(Y); } } } - if (pn && dn.has(t)) - return dn.get(t); + if (xn && yn.has(e)) + return yn.get(e); if (n) { var a = ( /** @type {Derived} */ - t + e ); - if (pn) { - var o = a.v; - return ((a.f & wt) === 0 && a.reactions !== null || So(a)) && (o = Ms(a)), dn.set(a, o), o; + if (xn) { + var l = a.v; + return ((a.f & Ae) === 0 && a.reactions !== null || Ll(a)) && (l = Ps(a)), yn.set(a, l), l; } - var l = (a.f & ae) === 0 && !ye && Y !== null && (li || (Y.f & ae) !== 0), u = (a.f & mr) === 0; - Jr(a) && (l && (a.f |= ae), io(a)), l && !u && (so(a), To(a)); - } - if (At != null && At.has(t)) - return At.get(t); - if ((t.f & hn) !== 0) - throw t.v; - return t.v; -} -function To(t) { - if (t.f |= ae, t.deps !== null) - for (const e of t.deps) - (e.reactions ?? (e.reactions = [])).push(t), (e.f & Et) !== 0 && (e.f & ae) === 0 && (so( + var o = (a.f & ft) === 0 && !yt && Y !== null && (ui || (Y.f & ft) !== 0), u = (a.f & yr) === 0; + jr(a) && (o && (a.f |= ft), pl(a)), o && !u && (vl(a), Ol(a)); + } + if (Re != null && Re.has(e)) + return Re.get(e); + if ((e.f & _n) !== 0) + throw e.v; + return e.v; +} +function Ol(e) { + if (e.f |= ft, e.deps !== null) + for (const t of e.deps) + (t.reactions ?? (t.reactions = [])).push(e), (t.f & Ce) !== 0 && (t.f & ft) === 0 && (vl( /** @type {Derived} */ - e - ), To( + t + ), Ol( /** @type {Derived} */ - e + t )); } -function So(t) { - if (t.v === $t) return !0; - if (t.deps === null) return !1; - for (const e of t.deps) - if (dn.has(e) || (e.f & Et) !== 0 && So( +function Ll(e) { + if (e.v === Te) return !0; + if (e.deps === null) return !1; + for (const t of e.deps) + if (yn.has(t) || (t.f & Ce) !== 0 && Ll( /** @type {Derived} */ - e + t )) return !0; return !1; } -function Oi(t) { - var e = ye; +function Yi(e) { + var t = yt; try { - return ye = !0, t(); + return yt = !0, e(); } finally { - ye = e; + yt = t; } } -const No = /* @__PURE__ */ new Set(), ps = /* @__PURE__ */ new Set(); -function Su(t) { - for (var e = 0; e < t.length; e++) - No.add(t[e]); - for (var n of ps) - n(t); +const ql = /* @__PURE__ */ new Set(), _s = /* @__PURE__ */ new Set(); +function Hu(e) { + for (var t = 0; t < e.length; t++) + ql.add(e[t]); + for (var n of _s) + n(e); } -let ua = null; -function fa(t) { - var $; - var e = this, n = ( +let ha = null; +function da(e) { + var _; + var t = this, n = ( /** @type {Node} */ - e.ownerDocument - ), r = t.type, i = (($ = t.composedPath) == null ? void 0 : $.call(t)) || [], s = ( + t.ownerDocument + ), r = e.type, i = ((_ = e.composedPath) == null ? void 0 : _.call(e)) || [], s = ( /** @type {null | Element} */ - i[0] || t.target + i[0] || e.target ); - ua = t; - var a = 0, o = ua === t && t.__root; - if (o) { - var l = i.indexOf(o); - if (l !== -1 && (e === document || e === /** @type {any} */ + ha = e; + var a = 0, l = ha === e && e.__root; + if (l) { + var o = i.indexOf(l); + if (o !== -1 && (t === document || t === /** @type {any} */ window)) { - t.__root = e; + e.__root = t; return; } - var u = i.indexOf(e); + var u = i.indexOf(t); if (u === -1) return; - l <= u && (a = l); + o <= u && (a = o); } if (s = /** @type {Element} */ - i[a] || t.target, s !== e) { - _i(t, "currentTarget", { + i[a] || e.target, s !== t) { + wi(e, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = Y, d = U; - ue(null), Fe(null); + var f = Y, h = J; + ht(null), It(null); try { for (var c, p = []; s !== null; ) { - var g = s.assignedSlot || s.parentNode || /** @type {any} */ + var m = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { - var y = s["__" + r]; - y != null && (!/** @type {any} */ + var $ = s["__" + r]; + $ != 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 - t.target === s) && y.call(s, t); - } catch (E) { - c ? p.push(E) : c = E; + e.target === s) && $.call(s, e); + } catch (x) { + c ? p.push(x) : c = x; } - if (t.cancelBubble || g === e || g === null) + if (e.cancelBubble || m === t || m === null) break; - s = g; + s = m; } if (c) { - for (let E of p) + for (let x of p) queueMicrotask(() => { - throw E; + throw x; }); throw c; } } finally { - t.__root = e, delete t.currentTarget, ue(f), Fe(d); + e.__root = t, delete e.currentTarget, ht(f), It(h); } } } -var Da, Fa; -const Ki = (Fa = (Da = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Da.trustedTypes) == null ? void 0 : /* @__PURE__ */ Fa.createPolicy( +var Ha, Ya; +const es = (Ya = (Ha = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ha.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ya.createPolicy( "svelte-trusted-html", { /** @param {string} html */ - createHTML: (t) => t + createHTML: (e) => e } ); -function Nu(t) { +function Yu(e) { return ( /** @type {string} */ - (Ki == null ? void 0 : Ki.createHTML(t)) ?? t + (es == null ? void 0 : es.createHTML(e)) ?? e ); } -function ko(t, e = !1) { - var n = Ps("template"); - return t = t.replaceAll("", ""), n.innerHTML = e ? Nu(t) : t, n.content; +function Vl(e, t = !1) { + var n = Ds("template"); + return e = e.replaceAll("", ""), n.innerHTML = t ? Yu(e) : e, n.content; } -function Vn(t, e) { +function wn(e, t) { var n = ( /** @type {Effect} */ - U + J ); - n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); + n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function Xn(t, e) { - var n = (e & Pl) !== 0, r, i = !t.startsWith(""); +function qt(e, t) { + var n = (t & zo) !== 0, r = (t & Xo) !== 0, i, s = !e.startsWith(""); return () => { - if (J) - return Vn(H, null), H; - r === void 0 && (r = ko(i ? t : "" + t, !0)); - var s = ( + if (K) + return wn(z, null), z; + i === void 0 && (i = Vl(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ + /* @__PURE__ */ on(i))); + var a = ( /** @type {TemplateNode} */ - n || uo ? document.importNode(r, !0) : r.cloneNode(!0) + r || yl ? document.importNode(i, !0) : i.cloneNode(!0) ); - { - var a = ( + if (n) { + var l = ( /** @type {TemplateNode} */ - /* @__PURE__ */ qn(s) + /* @__PURE__ */ on(a) ), o = ( /** @type {TemplateNode} */ - s.lastChild + a.lastChild ); - Vn(a, o); - } - return s; + wn(l, o); + } else + wn(a, a); + return a; }; } // @__NO_SIDE_EFFECTS__ -function ku(t, e, n = "svg") { - var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; +function zu(e, t, n = "svg") { + var r = !e.startsWith(""), i = `<${n}>${r ? e : "" + e}`, s; return () => { - if (J) - return Vn(H, null), H; + if (K) + return wn(z, null), z; if (!s) { var a = ( /** @type {DocumentFragment} */ - ko(i, !0) - ), o = ( + Vl(i, !0) + ), l = ( /** @type {Element} */ - /* @__PURE__ */ qn(a) + /* @__PURE__ */ on(a) ); s = /** @type {Element} */ - /* @__PURE__ */ qn(o); + /* @__PURE__ */ on(l); } - var l = ( + var o = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return Vn(l, l), l; + return wn(o, o), o; }; } // @__NO_SIDE_EFFECTS__ -function Mu(t, e) { - return /* @__PURE__ */ ku(t, e, "svg"); +function Xu(e, t) { + return /* @__PURE__ */ zu(e, t, "svg"); } -function ca(t = "") { - if (!J) { - var e = le(t + ""); - return Vn(e, e), e; +function pa(e = "") { + if (!K) { + var t = nt(e + ""); + return wn(t, t), t; } - var n = H; - return n.nodeType !== Kr ? (n.before(n = le()), Ht(n)) : Ii( + var n = z; + return n.nodeType !== Kr ? (n.before(n = nt()), Fe(n)) : Hi( /** @type {Text} */ n - ), Vn(n, n), n; + ), wn(n, n), n; } -function ve(t, e) { - if (J) { +function Xe(e, t) { + if (K) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ - U + J ); - ((n.f & mr) === 0 || n.nodes.end === null) && (n.nodes.end = H), Pi(); + ((n.f & yr) === 0 || n.nodes.end === null) && (n.nodes.end = z), Fi(); return; } - t !== null && t.before( + e !== null && e.before( /** @type {Node} */ - e + t ); } -const Pu = ["touchstart", "touchmove"]; -function Du(t) { - return Pu.includes(t); +const Bu = ["touchstart", "touchmove"]; +function Wu(e) { + return Bu.includes(e); } -function ln(t, e) { - var n = e == null ? "" : typeof e == "object" ? e + "" : e; - n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); +function vn(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 Mo(t, e) { - return Po(t, e); +function Hl(e, t) { + return Yl(e, t); } -function Fu(t, e) { - ds(), e.intro = e.intro ?? !1; - const n = e.target, r = J, i = H; +function Uu(e, t) { + gs(), t.intro = t.intro ?? !1; + const n = t.target, r = K, i = z; try { - for (var s = /* @__PURE__ */ qn(n); s && (s.nodeType !== yr || /** @type {Comment} */ - s.data !== Rs); ) - s = /* @__PURE__ */ Oe(s); + for (var s = /* @__PURE__ */ on(n); s && (s.nodeType !== wr || /** @type {Comment} */ + s.data !== Ss); ) + s = /* @__PURE__ */ Ot(s); if (!s) - throw ur; - tn(!0), Ht( + throw fr; + sn(!0), Fe( /** @type {Comment} */ s ); - const a = Po(t, { ...e, anchor: s }); - return tn(!1), /** @type {Exports} */ + const a = Yl(e, { ...t, anchor: s }); + return sn(!1), /** @type {Exports} */ a; } catch (a) { if (a instanceof Error && a.message.split(` -`).some((o) => o.startsWith("https://svelte.dev/e/"))) +`).some((l) => l.startsWith("https://svelte.dev/e/"))) throw a; - return a !== ur && console.warn("Failed to hydrate: ", a), e.recover === !1 && Jl(), ds(), ho(n), tn(!1), Mo(t, e); + return a !== fr && console.warn("Failed to hydrate: ", a), t.recover === !1 && ou(), gs(), bl(n), sn(!1), Hl(e, t); } finally { - tn(r), Ht(i); - } -} -const ti = /* @__PURE__ */ new Map(); -function Po(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - ds(); - var o = /* @__PURE__ */ new Set(), l = (d) => { - for (var c = 0; c < d.length; c++) { - var p = d[c]; - if (!o.has(p)) { - o.add(p); - var g = Du(p); - for (const E of [e, document]) { - var y = ti.get(E); - y === void 0 && (y = /* @__PURE__ */ new Map(), ti.set(E, y)); - var $ = y.get(p); - $ === void 0 ? (E.addEventListener(p, fa, { passive: g }), y.set(p, 1)) : y.set(p, $ + 1); + sn(r), Fe(i); + } +} +const ei = /* @__PURE__ */ new Map(); +function Yl(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + gs(); + var l = /* @__PURE__ */ new Set(), o = (h) => { + for (var c = 0; c < h.length; c++) { + var p = h[c]; + if (!l.has(p)) { + l.add(p); + var m = Wu(p); + for (const x of [t, document]) { + var $ = ei.get(x); + $ === void 0 && ($ = /* @__PURE__ */ new Map(), ei.set(x, $)); + var _ = $.get(p); + _ === void 0 ? (x.addEventListener(p, da, { passive: m }), $.set(p, 1)) : $.set(p, _ + 1); } } } }; - l(Ni(No)), ps.add(l); - var u = void 0, f = $u(() => { - var d = n ?? e.appendChild(le()); - return fu( + o(Pi(ql)), _s.add(o); + var u = void 0, f = Iu(() => { + var h = n ?? t.appendChild(nt()); + return bu( /** @type {TemplateNode} */ - d, + h, { pending: () => { } }, (c) => { - Ss({}); + Oi({}); var p = ( /** @type {ComponentContext} */ - Qt + rt ); - if (s && (p.c = s), i && (r.$$events = i), J && Vn( + if (s && (p.c = s), i && (r.$$events = i), K && wn( /** @type {TemplateNode} */ c, null - ), u = t(c, r) || {}, J && (U.nodes.end = H, H === null || H.nodeType !== yr || /** @type {Comment} */ - H.data !== Cs)) - throw Mi(), ur; - Ns(); + ), u = e(c, r) || {}, K && (J.nodes.end = z, z === null || z.nodeType !== wr || /** @type {Comment} */ + z.data !== Ns)) + throw Ii(), fr; + Li(); } ), () => { - var y; - for (var c of o) - for (const $ of [e, document]) { + var $; + for (var c of l) + for (const _ of [t, document]) { var p = ( /** @type {Map} */ - ti.get($) - ), g = ( + ei.get(_) + ), m = ( /** @type {number} */ p.get(c) ); - --g == 0 ? ($.removeEventListener(c, fa), p.delete(c), p.size === 0 && ti.delete($)) : p.set(c, g); + --m == 0 ? (_.removeEventListener(c, da), p.delete(c), p.size === 0 && ei.delete(_)) : p.set(c, m); } - ps.delete(l), d !== n && ((y = d.parentNode) == null || y.removeChild(d)); + _s.delete(o), h !== n && (($ = h.parentNode) == null || $.removeChild(h)); }; }); - return vs.set(u, f), u; + return ms.set(u, f), u; } -let vs = /* @__PURE__ */ new WeakMap(); -function Iu(t, e) { - const n = vs.get(t); - return n ? (vs.delete(t), n(e)) : Promise.resolve(); +let ms = /* @__PURE__ */ new WeakMap(); +function Gu(e, t) { + const n = ms.get(e); + return n ? (ms.delete(e), n(t)) : Promise.resolve(); } -var ge, Me, Zt, kn, Ur, Gr, Ti; -class Ou { +var gt, Mt, et, On, Ur, Gr, ki; +class Ku { /** * @param {TemplateNode} anchor * @param {boolean} transition */ - constructor(e, n = !0) { + constructor(t, n = !0) { /** @type {TemplateNode} */ - ot(this, "anchor"); + pe(this, "anchor"); /** @type {Map} */ - q(this, ge, /* @__PURE__ */ new Map()); + L(this, gt, /* @__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. @@ -2087,150 +2091,150 @@ class Ou { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - q(this, Me, /* @__PURE__ */ new Map()); + L(this, Mt, /* @__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} */ - q(this, Zt, /* @__PURE__ */ new Map()); + L(this, et, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - q(this, kn, /* @__PURE__ */ new Set()); + L(this, On, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - q(this, Ur, !0); - q(this, Gr, () => { - var e = ( + L(this, Ur, !0); + L(this, Gr, () => { + var t = ( /** @type {Batch} */ - B + G ); - if (v(this, ge).has(e)) { + if (v(this, gt).has(t)) { var n = ( /** @type {Key} */ - v(this, ge).get(e) - ), r = v(this, Me).get(n); + v(this, gt).get(t) + ), r = v(this, Mt).get(n); if (r) - qs(r), v(this, kn).delete(n); + Vs(r), v(this, On).delete(n); else { - var i = v(this, Zt).get(n); - i && (v(this, Me).set(n, i.effect), v(this, Zt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, et).get(n); + i && (v(this, Mt).set(n, i.effect), v(this, et).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, ge)) { - if (v(this, ge).delete(s), s === e) + for (const [s, a] of v(this, gt)) { + if (v(this, gt).delete(s), s === t) break; - const o = v(this, Zt).get(a); - o && (Dt(o.effect), v(this, Zt).delete(a)); + const l = v(this, et).get(a); + l && (Oe(l.effect), v(this, et).delete(a)); } - for (const [s, a] of v(this, Me)) { - if (s === n || v(this, kn).has(s)) continue; - const o = () => { - if (Array.from(v(this, ge).values()).includes(s)) { + for (const [s, a] of v(this, Mt)) { + if (s === n || v(this, On).has(s)) continue; + const l = () => { + if (Array.from(v(this, gt).values()).includes(s)) { var u = document.createDocumentFragment(); - bo(a, u), u.append(le()), v(this, Zt).set(s, { effect: a, fragment: u }); + kl(a, u), u.append(nt()), v(this, et).set(s, { effect: a, fragment: u }); } else - Dt(a); - v(this, kn).delete(s), v(this, Me).delete(s); + Oe(a); + v(this, On).delete(s), v(this, Mt).delete(s); }; - v(this, Ur) || !r ? (v(this, kn).add(s), Dn(a, o, !1)) : o(); + v(this, Ur) || !r ? (v(this, On).add(s), qn(a, l, !1)) : l(); } } }); /** * @param {Batch} batch */ - q(this, Ti, (e) => { - v(this, ge).delete(e); - const n = Array.from(v(this, ge).values()); - for (const [r, i] of v(this, Zt)) - n.includes(r) || (Dt(i.effect), v(this, Zt).delete(r)); + L(this, ki, (t) => { + v(this, gt).delete(t); + const n = Array.from(v(this, gt).values()); + for (const [r, i] of v(this, et)) + n.includes(r) || (Oe(i.effect), v(this, et).delete(r)); }); - this.anchor = e, O(this, Ur, n); + this.anchor = t, F(this, Ur, n); } /** * * @param {any} key * @param {null | ((target: TemplateNode) => void)} fn */ - ensure(e, n) { + ensure(t, n) { var r = ( /** @type {Batch} */ - B - ), i = po(); - if (n && !v(this, Me).has(e) && !v(this, Zt).has(e)) + G + ), i = $l(); + if (n && !v(this, Mt).has(t) && !v(this, et).has(t)) if (i) { - var s = document.createDocumentFragment(), a = le(); - s.append(a), v(this, Zt).set(e, { - effect: se(() => n(a)), + var s = document.createDocumentFragment(), a = nt(); + s.append(a), v(this, et).set(t, { + effect: ut(() => n(a)), fragment: s }); } else - v(this, Me).set( - e, - se(() => n(this.anchor)) + v(this, Mt).set( + t, + ut(() => n(this.anchor)) ); - if (v(this, ge).set(r, e), i) { - for (const [o, l] of v(this, Me)) - o === e ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, Zt)) - o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, Gr)), r.ondiscard(v(this, Ti)); + if (v(this, gt).set(r, t), i) { + for (const [l, o] of v(this, Mt)) + l === t ? r.unskip_effect(o) : r.skip_effect(o); + for (const [l, o] of v(this, et)) + l === t ? r.unskip_effect(o.effect) : r.skip_effect(o.effect); + r.oncommit(v(this, Gr)), r.ondiscard(v(this, ki)); } else - J && (this.anchor = H), v(this, Gr).call(this); + K && (this.anchor = z), v(this, Gr).call(this); } } -ge = new WeakMap(), Me = new WeakMap(), Zt = new WeakMap(), kn = new WeakMap(), Ur = new WeakMap(), Gr = new WeakMap(), Ti = new WeakMap(); -function Lu(t) { - Qt === null && zl(), Fs(() => { - const e = Oi(t); - if (typeof e == "function") return ( +gt = new WeakMap(), Mt = new WeakMap(), et = new WeakMap(), On = new WeakMap(), Ur = new WeakMap(), Gr = new WeakMap(), ki = new WeakMap(); +function ju(e) { + rt === null && tu(), Fs(() => { + const t = Yi(e); + if (typeof t == "function") return ( /** @type {() => void} */ - e + t ); }); } -function Tr(t, e, n = !1) { - J && Pi(); - var r = new Ou(t), i = n ? cr : 0; - function s(a, o) { - if (J) { - const f = Ha(t); - var l; - if (f === Rs ? l = 0 : f === Si ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = mi(); - Ht(u), r.anchor = u, tn(!1), r.ensure(a, o), tn(!0); +function er(e, t, n = !1) { + K && Fi(); + var r = new Ku(e), i = n ? hr : 0; + function s(a, l) { + if (K) { + const f = Za(e); + var o; + if (f === Ss ? o = 0 : f === Mi ? o = !1 : o = parseInt(f.substring(1)), a !== o) { + var u = xi(); + Fe(u), r.anchor = u, sn(!1), r.ensure(a, l), sn(!0); return; } } - r.ensure(a, o); + r.ensure(a, l); } - Os(() => { + Ls(() => { var a = !1; - e((o, l = 0) => { - a = !0, s(l, o); + t((l, o = 0) => { + a = !0, s(o, l); }), a || s(!1, null); }, i); } -function Ji(t, e) { - return e; +function fi(e, t) { + return t; } -function qu(t, e, n) { - for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { - let d = e[o]; - Dn( - d, +function Ju(e, t, n) { + for (var r = [], i = t.length, s, a = t.length, l = 0; l < i; l++) { + let h = t[l]; + qn( + h, () => { if (s) { - if (s.pending.delete(d), s.done.add(d), s.pending.size === 0) { + if (s.pending.delete(h), s.done.add(h), s.pending.size === 0) { var c = ( /** @type {Set} */ - t.outrogroups + e.outrogroups ); - gs(Ni(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); + ys(Pi(s.done)), c.delete(s), c.size === 0 && (e.outrogroups = null); } } else a -= 1; @@ -2239,8 +2243,8 @@ function qu(t, e, n) { ); } if (a === 0) { - var l = r.length === 0 && n !== null; - if (l) { + var o = r.length === 0 && n !== null; + if (o) { var u = ( /** @type {Element} */ n @@ -2248,165 +2252,188 @@ function qu(t, e, n) { /** @type {Element} */ u.parentNode ); - ho(f), f.append(u), t.items.clear(); + bl(f), f.append(u), e.items.clear(); } - gs(e, !l); + ys(t, !o); } else s = { - pending: new Set(e), + pending: new Set(t), done: /* @__PURE__ */ new Set() - }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); -} -function gs(t, e = !0) { - for (var n = 0; n < t.length; n++) - Dt(t[n], e); -} -var ha; -function Zi(t, e, n, r, i, s = null) { - var a = t, o = /* @__PURE__ */ new Map(); - J && Pi(); - var l = null, u = /* @__PURE__ */ ro(() => { - var y = n(); - return Ia(y) ? y : y == null ? [] : Ni(y); - }), f, d = !0; - function c() { - g.fallback = l, Vu(g, f, a, e, r), l !== null && (f.length === 0 ? (l.f & cn) === 0 ? qs(l) : (l.f ^= cn, kr(l, null, a)) : Dn(l, () => { - l = null; + }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s); +} +function ys(e, t = !0) { + for (var n = 0; n < e.length; n++) + Oe(e[n], t); +} +var va; +function ci(e, t, n, r, i, s = null) { + var a = e, l = /* @__PURE__ */ new Map(), o = (t & za) !== 0; + if (o) { + var u = ( + /** @type {Element} */ + e + ); + a = K ? Fe(/* @__PURE__ */ on(u)) : u.appendChild(nt()); + } + K && Fi(); + var f = null, h = /* @__PURE__ */ dl(() => { + var x = n(); + return Ba(x) ? x : x == null ? [] : Pi(x); + }), c, p = !0; + function m() { + _.fallback = f, Zu(_, c, a, t, r), f !== null && (c.length === 0 ? (f.f & rn) === 0 ? Vs(f) : (f.f ^= rn, kr(f, null, a)) : qn(f, () => { + f = null; })); } - var p = Os(() => { - f = /** @type {V[]} */ - x(u); - var y = f.length; - let $ = !1; - if (J) { - var E = Ha(a) === Si; - E !== (y === 0) && (a = mi(), Ht(a), tn(!1), $ = !0); + var $ = Ls(() => { + c = /** @type {V[]} */ + b(h); + var x = c.length; + let D = !1; + if (K) { + var C = Za(a) === Mi; + C !== (x === 0) && (a = xi(), Fe(a), sn(!1), D = !0); } - for (var N = /* @__PURE__ */ new Set(), C = ( + for (var S = /* @__PURE__ */ new Set(), M = ( /** @type {Batch} */ - B - ), P = po(), M = 0; M < y; M += 1) { - J && H.nodeType === yr && /** @type {Comment} */ - H.data === Cs && (a = /** @type {Comment} */ - H, $ = !0, tn(!1)); - var G = f[M], ft = r(G, M), K = d ? null : o.get(ft); - K ? (K.v && pr(K.v, G), K.i && pr(K.i, M), P && C.unskip_effect(K.e)) : (K = Yu( - o, - d ? a : ha ?? (ha = le()), - G, - ft, - M, + G + ), B = $l(), j = 0; j < x; j += 1) { + K && z.nodeType === wr && /** @type {Comment} */ + z.data === Ns && (a = /** @type {Comment} */ + z, D = !0, sn(!1)); + var Q = c[j], ce = r(Q, j), X = p ? null : l.get(ce); + X ? (X.v && vr(X.v, Q), X.i && vr(X.i, j), B && M.unskip_effect(X.e)) : (X = Qu( + l, + p ? a : va ?? (va = nt()), + Q, + ce, + j, i, - e, + t, n - ), d || (K.e.f |= cn), o.set(ft, K)), N.add(ft); + ), p || (X.e.f |= rn), l.set(ce, X)), S.add(ce); } - if (y === 0 && s && !l && (d ? l = se(() => s(a)) : (l = se(() => s(ha ?? (ha = le()))), l.f |= cn)), y > N.size && Bl(), J && y > 0 && Ht(mi()), !d) - if (P) { - for (const [at, et] of o) - N.has(at) || C.skip_effect(et.e); - C.oncommit(c), C.ondiscard(() => { + if (x === 0 && s && !f && (p ? f = ut(() => s(a)) : (f = ut(() => s(va ?? (va = nt()))), f.f |= rn)), x > S.size && ru(), K && x > 0 && Fe(xi()), !p) + if (B) { + for (const [ae, le] of l) + S.has(ae) || M.skip_effect(le.e); + M.oncommit(m), M.ondiscard(() => { }); } else - c(); - $ && tn(!0), x(u); - }), g = { effect: p, items: o, outrogroups: null, fallback: l }; - d = !1, J && (a = H); -} -function Sr(t) { - for (; t !== null && (t.f & xe) === 0; ) - t = t.next; - return t; + m(); + D && sn(!0), b(h); + }), _ = { effect: $, items: l, outrogroups: null, fallback: f }; + p = !1, K && (a = z); +} +function Sr(e) { + for (; e !== null && (e.f & xt) === 0; ) + e = e.next; + return e; } -function Vu(t, e, n, r, i) { - var K; - var s = e.length, a = t.items, o = Sr(t.effect.first), l, u = null, f = [], d = [], c, p, g, y; - for (y = 0; y < s; y += 1) { - if (c = e[y], p = i(c, y), g = /** @type {EachItem} */ - a.get(p).e, t.outrogroups !== null) - for (const at of t.outrogroups) - at.pending.delete(g), at.done.delete(g); - if ((g.f & cn) !== 0) - if (g.f ^= cn, g === o) - kr(g, null, n); +function Zu(e, t, n, r, i) { + var X, ae, le, T, q, Le, st, de, Ee; + var s = (r & Oo) !== 0, a = t.length, l = e.items, o = Sr(e.effect.first), u, f = null, h, c = [], p = [], m, $, _, x; + if (s) + for (x = 0; x < a; x += 1) + m = t[x], $ = i(m, x), _ = /** @type {EachItem} */ + l.get($).e, (_.f & rn) === 0 && ((ae = (X = _.nodes) == null ? void 0 : X.a) == null || ae.measure(), (h ?? (h = /* @__PURE__ */ new Set())).add(_)); + for (x = 0; x < a; x += 1) { + if (m = t[x], $ = i(m, x), _ = /** @type {EachItem} */ + l.get($).e, e.outrogroups !== null) + for (const ee of e.outrogroups) + ee.pending.delete(_), ee.done.delete(_); + if ((_.f & rn) !== 0) + if (_.f ^= rn, _ === o) + kr(_, null, n); else { - var $ = u ? u.next : o; - g === t.effect.last && (t.effect.last = g.prev), g.prev && (g.prev.next = g.next), g.next && (g.next.prev = g.prev), un(t, u, g), un(t, g, $), kr(g, $, n), u = g, f = [], d = [], o = Sr(u.next); + var D = f ? f.next : o; + _ === e.effect.last && (e.effect.last = _.prev), _.prev && (_.prev.next = _.next), _.next && (_.next.prev = _.prev), dn(e, f, _), dn(e, _, D), kr(_, D, n), f = _, c = [], p = [], o = Sr(f.next); continue; } - if ((g.f & jt) !== 0 && qs(g), g !== o) { - if (l !== void 0 && l.has(g)) { - if (f.length < d.length) { - var E = d[0], N; - u = E.prev; - var C = f[0], P = f[f.length - 1]; - for (N = 0; N < f.length; N += 1) - kr(f[N], E, n); - for (N = 0; N < d.length; N += 1) - l.delete(d[N]); - un(t, C.prev, P.next), un(t, u, C), un(t, P, E), o = E, u = P, y -= 1, f = [], d = []; + if ((_.f & tt) !== 0 && (Vs(_), s && ((T = (le = _.nodes) == null ? void 0 : le.a) == null || T.unfix(), (h ?? (h = /* @__PURE__ */ new Set())).delete(_))), _ !== o) { + if (u !== void 0 && u.has(_)) { + if (c.length < p.length) { + var C = p[0], S; + f = C.prev; + var M = c[0], B = c[c.length - 1]; + for (S = 0; S < c.length; S += 1) + kr(c[S], C, n); + for (S = 0; S < p.length; S += 1) + u.delete(p[S]); + dn(e, M.prev, B.next), dn(e, f, M), dn(e, B, C), o = C, f = B, x -= 1, c = [], p = []; } else - l.delete(g), kr(g, o, n), un(t, g.prev, g.next), un(t, g, u === null ? t.effect.first : u.next), un(t, u, g), u = g; + u.delete(_), kr(_, o, n), dn(e, _.prev, _.next), dn(e, _, f === null ? e.effect.first : f.next), dn(e, f, _), f = _; continue; } - for (f = [], d = []; o !== null && o !== g; ) - (l ?? (l = /* @__PURE__ */ new Set())).add(o), d.push(o), o = Sr(o.next); + for (c = [], p = []; o !== null && o !== _; ) + (u ?? (u = /* @__PURE__ */ new Set())).add(o), p.push(o), o = Sr(o.next); if (o === null) continue; } - (g.f & cn) === 0 && f.push(g), u = g, o = Sr(g.next); - } - if (t.outrogroups !== null) { - for (const at of t.outrogroups) - at.pending.size === 0 && (gs(Ni(at.done)), (K = t.outrogroups) == null || K.delete(at)); - t.outrogroups.size === 0 && (t.outrogroups = null); - } - if (o !== null || l !== void 0) { - var M = []; - if (l !== void 0) - for (g of l) - (g.f & jt) === 0 && M.push(g); + (_.f & rn) === 0 && c.push(_), f = _, o = Sr(_.next); + } + if (e.outrogroups !== null) { + for (const ee of e.outrogroups) + ee.pending.size === 0 && (ys(Pi(ee.done)), (q = e.outrogroups) == null || q.delete(ee)); + e.outrogroups.size === 0 && (e.outrogroups = null); + } + if (o !== null || u !== void 0) { + var j = []; + if (u !== void 0) + for (_ of u) + (_.f & tt) === 0 && j.push(_); for (; o !== null; ) - (o.f & jt) === 0 && o !== t.fallback && M.push(o), o = Sr(o.next); - var G = M.length; - if (G > 0) { - var ft = null; - qu(t, M, ft); + (o.f & tt) === 0 && o !== e.fallback && j.push(o), o = Sr(o.next); + var Q = j.length; + if (Q > 0) { + var ce = (r & za) !== 0 && a === 0 ? n : null; + if (s) { + for (x = 0; x < Q; x += 1) + (st = (Le = j[x].nodes) == null ? void 0 : Le.a) == null || st.measure(); + for (x = 0; x < Q; x += 1) + (Ee = (de = j[x].nodes) == null ? void 0 : de.a) == null || Ee.fix(); + } + Ju(e, j, ce); } } + s && mn(() => { + var ee, Pe; + if (h !== void 0) + for (_ of h) + (Pe = (ee = _.nodes) == null ? void 0 : ee.a) == null || Pe.apply(); + }); } -function Yu(t, e, n, r, i, s, a, o) { - var l = (a & Rl) !== 0 ? (a & Tl) === 0 ? /* @__PURE__ */ oo(n, !1, !1) : Ln(n) : null, u = (a & Cl) !== 0 ? Ln(i) : null; +function Qu(e, t, n, r, i, s, a, l) { + var o = (a & Io) !== 0 ? (a & Lo) === 0 ? /* @__PURE__ */ _l(n, !1, !1) : zn(n) : null, u = (a & Fo) !== 0 ? zn(i) : null; return { - v: l, + v: o, i: u, - e: se(() => (s(e, l ?? n, u ?? i, o), () => { - t.delete(r); + e: ut(() => (s(t, o ?? n, u ?? i, l), () => { + e.delete(r); })) }; } -function kr(t, e, n) { - if (t.nodes) - for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & cn) === 0 ? ( +function kr(e, t, n) { + if (e.nodes) + for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & rn) === 0 ? ( /** @type {EffectNodes} */ - e.nodes.start + t.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Oe(r) + /* @__PURE__ */ Ot(r) ); if (s.before(r), r === i) return; r = a; } } -function un(t, e, n) { - e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; +function dn(e, t, n) { + t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t; } -function Do(t, e) { - _o(() => { - var n = t.getRootNode(), r = ( +function Hs(e, t) { + Tl(() => { + var n = e.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( /** @type {ShadowRoot} */ @@ -2417,73 +2444,129 @@ function Do(t, e) { n.ownerDocument.head ) ); - if (!r.querySelector("#" + e.hash)) { - const i = Ps("style"); - i.id = e.hash, i.textContent = e.code, r.appendChild(i); + if (!r.querySelector("#" + t.hash)) { + const i = Ds("style"); + i.id = t.hash, i.textContent = t.code, r.appendChild(i); } }); } -function da(t, e = !1) { - var n = e ? " !important;" : ";", r = ""; - for (var i in t) { - var s = t[i]; +const ga = [...` +\r\f \v\uFEFF`]; +function ef(e, t, n) { + var r = e == null ? "" : "" + e; + if (n) { + for (var i in n) + if (n[i]) + r = r ? r + " " + i : i; + else if (r.length) + for (var s = i.length, a = 0; (a = r.indexOf(i, a)) >= 0; ) { + var l = a + s; + (a === 0 || ga.includes(r[a - 1])) && (l === r.length || ga.includes(r[l])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(l + 1) : a = l; + } + } + return r === "" ? null : r; +} +function _a(e, t = !1) { + var n = t ? " !important;" : ";", r = ""; + for (var i in e) { + var s = e[i]; s != null && s !== "" && (r += " " + i + ": " + s + n); } return r; } -function Hu(t, e) { - if (e) { +function tf(e, t) { + if (t) { var n = "", r, i; - return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += da(r)), i && (n += da(i, !0)), n = n.trim(), n === "" ? null : n; - } - return String(t); + return Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, r && (n += _a(r)), i && (n += _a(i, !0)), n = n.trim(), n === "" ? null : n; + } + return String(e); +} +function ti(e, t, n, r, i, s) { + var a = e.__className; + if (K || a !== n || a === void 0) { + var l = ef(n, r, s); + (!K || l !== e.getAttribute("class")) && (l == null ? e.removeAttribute("class") : e.className = l), e.__className = n; + } else if (s && i !== s) + for (var o in s) { + var u = !!s[o]; + (i == null || u !== !!i[o]) && e.classList.toggle(o, u); + } + return s; } -function ji(t, e = {}, n, r) { +function ts(e, t = {}, n, r) { for (var i in n) { var s = n[i]; - e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); + t[i] !== s && (n[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, s, r)); } } -function pa(t, e, n, r) { - var i = t.__style; - if (J || i !== e) { - var s = Hu(e, r); - (!J || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; - } else r && (Array.isArray(r) ? (ji(t, n == null ? void 0 : n[0], r[0]), ji(t, n == null ? void 0 : n[1], r[1], "important")) : ji(t, n, r)); +function ma(e, t, n, r) { + var i = e.__style; + if (K || i !== t) { + var s = tf(t, r); + (!K || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t; + } else r && (Array.isArray(r) ? (ts(e, n == null ? void 0 : n[0], r[0]), ts(e, n == null ? void 0 : n[1], r[1], "important")) : ts(e, n, r)); return r; } -function va(t, e) { - return t === e || (t == null ? void 0 : t[Fr]) === e; +const nf = Symbol("is custom element"), rf = Symbol("is html"), sf = eu ? "link" : "LINK"; +function ya(e, t, n, r) { + var i = af(e); + K && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === sf) || i[t] !== (i[t] = n) && (t === "loading" && (e[Qo] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && lf(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); +} +function af(e) { + return ( + /** @type {Record} **/ + // @ts-expect-error + e.__attributes ?? (e.__attributes = { + [nf]: e.nodeName.includes("-"), + [rf]: e.namespaceURI === Xa + }) + ); +} +var wa = /* @__PURE__ */ new Map(); +function lf(e) { + var t = e.getAttribute("is") || e.nodeName, n = wa.get(t); + if (n) return n; + wa.set(t, n = []); + for (var r, i = e, s = Element.prototype; s !== i; ) { + r = Wo(i); + for (var a in r) + r[a].set && n.push(a); + i = Wa(i); + } + return n; +} +function xa(e, t) { + return e === t || (e == null ? void 0 : e[Ir]) === t; } -function ui(t = {}, e, n, r) { - return _o(() => { +function hi(e = {}, t, n, r) { + return Tl(() => { var i, s; - return Is(() => { - i = s, s = [], Oi(() => { - t !== n(...s) && (e(t, ...s), i && va(n(...i), t) && e(null, ...i)); + return Os(() => { + i = s, s = [], Yi(() => { + e !== n(...s) && (t(e, ...s), i && xa(n(...i), e) && t(null, ...i)); }); }), () => { - Pn(() => { - s && va(n(...s), t) && e(null, ...s); + mn(() => { + s && xa(n(...s), e) && t(null, ...s); }); }; - }), t; + }), e; } -let ei = !1; -function zu(t) { - var e = ei; +let ni = !1; +function of(e) { + var t = ni; try { - return ei = !1, [t(), ei]; + return ni = !1, [e(), ni]; } finally { - ei = e; + ni = t; } } -function vt(t, e, n, r) { - var N; - var i = (n & kl) !== 0, s = (n & Ml) !== 0, a = ( +function fe(e, t, n, r) { + var D; + var i = (n & Ho) !== 0, s = (n & Yo) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? Oi( + ), l = !0, o = () => (l && (l = !1, a = s ? Yi( /** @type {() => V} */ r ) : ( @@ -2491,186 +2574,186 @@ function vt(t, e, n, r) { r )), a), u; if (i) { - var f = Fr in t || Ya in t; - u = ((N = Mn(t, e)) == null ? void 0 : N.set) ?? (f && e in t ? (C) => t[e] = C : void 0); + var f = Ir in e || Ja in e; + u = ((D = Ln(e, t)) == null ? void 0 : D.set) ?? (f && t in e ? (C) => e[t] = C : void 0); } - var d, c = !1; - i ? [d, c] = zu(() => ( + var h, c = !1; + i ? [h, c] = of(() => ( /** @type {V} */ - t[e] - )) : d = /** @type {V} */ - t[e], d === void 0 && r !== void 0 && (d = l(), u && (Zl(), u(d))); + e[t] + )) : h = /** @type {V} */ + e[t], h === void 0 && r !== void 0 && (h = o(), u && (uu(), u(h))); var p; if (p = () => { var C = ( /** @type {V} */ - t[e] + e[t] ); - return C === void 0 ? l() : (o = !0, C); - }, (n & Nl) === 0) + return C === void 0 ? o() : (l = !0, C); + }, (n & Vo) === 0) return p; if (u) { - var g = t.$$legacy; + var m = e.$$legacy; return ( /** @type {() => V} */ - (function(C, P) { - return arguments.length > 0 ? ((!P || g || c) && u(P ? p() : C), C) : p(); + (function(C, S) { + return arguments.length > 0 ? ((!S || m || c) && u(S ? p() : C), C) : p(); }) ); } - var y = !1, $ = ((n & Sl) !== 0 ? Fi : ro)(() => (y = !1, p())); - i && x($); - var E = ( + var $ = !1, _ = ((n & qo) !== 0 ? Vi : dl)(() => ($ = !1, p())); + i && b(_); + var x = ( /** @type {Effect} */ - U + J ); return ( /** @type {() => V} */ - (function(C, P) { + (function(C, S) { if (arguments.length > 0) { - const M = P ? x($) : i ? $n(C) : C; - return lt($, M), y = !0, a !== void 0 && (a = M), C; + const M = S ? b(_) : i ? Sn(C) : C; + return ve(_, M), $ = !0, a !== void 0 && (a = M), C; } - return pn && y || (E.f & en) !== 0 ? $.v : x($); + return xn && $ || (x.f & an) !== 0 ? _.v : b(_); }) ); } -function Xu(t) { - return new Bu(t); +function uf(e) { + return new ff(e); } -var Qe, ie; -class Bu { +var nn, ot; +class ff { /** * @param {ComponentConstructorOptions & { * component: any; * }} options */ - constructor(e) { + constructor(t) { /** @type {any} */ - q(this, Qe); + L(this, nn); /** @type {Record} */ - q(this, ie); + L(this, ot); var s; - var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ oo(o, !1, !1); - return n.set(a, l), l; + var n = /* @__PURE__ */ new Map(), r = (a, l) => { + var o = /* @__PURE__ */ _l(l, !1, !1); + return n.set(a, o), o; }; const i = new Proxy( - { ...e.props || {}, $$events: {} }, + { ...t.props || {}, $$events: {} }, { - get(a, o) { - return x(n.get(o) ?? r(o, Reflect.get(a, o))); + get(a, l) { + return b(n.get(l) ?? r(l, Reflect.get(a, l))); }, - has(a, o) { - return o === Ya ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + has(a, l) { + return l === Ja ? !0 : (b(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); }, - set(a, o, l) { - return lt(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + set(a, l, o) { + return ve(n.get(l) ?? r(l, o), o), Reflect.set(a, l, o); } } ); - O(this, ie, (e.hydrate ? Fu : Mo)(e.component, { - target: e.target, - anchor: e.anchor, + F(this, ot, (t.hydrate ? Uu : Hl)(t.component, { + target: t.target, + anchor: t.anchor, props: i, - context: e.context, - intro: e.intro ?? !1, - recover: e.recover - })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && ht(), O(this, Qe, i.$$events); - for (const a of Object.keys(v(this, ie))) - a === "$set" || a === "$destroy" || a === "$on" || _i(this, a, { + context: t.context, + intro: t.intro ?? !1, + recover: t.recover + })), (!((s = t == null ? void 0 : t.props) != null && s.$$host) || t.sync === !1) && se(), F(this, nn, i.$$events); + for (const a of Object.keys(v(this, ot))) + a === "$set" || a === "$destroy" || a === "$on" || wi(this, a, { get() { - return v(this, ie)[a]; + return v(this, ot)[a]; }, /** @param {any} value */ - set(o) { - v(this, ie)[a] = o; + set(l) { + v(this, ot)[a] = l; }, enumerable: !0 }); - v(this, ie).$set = /** @param {Record} next */ + v(this, ot).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, ie).$destroy = () => { - Iu(v(this, ie)); + }, v(this, ot).$destroy = () => { + Gu(v(this, ot)); }; } /** @param {Record} props */ - $set(e) { - v(this, ie).$set(e); + $set(t) { + v(this, ot).$set(t); } /** * @param {string} event * @param {(...args: any[]) => any} callback * @returns {any} */ - $on(e, n) { - v(this, Qe)[e] = v(this, Qe)[e] || []; + $on(t, n) { + v(this, nn)[t] = v(this, nn)[t] || []; const r = (...i) => n.call(this, ...i); - return v(this, Qe)[e].push(r), () => { - v(this, Qe)[e] = v(this, Qe)[e].filter( + return v(this, nn)[t].push(r), () => { + v(this, nn)[t] = v(this, nn)[t].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, ie).$destroy(); + v(this, ot).$destroy(); } } -Qe = new WeakMap(), ie = new WeakMap(); -let Fo; -typeof HTMLElement == "function" && (Fo = class extends HTMLElement { +nn = new WeakMap(), ot = new WeakMap(); +let zl; +typeof HTMLElement == "function" && (zl = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots * @param {ShadowRootInit | undefined} shadow_root_init */ - constructor(e, n, r) { + constructor(t, n, r) { super(); /** The Svelte component constructor */ - ot(this, "$$ctor"); + pe(this, "$$ctor"); /** Slots */ - ot(this, "$$s"); + pe(this, "$$s"); /** @type {any} The Svelte component instance */ - ot(this, "$$c"); + pe(this, "$$c"); /** Whether or not the custom element is connected */ - ot(this, "$$cn", !1); + pe(this, "$$cn", !1); /** @type {Record} Component props data */ - ot(this, "$$d", {}); + pe(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - ot(this, "$$r", !1); + pe(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - ot(this, "$$p_d", {}); + pe(this, "$$p_d", {}); /** @type {Record} Event listeners */ - ot(this, "$$l", {}); + pe(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - ot(this, "$$l_u", /* @__PURE__ */ new Map()); + pe(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - ot(this, "$$me"); + pe(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - ot(this, "$$shadowRoot", null); - this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); + pe(this, "$$shadowRoot", null); + this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - addEventListener(e, n, r) { - if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) { - const i = this.$$c.$on(e, n); + addEventListener(t, n, r) { + if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) { + const i = this.$$c.$on(t, n); this.$$l_u.set(n, i); } - super.addEventListener(e, n, r); + super.addEventListener(t, n, r); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - removeEventListener(e, n, r) { - if (super.removeEventListener(e, n, r), this.$$c) { + removeEventListener(t, n, r) { + if (super.removeEventListener(t, n, r), this.$$c) { const i = this.$$l_u.get(n); i && (i(), this.$$l_u.delete(n)); } @@ -2679,23 +2762,23 @@ typeof HTMLElement == "function" && (Fo = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const o = Ps("slot"); - s !== "default" && (o.name = s), ve(a, o); + const l = Ds("slot"); + s !== "default" && (l.name = s), Xe(a, l); }; }; - var e = n; + var t = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = Wu(this); + const r = {}, i = cf(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] = fi(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = di(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 = Xu({ + this.$$c = uf({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2703,28 +2786,28 @@ typeof HTMLElement == "function" && (Fo = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = bu(() => { - Is(() => { + }), this.$$me = Du(() => { + Os(() => { var s; this.$$r = !0; - for (const a of gi(this.$$c)) { + for (const a of yi(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = fi( + const l = di( a, this.$$d[a], this.$$p_d, "toAttribute" ); - o == null ? this.removeAttribute(this.$$p_d[a].attribute || a) : this.setAttribute(this.$$p_d[a].attribute || a, o); + l == null ? this.removeAttribute(this.$$p_d[a].attribute || a) : this.setAttribute(this.$$p_d[a].attribute || a, l); } this.$$r = !1; }); }); for (const s in this.$$l) for (const a of this.$$l[s]) { - const o = this.$$c.$on(s, a); - this.$$l_u.set(a, o); + const l = this.$$c.$on(s, a); + this.$$l_u.set(a, l); } this.$$l = {}; } @@ -2736,9 +2819,9 @@ typeof HTMLElement == "function" && (Fo = class extends HTMLElement { * @param {string} _oldValue * @param {string} newValue */ - attributeChangedCallback(e, n, r) { + attributeChangedCallback(t, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = fi(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + this.$$r || (t = this.$$g_p(t), this.$$d[t] = di(t, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [t]: this.$$d[t] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2748,734 +2831,734 @@ typeof HTMLElement == "function" && (Fo = class extends HTMLElement { /** * @param {string} attribute_name */ - $$g_p(e) { - return gi(this.$$p_d).find( - (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e - ) || e; + $$g_p(t) { + return yi(this.$$p_d).find( + (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t + ) || t; } }); -function fi(t, e, n, r) { +function di(e, t, n, r) { var s; - const i = (s = n[t]) == null ? void 0 : s.type; - if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) - return e; + const i = (s = n[e]) == null ? void 0 : s.type; + if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e]) + return t; if (r === "toAttribute") switch (i) { case "Object": case "Array": - return e == null ? null : JSON.stringify(e); + return t == null ? null : JSON.stringify(t); case "Boolean": - return e ? "" : null; + return t ? "" : null; case "Number": - return e ?? null; + return t ?? null; default: - return e; + return t; } else switch (i) { case "Object": case "Array": - return e && JSON.parse(e); + return t && JSON.parse(t); case "Boolean": - return e; + return t; // conversion already handled above case "Number": - return e != null ? +e : e; + return t != null ? +t : t; default: - return e; + return t; } } -function Wu(t) { - const e = {}; - return t.childNodes.forEach((n) => { - e[ +function cf(e) { + const t = {}; + return e.childNodes.forEach((n) => { + t[ /** @type {Element} node */ n.slot || "default" ] = !0; - }), e; + }), t; } -function Io(t, e, n, r, i, s) { - let a = class extends Fo { +function Ys(e, t, n, r, i, s) { + let a = class extends zl { constructor() { - super(t, n, i), this.$$p_d = e; + super(e, n, i), this.$$p_d = t; } static get observedAttributes() { - return gi(e).map( - (o) => (e[o].attribute || o).toLowerCase() + return yi(t).map( + (l) => (t[l].attribute || l).toLowerCase() ); } }; - return gi(e).forEach((o) => { - _i(a.prototype, o, { + return yi(t).forEach((l) => { + wi(a.prototype, l, { get() { - return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; + return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l]; }, - set(l) { - var d; - l = fi(o, l, e), this.$$d[o] = l; + set(o) { + var h; + o = di(l, o, t), this.$$d[l] = o; var u = this.$$c; if (u) { - var f = (d = Mn(u, o)) == null ? void 0 : d.get; - f ? u[o] = l : u.$set({ [o]: l }); + var f = (h = Ln(u, l)) == null ? void 0 : h.get; + f ? u[l] = o : u.$set({ [l]: o }); } } }); - }), r.forEach((o) => { - _i(a.prototype, o, { + }), r.forEach((l) => { + wi(a.prototype, l, { get() { - var l; - return (l = this.$$c) == null ? void 0 : l[o]; + var o; + return (o = this.$$c) == null ? void 0 : o[l]; } }); - }), t.element = /** @type {any} */ + }), e.element = /** @type {any} */ a, a; } -var Uu = { value: () => { +var hf = { value: () => { } }; -function Oo() { - for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { - if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); +function Xl() { + 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 ci(n); + return new pi(n); } -function ci(t) { - this._ = t; +function pi(e) { + this._ = e; } -function Gu(t, e) { - return t.trim().split(/^|\s+/).map(function(n) { +function df(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 && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n); + 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 }; }); } -ci.prototype = Oo.prototype = { - constructor: ci, - on: function(t, e) { - var n = this._, r = Gu(t + "", n), i, s = -1, a = r.length; +pi.prototype = Xl.prototype = { + constructor: pi, + on: function(e, t) { + var n = this._, r = df(e + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Ku(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = pf(n[i], e.name))) return i; return; } - if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); + if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); for (; ++s < a; ) - if (i = (t = r[s]).type) n[i] = ga(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = ga(n[i], t.name, null); + if (i = (e = r[s]).type) n[i] = ba(n[i], e.name, t); + else if (t == null) for (i in n) n[i] = ba(n[i], e.name, null); return this; }, copy: function() { - var t = {}, e = this._; - for (var n in e) t[n] = e[n].slice(); - return new ci(t); + var e = {}, t = this._; + for (var n in t) e[n] = t[n].slice(); + return new pi(e); }, - call: function(t, 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]; - if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); - for (s = this._[t], r = 0, i = s.length; r < i; ++r) s[r].value.apply(e, n); + if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); + for (s = this._[e], r = 0, i = s.length; r < i; ++r) s[r].value.apply(t, n); }, - apply: function(t, e, n) { - if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); - for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); + apply: function(e, t, n) { + if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); + for (var r = this._[e], i = 0, s = r.length; i < s; ++i) r[i].value.apply(t, n); } }; -function Ku(t, e) { - for (var n = 0, r = t.length, i; n < r; ++n) - if ((i = t[n]).name === e) +function pf(e, t) { + for (var n = 0, r = e.length, i; n < r; ++n) + if ((i = e[n]).name === t) return i.value; } -function ga(t, e, n) { - for (var r = 0, i = t.length; r < i; ++r) - if (t[r].name === e) { - t[r] = Uu, t = t.slice(0, r).concat(t.slice(r + 1)); +function ba(e, t, n) { + for (var r = 0, i = e.length; r < i; ++r) + if (e[r].name === t) { + e[r] = hf, e = e.slice(0, r).concat(e.slice(r + 1)); break; } - return n != null && t.push({ name: e, value: n }), t; + return n != null && e.push({ name: t, value: n }), e; } -var _s = "http://www.w3.org/1999/xhtml"; -const _a = { +var ws = "http://www.w3.org/1999/xhtml"; +const $a = { svg: "http://www.w3.org/2000/svg", - xhtml: _s, + xhtml: ws, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Li(t) { - var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), _a.hasOwnProperty(e) ? { space: _a[e], local: t } : t; +function zi(e) { + var t = e += "", n = t.indexOf(":"); + return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), $a.hasOwnProperty(t) ? { space: $a[t], local: e } : e; } -function Ju(t) { +function vf(e) { return function() { - var e = this.ownerDocument, n = this.namespaceURI; - return n === _s && e.documentElement.namespaceURI === _s ? e.createElement(t) : e.createElementNS(n, t); + var t = this.ownerDocument, n = this.namespaceURI; + return n === ws && t.documentElement.namespaceURI === ws ? t.createElement(e) : t.createElementNS(n, e); }; } -function Zu(t) { +function gf(e) { return function() { - return this.ownerDocument.createElementNS(t.space, t.local); + return this.ownerDocument.createElementNS(e.space, e.local); }; } -function Lo(t) { - var e = Li(t); - return (e.local ? Zu : Ju)(e); +function Bl(e) { + var t = zi(e); + return (t.local ? gf : vf)(t); } -function ju() { +function _f() { } -function Vs(t) { - return t == null ? ju : function() { - return this.querySelector(t); +function zs(e) { + return e == null ? _f : function() { + return this.querySelector(e); }; } -function Qu(t) { - typeof t != "function" && (t = Vs(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) - (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new te(r, this._parents); +function mf(e) { + typeof e != "function" && (e = zs(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, l = r[i] = new Array(a), o, u, f = 0; f < a; ++f) + (o = s[f]) && (u = e.call(o, o.__data__, f, s)) && ("__data__" in o && (u.__data__ = o.__data__), l[f] = u); + return new it(r, this._parents); } -function tf(t) { - return t == null ? [] : Array.isArray(t) ? t : Array.from(t); +function yf(e) { + return e == null ? [] : Array.isArray(e) ? e : Array.from(e); } -function ef() { +function wf() { return []; } -function qo(t) { - return t == null ? ef : function() { - return this.querySelectorAll(t); +function Wl(e) { + return e == null ? wf : function() { + return this.querySelectorAll(e); }; } -function nf(t) { +function xf(e) { return function() { - return tf(t.apply(this, arguments)); + return yf(e.apply(this, arguments)); }; } -function rf(t) { - typeof t == "function" ? t = nf(t) : t = qo(t); - for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) - for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); - return new te(r, i); +function bf(e) { + typeof e == "function" ? e = xf(e) : e = Wl(e); + for (var t = this._groups, n = t.length, r = [], i = [], s = 0; s < n; ++s) + for (var a = t[s], l = a.length, o, u = 0; u < l; ++u) + (o = a[u]) && (r.push(e.call(o, o.__data__, u, a)), i.push(o)); + return new it(r, i); } -function Vo(t) { +function Ul(e) { return function() { - return this.matches(t); + return this.matches(e); }; } -function Yo(t) { - return function(e) { - return e.matches(t); +function Gl(e) { + return function(t) { + return t.matches(e); }; } -var sf = Array.prototype.find; -function af(t) { +var $f = Array.prototype.find; +function Af(e) { return function() { - return sf.call(this.children, t); + return $f.call(this.children, e); }; } -function of() { +function Ef() { return this.firstElementChild; } -function lf(t) { - return this.select(t == null ? of : af(typeof t == "function" ? t : Yo(t))); +function Tf(e) { + return this.select(e == null ? Ef : Af(typeof e == "function" ? e : Gl(e))); } -var uf = Array.prototype.filter; -function ff() { +var Rf = Array.prototype.filter; +function Cf() { return Array.from(this.children); } -function cf(t) { +function Sf(e) { return function() { - return uf.call(this.children, t); + return Rf.call(this.children, e); }; } -function hf(t) { - return this.selectAll(t == null ? ff : cf(typeof t == "function" ? t : Yo(t))); +function Nf(e) { + return this.selectAll(e == null ? Cf : Sf(typeof e == "function" ? e : Gl(e))); } -function df(t) { - typeof t != "function" && (t = Vo(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new te(r, this._parents); +function kf(e) { + typeof e != "function" && (e = Ul(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, l = r[i] = [], o, u = 0; u < a; ++u) + (o = s[u]) && e.call(o, o.__data__, u, s) && l.push(o); + return new it(r, this._parents); } -function Ho(t) { - return new Array(t.length); +function Kl(e) { + return new Array(e.length); } -function pf() { - return new te(this._enter || this._groups.map(Ho), this._parents); +function Mf() { + return new it(this._enter || this._groups.map(Kl), this._parents); } -function yi(t, e) { - this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; +function bi(e, t) { + this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; } -yi.prototype = { - constructor: yi, - appendChild: function(t) { - return this._parent.insertBefore(t, this._next); +bi.prototype = { + constructor: bi, + appendChild: function(e) { + return this._parent.insertBefore(e, this._next); }, - insertBefore: function(t, e) { - return this._parent.insertBefore(t, e); + insertBefore: function(e, t) { + return this._parent.insertBefore(e, t); }, - querySelector: function(t) { - return this._parent.querySelector(t); + querySelector: function(e) { + return this._parent.querySelector(e); }, - querySelectorAll: function(t) { - return this._parent.querySelectorAll(t); + querySelectorAll: function(e) { + return this._parent.querySelectorAll(e); } }; -function vf(t) { +function Pf(e) { return function() { - return t; + return e; }; } -function gf(t, e, n, r, i, s) { - for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new yi(t, s[a]); - for (; a < l; ++a) - (o = e[a]) && (i[a] = o); -} -function _f(t, e, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = e.length, d = s.length, c = new Array(f), p; - for (o = 0; o < f; ++o) - (l = e[o]) && (c[o] = p = a.call(l, l.__data__, o, e) + "", u.has(p) ? i[o] = l : u.set(p, l)); - for (o = 0; o < d; ++o) - p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new yi(t, s[o]); - for (o = 0; o < f; ++o) - (l = e[o]) && u.get(c[o]) === l && (i[o] = l); -} -function mf(t) { - return t.__data__; -} -function yf(t, e) { - if (!arguments.length) return Array.from(this, mf); - var n = e ? _f : gf, r = this._parents, i = this._groups; - typeof t != "function" && (t = vf(t)); - 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], d = i[u], c = d.length, p = wf(t.call(f, f && f.__data__, u, r)), g = p.length, y = o[u] = new Array(g), $ = a[u] = new Array(g), E = l[u] = new Array(c); - n(f, d, y, $, E, p, e); - for (var N = 0, C = 0, P, M; N < g; ++N) - if (P = y[N]) { - for (N >= C && (C = N + 1); !(M = $[C]) && ++C < g; ) ; - P._next = M || null; +function Df(e, t, n, r, i, s) { + for (var a = 0, l, o = t.length, u = s.length; a < u; ++a) + (l = t[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new bi(e, s[a]); + for (; a < o; ++a) + (l = t[a]) && (i[a] = l); +} +function If(e, t, n, r, i, s, a) { + var l, o, u = /* @__PURE__ */ new Map(), f = t.length, h = s.length, c = new Array(f), p; + for (l = 0; l < f; ++l) + (o = t[l]) && (c[l] = p = a.call(o, o.__data__, l, t) + "", u.has(p) ? i[l] = o : u.set(p, o)); + for (l = 0; l < h; ++l) + p = a.call(e, s[l], l, s) + "", (o = u.get(p)) ? (r[l] = o, o.__data__ = s[l], u.delete(p)) : n[l] = new bi(e, s[l]); + for (l = 0; l < f; ++l) + (o = t[l]) && u.get(c[l]) === o && (i[l] = o); +} +function Ff(e) { + return e.__data__; +} +function Of(e, t) { + if (!arguments.length) return Array.from(this, Ff); + var n = t ? If : Df, r = this._parents, i = this._groups; + typeof e != "function" && (e = Pf(e)); + for (var s = i.length, a = new Array(s), l = new Array(s), o = new Array(s), u = 0; u < s; ++u) { + var f = r[u], h = i[u], c = h.length, p = Lf(e.call(f, f && f.__data__, u, r)), m = p.length, $ = l[u] = new Array(m), _ = a[u] = new Array(m), x = o[u] = new Array(c); + n(f, h, $, _, x, p, t); + for (var D = 0, C = 0, S, M; D < m; ++D) + if (S = $[D]) { + for (D >= C && (C = D + 1); !(M = _[C]) && ++C < m; ) ; + S._next = M || null; } } - return a = new te(a, r), a._enter = o, a._exit = l, a; + return a = new it(a, r), a._enter = l, a._exit = o, a; } -function wf(t) { - return typeof t == "object" && "length" in t ? t : Array.from(t); +function Lf(e) { + return typeof e == "object" && "length" in e ? e : Array.from(e); } -function xf() { - return new te(this._exit || this._groups.map(Ho), this._parents); +function qf() { + return new it(this._exit || this._groups.map(Kl), this._parents); } -function bf(t, e, n) { +function Vf(e, t, n) { var r = this.enter(), i = this, s = this.exit(); - return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; -} -function $f(t) { - for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._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], d = u.length, c = o[l] = new Array(d), p, g = 0; g < d; ++g) - (p = u[g] || f[g]) && (c[g] = p); - for (; l < i; ++l) - o[l] = n[l]; - return new te(o, this._parents); -} -function Af() { - for (var t = this._groups, e = -1, n = t.length; ++e < n; ) - for (var r = t[e], i = r.length - 1, s = r[i], a; --i >= 0; ) + 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 Hf(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), l = new Array(i), o = 0; o < a; ++o) + for (var u = n[o], f = r[o], h = u.length, c = l[o] = new Array(h), p, m = 0; m < h; ++m) + (p = u[m] || f[m]) && (c[m] = p); + for (; o < i; ++o) + l[o] = n[o]; + return new it(l, this._parents); +} +function Yf() { + 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 Ef(t) { - t || (t = Rf); - function e(d, c) { - return d && c ? t(d.__data__, c.__data__) : !d - !c; +function zf(e) { + e || (e = Xf); + function t(h, c) { + return h && c ? e(h.__data__, c.__data__) : !h - !c; } 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(e); + for (var a = n[s], l = a.length, o = i[s] = new Array(l), u, f = 0; f < l; ++f) + (u = a[f]) && (o[f] = u); + o.sort(t); } - return new te(i, this._parents).order(); + return new it(i, this._parents).order(); } -function Rf(t, e) { - return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; +function Xf(e, t) { + return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function Cf() { - var t = arguments[0]; - return arguments[0] = this, t.apply(null, arguments), this; +function Bf() { + var e = arguments[0]; + return arguments[0] = this, e.apply(null, arguments), this; } -function Tf() { +function Wf() { return Array.from(this); } -function Sf() { - for (var t = this._groups, e = 0, n = t.length; e < n; ++e) - for (var r = t[e], i = 0, s = r.length; i < s; ++i) { +function Uf() { + 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]; if (a) return a; } return null; } -function Nf() { - let t = 0; - for (const e of this) ++t; - return t; +function Gf() { + let e = 0; + for (const t of this) ++e; + return e; } -function kf() { +function Kf() { return !this.node(); } -function Mf(t) { - for (var e = this._groups, n = 0, r = e.length; n < r; ++n) - for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) - (o = i[s]) && t.call(o, o.__data__, s, i); +function jf(e) { + for (var t = this._groups, n = 0, r = t.length; n < r; ++n) + for (var i = t[n], s = 0, a = i.length, l; s < a; ++s) + (l = i[s]) && e.call(l, l.__data__, s, i); return this; } -function Pf(t) { +function Jf(e) { return function() { - this.removeAttribute(t); + this.removeAttribute(e); }; } -function Df(t) { +function Zf(e) { return function() { - this.removeAttributeNS(t.space, t.local); + this.removeAttributeNS(e.space, e.local); }; } -function Ff(t, e) { +function Qf(e, t) { return function() { - this.setAttribute(t, e); + this.setAttribute(e, t); }; } -function If(t, e) { +function ec(e, t) { return function() { - this.setAttributeNS(t.space, t.local, e); + this.setAttributeNS(e.space, e.local, t); }; } -function Of(t, e) { +function tc(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? this.removeAttribute(t) : this.setAttribute(t, n); + var n = t.apply(this, arguments); + n == null ? this.removeAttribute(e) : this.setAttribute(e, n); }; } -function Lf(t, e) { +function nc(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); + var n = t.apply(this, arguments); + n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n); }; } -function qf(t, e) { - var n = Li(t); +function rc(e, t) { + var n = zi(e); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((e == null ? n.local ? Df : Pf : typeof e == "function" ? n.local ? Lf : Of : n.local ? If : Ff)(n, e)); + return this.each((t == null ? n.local ? Zf : Jf : typeof t == "function" ? n.local ? nc : tc : n.local ? ec : Qf)(n, t)); } -function zo(t) { - return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; +function jl(e) { + return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; } -function Vf(t) { +function ic(e) { return function() { - this.style.removeProperty(t); + this.style.removeProperty(e); }; } -function Yf(t, e, n) { +function sc(e, t, n) { return function() { - this.style.setProperty(t, e, n); + this.style.setProperty(e, t, n); }; } -function Hf(t, e, n) { +function ac(e, t, n) { return function() { - var r = e.apply(this, arguments); - r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); + var r = t.apply(this, arguments); + r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); }; } -function zf(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? Vf : typeof e == "function" ? Hf : Yf)(t, e, n ?? "")) : gr(this.node(), t); +function lc(e, t, n) { + return arguments.length > 1 ? this.each((t == null ? ic : typeof t == "function" ? ac : sc)(e, t, n ?? "")) : _r(this.node(), e); } -function gr(t, e) { - return t.style.getPropertyValue(e) || zo(t).getComputedStyle(t, null).getPropertyValue(e); +function _r(e, t) { + return e.style.getPropertyValue(t) || jl(e).getComputedStyle(e, null).getPropertyValue(t); } -function Xf(t) { +function oc(e) { return function() { - delete this[t]; + delete this[e]; }; } -function Bf(t, e) { +function uc(e, t) { return function() { - this[t] = e; + this[e] = t; }; } -function Wf(t, e) { +function fc(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? delete this[t] : this[t] = n; + var n = t.apply(this, arguments); + n == null ? delete this[e] : this[e] = n; }; } -function Uf(t, e) { - return arguments.length > 1 ? this.each((e == null ? Xf : typeof e == "function" ? Wf : Bf)(t, e)) : this.node()[t]; +function cc(e, t) { + return arguments.length > 1 ? this.each((t == null ? oc : typeof t == "function" ? fc : uc)(e, t)) : this.node()[e]; } -function Xo(t) { - return t.trim().split(/^|\s+/); +function Jl(e) { + return e.trim().split(/^|\s+/); } -function Ys(t) { - return t.classList || new Bo(t); +function Xs(e) { + return e.classList || new Zl(e); } -function Bo(t) { - this._node = t, this._names = Xo(t.getAttribute("class") || ""); +function Zl(e) { + this._node = e, this._names = Jl(e.getAttribute("class") || ""); } -Bo.prototype = { - add: function(t) { - var e = this._names.indexOf(t); - e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); +Zl.prototype = { + add: function(e) { + var t = this._names.indexOf(e); + t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" "))); }, - remove: function(t) { - var e = this._names.indexOf(t); - e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" "))); + remove: function(e) { + var t = this._names.indexOf(e); + t >= 0 && (this._names.splice(t, 1), this._node.setAttribute("class", this._names.join(" "))); }, - contains: function(t) { - return this._names.indexOf(t) >= 0; + contains: function(e) { + return this._names.indexOf(e) >= 0; } }; -function Wo(t, e) { - for (var n = Ys(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +function Ql(e, t) { + for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); } -function Uo(t, e) { - for (var n = Ys(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +function eo(e, t) { + for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); } -function Gf(t) { +function hc(e) { return function() { - Wo(this, t); + Ql(this, e); }; } -function Kf(t) { +function dc(e) { return function() { - Uo(this, t); + eo(this, e); }; } -function Jf(t, e) { +function pc(e, t) { return function() { - (e.apply(this, arguments) ? Wo : Uo)(this, t); + (t.apply(this, arguments) ? Ql : eo)(this, e); }; } -function Zf(t, e) { - var n = Xo(t + ""); +function vc(e, t) { + var n = Jl(e + ""); if (arguments.length < 2) { - for (var r = Ys(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + 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 e == "function" ? Jf : e ? Gf : Kf)(n, e)); + return this.each((typeof t == "function" ? pc : t ? hc : dc)(n, t)); } -function jf() { +function gc() { this.textContent = ""; } -function Qf(t) { +function _c(e) { return function() { - this.textContent = t; + this.textContent = e; }; } -function tc(t) { +function mc(e) { return function() { - var e = t.apply(this, arguments); - this.textContent = e ?? ""; + var t = e.apply(this, arguments); + this.textContent = t ?? ""; }; } -function ec(t) { - return arguments.length ? this.each(t == null ? jf : (typeof t == "function" ? tc : Qf)(t)) : this.node().textContent; +function yc(e) { + return arguments.length ? this.each(e == null ? gc : (typeof e == "function" ? mc : _c)(e)) : this.node().textContent; } -function nc() { +function wc() { this.innerHTML = ""; } -function rc(t) { +function xc(e) { return function() { - this.innerHTML = t; + this.innerHTML = e; }; } -function ic(t) { +function bc(e) { return function() { - var e = t.apply(this, arguments); - this.innerHTML = e ?? ""; + var t = e.apply(this, arguments); + this.innerHTML = t ?? ""; }; } -function sc(t) { - return arguments.length ? this.each(t == null ? nc : (typeof t == "function" ? ic : rc)(t)) : this.node().innerHTML; +function $c(e) { + return arguments.length ? this.each(e == null ? wc : (typeof e == "function" ? bc : xc)(e)) : this.node().innerHTML; } -function ac() { +function Ac() { this.nextSibling && this.parentNode.appendChild(this); } -function oc() { - return this.each(ac); +function Ec() { + return this.each(Ac); } -function lc() { +function Tc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function uc() { - return this.each(lc); +function Rc() { + return this.each(Tc); } -function fc(t) { - var e = typeof t == "function" ? t : Lo(t); +function Cc(e) { + var t = typeof e == "function" ? e : Bl(e); return this.select(function() { - return this.appendChild(e.apply(this, arguments)); + return this.appendChild(t.apply(this, arguments)); }); } -function cc() { +function Sc() { return null; } -function hc(t, e) { - var n = typeof t == "function" ? t : Lo(t), r = e == null ? cc : typeof e == "function" ? e : Vs(e); +function Nc(e, t) { + var n = typeof e == "function" ? e : Bl(e), r = t == null ? Sc : typeof t == "function" ? t : zs(t); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function dc() { - var t = this.parentNode; - t && t.removeChild(this); +function kc() { + var e = this.parentNode; + e && e.removeChild(this); } -function pc() { - return this.each(dc); +function Mc() { + return this.each(kc); } -function vc() { - var t = this.cloneNode(!1), e = this.parentNode; - return e ? e.insertBefore(t, this.nextSibling) : t; +function Pc() { + var e = this.cloneNode(!1), t = this.parentNode; + return t ? t.insertBefore(e, this.nextSibling) : e; } -function gc() { - var t = this.cloneNode(!0), e = this.parentNode; - return e ? e.insertBefore(t, this.nextSibling) : t; +function Dc() { + var e = this.cloneNode(!0), t = this.parentNode; + return t ? t.insertBefore(e, this.nextSibling) : e; } -function _c(t) { - return this.select(t ? gc : vc); +function Ic(e) { + return this.select(e ? Dc : Pc); } -function mc(t) { - return arguments.length ? this.property("__data__", t) : this.node().__data__; +function Fc(e) { + return arguments.length ? this.property("__data__", e) : this.node().__data__; } -function yc(t) { - return function(e) { - t.call(this, e, this.__data__); +function Oc(e) { + return function(t) { + e.call(this, t, this.__data__); }; } -function wc(t) { - return t.trim().split(/^|\s+/).map(function(e) { - var n = "", r = e.indexOf("."); - return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n }; +function Lc(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(t) { +function qc(e) { return function() { - var e = this.__on; - if (e) { - for (var n = 0, r = -1, i = e.length, s; n < i; ++n) - s = e[n], (!t.type || s.type === t.type) && s.name === t.name ? this.removeEventListener(s.type, s.listener, s.options) : e[++r] = s; - ++r ? e.length = r : delete this.__on; + var t = this.__on; + if (t) { + for (var n = 0, r = -1, i = t.length, s; n < i; ++n) + s = t[n], (!e.type || s.type === e.type) && s.name === e.name ? this.removeEventListener(s.type, s.listener, s.options) : t[++r] = s; + ++r ? t.length = r : delete this.__on; } }; } -function bc(t, e, n) { +function Vc(e, t, n) { return function() { - var r = this.__on, i, s = yc(e); + var r = this.__on, i, s = Oc(t); if (r) { - for (var a = 0, o = r.length; a < o; ++a) - if ((i = r[a]).type === t.type && i.name === t.name) { - this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = e; + for (var a = 0, l = r.length; a < l; ++a) + if ((i = r[a]).type === e.type && i.name === e.name) { + this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = t; return; } } - this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; + 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 $c(t, e, n) { - var r = wc(t + ""), i, s = r.length, a; +function Hc(e, t, n) { + var r = Lc(e + ""), i, s = r.length, a; if (arguments.length < 2) { - var o = this.node().__on; - if (o) { - for (var l = 0, u = o.length, f; l < u; ++l) - for (i = 0, f = o[l]; i < s; ++i) + var l = this.node().__on; + if (l) { + for (var o = 0, u = l.length, f; o < u; ++o) + for (i = 0, f = l[o]; i < s; ++i) if ((a = r[i]).type === f.type && a.name === f.name) return f.value; } return; } - for (o = e ? bc : xc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + for (l = t ? Vc : qc, i = 0; i < s; ++i) this.each(l(r[i], t, n)); return this; } -function Go(t, e, n) { - var r = zo(t), i = r.CustomEvent; - typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); +function to(e, t, n) { + var r = jl(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 Ac(t, e) { +function Yc(e, t) { return function() { - return Go(this, t, e); + return to(this, e, t); }; } -function Ec(t, e) { +function zc(e, t) { return function() { - return Go(this, t, e.apply(this, arguments)); + return to(this, e, t.apply(this, arguments)); }; } -function Rc(t, e) { - return this.each((typeof e == "function" ? Ec : Ac)(t, e)); +function Xc(e, t) { + return this.each((typeof t == "function" ? zc : Yc)(e, t)); } -function* Cc() { - for (var t = this._groups, e = 0, n = t.length; e < n; ++e) - for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) +function* Bc() { + 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 Ko = [null]; -function te(t, e) { - this._groups = t, this._parents = e; +var no = [null]; +function it(e, t) { + this._groups = e, this._parents = t; } -function wr() { - return new te([[document.documentElement]], Ko); +function xr() { + return new it([[document.documentElement]], no); } -function Tc() { +function Wc() { return this; } -te.prototype = wr.prototype = { - constructor: te, - select: Qu, - selectAll: rf, - selectChild: lf, - selectChildren: hf, - filter: df, - data: yf, - enter: pf, - exit: xf, - join: bf, - merge: $f, - selection: Tc, - order: Af, - sort: Ef, - call: Cf, - nodes: Tf, - node: Sf, - size: Nf, - empty: kf, - each: Mf, - attr: qf, - style: zf, - property: Uf, - classed: Zf, - text: ec, - html: sc, - raise: oc, - lower: uc, - append: fc, - insert: hc, - remove: pc, - clone: _c, - datum: mc, - on: $c, - dispatch: Rc, - [Symbol.iterator]: Cc +it.prototype = xr.prototype = { + constructor: it, + select: mf, + selectAll: bf, + selectChild: Tf, + selectChildren: Nf, + filter: kf, + data: Of, + enter: Mf, + exit: qf, + join: Vf, + merge: Hf, + selection: Wc, + order: Yf, + sort: zf, + call: Bf, + nodes: Wf, + node: Uf, + size: Gf, + empty: Kf, + each: jf, + attr: rc, + style: lc, + property: cc, + classed: vc, + text: yc, + html: $c, + raise: Ec, + lower: Rc, + append: Cc, + insert: Nc, + remove: Mc, + clone: Ic, + datum: Fc, + on: Hc, + dispatch: Xc, + [Symbol.iterator]: Bc }; -function st(t) { - return typeof t == "string" ? new te([[document.querySelector(t)]], [document.documentElement]) : new te([[t]], Ko); +function he(e) { + return typeof e == "string" ? new it([[document.querySelector(e)]], [document.documentElement]) : new it([[e]], no); } -function Hs(t, e, n) { - t.prototype = e.prototype = n, n.constructor = t; +function Bs(e, t, n) { + e.prototype = t.prototype = n, n.constructor = e; } -function Jo(t, e) { - var n = Object.create(t.prototype); - for (var r in e) n[r] = e[r]; +function ro(e, t) { + var n = Object.create(e.prototype); + for (var r in t) n[r] = t[r]; return n; } -function Zr() { +function Jr() { } -var Vr = 0.7, wi = 1 / Vr, er = "\\s*([+-]?\\d+)\\s*", Yr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", De = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Sc = /^#([0-9a-f]{3,8})$/, Nc = new RegExp(`^rgb\\(${er},${er},${er}\\)$`), kc = new RegExp(`^rgb\\(${De},${De},${De}\\)$`), Mc = new RegExp(`^rgba\\(${er},${er},${er},${Yr}\\)$`), Pc = new RegExp(`^rgba\\(${De},${De},${De},${Yr}\\)$`), Dc = new RegExp(`^hsl\\(${Yr},${De},${De}\\)$`), Fc = new RegExp(`^hsla\\(${Yr},${De},${De},${Yr}\\)$`), ma = { +var Vr = 0.7, $i = 1 / Vr, nr = "\\s*([+-]?\\d+)\\s*", Hr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Dt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Uc = /^#([0-9a-f]{3,8})$/, Gc = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), Kc = new RegExp(`^rgb\\(${Dt},${Dt},${Dt}\\)$`), jc = new RegExp(`^rgba\\(${nr},${nr},${nr},${Hr}\\)$`), Jc = new RegExp(`^rgba\\(${Dt},${Dt},${Dt},${Hr}\\)$`), Zc = new RegExp(`^hsl\\(${Hr},${Dt},${Dt}\\)$`), Qc = new RegExp(`^hsla\\(${Hr},${Dt},${Dt},${Hr}\\)$`), Aa = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3625,243 +3708,243 @@ var Vr = 0.7, wi = 1 / Vr, er = "\\s*([+-]?\\d+)\\s*", Yr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Hs(Zr, Yn, { - copy(t) { - return Object.assign(new this.constructor(), this, t); +Bs(Jr, Xn, { + copy(e) { + return Object.assign(new this.constructor(), this, e); }, displayable() { return this.rgb().displayable(); }, - hex: ya, + hex: Ea, // Deprecated! Use color.formatHex. - formatHex: ya, - formatHex8: Ic, - formatHsl: Oc, - formatRgb: wa, - toString: wa + formatHex: Ea, + formatHex8: eh, + formatHsl: th, + formatRgb: Ta, + toString: Ta }); -function ya() { +function Ea() { return this.rgb().formatHex(); } -function Ic() { +function eh() { return this.rgb().formatHex8(); } -function Oc() { - return Zo(this).formatHsl(); +function th() { + return io(this).formatHsl(); } -function wa() { +function Ta() { return this.rgb().formatRgb(); } -function Yn(t) { - var e, n; - return t = (t + "").trim().toLowerCase(), (e = Sc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? xa(e) : n === 3 ? new Yt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? ni(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? ni(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Nc.exec(t)) ? new Yt(e[1], e[2], e[3], 1) : (e = kc.exec(t)) ? new Yt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Mc.exec(t)) ? ni(e[1], e[2], e[3], e[4]) : (e = Pc.exec(t)) ? ni(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Dc.exec(t)) ? Aa(e[1], e[2] / 100, e[3] / 100, 1) : (e = Fc.exec(t)) ? Aa(e[1], e[2] / 100, e[3] / 100, e[4]) : ma.hasOwnProperty(t) ? xa(ma[t]) : t === "transparent" ? new Yt(NaN, NaN, NaN, 0) : null; +function Xn(e) { + var t, n; + return e = (e + "").trim().toLowerCase(), (t = Uc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Ra(t) : n === 3 ? new Ue(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? ri(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? ri(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 = Gc.exec(e)) ? new Ue(t[1], t[2], t[3], 1) : (t = Kc.exec(e)) ? new Ue(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = jc.exec(e)) ? ri(t[1], t[2], t[3], t[4]) : (t = Jc.exec(e)) ? ri(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = Zc.exec(e)) ? Na(t[1], t[2] / 100, t[3] / 100, 1) : (t = Qc.exec(e)) ? Na(t[1], t[2] / 100, t[3] / 100, t[4]) : Aa.hasOwnProperty(e) ? Ra(Aa[e]) : e === "transparent" ? new Ue(NaN, NaN, NaN, 0) : null; } -function xa(t) { - return new Yt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +function Ra(e) { + return new Ue(e >> 16 & 255, e >> 8 & 255, e & 255, 1); } -function ni(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new Yt(t, e, n, r); +function ri(e, t, n, r) { + return r <= 0 && (e = t = n = NaN), new Ue(e, t, n, r); } -function Lc(t) { - return t instanceof Zr || (t = Yn(t)), t ? (t = t.rgb(), new Yt(t.r, t.g, t.b, t.opacity)) : new Yt(); +function nh(e) { + return e instanceof Jr || (e = Xn(e)), e ? (e = e.rgb(), new Ue(e.r, e.g, e.b, e.opacity)) : new Ue(); } -function ms(t, e, n, r) { - return arguments.length === 1 ? Lc(t) : new Yt(t, e, n, r ?? 1); +function xs(e, t, n, r) { + return arguments.length === 1 ? nh(e) : new Ue(e, t, n, r ?? 1); } -function Yt(t, e, n, r) { - this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; +function Ue(e, t, n, r) { + this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; } -Hs(Yt, ms, Jo(Zr, { - brighter(t) { - return t = t == null ? wi : Math.pow(wi, t), new Yt(this.r * t, this.g * t, this.b * t, this.opacity); +Bs(Ue, xs, ro(Jr, { + brighter(e) { + return e = e == null ? $i : Math.pow($i, e), new Ue(this.r * e, this.g * e, this.b * e, this.opacity); }, - darker(t) { - return t = t == null ? Vr : Math.pow(Vr, t), new Yt(this.r * t, this.g * t, this.b * t, this.opacity); + darker(e) { + return e = e == null ? Vr : Math.pow(Vr, e), new Ue(this.r * e, this.g * e, this.b * e, this.opacity); }, rgb() { return this; }, clamp() { - return new Yt(In(this.r), In(this.g), In(this.b), xi(this.opacity)); + return new Ue(Hn(this.r), Hn(this.g), Hn(this.b), Ai(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: ba, + hex: Ca, // Deprecated! Use color.formatHex. - formatHex: ba, - formatHex8: qc, - formatRgb: $a, - toString: $a + formatHex: Ca, + formatHex8: rh, + formatRgb: Sa, + toString: Sa })); -function ba() { - return `#${En(this.r)}${En(this.g)}${En(this.b)}`; +function Ca() { + return `#${kn(this.r)}${kn(this.g)}${kn(this.b)}`; } -function qc() { - return `#${En(this.r)}${En(this.g)}${En(this.b)}${En((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function rh() { + return `#${kn(this.r)}${kn(this.g)}${kn(this.b)}${kn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function $a() { - const t = xi(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${In(this.r)}, ${In(this.g)}, ${In(this.b)}${t === 1 ? ")" : `, ${t})`}`; +function Sa() { + const e = Ai(this.opacity); + return `${e === 1 ? "rgb(" : "rgba("}${Hn(this.r)}, ${Hn(this.g)}, ${Hn(this.b)}${e === 1 ? ")" : `, ${e})`}`; } -function xi(t) { - return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); +function Ai(e) { + return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); } -function In(t) { - return Math.max(0, Math.min(255, Math.round(t) || 0)); +function Hn(e) { + return Math.max(0, Math.min(255, Math.round(e) || 0)); } -function En(t) { - return t = In(t), (t < 16 ? "0" : "") + t.toString(16); +function kn(e) { + return e = Hn(e), (e < 16 ? "0" : "") + e.toString(16); } -function Aa(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new _e(t, e, n, r); +function Na(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 Zo(t) { - if (t instanceof _e) return new _e(t.h, t.s, t.l, t.opacity); - if (t instanceof Zr || (t = Yn(t)), !t) return new _e(); - if (t instanceof _e) return t; - t = t.rgb(); - var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new _e(a, o, l, t.opacity); +function io(e) { + if (e instanceof _t) return new _t(e.h, e.s, e.l, e.opacity); + if (e instanceof Jr || (e = Xn(e)), !e) return new _t(); + if (e instanceof _t) 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, l = s - i, o = (s + i) / 2; + return l ? (t === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - t) / l + 2 : a = (t - n) / l + 4, l /= o < 0.5 ? s + i : 2 - s - i, a *= 60) : l = o > 0 && o < 1 ? 0 : a, new _t(a, l, o, e.opacity); } -function Vc(t, e, n, r) { - return arguments.length === 1 ? Zo(t) : new _e(t, e, n, r ?? 1); +function ih(e, t, n, r) { + return arguments.length === 1 ? io(e) : new _t(e, t, n, r ?? 1); } -function _e(t, e, n, r) { - this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; +function _t(e, t, n, r) { + this.h = +e, this.s = +t, this.l = +n, this.opacity = +r; } -Hs(_e, Vc, Jo(Zr, { - brighter(t) { - return t = t == null ? wi : Math.pow(wi, t), new _e(this.h, this.s, this.l * t, this.opacity); +Bs(_t, ih, ro(Jr, { + brighter(e) { + return e = e == null ? $i : Math.pow($i, e), new _t(this.h, this.s, this.l * e, this.opacity); }, - darker(t) { - return t = t == null ? Vr : Math.pow(Vr, t), new _e(this.h, this.s, this.l * t, this.opacity); + darker(e) { + return e = e == null ? Vr : Math.pow(Vr, e), new _t(this.h, this.s, this.l * e, this.opacity); }, rgb() { - var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; - return new Yt( - Qi(t >= 240 ? t - 240 : t + 120, i, r), - Qi(t, i, r), - Qi(t < 120 ? t + 240 : t - 120, i, r), + 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 Ue( + ns(e >= 240 ? e - 240 : e + 120, i, r), + ns(e, i, r), + ns(e < 120 ? e + 240 : e - 120, i, r), this.opacity ); }, clamp() { - return new _e(Ea(this.h), ri(this.s), ri(this.l), xi(this.opacity)); + return new _t(ka(this.h), ii(this.s), ii(this.l), Ai(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 t = xi(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${Ea(this.h)}, ${ri(this.s) * 100}%, ${ri(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const e = Ai(this.opacity); + return `${e === 1 ? "hsl(" : "hsla("}${ka(this.h)}, ${ii(this.s) * 100}%, ${ii(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; } })); -function Ea(t) { - return t = (t || 0) % 360, t < 0 ? t + 360 : t; +function ka(e) { + return e = (e || 0) % 360, e < 0 ? e + 360 : e; } -function ri(t) { - return Math.max(0, Math.min(1, t || 0)); +function ii(e) { + return Math.max(0, Math.min(1, e || 0)); } -function Qi(t, e, n) { - return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; +function ns(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 zs = (t) => () => t; -function Yc(t, e) { +const Ws = (e) => () => e; +function sh(e, t) { return function(n) { - return t + n * e; + return e + n * t; }; } -function Hc(t, e, n) { - return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) { - return Math.pow(t + r * e, n); +function ah(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 zc(t) { - return (t = +t) == 1 ? jo : function(e, n) { - return n - e ? Hc(e, n, t) : zs(isNaN(e) ? n : e); +function lh(e) { + return (e = +e) == 1 ? so : function(t, n) { + return n - t ? ah(t, n, e) : Ws(isNaN(t) ? n : t); }; } -function jo(t, e) { - var n = e - t; - return n ? Yc(t, n) : zs(isNaN(t) ? e : t); +function so(e, t) { + var n = t - e; + return n ? sh(e, n) : Ws(isNaN(e) ? t : e); } -const bi = (function t(e) { - var n = zc(e); +const Ei = (function e(t) { + var n = lh(t); function r(i, s) { - var a = n((i = ms(i)).r, (s = ms(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = jo(i.opacity, s.opacity); + var a = n((i = xs(i)).r, (s = xs(s)).r), l = n(i.g, s.g), o = n(i.b, s.b), u = so(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 i.r = a(f), i.g = l(f), i.b = o(f), i.opacity = u(f), i + ""; }; } - return r.gamma = t, r; + return r.gamma = e, r; })(1); -function Xc(t, e) { - e || (e = []); - var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; +function oh(e, t) { + t || (t = []); + var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i; return function(s) { - for (i = 0; i < n; ++i) r[i] = t[i] * (1 - s) + e[i] * s; + for (i = 0; i < n; ++i) r[i] = e[i] * (1 - s) + t[i] * s; return r; }; } -function Bc(t) { - return ArrayBuffer.isView(t) && !(t instanceof DataView); +function uh(e) { + return ArrayBuffer.isView(e) && !(e instanceof DataView); } -function Wc(t, e) { - var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Ge(t[a], e[a]); - for (; a < n; ++a) s[a] = e[a]; - return function(o) { - for (a = 0; a < r; ++a) s[a] = i[a](o); +function fh(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] = jt(e[a], t[a]); + for (; a < n; ++a) s[a] = t[a]; + return function(l) { + for (a = 0; a < r; ++a) s[a] = i[a](l); return s; }; } -function Uc(t, e) { +function ch(e, t) { var n = /* @__PURE__ */ new Date(); - return t = +t, e = +e, function(r) { - return n.setTime(t * (1 - r) + e * r), n; + return e = +e, t = +t, function(r) { + return n.setTime(e * (1 - r) + t * r), n; }; } -function Pe(t, e) { - return t = +t, e = +e, function(n) { - return t * (1 - n) + e * n; +function Pt(e, t) { + return e = +e, t = +t, function(n) { + return e * (1 - n) + t * n; }; } -function Gc(t, e) { +function hh(e, t) { var n = {}, r = {}, i; - (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); - for (i in e) - i in t ? n[i] = Ge(t[i], e[i]) : r[i] = e[i]; + (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {}); + for (i in t) + 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 ys = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ts = new RegExp(ys.source, "g"); -function Kc(t) { +var bs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, rs = new RegExp(bs.source, "g"); +function dh(e) { return function() { - return t; + return e; }; } -function Jc(t) { - return function(e) { - return t(e) + ""; +function ph(e) { + return function(t) { + return e(t) + ""; }; } -function Qo(t, e) { - var n = ys.lastIndex = ts.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = ys.exec(t)) && (i = ts.exec(e)); ) - (s = i.index) > n && (s = e.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: Pe(r, i) })), n = ts.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Jc(l[0].x) : Kc(e) : (e = l.length, function(u) { - for (var f = 0, d; f < e; ++f) o[(d = l[f]).i] = d.x(u); - return o.join(""); +function ao(e, t) { + var n = bs.lastIndex = rs.lastIndex = 0, r, i, s, a = -1, l = [], o = []; + for (e = e + "", t = t + ""; (r = bs.exec(e)) && (i = rs.exec(t)); ) + (s = i.index) > n && (s = t.slice(n, s), l[a] ? l[a] += s : l[++a] = s), (r = r[0]) === (i = i[0]) ? l[a] ? l[a] += i : l[++a] = i : (l[++a] = null, o.push({ i: a, x: Pt(r, i) })), n = rs.lastIndex; + return n < t.length && (s = t.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? o[0] ? ph(o[0].x) : dh(t) : (t = o.length, function(u) { + for (var f = 0, h; f < t; ++f) l[(h = o[f]).i] = h.x(u); + return l.join(""); }); } -function Ge(t, e) { - var n = typeof e, r; - return e == null || n === "boolean" ? zs(e) : (n === "number" ? Pe : n === "string" ? (r = Yn(e)) ? (e = r, bi) : Qo : e instanceof Yn ? bi : e instanceof Date ? Uc : Bc(e) ? Xc : Array.isArray(e) ? Wc : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Gc : Pe)(t, e); +function jt(e, t) { + var n = typeof t, r; + return t == null || n === "boolean" ? Ws(t) : (n === "number" ? Pt : n === "string" ? (r = Xn(t)) ? (t = r, Ei) : ao : t instanceof Xn ? Ei : t instanceof Date ? ch : uh(t) ? oh : Array.isArray(t) ? fh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? hh : Pt)(e, t); } -var Ra = 180 / Math.PI, ws = { +var Ma = 180 / Math.PI, $s = { translateX: 0, translateY: 0, rotate: 0, @@ -3869,213 +3952,213 @@ var Ra = 180 / Math.PI, ws = { scaleX: 1, scaleY: 1 }; -function tl(t, e, n, r, i, s) { - var a, o, l; - return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { +function lo(e, t, n, r, i, s) { + var a, l, o; + return (a = Math.sqrt(e * e + t * t)) && (e /= a, t /= a), (o = e * n + t * r) && (n -= e * o, r -= t * o), (l = Math.sqrt(n * n + r * r)) && (n /= l, r /= l, o /= l), e * r < t * n && (e = -e, t = -t, o = -o, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(e, t) * Ra, - skewX: Math.atan(l) * Ra, + rotate: Math.atan2(t, e) * Ma, + skewX: Math.atan(o) * Ma, scaleX: a, - scaleY: o + scaleY: l }; } -var ii; -function Zc(t) { - const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? ws : tl(e.a, e.b, e.c, e.d, e.e, e.f); +var si; +function vh(e) { + const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + ""); + return t.isIdentity ? $s : lo(t.a, t.b, t.c, t.d, t.e, t.f); } -function jc(t) { - return t == null || (ii || (ii = document.createElementNS("http://www.w3.org/2000/svg", "g")), ii.setAttribute("transform", t), !(t = ii.transform.baseVal.consolidate())) ? ws : (t = t.matrix, tl(t.a, t.b, t.c, t.d, t.e, t.f)); +function gh(e) { + return e == null || (si || (si = document.createElementNS("http://www.w3.org/2000/svg", "g")), si.setAttribute("transform", e), !(e = si.transform.baseVal.consolidate())) ? $s : (e = e.matrix, lo(e.a, e.b, e.c, e.d, e.e, e.f)); } -function el(t, e, n, r) { +function oo(e, t, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } - function s(u, f, d, c, p, g) { - if (u !== d || f !== c) { - var y = p.push("translate(", null, e, null, n); - g.push({ i: y - 4, x: Pe(u, d) }, { i: y - 2, x: Pe(f, c) }); - } else (d || c) && p.push("translate(" + d + e + c + n); + function s(u, f, h, c, p, m) { + if (u !== h || f !== c) { + var $ = p.push("translate(", null, t, null, n); + m.push({ i: $ - 4, x: Pt(u, h) }, { i: $ - 2, x: Pt(f, c) }); + } else (h || c) && p.push("translate(" + h + t + c + n); } - function a(u, f, d, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: d.push(i(d) + "rotate(", null, r) - 2, x: Pe(u, f) })) : f && d.push(i(d) + "rotate(" + f + r); + function a(u, f, h, c) { + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Pt(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); } - function o(u, f, d, c) { - u !== f ? c.push({ i: d.push(i(d) + "skewX(", null, r) - 2, x: Pe(u, f) }) : f && d.push(i(d) + "skewX(" + f + r); + function l(u, f, h, c) { + u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Pt(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); } - function l(u, f, d, c, p, g) { - if (u !== d || f !== c) { - var y = p.push(i(p) + "scale(", null, ",", null, ")"); - g.push({ i: y - 4, x: Pe(u, d) }, { i: y - 2, x: Pe(f, c) }); - } else (d !== 1 || c !== 1) && p.push(i(p) + "scale(" + d + "," + c + ")"); + function o(u, f, h, c, p, m) { + if (u !== h || f !== c) { + var $ = p.push(i(p) + "scale(", null, ",", null, ")"); + m.push({ i: $ - 4, x: Pt(u, h) }, { i: $ - 2, x: Pt(f, c) }); + } else (h !== 1 || c !== 1) && p.push(i(p) + "scale(" + h + "," + c + ")"); } return function(u, f) { - var d = [], c = []; - return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, d, c), a(u.rotate, f.rotate, d, c), o(u.skewX, f.skewX, d, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, d, c), u = f = null, function(p) { - for (var g = -1, y = c.length, $; ++g < y; ) d[($ = c[g]).i] = $.x(p); - return d.join(""); + var h = [], c = []; + return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, h, c), a(u.rotate, f.rotate, h, c), l(u.skewX, f.skewX, h, c), o(u.scaleX, u.scaleY, f.scaleX, f.scaleY, h, c), u = f = null, function(p) { + for (var m = -1, $ = c.length, _; ++m < $; ) h[(_ = c[m]).i] = _.x(p); + return h.join(""); }; }; } -var Qc = el(Zc, "px, ", "px)", "deg)"), th = el(jc, ", ", ")", ")"), _r = 0, Mr = 0, Nr = 0, nl = 1e3, $i, Pr, Ai = 0, Hn = 0, qi = 0, Hr = typeof performance == "object" && performance.now ? performance : Date, rl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { - setTimeout(t, 17); +var _h = oo(vh, "px, ", "px)", "deg)"), mh = oo(gh, ", ", ")", ")"), mr = 0, Mr = 0, Nr = 0, uo = 1e3, Ti, Pr, Ri = 0, Bn = 0, Xi = 0, Yr = typeof performance == "object" && performance.now ? performance : Date, fo = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { + setTimeout(e, 17); }; -function Xs() { - return Hn || (rl(eh), Hn = Hr.now() + qi); +function Us() { + return Bn || (fo(yh), Bn = Yr.now() + Xi); } -function eh() { - Hn = 0; +function yh() { + Bn = 0; } -function Ei() { +function Ci() { this._call = this._time = this._next = null; } -Ei.prototype = il.prototype = { - constructor: Ei, - restart: function(t, e, n) { - if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Xs() : +n) + (e == null ? 0 : +e), !this._next && Pr !== this && (Pr ? Pr._next = this : $i = this, Pr = this), this._call = t, this._time = n, xs(); +Ci.prototype = co.prototype = { + constructor: Ci, + restart: function(e, t, n) { + if (typeof e != "function") throw new TypeError("callback is not a function"); + n = (n == null ? Us() : +n) + (t == null ? 0 : +t), !this._next && Pr !== this && (Pr ? Pr._next = this : Ti = this, Pr = this), this._call = e, this._time = n, As(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, xs()); + this._call && (this._call = null, this._time = 1 / 0, As()); } }; -function il(t, e, n) { - var r = new Ei(); - return r.restart(t, e, n), r; -} -function nh() { - Xs(), ++_r; - for (var t = $i, e; t; ) - (e = Hn - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --_r; -} -function Ca() { - Hn = (Ai = Hr.now()) + qi, _r = Mr = 0; +function co(e, t, n) { + var r = new Ci(); + return r.restart(e, t, n), r; +} +function wh() { + Us(), ++mr; + for (var e = Ti, t; e; ) + (t = Bn - e._time) >= 0 && e._call.call(void 0, t), e = e._next; + --mr; +} +function Pa() { + Bn = (Ri = Yr.now()) + Xi, mr = Mr = 0; try { - nh(); + wh(); } finally { - _r = 0, ih(), Hn = 0; + mr = 0, bh(), Bn = 0; } } -function rh() { - var t = Hr.now(), e = t - Ai; - e > nl && (qi -= e, Ai = t); +function xh() { + var e = Yr.now(), t = e - Ri; + t > uo && (Xi -= t, Ri = e); } -function ih() { - for (var t, e = $i, n, r = 1 / 0; e; ) - e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : $i = n); - Pr = t, xs(r); +function bh() { + for (var e, t = Ti, 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 : Ti = n); + Pr = e, As(r); } -function xs(t) { - if (!_r) { +function As(e) { + if (!mr) { Mr && (Mr = clearTimeout(Mr)); - var e = t - Hn; - e > 24 ? (t < 1 / 0 && (Mr = setTimeout(Ca, t - Hr.now() - qi)), Nr && (Nr = clearInterval(Nr))) : (Nr || (Ai = Hr.now(), Nr = setInterval(rh, nl)), _r = 1, rl(Ca)); + var t = e - Bn; + t > 24 ? (e < 1 / 0 && (Mr = setTimeout(Pa, e - Yr.now() - Xi)), Nr && (Nr = clearInterval(Nr))) : (Nr || (Ri = Yr.now(), Nr = setInterval(xh, uo)), mr = 1, fo(Pa)); } } -function Ta(t, e, n) { - var r = new Ei(); - return e = e == null ? 0 : +e, r.restart((i) => { - r.stop(), t(i + e); - }, e, n), r; +function Da(e, t, n) { + var r = new Ci(); + return t = t == null ? 0 : +t, r.restart((i) => { + r.stop(), e(i + t); + }, t, n), r; } -var sh = Oo("start", "end", "cancel", "interrupt"), ah = [], sl = 0, Sa = 1, bs = 2, hi = 3, Na = 4, $s = 5, di = 6; -function Vi(t, e, n, r, i, s) { - var a = t.__transition; - if (!a) t.__transition = {}; +var $h = Xl("start", "end", "cancel", "interrupt"), Ah = [], ho = 0, Ia = 1, Es = 2, vi = 3, Fa = 4, Ts = 5, gi = 6; +function Bi(e, t, n, r, i, s) { + var a = e.__transition; + if (!a) e.__transition = {}; else if (n in a) return; - oh(t, n, { - name: e, + Eh(e, n, { + name: t, index: r, // For context during callback. group: i, // For context during callback. - on: sh, - tween: ah, + on: $h, + tween: Ah, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: sl + state: ho }); } -function Bs(t, e) { - var n = be(t, e); - if (n.state > sl) throw new Error("too late; already scheduled"); +function Gs(e, t) { + var n = bt(e, t); + if (n.state > ho) throw new Error("too late; already scheduled"); return n; } -function qe(t, e) { - var n = be(t, e); - if (n.state > hi) throw new Error("too late; already running"); +function Vt(e, t) { + var n = bt(e, t); + if (n.state > vi) throw new Error("too late; already running"); return n; } -function be(t, e) { - var n = t.__transition; - if (!n || !(n = n[e])) throw new Error("transition not found"); +function bt(e, t) { + var n = e.__transition; + if (!n || !(n = n[t])) throw new Error("transition not found"); return n; } -function oh(t, e, n) { - var r = t.__transition, i; - r[e] = n, n.timer = il(s, 0, n.time); +function Eh(e, t, n) { + var r = e.__transition, i; + r[t] = n, n.timer = co(s, 0, n.time); function s(u) { - n.state = Sa, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = Ia, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { - var f, d, c, p; - if (n.state !== Sa) return l(); + var f, h, c, p; + if (n.state !== Ia) return o(); for (f in r) if (p = r[f], p.name === n.name) { - if (p.state === hi) return Ta(a); - p.state === Na ? (p.state = di, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = di, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); + if (p.state === vi) return Da(a); + p.state === Fa ? (p.state = gi, p.timer.stop(), p.on.call("interrupt", e, e.__data__, p.index, p.group), delete r[f]) : +f < t && (p.state = gi, p.timer.stop(), p.on.call("cancel", e, e.__data__, p.index, p.group), delete r[f]); } - if (Ta(function() { - n.state === hi && (n.state = Na, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = bs, n.on.call("start", t, t.__data__, n.index, n.group), n.state === bs) { - for (n.state = hi, i = new Array(c = n.tween.length), f = 0, d = -1; f < c; ++f) - (p = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++d] = p); - i.length = d + 1; + if (Da(function() { + n.state === vi && (n.state = Fa, n.timer.restart(l, n.delay, n.time), l(u)); + }), n.state = Es, n.on.call("start", e, e.__data__, n.index, n.group), n.state === Es) { + for (n.state = vi, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) + (p = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++h] = p); + i.length = h + 1; } } - function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = $s, 1), d = -1, c = i.length; ++d < c; ) - i[d].call(t, f); - n.state === $s && (n.on.call("end", t, t.__data__, n.index, n.group), l()); + function l(u) { + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(o), n.state = Ts, 1), h = -1, c = i.length; ++h < c; ) + i[h].call(e, f); + n.state === Ts && (n.on.call("end", e, e.__data__, n.index, n.group), o()); } - function l() { - n.state = di, n.timer.stop(), delete r[e]; + function o() { + n.state = gi, n.timer.stop(), delete r[t]; for (var u in r) return; - delete t.__transition; + delete e.__transition; } } -function lh(t, e) { - var n = t.__transition, r, i, s = !0, a; +function Th(e, t) { + var n = e.__transition, r, i, s = !0, a; if (n) { - e = e == null ? null : e + ""; + t = t == null ? null : t + ""; for (a in n) { - if ((r = n[a]).name !== e) { + if ((r = n[a]).name !== t) { s = !1; continue; } - i = r.state > bs && r.state < $s, r.state = di, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > Es && r.state < Ts, r.state = gi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; } - s && delete t.__transition; + s && delete e.__transition; } } -function uh(t) { +function Rh(e) { return this.each(function() { - lh(this, t); + Th(this, e); }); } -function fh(t, e) { +function Ch(e, t) { var n, r; return function() { - var i = qe(this, t), s = i.tween; + var i = Vt(this, e), s = i.tween; if (s !== n) { r = n = s; - for (var a = 0, o = r.length; a < o; ++a) - if (r[a].name === e) { + for (var a = 0, l = r.length; a < l; ++a) + if (r[a].name === t) { r = r.slice(), r.splice(a, 1); break; } @@ -4083,1302 +4166,1318 @@ function fh(t, e) { i.tween = r; }; } -function ch(t, e, n) { +function Sh(e, t, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = qe(this, t), a = s.tween; + var s = Vt(this, e), a = s.tween; if (a !== r) { i = (r = a).slice(); - for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) - if (i[l].name === e) { - i[l] = o; + for (var l = { name: t, value: n }, o = 0, u = i.length; o < u; ++o) + if (i[o].name === t) { + i[o] = l; break; } - l === u && i.push(o); + o === u && i.push(l); } s.tween = i; }; } -function hh(t, e) { +function Nh(e, t) { var n = this._id; - if (t += "", arguments.length < 2) { - for (var r = be(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) - if ((a = r[i]).name === t) + if (e += "", arguments.length < 2) { + for (var r = bt(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + if ((a = r[i]).name === e) return a.value; return null; } - return this.each((e == null ? fh : ch)(n, t, e)); + return this.each((t == null ? Ch : Sh)(n, e, t)); } -function Ws(t, e, n) { - var r = t._id; - return t.each(function() { - var i = qe(this, r); - (i.value || (i.value = {}))[e] = n.apply(this, arguments); +function Ks(e, t, n) { + var r = e._id; + return e.each(function() { + var i = Vt(this, r); + (i.value || (i.value = {}))[t] = n.apply(this, arguments); }), function(i) { - return be(i, r).value[e]; + return bt(i, r).value[t]; }; } -function al(t, e) { +function po(e, t) { var n; - return (typeof e == "number" ? Pe : e instanceof Yn ? bi : (n = Yn(e)) ? (e = n, bi) : Qo)(t, e); + return (typeof t == "number" ? Pt : t instanceof Xn ? Ei : (n = Xn(t)) ? (t = n, Ei) : ao)(e, t); } -function dh(t) { +function kh(e) { return function() { - this.removeAttribute(t); + this.removeAttribute(e); }; } -function ph(t) { +function Mh(e) { return function() { - this.removeAttributeNS(t.space, t.local); + this.removeAttributeNS(e.space, e.local); }; } -function vh(t, e, n) { +function Ph(e, t, n) { var r, i = n + "", s; return function() { - var a = this.getAttribute(t); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = this.getAttribute(e); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function gh(t, e, n) { +function Dh(e, t, n) { var r, i = n + "", s; return function() { - var a = this.getAttributeNS(t.space, t.local); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = this.getAttributeNS(e.space, e.local); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function _h(t, e, n) { +function Ih(e, t, n) { var r, i, s; return function() { - var a, o = n(this), l; - return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); + var a, l = n(this), o; + return l == null ? void this.removeAttribute(e) : (a = this.getAttribute(e), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = t(r = a, l))); }; } -function mh(t, e, n) { +function Fh(e, t, n) { var r, i, s; return function() { - var a, o = n(this), l; - return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); + var a, l = n(this), o; + return l == null ? void this.removeAttributeNS(e.space, e.local) : (a = this.getAttributeNS(e.space, e.local), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = t(r = a, l))); }; } -function yh(t, e) { - var n = Li(t), r = n === "transform" ? th : al; - return this.attrTween(t, typeof e == "function" ? (n.local ? mh : _h)(n, r, Ws(this, "attr." + t, e)) : e == null ? (n.local ? ph : dh)(n) : (n.local ? gh : vh)(n, r, e)); +function Oh(e, t) { + var n = zi(e), r = n === "transform" ? mh : po; + return this.attrTween(e, typeof t == "function" ? (n.local ? Fh : Ih)(n, r, Ks(this, "attr." + e, t)) : t == null ? (n.local ? Mh : kh)(n) : (n.local ? Dh : Ph)(n, r, t)); } -function wh(t, e) { +function Lh(e, t) { return function(n) { - this.setAttribute(t, e.call(this, n)); + this.setAttribute(e, t.call(this, n)); }; } -function xh(t, e) { +function qh(e, t) { return function(n) { - this.setAttributeNS(t.space, t.local, e.call(this, n)); + this.setAttributeNS(e.space, e.local, t.call(this, n)); }; } -function bh(t, e) { +function Vh(e, t) { var n, r; function i() { - var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && xh(t, s)), n; + var s = t.apply(this, arguments); + return s !== r && (n = (r = s) && qh(e, s)), n; } - return i._value = e, i; + return i._value = t, i; } -function $h(t, e) { +function Hh(e, t) { var n, r; function i() { - var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && wh(t, s)), n; + var s = t.apply(this, arguments); + return s !== r && (n = (r = s) && Lh(e, s)), n; } - return i._value = e, i; + return i._value = t, i; } -function Ah(t, e) { - var n = "attr." + t; +function Yh(e, t) { + var n = "attr." + e; if (arguments.length < 2) return (n = this.tween(n)) && n._value; - if (e == null) return this.tween(n, null); - if (typeof e != "function") throw new Error(); - var r = Li(t); - return this.tween(n, (r.local ? bh : $h)(r, e)); + if (t == null) return this.tween(n, null); + if (typeof t != "function") throw new Error(); + var r = zi(e); + return this.tween(n, (r.local ? Vh : Hh)(r, t)); } -function Eh(t, e) { +function zh(e, t) { return function() { - Bs(this, t).delay = +e.apply(this, arguments); + Gs(this, e).delay = +t.apply(this, arguments); }; } -function Rh(t, e) { - return e = +e, function() { - Bs(this, t).delay = e; +function Xh(e, t) { + return t = +t, function() { + Gs(this, e).delay = t; }; } -function Ch(t) { - var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Eh : Rh)(e, t)) : be(this.node(), e).delay; +function Bh(e) { + var t = this._id; + return arguments.length ? this.each((typeof e == "function" ? zh : Xh)(t, e)) : bt(this.node(), t).delay; } -function Th(t, e) { +function Wh(e, t) { return function() { - qe(this, t).duration = +e.apply(this, arguments); + Vt(this, e).duration = +t.apply(this, arguments); }; } -function Sh(t, e) { - return e = +e, function() { - qe(this, t).duration = e; +function Uh(e, t) { + return t = +t, function() { + Vt(this, e).duration = t; }; } -function Nh(t) { - var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Th : Sh)(e, t)) : be(this.node(), e).duration; +function Gh(e) { + var t = this._id; + return arguments.length ? this.each((typeof e == "function" ? Wh : Uh)(t, e)) : bt(this.node(), t).duration; } -function kh(t, e) { - if (typeof e != "function") throw new Error(); +function Kh(e, t) { + if (typeof t != "function") throw new Error(); return function() { - qe(this, t).ease = e; + Vt(this, e).ease = t; }; } -function Mh(t) { - var e = this._id; - return arguments.length ? this.each(kh(e, t)) : be(this.node(), e).ease; +function jh(e) { + var t = this._id; + return arguments.length ? this.each(Kh(t, e)) : bt(this.node(), t).ease; } -function Ph(t, e) { +function Jh(e, t) { return function() { - var n = e.apply(this, arguments); + var n = t.apply(this, arguments); if (typeof n != "function") throw new Error(); - qe(this, t).ease = n; + Vt(this, e).ease = n; }; } -function Dh(t) { - if (typeof t != "function") throw new Error(); - return this.each(Ph(this._id, t)); -} -function Fh(t) { - typeof t != "function" && (t = Vo(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new rn(r, this._parents, this._name, this._id); -} -function Ih(t) { - if (t._id !== this._id) throw new Error(); - for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) - for (var l = e[o], u = n[o], f = l.length, d = a[o] = new Array(f), c, p = 0; p < f; ++p) - (c = l[p] || u[p]) && (d[p] = c); - for (; o < r; ++o) - a[o] = e[o]; - return new rn(a, this._parents, this._name, this._id); -} -function Oh(t) { - return (t + "").trim().split(/^|\s+/).every(function(e) { - var n = e.indexOf("."); - return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; +function Zh(e) { + if (typeof e != "function") throw new Error(); + return this.each(Jh(this._id, e)); +} +function Qh(e) { + typeof e != "function" && (e = Ul(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, l = r[i] = [], o, u = 0; u < a; ++u) + (o = s[u]) && e.call(o, o.__data__, u, s) && l.push(o); + return new un(r, this._parents, this._name, this._id); +} +function ed(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), l = 0; l < s; ++l) + for (var o = t[l], u = n[l], f = o.length, h = a[l] = new Array(f), c, p = 0; p < f; ++p) + (c = o[p] || u[p]) && (h[p] = c); + for (; l < r; ++l) + a[l] = t[l]; + return new un(a, this._parents, this._name, this._id); +} +function td(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 Lh(t, e, n) { - var r, i, s = Oh(e) ? Bs : qe; +function nd(e, t, n) { + var r, i, s = td(t) ? Gs : Vt; return function() { - var a = s(this, t), o = a.on; - o !== r && (i = (r = o).copy()).on(e, n), a.on = i; + var a = s(this, e), l = a.on; + l !== r && (i = (r = l).copy()).on(t, n), a.on = i; }; } -function qh(t, e) { +function rd(e, t) { var n = this._id; - return arguments.length < 2 ? be(this.node(), n).on.on(t) : this.each(Lh(n, t, e)); + return arguments.length < 2 ? bt(this.node(), n).on.on(e) : this.each(nd(n, e, t)); } -function Vh(t) { +function id(e) { return function() { - var e = this.parentNode; - for (var n in this.__transition) if (+n !== t) return; - e && e.removeChild(this); + var t = this.parentNode; + for (var n in this.__transition) if (+n !== e) return; + t && t.removeChild(this); }; } -function Yh() { - return this.on("end.remove", Vh(this._id)); +function sd() { + return this.on("end.remove", id(this._id)); } -function Hh(t) { - var e = this._name, n = this._id; - typeof t != "function" && (t = Vs(t)); +function ad(e) { + var t = this._name, n = this._id; + typeof e != "function" && (e = zs(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, d, c = 0; c < l; ++c) - (f = o[c]) && (d = t.call(f, f.__data__, c, o)) && ("__data__" in f && (d.__data__ = f.__data__), u[c] = d, Vi(u[c], e, n, c, u, be(f, n))); - return new rn(s, this._parents, e, n); -} -function zh(t) { - var e = this._name, n = this._id; - typeof t != "function" && (t = qo(t)); - for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) - for (var l = r[o], u = l.length, f, d = 0; d < u; ++d) - if (f = l[d]) { - for (var c = t.call(f, f.__data__, d, l), p, g = be(f, n), y = 0, $ = c.length; y < $; ++y) - (p = c[y]) && Vi(p, e, n, y, c, g); + for (var l = r[a], o = l.length, u = s[a] = new Array(o), f, h, c = 0; c < o; ++c) + (f = l[c]) && (h = e.call(f, f.__data__, c, l)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Bi(u[c], t, n, c, u, bt(f, n))); + return new un(s, this._parents, t, n); +} +function ld(e) { + var t = this._name, n = this._id; + typeof e != "function" && (e = Wl(e)); + for (var r = this._groups, i = r.length, s = [], a = [], l = 0; l < i; ++l) + for (var o = r[l], u = o.length, f, h = 0; h < u; ++h) + if (f = o[h]) { + for (var c = e.call(f, f.__data__, h, o), p, m = bt(f, n), $ = 0, _ = c.length; $ < _; ++$) + (p = c[$]) && Bi(p, t, n, $, c, m); s.push(c), a.push(f); } - return new rn(s, a, e, n); + return new un(s, a, t, n); } -var Xh = wr.prototype.constructor; -function Bh() { - return new Xh(this._groups, this._parents); +var od = xr.prototype.constructor; +function ud() { + return new od(this._groups, this._parents); } -function Wh(t, e) { +function fd(e, t) { var n, r, i; return function() { - var s = gr(this, t), a = (this.style.removeProperty(t), gr(this, t)); - return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); + var s = _r(this, e), a = (this.style.removeProperty(e), _r(this, e)); + return s === a ? null : s === n && a === r ? i : i = t(n = s, r = a); }; } -function ol(t) { +function vo(e) { return function() { - this.style.removeProperty(t); + this.style.removeProperty(e); }; } -function Uh(t, e, n) { +function cd(e, t, n) { var r, i = n + "", s; return function() { - var a = gr(this, t); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = _r(this, e); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function Gh(t, e, n) { +function hd(e, t, n) { var r, i, s; return function() { - var a = gr(this, t), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(t), gr(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + var a = _r(this, e), l = n(this), o = l + ""; + return l == null && (o = l = (this.style.removeProperty(e), _r(this, e))), a === o ? null : a === r && o === i ? s : (i = o, s = t(r = a, l)); }; } -function Kh(t, e) { - var n, r, i, s = "style." + e, a = "end." + s, o; +function dd(e, t) { + var n, r, i, s = "style." + t, a = "end." + s, l; return function() { - var l = qe(this, t), u = l.on, f = l.value[s] == null ? o || (o = ol(e)) : void 0; - (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; + var o = Vt(this, e), u = o.on, f = o.value[s] == null ? l || (l = vo(t)) : void 0; + (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), o.on = r; }; } -function Jh(t, e, n) { - var r = (t += "") == "transform" ? Qc : al; - return e == null ? this.styleTween(t, Wh(t, r)).on("end.style." + t, ol(t)) : typeof e == "function" ? this.styleTween(t, Gh(t, r, Ws(this, "style." + t, e))).each(Kh(this._id, t)) : this.styleTween(t, Uh(t, r, e), n).on("end.style." + t, null); +function pd(e, t, n) { + var r = (e += "") == "transform" ? _h : po; + return t == null ? this.styleTween(e, fd(e, r)).on("end.style." + e, vo(e)) : typeof t == "function" ? this.styleTween(e, hd(e, r, Ks(this, "style." + e, t))).each(dd(this._id, e)) : this.styleTween(e, cd(e, r, t), n).on("end.style." + e, null); } -function Zh(t, e, n) { +function vd(e, t, n) { return function(r) { - this.style.setProperty(t, e.call(this, r), n); + this.style.setProperty(e, t.call(this, r), n); }; } -function jh(t, e, n) { +function gd(e, t, n) { var r, i; function s() { - var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && Zh(t, a, n)), r; + var a = t.apply(this, arguments); + return a !== i && (r = (i = a) && vd(e, a, n)), r; } - return s._value = e, s; + return s._value = t, s; } -function Qh(t, e, n) { - var r = "style." + (t += ""); +function _d(e, t, n) { + var r = "style." + (e += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; - if (e == null) return this.tween(r, null); - if (typeof e != "function") throw new Error(); - return this.tween(r, jh(t, e, n ?? "")); + if (t == null) return this.tween(r, null); + if (typeof t != "function") throw new Error(); + return this.tween(r, gd(e, t, n ?? "")); } -function td(t) { +function md(e) { return function() { - this.textContent = t; + this.textContent = e; }; } -function ed(t) { +function yd(e) { return function() { - var e = t(this); - this.textContent = e ?? ""; + var t = e(this); + this.textContent = t ?? ""; }; } -function nd(t) { - return this.tween("text", typeof t == "function" ? ed(Ws(this, "text", t)) : td(t == null ? "" : t + "")); +function wd(e) { + return this.tween("text", typeof e == "function" ? yd(Ks(this, "text", e)) : md(e == null ? "" : e + "")); } -function rd(t) { - return function(e) { - this.textContent = t.call(this, e); +function xd(e) { + return function(t) { + this.textContent = e.call(this, t); }; } -function id(t) { - var e, n; +function bd(e) { + var t, n; function r() { - var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && rd(i)), e; + var i = e.apply(this, arguments); + return i !== n && (t = (n = i) && xd(i)), t; } - return r._value = t, r; + return r._value = e, r; } -function sd(t) { - var e = "text"; - if (arguments.length < 1) return (e = this.tween(e)) && e._value; - if (t == null) return this.tween(e, null); - if (typeof t != "function") throw new Error(); - return this.tween(e, id(t)); -} -function ad() { - for (var t = this._name, e = this._id, n = ll(), 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 = be(l, e); - Vi(l, t, n, u, a, { +function $d(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, bd(e)); +} +function Ad() { + for (var e = this._name, t = this._id, n = go(), r = this._groups, i = r.length, s = 0; s < i; ++s) + for (var a = r[s], l = a.length, o, u = 0; u < l; ++u) + if (o = a[u]) { + var f = bt(o, t); + Bi(o, e, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new rn(r, this._parents, t, n); + return new un(r, this._parents, e, n); } -function od() { - var t, e, n = this, r = n._id, i = n.size(); +function Ed() { + var e, t, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { - var o = { value: a }, l = { value: function() { + var l = { value: a }, o = { value: function() { --i === 0 && s(); } }; n.each(function() { - var u = qe(this, r), f = u.on; - f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; + var u = Vt(this, r), f = u.on; + f !== e && (t = (e = f).copy(), t._.cancel.push(l), t._.interrupt.push(l), t._.end.push(o)), u.on = t; }), i === 0 && s(); }); } -var ld = 0; -function rn(t, e, n, r) { - this._groups = t, this._parents = e, this._name = n, this._id = r; -} -function pi(t) { - return wr().transition(t); -} -function ll() { - return ++ld; -} -var Ue = wr.prototype; -rn.prototype = pi.prototype = { - constructor: rn, - select: Hh, - selectAll: zh, - selectChild: Ue.selectChild, - selectChildren: Ue.selectChildren, - filter: Fh, - merge: Ih, - selection: Bh, - transition: ad, - call: Ue.call, - nodes: Ue.nodes, - node: Ue.node, - size: Ue.size, - empty: Ue.empty, - each: Ue.each, - on: qh, - attr: yh, - attrTween: Ah, - style: Jh, - styleTween: Qh, - text: nd, - textTween: sd, - remove: Yh, - tween: hh, - delay: Ch, - duration: Nh, - ease: Mh, - easeVarying: Dh, - end: od, - [Symbol.iterator]: Ue[Symbol.iterator] +var Td = 0; +function un(e, t, n, r) { + this._groups = e, this._parents = t, this._name = n, this._id = r; +} +function _i(e) { + return xr().transition(e); +} +function go() { + return ++Td; +} +var Kt = xr.prototype; +un.prototype = _i.prototype = { + constructor: un, + select: ad, + selectAll: ld, + selectChild: Kt.selectChild, + selectChildren: Kt.selectChildren, + filter: Qh, + merge: ed, + selection: ud, + transition: Ad, + call: Kt.call, + nodes: Kt.nodes, + node: Kt.node, + size: Kt.size, + empty: Kt.empty, + each: Kt.each, + on: rd, + attr: Oh, + attrTween: Yh, + style: pd, + styleTween: _d, + text: wd, + textTween: $d, + remove: sd, + tween: Nh, + delay: Bh, + duration: Gh, + ease: jh, + easeVarying: Zh, + end: Ed, + [Symbol.iterator]: Kt[Symbol.iterator] }; -function ud(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +function Rd(e) { + return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; } -var fd = { +var Cd = { time: null, // Set on use. delay: 0, duration: 250, - ease: ud + ease: Rd }; -function cd(t, e) { - for (var n; !(n = t.__transition) || !(n = n[e]); ) - if (!(t = t.parentNode)) - throw new Error(`transition ${e} not found`); +function Sd(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 hd(t) { - var e, n; - t instanceof rn ? (e = t._id, t = t._name) : (e = ll(), (n = fd).time = Xs(), t = t == null ? null : t + ""); +function Nd(e) { + var t, n; + e instanceof un ? (t = e._id, e = e._name) : (t = go(), (n = Cd).time = Us(), 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]) && Vi(l, t, e, u, a, n || cd(l, e)); - return new rn(r, this._parents, t, e); -} -wr.prototype.interrupt = uh; -wr.prototype.transition = hd; -const As = Math.PI, Es = 2 * As, wn = 1e-6, dd = Es - wn; -function ul(t) { - this._ += t[0]; - for (let e = 1, n = t.length; e < n; ++e) - this._ += arguments[e] + t[e]; -} -function pd(t) { - let e = Math.floor(t); - if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return ul; - const n = 10 ** e; + for (var a = r[s], l = a.length, o, u = 0; u < l; ++u) + (o = a[u]) && Bi(o, e, t, u, a, n || Sd(o, t)); + return new un(r, this._parents, e, t); +} +xr.prototype.interrupt = Rh; +xr.prototype.transition = Nd; +const Rs = Math.PI, Cs = 2 * Rs, Tn = 1e-6, kd = Cs - Tn; +function _o(e) { + this._ += e[0]; + for (let t = 1, n = e.length; t < n; ++t) + this._ += arguments[t] + e[t]; +} +function Md(e) { + let t = Math.floor(e); + if (!(t >= 0)) throw new Error(`invalid digits: ${e}`); + if (t > 15) return _o; + const n = 10 ** t; return function(r) { this._ += r[0]; for (let i = 1, s = r.length; i < s; ++i) this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class vd { - constructor(e) { +class Pd { + constructor(t) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? ul : pd(e); + this._x1 = this._y1 = null, this._ = "", this._append = t == null ? _o : Md(t); } - moveTo(e, n) { - this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; + moveTo(t, n) { + this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`; } closePath() { this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`); } - lineTo(e, n) { - this._append`L${this._x1 = +e},${this._y1 = +n}`; + lineTo(t, n) { + this._append`L${this._x1 = +t},${this._y1 = +n}`; } - quadraticCurveTo(e, n, r, i) { - this._append`Q${+e},${+n},${this._x1 = +r},${this._y1 = +i}`; + quadraticCurveTo(t, n, r, i) { + this._append`Q${+t},${+n},${this._x1 = +r},${this._y1 = +i}`; } - bezierCurveTo(e, n, r, i, s, a) { - this._append`C${+e},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; + bezierCurveTo(t, n, r, i, s, a) { + this._append`C${+t},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; } - arcTo(e, n, r, i, s) { - if (e = +e, 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 - e, u = i - n, f = a - e, d = o - n, c = f * f + d * d; + 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, l = this._y1, o = r - t, u = i - n, f = a - t, h = l - n, c = f * f + h * h; if (this._x1 === null) - this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > wn) if (!(Math.abs(d * l - u * f) > wn) || !s) - this._append`L${this._x1 = e},${this._y1 = n}`; + this._append`M${this._x1 = t},${this._y1 = n}`; + else if (c > Tn) if (!(Math.abs(h * o - u * f) > Tn) || !s) + this._append`L${this._x1 = t},${this._y1 = n}`; else { - let p = r - a, g = i - o, y = l * l + u * u, $ = p * p + g * g, E = Math.sqrt(y), N = Math.sqrt(c), C = s * Math.tan((As - Math.acos((y + c - $) / (2 * E * N))) / 2), P = C / N, M = C / E; - Math.abs(P - 1) > wn && this._append`L${e + P * f},${n + P * d}`, this._append`A${s},${s},0,0,${+(d * p > f * g)},${this._x1 = e + M * l},${this._y1 = n + M * u}`; + let p = r - a, m = i - l, $ = o * o + u * u, _ = p * p + m * m, x = Math.sqrt($), D = Math.sqrt(c), C = s * Math.tan((Rs - Math.acos(($ + c - _) / (2 * x * D))) / 2), S = C / D, M = C / x; + Math.abs(S - 1) > Tn && this._append`L${t + S * f},${n + S * h}`, this._append`A${s},${s},0,0,${+(h * p > f * m)},${this._x1 = t + M * o},${this._y1 = n + M * u}`; } } - arc(e, n, r, i, s, a) { - if (e = +e, 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 = e + o, f = n + l, d = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > wn || Math.abs(this._y1 - f) > wn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Es + Es), c > dd ? this._append`A${r},${r},0,1,${d},${e - o},${n - l}A${r},${r},0,1,${d},${this._x1 = u},${this._y1 = f}` : c > wn && this._append`A${r},${r},0,${+(c >= As)},${d},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + 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 l = r * Math.cos(i), o = r * Math.sin(i), u = t + l, f = n + o, h = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Tn || Math.abs(this._y1 - f) > Tn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Cs + Cs), c > kd ? this._append`A${r},${r},0,1,${h},${t - l},${n - o}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > Tn && this._append`A${r},${r},0,${+(c >= Rs)},${h},${this._x1 = t + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } - rect(e, n, r, i) { - this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; + 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`; } toString() { return this._; } } -function gd(t) { - for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); +function Dd(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 _d = gd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Pt(t) { +const Id = Dd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Ie(e) { return function() { - return t; + return e; }; } -const ka = Math.abs, Nt = Math.atan2, yn = Math.cos, md = Math.max, es = Math.min, Ce = Math.sin, tr = Math.sqrt, Ot = 1e-12, zr = Math.PI, Ri = zr / 2, vi = 2 * zr; -function yd(t) { - return t > 1 ? 0 : t < -1 ? zr : Math.acos(t); +const Oa = Math.abs, Me = Math.atan2, En = Math.cos, Fd = Math.max, is = Math.min, Rt = Math.sin, tr = Math.sqrt, He = 1e-12, zr = Math.PI, Si = zr / 2, mi = 2 * zr; +function Od(e) { + return e > 1 ? 0 : e < -1 ? zr : Math.acos(e); } -function Ma(t) { - return t >= 1 ? Ri : t <= -1 ? -Ri : Math.asin(t); +function La(e) { + return e >= 1 ? Si : e <= -1 ? -Si : Math.asin(e); } -function wd(t) { - let e = 3; - return t.digits = function(n) { - if (!arguments.length) return e; +function Ld(e) { + let t = 3; + return e.digits = function(n) { + if (!arguments.length) return t; if (n == null) - e = null; + t = null; else { const r = Math.floor(n); if (!(r >= 0)) throw new RangeError(`invalid digits: ${n}`); - e = r; + t = r; } - return t; - }, () => new vd(e); + return e; + }, () => new Pd(t); } -function xd(t) { - return t.innerRadius; +function qd(e) { + return e.innerRadius; } -function bd(t) { - return t.outerRadius; +function Vd(e) { + return e.outerRadius; } -function $d(t) { - return t.startAngle; +function Hd(e) { + return e.startAngle; } -function Ad(t) { - return t.endAngle; +function Yd(e) { + return e.endAngle; } -function Ed(t) { - return t && t.padAngle; +function zd(e) { + return e && e.padAngle; } -function Rd(t, e, n, r, i, s, a, o) { - var l = n - t, u = r - e, f = a - i, d = o - s, c = d * l - f * u; - if (!(c * c < Ot)) - return c = (f * (e - s) - d * (t - i)) / c, [t + c * l, e + c * u]; +function Xd(e, t, n, r, i, s, a, l) { + var o = n - e, u = r - t, f = a - i, h = l - s, c = h * o - f * u; + if (!(c * c < He)) + return c = (f * (t - s) - h * (e - i)) / c, [e + c * o, t + c * u]; } -function si(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / tr(o * o + l * l), f = u * l, d = -u * o, c = t + f, p = e + d, g = n + f, y = r + d, $ = (c + g) / 2, E = (p + y) / 2, N = g - c, C = y - p, P = N * N + C * C, M = i - s, G = c * y - g * p, ft = (C < 0 ? -1 : 1) * tr(md(0, M * M * P - G * G)), K = (G * C - N * ft) / P, at = (-G * N - C * ft) / P, et = (G * C + N * ft) / P, gt = (-G * N + C * ft) / P, _t = K - $, F = at - E, I = et - $, zt = gt - E; - return _t * _t + F * F > I * I + zt * zt && (K = et, at = gt), { - cx: K, - cy: at, +function ai(e, t, n, r, i, s, a) { + var l = e - n, o = t - r, u = (a ? s : -s) / tr(l * l + o * o), f = u * o, h = -u * l, c = e + f, p = t + h, m = n + f, $ = r + h, _ = (c + m) / 2, x = (p + $) / 2, D = m - c, C = $ - p, S = D * D + C * C, M = i - s, B = c * $ - m * p, j = (C < 0 ? -1 : 1) * tr(Fd(0, M * M * S - B * B)), Q = (B * C - D * j) / S, ce = (-B * D - C * j) / S, X = (B * C + D * j) / S, ae = (-B * D + C * j) / S, le = Q - _, T = ce - x, q = X - _, Le = ae - x; + return le * le + T * T > q * q + Le * Le && (Q = X, ce = ae), { + cx: Q, + cy: ce, x01: -f, - y01: -d, - x11: K * (i / M - 1), - y11: at * (i / M - 1) + y01: -h, + x11: Q * (i / M - 1), + y11: ce * (i / M - 1) }; } -function Te() { - var t = xd, e = bd, n = Pt(0), r = null, i = $d, s = Ad, a = Ed, o = null, l = wd(u); +function Ct() { + var e = qd, t = Vd, n = Ie(0), r = null, i = Hd, s = Yd, a = zd, l = null, o = Ld(u); function u() { - var f, d, c = +t.apply(this, arguments), p = +e.apply(this, arguments), g = i.apply(this, arguments) - Ri, y = s.apply(this, arguments) - Ri, $ = ka(y - g), E = y > g; - if (o || (o = f = l()), p < c && (d = p, p = c, c = d), !(p > Ot)) o.moveTo(0, 0); - else if ($ > vi - Ot) - o.moveTo(p * yn(g), p * Ce(g)), o.arc(0, 0, p, g, y, !E), c > Ot && (o.moveTo(c * yn(y), c * Ce(y)), o.arc(0, 0, c, y, g, E)); + var f, h, c = +e.apply(this, arguments), p = +t.apply(this, arguments), m = i.apply(this, arguments) - Si, $ = s.apply(this, arguments) - Si, _ = Oa($ - m), x = $ > m; + if (l || (l = f = o()), p < c && (h = p, p = c, c = h), !(p > He)) l.moveTo(0, 0); + else if (_ > mi - He) + l.moveTo(p * En(m), p * Rt(m)), l.arc(0, 0, p, m, $, !x), c > He && (l.moveTo(c * En($), c * Rt($)), l.arc(0, 0, c, $, m, x)); else { - var N = g, C = y, P = g, M = y, G = $, ft = $, K = a.apply(this, arguments) / 2, at = K > Ot && (r ? +r.apply(this, arguments) : tr(c * c + p * p)), et = es(ka(p - c) / 2, +n.apply(this, arguments)), gt = et, _t = et, F, I; - if (at > Ot) { - var zt = Ma(at / c * Ce(K)), ee = Ma(at / p * Ce(K)); - (G -= zt * 2) > Ot ? (zt *= E ? 1 : -1, P += zt, M -= zt) : (G = 0, P = M = (g + y) / 2), (ft -= ee * 2) > Ot ? (ee *= E ? 1 : -1, N += ee, C -= ee) : (ft = 0, N = C = (g + y) / 2); + var D = m, C = $, S = m, M = $, B = _, j = _, Q = a.apply(this, arguments) / 2, ce = Q > He && (r ? +r.apply(this, arguments) : tr(c * c + p * p)), X = is(Oa(p - c) / 2, +n.apply(this, arguments)), ae = X, le = X, T, q; + if (ce > He) { + var Le = La(ce / c * Rt(Q)), st = La(ce / p * Rt(Q)); + (B -= Le * 2) > He ? (Le *= x ? 1 : -1, S += Le, M -= Le) : (B = 0, S = M = (m + $) / 2), (j -= st * 2) > He ? (st *= x ? 1 : -1, D += st, C -= st) : (j = 0, D = C = (m + $) / 2); } - var xt = p * yn(N), Ft = p * Ce(N), Ct = c * yn(M), fe = c * Ce(M); - if (et > Ot) { - var z = p * yn(C), Tt = p * Ce(C), an = c * yn(P), Z = c * Ce(P), kt; - if ($ < zr) - if (kt = Rd(xt, Ft, an, Z, z, Tt, Ct, fe)) { - var $e = xt - kt[0], Ae = Ft - kt[1], Ve = z - kt[0], pt = Tt - kt[1], Ye = 1 / Ce(yd(($e * Ve + Ae * pt) / (tr($e * $e + Ae * Ae) * tr(Ve * Ve + pt * pt))) / 2), on = tr(kt[0] * kt[0] + kt[1] * kt[1]); - gt = es(et, (c - on) / (Ye - 1)), _t = es(et, (p - on) / (Ye + 1)); + var de = p * En(D), Ee = p * Rt(D), ee = c * En(M), Pe = c * Rt(M); + if (X > He) { + var W = p * En(C), Ne = p * Rt(C), Ht = c * En(S), ne = c * Rt(S), qe; + if (_ < zr) + if (qe = Xd(de, Ee, Ht, ne, W, Ne, ee, Pe)) { + var $t = de - qe[0], At = Ee - qe[1], Yt = W - qe[0], we = Ne - qe[1], zt = 1 / Rt(Od(($t * Yt + At * we) / (tr($t * $t + At * At) * tr(Yt * Yt + we * we))) / 2), cn = tr(qe[0] * qe[0] + qe[1] * qe[1]); + ae = is(X, (c - cn) / (zt - 1)), le = is(X, (p - cn) / (zt + 1)); } else - gt = _t = 0; + ae = le = 0; } - ft > Ot ? _t > Ot ? (F = si(an, Z, xt, Ft, p, _t, E), I = si(z, Tt, Ct, fe, p, _t, E), o.moveTo(F.cx + F.x01, F.cy + F.y01), _t < et ? o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !E) : (o.arc(F.cx, F.cy, _t, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !E), o.arc(0, 0, p, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), !E), o.arc(I.cx, I.cy, _t, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !E))) : (o.moveTo(xt, Ft), o.arc(0, 0, p, N, C, !E)) : o.moveTo(xt, Ft), !(c > Ot) || !(G > Ot) ? o.lineTo(Ct, fe) : gt > Ot ? (F = si(Ct, fe, z, Tt, c, -gt, E), I = si(xt, Ft, an, Z, c, -gt, E), o.lineTo(F.cx + F.x01, F.cy + F.y01), gt < et ? o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(I.y01, I.x01), !E) : (o.arc(F.cx, F.cy, gt, Nt(F.y01, F.x01), Nt(F.y11, F.x11), !E), o.arc(0, 0, c, Nt(F.cy + F.y11, F.cx + F.x11), Nt(I.cy + I.y11, I.cx + I.x11), E), o.arc(I.cx, I.cy, gt, Nt(I.y11, I.x11), Nt(I.y01, I.x01), !E))) : o.arc(0, 0, c, M, P, E); + j > He ? le > He ? (T = ai(Ht, ne, de, Ee, p, le, x), q = ai(W, Ne, ee, Pe, p, le, x), l.moveTo(T.cx + T.x01, T.cy + T.y01), le < X ? l.arc(T.cx, T.cy, le, Me(T.y01, T.x01), Me(q.y01, q.x01), !x) : (l.arc(T.cx, T.cy, le, Me(T.y01, T.x01), Me(T.y11, T.x11), !x), l.arc(0, 0, p, Me(T.cy + T.y11, T.cx + T.x11), Me(q.cy + q.y11, q.cx + q.x11), !x), l.arc(q.cx, q.cy, le, Me(q.y11, q.x11), Me(q.y01, q.x01), !x))) : (l.moveTo(de, Ee), l.arc(0, 0, p, D, C, !x)) : l.moveTo(de, Ee), !(c > He) || !(B > He) ? l.lineTo(ee, Pe) : ae > He ? (T = ai(ee, Pe, W, Ne, c, -ae, x), q = ai(de, Ee, Ht, ne, c, -ae, x), l.lineTo(T.cx + T.x01, T.cy + T.y01), ae < X ? l.arc(T.cx, T.cy, ae, Me(T.y01, T.x01), Me(q.y01, q.x01), !x) : (l.arc(T.cx, T.cy, ae, Me(T.y01, T.x01), Me(T.y11, T.x11), !x), l.arc(0, 0, c, Me(T.cy + T.y11, T.cx + T.x11), Me(q.cy + q.y11, q.cx + q.x11), x), l.arc(q.cx, q.cy, ae, Me(q.y11, q.x11), Me(q.y01, q.x01), !x))) : l.arc(0, 0, c, M, S, x); } - if (o.closePath(), f) return o = null, f + "" || null; + if (l.closePath(), f) return l = null, f + "" || null; } return u.centroid = function() { - var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, d = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - zr / 2; - return [yn(d) * f, Ce(d) * f]; + var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - zr / 2; + return [En(h) * f, Rt(h) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Pt(+f), u) : t; + return arguments.length ? (e = typeof f == "function" ? f : Ie(+f), u) : e; }, u.outerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Pt(+f), u) : e; + return arguments.length ? (t = typeof f == "function" ? f : Ie(+f), u) : t; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Pt(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Ie(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Pt(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Ie(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Pt(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Ie(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Pt(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Ie(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Pt(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Ie(+f), u) : a; }, u.context = function(f) { - return arguments.length ? (o = f ?? null, u) : o; + return arguments.length ? (l = f ?? null, u) : l; }, u; } -function Cd(t) { - return typeof t == "object" && "length" in t ? t : Array.from(t); +function Bd(e) { + return typeof e == "object" && "length" in e ? e : Array.from(e); } -function Td(t, e) { - return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; +function Wd(e, t) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function Sd(t) { - return t; +function Ud(e) { + return e; } -function ns() { - var t = Sd, e = Td, n = null, r = Pt(0), i = Pt(vi), s = Pt(0); - function a(o) { - var l, u = (o = Cd(o)).length, f, d, c = 0, p = new Array(u), g = new Array(u), y = +r.apply(this, arguments), $ = Math.min(vi, Math.max(-vi, i.apply(this, arguments) - y)), E, N = Math.min(Math.abs($) / u, s.apply(this, arguments)), C = N * ($ < 0 ? -1 : 1), P; - for (l = 0; l < u; ++l) - (P = g[p[l] = l] = +t(o[l], l, o)) > 0 && (c += P); - for (e != null ? p.sort(function(M, G) { - return e(g[M], g[G]); - }) : n != null && p.sort(function(M, G) { - return n(o[M], o[G]); - }), l = 0, d = c ? ($ - u * C) / c : 0; l < u; ++l, y = E) - f = p[l], P = g[f], E = y + (P > 0 ? P * d : 0) + C, g[f] = { - data: o[f], - index: l, - value: P, - startAngle: y, - endAngle: E, - padAngle: N +function ss() { + var e = Ud, t = Wd, n = null, r = Ie(0), i = Ie(mi), s = Ie(0); + function a(l) { + var o, u = (l = Bd(l)).length, f, h, c = 0, p = new Array(u), m = new Array(u), $ = +r.apply(this, arguments), _ = Math.min(mi, Math.max(-mi, i.apply(this, arguments) - $)), x, D = Math.min(Math.abs(_) / u, s.apply(this, arguments)), C = D * (_ < 0 ? -1 : 1), S; + for (o = 0; o < u; ++o) + (S = m[p[o] = o] = +e(l[o], o, l)) > 0 && (c += S); + for (t != null ? p.sort(function(M, B) { + return t(m[M], m[B]); + }) : n != null && p.sort(function(M, B) { + return n(l[M], l[B]); + }), o = 0, h = c ? (_ - u * C) / c : 0; o < u; ++o, $ = x) + f = p[o], S = m[f], x = $ + (S > 0 ? S * h : 0) + C, m[f] = { + data: l[f], + index: o, + value: S, + startAngle: $, + endAngle: x, + padAngle: D }; - return g; + return m; } - return a.value = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : Pt(+o), a) : t; - }, a.sortValues = function(o) { - return arguments.length ? (e = o, n = null, a) : e; - }, a.sort = function(o) { - return arguments.length ? (n = o, e = null, a) : n; - }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Pt(+o), a) : r; - }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Pt(+o), a) : i; - }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Pt(+o), a) : s; + return a.value = function(l) { + return arguments.length ? (e = typeof l == "function" ? l : Ie(+l), a) : e; + }, a.sortValues = function(l) { + return arguments.length ? (t = l, n = null, a) : t; + }, a.sort = function(l) { + return arguments.length ? (n = l, t = null, a) : n; + }, a.startAngle = function(l) { + return arguments.length ? (r = typeof l == "function" ? l : Ie(+l), a) : r; + }, a.endAngle = function(l) { + return arguments.length ? (i = typeof l == "function" ? l : Ie(+l), a) : i; + }, a.padAngle = function(l) { + return arguments.length ? (s = typeof l == "function" ? l : Ie(+l), a) : s; }, a; } -function Dr(t, e, n) { - this.k = t, this.x = e, this.y = n; +function Dr(e, t, n) { + this.k = e, this.x = t, this.y = n; } Dr.prototype = { constructor: Dr, - scale: function(t) { - return t === 1 ? this : new Dr(this.k * t, this.x, this.y); + scale: function(e) { + return e === 1 ? this : new Dr(this.k * e, this.x, this.y); }, - translate: function(t, e) { - return t === 0 & e === 0 ? this : new Dr(this.k, this.x + this.k * t, this.y + this.k * e); + translate: function(e, t) { + return e === 0 & t === 0 ? this : new Dr(this.k, this.x + this.k * e, this.y + this.k * t); }, - apply: function(t) { - return [t[0] * this.k + this.x, t[1] * this.k + this.y]; + apply: function(e) { + return [e[0] * this.k + this.x, e[1] * this.k + this.y]; }, - applyX: function(t) { - return t * this.k + this.x; + applyX: function(e) { + return e * this.k + this.x; }, - applyY: function(t) { - return t * this.k + this.y; + applyY: function(e) { + return e * this.k + this.y; }, - invert: function(t) { - return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k]; + invert: function(e) { + return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k]; }, - invertX: function(t) { - return (t - this.x) / this.k; + invertX: function(e) { + return (e - this.x) / this.k; }, - invertY: function(t) { - return (t - this.y) / this.k; + invertY: function(e) { + return (e - this.y) / this.k; }, - rescaleX: function(t) { - return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t)); + rescaleX: function(e) { + return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e)); }, - rescaleY: function(t) { - return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t)); + rescaleY: function(e) { + return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e)); }, toString: function() { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; Dr.prototype; -var Nd = /* @__PURE__ */ Mu(''); -const kd = { +var Gd = /* @__PURE__ */ Xu(''); +const Kd = { 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 fl(t, e) { - Ss(e, !0), Do(t, kd); - let n = vt(e, "jsonData", 7), r = vt(e, "currentRound", 7, 1), i = vt(e, "mouseEventType", 15), s = vt(e, "mouseData", 15), a = vt(e, "mouseX", 15), o = vt(e, "mouseY", 15), l = vt(e, "requestRoundChange", 7, (h) => { - }), u = vt(e, "candidateColors", 23, () => []), f = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), d = vt(e, "firstRoundDeterminesPercentages", 7, !1), c = vt(e, "displayPhase", 15, 0); - function p(h) { - return h.isTransfer ? `${h.label}__transfer` : h.transferIndex != null ? `${h.label}__${h.transferIndex}` : h.label; - } - const g = 800, y = 800, $ = Math.min(g, y) * 0.3, E = g / 2, N = y / 2, C = "Pie", P = "PieOutline", M = "Donut", G = "TextLayer", ft = "url(#cross-hatch)", K = 1.15, at = 0.1, et = 750, gt = 800, _t = "white", F = 1, I = "#ff00ff", zt = 3; - function ee(h) { - return "hatch-" + h.replace(/[^a-zA-Z0-9]/g, "-"); - } - let xt = [], Ft = [], Ct = [], fe = 0, z = 0; - const Tt = {}, an = "No Further Rankings"; - let Z = /* @__PURE__ */ yt(null); - function kt() { - const h = st(x(Z)); - h.select("#" + C).remove(), h.select("#" + P).remove(), h.select("#" + M).remove(), h.select("#" + G).remove(); - } - function $e(h) { - l() && (nt = h, l()(h)); - } - function Ae(h) { - kt(), Ct = Ve(h), xt = Ks(h, C, Ct, E, N, 0, pt()), Ks(h, P, Ct, E, N, 0, pt(), !1, !1, !0), Rr(); - } - Lu(() => { - It(), setTimeout( +function mo(e, t) { + Oi(t, !0), Hs(e, Kd); + let n = fe(t, "jsonData", 7), r = fe(t, "currentRound", 7, 1), i = fe(t, "mouseEventType", 15), s = fe(t, "mouseData", 15), a = fe(t, "mouseX", 15), l = fe(t, "mouseY", 15), o = fe(t, "requestRoundChange", 7, (d) => { + }), u = fe(t, "candidateColors", 23, () => []), f = fe(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = fe(t, "firstRoundDeterminesPercentages", 7, !1), c = fe(t, "displayPhase", 15, 0); + function p(d) { + return d.isTransfer ? `${d.label}__transfer` : d.transferIndex != null ? `${d.label}__${d.transferIndex}` : d.label; + } + const m = 800, $ = 800, _ = Math.min(m, $) * 0.3, x = m / 2, D = $ / 2, C = "Pie", S = "PieOutline", M = "Donut", B = "TextLayer", j = "url(#cross-hatch)", Q = 1.15, ce = 0.1, X = 750, ae = 800, le = "white", T = 1, q = "#ff00ff", Le = 3; + function st(d) { + return "hatch-" + d.replace(/[^a-zA-Z0-9]/g, "-"); + } + let de = [], Ee = [], ee = [], Pe = 0, W = 0; + const Ne = {}, Ht = "No Further Rankings"; + let ne = /* @__PURE__ */ $e(null); + function qe() { + const d = he(b(ne)); + d.select("#" + C).remove(), d.select("#" + S).remove(), d.select("#" + M).remove(), d.select("#" + B).remove(); + } + function $t(d) { + o() && (oe = d, o()(d)); + } + function At(d) { + qe(), ee = Yt(d), de = Zs(d, C, ee, x, D, 0, we()), Zs(d, S, ee, x, D, 0, we(), !1, !1, !0), Rr(); + } + ju(() => { + Ve(), setTimeout( () => { - Ae(r()); + At(r()); }, 0 ); }); - function Ve(h) { - const _ = bt(h); - return fe = xr(h), _; + function Yt(d) { + const g = _e(d); + return Pe = br(d), g; } - function pt() { - return $; - } - function Ye() { - return pt() * 1.41; - } - function on(h) { - let _ = 0; - for (let m = 1; m < h; m++) { - const A = n().results[m - 1].tallyResults; - for (let b = 0; b < A.length; b++) { - const T = A[b].transfers; - if (T) { - const D = T.exhausted; - D && (_ += Number(D)); + function we() { + return _; + } + function zt() { + return we() * 1.41; + } + function cn(d) { + let g = 0; + for (let y = 1; y < d; y++) { + const E = n().results[y - 1].tallyResults; + for (let A = 0; A < E.length; A++) { + const N = E[A].transfers; + if (N) { + const I = N.exhausted; + I && (g += Number(I)); } } } - return _; + return g; } - function jr(h, _) { - if (h === "exhausted") return on(_); + function Zr(d, g) { + if (d === "exhausted") return cn(g); { - const m = n().results[_ - 1].tally; - return Number(m[h]); + const y = n().results[g - 1].tally; + return Number(y[d]); } } - function Yi(h, _) { - return jr(h, _).toLocaleString("en-US"); + function Wi(d, g) { + return Zr(d, g).toLocaleString("en-US"); } - function Bn(h, _) { - const m = d() ? fe : Hi(_); - return (jr(h, _) / m).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Un(d, g) { + const y = h() ? Pe : Ui(g); + return (Zr(d, g) / y).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function xr(h) { - const _ = n().results[h - 1].tally; - let m = 0; - for (let [A, b] of Object.entries(_)) - m += Number(b); - return m; + function br(d) { + const g = n().results[d - 1].tally; + let y = 0; + for (let [E, A] of Object.entries(g)) + y += Number(A); + return y; } - function br(h) { - return h === "exhausted" || h === "Inactive Ballots"; + function $r(d) { + return d === "exhausted" || d === "Inactive Ballots"; } - function Hi(h) { - const _ = n().results[h - 1].tally; - let m = 0; - for (let [A, b] of Object.entries(_)) - br(A) || (m += Number(b)); - return m; + function Ui(d) { + const g = n().results[d - 1].tally; + let y = 0; + for (let [E, A] of Object.entries(g)) + $r(E) || (y += Number(A)); + return y; } - function Wn(h, _) { - if (!h || h < 1 || h > n().results.length) + function Gn(d, g) { + if (!d || d < 1 || d > n().results.length) return console.warn("In chosenCandidates: round ${round} is out of range."), []; - if (f() && h === n().results.length) + if (f() && d === n().results.length) return []; - const m = n().results[h - 1].tallyResults, A = []; - for (let b = 0; b < m.length; b++) { - const T = m[b][_]; - T != null && A.push(T); + const y = n().results[d - 1].tallyResults, E = []; + for (let A = 0; A < y.length; A++) { + const N = y[A][g]; + N != null && E.push(N); } - return A; - } - function Un(h) { - return Wn(h, "eliminated"); - } - function w(h) { - let _ = []; - for (let m = 1; m <= h; m++) _ = _.concat(Wn(m, "elected")); - return [...new Set(_)]; - } - function W(h, _) { - const m = n().results[_ - 1].tallyResults; - let A = 0; - const b = m.findIndex((T) => (T == null ? void 0 : T.elected) && h == T.elected); - if (b >= 0) { - const T = m[b].transfers; - if (T) - for (let [D, V] of Object.entries(T)) A += Number(V); + return E; + } + function Kn(d) { + return Gn(d, "eliminated"); + } + function w(d) { + let g = []; + for (let y = 1; y <= d; y++) g = g.concat(Gn(y, "elected")); + return [...new Set(g)]; + } + function V(d, g) { + const y = n().results[g - 1].tallyResults; + let E = 0; + const A = y.findIndex((N) => (N == null ? void 0 : N.elected) && d == N.elected); + if (A >= 0) { + const N = y[A].transfers; + if (N) + for (let [I, H] of Object.entries(N)) E += Number(H); } else return 0; - return A; - } - function tt(h, _) { - h.some((m) => br(m.label)) || h.push({ label: "exhausted", value: on(_) }); - } - function bt(h) { - const _ = []; - for (let [m, A] of Object.entries(n().results[h - 1].tally)) - _.push({ label: m, value: Number(A) }); - return tt(_, h), _; - } - function Mt(h) { - const _ = n().results[Math.max(0, h - 2)].tally, m = n().results[h - 1].tally, A = []; - for (let [b] of Object.entries(_)) - A.push({ label: b, value: Number(m[b] ?? 0) }); - return tt(A, h), A; - } - function it(h, _) { - const m = []; - for (const A of h) { - if (A.label === "exhausted" || A.isTransfer) { - m.push(A); + return E; + } + function Z(d, g) { + d.some((y) => $r(y.label)) || d.push({ label: "exhausted", value: cn(g) }); + } + function _e(d) { + const g = []; + for (let [y, E] of Object.entries(n().results[d - 1].tally)) + g.push({ label: y, value: Number(E) }); + return Z(g, d), g; + } + function xe(d) { + const g = n().results[Math.max(0, d - 2)].tally, y = n().results[d - 1].tally, E = []; + for (let [A] of Object.entries(g)) + E.push({ label: A, value: Number(y[A] ?? 0) }); + return Z(E, d), E; + } + function ie(d, g) { + const y = []; + for (const E of d) { + if (E.label === "exhausted" || E.isTransfer) { + y.push(E); continue; } - const b = W(A.label, _); - b > 0 ? (m.push({ - label: A.label, - value: b, + const A = V(E.label, g); + A > 0 ? (y.push({ + label: E.label, + value: A, isTransfer: !0 - }), m.push({ ...A, value: A.value - b })) : m.push(A); + }), y.push({ ...E, value: E.value - A })) : y.push(E); } - return m; + return y; } - function It() { - const h = st(x(Z)).select("defs").select("#cross-hatch"); - let _ = 0; - for (let [m, A] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? _ < 10 ? Tt[m] = _d[_] : Tt[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Tt[m] = u()[_ % u().length], _++; + function Ve() { + const d = he(b(ne)).select("defs").select("#cross-hatch"); + let g = 0; + for (let [y, E] of Object.entries(n().results[0].tally)) { + !u() || u().length === 0 ? g < 10 ? Ne[y] = Id[g] : Ne[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ne[y] = u()[g % u().length], g++; { - const b = h.clone(!0); - b.attr("id", ee(m)).select("rect").attr("fill", Tt[m]), b.selectAll("circle").attr("fill", "#383838"); + const A = d.clone(!0); + A.attr("id", st(y)).select("rect").attr("fill", Ne[y]), A.selectAll("circle").attr("fill", "#383838"); } } - Tt.exhausted = ft, Tt["Inactive Ballots"] = ft; + Ne.exhausted = j, Ne["Inactive Ballots"] = j; } - function He() { - st(x(Z)).select("#" + M).remove(); + function Xt() { + he(b(ne)).select("#" + M).remove(); } - function Xt(h, _) { - const m = pi("global").duration(gt); - _ && m.on("end", _); - const A = it(Ct, h), T = ns().sort(null).value((D) => D.value)(A); - Qs(h, C, T, 0, pt()), Qs(h, P, T, 0, pt(), !0), Ct = A, xt = T, He(), Be(h), gl(), ml(0, pt()), Rr(); + function Ge(d, g) { + const y = _i("global").duration(ae); + g && y.on("end", g); + const E = ie(ee, d), N = ss().sort(null).value((I) => I.value)(E); + na(d, C, N, 0, we()), na(d, S, N, 0, we(), !0), ee = E, de = N, Xt(), Ut(d), Eo(), Ro(0, we()), Rr(); } - function ce(h, _) { - const m = pi("global").duration(gt); - _ && m.on("end", _), zi(h); + function dt(d, g) { + const y = _i("global").duration(ae); + g && y.on("end", g), Gi(d); } - function Bt(h, _) { - const m = pi("global").duration(gt); - _ && m.on("end", _), Ar(h), Xe(pt(), Ye()); + function Ke(d, g) { + const y = _i("global").duration(ae); + g && y.on("end", g), Er(d), Wt(we(), zt()); } - let j = !1, St = []; - function ct() { - Rr(), j = !1, he(); + let te = !1, ke = []; + function me() { + Rr(), te = !1, pt(); } - function he() { - if (St.length === 0) { - nt !== r() && (r() === nt + 1 && nt > 0 && r() <= n().results.length ? (nt = r(), gn(r())) : r() >= 1 && r() <= n().results.length && (nt = r(), c(0), Ae(r()))); + function pt() { + if (ke.length === 0) { + oe !== r() && (r() === oe + 1 && oe > 0 && r() <= n().results.length ? (oe = r(), $n(r())) : r() >= 1 && r() <= n().results.length && (oe = r(), c(0), At(r()))); return; } - const h = St.shift(); - switch (h.type) { + const d = ke.shift(); + switch (d.type) { case "round": { - const _ = h.round; - _ === nt + 1 && nt > 0 && _ <= n().results.length ? (nt = _, gn(_)) : (_ !== nt && _ >= 1 && _ <= n().results.length && (nt = _, c(0), Ae(_)), he()); + const g = d.round; + g === oe + 1 && oe > 0 && g <= n().results.length ? (oe = g, $n(g)) : (g !== oe && g >= 1 && g <= n().results.length && (oe = g, c(0), At(g)), pt()); break; } case "step": - Jn(); + Zn(); break; } } - function gn(h) { - if (h <= 1 || h > n().results.length) { - he(); + function $n(d) { + if (d <= 1 || d > n().results.length) { + pt(); return; } - j = !0, z = h, c(0), Xt(z - 1, () => { - ce(z - 1, () => { - Bt(z, ct); + te = !0, W = d, c(0), Ge(W - 1, () => { + c(1), dt(W - 1, () => { + c(2), Ke(W, () => { + c(0), me(); + }); }); }); } - function Gn() { - j || (j = !0, z = r(), _n()); + function jn() { + te || (te = !0, W = r(), An()); } - function _n() { + function An() { if (c( 0 // if in the middle of "one small step" animation, reset to 0. - ), St.length > 0) { - ct(); + ), ke.length > 0) { + me(); return; } - const h = z < n().results.length - 1 ? _n : ct; - Xt(z, () => { - ce(z, () => { - z++, $e(z), Bt(z, h); + const d = W < n().results.length - 1 ? An : () => { + c(0), me(); + }; + Ge(W, () => { + c(1), dt(W, () => { + c(2), W++, $t(W), Ke(W, d); }); }); } Fs(() => { - ze(); + Bt(); }); - let nt = 0; - function ze() { - if (nt != r()) { - if (j) { - St.push({ type: "round", round: r() }); + let oe = 0; + function Bt() { + if (oe != r()) { + if (te) { + ke.push({ type: "round", round: r() }); return; } - nt == r() - 1 && nt > 0 ? $r() : Kn(r()), nt = r(); + oe == r() - 1 && oe > 0 ? Ar() : Jn(r()), oe = r(); } } - function Kn(h) { - if (j) { - St.push({ type: "round", round: h }); + function Jn(d) { + if (te) { + ke.push({ type: "round", round: d }); return; } - c(0), Ae(h); + c(0), At(d); } - function $r() { - if (j) { - St.push({ type: "round", round: r() }); + function Ar() { + if (te) { + ke.push({ type: "round", round: r() }); return; } if (r() <= 1) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (z = r(), z > n().results.length) { - Rr(), j = !1; + if (W = r(), W > n().results.length) { + Rr(), te = !1; return; } - j = !0, c() === 0 ? Xt(z - 1, () => { - ce(z - 1, () => { - Bt(z, ct); + te = !0, c() === 0 ? Ge(W - 1, () => { + c(1), dt(W - 1, () => { + c(2), Ke(W, () => { + c(0), me(); + }); }); - }) : c() === 1 ? ce(z - 1, () => { - Bt(z, ct); - }) : c() === 2 && Bt(z, ct), c(0); + }) : c() === 1 ? dt(W - 1, () => { + c(2), Ke(W, () => { + c(0), me(); + }); + }) : c() === 2 && Ke(W, () => { + c(0), me(); + }); } - function Jn() { + function Zn() { if (r() > n().results.length) { - Rr(), j = !1; + Rr(), te = !1; return; } - if (j) { - St.push({ type: "step" }); + if (te) { + ke.push({ type: "step" }); return; } - j = !0, c((c() + 1) % 3), z = r(), c() === 1 ? Xt(z, ct) : c() === 2 ? ce(z, ct) : c() === 0 ? (z++, $e(z), Bt(z, ct)) : (j = !1, console.warn("displayPhase out of range at ", c())); - } - function Ar(h) { - Ct = Mt(h), xt = Zs(h, C, Ct, 0, pt(), !0), Zs(h, P, Ct, 0, pt(), !1, !0), st(x(Z)).select("#" + P).selectAll(".eliminated").remove(); - } - function Xe(h, _) { - const m = st(x(Z)).select("#" + M), b = st(x(Z)).select("#" + C), T = {}; - for (const S of xt) { - const k = S.data.label; - if (S.data.isTransfer) continue; - const R = b.select("#" + CSS.escape(p(S.data))); - R.empty() || (T[k] = { + te = !0, W = r(), c() === 0 ? Ge(W, () => { + c(1), me(); + }) : c() === 1 ? dt(W, () => { + c(2), me(); + }) : c() === 2 ? (W++, $t(W), Ke(W, () => { + c(0), me(); + })) : (te = !1, console.warn("displayPhase out of range at ", c())); + } + function Er(d) { + ee = xe(d), de = ea(d, C, ee, 0, we(), !0), ea(d, S, ee, 0, we(), !1, !0), he(b(ne)).select("#" + S).selectAll(".eliminated").remove(); + } + function Wt(d, g) { + const y = he(b(ne)).select("#" + M), A = he(b(ne)).select("#" + C), N = {}; + for (const k of de) { + const P = k.data.label; + if (k.data.isTransfer) continue; + const R = A.select("#" + CSS.escape(p(k.data))); + R.empty() || (N[P] = { oldStart: Number(R.attr("prevStart")), oldEnd: Number(R.attr("prevEnd")), - newStart: S.startAngle, - newEnd: S.endAngle + newStart: k.startAngle, + newEnd: k.endAngle }); } - const D = m.selectAll(".slice"); - let V = D.size(); - function L() { - V--, V === 0 && _l(); + const I = y.selectAll(".slice"); + let H = I.size(); + function O() { + H--, H === 0 && To(); } - D.select("path").transition("global").duration(et).attrTween("d", function(S) { - const k = S.startAngle, R = S.endAngle, X = R - k, Wt = T[S.data.label]; - let Q, Ee; - if (Wt) { - const Zn = (Wt.oldStart + Wt.oldEnd) / 2, bl = (Wt.newStart + Wt.newEnd) / 2, $l = k - Zn; - Q = bl + $l, Ee = Q + X; + I.select("path").transition("global").duration(X).attrTween("d", function(k) { + const P = k.startAngle, R = k.endAngle, U = R - P, je = N[k.data.label]; + let re, Et; + if (je) { + const Qn = (je.oldStart + je.oldEnd) / 2, ko = (je.newStart + je.newEnd) / 2, Mo = P - Qn; + re = ko + Mo, Et = re + U; } else - Q = k, Ee = R; - const rt = Ge(k, Q), Re = Ge(R, Ee), We = Ge(_, h), Cr = Te(); - return function(Zn) { - return Cr.innerRadius(Math.min(We(Zn), h) - 1).outerRadius(We(Zn)).startAngle(rt(Zn)).endAngle(Re(Zn)), Cr(S); + re = P, Et = R; + const ue = jt(P, re), Tt = jt(R, Et), Gt = jt(g, d), Cr = Ct(); + return function(Qn) { + return Cr.innerRadius(Math.min(Gt(Qn), d) - 1).outerRadius(Gt(Qn)).startAngle(ue(Qn)).endAngle(Tt(Qn)), Cr(k); }; - }).on("end", (S) => L()); - } - function Be(h) { - const _ = hl(h, xt); - Ft = Js(h, M, _, E, N, pt(), Ye(), !1, !0); - const m = st(x(Z)); - m.select("#" + C).raise(), m.select("#" + P).raise(); - } - function zi(h) { - const _ = pl(h, Ft, xt); - Ft = ta(h, M, _, pt(), Ye(), !1); - } - function Er(h) { - return Tt[h.data.label]; - } - function cl(h) { - const _ = {}, m = n().results[h - 1].tallyResults; - for (let A = 0; A < m.length; A++) { - let b = m[A].eliminated; - if (b === void 0 && (b = m[A].elected), b === void 0) { + }).on("end", (k) => O()); + } + function Ut(d) { + const g = xo(d, de); + Ee = Qs(d, M, g, x, D, we(), zt(), !1, !0); + const y = he(b(ne)); + y.select("#" + C).raise(), y.select("#" + S).raise(); + } + function Gi(d) { + const g = $o(d, Ee, de); + Ee = ra(d, M, g, we(), zt(), !1); + } + function Tr(d) { + return Ne[d.data.label]; + } + function wo(d) { + const g = {}, y = n().results[d - 1].tallyResults; + for (let E = 0; E < y.length; E++) { + let A = y[E].eliminated; + if (A === void 0 && (A = y[E].elected), A === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const T = m[A].transfers; - if (T === void 0) { + const N = y[E].transfers; + if (N === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [D, V] of Object.entries(T)) - _[D] === void 0 ? _[D] = Number(V) : _[D] += Number(V); + for (let [I, H] of Object.entries(N)) + g[I] === void 0 ? g[I] = Number(H) : g[I] += Number(H); } - return _; + return g; } - function hl(h, _) { - const m = [], A = fe, b = n().results[h - 1].tallyResults; - for (let T = 0; T < b.length; T++) { - let D = b[T].eliminated; - if (D === void 0 && (D = b[T].elected), D === void 0) { + function xo(d, g) { + const y = [], E = Pe, A = n().results[d - 1].tallyResults; + for (let N = 0; N < A.length; N++) { + let I = A[N].eliminated; + if (I === void 0 && (I = A[N].elected), I === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const V = b[T].transfers; - if (V === void 0) { + const H = A[N].transfers; + if (H === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let L = _.find((k) => k.data.label == D && k.data.isTransfer); - L === void 0 && (L = _.find((k) => k.data.label == D && !k.data.isTransfer)); - let S = 0; - if (L) S = L.startAngle; + let O = g.find((P) => P.data.label == I && P.data.isTransfer); + O === void 0 && (O = g.find((P) => P.data.label == I && !P.data.isTransfer)); + let k = 0; + if (O) k = O.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [k, R] of Object.entries(V)) { - let X; - const Wt = _.find((rt) => rt.data.label == k); - if (Wt) - X = structuredClone(Wt); - else if (k == "exhausted") - X = { - data: { label: k, value: Number(R) }, + for (let [P, R] of Object.entries(H)) { + let U; + const je = g.find((ue) => ue.data.label == P); + if (je) + U = structuredClone(je); + else if (P == "exhausted") + U = { + data: { label: P, value: Number(R) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (k == "residual surplus") { + else if (P == "residual surplus") { console.warn("makeDonutInfo: residual surplus = ", R); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", k); + console.warn("makeDonutInfo: unrecognized name in transfers ", P); continue; } - const Ee = Number(R) / A * 2 * Math.PI; - X.startAngle = S, S = X.endAngle = S + Ee, X.index = T, X.data.transferIndex = T, m.push(X); + const Et = Number(R) / E * 2 * Math.PI; + U.startAngle = k, k = U.endAngle = k + Et, U.index = N, U.data.transferIndex = N, y.push(U); } } - return m; - } - function dl(h, _, m) { - const A = {}; - for (let [b, T] of Object.entries(h)) { - const D = m.find((S) => b == S.data.label); - if (D === void 0) { - console.warn("getTransferStartAngles: mainPieObj not found for ", b); + return y; + } + function bo(d, g, y) { + const E = {}; + for (let [A, N] of Object.entries(d)) { + const I = y.find((k) => A == k.data.label); + if (I === void 0) { + console.warn("getTransferStartAngles: mainPieObj not found for ", A); continue; } - const V = (D.startAngle + D.endAngle) / 2, L = h[D.data.label] / _ * 2 * Math.PI; - A[D.data.label] = V - L / 2; + const H = (I.startAngle + I.endAngle) / 2, O = d[I.data.label] / g * 2 * Math.PI; + E[I.data.label] = H - O / 2; } - return A; + return E; } - function pl(h, _, m) { - const A = [], b = fe, T = cl(h), D = dl(T, b, m); - for (let [V, L] of _.entries()) { - const S = structuredClone(L), k = L.endAngle - L.startAngle, R = m.find((X) => L.data.label === X.data.label && !X.data.isTransfer); + function $o(d, g, y) { + const E = [], A = Pe, N = wo(d), I = bo(N, A, y); + for (let [H, O] of g.entries()) { + const k = structuredClone(O), P = O.endAngle - O.startAngle, R = y.find((U) => O.data.label === U.data.label && !U.data.isTransfer); if (R) { - const X = R.data.label; - S.startAngle = D[X], D[X] += k, S.endAngle = S.startAngle + k; - } else if (L.data.label === "exhausted") - S.startAngle = L.startAngle, S.endAngle = L.endAngle; + const U = R.data.label; + k.startAngle = I[U], I[U] += P, k.endAngle = k.startAngle + P; + } else if (O.data.label === "exhausted") + k.startAngle = O.startAngle, k.endAngle = O.endAngle; else { - console.warn("updateDonutInfo: unrecognized slice name ", L.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", O.data.label); continue; } - S.index = V, A.push(S); + k.index = H, E.push(k); } - return A; - } - function Gs(h, _, m, A, b, T) { - const V = st(x(Z)).append("g").attr("id", G).attr("transform", `translate(${m}, ${A})`), L = Te().innerRadius(b * K).outerRadius(b * K); - V.selectAll("text").data(_).enter().each(function(S) { - S.endAngle - S.startAngle < at || S.data.isTransfer || st(this).append("g").attr("id", (k) => p(k.data)).classed("eliminated", (k) => T.includes(k.data.label) || k.data.isTransfer === !0).each(function(k, R) { - k.data.label === "exhausted" && st(this).on("mouseenter", (X, Wt) => yl(X)).on("mouseleave", (X, Wt) => wl()); - }).append("text").attr("transform", (k) => `translate(${L.centroid(k)})`).attr("text-anchor", (k) => Xi(k.startAngle, k.endAngle)).text((k) => k.data.label === "exhausted" ? an : k.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((k) => { - const R = Yi(k.data.label, h); - return !d() && br(k.data.label) ? R : R + " (" + Bn(k.data.label, h) + ")"; + return E; + } + function Js(d, g, y, E, A, N) { + const H = he(b(ne)).append("g").attr("id", B).attr("transform", `translate(${y}, ${E})`), O = Ct().innerRadius(A * Q).outerRadius(A * Q); + H.selectAll("text").data(g).enter().each(function(k) { + k.endAngle - k.startAngle < ce || k.data.isTransfer || he(this).append("g").attr("id", (P) => p(P.data)).classed("eliminated", (P) => N.includes(P.data.label) || P.data.isTransfer === !0).each(function(P, R) { + P.data.label === "exhausted" && he(this).on("mouseenter", (U, je) => Co(U)).on("mouseleave", (U, je) => So()); + }).append("text").attr("transform", (P) => `translate(${O.centroid(P)})`).attr("text-anchor", (P) => Ki(P.startAngle, P.endAngle)).text((P) => P.data.label === "exhausted" ? Ht : P.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((P) => { + const R = Wi(P.data.label, d); + return !h() && $r(P.data.label) ? R : R + " (" + Un(P.data.label, d) + ")"; }); }); } - function vl(h, _, m, A) { - const T = st(x(Z)).select("#" + G), D = T.selectAll("tspan"), V = T.selectAll("g").data(_, (R) => p(R.data)).classed("eliminated", (R) => A.includes(R.data.label) || R.data.isTransfer === !0), L = Te().innerRadius(m * K).outerRadius(m * K + 1); - D.transition("global").duration(et).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => Xi(R.startAngle, R.endAngle)), V.select("text").transition("global").duration(et).attr("transform", (R) => `translate(${L.centroid(R)})`).attr("text-anchor", (R) => Xi(R.startAngle, R.endAngle)).on("end", (R) => k()); - let S = V.size(); - function k(R) { - S--, S === 0 && (T.remove(), Gs(h, _, E, N, m, A)); + function Ao(d, g, y, E) { + const N = he(b(ne)).select("#" + B), I = N.selectAll("tspan"), H = N.selectAll("g").data(g, (R) => p(R.data)).classed("eliminated", (R) => E.includes(R.data.label) || R.data.isTransfer === !0), O = Ct().innerRadius(y * Q).outerRadius(y * Q + 1); + I.transition("global").duration(X).attr("transform", (R) => `translate(${O.centroid(R)})`).attr("text-anchor", (R) => Ki(R.startAngle, R.endAngle)), H.select("text").transition("global").duration(X).attr("transform", (R) => `translate(${O.centroid(R)})`).attr("text-anchor", (R) => Ki(R.startAngle, R.endAngle)).on("end", (R) => P()); + let k = H.size(); + function P(R) { + k--, k === 0 && (N.remove(), Js(d, g, x, D, y, E)); } } - function Ks(h, _, m, A, b, T, D, V = !0, L = !1, S = !1) { - const R = ns().sort(null).value((X) => X.value)(m); - return Js(h, _, R, A, b, T, D, V, L, S), R; + function Zs(d, g, y, E, A, N, I, H = !0, O = !1, k = !1) { + const R = ss().sort(null).value((U) => U.value)(y); + return Qs(d, g, R, E, A, N, I, H, O, k), R; } function Rr() { - st(x(Z)).select("#" + P).selectAll(".elected").select("path").style("stroke", I).style("stroke-width", `${zt}px`); - } - function Js(h, _, m, A, b, T, D, V, L, S = !1) { - const k = Un(h), R = w(h), Q = st(x(Z)).attr("viewBox", `0 0 ${g} ${y}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", _).attr("transform", `translate(${A}, ${b})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (rt) => k.includes(rt.data.label) || rt.data.isTransfer === !0).classed("elected", (rt) => R.includes(rt.data.label) && !rt.data.isTransfer).attr("id", (rt) => p(rt.data)); - S ? Q.style("pointer-events", "none") : Q.on("mouseenter", (rt, Re) => Wi(rt, Re)).on("mouseleave", (rt, Re) => Ui(rt, Re)); - const Ee = Te().outerRadius(D).innerRadius(T); - if (L) { - const rt = Te().outerRadius(T + 1).innerRadius(T), Re = Q.append("path").attr("d", rt).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F).attr("fill", "none").transition("global").duration(et).attr("d", (We) => Ee(We)).on("end", (We) => { - S || Bi(); + he(b(ne)).select("#" + S).selectAll(".elected").select("path").style("stroke", q).style("stroke-width", `${Le}px`); + } + function Qs(d, g, y, E, A, N, I, H, O, k = !1) { + const P = Kn(d), R = w(d), re = he(b(ne)).attr("viewBox", `0 0 ${m} ${$}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${E}, ${A})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (ue) => P.includes(ue.data.label) || ue.data.isTransfer === !0).classed("elected", (ue) => R.includes(ue.data.label) && !ue.data.isTransfer).attr("id", (ue) => p(ue.data)); + k ? re.style("pointer-events", "none") : re.on("mouseenter", (ue, Tt) => Ji(ue, Tt)).on("mouseleave", (ue, Tt) => Zi(ue, Tt)); + const Et = Ct().outerRadius(I).innerRadius(N); + if (O) { + const ue = Ct().outerRadius(N + 1).innerRadius(N), Tt = re.append("path").attr("d", ue).attr("stroke", k ? "none" : le).attr("stroke-width", k ? 0 : T).attr("fill", "none").transition("global").duration(X).attr("d", (Gt) => Et(Gt)).on("end", (Gt) => { + k || ji(); }); - S ? Re.attr("fill", "none") : Re.attr("fill", (We) => Er(We)); + k ? Tt.attr("fill", "none") : Tt.attr("fill", (Gt) => Tr(Gt)); } else - Q.append("path").attr("d", (rt) => Ee(rt)).attr("fill", S ? "none" : (rt) => Er(rt)).attr("stroke", S ? "none" : _t).attr("stroke-width", S ? 0 : F), S || Bi(); - return V && !S && Gs(h, m, A, b, D, k), m; - } - function gl() { - const m = st(x(Z)).select("#" + G).selectAll(".eliminated"); - m.size() > 0 && m.classed("finished", !0); - } - function _l() { - const m = st(x(Z)).select("#" + G).selectAll(".finished"); - m.size() > 0 && m.remove(); - } - function ml(h, _) { - const b = st(x(Z)).select("#" + C).selectAll(".eliminated"), T = Te().innerRadius(h), D = Te().outerRadius(_); - b.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(et).attrTween("d", function(V) { - const L = Ge(_, h); - return function(S) { - return D.innerRadius(L(S)), D(V); + re.append("path").attr("d", (ue) => Et(ue)).attr("fill", k ? "none" : (ue) => Tr(ue)).attr("stroke", k ? "none" : le).attr("stroke-width", k ? 0 : T), k || ji(); + return H && !k && Js(d, y, E, A, I, P), y; + } + function Eo() { + const y = he(b(ne)).select("#" + B).selectAll(".eliminated"); + y.size() > 0 && y.classed("finished", !0); + } + function To() { + const y = he(b(ne)).select("#" + B).selectAll(".finished"); + y.size() > 0 && y.remove(); + } + function Ro(d, g) { + const A = he(b(ne)).select("#" + C).selectAll(".eliminated"), N = Ct().innerRadius(d), I = Ct().outerRadius(g); + A.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(X).attrTween("d", function(H) { + const O = jt(g, d); + return function(k) { + return I.innerRadius(O(k)), I(H); }; - }).attr("fill", (V) => `url(#${ee(V.data.label)})`), b.clone(!0).classed("finished", !0).select("path").transition("global").duration(et).attrTween("d", function(V) { - const L = Ge(_, h); - return function(S) { - return T.outerRadius(L(S)), T(V); + }).attr("fill", (H) => `url(#${st(H.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(X).attrTween("d", function(H) { + const O = jt(g, d); + return function(k) { + return N.outerRadius(O(k)), N(H); }; - }).attr("fill", (V) => Er(V)); + }).attr("fill", (H) => Tr(H)); } - function Xi(h, _) { - const m = (h + _) / 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 Ki(d, g) { + const y = (d + g) / 2; + return y > Math.PI * 11 / 6 || y < Math.PI * 1 / 6 || y > Math.PI * 5 / 6 && y < Math.PI * 7 / 6 ? "middle" : y < Math.PI ? "start" : "end"; } - function Bi() { - st(x( - Z + function ji() { + he(b( + ne // force redisplay of text labels - )).select("#" + G).raise().append("g").remove(); - } - function Zs(h, _, m, A, b, T, D = !1) { - const L = ns().sort(null).value((S) => S.value)(m); - return ta(h, _, L, A, b, T, D), L; - } - function js(h, _, m, A, b = !1) { - const T = Un(h), D = w(h), S = st(x(Z)).select("#" + _).selectAll(".slice").data(m, (R) => p(R.data)), k = S.enter().append("g").attr("class", "slice").attr("id", (R) => p(R.data)).classed("eliminated", !0); - return b ? k.style("pointer-events", "none") : k.on("mouseenter", (R, X) => Wi(R, X)).on("mouseleave", (R, X) => Ui(R, X)), k.append("path").attr("d", (R) => A(R)).attr("fill", b ? "none" : (R) => Er(R)).attr("stroke", b ? "none" : _t).attr("stroke-width", b ? 0 : F), S.classed("eliminated", (R) => T.includes(R.data.label)).classed("elected", (R) => D.includes(R.data.label)), b || S.on("mouseenter", (R, X) => Wi(R, X)).on("mouseleave", (R, X) => Ui(R, X)), S; - } - function Qs(h, _, m, A, b, T = !1) { - const D = Te().outerRadius(b).innerRadius(A); - js(h, _, m, D, T).select("path").attr("d", (L) => D(L)).attr("fill", T ? "none" : (L) => Er(L)); - } - function ta(h, _, m, A, b, T, D = !1) { - const V = Te().outerRadius(b).innerRadius(A).startAngle((Q) => Q.startAngle).endAngle((Q) => Q.endAngle), L = Te().outerRadius(b).innerRadius(A), k = st(x(Z)).select("#" + _); - k.selectAll(".slice").attr("prevStart", (Q) => Q.startAngle).attr("prevEnd", (Q) => Q.endAngle); - const R = js(h, _, m, L, D); - let X = R.size(); - function Wt() { - X--, X <= 0 && (D || Bi(), k.selectAll(".finished").remove()); + )).select("#" + B).raise().append("g").remove(); + } + function ea(d, g, y, E, A, N, I = !1) { + const O = ss().sort(null).value((k) => k.value)(y); + return ra(d, g, O, E, A, N, I), O; + } + function ta(d, g, y, E, A = !1) { + const N = Kn(d), I = w(d), k = he(b(ne)).select("#" + g).selectAll(".slice").data(y, (R) => p(R.data)), P = k.enter().append("g").attr("class", "slice").attr("id", (R) => p(R.data)).classed("eliminated", !0); + return A ? P.style("pointer-events", "none") : P.on("mouseenter", (R, U) => Ji(R, U)).on("mouseleave", (R, U) => Zi(R, U)), P.append("path").attr("d", (R) => E(R)).attr("fill", A ? "none" : (R) => Tr(R)).attr("stroke", A ? "none" : le).attr("stroke-width", A ? 0 : T), k.classed("eliminated", (R) => N.includes(R.data.label)).classed("elected", (R) => I.includes(R.data.label)), A || k.on("mouseenter", (R, U) => Ji(R, U)).on("mouseleave", (R, U) => Zi(R, U)), k; + } + function na(d, g, y, E, A, N = !1) { + const I = Ct().outerRadius(A).innerRadius(E); + ta(d, g, y, I, N).select("path").attr("d", (O) => I(O)).attr("fill", N ? "none" : (O) => Tr(O)); + } + function ra(d, g, y, E, A, N, I = !1) { + const H = Ct().outerRadius(A).innerRadius(E).startAngle((re) => re.startAngle).endAngle((re) => re.endAngle), O = Ct().outerRadius(A).innerRadius(E), P = he(b(ne)).select("#" + g); + P.selectAll(".slice").attr("prevStart", (re) => re.startAngle).attr("prevEnd", (re) => re.endAngle); + const R = ta(d, g, y, O, I); + let U = R.size(); + function je() { + U--, U <= 0 && (I || ji(), P.selectAll(".finished").remove()); } - return R.select("path").transition("global").duration(et).attrTween("d", function(Q) { - const Ee = Number(st(this.parentNode).attr("prevStart")), rt = Number(st(this.parentNode).attr("prevEnd")), Re = Ge(Ee, Q.startAngle), We = Ge(rt, Q.endAngle); - return (Cr) => (V.startAngle(Re(Cr)).endAngle(We(Cr)), V(Q)); - }).on("end", function(Q) { - Q.startAngle === Q.endAngle && st(this).attr("stroke", "none"), Wt(); - }), T && !D && vl(h, m, b, Un(h)), m; + return R.select("path").transition("global").duration(X).attrTween("d", function(re) { + const Et = Number(he(this.parentNode).attr("prevStart")), ue = Number(he(this.parentNode).attr("prevEnd")), Tt = jt(Et, re.startAngle), Gt = jt(ue, re.endAngle); + return (Cr) => (H.startAngle(Tt(Cr)).endAngle(Gt(Cr)), H(re)); + }).on("end", function(re) { + re.startAngle === re.endAngle && he(this).attr("stroke", "none"), je(); + }), N && !I && Ao(d, y, A, Kn(d)), y; } - function Wi(h, _) { - s(_.data.label), i("enter"), a(h.clientX), o(h.clientY); + function Ji(d, g) { + s(g.data.label), i("enter"), a(d.clientX), l(d.clientY); } - function Ui(h, _) { - s(_.data.label), i("leave"); + function Zi(d, g) { + s(g.data.label), i("leave"); } - function yl(h, _) { - i("show-exhausted"), a(h.clientX), o(h.clientY); + function Co(d, g) { + i("show-exhausted"), a(d.clientX), l(d.clientY); } - function wl(h, _) { + function So(d, g) { i("hide-exhausted"); } - var xl = { - pieColors: Tt, - exhaustedLabel: an, - countExhaustedVotes: on, - getEliminatedCandidates: Un, + var No = { + pieColors: Ne, + exhaustedLabel: Ht, + countExhaustedVotes: cn, + getEliminatedCandidates: Kn, getElectedCandidates: w, - runFullAnimationFn: Gn, - animateOnePhaseFn: Jn, + runFullAnimationFn: jn, + animateOnePhaseFn: Zn, get jsonData() { return n(); }, - set jsonData(h) { - n(h), ht(); + set jsonData(d) { + n(d), se(); }, get currentRound() { return r(); }, - set currentRound(h = 1) { - r(h), ht(); + set currentRound(d = 1) { + r(d), se(); }, get mouseEventType() { return i(); }, - set mouseEventType(h) { - i(h), ht(); + set mouseEventType(d) { + i(d), se(); }, get mouseData() { return s(); }, - set mouseData(h) { - s(h), ht(); + set mouseData(d) { + s(d), se(); }, get mouseX() { return a(); }, - set mouseX(h) { - a(h), ht(); + set mouseX(d) { + a(d), se(); }, get mouseY() { - return o(); + return l(); }, - set mouseY(h) { - o(h), ht(); + set mouseY(d) { + l(d), se(); }, get requestRoundChange() { - return l(); + return o(); }, - set requestRoundChange(h = (_) => { + set requestRoundChange(d = (g) => { }) { - l(h), ht(); + o(d), se(); }, get candidateColors() { return u(); }, - set candidateColors(h = []) { - u(h), ht(); + set candidateColors(d = []) { + u(d), se(); }, get excludeFinalWinnerAndEliminatedCandidate() { return f(); }, - set excludeFinalWinnerAndEliminatedCandidate(h = !1) { - f(h), ht(); + set excludeFinalWinnerAndEliminatedCandidate(d = !1) { + f(d), se(); }, get firstRoundDeterminesPercentages() { - return d(); + return h(); }, - set firstRoundDeterminesPercentages(h = !1) { - d(h), ht(); + set firstRoundDeterminesPercentages(d = !1) { + h(d), se(); }, get displayPhase() { return c(); }, - set displayPhase(h = 0) { - c(h), ht(); + set displayPhase(d = 0) { + c(d), se(); } - }, ea = Nd(); - return ui(ea, (h) => lt(Z, h), () => x(Z)), ve(t, ea), Ns(xl); + }, ia = Gd(); + return hi(ia, (d) => ve(ne, d), () => b(ne)), Xe(e, ia), Li(No); } -Io( - fl, +Ys( + mo, { jsonData: {}, currentRound: {}, @@ -5404,10 +5503,85 @@ Io( ], { mode: "open" } ); -var Md = /* @__PURE__ */ Xn(" ", 1), Pd = /* @__PURE__ */ Xn("About to eliminate: ", 1), Dd = /* @__PURE__ */ Xn(" ", 1), Fd = /* @__PURE__ */ Xn(" ", 1), Id = /* @__PURE__ */ Xn('

', 1), Od = /* @__PURE__ */ Xn("
", 1), Ld = /* @__PURE__ */ Xn('


these ballots have already been eliminated.
', 1); -const qd = { +var jd = /* @__PURE__ */ qt("
"), Jd = /* @__PURE__ */ qt('
', 1), Zd = /* @__PURE__ */ qt('
'); +const Qd = { + 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 yo(e, t) { + Oi(t, !0), Hs(e, Qd); + let n = fe(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = fe(t, "currentStep", 7, 0), i = fe(t, "disabled", 7, !1), s = fe(t, "onAdvance", 7, () => { + }); + function a() { + i() || s()(); + } + function l(h) { + (h.key === "Enter" || h.key === " ") && (h.preventDefault(), a()); + } + var o = { + get labels() { + return n(); + }, + set labels(h = ["Eliminate", "Transfer", "Consolidate"]) { + n(h), se(); + }, + get currentStep() { + return r(); + }, + set currentStep(h = 0) { + r(h), se(); + }, + get disabled() { + return i(); + }, + set disabled(h = !1) { + i(h), se(); + }, + get onAdvance() { + return s(); + }, + set onAdvance(h = () => { + }) { + s(h), se(); + } + }, u = Zd(); + let f; + return u.__click = a, u.__keydown = l, ci(u, 21, n, fi, (h, c, p) => { + var m = Jd(), $ = pn(m); + { + var _ = (j) => { + var Q = jd(); + let ce; + Jt(() => ce = ti(Q, 1, "connector svelte-1l4eyw0", null, ce, { completed: !i() && p <= r() })), Xe(j, Q); + }; + er($, (j) => { + p > 0 && j(_); + }); + } + var x = Je($, 2), D = Ye(x); + let C; + var S = Je(D, 2); + let M; + var B = Ye(S, !0); + De(S), De(x), Jt(() => { + C = ti(D, 1, "dot svelte-1l4eyw0", null, C, { + active: !i() && p === r(), + completed: !i() && p < r() + }), M = ti(S, 1, "label svelte-1l4eyw0", null, M, { + active: !i() && p === r(), + completed: !i() && p < r() + }), vn(B, b(c)); + }), Xe(h, m); + }), De(u), Jt(() => { + f = ti(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), ya(u, "tabindex", i() ? -1 : 0), ya(u, "aria-disabled", i()); + }), Xe(e, u), Li(o); +} +Hu(["click", "keydown"]); +Ys(yo, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); +var ep = /* @__PURE__ */ qt(" ", 1), tp = /* @__PURE__ */ qt("About to eliminate: ", 1), np = /* @__PURE__ */ qt(" ", 1), rp = /* @__PURE__ */ qt(" ", 1), ip = /* @__PURE__ */ qt('

', 1), sp = /* @__PURE__ */ qt("
", 1), ap = /* @__PURE__ */ qt('


these ballots have already been eliminated.
', 1); +const lp = { 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;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl) {background-color:#4747ff;color:#fff;padding:4px 10px;font-size:0.8rem;min-width:107px;border:none;border-radius:3px;cursor:pointer;}.animation-button-container.svelte-1r6y5gl button:where(.svelte-1r6y5gl):hover {background-color:#4747c2;}.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;} + 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;} /* Media query for smaller screens */ @media (max-width: 1300px) {.visualizations-container.svelte-1r6y5gl {flex-direction:column;align-items:center;} @@ -5420,12 +5594,12 @@ const qd = { }` }; -function Vd(t, e) { - Ss(e, !0), Do(t, qd); +function op(e, t) { + Oi(t, !0), Hs(e, lp); const n = 0.85; - let r = vt(e, "electionSummary", 7), i = vt(e, "currentRound", 7, 1), s = vt(e, "requestRoundChange", 7, (w) => { - }), a = vt(e, "candidateColors", 23, () => []), o = vt(e, "textForWinner", 7, "elected"), l = vt(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = vt(e, "firstRoundDeterminesPercentages", 7, !1), f = vt(e, "showCaptions", 7, !1); - const d = { + let r = fe(t, "electionSummary", 7), i = fe(t, "currentRound", 7, 1), s = fe(t, "requestRoundChange", 7, (w) => { + }), a = fe(t, "candidateColors", 23, () => []), l = fe(t, "textForWinner", 7, "elected"), o = fe(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = fe(t, "firstRoundDeterminesPercentages", 7, !1), f = fe(t, "showCaptions", 7, !1); + const h = { elected: { caption: "Elected", event: "was elected", @@ -5443,309 +5617,330 @@ function Vd(t, e) { infinitive: "to take the lead" } }; - let c = /* @__PURE__ */ jn(() => d[o()] ?? d.elected), p = /* @__PURE__ */ yt(null), g = /* @__PURE__ */ yt(null), y = /* @__PURE__ */ yt(""), $ = /* @__PURE__ */ yt($n([])), E = /* @__PURE__ */ yt(""), N = /* @__PURE__ */ yt(""), C = /* @__PURE__ */ yt(0), P = /* @__PURE__ */ yt(0), M = /* @__PURE__ */ jn(() => G(r())); - function G(w) { + let c = /* @__PURE__ */ hn(() => h[l()] ?? h.elected), p = /* @__PURE__ */ $e(null), m = /* @__PURE__ */ $e(null), $ = /* @__PURE__ */ $e(""), _ = /* @__PURE__ */ $e(Sn([])), x = /* @__PURE__ */ $e(""), D = /* @__PURE__ */ $e(""), C = /* @__PURE__ */ $e(0), S = /* @__PURE__ */ $e(0), M = /* @__PURE__ */ hn(() => B(r())); + function B(w) { if (typeof w == "string") try { w = JSON.parse(w); - } catch (W) { - return console.error("Failed to parse JSON string:", W), {}; + } catch (V) { + return console.error("Failed to parse JSON string:", V), {}; } return w || {}; } - function ft(w) { + function j(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function K(w, W, tt) { - w.style.left = W + "px", w.style.top = tt + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const it = w.getBoundingClientRect(); - let It = W, He = tt + 20; - It + it.width > window.innerWidth - 12 && (It = window.innerWidth - it.width - 12), It < 12 && (It = 12), He + it.height > window.innerHeight - 12 && (He = tt - it.height - 12), w.style.left = It + "px", w.style.top = He + "px"; + function Q(w, V, Z) { + w.style.left = V + "px", w.style.top = Z + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const ie = w.getBoundingClientRect(); + let Ve = V, Xt = Z + 20; + Ve + ie.width > window.innerWidth - 12 && (Ve = window.innerWidth - ie.width - 12), Ve < 12 && (Ve = 12), Xt + ie.height > window.innerHeight - 12 && (Xt = Z - ie.height - 12), w.style.left = Ve + "px", w.style.top = Xt + "px"; }); } - function at() { - switch (x(E)) { + function ce() { + switch (b(x)) { case "enter": ((w) => { - var W = Yl(w, 2); - lt($, W[0], !0), lt(y, W[1], !0); - })(gt(x(N), i())), x(p) && (K(x(p), x(C) || 0, x(P) || 0), x(p).style.opacity = String(n)); + var V = Jo(w, 2); + ve(_, V[0], !0), ve($, V[1], !0); + })(ae(b(D), i())), b(p) && (Q(b(p), b(C) || 0, b(S) || 0), b(p).style.opacity = String(n)); break; case "leave": - x(p) && (x(p).style.opacity = "0"), lt($, [], !0), lt(y, ""); + b(p) && (b(p).style.opacity = "0"), ve(_, [], !0), ve($, ""); break; case "show-exhausted": - x(g) && (K(x(g), x(C) || 0, x(P) || 0), x(g).style.opacity = String(n)); + b(m) && (Q(b(m), b(C) || 0, b(S) || 0), b(m).style.opacity = String(n)); break; case "hide-exhausted": - x(g) && (x(g).style.opacity = "0"); + b(m) && (b(m).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", x(E)); + console.log("Unknown mouse event: ", b(x)); break; } } - Fs(() => at()); - function et(w, W) { - return w === 1 ? W ? "vote was" : "vote will be" : W ? "votes were" : "votes will be"; - } - function gt(w, W) { - const tt = [], bt = w === "exhausted" ? z() : w; - let Mt; - w === "exhausted" ? Mt = Ct(1) : Mt = x(M).results[0].tally[w], tt.push(`${bt} started with ${Mt} votes.`); - for (let it = 1; it <= W; it++) { - it === W && (w === "exhausted" ? Mt = Ct(W) : Mt = x(M).results[W - 1].tally[w], tt.push(`${bt} has ${Mt} votes at round ${W}.`)); - const It = x(M).results[it - 1].tallyResults, He = ee(it); - for (let Xt = 0; Xt < It.length; Xt++) { - const ce = It[Xt].transfers, Bt = It[Xt].eliminated, j = It[Xt].elected; - if (!He) { - if (Bt) - Bt === w && tt.push(`${bt} will be eliminated on round ${it}.`); - else if (w === j && (tt.push(`${bt} ${x(c).event} on round ${it}.`), ce)) - for (let [ct, he] of Object.entries(ce)) - tt.push(`${he} ${et(Number(he), it < W)} transferred to ${ct} on round ${it}.`); + Fs(() => ce()); + function X(w, V) { + return w === 1 ? V ? "vote was" : "vote will be" : V ? "votes were" : "votes will be"; + } + function ae(w, V) { + const Z = [], _e = w === "exhausted" ? Ne() : w; + let xe; + w === "exhausted" ? xe = Pe(1) : xe = b(M).results[0].tally[w], Z.push(`${_e} started with ${xe} votes.`); + for (let ie = 1; ie <= V; ie++) { + ie === V && (w === "exhausted" ? xe = Pe(V) : xe = b(M).results[V - 1].tally[w], Z.push(`${_e} has ${xe} votes at round ${V}.`)); + const Ve = b(M).results[ie - 1].tallyResults, Xt = de(ie); + for (let Ge = 0; Ge < Ve.length; Ge++) { + const dt = Ve[Ge].transfers, Ke = Ve[Ge].eliminated, te = Ve[Ge].elected; + if (!Xt) { + if (Ke) + Ke === w && Z.push(`${_e} will be eliminated on round ${ie}.`); + else if (w === te && (Z.push(`${_e} ${b(c).event} on round ${ie}.`), dt)) + for (let [me, pt] of Object.entries(dt)) + Z.push(`${pt} ${X(Number(pt), ie < V)} transferred to ${me} on round ${ie}.`); } - const St = Bt || j; - if (St) { - const ct = Number(ce[w]); - ct && tt.push(`${ct} ${et(ct, it < W)} transferred from ${St} on round ${it}.`); + const ke = Ke || te; + if (ke) { + const me = Number(dt[w]); + me && Z.push(`${me} ${X(me, ie < V)} transferred from ${ke} on round ${ie}.`); } } } - return [tt, bt]; + return [Z, _e]; } - function _t() { + function le() { let w = 0; - for (let W = 1; W <= x(M).results.length; W++) { - if (ee(W)) continue; - const tt = x(M).results[W - 1].tallyResults; - for (let bt = 0; bt < tt.length; bt++) - tt[bt].elected && w++; + for (let V = 1; V <= b(M).results.length; V++) { + if (de(V)) continue; + const Z = b(M).results[V - 1].tallyResults; + for (let _e = 0; _e < Z.length; _e++) + Z[_e].elected && w++; } return w; } - const F = ["Eliminate", "Transfer", "Consolidate"]; - let I, zt = /* @__PURE__ */ yt(0); - function ee(w) { - return l() && x(M).results && w === x(M).results.length; + let T, q = /* @__PURE__ */ $e(0); + function Le(w) { + var xe; + return !((xe = b(M)) != null && xe.results) || w < 2 || w > b(M).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [b(M).results[w - 2].tallyResults.some((ie) => ie.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; } - function xt(w) { - return ee(w) ? [] : I ? I.getEliminatedCandidates(w) : []; + function st(w) { + var Z; + if (!((Z = b(M)) != null && Z.results) || w < 2 || w > b(M).results.length) return !0; + const V = b(M).results[w - 2].tallyResults; + return V.length === 0 || V.every((_e) => Object.keys(_e.transfers).length === 0); } - function Ft(w) { - return ee(w) ? [] : I ? I.getElectedCandidates(w) : []; + function de(w) { + return o() && b(M).results && w === b(M).results.length; } - function Ct(w) { - return I ? I.countExhaustedVotes(w) : 0; + function Ee(w) { + return de(w) ? [] : T ? T.getEliminatedCandidates(w) : []; } - function fe() { - I && I.animateOnePhaseFn && I.animateOnePhaseFn(); + function ee(w) { + return de(w) ? [] : T ? T.getElectedCandidates(w) : []; + } + function Pe(w) { + return T ? T.countExhaustedVotes(w) : 0; } - function z() { - return I ? I.exhaustedLabel : ""; + function W() { + T && T.animateOnePhaseFn && T.animateOnePhaseFn(); } - function Tt() { - return I ? I.pieColors : {}; + function Ne() { + return T ? T.exhaustedLabel : ""; } - var an = { + function Ht() { + return T ? T.pieColors : {}; + } + var ne = { get electionSummary() { return r(); }, set electionSummary(w) { - r(w), ht(); + r(w), se(); }, get currentRound() { return i(); }, set currentRound(w = 1) { - i(w), ht(); + i(w), se(); }, get requestRoundChange() { return s(); }, - set requestRoundChange(w = (W) => { + set requestRoundChange(w = (V) => { }) { - s(w), ht(); + s(w), se(); }, get candidateColors() { return a(); }, set candidateColors(w = []) { - a(w), ht(); + a(w), se(); }, get textForWinner() { - return o(); + return l(); }, set textForWinner(w = "elected") { - o(w), ht(); + l(w), se(); }, get excludeFinalWinnerAndEliminatedCandidate() { - return l(); + return o(); }, set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - l(w), ht(); + o(w), se(); }, get firstRoundDeterminesPercentages() { return u(); }, set firstRoundDeterminesPercentages(w = !1) { - u(w), ht(); + u(w), se(); }, get showCaptions() { return f(); }, set showCaptions(w = !1) { - f(w), ht(); + f(w), se(); } - }, Z = Ld(), kt = mn(Z), $e = Gt(kt); - $e.__click = fe; - var Ae = Gt($e, !0); - Ut($e), Ut(kt); - var Ve = de(kt, 4), pt = Gt(Ve), Ye = Gt(pt), on = Gt(Ye); - ui( - fl(on, { + }, qe = ap(), $t = pn(qe), At = Ye($t); + { + let w = /* @__PURE__ */ hn(() => Le(i())), V = /* @__PURE__ */ hn(() => st(i())); + yo(At, { + get labels() { + return b(w); + }, + get currentStep() { + return b(q); + }, + get disabled() { + return b(V); + }, + onAdvance: W + }); + } + De($t); + var Yt = Je($t, 4), we = Ye(Yt), zt = Ye(we), cn = Ye(zt); + hi( + mo(cn, { get jsonData() { - return x(M); + return b(M); }, get currentRound() { return i(); }, - requestRoundChange: ft, + requestRoundChange: j, get candidateColors() { return a(); }, get excludeFinalWinnerAndEliminatedCandidate() { - return l(); + return o(); }, get firstRoundDeterminesPercentages() { return u(); }, get mouseEventType() { - return x(E); + return b(x); }, set mouseEventType(w) { - lt(E, w, !0); + ve(x, w, !0); }, get mouseData() { - return x(N); + return b(D); }, set mouseData(w) { - lt(N, w, !0); + ve(D, w, !0); }, get mouseX() { - return x(C); + return b(C); }, set mouseX(w) { - lt(C, w, !0); + ve(C, w, !0); }, get mouseY() { - return x(P); + return b(S); }, set mouseY(w) { - lt(P, w, !0); + ve(S, w, !0); }, get displayPhase() { - return x(zt); + return b(q); }, set displayPhase(w) { - lt(zt, w, !0); + ve(q, w, !0); } }), - (w) => I = w, - () => I - ), Ut(Ye), Ut(pt); - var jr = de(pt, 2); + (w) => T = w, + () => T + ), De(zt), De(we); + var Zr = Je(we, 2); { - var Yi = (w) => { - var W = Id(), tt = mn(W), bt = Gt(tt); - Ut(tt); - var Mt = de(tt, 2), it = Gt(Mt); + var Wi = (w) => { + var V = ip(), Z = pn(V), _e = Ye(Z); + De(Z); + var xe = Je(Z, 2), ie = Ye(xe); { - var It = (j) => { - var St = Pd(), ct = de(mn(St)); - Zi(ct, 17, () => xt(i()), Ji, (he, gn, Gn) => { - var _n = Md(), nt = mn(_n); - let ze; - var Kn = Gt(nt, !0); - Ut(nt); - var $r = de(nt, 2); + var Ve = (te) => { + var ke = tp(), me = Je(pn(ke)); + ci(me, 17, () => Ee(i()), fi, (pt, $n, jn) => { + var An = ep(), oe = pn(An); + let Bt; + var Jn = Ye(oe, !0); + De(oe); + var Ar = Je(oe, 2); { - var Jn = (Xe) => { - var Be = ca(", "); - ve(Xe, Be); - }, Ar = /* @__PURE__ */ jn(() => Gn < xt(i()).length - 1); - Tr($r, (Xe) => { - x(Ar) && Xe(Jn); + var Zn = (Wt) => { + var Ut = pa(", "); + Xe(Wt, Ut); + }, Er = /* @__PURE__ */ hn(() => jn < Ee(i()).length - 1); + er(Ar, (Wt) => { + b(Er) && Wt(Zn); }); } - Qn( - (Xe) => { - ze = pa(nt, "", ze, Xe), ln(Kn, x(gn)); + Jt( + (Wt) => { + Bt = ma(oe, "", Bt, Wt), vn(Jn, b($n)); }, - [() => ({ color: Tt()[x(gn)] })] - ), ve(he, _n); - }), ve(j, St); - }, He = /* @__PURE__ */ jn(() => xt(i()).length > 0); - Tr(it, (j) => { - x(He) && j(It); + [() => ({ color: Ht()[b($n)] })] + ), Xe(pt, An); + }), Xe(te, ke); + }, Xt = /* @__PURE__ */ hn(() => Ee(i()).length > 0); + er(ie, (te) => { + b(Xt) && te(Ve); }); } - var Xt = de(it, 2); + var Ge = Je(ie, 2); { - var ce = (j) => { - var St = Fd(), ct = mn(St), he = de(ct); - Zi(he, 17, () => Ft(i()), Ji, (gn, Gn, _n) => { - var nt = Dd(), ze = mn(nt); - let Kn; - var $r = Gt(ze, !0); - Ut(ze); - var Jn = de(ze, 2); + var dt = (te) => { + var ke = rp(), me = pn(ke), pt = Je(me); + ci(pt, 17, () => ee(i()), fi, ($n, jn, An) => { + var oe = np(), Bt = pn(oe); + let Jn; + var Ar = Ye(Bt, !0); + De(Bt); + var Zn = Je(Bt, 2); { - var Ar = (Be) => { - var zi = ca(", "); - ve(Be, zi); - }, Xe = /* @__PURE__ */ jn(() => _n < Ft(i()).length - 1); - Tr(Jn, (Be) => { - x(Xe) && Be(Ar); + var Er = (Ut) => { + var Gi = pa(", "); + Xe(Ut, Gi); + }, Wt = /* @__PURE__ */ hn(() => An < ee(i()).length - 1); + er(Zn, (Ut) => { + b(Wt) && Ut(Er); }); } - Qn( - (Be) => { - Kn = pa(ze, "", Kn, Be), ln($r, x(Gn)); + Jt( + (Ut) => { + Jn = ma(Bt, "", Jn, Ut), vn(Ar, b(jn)); }, - [() => ({ color: Tt()[x(Gn)] })] - ), ve(gn, nt); - }), Qn(() => ln(ct, `${x(c).caption ?? ""}: `)), ve(j, St); - }, Bt = /* @__PURE__ */ jn(() => Ft(i()).length > 0); - Tr(Xt, (j) => { - x(Bt) && j(ce); + [() => ({ color: Ht()[b(jn)] })] + ), Xe($n, oe); + }), Jt(() => vn(me, `${b(c).caption ?? ""}: `)), Xe(te, ke); + }, Ke = /* @__PURE__ */ hn(() => ee(i()).length > 0); + er(Ge, (te) => { + b(Ke) && te(dt); }); } - Ut(Mt), Qn((j) => ln(bt, `${x(M).config.contest ?? ""}, ${j ?? ""} ${x(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [_t]), ve(w, W); + De(xe), Jt((te) => vn(_e, `${b(M).config.contest ?? ""}, ${te ?? ""} ${b(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [le]), Xe(w, V); }; - Tr(jr, (w) => { - f() && w(Yi); + er(Zr, (w) => { + f() && w(Wi); }); } - Ut(Ve); - var Bn = de(Ve, 2), xr = Gt(Bn), br = Gt(xr, !0); - Ut(xr); - var Hi = de(xr, 2); - Zi(Hi, 17, () => x($), Ji, (w, W) => { - var tt = Od(), bt = mn(tt), Mt = Gt(bt, !0); - Ut(bt), ss(2), Qn(() => ln(Mt, x(W))), ve(w, tt); - }), Ut(Bn), ui(Bn, (w) => lt(p, w), () => x(p)); - var Wn = de(Bn, 2), Un = Gt(Wn); - return ss(2), Ut(Wn), ui(Wn, (w) => lt(g, w), () => x(g)), Qn( + De(Yt); + var Un = Je(Yt, 2), br = Ye(Un), $r = Ye(br, !0); + De(br); + var Ui = Je(br, 2); + ci(Ui, 17, () => b(_), fi, (w, V) => { + var Z = sp(), _e = pn(Z), xe = Ye(_e, !0); + De(_e), os(2), Jt(() => vn(xe, b(V))), Xe(w, Z); + }), De(Un), hi(Un, (w) => ve(p, w), () => b(p)); + var Gn = Je(Un, 2), Kn = Ye(Gn); + return os(2), De(Gn), hi(Gn, (w) => ve(m, w), () => b(m)), Jt( (w) => { - ln(Ae, F[x(zt)]), ln(br, x(y)), ln(Un, `"${w ?? ""}" means all the candidates ranked on `); + vn($r, b($)), vn(Kn, `"${w ?? ""}" means all the candidates ranked on `); }, - [z] - ), ve(t, Z), Ns(an); + [Ne] + ), Xe(e, qe), Li(ne); } -Su(["click"]); -customElements.define("pie-chart", Io( - Vd, +customElements.define("pie-chart", Ys( + op, { electionSummary: {}, currentRound: {}, From a0306952c430e0acfcbe16b534ea111b6637bee9 Mon Sep 17 00:00:00 2001 From: skaphan Date: Wed, 25 Mar 2026 23:28:32 +0000 Subject: [PATCH 23/31] Disable stepper on last round --- static/pie/pie-chart.es.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index be395c59..de5606a3 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -5705,7 +5705,7 @@ function op(e, t) { } function st(w) { var Z; - if (!((Z = b(M)) != null && Z.results) || w < 2 || w > b(M).results.length) return !0; + if (!((Z = b(M)) != null && Z.results) || w < 2 || w > b(M).results.length || w === b(M).results.length) return !0; const V = b(M).results[w - 2].tallyResults; return V.length === 0 || V.every((_e) => Object.keys(_e.transfers).length === 0); } From b91ca14a2309b821d8d22c17f53b00f3a01a5b12 Mon Sep 17 00:00:00 2001 From: skaphan Date: Thu, 26 Mar 2026 09:34:02 +0000 Subject: [PATCH 24/31] Fix off-by-one in stepper disabled/label check --- static/pie/pie-chart.es.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index de5606a3..416a9a6b 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -5701,12 +5701,12 @@ function op(e, t) { let T, q = /* @__PURE__ */ $e(0); function Le(w) { var xe; - return !((xe = b(M)) != null && xe.results) || w < 2 || w > b(M).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [b(M).results[w - 2].tallyResults.some((ie) => ie.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; + return !((xe = b(M)) != null && xe.results) || w < 1 || w > b(M).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [b(M).results[w - 1].tallyResults.some((ie) => ie.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; } function st(w) { var Z; - if (!((Z = b(M)) != null && Z.results) || w < 2 || w > b(M).results.length || w === b(M).results.length) return !0; - const V = b(M).results[w - 2].tallyResults; + if (!((Z = b(M)) != null && Z.results) || w < 1 || w > b(M).results.length || w === b(M).results.length) return !0; + const V = b(M).results[w - 1].tallyResults; return V.length === 0 || V.every((_e) => Object.keys(_e.transfers).length === 0); } function de(w) { From fccbbac522ae7156bab72367cdb4fcb5aaa484e4 Mon Sep 17 00:00:00 2001 From: skaphan Date: Fri, 3 Apr 2026 07:08:56 -0700 Subject: [PATCH 25/31] Sync pie chart --- static/pie/pie-chart.es.js | 3883 ++++++++++++++++++------------------ 1 file changed, 1954 insertions(+), 1929 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 416a9a6b..27302b71 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,17 +1,17 @@ -var Po = Object.defineProperty; +var Pl = Object.defineProperty; var sa = (e) => { throw TypeError(e); }; -var Do = (e, t, n) => t in e ? Po(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var pe = (e, t, n) => Do(e, typeof t != "symbol" ? t + "" : t, n), Qi = (e, t, n) => t.has(e) || sa("Cannot " + n); -var v = (e, t, n) => (Qi(e, t, "read from private field"), n ? n.call(e) : t.get(e)), L = (e, t, n) => t.has(e) ? sa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), F = (e, t, n, r) => (Qi(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), be = (e, t, n) => (Qi(e, t, "access private method"), n); +var Dl = (e, t, n) => t in e ? Pl(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var he = (e, t, n) => Dl(e, typeof t != "symbol" ? t + "" : t, n), Zi = (e, t, n) => t.has(e) || sa("Cannot " + n); +var v = (e, t, n) => (Zi(e, t, "read from private field"), n ? n.call(e) : t.get(e)), V = (e, t, n) => t.has(e) ? sa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), L = (e, t, n, r) => (Zi(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), Ae = (e, t, n) => (Zi(e, t, "access private method"), n); var qa; typeof window < "u" && ((qa = window.__svelte ?? (window.__svelte = {})).v ?? (qa.v = /* @__PURE__ */ new Set())).add("5"); -const Io = 1, Fo = 2, za = 4, Oo = 8, Lo = 16, qo = 1, Vo = 4, Ho = 8, Yo = 16, zo = 1, Xo = 2, Ss = "[", Mi = "[!", Ns = "]", fr = {}, Te = Symbol(), Xa = "http://www.w3.org/1999/xhtml", as = !1; -var Ba = Array.isArray, Bo = Array.prototype.indexOf, cr = Array.prototype.includes, Pi = Array.from, yi = Object.keys, wi = Object.defineProperty, Ln = Object.getOwnPropertyDescriptor, Wo = Object.getOwnPropertyDescriptors, Uo = Object.prototype, Go = Array.prototype, Wa = Object.getPrototypeOf, aa = Object.isExtensible; -const Ko = () => { +const Il = 1, Fl = 2, za = 4, Ol = 8, Ll = 16, ql = 1, Vl = 4, Hl = 8, Yl = 16, zl = 1, Bl = 2, Cs = "[", Di = "[!", Ss = "]", fr = {}, Ce = Symbol(), Ba = "http://www.w3.org/1999/xhtml", ss = !1; +var Xa = Array.isArray, Xl = Array.prototype.indexOf, cr = Array.prototype.includes, Ii = Array.from, xi = Object.keys, bi = Object.defineProperty, Vn = Object.getOwnPropertyDescriptor, Wl = Object.getOwnPropertyDescriptors, Ul = Object.prototype, Gl = Array.prototype, Wa = Object.getPrototypeOf, aa = Object.isExtensible; +const Kl = () => { }; -function jo(e) { +function jl(e) { for (var t = 0; t < e.length; t++) e[t](); } @@ -21,7 +21,7 @@ function Ua() { }); return { promise: n, resolve: e, reject: t }; } -function Jo(e, t) { +function Jl(e, t) { if (Array.isArray(e)) return e; if (!(Symbol.iterator in e)) @@ -31,15 +31,15 @@ function Jo(e, t) { if (n.push(r), n.length === t) break; return n; } -const Ce = 2, Lr = 4, Di = 8, Ga = 1 << 24, fn = 16, xt = 32, bn = 64, Ka = 128, ft = 512, Ae = 1024, Se = 2048, wt = 4096, tt = 8192, an = 16384, yr = 32768, hr = 65536, la = 1 << 17, ja = 1 << 18, Wn = 1 << 19, Zo = 1 << 20, rn = 1 << 25, Yn = 65536, ls = 1 << 21, ks = 1 << 22, _n = 1 << 23, Ir = Symbol("$state"), Ja = Symbol("legacy props"), Qo = Symbol(""), Rn = new class extends Error { +const Ne = 2, Fr = 4, Fi = 8, Ga = 1 << 24, ln = 16, Tt = 32, xn = 64, Ka = 128, pt = 512, Te = 1024, ke = 2048, Et = 4096, rt = 8192, rn = 16384, yr = 32768, hr = 65536, oa = 1 << 17, ja = 1 << 18, Gn = 1 << 19, Zl = 1 << 20, tn = 1 << 25, Bn = 65536, as = 1 << 21, Ns = 1 << 22, gn = 1 << 23, Pr = Symbol("$state"), Ja = Symbol("legacy props"), Ql = Symbol(""), Sn = new class extends Error { constructor() { super(...arguments); - pe(this, "name", "StaleReactionError"); - pe(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + he(this, "name", "StaleReactionError"); + he(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } }(); var Va; -const eu = ((Va = globalThis.document) == null ? void 0 : /* @__PURE__ */ Va.contentType.includes("xml")) ?? !1, Kr = 3, wr = 8; +const eu = ((Va = globalThis.document) == null ? void 0 : /* @__PURE__ */ Va.contentType.includes("xml")) ?? !1, Ur = 3, wr = 8; function tu(e) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } @@ -58,10 +58,10 @@ function su() { function au(e) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function lu() { +function ou() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function ou() { +function lu() { throw new Error("https://svelte.dev/e/hydration_failed"); } function uu(e) { @@ -79,51 +79,51 @@ function hu() { function du() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Ii(e) { +function Oi(e) { console.warn("https://svelte.dev/e/hydration_mismatch"); } function pu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } -let K = !1; -function sn(e) { - K = e; +let G = !1; +function nn(e) { + G = e; } -let z; -function Fe(e) { +let X; +function He(e) { if (e === null) - throw Ii(), fr; - return z = e; + throw Oi(), fr; + return X = e; } -function Fi() { - return Fe(/* @__PURE__ */ Ot(z)); +function Li() { + return He(/* @__PURE__ */ Ot(X)); } -function De(e) { - if (K) { - if (/* @__PURE__ */ Ot(z) !== null) - throw Ii(), fr; - z = e; +function qe(e) { + if (G) { + if (/* @__PURE__ */ Ot(X) !== null) + throw Oi(), fr; + X = e; } } function os(e = 1) { - if (K) { - for (var t = e, n = z; t--; ) + if (G) { + for (var t = e, n = X; t--; ) n = /** @type {TemplateNode} */ /* @__PURE__ */ Ot(n); - z = n; + X = n; } } -function xi(e = !0) { - for (var t = 0, n = z; ; ) { +function $i(e = !0) { + for (var t = 0, n = X; ; ) { if (n.nodeType === wr) { var r = ( /** @type {Comment} */ n.data ); - if (r === Ns) { + if (r === Ss) { if (t === 0) return n; t -= 1; - } else (r === Ss || r === Mi || // "[1", "[2", etc. for if blocks + } else (r === Cs || r === Di || // "[1", "[2", etc. for if blocks r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1); } var i = ( @@ -135,7 +135,7 @@ function xi(e = !0) { } function Za(e) { if (!e || e.nodeType !== wr) - throw Ii(), fr; + throw Oi(), fr; return ( /** @type {Comment} */ e.data @@ -147,16 +147,16 @@ function Qa(e) { function vu(e, t) { return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; } -function el(e) { +function eo(e) { return !vu(e, this.v); } -let gu = !1, rt = null; +let gu = !1, st = null; function dr(e) { - rt = e; + st = e; } -function Oi(e, t = !1, n) { - rt = { - p: rt, +function qi(e, t = !1, n) { + st = { + p: st, i: !1, c: null, e: null, @@ -165,45 +165,45 @@ function Oi(e, t = !1, n) { l: null }; } -function Li(e) { +function Vi(e) { var t = ( /** @type {ComponentContext} */ - rt + st ), n = t.e; if (n !== null) { t.e = null; for (var r of n) - El(r); + To(r); } - return e !== void 0 && (t.x = e), t.i = !0, rt = t.p, e ?? /** @type {T} */ + return e !== void 0 && (t.x = e), t.i = !0, st = t.p, e ?? /** @type {T} */ {}; } -function tl() { +function to() { return !0; } -let Cn = []; -function nl() { - var e = Cn; - Cn = [], jo(e); +let Nn = []; +function no() { + var e = Nn; + Nn = [], jl(e); } -function mn(e) { - if (Cn.length === 0 && !Fr) { - var t = Cn; +function _n(e) { + if (Nn.length === 0 && !Dr) { + var t = Nn; queueMicrotask(() => { - t === Cn && nl(); + t === Nn && no(); }); } - Cn.push(e); + Nn.push(e); } function _u() { - for (; Cn.length > 0; ) - nl(); + for (; Nn.length > 0; ) + no(); } -function rl(e) { - var t = J; +function ro(e) { + var t = j; if (t === null) - return Y.f |= _n, e; - if ((t.f & yr) === 0 && (t.f & Lr) === 0) + return B.f |= gn, e; + if ((t.f & yr) === 0 && (t.f & Fr) === 0) throw e; pr(e, t); } @@ -224,77 +224,77 @@ function pr(e, t) { throw e; } const mu = -7169; -function ge(e, t) { +function pe(e, t) { e.f = e.f & mu | t; } -function Ms(e) { - (e.f & ft) !== 0 || e.deps === null ? ge(e, Ae) : ge(e, wt); +function ks(e) { + (e.f & pt) !== 0 || e.deps === null ? pe(e, Te) : pe(e, Et); } -function il(e) { +function io(e) { if (e !== null) for (const t of e) - (t.f & Ce) === 0 || (t.f & Yn) === 0 || (t.f ^= Yn, il( + (t.f & Ne) === 0 || (t.f & Bn) === 0 || (t.f ^= Bn, io( /** @type {Derived} */ t.deps )); } -function sl(e, t, n) { - (e.f & Se) !== 0 ? t.add(e) : (e.f & wt) !== 0 && n.add(e), il(e.deps), ge(e, Ae); +function so(e, t, n) { + (e.f & ke) !== 0 ? t.add(e) : (e.f & Et) !== 0 && n.add(e), io(e.deps), pe(e, Te); } -const Qr = /* @__PURE__ */ new Set(); -let G = null, Re = null, Be = [], qi = null, us = !1, Fr = !1; -var rr, ir, Mn, sr, Xr, Br, Pn, Zt, ar, Ft, fs, cs, al; -const js = class js { +const ti = /* @__PURE__ */ new Set(); +let U = null, Se = null, je = [], Hi = null, ls = !1, Dr = !1; +var rr, ir, Dn, sr, Yr, zr, In, jt, ar, Ft, us, fs, ao; +const Ks = class Ks { constructor() { - L(this, Ft); - pe(this, "committed", !1); + V(this, Ft); + he(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} */ - pe(this, "current", /* @__PURE__ */ new Map()); + he(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} */ - pe(this, "previous", /* @__PURE__ */ new Map()); + he(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>} */ - L(this, rr, /* @__PURE__ */ new Set()); + V(this, rr, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - L(this, ir, /* @__PURE__ */ new Set()); + V(this, ir, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - L(this, Mn, 0); + V(this, Dn, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - L(this, sr, 0); + V(this, sr, 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} */ - L(this, Xr, null); + V(this, Yr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - L(this, Br, /* @__PURE__ */ new Set()); + V(this, zr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - L(this, Pn, /* @__PURE__ */ new Set()); + V(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,9 +302,9 @@ const js = class js { * so they can be rescheduled if the branch survives. * @type {Map} */ - L(this, Zt, /* @__PURE__ */ new Map()); - pe(this, "is_fork", !1); - L(this, ar, !1); + V(this, jt, /* @__PURE__ */ new Map()); + he(this, "is_fork", !1); + V(this, ar, !1); } is_deferred() { return this.is_fork || v(this, sr) > 0; @@ -314,7 +314,7 @@ const js = class js { * @param {Effect} effect */ skip_effect(t) { - v(this, Zt).has(t) || v(this, Zt).set(t, { d: [], m: [] }); + v(this, jt).has(t) || v(this, jt).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, Zt).get(t); + var n = v(this, jt).get(t); if (n) { - v(this, Zt).delete(t); + v(this, jt).delete(t); for (var r of n.d) - ge(r, Se), mt(r); + pe(r, ke), $t(r); for (r of n.m) - ge(r, wt), mt(r); + pe(r, Et), $t(r); } } /** @@ -337,19 +337,19 @@ const js = class js { */ process(t) { var i; - Be = [], this.apply(); + je = [], this.apply(); var n = [], r = []; for (const s of t) - be(this, Ft, fs).call(this, s, n, r); + Ae(this, Ft, us).call(this, s, n, r); if (this.is_deferred()) { - be(this, Ft, cs).call(this, r), be(this, Ft, cs).call(this, n); - for (const [s, a] of v(this, Zt)) - fl(s, a); + Ae(this, Ft, fs).call(this, r), Ae(this, Ft, fs).call(this, n); + for (const [s, a] of v(this, jt)) + fo(s, a); } else { for (const s of v(this, rr)) s(); - v(this, rr).clear(), v(this, Mn) === 0 && be(this, Ft, al).call(this), G = null, oa(r), oa(n), (i = v(this, Xr)) == null || i.resolve(); + v(this, rr).clear(), v(this, Dn) === 0 && Ae(this, Ft, ao).call(this), U = null, la(r), la(n), (i = v(this, Yr)) == null || i.resolve(); } - Re = null; + Se = null; } /** * Associate a change to a given source with the current @@ -358,19 +358,19 @@ const js = class js { * @param {any} value */ capture(t, n) { - n !== Te && !this.previous.has(t) && this.previous.set(t, n), (t.f & _n) === 0 && (this.current.set(t, t.v), Re == null || Re.set(t, t.v)); + n !== Ce && !this.previous.has(t) && this.previous.set(t, n), (t.f & gn) === 0 && (this.current.set(t, t.v), Se == null || Se.set(t, t.v)); } activate() { - G = this, this.apply(); + U = this, this.apply(); } deactivate() { - G === this && (G = null, Re = null); + U === this && (U = null, Se = null); } flush() { - if (this.activate(), Be.length > 0) { - if (ll(), G !== null && G !== this) + if (this.activate(), je.length > 0) { + if (oo(), U !== null && U !== this) return; - } else v(this, Mn) === 0 && this.process([]); + } else v(this, Dn) === 0 && this.process([]); this.deactivate(); } discard() { @@ -382,22 +382,22 @@ const js = class js { * @param {boolean} blocking */ increment(t) { - F(this, Mn, v(this, Mn) + 1), t && F(this, sr, v(this, sr) + 1); + L(this, Dn, v(this, Dn) + 1), t && L(this, sr, v(this, sr) + 1); } /** * * @param {boolean} blocking */ decrement(t) { - F(this, Mn, v(this, Mn) - 1), t && F(this, sr, v(this, sr) - 1), !v(this, ar) && (F(this, ar, !0), mn(() => { - F(this, ar, !1), this.is_deferred() ? Be.length > 0 && this.flush() : this.revive(); + L(this, Dn, v(this, Dn) - 1), t && L(this, sr, v(this, sr) - 1), !v(this, ar) && (L(this, ar, !0), _n(() => { + L(this, ar, !1), this.is_deferred() ? je.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const t of v(this, Br)) - v(this, Pn).delete(t), ge(t, Se), mt(t); - for (const t of v(this, Pn)) - ge(t, wt), mt(t); + for (const t of v(this, zr)) + v(this, In).delete(t), pe(t, ke), $t(t); + for (const t of v(this, In)) + pe(t, Et), $t(t); this.flush(); } /** @param {() => void} fn */ @@ -409,33 +409,33 @@ const js = class js { v(this, ir).add(t); } settled() { - return (v(this, Xr) ?? F(this, Xr, Ua())).promise; + return (v(this, Yr) ?? L(this, Yr, Ua())).promise; } static ensure() { - if (G === null) { - const t = G = new js(); - Qr.add(G), Fr || mn(() => { - G === t && t.flush(); + if (U === null) { + const t = U = new Ks(); + ti.add(U), Dr || _n(() => { + U === t && t.flush(); }); } - return G; + return U; } apply() { } }; -rr = new WeakMap(), ir = new WeakMap(), Mn = new WeakMap(), sr = new WeakMap(), Xr = new WeakMap(), Br = new WeakMap(), Pn = new WeakMap(), Zt = new WeakMap(), ar = new WeakMap(), Ft = new WeakSet(), /** +rr = new WeakMap(), ir = new WeakMap(), Dn = new WeakMap(), sr = new WeakMap(), Yr = new WeakMap(), zr = new WeakMap(), In = new WeakMap(), jt = new WeakMap(), ar = new WeakMap(), Ft = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -fs = function(t, n, r) { - t.f ^= Ae; +us = function(t, n, r) { + t.f ^= Te; for (var i = t.first, s = null; i !== null; ) { - var a = i.f, l = (a & (xt | bn)) !== 0, o = l && (a & Ae) !== 0, u = o || (a & tt) !== 0 || v(this, Zt).has(i); + var a = i.f, o = (a & (Tt | xn)) !== 0, l = o && (a & Te) !== 0, u = l || (a & rt) !== 0 || v(this, jt).has(i); if (!u && i.fn !== null) { - l ? i.f ^= Ae : s !== null && (a & (Lr | Di | Ga)) !== 0 ? s.b.defer_effect(i) : (a & Lr) !== 0 ? n.push(i) : jr(i) && ((a & fn) !== 0 && v(this, Pn).add(i), gr(i)); + o ? i.f ^= Te : s !== null && (a & (Fr | Fi | Ga)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Gr(i) && ((a & ln) !== 0 && v(this, In).add(i), gr(i)); var f = i.first; if (f !== null) { i = f; @@ -449,137 +449,137 @@ fs = function(t, n, r) { }, /** * @param {Effect[]} effects */ -cs = function(t) { +fs = function(t) { for (var n = 0; n < t.length; n += 1) - sl(t[n], v(this, Br), v(this, Pn)); -}, al = function() { + so(t[n], v(this, zr), v(this, In)); +}, ao = function() { var i; - if (Qr.size > 1) { + if (ti.size > 1) { this.previous.clear(); - var t = Re, n = !0; - for (const s of Qr) { + var t = Se, n = !0; + for (const s of ti) { if (s === this) { n = !1; continue; } const a = []; - for (const [o, u] of this.current) { - if (s.current.has(o)) - if (n && u !== s.current.get(o)) - s.current.set(o, u); + for (const [l, u] of this.current) { + if (s.current.has(l)) + if (n && u !== s.current.get(l)) + s.current.set(l, u); else continue; - a.push(o); + a.push(l); } if (a.length === 0) continue; - const l = [...s.current.keys()].filter((o) => !this.current.has(o)); - if (l.length > 0) { - var r = Be; - Be = []; - const o = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); + const o = [...s.current.keys()].filter((l) => !this.current.has(l)); + if (o.length > 0) { + var r = je; + je = []; + const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - ol(f, l, o, u); - if (Be.length > 0) { - G = s, s.apply(); - for (const f of Be) - be(i = s, Ft, fs).call(i, f, [], []); + lo(f, o, l, u); + if (je.length > 0) { + U = s, s.apply(); + for (const f of je) + Ae(i = s, Ft, us).call(i, f, [], []); s.deactivate(); } - Be = r; + je = r; } } - G = null, Re = t; + U = null, Se = t; } - this.committed = !0, Qr.delete(this); + this.committed = !0, ti.delete(this); }; -let ln = js; +let sn = Ks; function se(e) { - var t = Fr; - Fr = !0; + var t = Dr; + Dr = !0; try { for (var n; ; ) { - if (_u(), Be.length === 0 && (G == null || G.flush(), Be.length === 0)) - return qi = null, /** @type {T} */ + if (_u(), je.length === 0 && (U == null || U.flush(), je.length === 0)) + return Hi = null, /** @type {T} */ n; - ll(); + oo(); } } finally { - Fr = t; + Dr = t; } } -function ll() { - us = !0; +function oo() { + ls = !0; var e = null; try { - for (var t = 0; Be.length > 0; ) { - var n = ln.ensure(); + for (var t = 0; je.length > 0; ) { + var n = sn.ensure(); if (t++ > 1e3) { var r, i; yu(); } - n.process(Be), yn.clear(); + n.process(je), mn.clear(); } } finally { - Be = [], us = !1, qi = null; + je = [], ls = !1, Hi = null; } } function yu() { try { - lu(); + ou(); } catch (e) { - pr(e, qi); + pr(e, Hi); } } -let vt = null; -function oa(e) { +let wt = null; +function la(e) { var t = e.length; if (t !== 0) { for (var n = 0; n < t; ) { var r = e[n++]; - if ((r.f & (an | tt)) === 0 && jr(r) && (vt = /* @__PURE__ */ new Set(), gr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Cl(r), (vt == null ? void 0 : vt.size) > 0)) { - yn.clear(); - for (const i of vt) { - if ((i.f & (an | tt)) !== 0) continue; + if ((r.f & (rn | rt)) === 0 && Gr(r) && (wt = /* @__PURE__ */ new Set(), gr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && So(r), (wt == null ? void 0 : wt.size) > 0)) { + mn.clear(); + for (const i of wt) { + if ((i.f & (rn | rt)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - vt.has(a) && (vt.delete(a), s.push(a)), a = a.parent; - for (let l = s.length - 1; l >= 0; l--) { - const o = s[l]; - (o.f & (an | tt)) === 0 && gr(o); + 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 & (rn | rt)) === 0 && gr(l); } } - vt.clear(); + wt.clear(); } } - vt = null; + wt = null; } } -function ol(e, t, n, r) { +function lo(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 & Ce) !== 0 ? ol( + (s & Ne) !== 0 ? lo( /** @type {Derived} */ i, t, n, r - ) : (s & (ks | fn)) !== 0 && (s & Se) === 0 && ul(i, t, r) && (ge(i, Se), mt( + ) : (s & (Ns | ln)) !== 0 && (s & ke) === 0 && uo(i, t, r) && (pe(i, ke), $t( /** @type {Effect} */ i )); } } -function ul(e, t, n) { +function uo(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)) return !0; - if ((i.f & Ce) !== 0 && ul( + if ((i.f & Ne) !== 0 && uo( /** @type {Derived} */ i, t, @@ -593,41 +593,41 @@ function ul(e, t, n) { } return n.set(e, !1), !1; } -function mt(e) { - for (var t = qi = e; t.parent !== null; ) { +function $t(e) { + for (var t = Hi = e; t.parent !== null; ) { t = t.parent; var n = t.f; - if (us && t === J && (n & fn) !== 0 && (n & ja) === 0) + if (ls && t === j && (n & ln) !== 0 && (n & ja) === 0) return; - if ((n & (bn | xt)) !== 0) { - if ((n & Ae) === 0) return; - t.f ^= Ae; + if ((n & (xn | Tt)) !== 0) { + if ((n & Te) === 0) return; + t.f ^= Te; } } - Be.push(t); + je.push(t); } -function fl(e, t) { - if (!((e.f & xt) !== 0 && (e.f & Ae) !== 0)) { - (e.f & Se) !== 0 ? t.d.push(e) : (e.f & wt) !== 0 && t.m.push(e), ge(e, Ae); +function fo(e, t) { + if (!((e.f & Tt) !== 0 && (e.f & Te) !== 0)) { + (e.f & ke) !== 0 ? t.d.push(e) : (e.f & Et) !== 0 && t.m.push(e), pe(e, Te); for (var n = e.first; n !== null; ) - fl(n, t), n = n.next; + fo(n, t), n = n.next; } } function wu(e) { - let t = 0, n = zn(0), r; + let t = 0, n = Xn(0), r; return () => { - Is() && (b(n), Os(() => (t === 0 && (r = Yi(() => e(() => Or(n)))), t += 1, () => { - mn(() => { - t -= 1, t === 0 && (r == null || r(), r = void 0, Or(n)); + Ds() && (b(n), Fs(() => (t === 0 && (r = Bi(() => e(() => Ir(n)))), t += 1, () => { + _n(() => { + t -= 1, t === 0 && (r == null || r(), r = void 0, Ir(n)); }); }))); }; } -var xu = hr | Wn | Ka; +var xu = hr | Gn | Ka; function bu(e, t, n) { new $u(e, t, n); } -var Qe, Wr, St, Dn, Nt, lt, ze, kt, Qt, gn, In, en, lr, Fn, or, ur, tn, Ni, ye, cl, hl, hs, li, oi, ds; +var tt, Br, St, Fn, Nt, ct, Ge, kt, Jt, vn, On, Zt, or, Ln, lr, ur, Qt, Mi, ye, co, ho, cs, ui, fi, hs; class $u { /** * @param {TemplateNode} node @@ -635,38 +635,38 @@ class $u { * @param {((anchor: Node) => void)} children */ constructor(t, n, r) { - L(this, ye); + V(this, ye); /** @type {Boundary | null} */ - pe(this, "parent"); - pe(this, "is_pending", !1); + he(this, "parent"); + he(this, "is_pending", !1); /** @type {TemplateNode} */ - L(this, Qe); + V(this, tt); /** @type {TemplateNode | null} */ - L(this, Wr, K ? z : null); + V(this, Br, G ? X : null); /** @type {BoundaryProps} */ - L(this, St); + V(this, St); /** @type {((anchor: Node) => void)} */ - L(this, Dn); + V(this, Fn); /** @type {Effect} */ - L(this, Nt); + V(this, Nt); /** @type {Effect | null} */ - L(this, lt, null); + V(this, ct, null); /** @type {Effect | null} */ - L(this, ze, null); + V(this, Ge, null); /** @type {Effect | null} */ - L(this, kt, null); + V(this, kt, null); /** @type {DocumentFragment | null} */ - L(this, Qt, null); + V(this, Jt, null); /** @type {TemplateNode | null} */ - L(this, gn, null); - L(this, In, 0); - L(this, en, 0); - L(this, lr, !1); - L(this, Fn, !1); + V(this, vn, null); + V(this, On, 0); + V(this, Zt, 0); + V(this, or, !1); + V(this, Ln, !1); /** @type {Set} */ - L(this, or, /* @__PURE__ */ new Set()); + V(this, lr, /* @__PURE__ */ new Set()); /** @type {Set} */ - L(this, ur, /* @__PURE__ */ new Set()); + V(this, ur, /* @__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 $u { * calls followed by no-op flushes * @type {Source | null} */ - L(this, tn, null); - L(this, Ni, wu(() => (F(this, tn, zn(v(this, In))), () => { - F(this, tn, null); + V(this, Qt, null); + V(this, Mi, wu(() => (L(this, Qt, Xn(v(this, On))), () => { + L(this, Qt, null); }))); - F(this, Qe, t), F(this, St, n), F(this, Dn, r), this.parent = /** @type {Effect} */ - J.b, this.is_pending = !!v(this, St).pending, F(this, Nt, Ls(() => { - if (J.b = this, K) { - const s = v(this, Wr); - Fi(), /** @type {Comment} */ + L(this, tt, t), L(this, St, n), L(this, Fn, r), this.parent = /** @type {Effect} */ + j.b, this.is_pending = !!v(this, St).pending, L(this, Nt, Os(() => { + if (j.b = this, G) { + const s = v(this, Br); + Li(), /** @type {Comment} */ s.nodeType === wr && /** @type {Comment} */ - s.data === Mi ? be(this, ye, hl).call(this) : (be(this, ye, cl).call(this), v(this, en) === 0 && (this.is_pending = !1)); + s.data === Di ? Ae(this, ye, ho).call(this) : (Ae(this, ye, co).call(this), v(this, Zt) === 0 && (this.is_pending = !1)); } else { - var i = be(this, ye, hs).call(this); + var i = Ae(this, ye, cs).call(this); try { - F(this, lt, ut(() => r(i))); + L(this, ct, dt(() => r(i))); } catch (s) { this.error(s); } - v(this, en) > 0 ? be(this, ye, oi).call(this) : this.is_pending = !1; + v(this, Zt) > 0 ? Ae(this, ye, fi).call(this) : this.is_pending = !1; } return () => { var s; - (s = v(this, gn)) == null || s.remove(); + (s = v(this, vn)) == null || s.remove(); }; - }, xu)), K && F(this, Qe, z); + }, xu)), G && L(this, tt, X); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ defer_effect(t) { - sl(t, v(this, or), v(this, ur)); + so(t, v(this, lr), v(this, ur)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -724,176 +724,176 @@ class $u { * @param {1 | -1} d */ update_pending_count(t) { - be(this, ye, ds).call(this, t), F(this, In, v(this, In) + t), !(!v(this, tn) || v(this, lr)) && (F(this, lr, !0), mn(() => { - F(this, lr, !1), v(this, tn) && vr(v(this, tn), v(this, In)); + Ae(this, ye, hs).call(this, t), L(this, On, v(this, On) + t), !(!v(this, Qt) || v(this, or)) && (L(this, or, !0), _n(() => { + L(this, or, !1), v(this, Qt) && vr(v(this, Qt), v(this, On)); })); } get_effect_pending() { - return v(this, Ni).call(this), b( + return v(this, Mi).call(this), b( /** @type {Source} */ - v(this, tn) + v(this, Qt) ); } /** @param {unknown} error */ error(t) { var n = v(this, St).onerror; let r = v(this, St).failed; - if (v(this, Fn) || !n && !r) + if (v(this, Ln) || !n && !r) throw t; - v(this, lt) && (Oe(v(this, lt)), F(this, lt, null)), v(this, ze) && (Oe(v(this, ze)), F(this, ze, null)), v(this, kt) && (Oe(v(this, kt)), F(this, kt, null)), K && (Fe( + v(this, ct) && (Ye(v(this, ct)), L(this, ct, null)), v(this, Ge) && (Ye(v(this, Ge)), L(this, Ge, null)), v(this, kt) && (Ye(v(this, kt)), L(this, kt, null)), G && (He( /** @type {TemplateNode} */ - v(this, Wr) - ), os(), Fe(xi())); + v(this, Br) + ), os(), He($i())); var i = !1, s = !1; const a = () => { if (i) { pu(); return; } - i = !0, s && du(), ln.ensure(), F(this, In, 0), v(this, kt) !== null && qn(v(this, kt), () => { - F(this, kt, null); - }), this.is_pending = this.has_pending_snippet(), F(this, lt, be(this, ye, li).call(this, () => (F(this, Fn, !1), ut(() => v(this, Dn).call(this, v(this, Qe)))))), v(this, en) > 0 ? be(this, ye, oi).call(this) : this.is_pending = !1; + i = !0, s && du(), sn.ensure(), L(this, On, 0), v(this, kt) !== null && Hn(v(this, kt), () => { + L(this, kt, null); + }), this.is_pending = this.has_pending_snippet(), L(this, ct, Ae(this, ye, ui).call(this, () => (L(this, Ln, !1), dt(() => v(this, Fn).call(this, v(this, tt)))))), v(this, Zt) > 0 ? Ae(this, ye, fi).call(this) : this.is_pending = !1; }; - mn(() => { + _n(() => { try { s = !0, n == null || n(t, a), s = !1; - } catch (l) { - pr(l, v(this, Nt) && v(this, Nt).parent); + } catch (o) { + pr(o, v(this, Nt) && v(this, Nt).parent); } - r && F(this, kt, be(this, ye, li).call(this, () => { - ln.ensure(), F(this, Fn, !0); + r && L(this, kt, Ae(this, ye, ui).call(this, () => { + sn.ensure(), L(this, Ln, !0); try { - return ut(() => { + return dt(() => { r( - v(this, Qe), + v(this, tt), () => t, () => a ); }); - } catch (l) { + } catch (o) { return pr( - l, + o, /** @type {Effect} */ v(this, Nt).parent ), null; } finally { - F(this, Fn, !1); + L(this, Ln, !1); } })); }); } } -Qe = new WeakMap(), Wr = new WeakMap(), St = new WeakMap(), Dn = new WeakMap(), Nt = new WeakMap(), lt = new WeakMap(), ze = new WeakMap(), kt = new WeakMap(), Qt = new WeakMap(), gn = new WeakMap(), In = new WeakMap(), en = new WeakMap(), lr = new WeakMap(), Fn = new WeakMap(), or = new WeakMap(), ur = new WeakMap(), tn = new WeakMap(), Ni = new WeakMap(), ye = new WeakSet(), cl = function() { +tt = new WeakMap(), Br = new WeakMap(), St = new WeakMap(), Fn = new WeakMap(), Nt = new WeakMap(), ct = new WeakMap(), Ge = new WeakMap(), kt = new WeakMap(), Jt = new WeakMap(), vn = new WeakMap(), On = new WeakMap(), Zt = new WeakMap(), or = new WeakMap(), Ln = new WeakMap(), lr = new WeakMap(), ur = new WeakMap(), Qt = new WeakMap(), Mi = new WeakMap(), ye = new WeakSet(), co = function() { try { - F(this, lt, ut(() => v(this, Dn).call(this, v(this, Qe)))); + L(this, ct, dt(() => v(this, Fn).call(this, v(this, tt)))); } catch (t) { this.error(t); } -}, hl = function() { +}, ho = function() { const t = v(this, St).pending; - t && (F(this, ze, ut(() => t(v(this, Qe)))), mn(() => { - var n = be(this, ye, hs).call(this); - F(this, lt, be(this, ye, li).call(this, () => (ln.ensure(), ut(() => v(this, Dn).call(this, n))))), v(this, en) > 0 ? be(this, ye, oi).call(this) : (qn( + t && (L(this, Ge, dt(() => t(v(this, tt)))), _n(() => { + var n = Ae(this, ye, cs).call(this); + L(this, ct, Ae(this, ye, ui).call(this, () => (sn.ensure(), dt(() => v(this, Fn).call(this, n))))), v(this, Zt) > 0 ? Ae(this, ye, fi).call(this) : (Hn( /** @type {Effect} */ - v(this, ze), + v(this, Ge), () => { - F(this, ze, null); + L(this, Ge, null); } ), this.is_pending = !1); })); -}, hs = function() { - var t = v(this, Qe); - return this.is_pending && (F(this, gn, nt()), v(this, Qe).before(v(this, gn)), t = v(this, gn)), t; +}, cs = function() { + var t = v(this, tt); + return this.is_pending && (L(this, vn, it()), v(this, tt).before(v(this, vn)), t = v(this, vn)), t; }, /** * @param {() => Effect | null} fn */ -li = function(t) { - var n = J, r = Y, i = rt; - It(v(this, Nt)), ht(v(this, Nt)), dr(v(this, Nt).ctx); +ui = function(t) { + var n = j, r = B, i = st; + It(v(this, Nt)), gt(v(this, Nt)), dr(v(this, Nt).ctx); try { return t(); } catch (s) { - return rl(s), null; + return ro(s), null; } finally { - It(n), ht(r), dr(i); + It(n), gt(r), dr(i); } -}, oi = function() { +}, fi = function() { const t = ( /** @type {(anchor: Node) => void} */ v(this, St).pending ); - v(this, lt) !== null && (F(this, Qt, document.createDocumentFragment()), v(this, Qt).append( + v(this, ct) !== null && (L(this, Jt, document.createDocumentFragment()), v(this, Jt).append( /** @type {TemplateNode} */ - v(this, gn) - ), kl(v(this, lt), v(this, Qt))), v(this, ze) === null && F(this, ze, ut(() => t(v(this, Qe)))); + v(this, vn) + ), Mo(v(this, ct), v(this, Jt))), v(this, Ge) === null && L(this, Ge, dt(() => t(v(this, tt)))); }, /** * 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 * @param {1 | -1} d */ -ds = function(t) { +hs = function(t) { var n; if (!this.has_pending_snippet()) { - this.parent && be(n = this.parent, ye, ds).call(n, t); + this.parent && Ae(n = this.parent, ye, hs).call(n, t); return; } - if (F(this, en, v(this, en) + t), v(this, en) === 0) { + if (L(this, Zt, v(this, Zt) + t), v(this, Zt) === 0) { this.is_pending = !1; - for (const r of v(this, or)) - ge(r, Se), mt(r); + for (const r of v(this, lr)) + pe(r, ke), $t(r); for (const r of v(this, ur)) - ge(r, wt), mt(r); - v(this, or).clear(), v(this, ur).clear(), v(this, ze) && qn(v(this, ze), () => { - F(this, ze, null); - }), v(this, Qt) && (v(this, Qe).before(v(this, Qt)), F(this, Qt, null)); + pe(r, Et), $t(r); + v(this, lr).clear(), v(this, ur).clear(), v(this, Ge) && Hn(v(this, Ge), () => { + L(this, Ge, null); + }), v(this, Jt) && (v(this, tt).before(v(this, Jt)), L(this, Jt, null)); } }; function Au(e, t, n, r) { - const i = Vi; + const i = Yi; var s = e.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { r(t.map(i)); return; } - var a = G, l = ( + var a = U, o = ( /** @type {Effect} */ - J - ), o = Eu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + j + ), l = Eu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; function f(c) { - o(); + l(); try { r(c); } catch (p) { - (l.f & an) === 0 && pr(p, l); + (o.f & rn) === 0 && pr(p, o); } - a == null || a.deactivate(), ps(); + a == null || a.deactivate(), ds(); } if (n.length === 0) { u.then(() => f(t.map(i))); return; } function h() { - o(), Promise.all(n.map((c) => /* @__PURE__ */ Tu(c))).then((c) => f([...t.map(i), ...c])).catch((c) => pr(c, l)); + l(), Promise.all(n.map((c) => /* @__PURE__ */ Tu(c))).then((c) => f([...t.map(i), ...c])).catch((c) => pr(c, o)); } u ? u.then(h) : h(); } function Eu() { - var e = J, t = Y, n = rt, r = G; + var e = j, t = B, n = st, r = U; return function(s = !0) { - It(e), ht(t), dr(n), s && (r == null || r.activate()); + It(e), gt(t), dr(n), s && (r == null || r.activate()); }; } -function ps() { - It(null), ht(null), dr(null); +function ds() { + It(null), gt(null), dr(null); } // @__NO_SIDE_EFFECTS__ -function Vi(e) { - var t = Ce | Se, n = Y !== null && (Y.f & Ce) !== 0 ? ( +function Yi(e) { + var t = Ne | ke, n = B !== null && (B.f & Ne) !== 0 ? ( /** @type {Derived} */ - Y + B ) : null; - return J !== null && (J.f |= Wn), { - ctx: rt, + return j !== null && (j.f |= Gn), { + ctx: st, deps: null, effects: null, equals: Qa, @@ -903,10 +903,10 @@ function Vi(e) { rv: 0, v: ( /** @type {V} */ - Te + Ce ), wv: 0, - parent: n ?? J, + parent: n ?? j, ac: null }; } @@ -914,7 +914,7 @@ function Vi(e) { function Tu(e, t, n) { let r = ( /** @type {Effect | null} */ - J + j ); r === null && nu(); var i = ( @@ -924,45 +924,45 @@ function Tu(e, t, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = zn( + ), a = Xn( /** @type {V} */ - Te - ), l = !Y, o = /* @__PURE__ */ new Map(); + Ce + ), o = !B, l = /* @__PURE__ */ new Map(); return Fu(() => { var p; var u = Ua(); s = u.promise; try { Promise.resolve(e()).then(u.resolve, u.reject).then(() => { - f === G && f.committed && f.deactivate(), ps(); + f === U && f.committed && f.deactivate(), ds(); }); } catch (m) { - u.reject(m), ps(); + u.reject(m), ds(); } var f = ( /** @type {Batch} */ - G + U ); - if (l) { + if (o) { var h = i.is_rendered(); - i.update_pending_count(1), f.increment(h), (p = o.get(f)) == null || p.reject(Rn), o.delete(f), o.set(f, u); + i.update_pending_count(1), f.increment(h), (p = l.get(f)) == null || p.reject(Sn), l.delete(f), l.set(f, u); } const c = (m, $ = void 0) => { if (f.activate(), $) - $ !== Rn && (a.f |= _n, vr(a, $)); + $ !== Sn && (a.f |= gn, vr(a, $)); else { - (a.f & _n) !== 0 && (a.f ^= _n), vr(a, m); - for (const [_, x] of o) { - if (o.delete(_), _ === f) break; - x.reject(Rn); + (a.f & gn) !== 0 && (a.f ^= gn), vr(a, m); + for (const [_, x] of l) { + if (l.delete(_), _ === f) break; + x.reject(Sn); } } - l && (i.update_pending_count(-1), f.decrement(h)); + o && (i.update_pending_count(-1), f.decrement(h)); }; u.promise.then(c, (m) => c(null, m || "unknown")); }), Pu(() => { - for (const u of o.values()) - u.reject(Rn); + for (const u of l.values()) + u.reject(Sn); }), new Promise((u) => { function f(h) { function c() { @@ -974,21 +974,21 @@ function Tu(e, t, n) { }); } // @__NO_SIDE_EFFECTS__ -function hn(e) { - const t = /* @__PURE__ */ Vi(e); - return Ml(t), t; +function cn(e) { + const t = /* @__PURE__ */ Yi(e); + return Po(t), t; } // @__NO_SIDE_EFFECTS__ -function dl(e) { - const t = /* @__PURE__ */ Vi(e); - return t.equals = el, t; +function po(e) { + const t = /* @__PURE__ */ Yi(e); + return t.equals = eo, t; } function Ru(e) { var t = e.effects; if (t !== null) { e.effects = null; for (var n = 0; n < t.length; n += 1) - Oe( + Ye( /** @type {Effect} */ t[n] ); @@ -996,8 +996,8 @@ function Ru(e) { } function Cu(e) { for (var t = e.parent; t !== null; ) { - if ((t.f & Ce) === 0) - return (t.f & an) === 0 ? ( + if ((t.f & Ne) === 0) + return (t.f & rn) === 0 ? ( /** @type {Effect} */ t ) : null; @@ -1005,39 +1005,39 @@ function Cu(e) { } return null; } -function Ps(e) { - var t, n = J; +function Ms(e) { + var t, n = j; It(Cu(e)); try { - e.f &= ~Yn, Ru(e), t = Fl(e); + e.f &= ~Bn, Ru(e), t = Oo(e); } finally { It(n); } return t; } -function pl(e) { - var t = Ps(e); - if (!e.equals(t) && (e.wv = Dl(), (!(G != null && G.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { - ge(e, Ae); +function vo(e) { + var t = Ms(e); + if (!e.equals(t) && (e.wv = Io(), (!(U != null && U.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { + pe(e, Te); return; } - xn || (Re !== null ? (Is() || G != null && G.is_fork) && Re.set(e, t) : Ms(e)); + wn || (Se !== null ? (Ds() || U != null && U.is_fork) && Se.set(e, t) : ks(e)); } function Su(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(Rn), r.teardown = Ko, r.ac = null, qr(r, 0), qs(r)); + (r.teardown || r.ac) && ((t = r.teardown) == null || t.call(r), (n = r.ac) == null || n.abort(Sn), r.teardown = Kl, r.ac = null, Or(r, 0), Ls(r)); } -function vl(e) { +function go(e) { if (e.effects !== null) for (const t of e.effects) t.teardown && gr(t); } -let vs = /* @__PURE__ */ new Set(); -const yn = /* @__PURE__ */ new Map(); -let gl = !1; -function zn(e, t) { +let ps = /* @__PURE__ */ new Set(); +const mn = /* @__PURE__ */ new Map(); +let _o = !1; +function Xn(e, t) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors @@ -1050,129 +1050,129 @@ function zn(e, t) { return n; } // @__NO_SIDE_EFFECTS__ -function $e(e, t) { - const n = zn(e); - return Ml(n), n; +function Ee(e, t) { + const n = Xn(e); + return Po(n), n; } // @__NO_SIDE_EFFECTS__ -function _l(e, t = !1, n = !0) { - const r = zn(e); - return t || (r.equals = el), r; +function mo(e, t = !1, n = !0) { + const r = Xn(e); + return t || (r.equals = eo), r; } -function ve(e, t, n = !1) { - Y !== null && // since we are untracking the function inside `$inspect.with` we need to add this check +function de(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 - (!yt || (Y.f & la) !== 0) && tl() && (Y.f & (Ce | fn | ks | la)) !== 0 && (ct === null || !cr.call(ct, e)) && hu(); - let r = n ? Sn(t) : t; + (!At || (B.f & oa) !== 0) && to() && (B.f & (Ne | ln | Ns | oa)) !== 0 && (vt === null || !cr.call(vt, e)) && hu(); + let r = n ? kn(t) : t; return vr(e, r); } function vr(e, t) { if (!e.equals(t)) { var n = e.v; - xn ? yn.set(e, t) : yn.set(e, n), e.v = t; - var r = ln.ensure(); - if (r.capture(e, n), (e.f & Ce) !== 0) { + wn ? mn.set(e, t) : mn.set(e, n), e.v = t; + var r = sn.ensure(); + if (r.capture(e, n), (e.f & Ne) !== 0) { const i = ( /** @type {Derived} */ e ); - (e.f & Se) !== 0 && Ps(i), Ms(i); + (e.f & ke) !== 0 && Ms(i), ks(i); } - e.wv = Dl(), ml(e, Se), J !== null && (J.f & Ae) !== 0 && (J.f & (xt | bn)) === 0 && (at === null ? qu([e]) : at.push(e)), !r.is_fork && vs.size > 0 && !gl && Nu(); + e.wv = Io(), yo(e, ke), j !== null && (j.f & Te) !== 0 && (j.f & (Tt | xn)) === 0 && (ft === null ? qu([e]) : ft.push(e)), !r.is_fork && ps.size > 0 && !_o && Nu(); } return t; } function Nu() { - gl = !1; - for (const e of vs) - (e.f & Ae) !== 0 && ge(e, wt), jr(e) && gr(e); - vs.clear(); + _o = !1; + for (const e of ps) + (e.f & Te) !== 0 && pe(e, Et), Gr(e) && gr(e); + ps.clear(); } -function Or(e) { - ve(e, e.v + 1); +function Ir(e) { + de(e, e.v + 1); } -function ml(e, t) { +function yo(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, l = (a & Se) === 0; - if (l && ge(s, t), (a & Ce) !== 0) { - var o = ( + var s = n[i], a = s.f, o = (a & ke) === 0; + if (o && pe(s, t), (a & Ne) !== 0) { + var l = ( /** @type {Derived} */ s ); - Re == null || Re.delete(o), (a & Yn) === 0 && (a & ft && (s.f |= Yn), ml(o, wt)); - } else l && ((a & fn) !== 0 && vt !== null && vt.add( + Se == null || Se.delete(l), (a & Bn) === 0 && (a & pt && (s.f |= Bn), yo(l, Et)); + } else o && ((a & ln) !== 0 && wt !== null && wt.add( /** @type {Effect} */ s - ), mt( + ), $t( /** @type {Effect} */ s )); } } -function Sn(e) { - if (typeof e != "object" || e === null || Ir in e) +function kn(e) { + if (typeof e != "object" || e === null || Pr in e) return e; const t = Wa(e); - if (t !== Uo && t !== Go) + if (t !== Ul && t !== Gl) return e; - var n = /* @__PURE__ */ new Map(), r = Ba(e), i = /* @__PURE__ */ $e(0), s = Vn, a = (l) => { - if (Vn === s) - return l(); - var o = Y, u = Vn; - ht(null), ca(s); - var f = l(); - return ht(o), ca(u), f; + var n = /* @__PURE__ */ new Map(), r = Xa(e), i = /* @__PURE__ */ Ee(0), s = Yn, a = (o) => { + if (Yn === s) + return o(); + var l = B, u = Yn; + gt(null), ca(s); + var f = o(); + return gt(l), ca(u), f; }; - return r && n.set("length", /* @__PURE__ */ $e( + return r && n.set("length", /* @__PURE__ */ Ee( /** @type {any[]} */ e.length )), new Proxy( /** @type {any} */ e, { - defineProperty(l, o, u) { + defineProperty(o, l, u) { (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && fu(); - var f = n.get(o); + var f = n.get(l); return f === void 0 ? a(() => { - var h = /* @__PURE__ */ $e(u.value); - return n.set(o, h), h; - }) : ve(f, u.value, !0), !0; + var h = /* @__PURE__ */ Ee(u.value); + return n.set(l, h), h; + }) : de(f, u.value, !0), !0; }, - deleteProperty(l, o) { - var u = n.get(o); + deleteProperty(o, l) { + var u = n.get(l); if (u === void 0) { - if (o in l) { - const f = a(() => /* @__PURE__ */ $e(Te)); - n.set(o, f), Or(i); + if (l in o) { + const f = a(() => /* @__PURE__ */ Ee(Ce)); + n.set(l, f), Ir(i); } } else - ve(u, Te), Or(i); + de(u, Ce), Ir(i); return !0; }, - get(l, o, u) { + get(o, l, u) { var p; - if (o === Ir) + if (l === Pr) return e; - var f = n.get(o), h = o in l; - if (f === void 0 && (!h || (p = Ln(l, o)) != null && p.writable) && (f = a(() => { - var m = Sn(h ? l[o] : Te), $ = /* @__PURE__ */ $e(m); + var f = n.get(l), h = l in o; + if (f === void 0 && (!h || (p = Vn(o, l)) != null && p.writable) && (f = a(() => { + var m = kn(h ? o[l] : Ce), $ = /* @__PURE__ */ Ee(m); return $; - }), n.set(o, f)), f !== void 0) { + }), n.set(l, f)), f !== void 0) { var c = b(f); - return c === Te ? void 0 : c; + return c === Ce ? void 0 : c; } - return Reflect.get(l, o, u); + return Reflect.get(o, l, u); }, - getOwnPropertyDescriptor(l, o) { - var u = Reflect.getOwnPropertyDescriptor(l, o); + getOwnPropertyDescriptor(o, l) { + var u = Reflect.getOwnPropertyDescriptor(o, l); if (u && "value" in u) { - var f = n.get(o); + var f = n.get(l); f && (u.value = b(f)); } else if (u === void 0) { - var h = n.get(o), c = h == null ? void 0 : h.v; - if (h !== void 0 && c !== Te) + var h = n.get(l), c = h == null ? void 0 : h.v; + if (h !== void 0 && c !== Ce) return { enumerable: !0, configurable: !0, @@ -1182,60 +1182,60 @@ function Sn(e) { } return u; }, - has(l, o) { + has(o, l) { var c; - if (o === Ir) + if (l === Pr) return !0; - var u = n.get(o), f = u !== void 0 && u.v !== Te || Reflect.has(l, o); - if (u !== void 0 || J !== null && (!f || (c = Ln(l, o)) != null && c.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== Ce || Reflect.has(o, l); + if (u !== void 0 || j !== null && (!f || (c = Vn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { - var p = f ? Sn(l[o]) : Te, m = /* @__PURE__ */ $e(p); + var p = f ? kn(o[l]) : Ce, m = /* @__PURE__ */ Ee(p); return m; - }), n.set(o, u)); + }), n.set(l, u)); var h = b(u); - if (h === Te) + if (h === Ce) return !1; } return f; }, - set(l, o, u, f) { - var C; - var h = n.get(o), c = o in l; - if (r && o === "length") + set(o, l, u, f) { + var S; + var h = n.get(l), c = l in o; + if (r && l === "length") for (var p = u; p < /** @type {Source} */ h.v; p += 1) { var m = n.get(p + ""); - m !== void 0 ? ve(m, Te) : p in l && (m = a(() => /* @__PURE__ */ $e(Te)), n.set(p + "", m)); + m !== void 0 ? de(m, Ce) : p in o && (m = a(() => /* @__PURE__ */ Ee(Ce)), n.set(p + "", m)); } if (h === void 0) - (!c || (C = Ln(l, o)) != null && C.writable) && (h = a(() => /* @__PURE__ */ $e(void 0)), ve(h, Sn(u)), n.set(o, h)); + (!c || (S = Vn(o, l)) != null && S.writable) && (h = a(() => /* @__PURE__ */ Ee(void 0)), de(h, kn(u)), n.set(l, h)); else { - c = h.v !== Te; - var $ = a(() => Sn(u)); - ve(h, $); + c = h.v !== Ce; + var $ = a(() => kn(u)); + de(h, $); } - var _ = Reflect.getOwnPropertyDescriptor(l, o); + var _ = Reflect.getOwnPropertyDescriptor(o, l); if (_ != null && _.set && _.set.call(f, u), !c) { - if (r && typeof o == "string") { + if (r && typeof l == "string") { var x = ( /** @type {Source} */ n.get("length") - ), D = Number(o); - Number.isInteger(D) && D >= x.v && ve(x, D + 1); + ), F = Number(l); + Number.isInteger(F) && F >= x.v && de(x, F + 1); } - Or(i); + Ir(i); } return !0; }, - ownKeys(l) { + ownKeys(o) { b(i); - var o = Reflect.ownKeys(l).filter((h) => { + var l = Reflect.ownKeys(o).filter((h) => { var c = n.get(h); - return c === void 0 || c.v !== Te; + return c === void 0 || c.v !== Ce; }); for (var [u, f] of n) - f.v !== Te && !(u in l) && o.push(u); - return o; + f.v !== Ce && !(u in o) && l.push(u); + return l; }, setPrototypeOf() { cu(); @@ -1243,129 +1243,129 @@ function Sn(e) { } ); } -var ua, yl, wl, xl; -function gs() { +var ua, wo, xo, bo; +function vs() { if (ua === void 0) { - ua = window, yl = /Firefox/.test(navigator.userAgent); + ua = window, wo = /Firefox/.test(navigator.userAgent); var e = Element.prototype, t = Node.prototype, n = Text.prototype; - wl = Ln(t, "firstChild").get, xl = Ln(t, "nextSibling").get, aa(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), aa(n) && (n.__t = void 0); + xo = Vn(t, "firstChild").get, bo = Vn(t, "nextSibling").get, aa(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), aa(n) && (n.__t = void 0); } } -function nt(e = "") { +function it(e = "") { return document.createTextNode(e); } // @__NO_SIDE_EFFECTS__ -function on(e) { +function an(e) { return ( /** @type {TemplateNode | null} */ - wl.call(e) + xo.call(e) ); } // @__NO_SIDE_EFFECTS__ function Ot(e) { return ( /** @type {TemplateNode | null} */ - xl.call(e) + bo.call(e) ); } -function Ye(e, t) { - if (!K) - return /* @__PURE__ */ on(e); - var n = /* @__PURE__ */ on(z); +function Ue(e, t) { + if (!G) + return /* @__PURE__ */ an(e); + var n = /* @__PURE__ */ an(X); if (n === null) - n = z.appendChild(nt()); - else if (t && n.nodeType !== Kr) { - var r = nt(); - return n == null || n.before(r), Fe(r), r; + n = X.appendChild(it()); + else if (t && n.nodeType !== Ur) { + var r = it(); + return n == null || n.before(r), He(r), r; } - return t && Hi( + return t && zi( /** @type {Text} */ n - ), Fe(n), n; + ), He(n), n; } -function pn(e, t = !1) { - if (!K) { - var n = /* @__PURE__ */ on(e); +function dn(e, t = !1) { + if (!G) { + var n = /* @__PURE__ */ an(e); return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ot(n) : n; } if (t) { - if ((z == null ? void 0 : z.nodeType) !== Kr) { - var r = nt(); - return z == null || z.before(r), Fe(r), r; + if ((X == null ? void 0 : X.nodeType) !== Ur) { + var r = it(); + return X == null || X.before(r), He(r), r; } - Hi( + zi( /** @type {Text} */ - z + X ); } - return z; + return X; } -function Je(e, t = 1, n = !1) { - let r = K ? z : e; +function Qe(e, t = 1, n = !1) { + let r = G ? X : e; for (var i; t--; ) i = r, r = /** @type {TemplateNode} */ /* @__PURE__ */ Ot(r); - if (!K) + if (!G) return r; if (n) { - if ((r == null ? void 0 : r.nodeType) !== Kr) { - var s = nt(); - return r === null ? i == null || i.after(s) : r.before(s), Fe(s), s; + if ((r == null ? void 0 : r.nodeType) !== Ur) { + var s = it(); + return r === null ? i == null || i.after(s) : r.before(s), He(s), s; } - Hi( + zi( /** @type {Text} */ r ); } - return Fe(r), r; + return He(r), r; } -function bl(e) { +function $o(e) { e.textContent = ""; } -function $l() { +function Ao() { return !1; } -function Ds(e, t, n) { +function Ps(e, t, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Xa, e, void 0) + document.createElementNS(Ba, e, void 0) ); } -function Hi(e) { +function zi(e) { if ( /** @type {string} */ e.nodeValue.length < 65536 ) return; let t = e.nextSibling; - for (; t !== null && t.nodeType === Kr; ) + for (; t !== null && t.nodeType === Ur; ) t.remove(), e.nodeValue += /** @type {string} */ t.nodeValue, t = e.nextSibling; } -function Al(e) { - var t = Y, n = J; - ht(null), It(null); +function Eo(e) { + var t = B, n = j; + gt(null), It(null); try { return e(); } finally { - ht(t), It(n); + gt(t), It(n); } } function ku(e) { - J === null && (Y === null && au(), su()), xn && iu(); + j === null && (B === null && au(), su()), wn && iu(); } function Mu(e, t) { var n = t.last; n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); } function Lt(e, t, n) { - var r = J; - r !== null && (r.f & tt) !== 0 && (e |= tt); + var r = j; + r !== null && (r.f & rt) !== 0 && (e |= rt); var i = { - ctx: rt, + ctx: st, deps: null, nodes: null, - f: e | Se | ft, + f: e | ke | pt, first: null, fn: t, last: null, @@ -1380,126 +1380,126 @@ function Lt(e, t, n) { if (n) try { gr(i); - } catch (l) { - throw Oe(i), l; + } catch (o) { + throw Ye(i), o; } - else t !== null && mt(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 & Wn) === 0 && (s = s.first, (e & fn) !== 0 && (e & hr) !== 0 && s !== null && (s.f |= hr)), s !== null && (s.parent = r, r !== null && Mu(s, r), Y !== null && (Y.f & Ce) !== 0 && (e & bn) === 0)) { + (s.f & Gn) === 0 && (s = s.first, (e & ln) !== 0 && (e & hr) !== 0 && s !== null && (s.f |= hr)), s !== null && (s.parent = r, r !== null && Mu(s, r), B !== null && (B.f & Ne) !== 0 && (e & xn) === 0)) { var a = ( /** @type {Derived} */ - Y + B ); (a.effects ?? (a.effects = [])).push(s); } return i; } -function Is() { - return Y !== null && !yt; +function Ds() { + return B !== null && !At; } function Pu(e) { - const t = Lt(Di, null, !1); - return ge(t, Ae), t.teardown = e, t; + const t = Lt(Fi, null, !1); + return pe(t, Te), t.teardown = e, t; } -function Fs(e) { +function Is(e) { ku(); var t = ( /** @type {Effect} */ - J.f - ), n = !Y && (t & xt) !== 0 && (t & yr) === 0; + j.f + ), n = !B && (t & Tt) !== 0 && (t & yr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - rt + st ); (r.e ?? (r.e = [])).push(e); } else - return El(e); + return To(e); } -function El(e) { - return Lt(Lr | Zo, e, !1); +function To(e) { + return Lt(Fr | Zl, e, !1); } function Du(e) { - ln.ensure(); - const t = Lt(bn | Wn, e, !0); + sn.ensure(); + const t = Lt(xn | Gn, e, !0); return () => { - Oe(t); + Ye(t); }; } function Iu(e) { - ln.ensure(); - const t = Lt(bn | Wn, e, !0); + sn.ensure(); + const t = Lt(xn | Gn, e, !0); return (n = {}) => new Promise((r) => { - n.outro ? qn(t, () => { - Oe(t), r(void 0); - }) : (Oe(t), r(void 0)); + n.outro ? Hn(t, () => { + Ye(t), r(void 0); + }) : (Ye(t), r(void 0)); }); } -function Tl(e) { - return Lt(Lr, e, !1); +function Ro(e) { + return Lt(Fr, e, !1); } function Fu(e) { - return Lt(ks | Wn, e, !0); + return Lt(Ns | Gn, e, !0); } -function Os(e, t = 0) { - return Lt(Di | t, e, !0); +function Fs(e, t = 0) { + return Lt(Fi | t, e, !0); } -function Jt(e, t = [], n = [], r = []) { +function Kt(e, t = [], n = [], r = []) { Au(r, t, n, (i) => { - Lt(Di, () => e(...i.map(b)), !0); + Lt(Fi, () => e(...i.map(b)), !0); }); } -function Ls(e, t = 0) { - var n = Lt(fn | t, e, !0); +function Os(e, t = 0) { + var n = Lt(ln | t, e, !0); return n; } -function ut(e) { - return Lt(xt | Wn, e, !0); +function dt(e) { + return Lt(Tt | Gn, e, !0); } -function Rl(e) { +function Co(e) { var t = e.teardown; if (t !== null) { - const n = xn, r = Y; - fa(!0), ht(null); + const n = wn, r = B; + fa(!0), gt(null); try { t.call(null); } finally { - fa(n), ht(r); + fa(n), gt(r); } } } -function qs(e, t = !1) { +function Ls(e, t = !1) { var n = e.first; for (e.first = e.last = null; n !== null; ) { const i = n.ac; - i !== null && Al(() => { - i.abort(Rn); + i !== null && Eo(() => { + i.abort(Sn); }); var r = n.next; - (n.f & bn) !== 0 ? n.parent = null : Oe(n, t), n = r; + (n.f & xn) !== 0 ? n.parent = null : Ye(n, t), n = r; } } function Ou(e) { for (var t = e.first; t !== null; ) { var n = t.next; - (t.f & xt) === 0 && Oe(t), t = n; + (t.f & Tt) === 0 && Ye(t), t = n; } } -function Oe(e, t = !0) { +function Ye(e, t = !0) { var n = !1; (t || (e.f & ja) !== 0) && e.nodes !== null && e.nodes.end !== null && (Lu( e.nodes.start, /** @type {TemplateNode} */ e.nodes.end - ), n = !0), qs(e, t && !n), qr(e, 0), ge(e, an); + ), n = !0), Ls(e, t && !n), Or(e, 0), pe(e, rn); var r = e.nodes && e.nodes.t; if (r !== null) for (const s of r) s.stop(); - Rl(e); + Co(e); var i = e.parent; - i !== null && i.first !== null && Cl(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; + i !== null && i.first !== null && So(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; } function Lu(e, t) { for (; e !== null; ) { @@ -1507,48 +1507,48 @@ function Lu(e, t) { e.remove(), e = n; } } -function Cl(e) { +function So(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 qn(e, t, n = !0) { +function Hn(e, t, n = !0) { var r = []; - Sl(e, r, !0); + No(e, r, !0); var i = () => { - n && Oe(e), t && t(); + n && Ye(e), t && t(); }, s = r.length; if (s > 0) { var a = () => --s || i(); - for (var l of r) - l.out(a); + for (var o of r) + o.out(a); } else i(); } -function Sl(e, t, n) { - if ((e.f & tt) === 0) { - e.f ^= tt; +function No(e, t, n) { + if ((e.f & rt) === 0) { + e.f ^= rt; var r = e.nodes && e.nodes.t; if (r !== null) - for (const l of r) - (l.is_global || n) && t.push(l); + 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, // it means the parent block effect was pruned. In that case, // transparency information was transferred to the branch effect. - (i.f & xt) !== 0 && (e.f & fn) !== 0; - Sl(i, t, a ? n : !1), i = s; + (i.f & Tt) !== 0 && (e.f & ln) !== 0; + No(i, t, a ? n : !1), i = s; } } } -function Vs(e) { - Nl(e, !0); +function qs(e) { + ko(e, !0); } -function Nl(e, t) { - if ((e.f & tt) !== 0) { - e.f ^= tt, (e.f & Ae) === 0 && (ge(e, Se), mt(e)); +function ko(e, t) { + if ((e.f & rt) !== 0) { + e.f ^= rt, (e.f & Te) === 0 && (pe(e, ke), $t(e)); for (var n = e.first; n !== null; ) { - var r = n.next, i = (n.f & hr) !== 0 || (n.f & xt) !== 0; - Nl(n, i ? t : !1), n = r; + var r = n.next, i = (n.f & hr) !== 0 || (n.f & Tt) !== 0; + ko(n, i ? t : !1), n = r; } var s = e.nodes && e.nodes.t; if (s !== null) @@ -1556,153 +1556,153 @@ function Nl(e, t) { (a.is_global || t) && a.in(); } } -function kl(e, t) { +function Mo(e, t) { if (e.nodes) for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { var i = n === r ? null : /* @__PURE__ */ Ot(n); t.append(n), n = i; } } -let ui = !1, xn = !1; +let ci = !1, wn = !1; function fa(e) { - xn = e; + wn = e; } -let Y = null, yt = !1; -function ht(e) { - Y = e; +let B = null, At = !1; +function gt(e) { + B = e; } -let J = null; +let j = null; function It(e) { - J = e; + j = e; } -let ct = null; -function Ml(e) { - Y !== null && (ct === null ? ct = [e] : ct.push(e)); +let vt = null; +function Po(e) { + B !== null && (vt === null ? vt = [e] : vt.push(e)); } -let We = null, Ze = 0, at = null; +let Je = null, et = 0, ft = null; function qu(e) { - at = e; + ft = e; } -let Pl = 1, Nn = 0, Vn = Nn; +let Do = 1, Mn = 0, Yn = Mn; function ca(e) { - Vn = e; + Yn = e; } -function Dl() { - return ++Pl; +function Io() { + return ++Do; } -function jr(e) { +function Gr(e) { var t = e.f; - if ((t & Se) !== 0) + if ((t & ke) !== 0) return !0; - if (t & Ce && (e.f &= ~Yn), (t & wt) !== 0) { + if (t & Ne && (e.f &= ~Bn), (t & Et) !== 0) { for (var n = ( /** @type {Value[]} */ e.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; - if (jr( + if (Gr( /** @type {Derived} */ s - ) && pl( + ) && vo( /** @type {Derived} */ s ), s.wv > e.wv) return !0; } - (t & ft) !== 0 && // During time traveling we don't want to reset the status so that + (t & pt) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - Re === null && ge(e, Ae); + Se === null && pe(e, Te); } return !1; } -function Il(e, t, n = !0) { +function Fo(e, t, n = !0) { var r = e.reactions; - if (r !== null && !(ct !== null && cr.call(ct, e))) + if (r !== null && !(vt !== null && cr.call(vt, e))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Ce) !== 0 ? Il( + (s.f & Ne) !== 0 ? Fo( /** @type {Derived} */ s, t, !1 - ) : t === s && (n ? ge(s, Se) : (s.f & Ae) !== 0 && ge(s, wt), mt( + ) : t === s && (n ? pe(s, ke) : (s.f & Te) !== 0 && pe(s, Et), $t( /** @type {Effect} */ s )); } } -function Fl(e) { +function Oo(e) { var $; - var t = We, n = Ze, r = at, i = Y, s = ct, a = rt, l = yt, o = Vn, u = e.f; - We = /** @type {null | Value[]} */ - null, Ze = 0, at = null, Y = (u & (xt | bn)) === 0 ? e : null, ct = null, dr(e.ctx), yt = !1, Vn = ++Nn, e.ac !== null && (Al(() => { - e.ac.abort(Rn); + var t = Je, n = et, r = ft, i = B, s = vt, a = st, o = At, l = Yn, u = e.f; + Je = /** @type {null | Value[]} */ + null, et = 0, ft = null, B = (u & (Tt | xn)) === 0 ? e : null, vt = null, dr(e.ctx), At = !1, Yn = ++Mn, e.ac !== null && (Eo(() => { + e.ac.abort(Sn); }), e.ac = null); try { - e.f |= ls; + e.f |= as; var f = ( /** @type {Function} */ e.fn ), h = f(); e.f |= yr; - var c = e.deps, p = G == null ? void 0 : G.is_fork; - if (We !== null) { + var c = e.deps, p = U == null ? void 0 : U.is_fork; + if (Je !== null) { var m; - if (p || qr(e, Ze), c !== null && Ze > 0) - for (c.length = Ze + We.length, m = 0; m < We.length; m++) - c[Ze + m] = We[m]; + if (p || Or(e, et), c !== null && et > 0) + for (c.length = et + Je.length, m = 0; m < Je.length; m++) + c[et + m] = Je[m]; else - e.deps = c = We; - if (Is() && (e.f & ft) !== 0) - for (m = Ze; m < c.length; m++) + e.deps = c = Je; + if (Ds() && (e.f & pt) !== 0) + for (m = et; m < c.length; m++) (($ = c[m]).reactions ?? ($.reactions = [])).push(e); - } else !p && c !== null && Ze < c.length && (qr(e, Ze), c.length = Ze); - if (tl() && at !== null && !yt && c !== null && (e.f & (Ce | wt | Se)) === 0) + } else !p && c !== null && et < c.length && (Or(e, et), c.length = et); + if (to() && ft !== null && !At && c !== null && (e.f & (Ne | Et | ke)) === 0) for (m = 0; m < /** @type {Source[]} */ - at.length; m++) - Il( - at[m], + ft.length; m++) + Fo( + ft[m], /** @type {Effect} */ e ); if (i !== null && i !== e) { - if (Nn++, i.deps !== null) + if (Mn++, i.deps !== null) for (let _ = 0; _ < n; _ += 1) - i.deps[_].rv = Nn; + i.deps[_].rv = Mn; if (t !== null) for (const _ of t) - _.rv = Nn; - at !== null && (r === null ? r = at : r.push(.../** @type {Source[]} */ - at)); + _.rv = Mn; + ft !== null && (r === null ? r = ft : r.push(.../** @type {Source[]} */ + ft)); } - return (e.f & _n) !== 0 && (e.f ^= _n), h; + return (e.f & gn) !== 0 && (e.f ^= gn), h; } catch (_) { - return rl(_); + return ro(_); } finally { - e.f ^= ls, We = t, Ze = n, at = r, Y = i, ct = s, dr(a), yt = l, Vn = o; + e.f ^= as, Je = t, et = n, ft = r, B = i, vt = s, dr(a), At = o, Yn = l; } } function Vu(e, t) { let n = t.reactions; if (n !== null) { - var r = Bo.call(n, e); + var r = Xl.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 & Ce) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (t.f & Ne) !== 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 - (We === null || !cr.call(We, t))) { + (Je === null || !cr.call(Je, t))) { var s = ( /** @type {Derived} */ t ); - (s.f & ft) !== 0 && (s.f ^= ft, s.f &= ~Yn), Ms(s), Su(s), qr(s, 0); + (s.f & pt) !== 0 && (s.f ^= pt, s.f &= ~Bn), ks(s), Su(s), Or(s, 0); } } -function qr(e, t) { +function Or(e, t) { var n = e.deps; if (n !== null) for (var r = t; r < n.length; r++) @@ -1710,91 +1710,91 @@ function qr(e, t) { } function gr(e) { var t = e.f; - if ((t & an) === 0) { - ge(e, Ae); - var n = J, r = ui; - J = e, ui = !0; + if ((t & rn) === 0) { + pe(e, Te); + var n = j, r = ci; + j = e, ci = !0; try { - (t & (fn | Ga)) !== 0 ? Ou(e) : qs(e), Rl(e); - var i = Fl(e); - e.teardown = typeof i == "function" ? i : null, e.wv = Pl; + (t & (ln | Ga)) !== 0 ? Ou(e) : Ls(e), Co(e); + var i = Oo(e); + e.teardown = typeof i == "function" ? i : null, e.wv = Do; var s; - as && gu && (e.f & Se) !== 0 && e.deps; + ss && gu && (e.f & ke) !== 0 && e.deps; } finally { - ui = r, J = n; + ci = r, j = n; } } } function b(e) { - var t = e.f, n = (t & Ce) !== 0; - if (Y !== null && !yt) { - var r = J !== null && (J.f & an) !== 0; - if (!r && (ct === null || !cr.call(ct, e))) { - var i = Y.deps; - if ((Y.f & ls) !== 0) - e.rv < Nn && (e.rv = Nn, We === null && i !== null && i[Ze] === e ? Ze++ : We === null ? We = [e] : We.push(e)); + var t = e.f, n = (t & Ne) !== 0; + if (B !== null && !At) { + var r = j !== null && (j.f & rn) !== 0; + if (!r && (vt === null || !cr.call(vt, e))) { + var i = B.deps; + if ((B.f & as) !== 0) + e.rv < Mn && (e.rv = Mn, Je === null && i !== null && i[et] === e ? et++ : Je === null ? Je = [e] : Je.push(e)); else { - (Y.deps ?? (Y.deps = [])).push(e); + (B.deps ?? (B.deps = [])).push(e); var s = e.reactions; - s === null ? e.reactions = [Y] : cr.call(s, Y) || s.push(Y); + s === null ? e.reactions = [B] : cr.call(s, B) || s.push(B); } } } - if (xn && yn.has(e)) - return yn.get(e); + if (wn && mn.has(e)) + return mn.get(e); if (n) { var a = ( /** @type {Derived} */ e ); - if (xn) { - var l = a.v; - return ((a.f & Ae) === 0 && a.reactions !== null || Ll(a)) && (l = Ps(a)), yn.set(a, l), l; + if (wn) { + var o = a.v; + return ((a.f & Te) === 0 && a.reactions !== null || qo(a)) && (o = Ms(a)), mn.set(a, o), o; } - var o = (a.f & ft) === 0 && !yt && Y !== null && (ui || (Y.f & ft) !== 0), u = (a.f & yr) === 0; - jr(a) && (o && (a.f |= ft), pl(a)), o && !u && (vl(a), Ol(a)); + var l = (a.f & pt) === 0 && !At && B !== null && (ci || (B.f & pt) !== 0), u = (a.f & yr) === 0; + Gr(a) && (l && (a.f |= pt), vo(a)), l && !u && (go(a), Lo(a)); } - if (Re != null && Re.has(e)) - return Re.get(e); - if ((e.f & _n) !== 0) + if (Se != null && Se.has(e)) + return Se.get(e); + if ((e.f & gn) !== 0) throw e.v; return e.v; } -function Ol(e) { - if (e.f |= ft, e.deps !== null) +function Lo(e) { + if (e.f |= pt, e.deps !== null) for (const t of e.deps) - (t.reactions ?? (t.reactions = [])).push(e), (t.f & Ce) !== 0 && (t.f & ft) === 0 && (vl( + (t.reactions ?? (t.reactions = [])).push(e), (t.f & Ne) !== 0 && (t.f & pt) === 0 && (go( /** @type {Derived} */ t - ), Ol( + ), Lo( /** @type {Derived} */ t )); } -function Ll(e) { - if (e.v === Te) return !0; +function qo(e) { + if (e.v === Ce) return !0; if (e.deps === null) return !1; for (const t of e.deps) - if (yn.has(t) || (t.f & Ce) !== 0 && Ll( + if (mn.has(t) || (t.f & Ne) !== 0 && qo( /** @type {Derived} */ t )) return !0; return !1; } -function Yi(e) { - var t = yt; +function Bi(e) { + var t = At; try { - return yt = !0, e(); + return At = !0, e(); } finally { - yt = t; + At = t; } } -const ql = /* @__PURE__ */ new Set(), _s = /* @__PURE__ */ new Set(); +const Vo = /* @__PURE__ */ new Set(), gs = /* @__PURE__ */ new Set(); function Hu(e) { for (var t = 0; t < e.length; t++) - ql.add(e[t]); - for (var n of _s) + Vo.add(e[t]); + for (var n of gs) n(e); } let ha = null; @@ -1808,10 +1808,10 @@ function da(e) { i[0] || e.target ); ha = e; - var a = 0, l = ha === e && e.__root; - if (l) { - var o = i.indexOf(l); - if (o !== -1 && (t === document || t === /** @type {any} */ + var a = 0, o = ha === e && e.__root; + if (o) { + var l = i.indexOf(o); + if (l !== -1 && (t === document || t === /** @type {any} */ window)) { e.__root = t; return; @@ -1819,18 +1819,18 @@ function da(e) { var u = i.indexOf(t); if (u === -1) return; - o <= u && (a = o); + l <= u && (a = l); } if (s = /** @type {Element} */ i[a] || e.target, s !== t) { - wi(e, "currentTarget", { + bi(e, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = Y, h = J; - ht(null), It(null); + var f = B, h = j; + gt(null), It(null); try { for (var c, p = []; s !== null; ) { var m = s.assignedSlot || s.parentNode || /** @type {any} */ @@ -1856,12 +1856,12 @@ function da(e) { throw c; } } finally { - e.__root = t, delete e.currentTarget, ht(f), It(h); + e.__root = t, delete e.currentTarget, gt(f), It(h); } } } var Ha, Ya; -const es = (Ya = (Ha = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ha.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ya.createPolicy( +const Qi = (Ya = (Ha = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ha.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ya.createPolicy( "svelte-trusted-html", { /** @param {string} html */ @@ -1871,43 +1871,43 @@ const es = (Ya = (Ha = globalThis == null ? void 0 : globalThis.window) == null function Yu(e) { return ( /** @type {string} */ - (es == null ? void 0 : es.createHTML(e)) ?? e + (Qi == null ? void 0 : Qi.createHTML(e)) ?? e ); } -function Vl(e, t = !1) { - var n = Ds("template"); +function Ho(e, t = !1) { + var n = Ps("template"); return e = e.replaceAll("", ""), n.innerHTML = t ? Yu(e) : e, n.content; } -function wn(e, t) { +function yn(e, t) { var n = ( /** @type {Effect} */ - J + j ); n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ function qt(e, t) { - var n = (t & zo) !== 0, r = (t & Xo) !== 0, i, s = !e.startsWith(""); + var n = (t & zl) !== 0, r = (t & Bl) !== 0, i, s = !e.startsWith(""); return () => { - if (K) - return wn(z, null), z; - i === void 0 && (i = Vl(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ - /* @__PURE__ */ on(i))); + if (G) + return yn(X, null), X; + i === void 0 && (i = Ho(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ + /* @__PURE__ */ an(i))); var a = ( /** @type {TemplateNode} */ - r || yl ? document.importNode(i, !0) : i.cloneNode(!0) + r || wo ? document.importNode(i, !0) : i.cloneNode(!0) ); if (n) { - var l = ( + var o = ( /** @type {TemplateNode} */ - /* @__PURE__ */ on(a) - ), o = ( + /* @__PURE__ */ an(a) + ), l = ( /** @type {TemplateNode} */ a.lastChild ); - wn(l, o); + yn(o, l); } else - wn(a, a); + yn(a, a); return a; }; } @@ -1915,48 +1915,48 @@ function qt(e, t) { function zu(e, t, n = "svg") { var r = !e.startsWith(""), i = `<${n}>${r ? e : "" + e}`, s; return () => { - if (K) - return wn(z, null), z; + if (G) + return yn(X, null), X; if (!s) { var a = ( /** @type {DocumentFragment} */ - Vl(i, !0) - ), l = ( + Ho(i, !0) + ), o = ( /** @type {Element} */ - /* @__PURE__ */ on(a) + /* @__PURE__ */ an(a) ); s = /** @type {Element} */ - /* @__PURE__ */ on(l); + /* @__PURE__ */ an(o); } - var o = ( + var l = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return wn(o, o), o; + return yn(l, l), l; }; } // @__NO_SIDE_EFFECTS__ -function Xu(e, t) { +function Bu(e, t) { return /* @__PURE__ */ zu(e, t, "svg"); } function pa(e = "") { - if (!K) { - var t = nt(e + ""); - return wn(t, t), t; + if (!G) { + var t = it(e + ""); + return yn(t, t), t; } - var n = z; - return n.nodeType !== Kr ? (n.before(n = nt()), Fe(n)) : Hi( + var n = X; + return n.nodeType !== Ur ? (n.before(n = it()), He(n)) : zi( /** @type {Text} */ n - ), wn(n, n), n; + ), yn(n, n), n; } -function Xe(e, t) { - if (K) { +function Ke(e, t) { + if (G) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ - J + j ); - ((n.f & yr) === 0 || n.nodes.end === null) && (n.nodes.end = z), Fi(); + ((n.f & yr) === 0 || n.nodes.end === null) && (n.nodes.end = X), Li(); return; } e !== null && e.before( @@ -1964,63 +1964,63 @@ function Xe(e, t) { t ); } -const Bu = ["touchstart", "touchmove"]; +const Xu = ["touchstart", "touchmove"]; function Wu(e) { - return Bu.includes(e); + return Xu.includes(e); } -function vn(e, t) { +function pn(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 Hl(e, t) { - return Yl(e, t); +function Yo(e, t) { + return zo(e, t); } function Uu(e, t) { - gs(), t.intro = t.intro ?? !1; - const n = t.target, r = K, i = z; + vs(), t.intro = t.intro ?? !1; + const n = t.target, r = G, i = X; try { - for (var s = /* @__PURE__ */ on(n); s && (s.nodeType !== wr || /** @type {Comment} */ - s.data !== Ss); ) + for (var s = /* @__PURE__ */ an(n); s && (s.nodeType !== wr || /** @type {Comment} */ + s.data !== Cs); ) s = /* @__PURE__ */ Ot(s); if (!s) throw fr; - sn(!0), Fe( + nn(!0), He( /** @type {Comment} */ s ); - const a = Yl(e, { ...t, anchor: s }); - return sn(!1), /** @type {Exports} */ + const a = zo(e, { ...t, anchor: s }); + return nn(!1), /** @type {Exports} */ a; } catch (a) { if (a instanceof Error && a.message.split(` -`).some((l) => l.startsWith("https://svelte.dev/e/"))) +`).some((o) => o.startsWith("https://svelte.dev/e/"))) throw a; - return a !== fr && console.warn("Failed to hydrate: ", a), t.recover === !1 && ou(), gs(), bl(n), sn(!1), Hl(e, t); + return a !== fr && console.warn("Failed to hydrate: ", a), t.recover === !1 && lu(), vs(), $o(n), nn(!1), Yo(e, t); } finally { - sn(r), Fe(i); + nn(r), He(i); } } -const ei = /* @__PURE__ */ new Map(); -function Yl(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - gs(); - var l = /* @__PURE__ */ new Set(), o = (h) => { +const ni = /* @__PURE__ */ new Map(); +function zo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + vs(); + var o = /* @__PURE__ */ new Set(), l = (h) => { for (var c = 0; c < h.length; c++) { var p = h[c]; - if (!l.has(p)) { - l.add(p); + if (!o.has(p)) { + o.add(p); var m = Wu(p); for (const x of [t, document]) { - var $ = ei.get(x); - $ === void 0 && ($ = /* @__PURE__ */ new Map(), ei.set(x, $)); + var $ = ni.get(x); + $ === void 0 && ($ = /* @__PURE__ */ new Map(), ni.set(x, $)); var _ = $.get(p); _ === void 0 ? (x.addEventListener(p, da, { passive: m }), $.set(p, 1)) : $.set(p, _ + 1); } } } }; - o(Pi(ql)), _s.add(o); + l(Ii(Vo)), gs.add(l); var u = void 0, f = Iu(() => { - var h = n ?? t.appendChild(nt()); + var h = n ?? t.appendChild(it()); return bu( /** @type {TemplateNode} */ h, @@ -2029,44 +2029,44 @@ function Yl(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int } }, (c) => { - Oi({}); + qi({}); var p = ( /** @type {ComponentContext} */ - rt + st ); - if (s && (p.c = s), i && (r.$$events = i), K && wn( + if (s && (p.c = s), i && (r.$$events = i), G && yn( /** @type {TemplateNode} */ c, null - ), u = e(c, r) || {}, K && (J.nodes.end = z, z === null || z.nodeType !== wr || /** @type {Comment} */ - z.data !== Ns)) - throw Ii(), fr; - Li(); + ), u = e(c, r) || {}, G && (j.nodes.end = X, X === null || X.nodeType !== wr || /** @type {Comment} */ + X.data !== Ss)) + throw Oi(), fr; + Vi(); } ), () => { var $; - for (var c of l) + for (var c of o) for (const _ of [t, document]) { var p = ( /** @type {Map} */ - ei.get(_) + ni.get(_) ), m = ( /** @type {number} */ p.get(c) ); - --m == 0 ? (_.removeEventListener(c, da), p.delete(c), p.size === 0 && ei.delete(_)) : p.set(c, m); + --m == 0 ? (_.removeEventListener(c, da), p.delete(c), p.size === 0 && ni.delete(_)) : p.set(c, m); } - _s.delete(o), h !== n && (($ = h.parentNode) == null || $.removeChild(h)); + gs.delete(l), h !== n && (($ = h.parentNode) == null || $.removeChild(h)); }; }); - return ms.set(u, f), u; + return _s.set(u, f), u; } -let ms = /* @__PURE__ */ new WeakMap(); +let _s = /* @__PURE__ */ new WeakMap(); function Gu(e, t) { - const n = ms.get(e); - return n ? (ms.delete(e), n(t)) : Promise.resolve(); + const n = _s.get(e); + return n ? (_s.delete(e), n(t)) : Promise.resolve(); } -var gt, Mt, et, On, Ur, Gr, ki; +var xt, Mt, nt, qn, Xr, Wr, Pi; class Ku { /** * @param {TemplateNode} anchor @@ -2074,9 +2074,9 @@ class Ku { */ constructor(t, n = !0) { /** @type {TemplateNode} */ - pe(this, "anchor"); + he(this, "anchor"); /** @type {Map} */ - L(this, gt, /* @__PURE__ */ new Map()); + V(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 Ku { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - L(this, Mt, /* @__PURE__ */ new Map()); + V(this, Mt, /* @__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} */ - L(this, et, /* @__PURE__ */ new Map()); + V(this, nt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - L(this, On, /* @__PURE__ */ new Set()); + V(this, qn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - L(this, Ur, !0); - L(this, Gr, () => { + V(this, Xr, !0); + V(this, Wr, () => { var t = ( /** @type {Batch} */ - G + U ); - if (v(this, gt).has(t)) { + if (v(this, xt).has(t)) { var n = ( /** @type {Key} */ - v(this, gt).get(t) + v(this, xt).get(t) ), r = v(this, Mt).get(n); if (r) - Vs(r), v(this, On).delete(n); + qs(r), v(this, qn).delete(n); else { - var i = v(this, et).get(n); - i && (v(this, Mt).set(n, i.effect), v(this, et).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, nt).get(n); + i && (v(this, Mt).set(n, i.effect), v(this, nt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, gt)) { - if (v(this, gt).delete(s), s === t) + for (const [s, a] of v(this, xt)) { + if (v(this, xt).delete(s), s === t) break; - const l = v(this, et).get(a); - l && (Oe(l.effect), v(this, et).delete(a)); + const o = v(this, nt).get(a); + o && (Ye(o.effect), v(this, nt).delete(a)); } for (const [s, a] of v(this, Mt)) { - if (s === n || v(this, On).has(s)) continue; - const l = () => { - if (Array.from(v(this, gt).values()).includes(s)) { + if (s === n || v(this, qn).has(s)) continue; + const o = () => { + if (Array.from(v(this, xt).values()).includes(s)) { var u = document.createDocumentFragment(); - kl(a, u), u.append(nt()), v(this, et).set(s, { effect: a, fragment: u }); + Mo(a, u), u.append(it()), v(this, nt).set(s, { effect: a, fragment: u }); } else - Oe(a); - v(this, On).delete(s), v(this, Mt).delete(s); + Ye(a); + v(this, qn).delete(s), v(this, Mt).delete(s); }; - v(this, Ur) || !r ? (v(this, On).add(s), qn(a, l, !1)) : l(); + v(this, Xr) || !r ? (v(this, qn).add(s), Hn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - L(this, ki, (t) => { - v(this, gt).delete(t); - const n = Array.from(v(this, gt).values()); - for (const [r, i] of v(this, et)) - n.includes(r) || (Oe(i.effect), v(this, et).delete(r)); + V(this, Pi, (t) => { + v(this, xt).delete(t); + const n = Array.from(v(this, xt).values()); + for (const [r, i] of v(this, nt)) + n.includes(r) || (Ye(i.effect), v(this, nt).delete(r)); }); - this.anchor = t, F(this, Ur, n); + this.anchor = t, L(this, Xr, n); } /** * @@ -2163,34 +2163,34 @@ class Ku { ensure(t, n) { var r = ( /** @type {Batch} */ - G - ), i = $l(); - if (n && !v(this, Mt).has(t) && !v(this, et).has(t)) + U + ), i = Ao(); + if (n && !v(this, Mt).has(t) && !v(this, nt).has(t)) if (i) { - var s = document.createDocumentFragment(), a = nt(); - s.append(a), v(this, et).set(t, { - effect: ut(() => n(a)), + var s = document.createDocumentFragment(), a = it(); + s.append(a), v(this, nt).set(t, { + effect: dt(() => n(a)), fragment: s }); } else v(this, Mt).set( t, - ut(() => n(this.anchor)) + dt(() => n(this.anchor)) ); - if (v(this, gt).set(r, t), i) { - for (const [l, o] of v(this, Mt)) - l === t ? r.unskip_effect(o) : r.skip_effect(o); - for (const [l, o] of v(this, et)) - l === t ? r.unskip_effect(o.effect) : r.skip_effect(o.effect); - r.oncommit(v(this, Gr)), r.ondiscard(v(this, ki)); + if (v(this, xt).set(r, t), i) { + for (const [o, l] of v(this, Mt)) + o === t ? r.unskip_effect(l) : r.skip_effect(l); + for (const [o, l] of v(this, nt)) + o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); + r.oncommit(v(this, Wr)), r.ondiscard(v(this, Pi)); } else - K && (this.anchor = z), v(this, Gr).call(this); + G && (this.anchor = X), v(this, Wr).call(this); } } -gt = new WeakMap(), Mt = new WeakMap(), et = new WeakMap(), On = new WeakMap(), Ur = new WeakMap(), Gr = new WeakMap(), ki = new WeakMap(); +xt = new WeakMap(), Mt = new WeakMap(), nt = new WeakMap(), qn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Pi = new WeakMap(); function ju(e) { - rt === null && tu(), Fs(() => { - const t = Yi(e); + st === null && tu(), Is(() => { + const t = Bi(e); if (typeof t == "function") return ( /** @type {() => void} */ t @@ -2198,34 +2198,34 @@ function ju(e) { }); } function er(e, t, n = !1) { - K && Fi(); + G && Li(); var r = new Ku(e), i = n ? hr : 0; - function s(a, l) { - if (K) { + function s(a, o) { + if (G) { const f = Za(e); - var o; - if (f === Ss ? o = 0 : f === Mi ? o = !1 : o = parseInt(f.substring(1)), a !== o) { - var u = xi(); - Fe(u), r.anchor = u, sn(!1), r.ensure(a, l), sn(!0); + var l; + if (f === Cs ? l = 0 : f === Di ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = $i(); + He(u), r.anchor = u, nn(!1), r.ensure(a, o), nn(!0); return; } } - r.ensure(a, l); + r.ensure(a, o); } - Ls(() => { + Os(() => { var a = !1; - t((l, o = 0) => { - a = !0, s(o, l); + t((o, l = 0) => { + a = !0, s(l, o); }), a || s(!1, null); }, i); } -function fi(e, t) { +function hi(e, t) { return t; } function Ju(e, t, n) { - for (var r = [], i = t.length, s, a = t.length, l = 0; l < i; l++) { - let h = t[l]; - qn( + for (var r = [], i = t.length, s, a = t.length, o = 0; o < i; o++) { + let h = t[o]; + Hn( h, () => { if (s) { @@ -2234,7 +2234,7 @@ function Ju(e, t, n) { /** @type {Set} */ e.outrogroups ); - ys(Pi(s.done)), c.delete(s), c.size === 0 && (e.outrogroups = null); + ms(Ii(s.done)), c.delete(s), c.size === 0 && (e.outrogroups = null); } } else a -= 1; @@ -2243,8 +2243,8 @@ function Ju(e, t, n) { ); } if (a === 0) { - var o = r.length === 0 && n !== null; - if (o) { + var l = r.length === 0 && n !== null; + if (l) { var u = ( /** @type {Element} */ n @@ -2252,170 +2252,170 @@ function Ju(e, t, n) { /** @type {Element} */ u.parentNode ); - bl(f), f.append(u), e.items.clear(); + $o(f), f.append(u), e.items.clear(); } - ys(t, !o); + ms(t, !l); } else s = { pending: new Set(t), done: /* @__PURE__ */ new Set() }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function ys(e, t = !0) { +function ms(e, t = !0) { for (var n = 0; n < e.length; n++) - Oe(e[n], t); + Ye(e[n], t); } var va; -function ci(e, t, n, r, i, s = null) { - var a = e, l = /* @__PURE__ */ new Map(), o = (t & za) !== 0; - if (o) { +function di(e, t, n, r, i, s = null) { + var a = e, o = /* @__PURE__ */ new Map(), l = (t & za) !== 0; + if (l) { var u = ( /** @type {Element} */ e ); - a = K ? Fe(/* @__PURE__ */ on(u)) : u.appendChild(nt()); + a = G ? He(/* @__PURE__ */ an(u)) : u.appendChild(it()); } - K && Fi(); - var f = null, h = /* @__PURE__ */ dl(() => { + G && Li(); + var f = null, h = /* @__PURE__ */ po(() => { var x = n(); - return Ba(x) ? x : x == null ? [] : Pi(x); + return Xa(x) ? x : x == null ? [] : Ii(x); }), c, p = !0; function m() { - _.fallback = f, Zu(_, c, a, t, r), f !== null && (c.length === 0 ? (f.f & rn) === 0 ? Vs(f) : (f.f ^= rn, kr(f, null, a)) : qn(f, () => { + _.fallback = f, Zu(_, c, a, t, r), f !== null && (c.length === 0 ? (f.f & tn) === 0 ? qs(f) : (f.f ^= tn, Sr(f, null, a)) : Hn(f, () => { f = null; })); } - var $ = Ls(() => { + var $ = Os(() => { c = /** @type {V[]} */ b(h); var x = c.length; - let D = !1; - if (K) { - var C = Za(a) === Mi; - C !== (x === 0) && (a = xi(), Fe(a), sn(!1), D = !0); + let F = !1; + if (G) { + var S = Za(a) === Di; + S !== (x === 0) && (a = $i(), He(a), nn(!1), F = !0); } - for (var S = /* @__PURE__ */ new Set(), M = ( + for (var M = /* @__PURE__ */ new Set(), D = ( /** @type {Batch} */ - G - ), B = $l(), j = 0; j < x; j += 1) { - K && z.nodeType === wr && /** @type {Comment} */ - z.data === Ns && (a = /** @type {Comment} */ - z, D = !0, sn(!1)); - var Q = c[j], ce = r(Q, j), X = p ? null : l.get(ce); - X ? (X.v && vr(X.v, Q), X.i && vr(X.i, j), B && M.unskip_effect(X.e)) : (X = Qu( - l, - p ? a : va ?? (va = nt()), + U + ), W = Ao(), K = 0; K < x; K += 1) { + G && X.nodeType === wr && /** @type {Comment} */ + X.data === Ss && (a = /** @type {Comment} */ + X, F = !0, nn(!1)); + var Q = c[K], ee = r(Q, K), J = p ? null : o.get(ee); + J ? (J.v && vr(J.v, Q), J.i && vr(J.i, K), W && D.unskip_effect(J.e)) : (J = Qu( + o, + p ? a : va ?? (va = it()), Q, - ce, - j, + ee, + K, i, t, n - ), p || (X.e.f |= rn), l.set(ce, X)), S.add(ce); + ), p || (J.e.f |= tn), o.set(ee, J)), M.add(ee); } - if (x === 0 && s && !f && (p ? f = ut(() => s(a)) : (f = ut(() => s(va ?? (va = nt()))), f.f |= rn)), x > S.size && ru(), K && x > 0 && Fe(xi()), !p) - if (B) { - for (const [ae, le] of l) - S.has(ae) || M.skip_effect(le.e); - M.oncommit(m), M.ondiscard(() => { + if (x === 0 && s && !f && (p ? f = dt(() => s(a)) : (f = dt(() => s(va ?? (va = it()))), f.f |= tn)), x > M.size && ru(), G && x > 0 && He($i()), !p) + if (W) { + for (const [ae, oe] of o) + M.has(ae) || D.skip_effect(oe.e); + D.oncommit(m), D.ondiscard(() => { }); } else m(); - D && sn(!0), b(h); - }), _ = { effect: $, items: l, outrogroups: null, fallback: f }; - p = !1, K && (a = z); + F && nn(!0), b(h); + }), _ = { effect: $, items: o, outrogroups: null, fallback: f }; + p = !1, G && (a = X); } -function Sr(e) { - for (; e !== null && (e.f & xt) === 0; ) +function Rr(e) { + for (; e !== null && (e.f & Tt) === 0; ) e = e.next; return e; } function Zu(e, t, n, r, i) { - var X, ae, le, T, q, Le, st, de, Ee; - var s = (r & Oo) !== 0, a = t.length, l = e.items, o = Sr(e.effect.first), u, f = null, h, c = [], p = [], m, $, _, x; + var J, ae, oe, N, H, Ie, Me, xe, ce; + var s = (r & Ol) !== 0, a = t.length, o = e.items, l = Rr(e.effect.first), u, f = null, h, c = [], p = [], m, $, _, x; if (s) for (x = 0; x < a; x += 1) m = t[x], $ = i(m, x), _ = /** @type {EachItem} */ - l.get($).e, (_.f & rn) === 0 && ((ae = (X = _.nodes) == null ? void 0 : X.a) == null || ae.measure(), (h ?? (h = /* @__PURE__ */ new Set())).add(_)); + o.get($).e, (_.f & tn) === 0 && ((ae = (J = _.nodes) == null ? void 0 : J.a) == null || ae.measure(), (h ?? (h = /* @__PURE__ */ new Set())).add(_)); for (x = 0; x < a; x += 1) { if (m = t[x], $ = i(m, x), _ = /** @type {EachItem} */ - l.get($).e, e.outrogroups !== null) - for (const ee of e.outrogroups) - ee.pending.delete(_), ee.done.delete(_); - if ((_.f & rn) !== 0) - if (_.f ^= rn, _ === o) - kr(_, null, n); + o.get($).e, e.outrogroups !== null) + for (const le of e.outrogroups) + le.pending.delete(_), le.done.delete(_); + if ((_.f & tn) !== 0) + if (_.f ^= tn, _ === l) + Sr(_, null, n); else { - var D = f ? f.next : o; - _ === e.effect.last && (e.effect.last = _.prev), _.prev && (_.prev.next = _.next), _.next && (_.next.prev = _.prev), dn(e, f, _), dn(e, _, D), kr(_, D, n), f = _, c = [], p = [], o = Sr(f.next); + var F = f ? f.next : l; + _ === e.effect.last && (e.effect.last = _.prev), _.prev && (_.prev.next = _.next), _.next && (_.next.prev = _.prev), hn(e, f, _), hn(e, _, F), Sr(_, F, n), f = _, c = [], p = [], l = Rr(f.next); continue; } - if ((_.f & tt) !== 0 && (Vs(_), s && ((T = (le = _.nodes) == null ? void 0 : le.a) == null || T.unfix(), (h ?? (h = /* @__PURE__ */ new Set())).delete(_))), _ !== o) { + if ((_.f & rt) !== 0 && (qs(_), s && ((N = (oe = _.nodes) == null ? void 0 : oe.a) == null || N.unfix(), (h ?? (h = /* @__PURE__ */ new Set())).delete(_))), _ !== l) { if (u !== void 0 && u.has(_)) { if (c.length < p.length) { - var C = p[0], S; - f = C.prev; - var M = c[0], B = c[c.length - 1]; - for (S = 0; S < c.length; S += 1) - kr(c[S], C, n); - for (S = 0; S < p.length; S += 1) - u.delete(p[S]); - dn(e, M.prev, B.next), dn(e, f, M), dn(e, B, C), o = C, f = B, x -= 1, c = [], p = []; + var S = p[0], M; + f = S.prev; + var D = c[0], W = c[c.length - 1]; + for (M = 0; M < c.length; M += 1) + Sr(c[M], S, n); + for (M = 0; M < p.length; M += 1) + u.delete(p[M]); + hn(e, D.prev, W.next), hn(e, f, D), hn(e, W, S), l = S, f = W, x -= 1, c = [], p = []; } else - u.delete(_), kr(_, o, n), dn(e, _.prev, _.next), dn(e, _, f === null ? e.effect.first : f.next), dn(e, f, _), f = _; + u.delete(_), Sr(_, l, n), hn(e, _.prev, _.next), hn(e, _, f === null ? e.effect.first : f.next), hn(e, f, _), f = _; continue; } - for (c = [], p = []; o !== null && o !== _; ) - (u ?? (u = /* @__PURE__ */ new Set())).add(o), p.push(o), o = Sr(o.next); - if (o === null) + for (c = [], p = []; l !== null && l !== _; ) + (u ?? (u = /* @__PURE__ */ new Set())).add(l), p.push(l), l = Rr(l.next); + if (l === null) continue; } - (_.f & rn) === 0 && c.push(_), f = _, o = Sr(_.next); + (_.f & tn) === 0 && c.push(_), f = _, l = Rr(_.next); } if (e.outrogroups !== null) { - for (const ee of e.outrogroups) - ee.pending.size === 0 && (ys(Pi(ee.done)), (q = e.outrogroups) == null || q.delete(ee)); + for (const le of e.outrogroups) + le.pending.size === 0 && (ms(Ii(le.done)), (H = e.outrogroups) == null || H.delete(le)); e.outrogroups.size === 0 && (e.outrogroups = null); } - if (o !== null || u !== void 0) { - var j = []; + if (l !== null || u !== void 0) { + var K = []; if (u !== void 0) for (_ of u) - (_.f & tt) === 0 && j.push(_); - for (; o !== null; ) - (o.f & tt) === 0 && o !== e.fallback && j.push(o), o = Sr(o.next); - var Q = j.length; + (_.f & rt) === 0 && K.push(_); + for (; l !== null; ) + (l.f & rt) === 0 && l !== e.fallback && K.push(l), l = Rr(l.next); + var Q = K.length; if (Q > 0) { - var ce = (r & za) !== 0 && a === 0 ? n : null; + var ee = (r & za) !== 0 && a === 0 ? n : null; if (s) { for (x = 0; x < Q; x += 1) - (st = (Le = j[x].nodes) == null ? void 0 : Le.a) == null || st.measure(); + (Me = (Ie = K[x].nodes) == null ? void 0 : Ie.a) == null || Me.measure(); for (x = 0; x < Q; x += 1) - (Ee = (de = j[x].nodes) == null ? void 0 : de.a) == null || Ee.fix(); + (ce = (xe = K[x].nodes) == null ? void 0 : xe.a) == null || ce.fix(); } - Ju(e, j, ce); + Ju(e, K, ee); } } - s && mn(() => { - var ee, Pe; + s && _n(() => { + var le, z; if (h !== void 0) for (_ of h) - (Pe = (ee = _.nodes) == null ? void 0 : ee.a) == null || Pe.apply(); + (z = (le = _.nodes) == null ? void 0 : le.a) == null || z.apply(); }); } -function Qu(e, t, n, r, i, s, a, l) { - var o = (a & Io) !== 0 ? (a & Lo) === 0 ? /* @__PURE__ */ _l(n, !1, !1) : zn(n) : null, u = (a & Fo) !== 0 ? zn(i) : null; +function Qu(e, t, n, r, i, s, a, o) { + var l = (a & Il) !== 0 ? (a & Ll) === 0 ? /* @__PURE__ */ mo(n, !1, !1) : Xn(n) : null, u = (a & Fl) !== 0 ? Xn(i) : null; return { - v: o, + v: l, i: u, - e: ut(() => (s(t, o ?? n, u ?? i, l), () => { + e: dt(() => (s(t, l ?? n, u ?? i, o), () => { e.delete(r); })) }; } -function kr(e, t, n) { +function Sr(e, t, n) { if (e.nodes) - for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & rn) === 0 ? ( + for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & tn) === 0 ? ( /** @type {EffectNodes} */ t.nodes.start ) : n; r !== null; ) { @@ -2428,11 +2428,11 @@ function kr(e, t, n) { r = a; } } -function dn(e, t, n) { +function hn(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) { - Tl(() => { +function Vs(e, t) { + Ro(() => { var n = e.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -2445,7 +2445,7 @@ function Hs(e, t) { ) ); if (!r.querySelector("#" + t.hash)) { - const i = Ds("style"); + const i = Ps("style"); i.id = t.hash, i.textContent = t.code, r.appendChild(i); } }); @@ -2460,8 +2460,8 @@ function ef(e, t, n) { r = r ? r + " " + i : i; else if (r.length) for (var s = i.length, a = 0; (a = r.indexOf(i, a)) >= 0; ) { - var l = a + s; - (a === 0 || ga.includes(r[a - 1])) && (l === r.length || ga.includes(r[l])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(l + 1) : a = l; + var o = a + s; + (a === 0 || ga.includes(r[a - 1])) && (o === r.length || ga.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; } } return r === "" ? null : r; @@ -2481,19 +2481,19 @@ function tf(e, t) { } return String(e); } -function ti(e, t, n, r, i, s) { +function ri(e, t, n, r, i, s) { var a = e.__className; - if (K || a !== n || a === void 0) { - var l = ef(n, r, s); - (!K || l !== e.getAttribute("class")) && (l == null ? e.removeAttribute("class") : e.className = l), e.__className = n; + if (G || a !== n || a === void 0) { + var o = ef(n, r, s); + (!G || o !== e.getAttribute("class")) && (o == null ? e.removeAttribute("class") : e.className = o), e.__className = n; } else if (s && i !== s) - for (var o in s) { - var u = !!s[o]; - (i == null || u !== !!i[o]) && e.classList.toggle(o, u); + for (var l in s) { + var u = !!s[l]; + (i == null || u !== !!i[l]) && e.classList.toggle(l, u); } return s; } -function ts(e, t = {}, n, r) { +function es(e, t = {}, n, r) { for (var i in n) { var s = n[i]; t[i] !== s && (n[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, s, r)); @@ -2501,16 +2501,16 @@ function ts(e, t = {}, n, r) { } function ma(e, t, n, r) { var i = e.__style; - if (K || i !== t) { + if (G || i !== t) { var s = tf(t, r); - (!K || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t; - } else r && (Array.isArray(r) ? (ts(e, n == null ? void 0 : n[0], r[0]), ts(e, n == null ? void 0 : n[1], r[1], "important")) : ts(e, n, r)); + (!G || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t; + } else r && (Array.isArray(r) ? (es(e, n == null ? void 0 : n[0], r[0]), es(e, n == null ? void 0 : n[1], r[1], "important")) : es(e, n, r)); return r; } const nf = Symbol("is custom element"), rf = Symbol("is html"), sf = eu ? "link" : "LINK"; function ya(e, t, n, r) { var i = af(e); - K && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === sf) || i[t] !== (i[t] = n) && (t === "loading" && (e[Qo] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && lf(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); + G && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === sf) || i[t] !== (i[t] = n) && (t === "loading" && (e[Ql] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && of(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); } function af(e) { return ( @@ -2518,17 +2518,17 @@ function af(e) { // @ts-expect-error e.__attributes ?? (e.__attributes = { [nf]: e.nodeName.includes("-"), - [rf]: e.namespaceURI === Xa + [rf]: e.namespaceURI === Ba }) ); } var wa = /* @__PURE__ */ new Map(); -function lf(e) { +function of(e) { var t = e.getAttribute("is") || e.nodeName, n = wa.get(t); if (n) return n; wa.set(t, n = []); for (var r, i = e, s = Element.prototype; s !== i; ) { - r = Wo(i); + r = Wl(i); for (var a in r) r[a].set && n.push(a); i = Wa(i); @@ -2536,37 +2536,37 @@ function lf(e) { return n; } function xa(e, t) { - return e === t || (e == null ? void 0 : e[Ir]) === t; + return e === t || (e == null ? void 0 : e[Pr]) === t; } -function hi(e = {}, t, n, r) { - return Tl(() => { +function pi(e = {}, t, n, r) { + return Ro(() => { var i, s; - return Os(() => { - i = s, s = [], Yi(() => { + return Fs(() => { + i = s, s = [], Bi(() => { e !== n(...s) && (t(e, ...s), i && xa(n(...i), e) && t(null, ...i)); }); }), () => { - mn(() => { + _n(() => { s && xa(n(...s), e) && t(null, ...s); }); }; }), e; } -let ni = !1; -function of(e) { - var t = ni; +let ii = !1; +function lf(e) { + var t = ii; try { - return ni = !1, [e(), ni]; + return ii = !1, [e(), ii]; } finally { - ni = t; + ii = t; } } function fe(e, t, n, r) { - var D; - var i = (n & Ho) !== 0, s = (n & Yo) !== 0, a = ( + var F; + var i = (n & Hl) !== 0, s = (n & Yl) !== 0, a = ( /** @type {V} */ r - ), l = !0, o = () => (l && (l = !1, a = s ? Yi( + ), o = !0, l = () => (o && (o = !1, a = s ? Bi( /** @type {() => V} */ r ) : ( @@ -2574,54 +2574,54 @@ function fe(e, t, n, r) { r )), a), u; if (i) { - var f = Ir in e || Ja in e; - u = ((D = Ln(e, t)) == null ? void 0 : D.set) ?? (f && t in e ? (C) => e[t] = C : void 0); + var f = Pr in e || Ja in e; + u = ((F = Vn(e, t)) == null ? void 0 : F.set) ?? (f && t in e ? (S) => e[t] = S : void 0); } var h, c = !1; - i ? [h, c] = of(() => ( + i ? [h, c] = lf(() => ( /** @type {V} */ e[t] )) : h = /** @type {V} */ - e[t], h === void 0 && r !== void 0 && (h = o(), u && (uu(), u(h))); + e[t], h === void 0 && r !== void 0 && (h = l(), u && (uu(), u(h))); var p; if (p = () => { - var C = ( + var S = ( /** @type {V} */ e[t] ); - return C === void 0 ? o() : (l = !0, C); - }, (n & Vo) === 0) + return S === void 0 ? l() : (o = !0, S); + }, (n & Vl) === 0) return p; if (u) { var m = e.$$legacy; return ( /** @type {() => V} */ - (function(C, S) { - return arguments.length > 0 ? ((!S || m || c) && u(S ? p() : C), C) : p(); + (function(S, M) { + return arguments.length > 0 ? ((!M || m || c) && u(M ? p() : S), S) : p(); }) ); } - var $ = !1, _ = ((n & qo) !== 0 ? Vi : dl)(() => ($ = !1, p())); + var $ = !1, _ = ((n & ql) !== 0 ? Yi : po)(() => ($ = !1, p())); i && b(_); var x = ( /** @type {Effect} */ - J + j ); return ( /** @type {() => V} */ - (function(C, S) { + (function(S, M) { if (arguments.length > 0) { - const M = S ? b(_) : i ? Sn(C) : C; - return ve(_, M), $ = !0, a !== void 0 && (a = M), C; + const D = M ? b(_) : i ? kn(S) : S; + return de(_, D), $ = !0, a !== void 0 && (a = D), S; } - return xn && $ || (x.f & an) !== 0 ? _.v : b(_); + return wn && $ || (x.f & rn) !== 0 ? _.v : b(_); }) ); } function uf(e) { return new ff(e); } -var nn, ot; +var en, ht; class ff { /** * @param {ComponentConstructorOptions & { @@ -2630,57 +2630,57 @@ class ff { */ constructor(t) { /** @type {any} */ - L(this, nn); + V(this, en); /** @type {Record} */ - L(this, ot); + V(this, ht); var s; - var n = /* @__PURE__ */ new Map(), r = (a, l) => { - var o = /* @__PURE__ */ _l(l, !1, !1); - return n.set(a, o), o; + var n = /* @__PURE__ */ new Map(), r = (a, o) => { + var l = /* @__PURE__ */ mo(o, !1, !1); + return n.set(a, l), l; }; const i = new Proxy( { ...t.props || {}, $$events: {} }, { - get(a, l) { - return b(n.get(l) ?? r(l, Reflect.get(a, l))); + get(a, o) { + return b(n.get(o) ?? r(o, Reflect.get(a, o))); }, - has(a, l) { - return l === Ja ? !0 : (b(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); + has(a, o) { + return o === Ja ? !0 : (b(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, - set(a, l, o) { - return ve(n.get(l) ?? r(l, o), o), Reflect.set(a, l, o); + set(a, o, l) { + return de(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - F(this, ot, (t.hydrate ? Uu : Hl)(t.component, { + L(this, ht, (t.hydrate ? Uu : Yo)(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) && se(), F(this, nn, i.$$events); - for (const a of Object.keys(v(this, ot))) - a === "$set" || a === "$destroy" || a === "$on" || wi(this, a, { + })), (!((s = t == null ? void 0 : t.props) != null && s.$$host) || t.sync === !1) && se(), L(this, en, i.$$events); + for (const a of Object.keys(v(this, ht))) + a === "$set" || a === "$destroy" || a === "$on" || bi(this, a, { get() { - return v(this, ot)[a]; + return v(this, ht)[a]; }, /** @param {any} value */ - set(l) { - v(this, ot)[a] = l; + set(o) { + v(this, ht)[a] = o; }, enumerable: !0 }); - v(this, ot).$set = /** @param {Record} next */ + v(this, ht).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, ot).$destroy = () => { - Gu(v(this, ot)); + }, v(this, ht).$destroy = () => { + Gu(v(this, ht)); }; } /** @param {Record} props */ $set(t) { - v(this, ot).$set(t); + v(this, ht).$set(t); } /** * @param {string} event @@ -2688,22 +2688,22 @@ class ff { * @returns {any} */ $on(t, n) { - v(this, nn)[t] = v(this, nn)[t] || []; + v(this, en)[t] = v(this, en)[t] || []; const r = (...i) => n.call(this, ...i); - return v(this, nn)[t].push(r), () => { - v(this, nn)[t] = v(this, nn)[t].filter( + return v(this, en)[t].push(r), () => { + v(this, en)[t] = v(this, en)[t].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, ot).$destroy(); + v(this, ht).$destroy(); } } -nn = new WeakMap(), ot = new WeakMap(); -let zl; -typeof HTMLElement == "function" && (zl = class extends HTMLElement { +en = new WeakMap(), ht = new WeakMap(); +let Bo; +typeof HTMLElement == "function" && (Bo = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -2712,27 +2712,27 @@ typeof HTMLElement == "function" && (zl = class extends HTMLElement { constructor(t, n, r) { super(); /** The Svelte component constructor */ - pe(this, "$$ctor"); + he(this, "$$ctor"); /** Slots */ - pe(this, "$$s"); + he(this, "$$s"); /** @type {any} The Svelte component instance */ - pe(this, "$$c"); + he(this, "$$c"); /** Whether or not the custom element is connected */ - pe(this, "$$cn", !1); + he(this, "$$cn", !1); /** @type {Record} Component props data */ - pe(this, "$$d", {}); + he(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - pe(this, "$$r", !1); + he(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - pe(this, "$$p_d", {}); + he(this, "$$p_d", {}); /** @type {Record} Event listeners */ - pe(this, "$$l", {}); + he(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - pe(this, "$$l_u", /* @__PURE__ */ new Map()); + he(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - pe(this, "$$me"); + he(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - pe(this, "$$shadowRoot", null); + he(this, "$$shadowRoot", null); this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** @@ -2762,8 +2762,8 @@ typeof HTMLElement == "function" && (zl = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const l = Ds("slot"); - s !== "default" && (l.name = s), Xe(a, l); + const o = Ps("slot"); + s !== "default" && (o.name = s), Ke(a, o); }; }; var t = n; @@ -2774,7 +2774,7 @@ typeof HTMLElement == "function" && (zl = class extends HTMLElement { 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] = di(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]); @@ -2787,27 +2787,27 @@ typeof HTMLElement == "function" && (zl = class extends HTMLElement { $$host: this } }), this.$$me = Du(() => { - Os(() => { + Fs(() => { var s; this.$$r = !0; - for (const a of yi(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 l = di( + const o = vi( a, this.$$d[a], this.$$p_d, "toAttribute" ); - l == null ? this.removeAttribute(this.$$p_d[a].attribute || a) : this.setAttribute(this.$$p_d[a].attribute || a, l); + o == null ? this.removeAttribute(this.$$p_d[a].attribute || a) : this.setAttribute(this.$$p_d[a].attribute || a, o); } this.$$r = !1; }); }); for (const s in this.$$l) for (const a of this.$$l[s]) { - const l = this.$$c.$on(s, a); - this.$$l_u.set(a, l); + const o = this.$$c.$on(s, a); + this.$$l_u.set(a, o); } this.$$l = {}; } @@ -2821,7 +2821,7 @@ typeof HTMLElement == "function" && (zl = class extends HTMLElement { */ attributeChangedCallback(t, n, r) { var i; - this.$$r || (t = this.$$g_p(t), this.$$d[t] = di(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" && (zl = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(t) { - return yi(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 di(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]) @@ -2877,37 +2877,37 @@ function cf(e) { ] = !0; }), t; } -function Ys(e, t, n, r, i, s) { - let a = class extends zl { +function Hs(e, t, n, r, i, s) { + let a = class extends Bo { constructor() { super(e, n, i), this.$$p_d = t; } static get observedAttributes() { - return yi(t).map( - (l) => (t[l].attribute || l).toLowerCase() + return xi(t).map( + (o) => (t[o].attribute || o).toLowerCase() ); } }; - return yi(t).forEach((l) => { - wi(a.prototype, l, { + return xi(t).forEach((o) => { + bi(a.prototype, o, { get() { - return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l]; + return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, - set(o) { + set(l) { var h; - o = di(l, o, t), this.$$d[l] = o; + l = vi(o, l, t), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (h = Ln(u, l)) == null ? void 0 : h.get; - f ? u[l] = o : u.$set({ [l]: o }); + var f = (h = Vn(u, o)) == null ? void 0 : h.get; + f ? u[o] = l : u.$set({ [o]: l }); } } }); - }), r.forEach((l) => { - wi(a.prototype, l, { + }), r.forEach((o) => { + bi(a.prototype, o, { get() { - var o; - return (o = this.$$c) == null ? void 0 : o[l]; + var l; + return (l = this.$$c) == null ? void 0 : l[o]; } }); }), e.element = /** @type {any} */ @@ -2915,14 +2915,14 @@ function Ys(e, t, n, r, i, s) { } var hf = { value: () => { } }; -function Xl() { +function Xo() { 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 pi(n); + return new gi(n); } -function pi(e) { +function gi(e) { this._ = e; } function df(e, t) { @@ -2932,8 +2932,8 @@ function df(e, t) { return { type: n, name: r }; }); } -pi.prototype = Xl.prototype = { - constructor: pi, +gi.prototype = Xo.prototype = { + constructor: gi, on: function(e, t) { var n = this._, r = df(e + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { @@ -2949,7 +2949,7 @@ pi.prototype = Xl.prototype = { copy: function() { var e = {}, t = this._; for (var n in t) e[n] = t[n].slice(); - return new pi(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]; @@ -2974,22 +2974,22 @@ function ba(e, t, n) { } return n != null && e.push({ name: t, value: n }), e; } -var ws = "http://www.w3.org/1999/xhtml"; +var ys = "http://www.w3.org/1999/xhtml"; const $a = { svg: "http://www.w3.org/2000/svg", - xhtml: ws, + xhtml: ys, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function zi(e) { +function Xi(e) { var t = e += "", n = t.indexOf(":"); return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), $a.hasOwnProperty(t) ? { space: $a[t], local: e } : e; } function vf(e) { return function() { var t = this.ownerDocument, n = this.namespaceURI; - return n === ws && t.documentElement.namespaceURI === ws ? t.createElement(e) : t.createElementNS(n, e); + return n === ys && t.documentElement.namespaceURI === ys ? t.createElement(e) : t.createElementNS(n, e); }; } function gf(e) { @@ -2997,23 +2997,23 @@ function gf(e) { return this.ownerDocument.createElementNS(e.space, e.local); }; } -function Bl(e) { - var t = zi(e); +function Wo(e) { + var t = Xi(e); return (t.local ? gf : vf)(t); } function _f() { } -function zs(e) { +function Ys(e) { return e == null ? _f : function() { return this.querySelector(e); }; } function mf(e) { - typeof e != "function" && (e = zs(e)); + typeof e != "function" && (e = Ys(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, l = r[i] = new Array(a), o, u, f = 0; f < a; ++f) - (o = s[f]) && (u = e.call(o, o.__data__, f, s)) && ("__data__" in o && (u.__data__ = o.__data__), l[f] = u); - return new it(r, this._parents); + 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 at(r, this._parents); } function yf(e) { return e == null ? [] : Array.isArray(e) ? e : Array.from(e); @@ -3021,7 +3021,7 @@ function yf(e) { function wf() { return []; } -function Wl(e) { +function Uo(e) { return e == null ? wf : function() { return this.querySelectorAll(e); }; @@ -3032,18 +3032,18 @@ function xf(e) { }; } function bf(e) { - typeof e == "function" ? e = xf(e) : e = Wl(e); + typeof e == "function" ? e = xf(e) : e = Uo(e); for (var t = this._groups, n = t.length, r = [], i = [], s = 0; s < n; ++s) - for (var a = t[s], l = a.length, o, u = 0; u < l; ++u) - (o = a[u]) && (r.push(e.call(o, o.__data__, u, a)), i.push(o)); - return new it(r, i); + 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 at(r, i); } -function Ul(e) { +function Go(e) { return function() { return this.matches(e); }; } -function Gl(e) { +function Ko(e) { return function(t) { return t.matches(e); }; @@ -3058,7 +3058,7 @@ function Ef() { return this.firstElementChild; } function Tf(e) { - return this.select(e == null ? Ef : Af(typeof e == "function" ? e : Gl(e))); + return this.select(e == null ? Ef : Af(typeof e == "function" ? e : Ko(e))); } var Rf = Array.prototype.filter; function Cf() { @@ -3070,26 +3070,26 @@ function Sf(e) { }; } function Nf(e) { - return this.selectAll(e == null ? Cf : Sf(typeof e == "function" ? e : Gl(e))); + return this.selectAll(e == null ? Cf : Sf(typeof e == "function" ? e : Ko(e))); } function kf(e) { - typeof e != "function" && (e = Ul(e)); + typeof e != "function" && (e = Go(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, l = r[i] = [], o, u = 0; u < a; ++u) - (o = s[u]) && e.call(o, o.__data__, u, s) && l.push(o); - return new it(r, this._parents); + 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 at(r, this._parents); } -function Kl(e) { +function jo(e) { return new Array(e.length); } function Mf() { - return new it(this._enter || this._groups.map(Kl), this._parents); + return new at(this._enter || this._groups.map(jo), this._parents); } -function bi(e, t) { +function Ai(e, t) { this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; } -bi.prototype = { - constructor: bi, +Ai.prototype = { + constructor: Ai, appendChild: function(e) { return this._parent.insertBefore(e, this._next); }, @@ -3109,19 +3109,19 @@ function Pf(e) { }; } function Df(e, t, n, r, i, s) { - for (var a = 0, l, o = t.length, u = s.length; a < u; ++a) - (l = t[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new bi(e, s[a]); - for (; a < o; ++a) - (l = t[a]) && (i[a] = l); + 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 Ai(e, s[a]); + for (; a < l; ++a) + (o = t[a]) && (i[a] = o); } function If(e, t, n, r, i, s, a) { - var l, o, u = /* @__PURE__ */ new Map(), f = t.length, h = s.length, c = new Array(f), p; - for (l = 0; l < f; ++l) - (o = t[l]) && (c[l] = p = a.call(o, o.__data__, l, t) + "", u.has(p) ? i[l] = o : u.set(p, o)); - for (l = 0; l < h; ++l) - p = a.call(e, s[l], l, s) + "", (o = u.get(p)) ? (r[l] = o, o.__data__ = s[l], u.delete(p)) : n[l] = new bi(e, s[l]); - for (l = 0; l < f; ++l) - (o = t[l]) && u.get(c[l]) === o && (i[l] = o); + var o, l, u = /* @__PURE__ */ new Map(), f = t.length, h = s.length, c = new Array(f), p; + for (o = 0; o < f; ++o) + (l = t[o]) && (c[o] = p = a.call(l, l.__data__, o, t) + "", u.has(p) ? i[o] = l : u.set(p, l)); + for (o = 0; o < h; ++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(c[o]) === l && (i[o] = l); } function Ff(e) { return e.__data__; @@ -3130,34 +3130,34 @@ function Of(e, t) { if (!arguments.length) return Array.from(this, Ff); var n = t ? If : Df, r = this._parents, i = this._groups; typeof e != "function" && (e = Pf(e)); - for (var s = i.length, a = new Array(s), l = new Array(s), o = new Array(s), u = 0; u < s; ++u) { - var f = r[u], h = i[u], c = h.length, p = Lf(e.call(f, f && f.__data__, u, r)), m = p.length, $ = l[u] = new Array(m), _ = a[u] = new Array(m), x = o[u] = new Array(c); + 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], h = i[u], c = h.length, p = Lf(e.call(f, f && f.__data__, u, r)), m = p.length, $ = o[u] = new Array(m), _ = a[u] = new Array(m), x = l[u] = new Array(c); n(f, h, $, _, x, p, t); - for (var D = 0, C = 0, S, M; D < m; ++D) - if (S = $[D]) { - for (D >= C && (C = D + 1); !(M = _[C]) && ++C < m; ) ; - S._next = M || null; + for (var F = 0, S = 0, M, D; F < m; ++F) + if (M = $[F]) { + for (F >= S && (S = F + 1); !(D = _[S]) && ++S < m; ) ; + M._next = D || null; } } - return a = new it(a, r), a._enter = l, a._exit = o, a; + return a = new at(a, r), a._enter = o, a._exit = l, a; } function Lf(e) { return typeof e == "object" && "length" in e ? e : Array.from(e); } function qf() { - return new it(this._exit || this._groups.map(Kl), this._parents); + return new at(this._exit || this._groups.map(jo), this._parents); } function Vf(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 Hf(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), l = new Array(i), o = 0; o < a; ++o) - for (var u = n[o], f = r[o], h = u.length, c = l[o] = new Array(h), p, m = 0; m < h; ++m) + 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], h = u.length, c = o[l] = new Array(h), p, m = 0; m < h; ++m) (p = u[m] || f[m]) && (c[m] = p); - for (; o < i; ++o) - l[o] = n[o]; - return new it(l, this._parents); + for (; l < i; ++l) + o[l] = n[l]; + return new at(o, this._parents); } function Yf() { for (var e = this._groups, t = -1, n = e.length; ++t < n; ) @@ -3166,21 +3166,21 @@ function Yf() { return this; } function zf(e) { - e || (e = Xf); + e || (e = Bf); function t(h, c) { return h && c ? e(h.__data__, c.__data__) : !h - !c; } for (var n = this._groups, r = n.length, i = new Array(r), s = 0; s < r; ++s) { - for (var a = n[s], l = a.length, o = i[s] = new Array(l), u, f = 0; f < l; ++f) - (u = a[f]) && (o[f] = u); - o.sort(t); + 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 it(i, this._parents).order(); + return new at(i, this._parents).order(); } -function Xf(e, t) { +function Bf(e, t) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function Bf() { +function Xf() { var e = arguments[0]; return arguments[0] = this, e.apply(null, arguments), this; } @@ -3205,8 +3205,8 @@ function Kf() { } function jf(e) { for (var t = this._groups, n = 0, r = t.length; n < r; ++n) - for (var i = t[n], s = 0, a = i.length, l; s < a; ++s) - (l = i[s]) && e.call(l, l.__data__, s, i); + 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 Jf(e) { @@ -3242,14 +3242,14 @@ function nc(e, t) { }; } function rc(e, t) { - var n = zi(e); + 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 ? Zf : Jf : typeof t == "function" ? n.local ? nc : tc : n.local ? ec : Qf)(n, t)); } -function jl(e) { +function Jo(e) { return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; } function ic(e) { @@ -3268,13 +3268,13 @@ function ac(e, t, n) { r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); }; } -function lc(e, t, n) { +function oc(e, t, n) { return arguments.length > 1 ? this.each((t == null ? ic : typeof t == "function" ? ac : sc)(e, t, n ?? "")) : _r(this.node(), e); } function _r(e, t) { - return e.style.getPropertyValue(t) || jl(e).getComputedStyle(e, null).getPropertyValue(t); + return e.style.getPropertyValue(t) || Jo(e).getComputedStyle(e, null).getPropertyValue(t); } -function oc(e) { +function lc(e) { return function() { delete this[e]; }; @@ -3291,18 +3291,18 @@ function fc(e, t) { }; } function cc(e, t) { - return arguments.length > 1 ? this.each((t == null ? oc : typeof t == "function" ? fc : uc)(e, t)) : this.node()[e]; + return arguments.length > 1 ? this.each((t == null ? lc : typeof t == "function" ? fc : uc)(e, t)) : this.node()[e]; } -function Jl(e) { +function Zo(e) { return e.trim().split(/^|\s+/); } -function Xs(e) { - return e.classList || new Zl(e); +function zs(e) { + return e.classList || new Qo(e); } -function Zl(e) { - this._node = e, this._names = Jl(e.getAttribute("class") || ""); +function Qo(e) { + this._node = e, this._names = Zo(e.getAttribute("class") || ""); } -Zl.prototype = { +Qo.prototype = { add: function(e) { var t = this._names.indexOf(e); t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" "))); @@ -3315,31 +3315,31 @@ Zl.prototype = { return this._names.indexOf(e) >= 0; } }; -function Ql(e, t) { - for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); +function el(e, t) { + for (var n = zs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); } -function eo(e, t) { - for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); +function tl(e, t) { + for (var n = zs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); } function hc(e) { return function() { - Ql(this, e); + el(this, e); }; } function dc(e) { return function() { - eo(this, e); + tl(this, e); }; } function pc(e, t) { return function() { - (t.apply(this, arguments) ? Ql : eo)(this, e); + (t.apply(this, arguments) ? el : tl)(this, e); }; } function vc(e, t) { - var n = Jl(e + ""); + var n = Zo(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; + for (var r = zs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } return this.each((typeof t == "function" ? pc : t ? hc : dc)(n, t)); @@ -3391,7 +3391,7 @@ function Rc() { return this.each(Tc); } function Cc(e) { - var t = typeof e == "function" ? e : Bl(e); + var t = typeof e == "function" ? e : Wo(e); return this.select(function() { return this.appendChild(t.apply(this, arguments)); }); @@ -3400,7 +3400,7 @@ function Sc() { return null; } function Nc(e, t) { - var n = typeof e == "function" ? e : Bl(e), r = t == null ? Sc : typeof t == "function" ? t : zs(t); + var n = typeof e == "function" ? e : Wo(e), r = t == null ? Sc : typeof t == "function" ? t : Ys(t); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); @@ -3451,7 +3451,7 @@ function Vc(e, t, n) { return function() { var r = this.__on, i, s = Oc(t); if (r) { - for (var a = 0, l = r.length; a < l; ++a) + for (var a = 0, o = r.length; a < o; ++a) if ((i = r[a]).type === e.type && i.name === e.name) { this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = t; return; @@ -3463,52 +3463,52 @@ function Vc(e, t, n) { function Hc(e, t, n) { var r = Lc(e + ""), i, s = r.length, a; if (arguments.length < 2) { - var l = this.node().__on; - if (l) { - for (var o = 0, u = l.length, f; o < u; ++o) - for (i = 0, f = l[o]; i < s; ++i) + var o = this.node().__on; + if (o) { + for (var l = 0, u = o.length, f; l < u; ++l) + for (i = 0, f = o[l]; i < s; ++i) if ((a = r[i]).type === f.type && a.name === f.name) return f.value; } return; } - for (l = t ? Vc : qc, i = 0; i < s; ++i) this.each(l(r[i], t, n)); + for (o = t ? Vc : qc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); return this; } -function to(e, t, n) { - var r = jl(e), i = r.CustomEvent; +function nl(e, t, n) { + var r = Jo(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 Yc(e, t) { return function() { - return to(this, e, t); + return nl(this, e, t); }; } function zc(e, t) { return function() { - return to(this, e, t.apply(this, arguments)); + return nl(this, e, t.apply(this, arguments)); }; } -function Xc(e, t) { +function Bc(e, t) { return this.each((typeof t == "function" ? zc : Yc)(e, t)); } -function* Bc() { +function* Xc() { 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 no = [null]; -function it(e, t) { +var rl = [null]; +function at(e, t) { this._groups = e, this._parents = t; } function xr() { - return new it([[document.documentElement]], no); + return new at([[document.documentElement]], rl); } function Wc() { return this; } -it.prototype = xr.prototype = { - constructor: it, +at.prototype = xr.prototype = { + constructor: at, select: mf, selectAll: bf, selectChild: Tf, @@ -3522,14 +3522,14 @@ it.prototype = xr.prototype = { selection: Wc, order: Yf, sort: zf, - call: Bf, + call: Xf, nodes: Wf, node: Uf, size: Gf, empty: Kf, each: jf, attr: rc, - style: lc, + style: oc, property: cc, classed: vc, text: yc, @@ -3542,23 +3542,23 @@ it.prototype = xr.prototype = { clone: Ic, datum: Fc, on: Hc, - dispatch: Xc, - [Symbol.iterator]: Bc + dispatch: Bc, + [Symbol.iterator]: Xc }; -function he(e) { - return typeof e == "string" ? new it([[document.querySelector(e)]], [document.documentElement]) : new it([[e]], no); +function ue(e) { + return typeof e == "string" ? new at([[document.querySelector(e)]], [document.documentElement]) : new at([[e]], rl); } function Bs(e, t, n) { e.prototype = t.prototype = n, n.constructor = e; } -function ro(e, t) { +function il(e, t) { var n = Object.create(e.prototype); for (var r in t) n[r] = t[r]; return n; } -function Jr() { +function Kr() { } -var Vr = 0.7, $i = 1 / Vr, nr = "\\s*([+-]?\\d+)\\s*", Hr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Dt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Uc = /^#([0-9a-f]{3,8})$/, Gc = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), Kc = new RegExp(`^rgb\\(${Dt},${Dt},${Dt}\\)$`), jc = new RegExp(`^rgba\\(${nr},${nr},${nr},${Hr}\\)$`), Jc = new RegExp(`^rgba\\(${Dt},${Dt},${Dt},${Hr}\\)$`), Zc = new RegExp(`^hsl\\(${Hr},${Dt},${Dt}\\)$`), Qc = new RegExp(`^hsla\\(${Hr},${Dt},${Dt},${Hr}\\)$`), Aa = { +var Lr = 0.7, Ei = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Dt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Uc = /^#([0-9a-f]{3,8})$/, Gc = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), Kc = new RegExp(`^rgb\\(${Dt},${Dt},${Dt}\\)$`), jc = new RegExp(`^rgba\\(${nr},${nr},${nr},${qr}\\)$`), Jc = new RegExp(`^rgba\\(${Dt},${Dt},${Dt},${qr}\\)$`), Zc = new RegExp(`^hsl\\(${qr},${Dt},${Dt}\\)$`), Qc = new RegExp(`^hsla\\(${qr},${Dt},${Dt},${qr}\\)$`), Aa = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3708,7 +3708,7 @@ var Vr = 0.7, $i = 1 / Vr, nr = "\\s*([+-]?\\d+)\\s*", Hr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Bs(Jr, Xn, { +Bs(Kr, Wn, { copy(e) { return Object.assign(new this.constructor(), this, e); }, @@ -3730,42 +3730,42 @@ function eh() { return this.rgb().formatHex8(); } function th() { - return io(this).formatHsl(); + return sl(this).formatHsl(); } function Ta() { return this.rgb().formatRgb(); } -function Xn(e) { +function Wn(e) { var t, n; - return e = (e + "").trim().toLowerCase(), (t = Uc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Ra(t) : n === 3 ? new Ue(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? ri(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? ri(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 = Gc.exec(e)) ? new Ue(t[1], t[2], t[3], 1) : (t = Kc.exec(e)) ? new Ue(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = jc.exec(e)) ? ri(t[1], t[2], t[3], t[4]) : (t = Jc.exec(e)) ? ri(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = Zc.exec(e)) ? Na(t[1], t[2] / 100, t[3] / 100, 1) : (t = Qc.exec(e)) ? Na(t[1], t[2] / 100, t[3] / 100, t[4]) : Aa.hasOwnProperty(e) ? Ra(Aa[e]) : e === "transparent" ? new Ue(NaN, NaN, NaN, 0) : null; + return e = (e + "").trim().toLowerCase(), (t = Uc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Ra(t) : n === 3 ? new Ze(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 = Gc.exec(e)) ? new Ze(t[1], t[2], t[3], 1) : (t = Kc.exec(e)) ? new Ze(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = jc.exec(e)) ? si(t[1], t[2], t[3], t[4]) : (t = Jc.exec(e)) ? si(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = Zc.exec(e)) ? Na(t[1], t[2] / 100, t[3] / 100, 1) : (t = Qc.exec(e)) ? Na(t[1], t[2] / 100, t[3] / 100, t[4]) : Aa.hasOwnProperty(e) ? Ra(Aa[e]) : e === "transparent" ? new Ze(NaN, NaN, NaN, 0) : null; } function Ra(e) { - return new Ue(e >> 16 & 255, e >> 8 & 255, e & 255, 1); + return new Ze(e >> 16 & 255, e >> 8 & 255, e & 255, 1); } -function ri(e, t, n, r) { - return r <= 0 && (e = t = n = NaN), new Ue(e, t, n, r); +function si(e, t, n, r) { + return r <= 0 && (e = t = n = NaN), new Ze(e, t, n, r); } function nh(e) { - return e instanceof Jr || (e = Xn(e)), e ? (e = e.rgb(), new Ue(e.r, e.g, e.b, e.opacity)) : new Ue(); + return e instanceof Kr || (e = Wn(e)), e ? (e = e.rgb(), new Ze(e.r, e.g, e.b, e.opacity)) : new Ze(); } -function xs(e, t, n, r) { - return arguments.length === 1 ? nh(e) : new Ue(e, t, n, r ?? 1); +function ws(e, t, n, r) { + return arguments.length === 1 ? nh(e) : new Ze(e, t, n, r ?? 1); } -function Ue(e, t, n, r) { +function Ze(e, t, n, r) { this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; } -Bs(Ue, xs, ro(Jr, { +Bs(Ze, ws, il(Kr, { brighter(e) { - return e = e == null ? $i : Math.pow($i, e), new Ue(this.r * e, this.g * e, this.b * e, this.opacity); + return e = e == null ? Ei : Math.pow(Ei, e), new Ze(this.r * e, this.g * e, this.b * e, this.opacity); }, darker(e) { - return e = e == null ? Vr : Math.pow(Vr, e), new Ue(this.r * e, this.g * e, this.b * e, this.opacity); + return e = e == null ? Lr : Math.pow(Lr, e), new Ze(this.r * e, this.g * e, this.b * e, this.opacity); }, rgb() { return this; }, clamp() { - return new Ue(Hn(this.r), Hn(this.g), Hn(this.b), Ai(this.opacity)); + return new Ze(zn(this.r), zn(this.g), zn(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; @@ -3778,78 +3778,78 @@ Bs(Ue, xs, ro(Jr, { toString: Sa })); function Ca() { - return `#${kn(this.r)}${kn(this.g)}${kn(this.b)}`; + return `#${Pn(this.r)}${Pn(this.g)}${Pn(this.b)}`; } function rh() { - return `#${kn(this.r)}${kn(this.g)}${kn(this.b)}${kn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; + return `#${Pn(this.r)}${Pn(this.g)}${Pn(this.b)}${Pn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Sa() { - const e = Ai(this.opacity); - return `${e === 1 ? "rgb(" : "rgba("}${Hn(this.r)}, ${Hn(this.g)}, ${Hn(this.b)}${e === 1 ? ")" : `, ${e})`}`; + const e = Ti(this.opacity); + return `${e === 1 ? "rgb(" : "rgba("}${zn(this.r)}, ${zn(this.g)}, ${zn(this.b)}${e === 1 ? ")" : `, ${e})`}`; } -function Ai(e) { +function Ti(e) { return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); } -function Hn(e) { +function zn(e) { return Math.max(0, Math.min(255, Math.round(e) || 0)); } -function kn(e) { - return e = Hn(e), (e < 16 ? "0" : "") + e.toString(16); +function Pn(e) { + return e = zn(e), (e < 16 ? "0" : "") + e.toString(16); } function Na(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); + 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 io(e) { - if (e instanceof _t) return new _t(e.h, e.s, e.l, e.opacity); - if (e instanceof Jr || (e = Xn(e)), !e) return new _t(); - if (e instanceof _t) return e; +function sl(e) { + if (e instanceof bt) return new bt(e.h, e.s, e.l, e.opacity); + if (e instanceof Kr || (e = Wn(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, l = s - i, o = (s + i) / 2; - return l ? (t === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - t) / l + 2 : a = (t - n) / l + 4, l /= o < 0.5 ? s + i : 2 - s - i, a *= 60) : l = o > 0 && o < 1 ? 0 : a, new _t(a, l, o, e.opacity); + 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 bt(a, o, l, e.opacity); } function ih(e, t, n, r) { - return arguments.length === 1 ? io(e) : new _t(e, t, n, r ?? 1); + return arguments.length === 1 ? sl(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; } -Bs(_t, ih, ro(Jr, { +Bs(bt, ih, il(Kr, { brighter(e) { - return e = e == null ? $i : Math.pow($i, 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 ? Vr : Math.pow(Vr, e), new _t(this.h, this.s, this.l * e, this.opacity); + return e = e == null ? Lr : Math.pow(Lr, 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 Ue( - ns(e >= 240 ? e - 240 : e + 120, i, r), - ns(e, i, r), - ns(e < 120 ? e + 240 : e - 120, i, r), + return new Ze( + ts(e >= 240 ? e - 240 : e + 120, i, r), + ts(e, i, r), + ts(e < 120 ? e + 240 : e - 120, i, r), this.opacity ); }, clamp() { - return new _t(ka(this.h), ii(this.s), ii(this.l), Ai(this.opacity)); + return new bt(ka(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 = Ai(this.opacity); - return `${e === 1 ? "hsl(" : "hsla("}${ka(this.h)}, ${ii(this.s) * 100}%, ${ii(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; + const e = Ti(this.opacity); + return `${e === 1 ? "hsl(" : "hsla("}${ka(this.h)}, ${ai(this.s) * 100}%, ${ai(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; } })); function ka(e) { return e = (e || 0) % 360, e < 0 ? e + 360 : e; } -function ii(e) { +function ai(e) { return Math.max(0, Math.min(1, e || 0)); } -function ns(e, t, n) { +function ts(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 Ws = (e) => () => e; +const Xs = (e) => () => e; function sh(e, t) { return function(n) { return e + n * t; @@ -3860,26 +3860,26 @@ function ah(e, t, n) { return Math.pow(e + r * t, n); }; } -function lh(e) { - return (e = +e) == 1 ? so : function(t, n) { - return n - t ? ah(t, n, e) : Ws(isNaN(t) ? n : t); +function oh(e) { + return (e = +e) == 1 ? al : function(t, n) { + return n - t ? ah(t, n, e) : Xs(isNaN(t) ? n : t); }; } -function so(e, t) { +function al(e, t) { var n = t - e; - return n ? sh(e, n) : Ws(isNaN(e) ? t : e); + return n ? sh(e, n) : Xs(isNaN(e) ? t : e); } -const Ei = (function e(t) { - var n = lh(t); +const Ri = (function e(t) { + var n = oh(t); function r(i, s) { - var a = n((i = xs(i)).r, (s = xs(s)).r), l = n(i.g, s.g), o = n(i.b, s.b), u = so(i.opacity, s.opacity); + var a = n((i = ws(i)).r, (s = ws(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = al(i.opacity, s.opacity); return function(f) { - return i.r = a(f), i.g = l(f), i.b = o(f), i.opacity = u(f), i + ""; + 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 oh(e, t) { +function lh(e, t) { t || (t = []); var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i; return function(s) { @@ -3892,10 +3892,10 @@ function uh(e) { } function fh(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] = jt(e[a], t[a]); + for (a = 0; a < r; ++a) i[a] = Gt(e[a], t[a]); for (; a < n; ++a) s[a] = t[a]; - return function(l) { - for (a = 0; a < r; ++a) s[a] = i[a](l); + return function(o) { + for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } @@ -3914,13 +3914,13 @@ function hh(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] = jt(e[i], t[i]) : r[i] = t[i]; + i in e ? n[i] = Gt(e[i], t[i]) : r[i] = t[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var bs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, rs = new RegExp(bs.source, "g"); +var xs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ns = new RegExp(xs.source, "g"); function dh(e) { return function() { return e; @@ -3931,20 +3931,20 @@ function ph(e) { return e(t) + ""; }; } -function ao(e, t) { - var n = bs.lastIndex = rs.lastIndex = 0, r, i, s, a = -1, l = [], o = []; - for (e = e + "", t = t + ""; (r = bs.exec(e)) && (i = rs.exec(t)); ) - (s = i.index) > n && (s = t.slice(n, s), l[a] ? l[a] += s : l[++a] = s), (r = r[0]) === (i = i[0]) ? l[a] ? l[a] += i : l[++a] = i : (l[++a] = null, o.push({ i: a, x: Pt(r, i) })), n = rs.lastIndex; - return n < t.length && (s = t.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? o[0] ? ph(o[0].x) : dh(t) : (t = o.length, function(u) { - for (var f = 0, h; f < t; ++f) l[(h = o[f]).i] = h.x(u); - return l.join(""); +function ol(e, t) { + var n = xs.lastIndex = ns.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (e = e + "", t = t + ""; (r = xs.exec(e)) && (i = ns.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: Pt(r, i) })), n = ns.lastIndex; + return n < t.length && (s = t.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? ph(l[0].x) : dh(t) : (t = l.length, function(u) { + for (var f = 0, h; f < t; ++f) o[(h = l[f]).i] = h.x(u); + return o.join(""); }); } -function jt(e, t) { +function Gt(e, t) { var n = typeof t, r; - return t == null || n === "boolean" ? Ws(t) : (n === "number" ? Pt : n === "string" ? (r = Xn(t)) ? (t = r, Ei) : ao : t instanceof Xn ? Ei : t instanceof Date ? ch : uh(t) ? oh : Array.isArray(t) ? fh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? hh : Pt)(e, t); + return t == null || n === "boolean" ? Xs(t) : (n === "number" ? Pt : n === "string" ? (r = Wn(t)) ? (t = r, Ri) : ol : t instanceof Wn ? Ri : t instanceof Date ? ch : uh(t) ? lh : Array.isArray(t) ? fh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? hh : Pt)(e, t); } -var Ma = 180 / Math.PI, $s = { +var Ma = 180 / Math.PI, bs = { translateX: 0, translateY: 0, rotate: 0, @@ -3952,26 +3952,26 @@ var Ma = 180 / Math.PI, $s = { scaleX: 1, scaleY: 1 }; -function lo(e, t, n, r, i, s) { - var a, l, o; - return (a = Math.sqrt(e * e + t * t)) && (e /= a, t /= a), (o = e * n + t * r) && (n -= e * o, r -= t * o), (l = Math.sqrt(n * n + r * r)) && (n /= l, r /= l, o /= l), e * r < t * n && (e = -e, t = -t, o = -o, a = -a), { +function ll(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) * Ma, - skewX: Math.atan(o) * Ma, + skewX: Math.atan(l) * Ma, scaleX: a, - scaleY: l + scaleY: o }; } -var si; +var oi; function vh(e) { const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + ""); - return t.isIdentity ? $s : lo(t.a, t.b, t.c, t.d, t.e, t.f); + return t.isIdentity ? bs : ll(t.a, t.b, t.c, t.d, t.e, t.f); } function gh(e) { - return e == null || (si || (si = document.createElementNS("http://www.w3.org/2000/svg", "g")), si.setAttribute("transform", e), !(e = si.transform.baseVal.consolidate())) ? $s : (e = e.matrix, lo(e.a, e.b, e.c, e.d, e.e, e.f)); + return e == null || (oi || (oi = document.createElementNS("http://www.w3.org/2000/svg", "g")), oi.setAttribute("transform", e), !(e = oi.transform.baseVal.consolidate())) ? bs : (e = e.matrix, ll(e.a, e.b, e.c, e.d, e.e, e.f)); } -function oo(e, t, n, r) { +function ul(e, t, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } @@ -3984,10 +3984,10 @@ function oo(e, t, n, r) { function a(u, f, h, c) { u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Pt(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); } - function l(u, f, h, c) { + function o(u, f, h, c) { u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Pt(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); } - function o(u, f, h, c, p, m) { + function l(u, f, h, c, p, m) { if (u !== h || f !== c) { var $ = p.push(i(p) + "scale(", null, ",", null, ")"); m.push({ i: $ - 4, x: Pt(u, h) }, { i: $ - 2, x: Pt(f, c) }); @@ -3995,76 +3995,76 @@ function oo(e, t, n, r) { } return function(u, f) { var h = [], c = []; - return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, h, c), a(u.rotate, f.rotate, h, c), l(u.skewX, f.skewX, h, c), o(u.scaleX, u.scaleY, f.scaleX, f.scaleY, h, c), u = f = null, function(p) { + return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, h, c), a(u.rotate, f.rotate, h, c), o(u.skewX, f.skewX, h, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, h, c), u = f = null, function(p) { for (var m = -1, $ = c.length, _; ++m < $; ) h[(_ = c[m]).i] = _.x(p); return h.join(""); }; }; } -var _h = oo(vh, "px, ", "px)", "deg)"), mh = oo(gh, ", ", ")", ")"), mr = 0, Mr = 0, Nr = 0, uo = 1e3, Ti, Pr, Ri = 0, Bn = 0, Xi = 0, Yr = typeof performance == "object" && performance.now ? performance : Date, fo = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { +var _h = ul(vh, "px, ", "px)", "deg)"), mh = ul(gh, ", ", ")", ")"), mr = 0, Nr = 0, Cr = 0, fl = 1e3, Ci, kr, Si = 0, Un = 0, Wi = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, cl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { setTimeout(e, 17); }; -function Us() { - return Bn || (fo(yh), Bn = Yr.now() + Xi); +function Ws() { + return Un || (cl(yh), Un = Vr.now() + Wi); } function yh() { - Bn = 0; + Un = 0; } -function Ci() { +function Ni() { this._call = this._time = this._next = null; } -Ci.prototype = co.prototype = { - constructor: Ci, +Ni.prototype = hl.prototype = { + constructor: Ni, restart: function(e, t, n) { if (typeof e != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Us() : +n) + (t == null ? 0 : +t), !this._next && Pr !== this && (Pr ? Pr._next = this : Ti = this, Pr = this), this._call = e, this._time = n, As(); + n = (n == null ? Ws() : +n) + (t == null ? 0 : +t), !this._next && kr !== this && (kr ? kr._next = this : Ci = this, kr = this), this._call = e, this._time = n, $s(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, As()); + this._call && (this._call = null, this._time = 1 / 0, $s()); } }; -function co(e, t, n) { - var r = new Ci(); +function hl(e, t, n) { + var r = new Ni(); return r.restart(e, t, n), r; } function wh() { - Us(), ++mr; - for (var e = Ti, t; e; ) - (t = Bn - e._time) >= 0 && e._call.call(void 0, t), e = e._next; + Ws(), ++mr; + for (var e = Ci, t; e; ) + (t = Un - e._time) >= 0 && e._call.call(void 0, t), e = e._next; --mr; } function Pa() { - Bn = (Ri = Yr.now()) + Xi, mr = Mr = 0; + Un = (Si = Vr.now()) + Wi, mr = Nr = 0; try { wh(); } finally { - mr = 0, bh(), Bn = 0; + mr = 0, bh(), Un = 0; } } function xh() { - var e = Yr.now(), t = e - Ri; - t > uo && (Xi -= t, Ri = e); + var e = Vr.now(), t = e - Si; + t > fl && (Wi -= t, Si = e); } function bh() { - for (var e, t = Ti, 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 : Ti = n); - Pr = e, As(r); + for (var e, t = Ci, 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 : Ci = n); + kr = e, $s(r); } -function As(e) { +function $s(e) { if (!mr) { - Mr && (Mr = clearTimeout(Mr)); - var t = e - Bn; - t > 24 ? (e < 1 / 0 && (Mr = setTimeout(Pa, e - Yr.now() - Xi)), Nr && (Nr = clearInterval(Nr))) : (Nr || (Ri = Yr.now(), Nr = setInterval(xh, uo)), mr = 1, fo(Pa)); + Nr && (Nr = clearTimeout(Nr)); + var t = e - Un; + t > 24 ? (e < 1 / 0 && (Nr = setTimeout(Pa, e - Vr.now() - Wi)), Cr && (Cr = clearInterval(Cr))) : (Cr || (Si = Vr.now(), Cr = setInterval(xh, fl)), mr = 1, cl(Pa)); } } function Da(e, t, n) { - var r = new Ci(); + var r = new Ni(); return t = t == null ? 0 : +t, r.restart((i) => { r.stop(), e(i + t); }, t, n), r; } -var $h = Xl("start", "end", "cancel", "interrupt"), Ah = [], ho = 0, Ia = 1, Es = 2, vi = 3, Fa = 4, Ts = 5, gi = 6; -function Bi(e, t, n, r, i, s) { +var $h = Xo("start", "end", "cancel", "interrupt"), Ah = [], dl = 0, Ia = 1, As = 2, _i = 3, Fa = 4, Es = 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; @@ -4081,53 +4081,53 @@ function Bi(e, t, n, r, i, s) { duration: s.duration, ease: s.ease, timer: null, - state: ho + state: dl }); } -function Gs(e, t) { - var n = bt(e, t); - if (n.state > ho) throw new Error("too late; already scheduled"); +function Us(e, t) { + var n = Rt(e, t); + if (n.state > dl) throw new Error("too late; already scheduled"); return n; } function Vt(e, t) { - var n = bt(e, t); - if (n.state > vi) throw new Error("too late; already running"); + var n = Rt(e, t); + if (n.state > _i) throw new Error("too late; already running"); return n; } -function bt(e, t) { +function Rt(e, t) { var n = e.__transition; if (!n || !(n = n[t])) throw new Error("transition not found"); return n; } function Eh(e, t, n) { var r = e.__transition, i; - r[t] = n, n.timer = co(s, 0, n.time); + r[t] = n, n.timer = hl(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); } function a(u) { var f, h, c, p; - if (n.state !== Ia) return o(); + if (n.state !== Ia) return l(); for (f in r) if (p = r[f], p.name === n.name) { - if (p.state === vi) return Da(a); - p.state === Fa ? (p.state = gi, p.timer.stop(), p.on.call("interrupt", e, e.__data__, p.index, p.group), delete r[f]) : +f < t && (p.state = gi, p.timer.stop(), p.on.call("cancel", e, e.__data__, p.index, p.group), delete r[f]); + if (p.state === _i) return Da(a); + p.state === Fa ? (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 (Da(function() { - n.state === vi && (n.state = Fa, n.timer.restart(l, n.delay, n.time), l(u)); - }), n.state = Es, n.on.call("start", e, e.__data__, n.index, n.group), n.state === Es) { - for (n.state = vi, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) + n.state === _i && (n.state = Fa, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = As, n.on.call("start", e, e.__data__, n.index, n.group), n.state === As) { + for (n.state = _i, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) (p = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++h] = p); i.length = h + 1; } } - function l(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(o), n.state = Ts, 1), h = -1, c = i.length; ++h < c; ) + function o(u) { + for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Es, 1), h = -1, c = i.length; ++h < c; ) i[h].call(e, f); - n.state === Ts && (n.on.call("end", e, e.__data__, n.index, n.group), o()); + n.state === Es && (n.on.call("end", e, e.__data__, n.index, n.group), l()); } - function o() { - n.state = gi, n.timer.stop(), delete r[t]; + function l() { + n.state = mi, n.timer.stop(), delete r[t]; for (var u in r) return; delete e.__transition; } @@ -4141,7 +4141,7 @@ function Th(e, t) { s = !1; continue; } - i = r.state > Es && r.state < Ts, r.state = gi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; + i = r.state > As && r.state < Es, 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; } @@ -4157,7 +4157,7 @@ function Ch(e, t) { var i = Vt(this, e), s = i.tween; if (s !== n) { r = n = s; - for (var a = 0, l = r.length; a < l; ++a) + for (var a = 0, o = r.length; a < o; ++a) if (r[a].name === t) { r = r.slice(), r.splice(a, 1); break; @@ -4173,12 +4173,12 @@ function Sh(e, t, n) { var s = Vt(this, e), a = s.tween; if (a !== r) { i = (r = a).slice(); - for (var l = { name: t, value: n }, o = 0, u = i.length; o < u; ++o) - if (i[o].name === t) { - i[o] = l; + for (var o = { name: t, value: n }, l = 0, u = i.length; l < u; ++l) + if (i[l].name === t) { + i[l] = o; break; } - o === u && i.push(l); + l === u && i.push(o); } s.tween = i; }; @@ -4186,25 +4186,25 @@ function Sh(e, t, n) { function Nh(e, t) { var n = this._id; if (e += "", arguments.length < 2) { - for (var r = bt(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = Rt(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) if ((a = r[i]).name === e) return a.value; return null; } return this.each((t == null ? Ch : Sh)(n, e, t)); } -function Ks(e, t, n) { +function Gs(e, t, n) { var r = e._id; return e.each(function() { var i = Vt(this, r); (i.value || (i.value = {}))[t] = n.apply(this, arguments); }), function(i) { - return bt(i, r).value[t]; + return Rt(i, r).value[t]; }; } -function po(e, t) { +function pl(e, t) { var n; - return (typeof t == "number" ? Pt : t instanceof Xn ? Ei : (n = Xn(t)) ? (t = n, Ei) : ao)(e, t); + return (typeof t == "number" ? Pt : t instanceof Wn ? Ri : (n = Wn(t)) ? (t = n, Ri) : ol)(e, t); } function kh(e) { return function() { @@ -4233,20 +4233,20 @@ function Dh(e, t, n) { function Ih(e, t, n) { var r, i, s; return function() { - var a, l = n(this), o; - return l == null ? void this.removeAttribute(e) : (a = this.getAttribute(e), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = t(r = a, l))); + 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 Fh(e, t, n) { var r, i, s; return function() { - var a, l = n(this), o; - return l == null ? void this.removeAttributeNS(e.space, e.local) : (a = this.getAttributeNS(e.space, e.local), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = t(r = a, l))); + 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 Oh(e, t) { - var n = zi(e), r = n === "transform" ? mh : po; - return this.attrTween(e, typeof t == "function" ? (n.local ? Fh : Ih)(n, r, Ks(this, "attr." + e, t)) : t == null ? (n.local ? Mh : kh)(n) : (n.local ? Dh : Ph)(n, r, t)); + var n = Xi(e), r = n === "transform" ? mh : pl; + return this.attrTween(e, typeof t == "function" ? (n.local ? Fh : Ih)(n, r, Gs(this, "attr." + e, t)) : t == null ? (n.local ? Mh : kh)(n) : (n.local ? Dh : Ph)(n, r, t)); } function Lh(e, t) { return function(n) { @@ -4279,22 +4279,22 @@ function Yh(e, t) { 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 = zi(e); + var r = Xi(e); return this.tween(n, (r.local ? Vh : Hh)(r, t)); } function zh(e, t) { return function() { - Gs(this, e).delay = +t.apply(this, arguments); + Us(this, e).delay = +t.apply(this, arguments); }; } -function Xh(e, t) { +function Bh(e, t) { return t = +t, function() { - Gs(this, e).delay = t; + Us(this, e).delay = t; }; } -function Bh(e) { +function Xh(e) { var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? zh : Xh)(t, e)) : bt(this.node(), t).delay; + return arguments.length ? this.each((typeof e == "function" ? zh : Bh)(t, e)) : Rt(this.node(), t).delay; } function Wh(e, t) { return function() { @@ -4308,7 +4308,7 @@ function Uh(e, t) { } function Gh(e) { var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Wh : Uh)(t, e)) : bt(this.node(), t).duration; + return arguments.length ? this.each((typeof e == "function" ? Wh : Uh)(t, e)) : Rt(this.node(), t).duration; } function Kh(e, t) { if (typeof t != "function") throw new Error(); @@ -4318,7 +4318,7 @@ function Kh(e, t) { } function jh(e) { var t = this._id; - return arguments.length ? this.each(Kh(t, e)) : bt(this.node(), t).ease; + return arguments.length ? this.each(Kh(t, e)) : Rt(this.node(), t).ease; } function Jh(e, t) { return function() { @@ -4332,20 +4332,20 @@ function Zh(e) { return this.each(Jh(this._id, e)); } function Qh(e) { - typeof e != "function" && (e = Ul(e)); + typeof e != "function" && (e = Go(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, l = r[i] = [], o, u = 0; u < a; ++u) - (o = s[u]) && e.call(o, o.__data__, u, s) && l.push(o); - return new un(r, this._parents, this._name, this._id); + 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 on(r, this._parents, this._name, this._id); } function ed(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), l = 0; l < s; ++l) - for (var o = t[l], u = n[l], f = o.length, h = a[l] = new Array(f), c, p = 0; p < f; ++p) - (c = o[p] || u[p]) && (h[p] = c); - for (; l < r; ++l) - a[l] = t[l]; - return new un(a, this._parents, this._name, this._id); + 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, h = a[o] = new Array(f), c, p = 0; p < f; ++p) + (c = l[p] || u[p]) && (h[p] = c); + for (; o < r; ++o) + a[o] = t[o]; + return new on(a, this._parents, this._name, this._id); } function td(e) { return (e + "").trim().split(/^|\s+/).every(function(t) { @@ -4354,15 +4354,15 @@ function td(e) { }); } function nd(e, t, n) { - var r, i, s = td(t) ? Gs : Vt; + var r, i, s = td(t) ? Us : Vt; return function() { - var a = s(this, e), l = a.on; - l !== r && (i = (r = l).copy()).on(t, n), a.on = i; + var a = s(this, e), o = a.on; + o !== r && (i = (r = o).copy()).on(t, n), a.on = i; }; } function rd(e, t) { var n = this._id; - return arguments.length < 2 ? bt(this.node(), n).on.on(e) : this.each(nd(n, e, t)); + return arguments.length < 2 ? Rt(this.node(), n).on.on(e) : this.each(nd(n, e, t)); } function id(e) { return function() { @@ -4376,27 +4376,27 @@ function sd() { } function ad(e) { var t = this._name, n = this._id; - typeof e != "function" && (e = zs(e)); + typeof e != "function" && (e = Ys(e)); for (var r = this._groups, i = r.length, s = new Array(i), a = 0; a < i; ++a) - for (var l = r[a], o = l.length, u = s[a] = new Array(o), f, h, c = 0; c < o; ++c) - (f = l[c]) && (h = e.call(f, f.__data__, c, l)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Bi(u[c], t, n, c, u, bt(f, n))); - return new un(s, this._parents, t, n); + for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, h, c = 0; c < l; ++c) + (f = o[c]) && (h = e.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Ui(u[c], t, n, c, u, Rt(f, n))); + return new on(s, this._parents, t, n); } -function ld(e) { +function od(e) { var t = this._name, n = this._id; - typeof e != "function" && (e = Wl(e)); - for (var r = this._groups, i = r.length, s = [], a = [], l = 0; l < i; ++l) - for (var o = r[l], u = o.length, f, h = 0; h < u; ++h) - if (f = o[h]) { - for (var c = e.call(f, f.__data__, h, o), p, m = bt(f, n), $ = 0, _ = c.length; $ < _; ++$) - (p = c[$]) && Bi(p, t, n, $, c, m); + typeof e != "function" && (e = Uo(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, h = 0; h < u; ++h) + if (f = l[h]) { + for (var c = e.call(f, f.__data__, h, l), p, m = Rt(f, n), $ = 0, _ = c.length; $ < _; ++$) + (p = c[$]) && Ui(p, t, n, $, c, m); s.push(c), a.push(f); } - return new un(s, a, t, n); + return new on(s, a, t, n); } -var od = xr.prototype.constructor; +var ld = xr.prototype.constructor; function ud() { - return new od(this._groups, this._parents); + return new ld(this._groups, this._parents); } function fd(e, t) { var n, r, i; @@ -4405,7 +4405,7 @@ function fd(e, t) { return s === a ? null : s === n && a === r ? i : i = t(n = s, r = a); }; } -function vo(e) { +function vl(e) { return function() { this.style.removeProperty(e); }; @@ -4420,20 +4420,20 @@ function cd(e, t, n) { function hd(e, t, n) { var r, i, s; return function() { - var a = _r(this, e), l = n(this), o = l + ""; - return l == null && (o = l = (this.style.removeProperty(e), _r(this, e))), a === o ? null : a === r && o === i ? s : (i = o, s = t(r = a, l)); + 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)); }; } function dd(e, t) { - var n, r, i, s = "style." + t, a = "end." + s, l; + var n, r, i, s = "style." + t, a = "end." + s, o; return function() { - var o = Vt(this, e), u = o.on, f = o.value[s] == null ? l || (l = vo(t)) : void 0; - (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), o.on = r; + var l = Vt(this, e), u = l.on, f = l.value[s] == null ? o || (o = vl(t)) : void 0; + (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } function pd(e, t, n) { - var r = (e += "") == "transform" ? _h : po; - return t == null ? this.styleTween(e, fd(e, r)).on("end.style." + e, vo(e)) : typeof t == "function" ? this.styleTween(e, hd(e, r, Ks(this, "style." + e, t))).each(dd(this._id, e)) : this.styleTween(e, cd(e, r, t), n).on("end.style." + e, null); + var r = (e += "") == "transform" ? _h : pl; + return t == null ? this.styleTween(e, fd(e, r)).on("end.style." + e, vl(e)) : typeof t == "function" ? this.styleTween(e, hd(e, r, Gs(this, "style." + e, t))).each(dd(this._id, e)) : this.styleTween(e, cd(e, r, t), n).on("end.style." + e, null); } function vd(e, t, n) { return function(r) { @@ -4467,7 +4467,7 @@ function yd(e) { }; } function wd(e) { - return this.tween("text", typeof e == "function" ? yd(Ks(this, "text", e)) : md(e == null ? "" : e + "")); + return this.tween("text", typeof e == "function" ? yd(Gs(this, "text", e)) : md(e == null ? "" : e + "")); } function xd(e) { return function(t) { @@ -4490,58 +4490,58 @@ function $d(e) { return this.tween(t, bd(e)); } function Ad() { - for (var e = this._name, t = this._id, n = go(), r = this._groups, i = r.length, s = 0; s < i; ++s) - for (var a = r[s], l = a.length, o, u = 0; u < l; ++u) - if (o = a[u]) { - var f = bt(o, t); - Bi(o, e, n, u, a, { + for (var e = this._name, t = this._id, n = gl(), 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); + Ui(l, e, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new un(r, this._parents, e, n); + return new on(r, this._parents, e, n); } function Ed() { var e, t, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { - var l = { value: a }, o = { value: function() { + var o = { value: a }, l = { value: function() { --i === 0 && s(); } }; n.each(function() { var u = Vt(this, r), f = u.on; - f !== e && (t = (e = f).copy(), t._.cancel.push(l), t._.interrupt.push(l), t._.end.push(o)), u.on = t; + 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 Td = 0; -function un(e, t, n, r) { +function on(e, t, n, r) { this._groups = e, this._parents = t, this._name = n, this._id = r; } -function _i(e) { +function yi(e) { return xr().transition(e); } -function go() { +function gl() { return ++Td; } -var Kt = xr.prototype; -un.prototype = _i.prototype = { - constructor: un, +var Ut = xr.prototype; +on.prototype = yi.prototype = { + constructor: on, select: ad, - selectAll: ld, - selectChild: Kt.selectChild, - selectChildren: Kt.selectChildren, + selectAll: od, + selectChild: Ut.selectChild, + selectChildren: Ut.selectChildren, filter: Qh, merge: ed, selection: ud, transition: Ad, - call: Kt.call, - nodes: Kt.nodes, - node: Kt.node, - size: Kt.size, - empty: Kt.empty, - each: Kt.each, + call: Ut.call, + nodes: Ut.nodes, + node: Ut.node, + size: Ut.size, + empty: Ut.empty, + each: Ut.each, on: rd, attr: Oh, attrTween: Yh, @@ -4551,12 +4551,12 @@ un.prototype = _i.prototype = { textTween: $d, remove: sd, tween: Nh, - delay: Bh, + delay: Xh, duration: Gh, ease: jh, easeVarying: Zh, end: Ed, - [Symbol.iterator]: Kt[Symbol.iterator] + [Symbol.iterator]: Ut[Symbol.iterator] }; function Rd(e) { return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; @@ -4576,16 +4576,16 @@ function Sd(e, t) { } function Nd(e) { var t, n; - e instanceof un ? (t = e._id, e = e._name) : (t = go(), (n = Cd).time = Us(), e = e == null ? null : e + ""); + e instanceof on ? (t = e._id, e = e._name) : (t = gl(), (n = Cd).time = Ws(), e = e == null ? null : e + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) - for (var a = r[s], l = a.length, o, u = 0; u < l; ++u) - (o = a[u]) && Bi(o, e, t, u, a, n || Sd(o, t)); - return new un(r, this._parents, e, t); + for (var a = r[s], o = a.length, l, u = 0; u < o; ++u) + (l = a[u]) && Ui(l, e, t, u, a, n || Sd(l, t)); + return new on(r, this._parents, e, t); } xr.prototype.interrupt = Rh; xr.prototype.transition = Nd; -const Rs = Math.PI, Cs = 2 * Rs, Tn = 1e-6, kd = Cs - Tn; -function _o(e) { +const Ts = Math.PI, Rs = 2 * Ts, Cn = 1e-6, kd = Rs - Cn; +function _l(e) { this._ += e[0]; for (let t = 1, n = e.length; t < n; ++t) this._ += arguments[t] + e[t]; @@ -4593,7 +4593,7 @@ function _o(e) { function Md(e) { let t = Math.floor(e); if (!(t >= 0)) throw new Error(`invalid digits: ${e}`); - if (t > 15) return _o; + if (t > 15) return _l; const n = 10 ** t; return function(r) { this._ += r[0]; @@ -4604,7 +4604,7 @@ function Md(e) { class Pd { constructor(t) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = t == null ? _o : Md(t); + this._x1 = this._y1 = null, this._ = "", this._append = t == null ? _l : Md(t); } moveTo(t, n) { this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`; @@ -4623,20 +4623,20 @@ class Pd { } 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, l = this._y1, o = r - t, u = i - n, f = a - t, h = l - n, c = f * f + h * h; + let a = this._x1, o = this._y1, l = r - t, u = i - n, f = a - t, h = o - n, c = f * f + h * h; if (this._x1 === null) this._append`M${this._x1 = t},${this._y1 = n}`; - else if (c > Tn) if (!(Math.abs(h * o - u * f) > Tn) || !s) + else if (c > Cn) if (!(Math.abs(h * l - u * f) > Cn) || !s) this._append`L${this._x1 = t},${this._y1 = n}`; else { - let p = r - a, m = i - l, $ = o * o + u * u, _ = p * p + m * m, x = Math.sqrt($), D = Math.sqrt(c), C = s * Math.tan((Rs - Math.acos(($ + c - _) / (2 * x * D))) / 2), S = C / D, M = C / x; - Math.abs(S - 1) > Tn && this._append`L${t + S * f},${n + S * h}`, this._append`A${s},${s},0,0,${+(h * p > f * m)},${this._x1 = t + M * o},${this._y1 = n + M * u}`; + let p = r - a, m = i - o, $ = l * l + u * u, _ = p * p + m * m, x = Math.sqrt($), F = Math.sqrt(c), S = s * Math.tan((Ts - Math.acos(($ + c - _) / (2 * x * F))) / 2), M = S / F, D = S / x; + Math.abs(M - 1) > Cn && this._append`L${t + M * f},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * p > f * m)},${this._x1 = t + D * l},${this._y1 = n + D * 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 l = r * Math.cos(i), o = r * Math.sin(i), u = t + l, f = n + o, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Tn || Math.abs(this._y1 - f) > Tn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Cs + Cs), c > kd ? this._append`A${r},${r},0,1,${h},${t - l},${n - o}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > Tn && this._append`A${r},${r},0,${+(c >= Rs)},${h},${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, h = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Cn || Math.abs(this._y1 - f) > Cn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Rs + Rs), c > kd ? this._append`A${r},${r},0,1,${h},${t - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > Cn && this._append`A${r},${r},0,${+(c >= Ts)},${h},${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`; @@ -4650,17 +4650,17 @@ function Dd(e) { return n; } const Id = Dd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Ie(e) { +function Ve(e) { return function() { return e; }; } -const Oa = Math.abs, Me = Math.atan2, En = Math.cos, Fd = Math.max, is = Math.min, Rt = Math.sin, tr = Math.sqrt, He = 1e-12, zr = Math.PI, Si = zr / 2, mi = 2 * zr; +const Oa = Math.abs, De = Math.atan2, Rn = Math.cos, Fd = Math.max, rs = Math.min, Ct = Math.sin, tr = Math.sqrt, We = 1e-12, Hr = Math.PI, ki = Hr / 2, wi = 2 * Hr; function Od(e) { - return e > 1 ? 0 : e < -1 ? zr : Math.acos(e); + return e > 1 ? 0 : e < -1 ? Hr : Math.acos(e); } function La(e) { - return e >= 1 ? Si : e <= -1 ? -Si : Math.asin(e); + return e >= 1 ? ki : e <= -1 ? -ki : Math.asin(e); } function Ld(e) { let t = 3; @@ -4691,71 +4691,71 @@ function Yd(e) { function zd(e) { return e && e.padAngle; } -function Xd(e, t, n, r, i, s, a, l) { - var o = n - e, u = r - t, f = a - i, h = l - s, c = h * o - f * u; - if (!(c * c < He)) - return c = (f * (t - s) - h * (e - i)) / c, [e + c * o, t + c * u]; +function Bd(e, t, n, r, i, s, a, o) { + var l = n - e, u = r - t, f = a - i, h = o - s, c = h * l - f * u; + if (!(c * c < We)) + return c = (f * (t - s) - h * (e - i)) / c, [e + c * l, t + c * u]; } -function ai(e, t, n, r, i, s, a) { - var l = e - n, o = t - r, u = (a ? s : -s) / tr(l * l + o * o), f = u * o, h = -u * l, c = e + f, p = t + h, m = n + f, $ = r + h, _ = (c + m) / 2, x = (p + $) / 2, D = m - c, C = $ - p, S = D * D + C * C, M = i - s, B = c * $ - m * p, j = (C < 0 ? -1 : 1) * tr(Fd(0, M * M * S - B * B)), Q = (B * C - D * j) / S, ce = (-B * D - C * j) / S, X = (B * C + D * j) / S, ae = (-B * D + C * j) / S, le = Q - _, T = ce - x, q = X - _, Le = ae - x; - return le * le + T * T > q * q + Le * Le && (Q = X, ce = ae), { +function li(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, h = -u * o, c = e + f, p = t + h, m = n + f, $ = r + h, _ = (c + m) / 2, x = (p + $) / 2, F = m - c, S = $ - p, M = F * F + S * S, D = i - s, W = c * $ - m * p, K = (S < 0 ? -1 : 1) * tr(Fd(0, D * D * M - W * W)), Q = (W * S - F * K) / M, ee = (-W * F - S * K) / M, J = (W * S + F * K) / M, ae = (-W * F + S * K) / M, oe = Q - _, N = ee - x, H = J - _, Ie = ae - x; + return oe * oe + N * N > H * H + Ie * Ie && (Q = J, ee = ae), { cx: Q, - cy: ce, + cy: ee, x01: -f, y01: -h, - x11: Q * (i / M - 1), - y11: ce * (i / M - 1) + x11: Q * (i / D - 1), + y11: ee * (i / D - 1) }; } -function Ct() { - var e = qd, t = Vd, n = Ie(0), r = null, i = Hd, s = Yd, a = zd, l = null, o = Ld(u); +function yt() { + var e = qd, t = Vd, n = Ve(0), r = null, i = Hd, s = Yd, a = zd, o = null, l = Ld(u); function u() { - var f, h, c = +e.apply(this, arguments), p = +t.apply(this, arguments), m = i.apply(this, arguments) - Si, $ = s.apply(this, arguments) - Si, _ = Oa($ - m), x = $ > m; - if (l || (l = f = o()), p < c && (h = p, p = c, c = h), !(p > He)) l.moveTo(0, 0); - else if (_ > mi - He) - l.moveTo(p * En(m), p * Rt(m)), l.arc(0, 0, p, m, $, !x), c > He && (l.moveTo(c * En($), c * Rt($)), l.arc(0, 0, c, $, m, x)); + var f, h, c = +e.apply(this, arguments), p = +t.apply(this, arguments), m = i.apply(this, arguments) - ki, $ = s.apply(this, arguments) - ki, _ = Oa($ - m), x = $ > m; + if (o || (o = f = l()), p < c && (h = p, p = c, c = h), !(p > We)) o.moveTo(0, 0); + else if (_ > wi - We) + o.moveTo(p * Rn(m), p * Ct(m)), o.arc(0, 0, p, m, $, !x), c > We && (o.moveTo(c * Rn($), c * Ct($)), o.arc(0, 0, c, $, m, x)); else { - var D = m, C = $, S = m, M = $, B = _, j = _, Q = a.apply(this, arguments) / 2, ce = Q > He && (r ? +r.apply(this, arguments) : tr(c * c + p * p)), X = is(Oa(p - c) / 2, +n.apply(this, arguments)), ae = X, le = X, T, q; - if (ce > He) { - var Le = La(ce / c * Rt(Q)), st = La(ce / p * Rt(Q)); - (B -= Le * 2) > He ? (Le *= x ? 1 : -1, S += Le, M -= Le) : (B = 0, S = M = (m + $) / 2), (j -= st * 2) > He ? (st *= x ? 1 : -1, D += st, C -= st) : (j = 0, D = C = (m + $) / 2); + var F = m, S = $, M = m, D = $, W = _, K = _, Q = a.apply(this, arguments) / 2, ee = Q > We && (r ? +r.apply(this, arguments) : tr(c * c + p * p)), J = rs(Oa(p - c) / 2, +n.apply(this, arguments)), ae = J, oe = J, N, H; + if (ee > We) { + var Ie = La(ee / c * Ct(Q)), Me = La(ee / p * Ct(Q)); + (W -= Ie * 2) > We ? (Ie *= x ? 1 : -1, M += Ie, D -= Ie) : (W = 0, M = D = (m + $) / 2), (K -= Me * 2) > We ? (Me *= x ? 1 : -1, F += Me, S -= Me) : (K = 0, F = S = (m + $) / 2); } - var de = p * En(D), Ee = p * Rt(D), ee = c * En(M), Pe = c * Rt(M); - if (X > He) { - var W = p * En(C), Ne = p * Rt(C), Ht = c * En(S), ne = c * Rt(S), qe; - if (_ < zr) - if (qe = Xd(de, Ee, Ht, ne, W, Ne, ee, Pe)) { - var $t = de - qe[0], At = Ee - qe[1], Yt = W - qe[0], we = Ne - qe[1], zt = 1 / Rt(Od(($t * Yt + At * we) / (tr($t * $t + At * At) * tr(Yt * Yt + we * we))) / 2), cn = tr(qe[0] * qe[0] + qe[1] * qe[1]); - ae = is(X, (c - cn) / (zt - 1)), le = is(X, (p - cn) / (zt + 1)); + var xe = p * Rn(F), ce = p * Ct(F), le = c * Rn(D), z = c * Ct(D); + if (J > We) { + var Fe = p * Rn(S), _t = p * Ct(S), ne = c * Rn(M), bn = c * Ct(M), Oe; + if (_ < Hr) + if (Oe = Bd(xe, ce, ne, bn, Fe, _t, le, z)) { + var ot = xe - Oe[0], $n = ce - Oe[1], we = Fe - Oe[0], mt = _t - Oe[1], Ht = 1 / Ct(Od((ot * we + $n * mt) / (tr(ot * ot + $n * $n) * tr(we * we + mt * mt))) / 2), An = tr(Oe[0] * Oe[0] + Oe[1] * Oe[1]); + ae = rs(J, (c - An) / (Ht - 1)), oe = rs(J, (p - An) / (Ht + 1)); } else - ae = le = 0; + ae = oe = 0; } - j > He ? le > He ? (T = ai(Ht, ne, de, Ee, p, le, x), q = ai(W, Ne, ee, Pe, p, le, x), l.moveTo(T.cx + T.x01, T.cy + T.y01), le < X ? l.arc(T.cx, T.cy, le, Me(T.y01, T.x01), Me(q.y01, q.x01), !x) : (l.arc(T.cx, T.cy, le, Me(T.y01, T.x01), Me(T.y11, T.x11), !x), l.arc(0, 0, p, Me(T.cy + T.y11, T.cx + T.x11), Me(q.cy + q.y11, q.cx + q.x11), !x), l.arc(q.cx, q.cy, le, Me(q.y11, q.x11), Me(q.y01, q.x01), !x))) : (l.moveTo(de, Ee), l.arc(0, 0, p, D, C, !x)) : l.moveTo(de, Ee), !(c > He) || !(B > He) ? l.lineTo(ee, Pe) : ae > He ? (T = ai(ee, Pe, W, Ne, c, -ae, x), q = ai(de, Ee, Ht, ne, c, -ae, x), l.lineTo(T.cx + T.x01, T.cy + T.y01), ae < X ? l.arc(T.cx, T.cy, ae, Me(T.y01, T.x01), Me(q.y01, q.x01), !x) : (l.arc(T.cx, T.cy, ae, Me(T.y01, T.x01), Me(T.y11, T.x11), !x), l.arc(0, 0, c, Me(T.cy + T.y11, T.cx + T.x11), Me(q.cy + q.y11, q.cx + q.x11), x), l.arc(q.cx, q.cy, ae, Me(q.y11, q.x11), Me(q.y01, q.x01), !x))) : l.arc(0, 0, c, M, S, x); + K > We ? oe > We ? (N = li(ne, bn, xe, ce, p, oe, x), H = li(Fe, _t, le, z, p, oe, x), o.moveTo(N.cx + N.x01, N.cy + N.y01), oe < J ? o.arc(N.cx, N.cy, oe, De(N.y01, N.x01), De(H.y01, H.x01), !x) : (o.arc(N.cx, N.cy, oe, De(N.y01, N.x01), De(N.y11, N.x11), !x), o.arc(0, 0, p, De(N.cy + N.y11, N.cx + N.x11), De(H.cy + H.y11, H.cx + H.x11), !x), o.arc(H.cx, H.cy, oe, De(H.y11, H.x11), De(H.y01, H.x01), !x))) : (o.moveTo(xe, ce), o.arc(0, 0, p, F, S, !x)) : o.moveTo(xe, ce), !(c > We) || !(W > We) ? o.lineTo(le, z) : ae > We ? (N = li(le, z, Fe, _t, c, -ae, x), H = li(xe, ce, ne, bn, c, -ae, x), o.lineTo(N.cx + N.x01, N.cy + N.y01), ae < J ? o.arc(N.cx, N.cy, ae, De(N.y01, N.x01), De(H.y01, H.x01), !x) : (o.arc(N.cx, N.cy, ae, De(N.y01, N.x01), De(N.y11, N.x11), !x), o.arc(0, 0, c, De(N.cy + N.y11, N.cx + N.x11), De(H.cy + H.y11, H.cx + H.x11), x), o.arc(H.cx, H.cy, ae, De(H.y11, H.x11), De(H.y01, H.x01), !x))) : o.arc(0, 0, c, D, M, x); } - if (l.closePath(), f) return l = null, f + "" || null; + if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - zr / 2; - return [En(h) * f, Rt(h) * f]; + var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Hr / 2; + return [Rn(h) * f, Ct(h) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Ie(+f), u) : e; + return arguments.length ? (e = typeof f == "function" ? f : Ve(+f), u) : e; }, u.outerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Ie(+f), u) : t; + return arguments.length ? (t = typeof f == "function" ? f : Ve(+f), u) : t; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Ie(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Ve(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Ie(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Ve(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Ie(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Ve(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Ie(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Ve(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Ie(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Ve(+f), u) : a; }, u.context = function(f) { - return arguments.length ? (l = f ?? null, u) : l; + return arguments.length ? (o = f ?? null, u) : o; }, u; } -function Bd(e) { +function Xd(e) { return typeof e == "object" && "length" in e ? e : Array.from(e); } function Wd(e, t) { @@ -4764,51 +4764,51 @@ function Wd(e, t) { function Ud(e) { return e; } -function ss() { - var e = Ud, t = Wd, n = null, r = Ie(0), i = Ie(mi), s = Ie(0); - function a(l) { - var o, u = (l = Bd(l)).length, f, h, c = 0, p = new Array(u), m = new Array(u), $ = +r.apply(this, arguments), _ = Math.min(mi, Math.max(-mi, i.apply(this, arguments) - $)), x, D = Math.min(Math.abs(_) / u, s.apply(this, arguments)), C = D * (_ < 0 ? -1 : 1), S; - for (o = 0; o < u; ++o) - (S = m[p[o] = o] = +e(l[o], o, l)) > 0 && (c += S); - for (t != null ? p.sort(function(M, B) { - return t(m[M], m[B]); - }) : n != null && p.sort(function(M, B) { - return n(l[M], l[B]); - }), o = 0, h = c ? (_ - u * C) / c : 0; o < u; ++o, $ = x) - f = p[o], S = m[f], x = $ + (S > 0 ? S * h : 0) + C, m[f] = { - data: l[f], - index: o, - value: S, +function is() { + var e = Ud, t = Wd, n = null, r = Ve(0), i = Ve(wi), s = Ve(0); + function a(o) { + var l, u = (o = Xd(o)).length, f, h, c = 0, p = new Array(u), m = new Array(u), $ = +r.apply(this, arguments), _ = Math.min(wi, Math.max(-wi, i.apply(this, arguments) - $)), x, F = Math.min(Math.abs(_) / u, s.apply(this, arguments)), S = F * (_ < 0 ? -1 : 1), M; + for (l = 0; l < u; ++l) + (M = m[p[l] = l] = +e(o[l], l, o)) > 0 && (c += M); + for (t != null ? p.sort(function(D, W) { + return t(m[D], m[W]); + }) : n != null && p.sort(function(D, W) { + return n(o[D], o[W]); + }), l = 0, h = c ? (_ - u * S) / c : 0; l < u; ++l, $ = x) + f = p[l], M = m[f], x = $ + (M > 0 ? M * h : 0) + S, m[f] = { + data: o[f], + index: l, + value: M, startAngle: $, endAngle: x, - padAngle: D + padAngle: F }; return m; } - return a.value = function(l) { - return arguments.length ? (e = typeof l == "function" ? l : Ie(+l), a) : e; - }, a.sortValues = function(l) { - return arguments.length ? (t = l, n = null, a) : t; - }, a.sort = function(l) { - return arguments.length ? (n = l, t = null, a) : n; - }, a.startAngle = function(l) { - return arguments.length ? (r = typeof l == "function" ? l : Ie(+l), a) : r; - }, a.endAngle = function(l) { - return arguments.length ? (i = typeof l == "function" ? l : Ie(+l), a) : i; - }, a.padAngle = function(l) { - return arguments.length ? (s = typeof l == "function" ? l : Ie(+l), a) : s; + return a.value = function(o) { + return arguments.length ? (e = typeof o == "function" ? o : Ve(+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 : Ve(+o), a) : r; + }, a.endAngle = function(o) { + return arguments.length ? (i = typeof o == "function" ? o : Ve(+o), a) : i; + }, a.padAngle = function(o) { + return arguments.length ? (s = typeof o == "function" ? o : Ve(+o), a) : s; }, a; } -function Dr(e, t, n) { +function Mr(e, t, n) { this.k = e, this.x = t, this.y = n; } -Dr.prototype = { - constructor: Dr, +Mr.prototype = { + constructor: Mr, scale: function(e) { - return e === 1 ? this : new Dr(this.k * e, this.x, this.y); + return e === 1 ? this : new Mr(this.k * e, this.x, this.y); }, translate: function(e, t) { - return e === 0 & t === 0 ? this : new Dr(this.k, this.x + this.k * e, this.y + this.k * t); + return e === 0 & t === 0 ? this : new Mr(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,8 +4838,8 @@ Dr.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Dr.prototype; -var Gd = /* @__PURE__ */ Xu(''); +Mr.prototype; +var Gd = /* @__PURE__ */ Bu(''); const Kd = { 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;} @@ -4847,148 +4847,148 @@ const Kd = { @media (max-width: 768px) {.pie-chart-svg.svelte-80ulj4 {max-height:60vh;} }` }; -function mo(e, t) { - Oi(t, !0), Hs(e, Kd); - let n = fe(t, "jsonData", 7), r = fe(t, "currentRound", 7, 1), i = fe(t, "mouseEventType", 15), s = fe(t, "mouseData", 15), a = fe(t, "mouseX", 15), l = fe(t, "mouseY", 15), o = fe(t, "requestRoundChange", 7, (d) => { +function ml(e, t) { + qi(t, !0), Vs(e, Kd); + let n = fe(t, "jsonData", 7), r = fe(t, "currentRound", 7, 1), i = fe(t, "mouseEventType", 15), s = fe(t, "mouseData", 15), a = fe(t, "mouseX", 15), o = fe(t, "mouseY", 15), l = fe(t, "requestRoundChange", 7, (d) => { }), u = fe(t, "candidateColors", 23, () => []), f = fe(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = fe(t, "firstRoundDeterminesPercentages", 7, !1), c = fe(t, "displayPhase", 15, 0); function p(d) { return d.isTransfer ? `${d.label}__transfer` : d.transferIndex != null ? `${d.label}__${d.transferIndex}` : d.label; } - const m = 800, $ = 800, _ = Math.min(m, $) * 0.3, x = m / 2, D = $ / 2, C = "Pie", S = "PieOutline", M = "Donut", B = "TextLayer", j = "url(#cross-hatch)", Q = 1.15, ce = 0.1, X = 750, ae = 800, le = "white", T = 1, q = "#ff00ff", Le = 3; - function st(d) { + const m = 800, $ = 800, _ = Math.min(m, $) * 0.3, x = m / 2, F = $ / 2, S = "Pie", M = "PieOutline", D = "Donut", W = "TextLayer", K = "url(#cross-hatch)", Q = 1.15, ee = 750, J = 800, ae = "white", oe = 1, N = "#ff00ff", H = 3; + function Ie(d) { return "hatch-" + d.replace(/[^a-zA-Z0-9]/g, "-"); } - let de = [], Ee = [], ee = [], Pe = 0, W = 0; - const Ne = {}, Ht = "No Further Rankings"; - let ne = /* @__PURE__ */ $e(null); - function qe() { - const d = he(b(ne)); - d.select("#" + C).remove(), d.select("#" + S).remove(), d.select("#" + M).remove(), d.select("#" + B).remove(); + let Me = [], xe = [], ce = [], le = 0, z = 0; + const Fe = {}, _t = "No Further Rankings"; + let ne = /* @__PURE__ */ Ee(null); + function bn() { + const d = ue(b(ne)); + d.select("#" + S).remove(), d.select("#" + M).remove(), d.select("#" + D).remove(), d.select("#" + W).remove(); } - function $t(d) { - o() && (oe = d, o()(d)); + function Oe(d) { + l() && (me = d, l()(d)); } - function At(d) { - qe(), ee = Yt(d), de = Zs(d, C, ee, x, D, 0, we()), Zs(d, S, ee, x, D, 0, we(), !1, !1, !0), Rr(); + function ot(d) { + bn(), ce = $n(d), Me = Zs(d, S, ce, x, F, 0, we()), Zs(d, M, ce, x, F, 0, we(), !1, !1, !0), Er(); } ju(() => { - Ve(), setTimeout( + ie(), setTimeout( () => { - At(r()); + ot(r()); }, 0 ); }); - function Yt(d) { - const g = _e(d); - return Pe = br(d), g; + function $n(d) { + const g = te(d); + return le = Kn(d), g; } function we() { return _; } - function zt() { + function mt() { return we() * 1.41; } - function cn(d) { + function Ht(d) { let g = 0; for (let y = 1; y < d; y++) { const E = n().results[y - 1].tallyResults; for (let A = 0; A < E.length; A++) { - const N = E[A].transfers; - if (N) { - const I = N.exhausted; + const R = E[A].transfers; + if (R) { + const I = R.exhausted; I && (g += Number(I)); } } } return g; } - function Zr(d, g) { - if (d === "exhausted") return cn(g); + function An(d, g) { + if (d === "exhausted") return Ht(g); { const y = n().results[g - 1].tally; return Number(y[d]); } } - function Wi(d, g) { - return Zr(d, g).toLocaleString("en-US"); + function jr(d, g) { + return An(d, g).toLocaleString("en-US"); } - function Un(d, g) { - const y = h() ? Pe : Ui(g); - return (Zr(d, g) / y).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Jr(d, g) { + const y = h() ? le : Gi(g); + return (An(d, g) / y).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function br(d) { + function Kn(d) { const g = n().results[d - 1].tally; let y = 0; for (let [E, A] of Object.entries(g)) y += Number(A); return y; } - function $r(d) { + function un(d) { return d === "exhausted" || d === "Inactive Ballots"; } - function Ui(d) { + function Gi(d) { const g = n().results[d - 1].tally; let y = 0; for (let [E, A] of Object.entries(g)) - $r(E) || (y += Number(A)); + un(E) || (y += Number(A)); return y; } - function Gn(d, g) { + function Zr(d, g) { if (!d || d < 1 || d > n().results.length) return console.warn("In chosenCandidates: round ${round} is out of range."), []; if (f() && d === n().results.length) return []; const y = n().results[d - 1].tallyResults, E = []; for (let A = 0; A < y.length; A++) { - const N = y[A][g]; - N != null && E.push(N); + const R = y[A][g]; + R != null && E.push(R); } return E; } - function Kn(d) { - return Gn(d, "eliminated"); + function fn(d) { + return Zr(d, "eliminated"); } - function w(d) { + function br(d) { let g = []; - for (let y = 1; y <= d; y++) g = g.concat(Gn(y, "elected")); + for (let y = 1; y <= d; y++) g = g.concat(Zr(y, "elected")); return [...new Set(g)]; } - function V(d, g) { + function w(d, g) { const y = n().results[g - 1].tallyResults; let E = 0; - const A = y.findIndex((N) => (N == null ? void 0 : N.elected) && d == N.elected); + const A = y.findIndex((R) => (R == null ? void 0 : R.elected) && d == R.elected); if (A >= 0) { - const N = y[A].transfers; - if (N) - for (let [I, H] of Object.entries(N)) E += Number(H); + const R = y[A].transfers; + if (R) + for (let [I, q] of Object.entries(R)) E += Number(q); } else return 0; return E; } - function Z(d, g) { - d.some((y) => $r(y.label)) || d.push({ label: "exhausted", value: cn(g) }); + function Y(d, g) { + d.some((y) => un(y.label)) || d.push({ label: "exhausted", value: Ht(g) }); } - function _e(d) { + function te(d) { const g = []; for (let [y, E] of Object.entries(n().results[d - 1].tally)) g.push({ label: y, value: Number(E) }); - return Z(g, d), g; + return Y(g, d), g; } - function xe(d) { + function ve(d) { const g = n().results[Math.max(0, d - 2)].tally, y = n().results[d - 1].tally, E = []; for (let [A] of Object.entries(g)) E.push({ label: A, value: Number(y[A] ?? 0) }); - return Z(E, d), E; + return Y(E, d), E; } - function ie(d, g) { + function be(d, g) { const y = []; for (const E of d) { if (E.label === "exhausted" || E.isTransfer) { y.push(E); continue; } - const A = V(E.label, g); + const A = w(E.label, g); A > 0 ? (y.push({ label: E.label, value: A, @@ -4997,49 +4997,49 @@ function mo(e, t) { } return y; } - function Ve() { - const d = he(b(ne)).select("defs").select("#cross-hatch"); + function ie() { + const d = ue(b(ne)).select("defs").select("#cross-hatch"); let g = 0; for (let [y, E] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? g < 10 ? Ne[y] = Id[g] : Ne[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ne[y] = u()[g % u().length], g++; + !u() || u().length === 0 ? g < 10 ? Fe[y] = Id[g] : Fe[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Fe[y] = u()[g % u().length], g++; { const A = d.clone(!0); - A.attr("id", st(y)).select("rect").attr("fill", Ne[y]), A.selectAll("circle").attr("fill", "#383838"); + A.attr("id", Ie(y)).select("rect").attr("fill", Fe[y]), A.selectAll("circle").attr("fill", "#383838"); } } - Ne.exhausted = j, Ne["Inactive Ballots"] = j; + Fe.exhausted = K, Fe["Inactive Ballots"] = K; } - function Xt() { - he(b(ne)).select("#" + M).remove(); + function ze() { + ue(b(ne)).select("#" + D).remove(); } - function Ge(d, g) { - const y = _i("global").duration(ae); + function lt(d, g) { + const y = yi("global").duration(J); g && y.on("end", g); - const E = ie(ee, d), N = ss().sort(null).value((I) => I.value)(E); - na(d, C, N, 0, we()), na(d, S, N, 0, we(), !0), ee = E, de = N, Xt(), Ut(d), Eo(), Ro(0, we()), Rr(); + const E = be(ce, d), R = is().sort(null).value((I) => I.value)(E); + na(d, S, R, 0, we()), na(d, M, R, 0, we(), !0), ce = E, Me = R, ze(), Xt(d), El(), Rl(0, we()), Er(); } - function dt(d, g) { - const y = _i("global").duration(ae); - g && y.on("end", g), Gi(d); + function Be(d, g) { + const y = yi("global").duration(J); + g && y.on("end", g), Wt(d); } - function Ke(d, g) { - const y = _i("global").duration(ae); - g && y.on("end", g), Er(d), Wt(we(), zt()); + function ut(d, g) { + const y = yi("global").duration(J); + g && y.on("end", g), $r(d), Ar(we(), mt()); } - let te = !1, ke = []; - function me() { - Rr(), te = !1, pt(); + let ge = !1, _e = []; + function $e() { + Er(), ge = !1, Le(); } - function pt() { - if (ke.length === 0) { - oe !== r() && (r() === oe + 1 && oe > 0 && r() <= n().results.length ? (oe = r(), $n(r())) : r() >= 1 && r() <= n().results.length && (oe = r(), c(0), At(r()))); + function Le() { + if (_e.length === 0) { + me !== r() && (r() === me + 1 && me > 0 && r() <= n().results.length ? (me = r(), Yt(r())) : r() >= 1 && r() <= n().results.length && (me = r(), c(0), ot(r()))); return; } - const d = ke.shift(); + const d = _e.shift(); switch (d.type) { case "round": { const g = d.round; - g === oe + 1 && oe > 0 && g <= n().results.length ? (oe = g, $n(g)) : (g !== oe && g >= 1 && g <= n().results.length && (oe = g, c(0), At(g)), pt()); + g === me + 1 && me > 0 && g <= n().results.length ? (me = g, Yt(g)) : (g !== me && g >= 1 && g <= n().results.length && (me = g, c(0), ot(g)), Le()); break; } case "step": @@ -5047,152 +5047,152 @@ function mo(e, t) { break; } } - function $n(d) { + function Yt(d) { if (d <= 1 || d > n().results.length) { - pt(); + Le(); return; } - te = !0, W = d, c(0), Ge(W - 1, () => { - c(1), dt(W - 1, () => { - c(2), Ke(W, () => { - c(0), me(); + ge = !0, z = d, c(0), lt(z - 1, () => { + c(1), Be(z - 1, () => { + c(2), ut(z, () => { + c(0), $e(); }); }); }); } function jn() { - te || (te = !0, W = r(), An()); + ge || (ge = !0, z = r(), En()); } - function An() { + function En() { if (c( 0 // if in the middle of "one small step" animation, reset to 0. - ), ke.length > 0) { - me(); + ), _e.length > 0) { + $e(); return; } - const d = W < n().results.length - 1 ? An : () => { - c(0), me(); + const d = z < n().results.length - 1 ? En : () => { + c(0), $e(); }; - Ge(W, () => { - c(1), dt(W, () => { - c(2), W++, $t(W), Ke(W, d); + lt(z, () => { + c(1), Be(z, () => { + c(2), z++, Oe(z), ut(z, d); }); }); } - Fs(() => { - Bt(); + Is(() => { + zt(); }); - let oe = 0; - function Bt() { - if (oe != r()) { - if (te) { - ke.push({ type: "round", round: r() }); + let me = 0; + function zt() { + if (me != r()) { + if (ge) { + _e.push({ type: "round", round: r() }); return; } - oe == r() - 1 && oe > 0 ? Ar() : Jn(r()), oe = r(); + me == r() - 1 && me > 0 ? Jn() : Bt(r()), me = r(); } } - function Jn(d) { - if (te) { - ke.push({ type: "round", round: d }); + function Bt(d) { + if (ge) { + _e.push({ type: "round", round: d }); return; } - c(0), At(d); + c(0), ot(d); } - function Ar() { - if (te) { - ke.push({ type: "round", round: r() }); + function Jn() { + if (ge) { + _e.push({ type: "round", round: r() }); return; } if (r() <= 1) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (W = r(), W > n().results.length) { - Rr(), te = !1; + if (z = r(), z > n().results.length) { + Er(), ge = !1; return; } - te = !0, c() === 0 ? Ge(W - 1, () => { - c(1), dt(W - 1, () => { - c(2), Ke(W, () => { - c(0), me(); + ge = !0, c() === 0 ? lt(z - 1, () => { + c(1), Be(z - 1, () => { + c(2), ut(z, () => { + c(0), $e(); }); }); - }) : c() === 1 ? dt(W - 1, () => { - c(2), Ke(W, () => { - c(0), me(); + }) : c() === 1 ? Be(z - 1, () => { + c(2), ut(z, () => { + c(0), $e(); }); - }) : c() === 2 && Ke(W, () => { - c(0), me(); + }) : c() === 2 && ut(z, () => { + c(0), $e(); }); } function Zn() { if (r() > n().results.length) { - Rr(), te = !1; + Er(), ge = !1; return; } - if (te) { - ke.push({ type: "step" }); + if (ge) { + _e.push({ type: "step" }); return; } - te = !0, W = r(), c() === 0 ? Ge(W, () => { - c(1), me(); - }) : c() === 1 ? dt(W, () => { - c(2), me(); - }) : c() === 2 ? (W++, $t(W), Ke(W, () => { - c(0), me(); - })) : (te = !1, console.warn("displayPhase out of range at ", c())); - } - function Er(d) { - ee = xe(d), de = ea(d, C, ee, 0, we(), !0), ea(d, S, ee, 0, we(), !1, !0), he(b(ne)).select("#" + S).selectAll(".eliminated").remove(); - } - function Wt(d, g) { - const y = he(b(ne)).select("#" + M), A = he(b(ne)).select("#" + C), N = {}; - for (const k of de) { - const P = k.data.label; - if (k.data.isTransfer) continue; - const R = A.select("#" + CSS.escape(p(k.data))); - R.empty() || (N[P] = { - oldStart: Number(R.attr("prevStart")), - oldEnd: Number(R.attr("prevEnd")), - newStart: k.startAngle, - newEnd: k.endAngle + ge = !0, z = r(), c() === 0 ? lt(z, () => { + c(1), $e(); + }) : c() === 1 ? Be(z, () => { + c(2), $e(); + }) : c() === 2 ? (z++, Oe(z), ut(z, () => { + c(0), $e(); + })) : (ge = !1, console.warn("displayPhase out of range at ", c())); + } + function $r(d) { + ce = ve(d), Me = ea(d, S, ce, 0, we(), !0), ea(d, M, ce, 0, we(), !1, !0), ue(b(ne)).select("#" + M).selectAll(".eliminated").remove(); + } + function Ar(d, g) { + const y = ue(b(ne)).select("#" + D), A = ue(b(ne)).select("#" + S), R = {}; + for (const P of Me) { + const k = P.data.label; + if (P.data.isTransfer) continue; + const T = A.select("#" + CSS.escape(p(P.data))); + T.empty() || (R[k] = { + oldStart: Number(T.attr("prevStart")), + oldEnd: Number(T.attr("prevEnd")), + newStart: P.startAngle, + newEnd: P.endAngle }); } const I = y.selectAll(".slice"); - let H = I.size(); + let q = I.size(); function O() { - H--, H === 0 && To(); + q--, q === 0 && Tl(); } - I.select("path").transition("global").duration(X).attrTween("d", function(k) { - const P = k.startAngle, R = k.endAngle, U = R - P, je = N[k.data.label]; - let re, Et; - if (je) { - const Qn = (je.oldStart + je.oldEnd) / 2, ko = (je.newStart + je.newEnd) / 2, Mo = P - Qn; - re = ko + Mo, Et = re + U; + I.select("path").transition("global").duration(ee).attrTween("d", function(P) { + const k = P.startAngle, T = P.endAngle, C = T - k, Pe = R[P.data.label]; + let Z, Xe; + if (Pe) { + const Qn = (Pe.oldStart + Pe.oldEnd) / 2, kl = (Pe.newStart + Pe.newEnd) / 2, Ml = k - Qn; + Z = kl + Ml, Xe = Z + C; } else - re = P, Et = R; - const ue = jt(P, re), Tt = jt(R, Et), Gt = jt(g, d), Cr = Ct(); + Z = k, Xe = T; + const re = Gt(k, Z), Re = Gt(T, Xe), ei = Gt(g, d), Tr = yt(); return function(Qn) { - return Cr.innerRadius(Math.min(Gt(Qn), d) - 1).outerRadius(Gt(Qn)).startAngle(ue(Qn)).endAngle(Tt(Qn)), Cr(k); + return Tr.innerRadius(Math.min(ei(Qn), d) - 1).outerRadius(ei(Qn)).startAngle(re(Qn)).endAngle(Re(Qn)), Tr(P); }; - }).on("end", (k) => O()); + }).on("end", (P) => O()); } - function Ut(d) { - const g = xo(d, de); - Ee = Qs(d, M, g, x, D, we(), zt(), !1, !0); - const y = he(b(ne)); - y.select("#" + C).raise(), y.select("#" + S).raise(); + function Xt(d) { + const g = xl(d, Me); + xe = Qs(d, D, g, x, F, we(), mt(), !1, !0); + const y = ue(b(ne)); + y.select("#" + S).raise(), y.select("#" + M).raise(); } - function Gi(d) { - const g = $o(d, Ee, de); - Ee = ra(d, M, g, we(), zt(), !1); + function Wt(d) { + const g = $l(d, xe, Me); + xe = ra(d, D, g, we(), mt(), !1); } - function Tr(d) { - return Ne[d.data.label]; + function Tn(d) { + return Fe[d.data.label]; } - function wo(d) { + function wl(d) { const g = {}, y = n().results[d - 1].tallyResults; for (let E = 0; E < y.length; E++) { let A = y[E].eliminated; @@ -5200,210 +5200,235 @@ function mo(e, t) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const N = y[E].transfers; - if (N === void 0) { + const R = y[E].transfers; + if (R === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [I, H] of Object.entries(N)) - g[I] === void 0 ? g[I] = Number(H) : g[I] += Number(H); + for (let [I, q] of Object.entries(R)) + g[I] === void 0 ? g[I] = Number(q) : g[I] += Number(q); } return g; } - function xo(d, g) { - const y = [], E = Pe, A = n().results[d - 1].tallyResults; - for (let N = 0; N < A.length; N++) { - let I = A[N].eliminated; - if (I === void 0 && (I = A[N].elected), I === void 0) { + function xl(d, g) { + const y = [], E = le, A = n().results[d - 1].tallyResults; + for (let R = 0; R < A.length; R++) { + let I = A[R].eliminated; + if (I === void 0 && (I = A[R].elected), I === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const H = A[N].transfers; - if (H === void 0) { + const q = A[R].transfers; + if (q === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let O = g.find((P) => P.data.label == I && P.data.isTransfer); - O === void 0 && (O = g.find((P) => P.data.label == I && !P.data.isTransfer)); - let k = 0; - if (O) k = O.startAngle; + let O = g.find((k) => k.data.label == I && k.data.isTransfer); + O === void 0 && (O = g.find((k) => k.data.label == I && !k.data.isTransfer)); + let P = 0; + if (O) P = O.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [P, R] of Object.entries(H)) { - let U; - const je = g.find((ue) => ue.data.label == P); - if (je) - U = structuredClone(je); - else if (P == "exhausted") - U = { - data: { label: P, value: Number(R) }, + for (let [k, T] of Object.entries(q)) { + let C; + const Pe = g.find((re) => re.data.label == k); + if (Pe) + C = structuredClone(Pe); + else if (k == "exhausted") + C = { + data: { label: k, value: Number(T) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (P == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", R); + else if (k == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", T); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", P); + console.warn("makeDonutInfo: unrecognized name in transfers ", k); continue; } - const Et = Number(R) / E * 2 * Math.PI; - U.startAngle = k, k = U.endAngle = k + Et, U.index = N, U.data.transferIndex = N, y.push(U); + const Xe = Number(T) / E * 2 * Math.PI; + C.startAngle = P, P = C.endAngle = P + Xe, C.index = R, C.data.transferIndex = R, y.push(C); } } return y; } - function bo(d, g, y) { + function bl(d, g, y) { const E = {}; - for (let [A, N] of Object.entries(d)) { - const I = y.find((k) => A == k.data.label); + for (let [A, R] of Object.entries(d)) { + const I = y.find((P) => A == P.data.label); if (I === void 0) { console.warn("getTransferStartAngles: mainPieObj not found for ", A); continue; } - const H = (I.startAngle + I.endAngle) / 2, O = d[I.data.label] / g * 2 * Math.PI; - E[I.data.label] = H - O / 2; + const q = (I.startAngle + I.endAngle) / 2, O = d[I.data.label] / g * 2 * Math.PI; + E[I.data.label] = q - O / 2; } return E; } - function $o(d, g, y) { - const E = [], A = Pe, N = wo(d), I = bo(N, A, y); - for (let [H, O] of g.entries()) { - const k = structuredClone(O), P = O.endAngle - O.startAngle, R = y.find((U) => O.data.label === U.data.label && !U.data.isTransfer); - if (R) { - const U = R.data.label; - k.startAngle = I[U], I[U] += P, k.endAngle = k.startAngle + P; + function $l(d, g, y) { + const E = [], A = le, R = wl(d), I = bl(R, A, y); + for (let [q, O] of g.entries()) { + const P = structuredClone(O), k = O.endAngle - O.startAngle, T = y.find((C) => O.data.label === C.data.label && !C.data.isTransfer); + if (T) { + const C = T.data.label; + P.startAngle = I[C], I[C] += k, P.endAngle = P.startAngle + k; } else if (O.data.label === "exhausted") - k.startAngle = O.startAngle, k.endAngle = O.endAngle; + P.startAngle = O.startAngle, P.endAngle = O.endAngle; else { console.warn("updateDonutInfo: unrecognized slice name ", O.data.label); continue; } - k.index = H, E.push(k); + P.index = q, E.push(P); } return E; } - function Js(d, g, y, E, A, N) { - const H = he(b(ne)).append("g").attr("id", B).attr("transform", `translate(${y}, ${E})`), O = Ct().innerRadius(A * Q).outerRadius(A * Q); - H.selectAll("text").data(g).enter().each(function(k) { - k.endAngle - k.startAngle < ce || k.data.isTransfer || he(this).append("g").attr("id", (P) => p(P.data)).classed("eliminated", (P) => N.includes(P.data.label) || P.data.isTransfer === !0).each(function(P, R) { - P.data.label === "exhausted" && he(this).on("mouseenter", (U, je) => Co(U)).on("mouseleave", (U, je) => So()); - }).append("text").attr("transform", (P) => `translate(${O.centroid(P)})`).attr("text-anchor", (P) => Ki(P.startAngle, P.endAngle)).text((P) => P.data.label === "exhausted" ? Ht : P.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((P) => { - const R = Wi(P.data.label, d); - return !h() && $r(P.data.label) ? R : R + " (" + Un(P.data.label, d) + ")"; + function js(d, g, y, E) { + const A = yt().innerRadius(y * Q).outerRadius(y * Q), R = g.filter((k) => !k.data.isTransfer && k.data.value > 0), I = [], q = E.append("g").attr("opacity", 0); + for (const k of R) { + const T = k.data.label === "exhausted" ? _t : k.data.label, C = A.centroid(k), Pe = Qr(k.startAngle, k.endAngle), Z = jr(k.data.label, d); + let Xe; + !h() && un(k.data.label) ? Xe = Z : Xe = Z + " (" + Jr(k.data.label, d) + ")"; + const re = q.append("text").attr("transform", `translate(${C})`).attr("text-anchor", Pe).text(T); + re.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Xe); + const Re = re.node().getBBox(); + I.push({ + label: k.data.label, + value: k.data.value, + bbox: new DOMRect(Re.x + C[0], Re.y + C[1], Re.width, Re.height) + }); + } + q.remove(), I.sort((k, T) => T.value - k.value); + const O = [], P = /* @__PURE__ */ new Set(); + for (const k of I) + O.some((C) => k.bbox.left < C.right && k.bbox.right > C.left && k.bbox.top < C.bottom && k.bbox.bottom > C.top) || (P.add(k.label), O.push(k.bbox)); + return P; + } + function Js(d, g, y, E, A, R) { + const q = ue(b(ne)).append("g").attr("id", W).attr("transform", `translate(${y}, ${E})`), O = yt().innerRadius(A * Q).outerRadius(A * Q), P = js(d, g, A, q); + q.selectAll("text").data(g).enter().each(function(k) { + !k.data.isTransfer && P.has(k.data.label) && ue(this).append("g").attr("id", (T) => p(T.data)).classed("eliminated", (T) => R.includes(T.data.label) || T.data.isTransfer === !0).each(function(T, C) { + T.data.label === "exhausted" && ue(this).on("mouseenter", (Pe, Z) => Cl(Pe)).on("mouseleave", (Pe, Z) => Sl()); + }).append("text").attr("transform", (T) => `translate(${O.centroid(T)})`).attr("text-anchor", (T) => Qr(T.startAngle, T.endAngle)).text((T) => T.data.label === "exhausted" ? _t : T.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((T) => { + const C = jr(T.data.label, d); + return !h() && un(T.data.label) ? C : C + " (" + Jr(T.data.label, d) + ")"; }); }); } - function Ao(d, g, y, E) { - const N = he(b(ne)).select("#" + B), I = N.selectAll("tspan"), H = N.selectAll("g").data(g, (R) => p(R.data)).classed("eliminated", (R) => E.includes(R.data.label) || R.data.isTransfer === !0), O = Ct().innerRadius(y * Q).outerRadius(y * Q + 1); - I.transition("global").duration(X).attr("transform", (R) => `translate(${O.centroid(R)})`).attr("text-anchor", (R) => Ki(R.startAngle, R.endAngle)), H.select("text").transition("global").duration(X).attr("transform", (R) => `translate(${O.centroid(R)})`).attr("text-anchor", (R) => Ki(R.startAngle, R.endAngle)).on("end", (R) => P()); - let k = H.size(); - function P(R) { - k--, k === 0 && (N.remove(), Js(d, g, x, D, y, E)); + function Al(d, g, y, E) { + const R = ue(b(ne)).select("#" + W), I = js(d, g, y, R); + R.selectAll("g").each(function(C) { + C && C.data && !C.data.isTransfer && !I.has(C.data.label) && ue(this).remove(); + }); + const q = R.selectAll("tspan"), O = R.selectAll("g").data(g, (C) => p(C.data)).classed("eliminated", (C) => E.includes(C.data.label) || C.data.isTransfer === !0), P = yt().innerRadius(y * Q).outerRadius(y * Q + 1); + q.transition("global").duration(ee).attr("transform", (C) => `translate(${P.centroid(C)})`).attr("text-anchor", (C) => Qr(C.startAngle, C.endAngle)), O.select("text").transition("global").duration(ee).attr("transform", (C) => `translate(${P.centroid(C)})`).attr("text-anchor", (C) => Qr(C.startAngle, C.endAngle)).on("end", (C) => T()); + let k = O.size(); + function T(C) { + k--, k === 0 && (R.remove(), Js(d, g, x, F, y, E)); } } - function Zs(d, g, y, E, A, N, I, H = !0, O = !1, k = !1) { - const R = ss().sort(null).value((U) => U.value)(y); - return Qs(d, g, R, E, A, N, I, H, O, k), R; + function Zs(d, g, y, E, A, R, I, q = !0, O = !1, P = !1) { + const T = is().sort(null).value((C) => C.value)(y); + return Qs(d, g, T, E, A, R, I, q, O, P), T; } - function Rr() { - he(b(ne)).select("#" + S).selectAll(".elected").select("path").style("stroke", q).style("stroke-width", `${Le}px`); + function Er() { + ue(b(ne)).select("#" + M).selectAll(".elected").select("path").style("stroke", N).style("stroke-width", `${H}px`); } - function Qs(d, g, y, E, A, N, I, H, O, k = !1) { - const P = Kn(d), R = w(d), re = he(b(ne)).attr("viewBox", `0 0 ${m} ${$}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${E}, ${A})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (ue) => P.includes(ue.data.label) || ue.data.isTransfer === !0).classed("elected", (ue) => R.includes(ue.data.label) && !ue.data.isTransfer).attr("id", (ue) => p(ue.data)); - k ? re.style("pointer-events", "none") : re.on("mouseenter", (ue, Tt) => Ji(ue, Tt)).on("mouseleave", (ue, Tt) => Zi(ue, Tt)); - const Et = Ct().outerRadius(I).innerRadius(N); + function Qs(d, g, y, E, A, R, I, q, O, P = !1) { + const k = fn(d), T = br(d), Z = ue(b(ne)).attr("viewBox", `0 0 ${m} ${$}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${E}, ${A})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (re) => k.includes(re.data.label) || re.data.isTransfer === !0).classed("elected", (re) => T.includes(re.data.label) && !re.data.isTransfer).attr("id", (re) => p(re.data)); + P ? Z.style("pointer-events", "none") : Z.on("mouseenter", (re, Re) => ji(re, Re)).on("mouseleave", (re, Re) => Ji(re, Re)); + const Xe = yt().outerRadius(I).innerRadius(R); if (O) { - const ue = Ct().outerRadius(N + 1).innerRadius(N), Tt = re.append("path").attr("d", ue).attr("stroke", k ? "none" : le).attr("stroke-width", k ? 0 : T).attr("fill", "none").transition("global").duration(X).attr("d", (Gt) => Et(Gt)).on("end", (Gt) => { - k || ji(); + const re = yt().outerRadius(R + 1).innerRadius(R); + Z.append("path").attr("d", re).attr("stroke", P ? "none" : R === 0 ? ae : "none").attr("stroke-width", P ? 0 : R === 0 ? oe : 0).attr("fill", P ? "none" : (Re) => Tn(Re)).transition("global").duration(ee).attr("d", (Re) => Xe(Re)).on("end", (Re) => { + P || Ki(); }); - k ? Tt.attr("fill", "none") : Tt.attr("fill", (Gt) => Tr(Gt)); } else - re.append("path").attr("d", (ue) => Et(ue)).attr("fill", k ? "none" : (ue) => Tr(ue)).attr("stroke", k ? "none" : le).attr("stroke-width", k ? 0 : T), k || ji(); - return H && !k && Js(d, y, E, A, I, P), y; + Z.append("path").attr("d", (re) => Xe(re)).attr("fill", P ? "none" : (re) => Tn(re)).attr("stroke", P ? "none" : ae).attr("stroke-width", P ? 0 : oe), P || Ki(); + return q && !P && Js(d, y, E, A, I, k), y; } - function Eo() { - const y = he(b(ne)).select("#" + B).selectAll(".eliminated"); + function El() { + const y = ue(b(ne)).select("#" + W).selectAll(".eliminated"); y.size() > 0 && y.classed("finished", !0); } - function To() { - const y = he(b(ne)).select("#" + B).selectAll(".finished"); + function Tl() { + const y = ue(b(ne)).select("#" + W).selectAll(".finished"); y.size() > 0 && y.remove(); } - function Ro(d, g) { - const A = he(b(ne)).select("#" + C).selectAll(".eliminated"), N = Ct().innerRadius(d), I = Ct().outerRadius(g); - A.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(X).attrTween("d", function(H) { - const O = jt(g, d); - return function(k) { - return I.innerRadius(O(k)), I(H); + function Rl(d, g) { + const A = ue(b(ne)).select("#" + S).selectAll(".eliminated"), R = yt().innerRadius(d), I = yt().outerRadius(g); + A.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(ee).attrTween("d", function(q) { + const O = Gt(g, d); + return function(P) { + return I.innerRadius(O(P)), I(q); }; - }).attr("fill", (H) => `url(#${st(H.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(X).attrTween("d", function(H) { - const O = jt(g, d); - return function(k) { - return N.outerRadius(O(k)), N(H); + }).attr("fill", (q) => `url(#${Ie(q.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(ee).attrTween("d", function(q) { + const O = Gt(g, d); + return function(P) { + return R.outerRadius(O(P)), R(q); }; - }).attr("fill", (H) => Tr(H)); + }).attr("fill", (q) => Tn(q)); } - function Ki(d, g) { + function Qr(d, g) { const y = (d + g) / 2; return y > Math.PI * 11 / 6 || y < Math.PI * 1 / 6 || y > Math.PI * 5 / 6 && y < Math.PI * 7 / 6 ? "middle" : y < Math.PI ? "start" : "end"; } - function ji() { - he(b( + function Ki() { + ue(b( ne // force redisplay of text labels - )).select("#" + B).raise().append("g").remove(); + )).select("#" + W).raise().append("g").remove(); } - function ea(d, g, y, E, A, N, I = !1) { - const O = ss().sort(null).value((k) => k.value)(y); - return ra(d, g, O, E, A, N, I), O; + function ea(d, g, y, E, A, R, I = !1) { + const O = is().sort(null).value((P) => P.value)(y); + return ra(d, g, O, E, A, R, I), O; } function ta(d, g, y, E, A = !1) { - const N = Kn(d), I = w(d), k = he(b(ne)).select("#" + g).selectAll(".slice").data(y, (R) => p(R.data)), P = k.enter().append("g").attr("class", "slice").attr("id", (R) => p(R.data)).classed("eliminated", !0); - return A ? P.style("pointer-events", "none") : P.on("mouseenter", (R, U) => Ji(R, U)).on("mouseleave", (R, U) => Zi(R, U)), P.append("path").attr("d", (R) => E(R)).attr("fill", A ? "none" : (R) => Tr(R)).attr("stroke", A ? "none" : le).attr("stroke-width", A ? 0 : T), k.classed("eliminated", (R) => N.includes(R.data.label)).classed("elected", (R) => I.includes(R.data.label)), A || k.on("mouseenter", (R, U) => Ji(R, U)).on("mouseleave", (R, U) => Zi(R, U)), k; - } - function na(d, g, y, E, A, N = !1) { - const I = Ct().outerRadius(A).innerRadius(E); - ta(d, g, y, I, N).select("path").attr("d", (O) => I(O)).attr("fill", N ? "none" : (O) => Tr(O)); - } - function ra(d, g, y, E, A, N, I = !1) { - const H = Ct().outerRadius(A).innerRadius(E).startAngle((re) => re.startAngle).endAngle((re) => re.endAngle), O = Ct().outerRadius(A).innerRadius(E), P = he(b(ne)).select("#" + g); - P.selectAll(".slice").attr("prevStart", (re) => re.startAngle).attr("prevEnd", (re) => re.endAngle); - const R = ta(d, g, y, O, I); - let U = R.size(); - function je() { - U--, U <= 0 && (I || ji(), P.selectAll(".finished").remove()); + const R = fn(d), I = br(d), P = ue(b(ne)).select("#" + g).selectAll(".slice").data(y, (T) => p(T.data)), k = P.enter().append("g").attr("class", "slice").attr("id", (T) => p(T.data)).classed("eliminated", !0); + return A ? k.style("pointer-events", "none") : k.on("mouseenter", (T, C) => ji(T, C)).on("mouseleave", (T, C) => Ji(T, C)), k.append("path").attr("d", (T) => E(T)).attr("fill", A ? "none" : (T) => Tn(T)).attr("stroke", A ? "none" : ae).attr("stroke-width", A ? 0 : oe), P.classed("eliminated", (T) => R.includes(T.data.label)).classed("elected", (T) => I.includes(T.data.label)), A || P.on("mouseenter", (T, C) => ji(T, C)).on("mouseleave", (T, C) => Ji(T, C)), P; + } + function na(d, g, y, E, A, R = !1) { + const I = yt().outerRadius(A).innerRadius(E); + ta(d, g, y, I, R).select("path").attr("d", (O) => I(O)).attr("fill", R ? "none" : (O) => Tn(O)); + } + function ra(d, g, y, E, A, R, I = !1) { + const q = yt().outerRadius(A).innerRadius(E).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), O = yt().outerRadius(A).innerRadius(E), k = ue(b(ne)).select("#" + g); + k.selectAll(".slice").attr("prevStart", (Z) => Z.startAngle).attr("prevEnd", (Z) => Z.endAngle); + const T = ta(d, g, y, O, I); + let C = T.size(); + function Pe() { + C--, C <= 0 && (I || Ki(), k.selectAll(".finished").remove()); } - return R.select("path").transition("global").duration(X).attrTween("d", function(re) { - const Et = Number(he(this.parentNode).attr("prevStart")), ue = Number(he(this.parentNode).attr("prevEnd")), Tt = jt(Et, re.startAngle), Gt = jt(ue, re.endAngle); - return (Cr) => (H.startAngle(Tt(Cr)).endAngle(Gt(Cr)), H(re)); - }).on("end", function(re) { - re.startAngle === re.endAngle && he(this).attr("stroke", "none"), je(); - }), N && !I && Ao(d, y, A, Kn(d)), y; + return T.select("path").transition("global").duration(ee).attrTween("d", function(Z) { + const Xe = Number(ue(this.parentNode).attr("prevStart")), re = Number(ue(this.parentNode).attr("prevEnd")), Re = Gt(Xe, Z.startAngle), ei = Gt(re, Z.endAngle); + return (Tr) => (q.startAngle(Re(Tr)).endAngle(ei(Tr)), q(Z)); + }).on("end", function(Z) { + Z.startAngle === Z.endAngle && ue(this).attr("stroke", "none"), Pe(); + }), R && !I && Al(d, y, A, fn(d)), y; } - function Ji(d, g) { - s(g.data.label), i("enter"), a(d.clientX), l(d.clientY); + function ji(d, g) { + s(g.data.label), i("enter"), a(d.clientX), o(d.clientY); } - function Zi(d, g) { + function Ji(d, g) { s(g.data.label), i("leave"); } - function Co(d, g) { - i("show-exhausted"), a(d.clientX), l(d.clientY); + function Cl(d, g) { + i("show-exhausted"), a(d.clientX), o(d.clientY); } - function So(d, g) { + function Sl(d, g) { i("hide-exhausted"); } - var No = { - pieColors: Ne, - exhaustedLabel: Ht, - countExhaustedVotes: cn, - getEliminatedCandidates: Kn, - getElectedCandidates: w, + var Nl = { + pieColors: Fe, + exhaustedLabel: _t, + countExhaustedVotes: Ht, + getEliminatedCandidates: fn, + getElectedCandidates: br, runFullAnimationFn: jn, animateOnePhaseFn: Zn, get jsonData() { @@ -5437,17 +5462,17 @@ function mo(e, t) { a(d), se(); }, get mouseY() { - return l(); + return o(); }, set mouseY(d) { - l(d), se(); + o(d), se(); }, get requestRoundChange() { - return o(); + return l(); }, set requestRoundChange(d = (g) => { }) { - o(d), se(); + l(d), se(); }, get candidateColors() { return u(); @@ -5474,10 +5499,10 @@ function mo(e, t) { c(d), se(); } }, ia = Gd(); - return hi(ia, (d) => ve(ne, d), () => b(ne)), Xe(e, ia), Li(No); + return pi(ia, (d) => de(ne, d), () => b(ne)), Ke(e, ia), Vi(Nl); } -Ys( - mo, +Hs( + ml, { jsonData: {}, currentRound: {}, @@ -5508,17 +5533,17 @@ const Qd = { 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 yo(e, t) { - Oi(t, !0), Hs(e, Qd); +function yl(e, t) { + qi(t, !0), Vs(e, Qd); let n = fe(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = fe(t, "currentStep", 7, 0), i = fe(t, "disabled", 7, !1), s = fe(t, "onAdvance", 7, () => { }); function a() { i() || s()(); } - function l(h) { + function o(h) { (h.key === "Enter" || h.key === " ") && (h.preventDefault(), a()); } - var o = { + var l = { get labels() { return n(); }, @@ -5546,40 +5571,40 @@ function yo(e, t) { } }, u = Zd(); let f; - return u.__click = a, u.__keydown = l, ci(u, 21, n, fi, (h, c, p) => { - var m = Jd(), $ = pn(m); + return u.__click = a, u.__keydown = o, di(u, 21, n, hi, (h, c, p) => { + var m = Jd(), $ = dn(m); { - var _ = (j) => { + var _ = (K) => { var Q = jd(); - let ce; - Jt(() => ce = ti(Q, 1, "connector svelte-1l4eyw0", null, ce, { completed: !i() && p <= r() })), Xe(j, Q); + let ee; + Kt(() => ee = ri(Q, 1, "connector svelte-1l4eyw0", null, ee, { completed: !i() && p <= r() })), Ke(K, Q); }; - er($, (j) => { - p > 0 && j(_); + er($, (K) => { + p > 0 && K(_); }); } - var x = Je($, 2), D = Ye(x); - let C; - var S = Je(D, 2); - let M; - var B = Ye(S, !0); - De(S), De(x), Jt(() => { - C = ti(D, 1, "dot svelte-1l4eyw0", null, C, { + var x = Qe($, 2), F = Ue(x); + let S; + var M = Qe(F, 2); + let D; + var W = Ue(M, !0); + qe(M), qe(x), Kt(() => { + S = ri(F, 1, "dot svelte-1l4eyw0", null, S, { active: !i() && p === r(), completed: !i() && p < r() - }), M = ti(S, 1, "label svelte-1l4eyw0", null, M, { + }), D = ri(M, 1, "label svelte-1l4eyw0", null, D, { active: !i() && p === r(), completed: !i() && p < r() - }), vn(B, b(c)); - }), Xe(h, m); - }), De(u), Jt(() => { - f = ti(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), ya(u, "tabindex", i() ? -1 : 0), ya(u, "aria-disabled", i()); - }), Xe(e, u), Li(o); + }), pn(W, b(c)); + }), Ke(h, m); + }), qe(u), Kt(() => { + f = ri(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), ya(u, "tabindex", i() ? -1 : 0), ya(u, "aria-disabled", i()); + }), Ke(e, u), Vi(l); } Hu(["click", "keydown"]); -Ys(yo, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); +Hs(yl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); var ep = /* @__PURE__ */ qt(" ", 1), tp = /* @__PURE__ */ qt("About to eliminate: ", 1), np = /* @__PURE__ */ qt(" ", 1), rp = /* @__PURE__ */ qt(" ", 1), ip = /* @__PURE__ */ qt('

', 1), sp = /* @__PURE__ */ qt("
", 1), ap = /* @__PURE__ */ qt('


these ballots have already been eliminated.
', 1); -const lp = { +const op = { 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;} @@ -5594,11 +5619,11 @@ const lp = { }` }; -function op(e, t) { - Oi(t, !0), Hs(e, lp); +function lp(e, t) { + qi(t, !0), Vs(e, op); const n = 0.85; let r = fe(t, "electionSummary", 7), i = fe(t, "currentRound", 7, 1), s = fe(t, "requestRoundChange", 7, (w) => { - }), a = fe(t, "candidateColors", 23, () => []), l = fe(t, "textForWinner", 7, "elected"), o = fe(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = fe(t, "firstRoundDeterminesPercentages", 7, !1), f = fe(t, "showCaptions", 7, !1); + }), a = fe(t, "candidateColors", 23, () => []), o = fe(t, "textForWinner", 7, "elected"), l = fe(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = fe(t, "firstRoundDeterminesPercentages", 7, !1), f = fe(t, "showCaptions", 7, !1); const h = { elected: { caption: "Elected", @@ -5617,39 +5642,39 @@ function op(e, t) { infinitive: "to take the lead" } }; - let c = /* @__PURE__ */ hn(() => h[l()] ?? h.elected), p = /* @__PURE__ */ $e(null), m = /* @__PURE__ */ $e(null), $ = /* @__PURE__ */ $e(""), _ = /* @__PURE__ */ $e(Sn([])), x = /* @__PURE__ */ $e(""), D = /* @__PURE__ */ $e(""), C = /* @__PURE__ */ $e(0), S = /* @__PURE__ */ $e(0), M = /* @__PURE__ */ hn(() => B(r())); - function B(w) { + let c = /* @__PURE__ */ cn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ Ee(null), m = /* @__PURE__ */ Ee(null), $ = /* @__PURE__ */ Ee(""), _ = /* @__PURE__ */ Ee(kn([])), x = /* @__PURE__ */ Ee(""), F = /* @__PURE__ */ Ee(""), S = /* @__PURE__ */ Ee(0), M = /* @__PURE__ */ Ee(0), D = /* @__PURE__ */ cn(() => W(r())); + function W(w) { if (typeof w == "string") try { w = JSON.parse(w); - } catch (V) { - return console.error("Failed to parse JSON string:", V), {}; + } catch (Y) { + return console.error("Failed to parse JSON string:", Y), {}; } return w || {}; } - function j(w) { + function K(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function Q(w, V, Z) { - w.style.left = V + "px", w.style.top = Z + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + function Q(w, Y, te) { + w.style.left = Y + "px", w.style.top = te + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { const ie = w.getBoundingClientRect(); - let Ve = V, Xt = Z + 20; - Ve + ie.width > window.innerWidth - 12 && (Ve = window.innerWidth - ie.width - 12), Ve < 12 && (Ve = 12), Xt + ie.height > window.innerHeight - 12 && (Xt = Z - ie.height - 12), w.style.left = Ve + "px", w.style.top = Xt + "px"; + let ze = Y, lt = te + 20; + ze + ie.width > window.innerWidth - 12 && (ze = window.innerWidth - ie.width - 12), ze < 12 && (ze = 12), lt + ie.height > window.innerHeight - 12 && (lt = te - ie.height - 12), w.style.left = ze + "px", w.style.top = lt + "px"; }); } - function ce() { + function ee() { switch (b(x)) { case "enter": ((w) => { - var V = Jo(w, 2); - ve(_, V[0], !0), ve($, V[1], !0); - })(ae(b(D), i())), b(p) && (Q(b(p), b(C) || 0, b(S) || 0), b(p).style.opacity = String(n)); + var Y = Jl(w, 2); + de(_, Y[0], !0), de($, Y[1], !0); + })(ae(b(F), i())), b(p) && (Q(b(p), b(S) || 0, b(M) || 0), b(p).style.opacity = String(n)); break; case "leave": - b(p) && (b(p).style.opacity = "0"), ve(_, [], !0), ve($, ""); + b(p) && (b(p).style.opacity = "0"), de(_, [], !0), de($, ""); break; case "show-exhausted": - b(m) && (Q(b(m), b(C) || 0, b(S) || 0), b(m).style.opacity = String(n)); + b(m) && (Q(b(m), b(S) || 0, b(M) || 0), b(m).style.opacity = String(n)); break; case "hide-exhausted": b(m) && (b(m).style.opacity = "0"); @@ -5659,78 +5684,78 @@ function op(e, t) { break; } } - Fs(() => ce()); - function X(w, V) { - return w === 1 ? V ? "vote was" : "vote will be" : V ? "votes were" : "votes will be"; - } - function ae(w, V) { - const Z = [], _e = w === "exhausted" ? Ne() : w; - let xe; - w === "exhausted" ? xe = Pe(1) : xe = b(M).results[0].tally[w], Z.push(`${_e} started with ${xe} votes.`); - for (let ie = 1; ie <= V; ie++) { - ie === V && (w === "exhausted" ? xe = Pe(V) : xe = b(M).results[V - 1].tally[w], Z.push(`${_e} has ${xe} votes at round ${V}.`)); - const Ve = b(M).results[ie - 1].tallyResults, Xt = de(ie); - for (let Ge = 0; Ge < Ve.length; Ge++) { - const dt = Ve[Ge].transfers, Ke = Ve[Ge].eliminated, te = Ve[Ge].elected; - if (!Xt) { - if (Ke) - Ke === w && Z.push(`${_e} will be eliminated on round ${ie}.`); - else if (w === te && (Z.push(`${_e} ${b(c).event} on round ${ie}.`), dt)) - for (let [me, pt] of Object.entries(dt)) - Z.push(`${pt} ${X(Number(pt), ie < V)} transferred to ${me} on round ${ie}.`); + Is(() => ee()); + function J(w, Y) { + return w === 1 ? Y ? "vote was" : "vote will be" : Y ? "votes were" : "votes will be"; + } + function ae(w, Y) { + const te = [], ve = w === "exhausted" ? _t() : w; + let be; + w === "exhausted" ? be = z(1) : be = b(D).results[0].tally[w], te.push(`${ve} started with ${be} votes.`); + for (let ie = 1; ie <= Y; ie++) { + ie === Y && (w === "exhausted" ? be = z(Y) : be = b(D).results[Y - 1].tally[w], te.push(`${ve} has ${be} votes at round ${Y}.`)); + const ze = b(D).results[ie - 1].tallyResults, lt = xe(ie); + for (let Be = 0; Be < ze.length; Be++) { + const ut = ze[Be].transfers, ge = ze[Be].eliminated, _e = ze[Be].elected; + if (!lt) { + if (ge) + ge === w && te.push(`${ve} will be eliminated on round ${ie}.`); + else if (w === _e && (te.push(`${ve} ${b(c).event} on round ${ie}.`), ut)) + for (let [Le, Yt] of Object.entries(ut)) + te.push(`${Yt} ${J(Number(Yt), ie < Y)} transferred to ${Le} on round ${ie}.`); } - const ke = Ke || te; - if (ke) { - const me = Number(dt[w]); - me && Z.push(`${me} ${X(me, ie < V)} transferred from ${ke} on round ${ie}.`); + const $e = ge || _e; + if ($e) { + const Le = Number(ut[w]); + Le && te.push(`${Le} ${J(Le, ie < Y)} transferred from ${$e} on round ${ie}.`); } } } - return [Z, _e]; + return [te, ve]; } - function le() { + function oe() { let w = 0; - for (let V = 1; V <= b(M).results.length; V++) { - if (de(V)) continue; - const Z = b(M).results[V - 1].tallyResults; - for (let _e = 0; _e < Z.length; _e++) - Z[_e].elected && w++; + for (let Y = 1; Y <= b(D).results.length; Y++) { + if (xe(Y)) continue; + const te = b(D).results[Y - 1].tallyResults; + for (let ve = 0; ve < te.length; ve++) + te[ve].elected && w++; } return w; } - let T, q = /* @__PURE__ */ $e(0); - function Le(w) { - var xe; - return !((xe = b(M)) != null && xe.results) || w < 1 || w > b(M).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [b(M).results[w - 1].tallyResults.some((ie) => ie.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; + let N, H = /* @__PURE__ */ Ee(0); + function Ie(w) { + var be; + return !((be = b(D)) != null && be.results) || w < 1 || w > b(D).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [b(D).results[w - 1].tallyResults.some((ie) => ie.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; } - function st(w) { - var Z; - if (!((Z = b(M)) != null && Z.results) || w < 1 || w > b(M).results.length || w === b(M).results.length) return !0; - const V = b(M).results[w - 1].tallyResults; - return V.length === 0 || V.every((_e) => Object.keys(_e.transfers).length === 0); + function Me(w) { + var te; + if (!((te = b(D)) != null && te.results) || w < 1 || w > b(D).results.length || w === b(D).results.length) return !0; + const Y = b(D).results[w - 1].tallyResults; + return Y.length === 0 || Y.every((ve) => Object.keys(ve.transfers).length === 0); } - function de(w) { - return o() && b(M).results && w === b(M).results.length; + function xe(w) { + return l() && b(D).results && w === b(D).results.length; } - function Ee(w) { - return de(w) ? [] : T ? T.getEliminatedCandidates(w) : []; + function ce(w) { + return xe(w) ? [] : N ? N.getEliminatedCandidates(w) : []; } - function ee(w) { - return de(w) ? [] : T ? T.getElectedCandidates(w) : []; + function le(w) { + return xe(w) ? [] : N ? N.getElectedCandidates(w) : []; } - function Pe(w) { - return T ? T.countExhaustedVotes(w) : 0; + function z(w) { + return N ? N.countExhaustedVotes(w) : 0; } - function W() { - T && T.animateOnePhaseFn && T.animateOnePhaseFn(); + function Fe() { + N && N.animateOnePhaseFn && N.animateOnePhaseFn(); } - function Ne() { - return T ? T.exhaustedLabel : ""; + function _t() { + return N ? N.exhaustedLabel : ""; } - function Ht() { - return T ? T.pieColors : {}; + function ne() { + return N ? N.pieColors : {}; } - var ne = { + var bn = { get electionSummary() { return r(); }, @@ -5746,7 +5771,7 @@ function op(e, t) { get requestRoundChange() { return s(); }, - set requestRoundChange(w = (V) => { + set requestRoundChange(w = (Y) => { }) { s(w), se(); }, @@ -5757,16 +5782,16 @@ function op(e, t) { a(w), se(); }, get textForWinner() { - return l(); + return o(); }, set textForWinner(w = "elected") { - l(w), se(); + o(w), se(); }, get excludeFinalWinnerAndEliminatedCandidate() { - return o(); + return l(); }, set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - o(w), se(); + l(w), se(); }, get firstRoundDeterminesPercentages() { return u(); @@ -5780,38 +5805,38 @@ function op(e, t) { set showCaptions(w = !1) { f(w), se(); } - }, qe = ap(), $t = pn(qe), At = Ye($t); + }, Oe = ap(), ot = dn(Oe), $n = Ue(ot); { - let w = /* @__PURE__ */ hn(() => Le(i())), V = /* @__PURE__ */ hn(() => st(i())); - yo(At, { + let w = /* @__PURE__ */ cn(() => Ie(i())), Y = /* @__PURE__ */ cn(() => Me(i())); + yl($n, { get labels() { return b(w); }, get currentStep() { - return b(q); + return b(H); }, get disabled() { - return b(V); + return b(Y); }, - onAdvance: W + onAdvance: Fe }); } - De($t); - var Yt = Je($t, 4), we = Ye(Yt), zt = Ye(we), cn = Ye(zt); - hi( - mo(cn, { + qe(ot); + var we = Qe(ot, 4), mt = Ue(we), Ht = Ue(mt), An = Ue(Ht); + pi( + ml(An, { get jsonData() { - return b(M); + return b(D); }, get currentRound() { return i(); }, - requestRoundChange: j, + requestRoundChange: K, get candidateColors() { return a(); }, get excludeFinalWinnerAndEliminatedCandidate() { - return o(); + return l(); }, get firstRoundDeterminesPercentages() { return u(); @@ -5820,127 +5845,127 @@ function op(e, t) { return b(x); }, set mouseEventType(w) { - ve(x, w, !0); + de(x, w, !0); }, get mouseData() { - return b(D); + return b(F); }, set mouseData(w) { - ve(D, w, !0); + de(F, w, !0); }, get mouseX() { - return b(C); + return b(S); }, set mouseX(w) { - ve(C, w, !0); + de(S, w, !0); }, get mouseY() { - return b(S); + return b(M); }, set mouseY(w) { - ve(S, w, !0); + de(M, w, !0); }, get displayPhase() { - return b(q); + return b(H); }, set displayPhase(w) { - ve(q, w, !0); + de(H, w, !0); } }), - (w) => T = w, - () => T - ), De(zt), De(we); - var Zr = Je(we, 2); + (w) => N = w, + () => N + ), qe(Ht), qe(mt); + var jr = Qe(mt, 2); { - var Wi = (w) => { - var V = ip(), Z = pn(V), _e = Ye(Z); - De(Z); - var xe = Je(Z, 2), ie = Ye(xe); + var Jr = (w) => { + var Y = ip(), te = dn(Y), ve = Ue(te); + qe(te); + var be = Qe(te, 2), ie = Ue(be); { - var Ve = (te) => { - var ke = tp(), me = Je(pn(ke)); - ci(me, 17, () => Ee(i()), fi, (pt, $n, jn) => { - var An = ep(), oe = pn(An); + var ze = (_e) => { + var $e = tp(), Le = Qe(dn($e)); + di(Le, 17, () => ce(i()), hi, (Yt, jn, En) => { + var me = ep(), zt = dn(me); let Bt; - var Jn = Ye(oe, !0); - De(oe); - var Ar = Je(oe, 2); + var Jn = Ue(zt, !0); + qe(zt); + var Zn = Qe(zt, 2); { - var Zn = (Wt) => { - var Ut = pa(", "); - Xe(Wt, Ut); - }, Er = /* @__PURE__ */ hn(() => jn < Ee(i()).length - 1); - er(Ar, (Wt) => { - b(Er) && Wt(Zn); + var $r = (Xt) => { + var Wt = pa(", "); + Ke(Xt, Wt); + }, Ar = /* @__PURE__ */ cn(() => En < ce(i()).length - 1); + er(Zn, (Xt) => { + b(Ar) && Xt($r); }); } - Jt( - (Wt) => { - Bt = ma(oe, "", Bt, Wt), vn(Jn, b($n)); + Kt( + (Xt) => { + Bt = ma(zt, "", Bt, Xt), pn(Jn, b(jn)); }, - [() => ({ color: Ht()[b($n)] })] - ), Xe(pt, An); - }), Xe(te, ke); - }, Xt = /* @__PURE__ */ hn(() => Ee(i()).length > 0); - er(ie, (te) => { - b(Xt) && te(Ve); + [() => ({ color: ne()[b(jn)] })] + ), Ke(Yt, me); + }), Ke(_e, $e); + }, lt = /* @__PURE__ */ cn(() => ce(i()).length > 0); + er(ie, (_e) => { + b(lt) && _e(ze); }); } - var Ge = Je(ie, 2); + var Be = Qe(ie, 2); { - var dt = (te) => { - var ke = rp(), me = pn(ke), pt = Je(me); - ci(pt, 17, () => ee(i()), fi, ($n, jn, An) => { - var oe = np(), Bt = pn(oe); + var ut = (_e) => { + var $e = rp(), Le = dn($e), Yt = Qe(Le); + di(Yt, 17, () => le(i()), hi, (jn, En, me) => { + var zt = np(), Bt = dn(zt); let Jn; - var Ar = Ye(Bt, !0); - De(Bt); - var Zn = Je(Bt, 2); + var Zn = Ue(Bt, !0); + qe(Bt); + var $r = Qe(Bt, 2); { - var Er = (Ut) => { - var Gi = pa(", "); - Xe(Ut, Gi); - }, Wt = /* @__PURE__ */ hn(() => An < ee(i()).length - 1); - er(Zn, (Ut) => { - b(Wt) && Ut(Er); + var Ar = (Wt) => { + var Tn = pa(", "); + Ke(Wt, Tn); + }, Xt = /* @__PURE__ */ cn(() => me < le(i()).length - 1); + er($r, (Wt) => { + b(Xt) && Wt(Ar); }); } - Jt( - (Ut) => { - Jn = ma(Bt, "", Jn, Ut), vn(Ar, b(jn)); + Kt( + (Wt) => { + Jn = ma(Bt, "", Jn, Wt), pn(Zn, b(En)); }, - [() => ({ color: Ht()[b(jn)] })] - ), Xe($n, oe); - }), Jt(() => vn(me, `${b(c).caption ?? ""}: `)), Xe(te, ke); - }, Ke = /* @__PURE__ */ hn(() => ee(i()).length > 0); - er(Ge, (te) => { - b(Ke) && te(dt); + [() => ({ color: ne()[b(En)] })] + ), Ke(jn, zt); + }), Kt(() => pn(Le, `${b(c).caption ?? ""}: `)), Ke(_e, $e); + }, ge = /* @__PURE__ */ cn(() => le(i()).length > 0); + er(Be, (_e) => { + b(ge) && _e(ut); }); } - De(xe), Jt((te) => vn(_e, `${b(M).config.contest ?? ""}, ${te ?? ""} ${b(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [le]), Xe(w, V); + qe(be), Kt((_e) => pn(ve, `${b(D).config.contest ?? ""}, ${_e ?? ""} ${b(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [oe]), Ke(w, Y); }; - er(Zr, (w) => { - f() && w(Wi); + er(jr, (w) => { + f() && w(Jr); }); } - De(Yt); - var Un = Je(Yt, 2), br = Ye(Un), $r = Ye(br, !0); - De(br); - var Ui = Je(br, 2); - ci(Ui, 17, () => b(_), fi, (w, V) => { - var Z = sp(), _e = pn(Z), xe = Ye(_e, !0); - De(_e), os(2), Jt(() => vn(xe, b(V))), Xe(w, Z); - }), De(Un), hi(Un, (w) => ve(p, w), () => b(p)); - var Gn = Je(Un, 2), Kn = Ye(Gn); - return os(2), De(Gn), hi(Gn, (w) => ve(m, w), () => b(m)), Jt( + qe(we); + var Kn = Qe(we, 2), un = Ue(Kn), Gi = Ue(un, !0); + qe(un); + var Zr = Qe(un, 2); + di(Zr, 17, () => b(_), hi, (w, Y) => { + var te = sp(), ve = dn(te), be = Ue(ve, !0); + qe(ve), os(2), Kt(() => pn(be, b(Y))), Ke(w, te); + }), qe(Kn), pi(Kn, (w) => de(p, w), () => b(p)); + var fn = Qe(Kn, 2), br = Ue(fn); + return os(2), qe(fn), pi(fn, (w) => de(m, w), () => b(m)), Kt( (w) => { - vn($r, b($)), vn(Kn, `"${w ?? ""}" means all the candidates ranked on `); + pn(Gi, b($)), pn(br, `"${w ?? ""}" means all the candidates ranked on `); }, - [Ne] - ), Xe(e, qe), Li(ne); + [_t] + ), Ke(e, Oe), Vi(bn); } -customElements.define("pie-chart", Ys( - op, +customElements.define("pie-chart", Hs( + lp, { electionSummary: {}, currentRound: {}, From f80a12111103b9ccaa6a6d455ecef154cec96960 Mon Sep 17 00:00:00 2001 From: skaphan Date: Fri, 3 Apr 2026 07:31:15 -0700 Subject: [PATCH 26/31] Randomize pie slice order with seeded shuffle for even size distribution --- visualizer/pie/graphToRCtab.py | 37 +++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/visualizer/pie/graphToRCtab.py b/visualizer/pie/graphToRCtab.py index 26f0960c..2bd7611d 100644 --- a/visualizer/pie/graphToRCtab.py +++ b/visualizer/pie/graphToRCtab.py @@ -13,6 +13,28 @@ from visualizer.graph.rcvResult import Elimination, WinTransfer +def _scatter_order(names): + """ + Shuffle candidate names deterministically to spread sizes around the pie. + + Uses a seeded random shuffle so the order is stable for the same set + of candidates (required for D3 pie animation across rounds). The seed + is derived from the sorted candidate names, so the same election + always produces the same order. + """ + import random + import hashlib + + if len(names) <= 3: + return list(names) + + seed = int(hashlib.md5('|'.join(sorted(names)).encode()).hexdigest(), 16) % (2**32) + rng = random.Random(seed) + result = list(names) + rng.shuffle(result) + return result + + def graph_to_rctab_json(graph): """ Build an RCTab-compatible JSON dict from a processed Graph. @@ -35,8 +57,10 @@ def graph_to_rctab_json(graph): num_active_candidates = sum(1 for c in graph.candidates if c.name not in inactive_names) # Compute interleave order once from round 1, reuse for all rounds. - # Alternates largest/smallest so small slices have large neighbors, - # reducing label overlap. Inactive/residual entries always last. + # Spreads sizes evenly around the circle using a stride-based approach: + # sort candidates by votes descending, then pick every Nth one to ensure + # large and small slices are distributed, not clustered. + # Inactive/residual entries always last. # Order must be stable across rounds for D3 pie animation to work. round1_nodes = graph.nodesPerRound[0] active_items = [] @@ -47,14 +71,7 @@ def graph_to_rctab_json(graph): else: active_items.append((candidate.name, node.count)) active_items.sort(key=lambda item: item[1], reverse=True) - interleaved_order = [] - lo, hi = 0, len(active_items) - 1 - while lo <= hi: - interleaved_order.append(active_items[lo][0]) - if lo != hi: - interleaved_order.append(active_items[hi][0]) - lo += 1 - hi -= 1 + interleaved_order = _scatter_order([name for name, _ in active_items]) interleaved_order.extend(inactive_order) results = [] From 2b0d031499c94bf25969b2176ece9a406c59d322 Mon Sep 17 00:00:00 2001 From: skaphan Date: Fri, 3 Apr 2026 10:28:23 -0700 Subject: [PATCH 27/31] Sync pie chart --- static/pie/pie-chart.es.js | 4372 ++++++++++++++++++------------------ 1 file changed, 2187 insertions(+), 2185 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 27302b71..37cd29b7 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,61 +1,61 @@ var Pl = Object.defineProperty; -var sa = (e) => { - throw TypeError(e); +var sa = (t) => { + throw TypeError(t); }; -var Dl = (e, t, n) => t in e ? Pl(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var he = (e, t, n) => Dl(e, typeof t != "symbol" ? t + "" : t, n), Zi = (e, t, n) => t.has(e) || sa("Cannot " + n); -var v = (e, t, n) => (Zi(e, t, "read from private field"), n ? n.call(e) : t.get(e)), V = (e, t, n) => t.has(e) ? sa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), L = (e, t, n, r) => (Zi(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), Ae = (e, t, n) => (Zi(e, t, "access private method"), n); +var Dl = (t, e, n) => e in t ? Pl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var ht = (t, e, n) => Dl(t, typeof e != "symbol" ? e + "" : e, n), Zi = (t, e, n) => e.has(t) || sa("Cannot " + n); +var v = (t, e, n) => (Zi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), V = (t, e, n) => e.has(t) ? sa("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), L = (t, e, n, r) => (Zi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), At = (t, e, n) => (Zi(t, e, "access private method"), n); var qa; typeof window < "u" && ((qa = window.__svelte ?? (window.__svelte = {})).v ?? (qa.v = /* @__PURE__ */ new Set())).add("5"); -const Il = 1, Fl = 2, za = 4, Ol = 8, Ll = 16, ql = 1, Vl = 4, Hl = 8, Yl = 16, zl = 1, Bl = 2, Cs = "[", Di = "[!", Ss = "]", fr = {}, Ce = Symbol(), Ba = "http://www.w3.org/1999/xhtml", ss = !1; +const Il = 1, Fl = 2, za = 4, Ol = 8, Ll = 16, ql = 1, Vl = 4, Hl = 8, Yl = 16, zl = 1, Bl = 2, Cs = "[", Di = "[!", Ss = "]", fr = {}, Ct = Symbol(), Ba = "http://www.w3.org/1999/xhtml", ss = !1; var Xa = Array.isArray, Xl = Array.prototype.indexOf, cr = Array.prototype.includes, Ii = Array.from, xi = Object.keys, bi = Object.defineProperty, Vn = Object.getOwnPropertyDescriptor, Wl = Object.getOwnPropertyDescriptors, Ul = Object.prototype, Gl = Array.prototype, Wa = Object.getPrototypeOf, aa = Object.isExtensible; const Kl = () => { }; -function jl(e) { - for (var t = 0; t < e.length; t++) - e[t](); +function jl(t) { + for (var e = 0; e < t.length; e++) + t[e](); } function Ua() { - var e, t, n = new Promise((r, i) => { - e = r, t = i; + var t, e, n = new Promise((r, i) => { + t = r, e = i; }); - return { promise: n, resolve: e, reject: t }; + return { promise: n, resolve: t, reject: e }; } -function Jl(e, t) { - if (Array.isArray(e)) - return e; - if (!(Symbol.iterator in e)) - return Array.from(e); +function Jl(t, e) { + if (Array.isArray(t)) + return t; + if (!(Symbol.iterator in t)) + return Array.from(t); const n = []; - for (const r of e) - if (n.push(r), n.length === t) break; + for (const r of t) + if (n.push(r), n.length === e) break; return n; } -const Ne = 2, Fr = 4, Fi = 8, Ga = 1 << 24, ln = 16, Tt = 32, xn = 64, Ka = 128, pt = 512, Te = 1024, ke = 2048, Et = 4096, rt = 8192, rn = 16384, yr = 32768, hr = 65536, oa = 1 << 17, ja = 1 << 18, Gn = 1 << 19, Zl = 1 << 20, tn = 1 << 25, Bn = 65536, as = 1 << 21, Ns = 1 << 22, gn = 1 << 23, Pr = Symbol("$state"), Ja = Symbol("legacy props"), Ql = Symbol(""), Sn = new class extends Error { +const Nt = 2, Fr = 4, Fi = 8, Ga = 1 << 24, ln = 16, Te = 32, xn = 64, Ka = 128, pe = 512, Tt = 1024, kt = 2048, Ee = 4096, re = 8192, rn = 16384, yr = 32768, hr = 65536, oa = 1 << 17, ja = 1 << 18, Gn = 1 << 19, Zl = 1 << 20, en = 1 << 25, Bn = 65536, as = 1 << 21, Ns = 1 << 22, gn = 1 << 23, Pr = Symbol("$state"), Ja = Symbol("legacy props"), Ql = Symbol(""), Sn = new class extends Error { constructor() { super(...arguments); - he(this, "name", "StaleReactionError"); - he(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + ht(this, "name", "StaleReactionError"); + ht(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } }(); var Va; -const eu = ((Va = globalThis.document) == null ? void 0 : /* @__PURE__ */ Va.contentType.includes("xml")) ?? !1, Ur = 3, wr = 8; -function tu(e) { +const tu = ((Va = globalThis.document) == null ? void 0 : /* @__PURE__ */ Va.contentType.includes("xml")) ?? !1, Ur = 3, wr = 8; +function eu(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } function nu() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function ru(e, t, n) { +function ru(t, e, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function iu(e) { +function iu(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } function su() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function au(e) { +function au(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } function ou() { @@ -64,7 +64,7 @@ function ou() { function lu() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function uu(e) { +function uu(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } function fu() { @@ -79,187 +79,187 @@ function hu() { function du() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Oi(e) { +function Oi(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } function pu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } let G = !1; -function nn(e) { - G = e; +function nn(t) { + G = t; } let X; -function He(e) { - if (e === null) +function Ht(t) { + if (t === null) throw Oi(), fr; - return X = e; + return X = t; } function Li() { - return He(/* @__PURE__ */ Ot(X)); + return Ht(/* @__PURE__ */ Oe(X)); } -function qe(e) { +function qt(t) { if (G) { - if (/* @__PURE__ */ Ot(X) !== null) + if (/* @__PURE__ */ Oe(X) !== null) throw Oi(), fr; - X = e; + X = t; } } -function os(e = 1) { +function os(t = 1) { if (G) { - for (var t = e, n = X; t--; ) + for (var e = t, n = X; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Ot(n); + /* @__PURE__ */ Oe(n); X = n; } } -function $i(e = !0) { - for (var t = 0, n = X; ; ) { +function $i(t = !0) { + for (var e = 0, n = X; ; ) { if (n.nodeType === wr) { var r = ( /** @type {Comment} */ n.data ); if (r === Ss) { - if (t === 0) return n; - t -= 1; + if (e === 0) return n; + e -= 1; } else (r === Cs || r === Di || // "[1", "[2", etc. for if blocks - r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1); + r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Ot(n) + /* @__PURE__ */ Oe(n) ); - e && n.remove(), n = i; + t && n.remove(), n = i; } } -function Za(e) { - if (!e || e.nodeType !== wr) +function Za(t) { + if (!t || t.nodeType !== wr) throw Oi(), fr; return ( /** @type {Comment} */ - e.data + t.data ); } -function Qa(e) { - return e === this.v; +function Qa(t) { + return t === this.v; } -function vu(e, t) { - return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; +function vu(t, e) { + return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function eo(e) { - return !vu(e, this.v); +function to(t) { + return !vu(t, this.v); } -let gu = !1, st = null; -function dr(e) { - st = e; +let gu = !1, se = null; +function dr(t) { + se = t; } -function qi(e, t = !1, n) { - st = { - p: st, +function qi(t, e = !1, n) { + se = { + p: se, i: !1, c: null, e: null, - s: e, + s: t, x: null, l: null }; } -function Vi(e) { - var t = ( +function Vi(t) { + var e = ( /** @type {ComponentContext} */ - st - ), n = t.e; + se + ), n = e.e; if (n !== null) { - t.e = null; + e.e = null; for (var r of n) To(r); } - return e !== void 0 && (t.x = e), t.i = !0, st = t.p, e ?? /** @type {T} */ + return t !== void 0 && (e.x = t), e.i = !0, se = e.p, t ?? /** @type {T} */ {}; } -function to() { +function eo() { return !0; } let Nn = []; function no() { - var e = Nn; - Nn = [], jl(e); + var t = Nn; + Nn = [], jl(t); } -function _n(e) { +function _n(t) { if (Nn.length === 0 && !Dr) { - var t = Nn; + var e = Nn; queueMicrotask(() => { - t === Nn && no(); + e === Nn && no(); }); } - Nn.push(e); + Nn.push(t); } function _u() { for (; Nn.length > 0; ) no(); } -function ro(e) { - var t = j; - if (t === null) - return B.f |= gn, e; - if ((t.f & yr) === 0 && (t.f & Fr) === 0) - throw e; - pr(e, t); +function ro(t) { + var e = j; + if (e === null) + return B.f |= gn, t; + if ((e.f & yr) === 0 && (e.f & Fr) === 0) + throw t; + pr(t, e); } -function pr(e, t) { - for (; t !== null; ) { - if ((t.f & Ka) !== 0) { - if ((t.f & yr) === 0) - throw e; +function pr(t, e) { + for (; e !== null; ) { + if ((e.f & Ka) !== 0) { + if ((e.f & yr) === 0) + throw t; try { - t.b.error(e); + e.b.error(t); return; } catch (n) { - e = n; + t = n; } } - t = t.parent; + e = e.parent; } - throw e; + throw t; } const mu = -7169; -function pe(e, t) { - e.f = e.f & mu | t; +function pt(t, e) { + t.f = t.f & mu | e; } -function ks(e) { - (e.f & pt) !== 0 || e.deps === null ? pe(e, Te) : pe(e, Et); +function ks(t) { + (t.f & pe) !== 0 || t.deps === null ? pt(t, Tt) : pt(t, Ee); } -function io(e) { - if (e !== null) - for (const t of e) - (t.f & Ne) === 0 || (t.f & Bn) === 0 || (t.f ^= Bn, io( +function io(t) { + if (t !== null) + for (const e of t) + (e.f & Nt) === 0 || (e.f & Bn) === 0 || (e.f ^= Bn, io( /** @type {Derived} */ - t.deps + e.deps )); } -function so(e, t, n) { - (e.f & ke) !== 0 ? t.add(e) : (e.f & Et) !== 0 && n.add(e), io(e.deps), pe(e, Te); +function so(t, e, n) { + (t.f & kt) !== 0 ? e.add(t) : (t.f & Ee) !== 0 && n.add(t), io(t.deps), pt(t, Tt); } -const ti = /* @__PURE__ */ new Set(); -let U = null, Se = null, je = [], Hi = null, ls = !1, Dr = !1; -var rr, ir, Dn, sr, Yr, zr, In, jt, ar, Ft, us, fs, ao; +const ei = /* @__PURE__ */ new Set(); +let U = null, St = null, jt = [], Hi = null, ls = !1, Dr = !1; +var rr, ir, Dn, sr, Yr, zr, In, je, ar, Fe, us, fs, ao; const Ks = class Ks { constructor() { - V(this, Ft); - he(this, "committed", !1); + V(this, Fe); + ht(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} */ - he(this, "current", /* @__PURE__ */ new Map()); + ht(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} */ - he(this, "previous", /* @__PURE__ */ new Map()); + ht(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 @@ -302,8 +302,8 @@ const Ks = class Ks { * so they can be rescheduled if the branch survives. * @type {Map} */ - V(this, jt, /* @__PURE__ */ new Map()); - he(this, "is_fork", !1); + V(this, je, /* @__PURE__ */ new Map()); + ht(this, "is_fork", !1); V(this, ar, !1); } is_deferred() { @@ -313,43 +313,43 @@ const Ks = class Ks { * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ - skip_effect(t) { - v(this, jt).has(t) || v(this, jt).set(t, { d: [], m: [] }); + skip_effect(e) { + v(this, je).has(e) || v(this, je).set(e, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule * any tracked dirty/maybe_dirty child effects * @param {Effect} effect */ - unskip_effect(t) { - var n = v(this, jt).get(t); + unskip_effect(e) { + var n = v(this, je).get(e); if (n) { - v(this, jt).delete(t); + v(this, je).delete(e); for (var r of n.d) - pe(r, ke), $t(r); + pt(r, kt), $e(r); for (r of n.m) - pe(r, Et), $t(r); + pt(r, Ee), $e(r); } } /** * * @param {Effect[]} root_effects */ - process(t) { + process(e) { var i; - je = [], this.apply(); + jt = [], this.apply(); var n = [], r = []; - for (const s of t) - Ae(this, Ft, us).call(this, s, n, r); + for (const s of e) + At(this, Fe, us).call(this, s, n, r); if (this.is_deferred()) { - Ae(this, Ft, fs).call(this, r), Ae(this, Ft, fs).call(this, n); - for (const [s, a] of v(this, jt)) + At(this, Fe, fs).call(this, r), At(this, Fe, fs).call(this, n); + for (const [s, a] of v(this, je)) fo(s, a); } else { for (const s of v(this, rr)) s(); - v(this, rr).clear(), v(this, Dn) === 0 && Ae(this, Ft, ao).call(this), U = null, la(r), la(n), (i = v(this, Yr)) == null || i.resolve(); + v(this, rr).clear(), v(this, Dn) === 0 && At(this, Fe, ao).call(this), U = null, la(r), la(n), (i = v(this, Yr)) == null || i.resolve(); } - Se = null; + St = null; } /** * Associate a change to a given source with the current @@ -357,65 +357,65 @@ const Ks = class Ks { * @param {Source} source * @param {any} value */ - capture(t, n) { - n !== Ce && !this.previous.has(t) && this.previous.set(t, n), (t.f & gn) === 0 && (this.current.set(t, t.v), Se == null || Se.set(t, t.v)); + capture(e, n) { + n !== Ct && !this.previous.has(e) && this.previous.set(e, n), (e.f & gn) === 0 && (this.current.set(e, e.v), St == null || St.set(e, e.v)); } activate() { U = this, this.apply(); } deactivate() { - U === this && (U = null, Se = null); + U === this && (U = null, St = null); } flush() { - if (this.activate(), je.length > 0) { + if (this.activate(), jt.length > 0) { if (oo(), U !== null && U !== this) return; } else v(this, Dn) === 0 && this.process([]); this.deactivate(); } discard() { - for (const t of v(this, ir)) t(this); + for (const e of v(this, ir)) e(this); v(this, ir).clear(); } /** * * @param {boolean} blocking */ - increment(t) { - L(this, Dn, v(this, Dn) + 1), t && L(this, sr, v(this, sr) + 1); + increment(e) { + L(this, Dn, v(this, Dn) + 1), e && L(this, sr, v(this, sr) + 1); } /** * * @param {boolean} blocking */ - decrement(t) { - L(this, Dn, v(this, Dn) - 1), t && L(this, sr, v(this, sr) - 1), !v(this, ar) && (L(this, ar, !0), _n(() => { - L(this, ar, !1), this.is_deferred() ? je.length > 0 && this.flush() : this.revive(); + decrement(e) { + L(this, Dn, v(this, Dn) - 1), e && L(this, sr, v(this, sr) - 1), !v(this, ar) && (L(this, ar, !0), _n(() => { + L(this, ar, !1), this.is_deferred() ? jt.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const t of v(this, zr)) - v(this, In).delete(t), pe(t, ke), $t(t); - for (const t of v(this, In)) - pe(t, Et), $t(t); + for (const e of v(this, zr)) + v(this, In).delete(e), pt(e, kt), $e(e); + for (const e of v(this, In)) + pt(e, Ee), $e(e); this.flush(); } /** @param {() => void} fn */ - oncommit(t) { - v(this, rr).add(t); + oncommit(e) { + v(this, rr).add(e); } /** @param {(batch: Batch) => void} fn */ - ondiscard(t) { - v(this, ir).add(t); + ondiscard(e) { + v(this, ir).add(e); } settled() { return (v(this, Yr) ?? L(this, Yr, Ua())).promise; } static ensure() { if (U === null) { - const t = U = new Ks(); - ti.add(U), Dr || _n(() => { - U === t && t.flush(); + const e = U = new Ks(); + ei.add(U), Dr || _n(() => { + U === e && e.flush(); }); } return U; @@ -423,19 +423,19 @@ const Ks = class Ks { apply() { } }; -rr = new WeakMap(), ir = new WeakMap(), Dn = new WeakMap(), sr = new WeakMap(), Yr = new WeakMap(), zr = new WeakMap(), In = new WeakMap(), jt = new WeakMap(), ar = new WeakMap(), Ft = new WeakSet(), /** +rr = new WeakMap(), ir = new WeakMap(), Dn = new WeakMap(), sr = new WeakMap(), Yr = new WeakMap(), zr = new WeakMap(), In = new WeakMap(), je = new WeakMap(), ar = new WeakMap(), Fe = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -us = function(t, n, r) { - t.f ^= Te; - for (var i = t.first, s = null; i !== null; ) { - var a = i.f, o = (a & (Tt | xn)) !== 0, l = o && (a & Te) !== 0, u = l || (a & rt) !== 0 || v(this, jt).has(i); +us = function(e, n, r) { + e.f ^= Tt; + for (var i = e.first, s = null; i !== null; ) { + var a = i.f, o = (a & (Te | xn)) !== 0, l = o && (a & Tt) !== 0, u = l || (a & re) !== 0 || v(this, je).has(i); if (!u && i.fn !== null) { - o ? i.f ^= Te : s !== null && (a & (Fr | Fi | Ga)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Gr(i) && ((a & ln) !== 0 && v(this, In).add(i), gr(i)); + o ? i.f ^= Tt : s !== null && (a & (Fr | Fi | Ga)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Gr(i) && ((a & ln) !== 0 && v(this, In).add(i), gr(i)); var f = i.first; if (f !== null) { i = f; @@ -449,15 +449,15 @@ us = function(t, n, r) { }, /** * @param {Effect[]} effects */ -fs = function(t) { - for (var n = 0; n < t.length; n += 1) - so(t[n], v(this, zr), v(this, In)); +fs = function(e) { + for (var n = 0; n < e.length; n += 1) + so(e[n], v(this, zr), v(this, In)); }, ao = function() { var i; - if (ti.size > 1) { + if (ei.size > 1) { this.previous.clear(); - var t = Se, n = !0; - for (const s of ti) { + var e = St, n = !0; + for (const s of ei) { if (s === this) { n = !1; continue; @@ -475,114 +475,114 @@ fs = function(t) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = je; - je = []; + var r = jt; + jt = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) lo(f, o, l, u); - if (je.length > 0) { + if (jt.length > 0) { U = s, s.apply(); - for (const f of je) - Ae(i = s, Ft, us).call(i, f, [], []); + for (const f of jt) + At(i = s, Fe, us).call(i, f, [], []); s.deactivate(); } - je = r; + jt = r; } } - U = null, Se = t; + U = null, St = e; } - this.committed = !0, ti.delete(this); + this.committed = !0, ei.delete(this); }; let sn = Ks; -function se(e) { - var t = Dr; +function st(t) { + var e = Dr; Dr = !0; try { for (var n; ; ) { - if (_u(), je.length === 0 && (U == null || U.flush(), je.length === 0)) + if (_u(), jt.length === 0 && (U == null || U.flush(), jt.length === 0)) return Hi = null, /** @type {T} */ n; oo(); } } finally { - Dr = t; + Dr = e; } } function oo() { ls = !0; - var e = null; + var t = null; try { - for (var t = 0; je.length > 0; ) { + for (var e = 0; jt.length > 0; ) { var n = sn.ensure(); - if (t++ > 1e3) { + if (e++ > 1e3) { var r, i; yu(); } - n.process(je), mn.clear(); + n.process(jt), mn.clear(); } } finally { - je = [], ls = !1, Hi = null; + jt = [], ls = !1, Hi = null; } } function yu() { try { ou(); - } catch (e) { - pr(e, Hi); + } catch (t) { + pr(t, Hi); } } -let wt = null; -function la(e) { - var t = e.length; - if (t !== 0) { - for (var n = 0; n < t; ) { - var r = e[n++]; - if ((r.f & (rn | rt)) === 0 && Gr(r) && (wt = /* @__PURE__ */ new Set(), gr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && So(r), (wt == null ? void 0 : wt.size) > 0)) { +let we = null; +function la(t) { + var e = t.length; + if (e !== 0) { + for (var n = 0; n < e; ) { + var r = t[n++]; + if ((r.f & (rn | re)) === 0 && Gr(r) && (we = /* @__PURE__ */ new Set(), gr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && So(r), (we == null ? void 0 : we.size) > 0)) { mn.clear(); - for (const i of wt) { - if ((i.f & (rn | rt)) !== 0) continue; + for (const i of we) { + if ((i.f & (rn | re)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - wt.has(a) && (wt.delete(a), s.push(a)), a = a.parent; + we.has(a) && (we.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (rn | rt)) === 0 && gr(l); + (l.f & (rn | re)) === 0 && gr(l); } } - wt.clear(); + we.clear(); } } - wt = null; + we = null; } } -function lo(e, t, n, r) { - if (!n.has(e) && (n.add(e), e.reactions !== null)) - for (const i of e.reactions) { +function lo(t, e, n, r) { + if (!n.has(t) && (n.add(t), t.reactions !== null)) + for (const i of t.reactions) { const s = i.f; - (s & Ne) !== 0 ? lo( + (s & Nt) !== 0 ? lo( /** @type {Derived} */ i, - t, + e, n, r - ) : (s & (Ns | ln)) !== 0 && (s & ke) === 0 && uo(i, t, r) && (pe(i, ke), $t( + ) : (s & (Ns | ln)) !== 0 && (s & kt) === 0 && uo(i, e, r) && (pt(i, kt), $e( /** @type {Effect} */ i )); } } -function uo(e, t, n) { - const r = n.get(e); +function uo(t, e, n) { + const r = n.get(t); if (r !== void 0) return r; - if (e.deps !== null) - for (const i of e.deps) { - if (cr.call(t, i)) + if (t.deps !== null) + for (const i of t.deps) { + if (cr.call(e, i)) return !0; - if ((i.f & Ne) !== 0 && uo( + if ((i.f & Nt) !== 0 && uo( /** @type {Derived} */ i, - t, + e, n )) return n.set( @@ -591,76 +591,76 @@ function uo(e, t, n) { !0 ), !0; } - return n.set(e, !1), !1; + return n.set(t, !1), !1; } -function $t(e) { - for (var t = Hi = e; t.parent !== null; ) { - t = t.parent; - var n = t.f; - if (ls && t === j && (n & ln) !== 0 && (n & ja) === 0) +function $e(t) { + for (var e = Hi = t; e.parent !== null; ) { + e = e.parent; + var n = e.f; + if (ls && e === j && (n & ln) !== 0 && (n & ja) === 0) return; - if ((n & (xn | Tt)) !== 0) { - if ((n & Te) === 0) return; - t.f ^= Te; + if ((n & (xn | Te)) !== 0) { + if ((n & Tt) === 0) return; + e.f ^= Tt; } } - je.push(t); + jt.push(e); } -function fo(e, t) { - if (!((e.f & Tt) !== 0 && (e.f & Te) !== 0)) { - (e.f & ke) !== 0 ? t.d.push(e) : (e.f & Et) !== 0 && t.m.push(e), pe(e, Te); - for (var n = e.first; n !== null; ) - fo(n, t), n = n.next; +function fo(t, e) { + if (!((t.f & Te) !== 0 && (t.f & Tt) !== 0)) { + (t.f & kt) !== 0 ? e.d.push(t) : (t.f & Ee) !== 0 && e.m.push(t), pt(t, Tt); + for (var n = t.first; n !== null; ) + fo(n, e), n = n.next; } } -function wu(e) { - let t = 0, n = Xn(0), r; +function wu(t) { + let e = 0, n = Xn(0), r; return () => { - Ds() && (b(n), Fs(() => (t === 0 && (r = Bi(() => e(() => Ir(n)))), t += 1, () => { + Ds() && (b(n), Fs(() => (e === 0 && (r = Bi(() => t(() => Ir(n)))), e += 1, () => { _n(() => { - t -= 1, t === 0 && (r == null || r(), r = void 0, Ir(n)); + e -= 1, e === 0 && (r == null || r(), r = void 0, Ir(n)); }); }))); }; } var xu = hr | Gn | Ka; -function bu(e, t, n) { - new $u(e, t, n); +function bu(t, e, n) { + new $u(t, e, n); } -var tt, Br, St, Fn, Nt, ct, Ge, kt, Jt, vn, On, Zt, or, Ln, lr, ur, Qt, Mi, ye, co, ho, cs, ui, fi, hs; +var ee, Br, Se, Fn, Ne, ce, Gt, ke, Je, vn, On, Ze, or, Ln, lr, ur, Qe, Mi, yt, co, ho, cs, ui, fi, hs; class $u { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ - constructor(t, n, r) { - V(this, ye); + constructor(e, n, r) { + V(this, yt); /** @type {Boundary | null} */ - he(this, "parent"); - he(this, "is_pending", !1); + ht(this, "parent"); + ht(this, "is_pending", !1); /** @type {TemplateNode} */ - V(this, tt); + V(this, ee); /** @type {TemplateNode | null} */ V(this, Br, G ? X : null); /** @type {BoundaryProps} */ - V(this, St); + V(this, Se); /** @type {((anchor: Node) => void)} */ V(this, Fn); /** @type {Effect} */ - V(this, Nt); + V(this, Ne); /** @type {Effect | null} */ - V(this, ct, null); + V(this, ce, null); /** @type {Effect | null} */ - V(this, Ge, null); + V(this, Gt, null); /** @type {Effect | null} */ - V(this, kt, null); + V(this, ke, null); /** @type {DocumentFragment | null} */ - V(this, Jt, null); + V(this, Je, null); /** @type {TemplateNode | null} */ V(this, vn, null); V(this, On, 0); - V(this, Zt, 0); + V(this, Ze, 0); V(this, or, !1); V(this, Ln, !1); /** @type {Set} */ @@ -674,38 +674,38 @@ class $u { * calls followed by no-op flushes * @type {Source | null} */ - V(this, Qt, null); - V(this, Mi, wu(() => (L(this, Qt, Xn(v(this, On))), () => { - L(this, Qt, null); + V(this, Qe, null); + V(this, Mi, wu(() => (L(this, Qe, Xn(v(this, On))), () => { + L(this, Qe, null); }))); - L(this, tt, t), L(this, St, n), L(this, Fn, r), this.parent = /** @type {Effect} */ - j.b, this.is_pending = !!v(this, St).pending, L(this, Nt, Os(() => { + L(this, ee, e), L(this, Se, n), L(this, Fn, r), this.parent = /** @type {Effect} */ + j.b, this.is_pending = !!v(this, Se).pending, L(this, Ne, Os(() => { if (j.b = this, G) { const s = v(this, Br); Li(), /** @type {Comment} */ s.nodeType === wr && /** @type {Comment} */ - s.data === Di ? Ae(this, ye, ho).call(this) : (Ae(this, ye, co).call(this), v(this, Zt) === 0 && (this.is_pending = !1)); + s.data === Di ? At(this, yt, ho).call(this) : (At(this, yt, co).call(this), v(this, Ze) === 0 && (this.is_pending = !1)); } else { - var i = Ae(this, ye, cs).call(this); + var i = At(this, yt, cs).call(this); try { - L(this, ct, dt(() => r(i))); + L(this, ce, de(() => r(i))); } catch (s) { this.error(s); } - v(this, Zt) > 0 ? Ae(this, ye, fi).call(this) : this.is_pending = !1; + v(this, Ze) > 0 ? At(this, yt, fi).call(this) : this.is_pending = !1; } return () => { var s; (s = v(this, vn)) == null || s.remove(); }; - }, xu)), G && L(this, tt, X); + }, xu)), G && L(this, ee, X); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ - defer_effect(t) { - so(t, v(this, lr), v(this, ur)); + defer_effect(e) { + so(e, v(this, lr), v(this, ur)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -715,7 +715,7 @@ class $u { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, St).pending; + return !!v(this, Se).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -723,50 +723,50 @@ class $u { * Do not call from inside the class * @param {1 | -1} d */ - update_pending_count(t) { - Ae(this, ye, hs).call(this, t), L(this, On, v(this, On) + t), !(!v(this, Qt) || v(this, or)) && (L(this, or, !0), _n(() => { - L(this, or, !1), v(this, Qt) && vr(v(this, Qt), v(this, On)); + update_pending_count(e) { + At(this, yt, hs).call(this, e), L(this, On, v(this, On) + e), !(!v(this, Qe) || v(this, or)) && (L(this, or, !0), _n(() => { + L(this, or, !1), v(this, Qe) && vr(v(this, Qe), v(this, On)); })); } get_effect_pending() { return v(this, Mi).call(this), b( /** @type {Source} */ - v(this, Qt) + v(this, Qe) ); } /** @param {unknown} error */ - error(t) { - var n = v(this, St).onerror; - let r = v(this, St).failed; + error(e) { + var n = v(this, Se).onerror; + let r = v(this, Se).failed; if (v(this, Ln) || !n && !r) - throw t; - v(this, ct) && (Ye(v(this, ct)), L(this, ct, null)), v(this, Ge) && (Ye(v(this, Ge)), L(this, Ge, null)), v(this, kt) && (Ye(v(this, kt)), L(this, kt, null)), G && (He( + throw e; + v(this, ce) && (Yt(v(this, ce)), L(this, ce, null)), v(this, Gt) && (Yt(v(this, Gt)), L(this, Gt, null)), v(this, ke) && (Yt(v(this, ke)), L(this, ke, null)), G && (Ht( /** @type {TemplateNode} */ v(this, Br) - ), os(), He($i())); + ), os(), Ht($i())); var i = !1, s = !1; const a = () => { if (i) { pu(); return; } - i = !0, s && du(), sn.ensure(), L(this, On, 0), v(this, kt) !== null && Hn(v(this, kt), () => { - L(this, kt, null); - }), this.is_pending = this.has_pending_snippet(), L(this, ct, Ae(this, ye, ui).call(this, () => (L(this, Ln, !1), dt(() => v(this, Fn).call(this, v(this, tt)))))), v(this, Zt) > 0 ? Ae(this, ye, fi).call(this) : this.is_pending = !1; + i = !0, s && du(), sn.ensure(), L(this, On, 0), v(this, ke) !== null && Hn(v(this, ke), () => { + L(this, ke, null); + }), this.is_pending = this.has_pending_snippet(), L(this, ce, At(this, yt, ui).call(this, () => (L(this, Ln, !1), de(() => v(this, Fn).call(this, v(this, ee)))))), v(this, Ze) > 0 ? At(this, yt, fi).call(this) : this.is_pending = !1; }; _n(() => { try { - s = !0, n == null || n(t, a), s = !1; + s = !0, n == null || n(e, a), s = !1; } catch (o) { - pr(o, v(this, Nt) && v(this, Nt).parent); + pr(o, v(this, Ne) && v(this, Ne).parent); } - r && L(this, kt, Ae(this, ye, ui).call(this, () => { + r && L(this, ke, At(this, yt, ui).call(this, () => { sn.ensure(), L(this, Ln, !0); try { - return dt(() => { + return de(() => { r( - v(this, tt), - () => t, + v(this, ee), + () => e, () => a ); }); @@ -774,7 +774,7 @@ class $u { return pr( o, /** @type {Effect} */ - v(this, Nt).parent + v(this, Ne).parent ), null; } finally { L(this, Ln, !1); @@ -783,76 +783,76 @@ class $u { }); } } -tt = new WeakMap(), Br = new WeakMap(), St = new WeakMap(), Fn = new WeakMap(), Nt = new WeakMap(), ct = new WeakMap(), Ge = new WeakMap(), kt = new WeakMap(), Jt = new WeakMap(), vn = new WeakMap(), On = new WeakMap(), Zt = new WeakMap(), or = new WeakMap(), Ln = new WeakMap(), lr = new WeakMap(), ur = new WeakMap(), Qt = new WeakMap(), Mi = new WeakMap(), ye = new WeakSet(), co = function() { +ee = new WeakMap(), Br = new WeakMap(), Se = new WeakMap(), Fn = new WeakMap(), Ne = new WeakMap(), ce = new WeakMap(), Gt = new WeakMap(), ke = new WeakMap(), Je = new WeakMap(), vn = new WeakMap(), On = new WeakMap(), Ze = new WeakMap(), or = new WeakMap(), Ln = new WeakMap(), lr = new WeakMap(), ur = new WeakMap(), Qe = new WeakMap(), Mi = new WeakMap(), yt = new WeakSet(), co = function() { try { - L(this, ct, dt(() => v(this, Fn).call(this, v(this, tt)))); - } catch (t) { - this.error(t); + L(this, ce, de(() => v(this, Fn).call(this, v(this, ee)))); + } catch (e) { + this.error(e); } }, ho = function() { - const t = v(this, St).pending; - t && (L(this, Ge, dt(() => t(v(this, tt)))), _n(() => { - var n = Ae(this, ye, cs).call(this); - L(this, ct, Ae(this, ye, ui).call(this, () => (sn.ensure(), dt(() => v(this, Fn).call(this, n))))), v(this, Zt) > 0 ? Ae(this, ye, fi).call(this) : (Hn( + const e = v(this, Se).pending; + e && (L(this, Gt, de(() => e(v(this, ee)))), _n(() => { + var n = At(this, yt, cs).call(this); + L(this, ce, At(this, yt, ui).call(this, () => (sn.ensure(), de(() => v(this, Fn).call(this, n))))), v(this, Ze) > 0 ? At(this, yt, fi).call(this) : (Hn( /** @type {Effect} */ - v(this, Ge), + v(this, Gt), () => { - L(this, Ge, null); + L(this, Gt, null); } ), this.is_pending = !1); })); }, cs = function() { - var t = v(this, tt); - return this.is_pending && (L(this, vn, it()), v(this, tt).before(v(this, vn)), t = v(this, vn)), t; + var e = v(this, ee); + return this.is_pending && (L(this, vn, ie()), v(this, ee).before(v(this, vn)), e = v(this, vn)), e; }, /** * @param {() => Effect | null} fn */ -ui = function(t) { - var n = j, r = B, i = st; - It(v(this, Nt)), gt(v(this, Nt)), dr(v(this, Nt).ctx); +ui = function(e) { + var n = j, r = B, i = se; + Ie(v(this, Ne)), ge(v(this, Ne)), dr(v(this, Ne).ctx); try { - return t(); + return e(); } catch (s) { return ro(s), null; } finally { - It(n), gt(r), dr(i); + Ie(n), ge(r), dr(i); } }, fi = function() { - const t = ( + const e = ( /** @type {(anchor: Node) => void} */ - v(this, St).pending + v(this, Se).pending ); - v(this, ct) !== null && (L(this, Jt, document.createDocumentFragment()), v(this, Jt).append( + v(this, ce) !== null && (L(this, Je, document.createDocumentFragment()), v(this, Je).append( /** @type {TemplateNode} */ v(this, vn) - ), Mo(v(this, ct), v(this, Jt))), v(this, Ge) === null && L(this, Ge, dt(() => t(v(this, tt)))); + ), Mo(v(this, ce), v(this, Je))), v(this, Gt) === null && L(this, Gt, de(() => e(v(this, ee)))); }, /** * 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 * @param {1 | -1} d */ -hs = function(t) { +hs = function(e) { var n; if (!this.has_pending_snippet()) { - this.parent && Ae(n = this.parent, ye, hs).call(n, t); + this.parent && At(n = this.parent, yt, hs).call(n, e); return; } - if (L(this, Zt, v(this, Zt) + t), v(this, Zt) === 0) { + if (L(this, Ze, v(this, Ze) + e), v(this, Ze) === 0) { this.is_pending = !1; for (const r of v(this, lr)) - pe(r, ke), $t(r); + pt(r, kt), $e(r); for (const r of v(this, ur)) - pe(r, Et), $t(r); - v(this, lr).clear(), v(this, ur).clear(), v(this, Ge) && Hn(v(this, Ge), () => { - L(this, Ge, null); - }), v(this, Jt) && (v(this, tt).before(v(this, Jt)), L(this, Jt, null)); + pt(r, Ee), $e(r); + v(this, lr).clear(), v(this, ur).clear(), v(this, Gt) && Hn(v(this, Gt), () => { + L(this, Gt, null); + }), v(this, Je) && (v(this, ee).before(v(this, Je)), L(this, Je, null)); } }; -function Au(e, t, n, r) { +function Au(t, e, n, r) { const i = Yi; - var s = e.filter((c) => !c.settled); + var s = t.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { - r(t.map(i)); + r(e.map(i)); return; } var a = U, o = ( @@ -869,41 +869,41 @@ function Au(e, t, n, r) { a == null || a.deactivate(), ds(); } if (n.length === 0) { - u.then(() => f(t.map(i))); + u.then(() => f(e.map(i))); return; } function h() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ Tu(c))).then((c) => f([...t.map(i), ...c])).catch((c) => pr(c, o)); + l(), Promise.all(n.map((c) => /* @__PURE__ */ Tu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => pr(c, o)); } u ? u.then(h) : h(); } function Eu() { - var e = j, t = B, n = st, r = U; + var t = j, e = B, n = se, r = U; return function(s = !0) { - It(e), gt(t), dr(n), s && (r == null || r.activate()); + Ie(t), ge(e), dr(n), s && (r == null || r.activate()); }; } function ds() { - It(null), gt(null), dr(null); + Ie(null), ge(null), dr(null); } // @__NO_SIDE_EFFECTS__ -function Yi(e) { - var t = Ne | ke, n = B !== null && (B.f & Ne) !== 0 ? ( +function Yi(t) { + var e = Nt | kt, n = B !== null && (B.f & Nt) !== 0 ? ( /** @type {Derived} */ B ) : null; return j !== null && (j.f |= Gn), { - ctx: st, + ctx: se, deps: null, effects: null, equals: Qa, - f: t, - fn: e, + f: e, + fn: t, reactions: null, rv: 0, v: ( /** @type {V} */ - Ce + Ct ), wv: 0, parent: n ?? j, @@ -911,7 +911,7 @@ function Yi(e) { }; } // @__NO_SIDE_EFFECTS__ -function Tu(e, t, n) { +function Tu(t, e, n) { let r = ( /** @type {Effect | null} */ j @@ -926,14 +926,14 @@ function Tu(e, t, n) { void 0 ), a = Xn( /** @type {V} */ - Ce + Ct ), o = !B, l = /* @__PURE__ */ new Map(); return Fu(() => { var p; var u = Ua(); s = u.promise; try { - Promise.resolve(e()).then(u.resolve, u.reject).then(() => { + Promise.resolve(t()).then(u.resolve, u.reject).then(() => { f === U && f.committed && f.deactivate(), ds(); }); } catch (m) { @@ -974,74 +974,74 @@ function Tu(e, t, n) { }); } // @__NO_SIDE_EFFECTS__ -function cn(e) { - const t = /* @__PURE__ */ Yi(e); - return Po(t), t; +function cn(t) { + const e = /* @__PURE__ */ Yi(t); + return Po(e), e; } // @__NO_SIDE_EFFECTS__ -function po(e) { - const t = /* @__PURE__ */ Yi(e); - return t.equals = eo, t; -} -function Ru(e) { - var t = e.effects; - if (t !== null) { - e.effects = null; - for (var n = 0; n < t.length; n += 1) - Ye( +function po(t) { + const e = /* @__PURE__ */ Yi(t); + return e.equals = to, e; +} +function Ru(t) { + var e = t.effects; + if (e !== null) { + t.effects = null; + for (var n = 0; n < e.length; n += 1) + Yt( /** @type {Effect} */ - t[n] + e[n] ); } } -function Cu(e) { - for (var t = e.parent; t !== null; ) { - if ((t.f & Ne) === 0) - return (t.f & rn) === 0 ? ( +function Cu(t) { + for (var e = t.parent; e !== null; ) { + if ((e.f & Nt) === 0) + return (e.f & rn) === 0 ? ( /** @type {Effect} */ - t + e ) : null; - t = t.parent; + e = e.parent; } return null; } -function Ms(e) { - var t, n = j; - It(Cu(e)); +function Ms(t) { + var e, n = j; + Ie(Cu(t)); try { - e.f &= ~Bn, Ru(e), t = Oo(e); + t.f &= ~Bn, Ru(t), e = Oo(t); } finally { - It(n); + Ie(n); } - return t; + return e; } -function vo(e) { - var t = Ms(e); - if (!e.equals(t) && (e.wv = Io(), (!(U != null && U.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { - pe(e, Te); +function vo(t) { + var e = Ms(t); + if (!t.equals(e) && (t.wv = Io(), (!(U != null && U.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { + pt(t, Tt); return; } - wn || (Se !== null ? (Ds() || U != null && U.is_fork) && Se.set(e, t) : ks(e)); + wn || (St !== null ? (Ds() || U != null && U.is_fork) && St.set(t, e) : ks(t)); } -function Su(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(Sn), r.teardown = Kl, r.ac = null, Or(r, 0), Ls(r)); +function Su(t) { + var e, n; + if (t.effects !== null) + for (const r of t.effects) + (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(Sn), r.teardown = Kl, r.ac = null, Or(r, 0), Ls(r)); } -function go(e) { - if (e.effects !== null) - for (const t of e.effects) - t.teardown && gr(t); +function go(t) { + if (t.effects !== null) + for (const e of t.effects) + e.teardown && gr(e); } let ps = /* @__PURE__ */ new Set(); const mn = /* @__PURE__ */ new Map(); let _o = !1; -function Xn(e, t) { +function Xn(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors - v: e, + v: t, reactions: null, equals: Qa, rv: 0, @@ -1050,118 +1050,118 @@ function Xn(e, t) { return n; } // @__NO_SIDE_EFFECTS__ -function Ee(e, t) { - const n = Xn(e); +function Et(t, e) { + const n = Xn(t); return Po(n), n; } // @__NO_SIDE_EFFECTS__ -function mo(e, t = !1, n = !0) { - const r = Xn(e); - return t || (r.equals = eo), r; +function mo(t, e = !1, n = !0) { + const r = Xn(t); + return e || (r.equals = to), r; } -function de(e, t, n = !1) { +function dt(t, e, 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 - (!At || (B.f & oa) !== 0) && to() && (B.f & (Ne | ln | Ns | oa)) !== 0 && (vt === null || !cr.call(vt, e)) && hu(); - let r = n ? kn(t) : t; - return vr(e, r); -} -function vr(e, t) { - if (!e.equals(t)) { - var n = e.v; - wn ? mn.set(e, t) : mn.set(e, n), e.v = t; + (!Ae || (B.f & oa) !== 0) && eo() && (B.f & (Nt | ln | Ns | oa)) !== 0 && (ve === null || !cr.call(ve, t)) && hu(); + let r = n ? kn(e) : e; + return vr(t, r); +} +function vr(t, e) { + if (!t.equals(e)) { + var n = t.v; + wn ? mn.set(t, e) : mn.set(t, n), t.v = e; var r = sn.ensure(); - if (r.capture(e, n), (e.f & Ne) !== 0) { + if (r.capture(t, n), (t.f & Nt) !== 0) { const i = ( /** @type {Derived} */ - e + t ); - (e.f & ke) !== 0 && Ms(i), ks(i); + (t.f & kt) !== 0 && Ms(i), ks(i); } - e.wv = Io(), yo(e, ke), j !== null && (j.f & Te) !== 0 && (j.f & (Tt | xn)) === 0 && (ft === null ? qu([e]) : ft.push(e)), !r.is_fork && ps.size > 0 && !_o && Nu(); + t.wv = Io(), yo(t, kt), j !== null && (j.f & Tt) !== 0 && (j.f & (Te | xn)) === 0 && (fe === null ? qu([t]) : fe.push(t)), !r.is_fork && ps.size > 0 && !_o && Nu(); } - return t; + return e; } function Nu() { _o = !1; - for (const e of ps) - (e.f & Te) !== 0 && pe(e, Et), Gr(e) && gr(e); + for (const t of ps) + (t.f & Tt) !== 0 && pt(t, Ee), Gr(t) && gr(t); ps.clear(); } -function Ir(e) { - de(e, e.v + 1); +function Ir(t) { + dt(t, t.v + 1); } -function yo(e, t) { - var n = e.reactions; +function yo(t, e) { + var n = t.reactions; if (n !== null) for (var r = n.length, i = 0; i < r; i++) { - var s = n[i], a = s.f, o = (a & ke) === 0; - if (o && pe(s, t), (a & Ne) !== 0) { + var s = n[i], a = s.f, o = (a & kt) === 0; + if (o && pt(s, e), (a & Nt) !== 0) { var l = ( /** @type {Derived} */ s ); - Se == null || Se.delete(l), (a & Bn) === 0 && (a & pt && (s.f |= Bn), yo(l, Et)); - } else o && ((a & ln) !== 0 && wt !== null && wt.add( + St == null || St.delete(l), (a & Bn) === 0 && (a & pe && (s.f |= Bn), yo(l, Ee)); + } else o && ((a & ln) !== 0 && we !== null && we.add( /** @type {Effect} */ s - ), $t( + ), $e( /** @type {Effect} */ s )); } } -function kn(e) { - if (typeof e != "object" || e === null || Pr in e) - return e; - const t = Wa(e); - if (t !== Ul && t !== Gl) - return e; - var n = /* @__PURE__ */ new Map(), r = Xa(e), i = /* @__PURE__ */ Ee(0), s = Yn, a = (o) => { +function kn(t) { + if (typeof t != "object" || t === null || Pr in t) + return t; + const e = Wa(t); + if (e !== Ul && e !== Gl) + return t; + var n = /* @__PURE__ */ new Map(), r = Xa(t), i = /* @__PURE__ */ Et(0), s = Yn, a = (o) => { if (Yn === s) return o(); var l = B, u = Yn; - gt(null), ca(s); + ge(null), ca(s); var f = o(); - return gt(l), ca(u), f; + return ge(l), ca(u), f; }; - return r && n.set("length", /* @__PURE__ */ Ee( + return r && n.set("length", /* @__PURE__ */ Et( /** @type {any[]} */ - e.length + t.length )), new Proxy( /** @type {any} */ - e, + t, { defineProperty(o, l, u) { (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && fu(); var f = n.get(l); return f === void 0 ? a(() => { - var h = /* @__PURE__ */ Ee(u.value); + var h = /* @__PURE__ */ Et(u.value); return n.set(l, h), h; - }) : de(f, u.value, !0), !0; + }) : dt(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__ */ Ee(Ce)); + const f = a(() => /* @__PURE__ */ Et(Ct)); n.set(l, f), Ir(i); } } else - de(u, Ce), Ir(i); + dt(u, Ct), Ir(i); return !0; }, get(o, l, u) { var p; if (l === Pr) - return e; + return t; var f = n.get(l), h = l in o; if (f === void 0 && (!h || (p = Vn(o, l)) != null && p.writable) && (f = a(() => { - var m = kn(h ? o[l] : Ce), $ = /* @__PURE__ */ Ee(m); + var m = kn(h ? o[l] : Ct), $ = /* @__PURE__ */ Et(m); return $; }), n.set(l, f)), f !== void 0) { var c = b(f); - return c === Ce ? void 0 : c; + return c === Ct ? void 0 : c; } return Reflect.get(o, l, u); }, @@ -1172,7 +1172,7 @@ function kn(e) { f && (u.value = b(f)); } else if (u === void 0) { var h = n.get(l), c = h == null ? void 0 : h.v; - if (h !== void 0 && c !== Ce) + if (h !== void 0 && c !== Ct) return { enumerable: !0, configurable: !0, @@ -1186,14 +1186,14 @@ function kn(e) { var c; if (l === Pr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== Ce || Reflect.has(o, l); + var u = n.get(l), f = u !== void 0 && u.v !== Ct || Reflect.has(o, l); if (u !== void 0 || j !== null && (!f || (c = Vn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { - var p = f ? kn(o[l]) : Ce, m = /* @__PURE__ */ Ee(p); + var p = f ? kn(o[l]) : Ct, m = /* @__PURE__ */ Et(p); return m; }), n.set(l, u)); var h = b(u); - if (h === Ce) + if (h === Ct) return !1; } return f; @@ -1205,14 +1205,14 @@ function kn(e) { for (var p = u; p < /** @type {Source} */ h.v; p += 1) { var m = n.get(p + ""); - m !== void 0 ? de(m, Ce) : p in o && (m = a(() => /* @__PURE__ */ Ee(Ce)), n.set(p + "", m)); + m !== void 0 ? dt(m, Ct) : p in o && (m = a(() => /* @__PURE__ */ Et(Ct)), n.set(p + "", m)); } if (h === void 0) - (!c || (S = Vn(o, l)) != null && S.writable) && (h = a(() => /* @__PURE__ */ Ee(void 0)), de(h, kn(u)), n.set(l, h)); + (!c || (S = Vn(o, l)) != null && S.writable) && (h = a(() => /* @__PURE__ */ Et(void 0)), dt(h, kn(u)), n.set(l, h)); else { - c = h.v !== Ce; + c = h.v !== Ct; var $ = a(() => kn(u)); - de(h, $); + dt(h, $); } var _ = Reflect.getOwnPropertyDescriptor(o, l); if (_ != null && _.set && _.set.call(f, u), !c) { @@ -1221,7 +1221,7 @@ function kn(e) { /** @type {Source} */ n.get("length") ), F = Number(l); - Number.isInteger(F) && F >= x.v && de(x, F + 1); + Number.isInteger(F) && F >= x.v && dt(x, F + 1); } Ir(i); } @@ -1231,10 +1231,10 @@ function kn(e) { b(i); var l = Reflect.ownKeys(o).filter((h) => { var c = n.get(h); - return c === void 0 || c.v !== Ce; + return c === void 0 || c.v !== Ct; }); for (var [u, f] of n) - f.v !== Ce && !(u in o) && l.push(u); + f.v !== Ct && !(u in o) && l.push(u); return l; }, setPrototypeOf() { @@ -1247,51 +1247,51 @@ var ua, wo, xo, bo; function vs() { if (ua === void 0) { ua = window, wo = /Firefox/.test(navigator.userAgent); - var e = Element.prototype, t = Node.prototype, n = Text.prototype; - xo = Vn(t, "firstChild").get, bo = Vn(t, "nextSibling").get, aa(e) && (e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0), aa(n) && (n.__t = void 0); + var t = Element.prototype, e = Node.prototype, n = Text.prototype; + xo = Vn(e, "firstChild").get, bo = Vn(e, "nextSibling").get, aa(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), aa(n) && (n.__t = void 0); } } -function it(e = "") { - return document.createTextNode(e); +function ie(t = "") { + return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function an(e) { +function an(t) { return ( /** @type {TemplateNode | null} */ - xo.call(e) + xo.call(t) ); } // @__NO_SIDE_EFFECTS__ -function Ot(e) { +function Oe(t) { return ( /** @type {TemplateNode | null} */ - bo.call(e) + bo.call(t) ); } -function Ue(e, t) { +function Ut(t, e) { if (!G) - return /* @__PURE__ */ an(e); + return /* @__PURE__ */ an(t); var n = /* @__PURE__ */ an(X); if (n === null) - n = X.appendChild(it()); - else if (t && n.nodeType !== Ur) { - var r = it(); - return n == null || n.before(r), He(r), r; + n = X.appendChild(ie()); + else if (e && n.nodeType !== Ur) { + var r = ie(); + return n == null || n.before(r), Ht(r), r; } - return t && zi( + return e && zi( /** @type {Text} */ n - ), He(n), n; + ), Ht(n), n; } -function dn(e, t = !1) { +function dn(t, e = !1) { if (!G) { - var n = /* @__PURE__ */ an(e); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ot(n) : n; + var n = /* @__PURE__ */ an(t); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Oe(n) : n; } - if (t) { + if (e) { if ((X == null ? void 0 : X.nodeType) !== Ur) { - var r = it(); - return X == null || X.before(r), He(r), r; + var r = ie(); + return X == null || X.before(r), Ht(r), r; } zi( /** @type {Text} */ @@ -1300,74 +1300,74 @@ function dn(e, t = !1) { } return X; } -function Qe(e, t = 1, n = !1) { - let r = G ? X : e; - for (var i; t--; ) +function Qt(t, e = 1, n = !1) { + let r = G ? X : t; + for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Ot(r); + /* @__PURE__ */ Oe(r); if (!G) return r; if (n) { if ((r == null ? void 0 : r.nodeType) !== Ur) { - var s = it(); - return r === null ? i == null || i.after(s) : r.before(s), He(s), s; + var s = ie(); + return r === null ? i == null || i.after(s) : r.before(s), Ht(s), s; } zi( /** @type {Text} */ r ); } - return He(r), r; + return Ht(r), r; } -function $o(e) { - e.textContent = ""; +function $o(t) { + t.textContent = ""; } function Ao() { return !1; } -function Ps(e, t, n) { +function Ps(t, e, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Ba, e, void 0) + document.createElementNS(Ba, t, void 0) ); } -function zi(e) { +function zi(t) { if ( /** @type {string} */ - e.nodeValue.length < 65536 + t.nodeValue.length < 65536 ) return; - let t = e.nextSibling; - for (; t !== null && t.nodeType === Ur; ) - t.remove(), e.nodeValue += /** @type {string} */ - t.nodeValue, t = e.nextSibling; -} -function Eo(e) { - var t = B, n = j; - gt(null), It(null); + let e = t.nextSibling; + for (; e !== null && e.nodeType === Ur; ) + e.remove(), t.nodeValue += /** @type {string} */ + e.nodeValue, e = t.nextSibling; +} +function Eo(t) { + var e = B, n = j; + ge(null), Ie(null); try { - return e(); + return t(); } finally { - gt(t), It(n); + ge(e), Ie(n); } } -function ku(e) { +function ku(t) { j === null && (B === null && au(), su()), wn && iu(); } -function Mu(e, t) { - var n = t.last; - n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); +function Mu(t, e) { + var n = e.last; + n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function Lt(e, t, n) { +function Le(t, e, n) { var r = j; - r !== null && (r.f & rt) !== 0 && (e |= rt); + r !== null && (r.f & re) !== 0 && (t |= re); var i = { - ctx: st, + ctx: se, deps: null, nodes: null, - f: e | ke | pt, + f: t | kt | pe, first: null, - fn: t, + fn: e, last: null, next: null, parent: r, @@ -1381,12 +1381,12 @@ function Lt(e, t, n) { try { gr(i); } catch (o) { - throw Ye(i), o; + throw Yt(i), o; } - else t !== null && $t(i); + else e !== null && $e(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 & Gn) === 0 && (s = s.first, (e & ln) !== 0 && (e & hr) !== 0 && s !== null && (s.f |= hr)), s !== null && (s.parent = r, r !== null && Mu(s, r), B !== null && (B.f & Ne) !== 0 && (e & xn) === 0)) { + (s.f & Gn) === 0 && (s = s.first, (t & ln) !== 0 && (t & hr) !== 0 && s !== null && (s.f |= hr)), s !== null && (s.parent = r, r !== null && Mu(s, r), B !== null && (B.f & Nt) !== 0 && (t & xn) === 0)) { var a = ( /** @type {Derived} */ B @@ -1396,126 +1396,126 @@ function Lt(e, t, n) { return i; } function Ds() { - return B !== null && !At; + return B !== null && !Ae; } -function Pu(e) { - const t = Lt(Fi, null, !1); - return pe(t, Te), t.teardown = e, t; +function Pu(t) { + const e = Le(Fi, null, !1); + return pt(e, Tt), e.teardown = t, e; } -function Is(e) { +function Is(t) { ku(); - var t = ( + var e = ( /** @type {Effect} */ j.f - ), n = !B && (t & Tt) !== 0 && (t & yr) === 0; + ), n = !B && (e & Te) !== 0 && (e & yr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - st + se ); - (r.e ?? (r.e = [])).push(e); + (r.e ?? (r.e = [])).push(t); } else - return To(e); + return To(t); } -function To(e) { - return Lt(Fr | Zl, e, !1); +function To(t) { + return Le(Fr | Zl, t, !1); } -function Du(e) { +function Du(t) { sn.ensure(); - const t = Lt(xn | Gn, e, !0); + const e = Le(xn | Gn, t, !0); return () => { - Ye(t); + Yt(e); }; } -function Iu(e) { +function Iu(t) { sn.ensure(); - const t = Lt(xn | Gn, e, !0); + const e = Le(xn | Gn, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Hn(t, () => { - Ye(t), r(void 0); - }) : (Ye(t), r(void 0)); + n.outro ? Hn(e, () => { + Yt(e), r(void 0); + }) : (Yt(e), r(void 0)); }); } -function Ro(e) { - return Lt(Fr, e, !1); +function Ro(t) { + return Le(Fr, t, !1); } -function Fu(e) { - return Lt(Ns | Gn, e, !0); +function Fu(t) { + return Le(Ns | Gn, t, !0); } -function Fs(e, t = 0) { - return Lt(Fi | t, e, !0); +function Fs(t, e = 0) { + return Le(Fi | e, t, !0); } -function Kt(e, t = [], n = [], r = []) { - Au(r, t, n, (i) => { - Lt(Fi, () => e(...i.map(b)), !0); +function Ke(t, e = [], n = [], r = []) { + Au(r, e, n, (i) => { + Le(Fi, () => t(...i.map(b)), !0); }); } -function Os(e, t = 0) { - var n = Lt(ln | t, e, !0); +function Os(t, e = 0) { + var n = Le(ln | e, t, !0); return n; } -function dt(e) { - return Lt(Tt | Gn, e, !0); +function de(t) { + return Le(Te | Gn, t, !0); } -function Co(e) { - var t = e.teardown; - if (t !== null) { +function Co(t) { + var e = t.teardown; + if (e !== null) { const n = wn, r = B; - fa(!0), gt(null); + fa(!0), ge(null); try { - t.call(null); + e.call(null); } finally { - fa(n), gt(r); + fa(n), ge(r); } } } -function Ls(e, t = !1) { - var n = e.first; - for (e.first = e.last = null; n !== null; ) { +function Ls(t, e = !1) { + var n = t.first; + for (t.first = t.last = null; n !== null; ) { const i = n.ac; i !== null && Eo(() => { i.abort(Sn); }); var r = n.next; - (n.f & xn) !== 0 ? n.parent = null : Ye(n, t), n = r; + (n.f & xn) !== 0 ? n.parent = null : Yt(n, e), n = r; } } -function Ou(e) { - for (var t = e.first; t !== null; ) { - var n = t.next; - (t.f & Tt) === 0 && Ye(t), t = n; +function Ou(t) { + for (var e = t.first; e !== null; ) { + var n = e.next; + (e.f & Te) === 0 && Yt(e), e = n; } } -function Ye(e, t = !0) { +function Yt(t, e = !0) { var n = !1; - (t || (e.f & ja) !== 0) && e.nodes !== null && e.nodes.end !== null && (Lu( - e.nodes.start, + (e || (t.f & ja) !== 0) && t.nodes !== null && t.nodes.end !== null && (Lu( + t.nodes.start, /** @type {TemplateNode} */ - e.nodes.end - ), n = !0), Ls(e, t && !n), Or(e, 0), pe(e, rn); - var r = e.nodes && e.nodes.t; + t.nodes.end + ), n = !0), Ls(t, e && !n), Or(t, 0), pt(t, rn); + var r = t.nodes && t.nodes.t; if (r !== null) for (const s of r) s.stop(); - Co(e); - var i = e.parent; - i !== null && i.first !== null && So(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = null; + Co(t); + var i = t.parent; + i !== null && i.first !== null && So(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; } -function Lu(e, t) { - for (; e !== null; ) { - var n = e === t ? null : /* @__PURE__ */ Ot(e); - e.remove(), e = n; +function Lu(t, e) { + for (; t !== null; ) { + var n = t === e ? null : /* @__PURE__ */ Oe(t); + t.remove(), t = n; } } -function So(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 So(t) { + var e = t.parent, n = t.prev, r = t.next; + n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); } -function Hn(e, t, n = !0) { +function Hn(t, e, n = !0) { var r = []; - No(e, r, !0); + No(t, r, !0); var i = () => { - n && Ye(e), t && t(); + n && Yt(t), e && e(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1524,80 +1524,80 @@ function Hn(e, t, n = !0) { } else i(); } -function No(e, t, n) { - if ((e.f & rt) === 0) { - e.f ^= rt; - var r = e.nodes && e.nodes.t; +function No(t, e, n) { + if ((t.f & re) === 0) { + t.f ^= re; + var r = t.nodes && t.nodes.t; if (r !== null) for (const o of r) - (o.is_global || n) && t.push(o); - for (var i = e.first; i !== null; ) { + (o.is_global || n) && e.push(o); + for (var i = t.first; i !== null; ) { var s = i.next, a = (i.f & hr) !== 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 & Tt) !== 0 && (e.f & ln) !== 0; - No(i, t, a ? n : !1), i = s; + (i.f & Te) !== 0 && (t.f & ln) !== 0; + No(i, e, a ? n : !1), i = s; } } } -function qs(e) { - ko(e, !0); +function qs(t) { + ko(t, !0); } -function ko(e, t) { - if ((e.f & rt) !== 0) { - e.f ^= rt, (e.f & Te) === 0 && (pe(e, ke), $t(e)); - for (var n = e.first; n !== null; ) { - var r = n.next, i = (n.f & hr) !== 0 || (n.f & Tt) !== 0; - ko(n, i ? t : !1), n = r; +function ko(t, e) { + if ((t.f & re) !== 0) { + t.f ^= re, (t.f & Tt) === 0 && (pt(t, kt), $e(t)); + for (var n = t.first; n !== null; ) { + var r = n.next, i = (n.f & hr) !== 0 || (n.f & Te) !== 0; + ko(n, i ? e : !1), n = r; } - var s = e.nodes && e.nodes.t; + var s = t.nodes && t.nodes.t; if (s !== null) for (const a of s) - (a.is_global || t) && a.in(); + (a.is_global || e) && a.in(); } } -function Mo(e, t) { - if (e.nodes) - for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Ot(n); - t.append(n), n = i; +function Mo(t, e) { + if (t.nodes) + for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { + var i = n === r ? null : /* @__PURE__ */ Oe(n); + e.append(n), n = i; } } let ci = !1, wn = !1; -function fa(e) { - wn = e; +function fa(t) { + wn = t; } -let B = null, At = !1; -function gt(e) { - B = e; +let B = null, Ae = !1; +function ge(t) { + B = t; } let j = null; -function It(e) { - j = e; +function Ie(t) { + j = t; } -let vt = null; -function Po(e) { - B !== null && (vt === null ? vt = [e] : vt.push(e)); +let ve = null; +function Po(t) { + B !== null && (ve === null ? ve = [t] : ve.push(t)); } -let Je = null, et = 0, ft = null; -function qu(e) { - ft = e; +let Jt = null, te = 0, fe = null; +function qu(t) { + fe = t; } let Do = 1, Mn = 0, Yn = Mn; -function ca(e) { - Yn = e; +function ca(t) { + Yn = t; } function Io() { return ++Do; } -function Gr(e) { - var t = e.f; - if ((t & ke) !== 0) +function Gr(t) { + var e = t.f; + if ((e & kt) !== 0) return !0; - if (t & Ne && (e.f &= ~Bn), (t & Et) !== 0) { + if (e & Nt && (t.f &= ~Bn), (e & Ee) !== 0) { for (var n = ( /** @type {Value[]} */ - e.deps + t.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; if (Gr( @@ -1606,231 +1606,231 @@ function Gr(e) { ) && vo( /** @type {Derived} */ s - ), s.wv > e.wv) + ), s.wv > t.wv) return !0; } - (t & pt) !== 0 && // During time traveling we don't want to reset the status so that + (e & pe) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - Se === null && pe(e, Te); + St === null && pt(t, Tt); } return !1; } -function Fo(e, t, n = !0) { - var r = e.reactions; - if (r !== null && !(vt !== null && cr.call(vt, e))) +function Fo(t, e, n = !0) { + var r = t.reactions; + if (r !== null && !(ve !== null && cr.call(ve, t))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Ne) !== 0 ? Fo( + (s.f & Nt) !== 0 ? Fo( /** @type {Derived} */ s, - t, + e, !1 - ) : t === s && (n ? pe(s, ke) : (s.f & Te) !== 0 && pe(s, Et), $t( + ) : e === s && (n ? pt(s, kt) : (s.f & Tt) !== 0 && pt(s, Ee), $e( /** @type {Effect} */ s )); } } -function Oo(e) { +function Oo(t) { var $; - var t = Je, n = et, r = ft, i = B, s = vt, a = st, o = At, l = Yn, u = e.f; - Je = /** @type {null | Value[]} */ - null, et = 0, ft = null, B = (u & (Tt | xn)) === 0 ? e : null, vt = null, dr(e.ctx), At = !1, Yn = ++Mn, e.ac !== null && (Eo(() => { - e.ac.abort(Sn); - }), e.ac = null); + var e = Jt, n = te, r = fe, i = B, s = ve, a = se, o = Ae, l = Yn, u = t.f; + Jt = /** @type {null | Value[]} */ + null, te = 0, fe = null, B = (u & (Te | xn)) === 0 ? t : null, ve = null, dr(t.ctx), Ae = !1, Yn = ++Mn, t.ac !== null && (Eo(() => { + t.ac.abort(Sn); + }), t.ac = null); try { - e.f |= as; + t.f |= as; var f = ( /** @type {Function} */ - e.fn + t.fn ), h = f(); - e.f |= yr; - var c = e.deps, p = U == null ? void 0 : U.is_fork; - if (Je !== null) { + t.f |= yr; + var c = t.deps, p = U == null ? void 0 : U.is_fork; + if (Jt !== null) { var m; - if (p || Or(e, et), c !== null && et > 0) - for (c.length = et + Je.length, m = 0; m < Je.length; m++) - c[et + m] = Je[m]; + if (p || Or(t, te), c !== null && te > 0) + for (c.length = te + Jt.length, m = 0; m < Jt.length; m++) + c[te + m] = Jt[m]; else - e.deps = c = Je; - if (Ds() && (e.f & pt) !== 0) - for (m = et; m < c.length; m++) - (($ = c[m]).reactions ?? ($.reactions = [])).push(e); - } else !p && c !== null && et < c.length && (Or(e, et), c.length = et); - if (to() && ft !== null && !At && c !== null && (e.f & (Ne | Et | ke)) === 0) + t.deps = c = Jt; + if (Ds() && (t.f & pe) !== 0) + for (m = te; m < c.length; m++) + (($ = c[m]).reactions ?? ($.reactions = [])).push(t); + } else !p && c !== null && te < c.length && (Or(t, te), c.length = te); + if (eo() && fe !== null && !Ae && c !== null && (t.f & (Nt | Ee | kt)) === 0) for (m = 0; m < /** @type {Source[]} */ - ft.length; m++) + fe.length; m++) Fo( - ft[m], + fe[m], /** @type {Effect} */ - e + t ); - if (i !== null && i !== e) { + if (i !== null && i !== t) { if (Mn++, i.deps !== null) for (let _ = 0; _ < n; _ += 1) i.deps[_].rv = Mn; - if (t !== null) - for (const _ of t) + if (e !== null) + for (const _ of e) _.rv = Mn; - ft !== null && (r === null ? r = ft : r.push(.../** @type {Source[]} */ - ft)); + fe !== null && (r === null ? r = fe : r.push(.../** @type {Source[]} */ + fe)); } - return (e.f & gn) !== 0 && (e.f ^= gn), h; + return (t.f & gn) !== 0 && (t.f ^= gn), h; } catch (_) { return ro(_); } finally { - e.f ^= as, Je = t, et = n, ft = r, B = i, vt = s, dr(a), At = o, Yn = l; + t.f ^= as, Jt = e, te = n, fe = r, B = i, ve = s, dr(a), Ae = o, Yn = l; } } -function Vu(e, t) { - let n = t.reactions; +function Vu(t, e) { + let n = e.reactions; if (n !== null) { - var r = Xl.call(n, e); + var r = Xl.call(n, t); if (r !== -1) { var i = n.length - 1; - i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop()); + i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (t.f & Ne) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (e.f & Nt) !== 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 - (Je === null || !cr.call(Je, t))) { + (Jt === null || !cr.call(Jt, e))) { var s = ( /** @type {Derived} */ - t + e ); - (s.f & pt) !== 0 && (s.f ^= pt, s.f &= ~Bn), ks(s), Su(s), Or(s, 0); + (s.f & pe) !== 0 && (s.f ^= pe, s.f &= ~Bn), ks(s), Su(s), Or(s, 0); } } -function Or(e, t) { - var n = e.deps; +function Or(t, e) { + var n = t.deps; if (n !== null) - for (var r = t; r < n.length; r++) - Vu(e, n[r]); + for (var r = e; r < n.length; r++) + Vu(t, n[r]); } -function gr(e) { - var t = e.f; - if ((t & rn) === 0) { - pe(e, Te); +function gr(t) { + var e = t.f; + if ((e & rn) === 0) { + pt(t, Tt); var n = j, r = ci; - j = e, ci = !0; + j = t, ci = !0; try { - (t & (ln | Ga)) !== 0 ? Ou(e) : Ls(e), Co(e); - var i = Oo(e); - e.teardown = typeof i == "function" ? i : null, e.wv = Do; + (e & (ln | Ga)) !== 0 ? Ou(t) : Ls(t), Co(t); + var i = Oo(t); + t.teardown = typeof i == "function" ? i : null, t.wv = Do; var s; - ss && gu && (e.f & ke) !== 0 && e.deps; + ss && gu && (t.f & kt) !== 0 && t.deps; } finally { ci = r, j = n; } } } -function b(e) { - var t = e.f, n = (t & Ne) !== 0; - if (B !== null && !At) { +function b(t) { + var e = t.f, n = (e & Nt) !== 0; + if (B !== null && !Ae) { var r = j !== null && (j.f & rn) !== 0; - if (!r && (vt === null || !cr.call(vt, e))) { + if (!r && (ve === null || !cr.call(ve, t))) { var i = B.deps; if ((B.f & as) !== 0) - e.rv < Mn && (e.rv = Mn, Je === null && i !== null && i[et] === e ? et++ : Je === null ? Je = [e] : Je.push(e)); + t.rv < Mn && (t.rv = Mn, Jt === null && i !== null && i[te] === t ? te++ : Jt === null ? Jt = [t] : Jt.push(t)); else { - (B.deps ?? (B.deps = [])).push(e); - var s = e.reactions; - s === null ? e.reactions = [B] : cr.call(s, B) || s.push(B); + (B.deps ?? (B.deps = [])).push(t); + var s = t.reactions; + s === null ? t.reactions = [B] : cr.call(s, B) || s.push(B); } } } - if (wn && mn.has(e)) - return mn.get(e); + if (wn && mn.has(t)) + return mn.get(t); if (n) { var a = ( /** @type {Derived} */ - e + t ); if (wn) { var o = a.v; - return ((a.f & Te) === 0 && a.reactions !== null || qo(a)) && (o = Ms(a)), mn.set(a, o), o; + return ((a.f & Tt) === 0 && a.reactions !== null || qo(a)) && (o = Ms(a)), mn.set(a, o), o; } - var l = (a.f & pt) === 0 && !At && B !== null && (ci || (B.f & pt) !== 0), u = (a.f & yr) === 0; - Gr(a) && (l && (a.f |= pt), vo(a)), l && !u && (go(a), Lo(a)); - } - if (Se != null && Se.has(e)) - return Se.get(e); - if ((e.f & gn) !== 0) - throw e.v; - return e.v; -} -function Lo(e) { - if (e.f |= pt, e.deps !== null) - for (const t of e.deps) - (t.reactions ?? (t.reactions = [])).push(e), (t.f & Ne) !== 0 && (t.f & pt) === 0 && (go( + var l = (a.f & pe) === 0 && !Ae && B !== null && (ci || (B.f & pe) !== 0), u = (a.f & yr) === 0; + Gr(a) && (l && (a.f |= pe), vo(a)), l && !u && (go(a), Lo(a)); + } + if (St != null && St.has(t)) + return St.get(t); + if ((t.f & gn) !== 0) + throw t.v; + return t.v; +} +function Lo(t) { + if (t.f |= pe, t.deps !== null) + for (const e of t.deps) + (e.reactions ?? (e.reactions = [])).push(t), (e.f & Nt) !== 0 && (e.f & pe) === 0 && (go( /** @type {Derived} */ - t + e ), Lo( /** @type {Derived} */ - t + e )); } -function qo(e) { - if (e.v === Ce) return !0; - if (e.deps === null) return !1; - for (const t of e.deps) - if (mn.has(t) || (t.f & Ne) !== 0 && qo( +function qo(t) { + if (t.v === Ct) return !0; + if (t.deps === null) return !1; + for (const e of t.deps) + if (mn.has(e) || (e.f & Nt) !== 0 && qo( /** @type {Derived} */ - t + e )) return !0; return !1; } -function Bi(e) { - var t = At; +function Bi(t) { + var e = Ae; try { - return At = !0, e(); + return Ae = !0, t(); } finally { - At = t; + Ae = e; } } const Vo = /* @__PURE__ */ new Set(), gs = /* @__PURE__ */ new Set(); -function Hu(e) { - for (var t = 0; t < e.length; t++) - Vo.add(e[t]); +function Hu(t) { + for (var e = 0; e < t.length; e++) + Vo.add(t[e]); for (var n of gs) - n(e); + n(t); } let ha = null; -function da(e) { +function da(t) { var _; - var t = this, n = ( + var e = this, n = ( /** @type {Node} */ - t.ownerDocument - ), r = e.type, i = ((_ = e.composedPath) == null ? void 0 : _.call(e)) || [], s = ( + e.ownerDocument + ), r = t.type, i = ((_ = t.composedPath) == null ? void 0 : _.call(t)) || [], s = ( /** @type {null | Element} */ - i[0] || e.target + i[0] || t.target ); - ha = e; - var a = 0, o = ha === e && e.__root; + ha = t; + var a = 0, o = ha === t && t.__root; if (o) { var l = i.indexOf(o); - if (l !== -1 && (t === document || t === /** @type {any} */ + if (l !== -1 && (e === document || e === /** @type {any} */ window)) { - e.__root = t; + t.__root = e; return; } - var u = i.indexOf(t); + var u = i.indexOf(e); if (u === -1) return; l <= u && (a = l); } if (s = /** @type {Element} */ - i[a] || e.target, s !== t) { - bi(e, "currentTarget", { + i[a] || t.target, s !== e) { + bi(t, "currentTarget", { configurable: !0, get() { return s || n; } }); var f = B, h = j; - gt(null), It(null); + ge(null), Ie(null); try { for (var c, p = []; s !== null; ) { var m = s.assignedSlot || s.parentNode || /** @type {any} */ @@ -1840,11 +1840,11 @@ function da(e) { $ != 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) && $.call(s, e); + t.target === s) && $.call(s, t); } catch (x) { c ? p.push(x) : c = x; } - if (e.cancelBubble || m === t || m === null) + if (t.cancelBubble || m === e || m === null) break; s = m; } @@ -1856,7 +1856,7 @@ function da(e) { throw c; } } finally { - e.__root = t, delete e.currentTarget, gt(f), It(h); + t.__root = e, delete t.currentTarget, ge(f), Ie(h); } } } @@ -1865,33 +1865,33 @@ const Qi = (Ya = (Ha = globalThis == null ? void 0 : globalThis.window) == null "svelte-trusted-html", { /** @param {string} html */ - createHTML: (e) => e + createHTML: (t) => t } ); -function Yu(e) { +function Yu(t) { return ( /** @type {string} */ - (Qi == null ? void 0 : Qi.createHTML(e)) ?? e + (Qi == null ? void 0 : Qi.createHTML(t)) ?? t ); } -function Ho(e, t = !1) { +function Ho(t, e = !1) { var n = Ps("template"); - return e = e.replaceAll("", ""), n.innerHTML = t ? Yu(e) : e, n.content; + return t = t.replaceAll("", ""), n.innerHTML = e ? Yu(t) : t, n.content; } -function yn(e, t) { +function yn(t, e) { var n = ( /** @type {Effect} */ j ); - n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); + n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function qt(e, t) { - var n = (t & zl) !== 0, r = (t & Bl) !== 0, i, s = !e.startsWith(""); +function qe(t, e) { + var n = (e & zl) !== 0, r = (e & Bl) !== 0, i, s = !t.startsWith(""); return () => { if (G) return yn(X, null), X; - i === void 0 && (i = Ho(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ + i === void 0 && (i = Ho(s ? t : "" + t, !0), n || (i = /** @type {TemplateNode} */ /* @__PURE__ */ an(i))); var a = ( /** @type {TemplateNode} */ @@ -1912,8 +1912,8 @@ function qt(e, t) { }; } // @__NO_SIDE_EFFECTS__ -function zu(e, t, n = "svg") { - var r = !e.startsWith(""), i = `<${n}>${r ? e : "" + e}`, s; +function zu(t, e, n = "svg") { + var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { if (G) return yn(X, null), X; @@ -1936,21 +1936,21 @@ function zu(e, t, n = "svg") { }; } // @__NO_SIDE_EFFECTS__ -function Bu(e, t) { - return /* @__PURE__ */ zu(e, t, "svg"); +function Bu(t, e) { + return /* @__PURE__ */ zu(t, e, "svg"); } -function pa(e = "") { +function pa(t = "") { if (!G) { - var t = it(e + ""); - return yn(t, t), t; + var e = ie(t + ""); + return yn(e, e), e; } var n = X; - return n.nodeType !== Ur ? (n.before(n = it()), He(n)) : zi( + return n.nodeType !== Ur ? (n.before(n = ie()), Ht(n)) : zi( /** @type {Text} */ n ), yn(n, n), n; } -function Ke(e, t) { +function Kt(t, e) { if (G) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ @@ -1959,49 +1959,49 @@ function Ke(e, t) { ((n.f & yr) === 0 || n.nodes.end === null) && (n.nodes.end = X), Li(); return; } - e !== null && e.before( + t !== null && t.before( /** @type {Node} */ - t + e ); } const Xu = ["touchstart", "touchmove"]; -function Wu(e) { - return Xu.includes(e); +function Wu(t) { + return Xu.includes(t); } -function pn(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 pn(t, e) { + var n = e == null ? "" : typeof e == "object" ? e + "" : e; + n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); } -function Yo(e, t) { - return zo(e, t); +function Yo(t, e) { + return zo(t, e); } -function Uu(e, t) { - vs(), t.intro = t.intro ?? !1; - const n = t.target, r = G, i = X; +function Uu(t, e) { + vs(), e.intro = e.intro ?? !1; + const n = e.target, r = G, i = X; try { for (var s = /* @__PURE__ */ an(n); s && (s.nodeType !== wr || /** @type {Comment} */ s.data !== Cs); ) - s = /* @__PURE__ */ Ot(s); + s = /* @__PURE__ */ Oe(s); if (!s) throw fr; - nn(!0), He( + nn(!0), Ht( /** @type {Comment} */ s ); - const a = zo(e, { ...t, anchor: s }); + const a = zo(t, { ...e, anchor: s }); return nn(!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 && lu(), vs(), $o(n), nn(!1), Yo(e, t); + return a !== fr && console.warn("Failed to hydrate: ", a), e.recover === !1 && lu(), vs(), $o(n), nn(!1), Yo(t, e); } finally { - nn(r), He(i); + nn(r), Ht(i); } } const ni = /* @__PURE__ */ new Map(); -function zo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { +function zo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { vs(); var o = /* @__PURE__ */ new Set(), l = (h) => { for (var c = 0; c < h.length; c++) { @@ -2009,7 +2009,7 @@ function zo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int if (!o.has(p)) { o.add(p); var m = Wu(p); - for (const x of [t, document]) { + for (const x of [e, document]) { var $ = ni.get(x); $ === void 0 && ($ = /* @__PURE__ */ new Map(), ni.set(x, $)); var _ = $.get(p); @@ -2020,7 +2020,7 @@ function zo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int }; l(Ii(Vo)), gs.add(l); var u = void 0, f = Iu(() => { - var h = n ?? t.appendChild(it()); + var h = n ?? e.appendChild(ie()); return bu( /** @type {TemplateNode} */ h, @@ -2032,13 +2032,13 @@ function zo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int qi({}); var p = ( /** @type {ComponentContext} */ - st + se ); if (s && (p.c = s), i && (r.$$events = i), G && yn( /** @type {TemplateNode} */ c, null - ), u = e(c, r) || {}, G && (j.nodes.end = X, X === null || X.nodeType !== wr || /** @type {Comment} */ + ), u = t(c, r) || {}, G && (j.nodes.end = X, X === null || X.nodeType !== wr || /** @type {Comment} */ X.data !== Ss)) throw Oi(), fr; Vi(); @@ -2046,7 +2046,7 @@ function zo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int ), () => { var $; for (var c of o) - for (const _ of [t, document]) { + for (const _ of [e, document]) { var p = ( /** @type {Map} */ ni.get(_) @@ -2062,21 +2062,21 @@ function zo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int return _s.set(u, f), u; } let _s = /* @__PURE__ */ new WeakMap(); -function Gu(e, t) { - const n = _s.get(e); - return n ? (_s.delete(e), n(t)) : Promise.resolve(); +function Gu(t, e) { + const n = _s.get(t); + return n ? (_s.delete(t), n(e)) : Promise.resolve(); } -var xt, Mt, nt, qn, Xr, Wr, Pi; +var xe, Me, ne, qn, Xr, Wr, Pi; class Ku { /** * @param {TemplateNode} anchor * @param {boolean} transition */ - constructor(t, n = !0) { + constructor(e, n = !0) { /** @type {TemplateNode} */ - he(this, "anchor"); + ht(this, "anchor"); /** @type {Map} */ - V(this, xt, /* @__PURE__ */ new Map()); + V(this, xe, /* @__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,13 +2091,13 @@ class Ku { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - V(this, Mt, /* @__PURE__ */ new Map()); + V(this, Me, /* @__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} */ - V(this, nt, /* @__PURE__ */ new Map()); + V(this, ne, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} @@ -2109,36 +2109,36 @@ class Ku { */ V(this, Xr, !0); V(this, Wr, () => { - var t = ( + var e = ( /** @type {Batch} */ U ); - if (v(this, xt).has(t)) { + if (v(this, xe).has(e)) { var n = ( /** @type {Key} */ - v(this, xt).get(t) - ), r = v(this, Mt).get(n); + v(this, xe).get(e) + ), r = v(this, Me).get(n); if (r) qs(r), v(this, qn).delete(n); else { - var i = v(this, nt).get(n); - i && (v(this, Mt).set(n, i.effect), v(this, nt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, ne).get(n); + i && (v(this, Me).set(n, i.effect), v(this, ne).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, xt)) { - if (v(this, xt).delete(s), s === t) + for (const [s, a] of v(this, xe)) { + if (v(this, xe).delete(s), s === e) break; - const o = v(this, nt).get(a); - o && (Ye(o.effect), v(this, nt).delete(a)); + const o = v(this, ne).get(a); + o && (Yt(o.effect), v(this, ne).delete(a)); } - for (const [s, a] of v(this, Mt)) { + for (const [s, a] of v(this, Me)) { if (s === n || v(this, qn).has(s)) continue; const o = () => { - if (Array.from(v(this, xt).values()).includes(s)) { + if (Array.from(v(this, xe).values()).includes(s)) { var u = document.createDocumentFragment(); - Mo(a, u), u.append(it()), v(this, nt).set(s, { effect: a, fragment: u }); + Mo(a, u), u.append(ie()), v(this, ne).set(s, { effect: a, fragment: u }); } else - Ye(a); - v(this, qn).delete(s), v(this, Mt).delete(s); + Yt(a); + v(this, qn).delete(s), v(this, Me).delete(s); }; v(this, Xr) || !r ? (v(this, qn).add(s), Hn(a, o, !1)) : o(); } @@ -2147,66 +2147,66 @@ class Ku { /** * @param {Batch} batch */ - V(this, Pi, (t) => { - v(this, xt).delete(t); - const n = Array.from(v(this, xt).values()); - for (const [r, i] of v(this, nt)) - n.includes(r) || (Ye(i.effect), v(this, nt).delete(r)); + V(this, Pi, (e) => { + v(this, xe).delete(e); + const n = Array.from(v(this, xe).values()); + for (const [r, i] of v(this, ne)) + n.includes(r) || (Yt(i.effect), v(this, ne).delete(r)); }); - this.anchor = t, L(this, Xr, n); + this.anchor = e, L(this, Xr, n); } /** * * @param {any} key * @param {null | ((target: TemplateNode) => void)} fn */ - ensure(t, n) { + ensure(e, n) { var r = ( /** @type {Batch} */ U ), i = Ao(); - if (n && !v(this, Mt).has(t) && !v(this, nt).has(t)) + if (n && !v(this, Me).has(e) && !v(this, ne).has(e)) if (i) { - var s = document.createDocumentFragment(), a = it(); - s.append(a), v(this, nt).set(t, { - effect: dt(() => n(a)), + var s = document.createDocumentFragment(), a = ie(); + s.append(a), v(this, ne).set(e, { + effect: de(() => n(a)), fragment: s }); } else - v(this, Mt).set( - t, - dt(() => n(this.anchor)) + v(this, Me).set( + e, + de(() => n(this.anchor)) ); - if (v(this, xt).set(r, t), i) { - for (const [o, l] of v(this, Mt)) - o === t ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, nt)) - o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); + if (v(this, xe).set(r, e), i) { + for (const [o, l] of v(this, Me)) + o === e ? r.unskip_effect(l) : r.skip_effect(l); + for (const [o, l] of v(this, ne)) + o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); r.oncommit(v(this, Wr)), r.ondiscard(v(this, Pi)); } else G && (this.anchor = X), v(this, Wr).call(this); } } -xt = new WeakMap(), Mt = new WeakMap(), nt = new WeakMap(), qn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Pi = new WeakMap(); -function ju(e) { - st === null && tu(), Is(() => { - const t = Bi(e); - if (typeof t == "function") return ( +xe = new WeakMap(), Me = new WeakMap(), ne = new WeakMap(), qn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Pi = new WeakMap(); +function ju(t) { + se === null && eu(), Is(() => { + const e = Bi(t); + if (typeof e == "function") return ( /** @type {() => void} */ - t + e ); }); } -function er(e, t, n = !1) { +function tr(t, e, n = !1) { G && Li(); - var r = new Ku(e), i = n ? hr : 0; + var r = new Ku(t), i = n ? hr : 0; function s(a, o) { if (G) { - const f = Za(e); + const f = Za(t); var l; if (f === Cs ? l = 0 : f === Di ? l = !1 : l = parseInt(f.substring(1)), a !== l) { var u = $i(); - He(u), r.anchor = u, nn(!1), r.ensure(a, o), nn(!0); + Ht(u), r.anchor = u, nn(!1), r.ensure(a, o), nn(!0); return; } } @@ -2214,17 +2214,17 @@ function er(e, t, n = !1) { } Os(() => { var a = !1; - t((o, l = 0) => { + e((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function hi(e, t) { - return t; +function hi(t, e) { + return e; } -function Ju(e, t, n) { - for (var r = [], i = t.length, s, a = t.length, o = 0; o < i; o++) { - let h = t[o]; +function Ju(t, e, n) { + for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { + let h = e[o]; Hn( h, () => { @@ -2232,9 +2232,9 @@ function Ju(e, t, n) { if (s.pending.delete(h), s.done.add(h), s.pending.size === 0) { var c = ( /** @type {Set} */ - e.outrogroups + t.outrogroups ); - ms(Ii(s.done)), c.delete(s), c.size === 0 && (e.outrogroups = null); + ms(Ii(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); } } else a -= 1; @@ -2252,28 +2252,28 @@ function Ju(e, t, n) { /** @type {Element} */ u.parentNode ); - $o(f), f.append(u), e.items.clear(); + $o(f), f.append(u), t.items.clear(); } - ms(t, !l); + ms(e, !l); } else s = { - pending: new Set(t), + pending: new Set(e), done: /* @__PURE__ */ new Set() - }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s); + }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function ms(e, t = !0) { - for (var n = 0; n < e.length; n++) - Ye(e[n], t); +function ms(t, e = !0) { + for (var n = 0; n < t.length; n++) + Yt(t[n], e); } var va; -function di(e, t, n, r, i, s = null) { - var a = e, o = /* @__PURE__ */ new Map(), l = (t & za) !== 0; +function di(t, e, n, r, i, s = null) { + var a = t, o = /* @__PURE__ */ new Map(), l = (e & za) !== 0; if (l) { var u = ( /** @type {Element} */ - e + t ); - a = G ? He(/* @__PURE__ */ an(u)) : u.appendChild(it()); + a = G ? Ht(/* @__PURE__ */ an(u)) : u.appendChild(ie()); } G && Li(); var f = null, h = /* @__PURE__ */ po(() => { @@ -2281,7 +2281,7 @@ function di(e, t, n, r, i, s = null) { return Xa(x) ? x : x == null ? [] : Ii(x); }), c, p = !0; function m() { - _.fallback = f, Zu(_, c, a, t, r), f !== null && (c.length === 0 ? (f.f & tn) === 0 ? qs(f) : (f.f ^= tn, Sr(f, null, a)) : Hn(f, () => { + _.fallback = f, Zu(_, c, a, e, r), f !== null && (c.length === 0 ? (f.f & en) === 0 ? qs(f) : (f.f ^= en, Sr(f, null, a)) : Hn(f, () => { f = null; })); } @@ -2292,7 +2292,7 @@ function di(e, t, n, r, i, s = null) { let F = !1; if (G) { var S = Za(a) === Di; - S !== (x === 0) && (a = $i(), He(a), nn(!1), F = !0); + S !== (x === 0) && (a = $i(), Ht(a), nn(!1), F = !0); } for (var M = /* @__PURE__ */ new Set(), D = ( /** @type {Batch} */ @@ -2301,22 +2301,22 @@ function di(e, t, n, r, i, s = null) { G && X.nodeType === wr && /** @type {Comment} */ X.data === Ss && (a = /** @type {Comment} */ X, F = !0, nn(!1)); - var Q = c[K], ee = r(Q, K), J = p ? null : o.get(ee); + var Q = c[K], tt = r(Q, K), J = p ? null : o.get(tt); J ? (J.v && vr(J.v, Q), J.i && vr(J.i, K), W && D.unskip_effect(J.e)) : (J = Qu( o, - p ? a : va ?? (va = it()), + p ? a : va ?? (va = ie()), Q, - ee, + tt, K, i, - t, + e, n - ), p || (J.e.f |= tn), o.set(ee, J)), M.add(ee); + ), p || (J.e.f |= en), o.set(tt, J)), M.add(tt); } - if (x === 0 && s && !f && (p ? f = dt(() => s(a)) : (f = dt(() => s(va ?? (va = it()))), f.f |= tn)), x > M.size && ru(), G && x > 0 && He($i()), !p) + if (x === 0 && s && !f && (p ? f = de(() => s(a)) : (f = de(() => s(va ?? (va = ie()))), f.f |= en)), x > M.size && ru(), G && x > 0 && Ht($i()), !p) if (W) { - for (const [ae, oe] of o) - M.has(ae) || D.skip_effect(oe.e); + for (const [at, ot] of o) + M.has(at) || D.skip_effect(ot.e); D.oncommit(m), D.ondiscard(() => { }); } else @@ -2325,32 +2325,32 @@ function di(e, t, n, r, i, s = null) { }), _ = { effect: $, items: o, outrogroups: null, fallback: f }; p = !1, G && (a = X); } -function Rr(e) { - for (; e !== null && (e.f & Tt) === 0; ) - e = e.next; - return e; +function Rr(t) { + for (; t !== null && (t.f & Te) === 0; ) + t = t.next; + return t; } -function Zu(e, t, n, r, i) { - var J, ae, oe, N, H, Ie, Me, xe, ce; - var s = (r & Ol) !== 0, a = t.length, o = e.items, l = Rr(e.effect.first), u, f = null, h, c = [], p = [], m, $, _, x; +function Zu(t, e, n, r, i) { + var J, at, ot, N, H, It, Mt, xt, ft; + var s = (r & Ol) !== 0, a = e.length, o = t.items, l = Rr(t.effect.first), u, f = null, h, c = [], p = [], m, $, _, x; if (s) for (x = 0; x < a; x += 1) - m = t[x], $ = i(m, x), _ = /** @type {EachItem} */ - o.get($).e, (_.f & tn) === 0 && ((ae = (J = _.nodes) == null ? void 0 : J.a) == null || ae.measure(), (h ?? (h = /* @__PURE__ */ new Set())).add(_)); + m = e[x], $ = i(m, x), _ = /** @type {EachItem} */ + o.get($).e, (_.f & en) === 0 && ((at = (J = _.nodes) == null ? void 0 : J.a) == null || at.measure(), (h ?? (h = /* @__PURE__ */ new Set())).add(_)); for (x = 0; x < a; x += 1) { - if (m = t[x], $ = i(m, x), _ = /** @type {EachItem} */ - o.get($).e, e.outrogroups !== null) - for (const le of e.outrogroups) - le.pending.delete(_), le.done.delete(_); - if ((_.f & tn) !== 0) - if (_.f ^= tn, _ === l) + if (m = e[x], $ = i(m, x), _ = /** @type {EachItem} */ + o.get($).e, t.outrogroups !== null) + for (const lt of t.outrogroups) + lt.pending.delete(_), lt.done.delete(_); + if ((_.f & en) !== 0) + if (_.f ^= en, _ === l) Sr(_, null, n); else { var F = f ? f.next : l; - _ === e.effect.last && (e.effect.last = _.prev), _.prev && (_.prev.next = _.next), _.next && (_.next.prev = _.prev), hn(e, f, _), hn(e, _, F), Sr(_, F, n), f = _, c = [], p = [], l = Rr(f.next); + _ === t.effect.last && (t.effect.last = _.prev), _.prev && (_.prev.next = _.next), _.next && (_.next.prev = _.prev), hn(t, f, _), hn(t, _, F), Sr(_, F, n), f = _, c = [], p = [], l = Rr(f.next); continue; } - if ((_.f & rt) !== 0 && (qs(_), s && ((N = (oe = _.nodes) == null ? void 0 : oe.a) == null || N.unfix(), (h ?? (h = /* @__PURE__ */ new Set())).delete(_))), _ !== l) { + if ((_.f & re) !== 0 && (qs(_), s && ((N = (ot = _.nodes) == null ? void 0 : ot.a) == null || N.unfix(), (h ?? (h = /* @__PURE__ */ new Set())).delete(_))), _ !== l) { if (u !== void 0 && u.has(_)) { if (c.length < p.length) { var S = p[0], M; @@ -2360,9 +2360,9 @@ function Zu(e, t, n, r, i) { Sr(c[M], S, n); for (M = 0; M < p.length; M += 1) u.delete(p[M]); - hn(e, D.prev, W.next), hn(e, f, D), hn(e, W, S), l = S, f = W, x -= 1, c = [], p = []; + hn(t, D.prev, W.next), hn(t, f, D), hn(t, W, S), l = S, f = W, x -= 1, c = [], p = []; } else - u.delete(_), Sr(_, l, n), hn(e, _.prev, _.next), hn(e, _, f === null ? e.effect.first : f.next), hn(e, f, _), f = _; + u.delete(_), Sr(_, l, n), hn(t, _.prev, _.next), hn(t, _, f === null ? t.effect.first : f.next), hn(t, f, _), f = _; continue; } for (c = [], p = []; l !== null && l !== _; ) @@ -2370,70 +2370,70 @@ function Zu(e, t, n, r, i) { if (l === null) continue; } - (_.f & tn) === 0 && c.push(_), f = _, l = Rr(_.next); + (_.f & en) === 0 && c.push(_), f = _, l = Rr(_.next); } - if (e.outrogroups !== null) { - for (const le of e.outrogroups) - le.pending.size === 0 && (ms(Ii(le.done)), (H = e.outrogroups) == null || H.delete(le)); - e.outrogroups.size === 0 && (e.outrogroups = null); + if (t.outrogroups !== null) { + for (const lt of t.outrogroups) + lt.pending.size === 0 && (ms(Ii(lt.done)), (H = t.outrogroups) == null || H.delete(lt)); + t.outrogroups.size === 0 && (t.outrogroups = null); } if (l !== null || u !== void 0) { var K = []; if (u !== void 0) for (_ of u) - (_.f & rt) === 0 && K.push(_); + (_.f & re) === 0 && K.push(_); for (; l !== null; ) - (l.f & rt) === 0 && l !== e.fallback && K.push(l), l = Rr(l.next); + (l.f & re) === 0 && l !== t.fallback && K.push(l), l = Rr(l.next); var Q = K.length; if (Q > 0) { - var ee = (r & za) !== 0 && a === 0 ? n : null; + var tt = (r & za) !== 0 && a === 0 ? n : null; if (s) { for (x = 0; x < Q; x += 1) - (Me = (Ie = K[x].nodes) == null ? void 0 : Ie.a) == null || Me.measure(); + (Mt = (It = K[x].nodes) == null ? void 0 : It.a) == null || Mt.measure(); for (x = 0; x < Q; x += 1) - (ce = (xe = K[x].nodes) == null ? void 0 : xe.a) == null || ce.fix(); + (ft = (xt = K[x].nodes) == null ? void 0 : xt.a) == null || ft.fix(); } - Ju(e, K, ee); + Ju(t, K, tt); } } s && _n(() => { - var le, z; + var lt, z; if (h !== void 0) for (_ of h) - (z = (le = _.nodes) == null ? void 0 : le.a) == null || z.apply(); + (z = (lt = _.nodes) == null ? void 0 : lt.a) == null || z.apply(); }); } -function Qu(e, t, n, r, i, s, a, o) { +function Qu(t, e, n, r, i, s, a, o) { var l = (a & Il) !== 0 ? (a & Ll) === 0 ? /* @__PURE__ */ mo(n, !1, !1) : Xn(n) : null, u = (a & Fl) !== 0 ? Xn(i) : null; return { v: l, i: u, - e: dt(() => (s(t, l ?? n, u ?? i, o), () => { - e.delete(r); + e: de(() => (s(e, l ?? n, u ?? i, o), () => { + t.delete(r); })) }; } -function Sr(e, t, n) { - if (e.nodes) - for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & tn) === 0 ? ( +function Sr(t, e, n) { + if (t.nodes) + for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & en) === 0 ? ( /** @type {EffectNodes} */ - t.nodes.start + e.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Ot(r) + /* @__PURE__ */ Oe(r) ); if (s.before(r), r === i) return; r = a; } } -function hn(e, t, n) { - t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t; +function hn(t, e, n) { + e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; } -function Vs(e, t) { +function Vs(t, e) { Ro(() => { - var n = e.getRootNode(), r = ( + var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( /** @type {ShadowRoot} */ @@ -2444,16 +2444,16 @@ function Vs(e, t) { n.ownerDocument.head ) ); - if (!r.querySelector("#" + t.hash)) { + if (!r.querySelector("#" + e.hash)) { const i = Ps("style"); - i.id = t.hash, i.textContent = t.code, r.appendChild(i); + i.id = e.hash, i.textContent = e.code, r.appendChild(i); } }); } const ga = [...` \r\f \v\uFEFF`]; -function ef(e, t, n) { - var r = e == null ? "" : "" + e; +function tf(t, e, n) { + var r = t == null ? "" : "" + t; if (n) { for (var i in n) if (n[i]) @@ -2466,68 +2466,68 @@ function ef(e, t, n) { } return r === "" ? null : r; } -function _a(e, t = !1) { - var n = t ? " !important;" : ";", r = ""; - for (var i in e) { - var s = e[i]; +function _a(t, e = !1) { + var n = e ? " !important;" : ";", r = ""; + for (var i in t) { + var s = t[i]; s != null && s !== "" && (r += " " + i + ": " + s + n); } return r; } -function tf(e, t) { - if (t) { +function ef(t, e) { + if (e) { var n = "", r, i; - return Array.isArray(t) ? (r = t[0], i = t[1]) : r = t, r && (n += _a(r)), i && (n += _a(i, !0)), n = n.trim(), n === "" ? null : n; + return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += _a(r)), i && (n += _a(i, !0)), n = n.trim(), n === "" ? null : n; } - return String(e); + return String(t); } -function ri(e, t, n, r, i, s) { - var a = e.__className; +function ri(t, e, n, r, i, s) { + var a = t.__className; if (G || a !== n || a === void 0) { - var o = ef(n, r, s); - (!G || o !== e.getAttribute("class")) && (o == null ? e.removeAttribute("class") : e.className = o), e.__className = n; + var o = tf(n, r, s); + (!G || o !== t.getAttribute("class")) && (o == null ? t.removeAttribute("class") : t.className = o), t.__className = n; } else if (s && i !== s) for (var l in s) { var u = !!s[l]; - (i == null || u !== !!i[l]) && e.classList.toggle(l, u); + (i == null || u !== !!i[l]) && t.classList.toggle(l, u); } return s; } -function es(e, t = {}, n, r) { +function ts(t, e = {}, n, r) { for (var i in n) { var s = n[i]; - t[i] !== s && (n[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, s, r)); + e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); } } -function ma(e, t, n, r) { - var i = e.__style; - if (G || i !== t) { - var s = tf(t, r); - (!G || s !== e.getAttribute("style")) && (s == null ? e.removeAttribute("style") : e.style.cssText = s), e.__style = t; - } else r && (Array.isArray(r) ? (es(e, n == null ? void 0 : n[0], r[0]), es(e, n == null ? void 0 : n[1], r[1], "important")) : es(e, n, r)); +function ma(t, e, n, r) { + var i = t.__style; + if (G || i !== e) { + var s = ef(e, r); + (!G || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; + } else r && (Array.isArray(r) ? (ts(t, n == null ? void 0 : n[0], r[0]), ts(t, n == null ? void 0 : n[1], r[1], "important")) : ts(t, n, r)); return r; } -const nf = Symbol("is custom element"), rf = Symbol("is html"), sf = eu ? "link" : "LINK"; -function ya(e, t, n, r) { - var i = af(e); - G && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === sf) || i[t] !== (i[t] = n) && (t === "loading" && (e[Ql] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && of(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); +const nf = Symbol("is custom element"), rf = Symbol("is html"), sf = tu ? "link" : "LINK"; +function ya(t, e, n, r) { + var i = af(t); + G && (i[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === sf) || i[e] !== (i[e] = n) && (e === "loading" && (t[Ql] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && of(t).includes(e) ? t[e] = n : t.setAttribute(e, n)); } -function af(e) { +function af(t) { return ( /** @type {Record} **/ // @ts-expect-error - e.__attributes ?? (e.__attributes = { - [nf]: e.nodeName.includes("-"), - [rf]: e.namespaceURI === Ba + t.__attributes ?? (t.__attributes = { + [nf]: t.nodeName.includes("-"), + [rf]: t.namespaceURI === Ba }) ); } var wa = /* @__PURE__ */ new Map(); -function of(e) { - var t = e.getAttribute("is") || e.nodeName, n = wa.get(t); +function of(t) { + var e = t.getAttribute("is") || t.nodeName, n = wa.get(e); if (n) return n; - wa.set(t, n = []); - for (var r, i = e, s = Element.prototype; s !== i; ) { + wa.set(e, n = []); + for (var r, i = t, s = Element.prototype; s !== i; ) { r = Wl(i); for (var a in r) r[a].set && n.push(a); @@ -2535,33 +2535,33 @@ function of(e) { } return n; } -function xa(e, t) { - return e === t || (e == null ? void 0 : e[Pr]) === t; +function xa(t, e) { + return t === e || (t == null ? void 0 : t[Pr]) === e; } -function pi(e = {}, t, n, r) { +function pi(t = {}, e, n, r) { return Ro(() => { var i, s; return Fs(() => { i = s, s = [], Bi(() => { - e !== n(...s) && (t(e, ...s), i && xa(n(...i), e) && t(null, ...i)); + t !== n(...s) && (e(t, ...s), i && xa(n(...i), t) && e(null, ...i)); }); }), () => { _n(() => { - s && xa(n(...s), e) && t(null, ...s); + s && xa(n(...s), t) && e(null, ...s); }); }; - }), e; + }), t; } let ii = !1; -function lf(e) { - var t = ii; +function lf(t) { + var e = ii; try { - return ii = !1, [e(), ii]; + return ii = !1, [t(), ii]; } finally { - ii = t; + ii = e; } } -function fe(e, t, n, r) { +function ut(t, e, n, r) { var F; var i = (n & Hl) !== 0, s = (n & Yl) !== 0, a = ( /** @type {V} */ @@ -2574,26 +2574,26 @@ function fe(e, t, n, r) { r )), a), u; if (i) { - var f = Pr in e || Ja in e; - u = ((F = Vn(e, t)) == null ? void 0 : F.set) ?? (f && t in e ? (S) => e[t] = S : void 0); + var f = Pr in t || Ja in t; + u = ((F = Vn(t, e)) == null ? void 0 : F.set) ?? (f && e in t ? (S) => t[e] = S : void 0); } var h, c = !1; i ? [h, c] = lf(() => ( /** @type {V} */ - e[t] + t[e] )) : h = /** @type {V} */ - e[t], h === void 0 && r !== void 0 && (h = l(), u && (uu(), u(h))); + t[e], h === void 0 && r !== void 0 && (h = l(), u && (uu(), u(h))); var p; if (p = () => { var S = ( /** @type {V} */ - e[t] + t[e] ); return S === void 0 ? l() : (o = !0, S); }, (n & Vl) === 0) return p; if (u) { - var m = e.$$legacy; + var m = t.$$legacy; return ( /** @type {() => V} */ (function(S, M) { @@ -2612,34 +2612,34 @@ function fe(e, t, n, r) { (function(S, M) { if (arguments.length > 0) { const D = M ? b(_) : i ? kn(S) : S; - return de(_, D), $ = !0, a !== void 0 && (a = D), S; + return dt(_, D), $ = !0, a !== void 0 && (a = D), S; } return wn && $ || (x.f & rn) !== 0 ? _.v : b(_); }) ); } -function uf(e) { - return new ff(e); +function uf(t) { + return new ff(t); } -var en, ht; +var tn, he; class ff { /** * @param {ComponentConstructorOptions & { * component: any; * }} options */ - constructor(t) { + constructor(e) { /** @type {any} */ - V(this, en); + V(this, tn); /** @type {Record} */ - V(this, ht); + V(this, he); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { var l = /* @__PURE__ */ mo(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( - { ...t.props || {}, $$events: {} }, + { ...e.props || {}, $$events: {} }, { get(a, o) { return b(n.get(o) ?? r(o, Reflect.get(a, o))); @@ -2648,60 +2648,60 @@ class ff { return o === Ja ? !0 : (b(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return de(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return dt(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - L(this, ht, (t.hydrate ? Uu : Yo)(t.component, { - target: t.target, - anchor: t.anchor, + L(this, he, (e.hydrate ? Uu : Yo)(e.component, { + target: e.target, + anchor: e.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) && se(), L(this, en, i.$$events); - for (const a of Object.keys(v(this, ht))) + context: e.context, + intro: e.intro ?? !1, + recover: e.recover + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && st(), L(this, tn, i.$$events); + for (const a of Object.keys(v(this, he))) a === "$set" || a === "$destroy" || a === "$on" || bi(this, a, { get() { - return v(this, ht)[a]; + return v(this, he)[a]; }, /** @param {any} value */ set(o) { - v(this, ht)[a] = o; + v(this, he)[a] = o; }, enumerable: !0 }); - v(this, ht).$set = /** @param {Record} next */ + v(this, he).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, ht).$destroy = () => { - Gu(v(this, ht)); + }, v(this, he).$destroy = () => { + Gu(v(this, he)); }; } /** @param {Record} props */ - $set(t) { - v(this, ht).$set(t); + $set(e) { + v(this, he).$set(e); } /** * @param {string} event * @param {(...args: any[]) => any} callback * @returns {any} */ - $on(t, n) { - v(this, en)[t] = v(this, en)[t] || []; + $on(e, n) { + v(this, tn)[e] = v(this, tn)[e] || []; const r = (...i) => n.call(this, ...i); - return v(this, en)[t].push(r), () => { - v(this, en)[t] = v(this, en)[t].filter( + return v(this, tn)[e].push(r), () => { + v(this, tn)[e] = v(this, tn)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - v(this, ht).$destroy(); + v(this, he).$destroy(); } } -en = new WeakMap(), ht = new WeakMap(); +tn = new WeakMap(), he = new WeakMap(); let Bo; typeof HTMLElement == "function" && (Bo = class extends HTMLElement { /** @@ -2709,51 +2709,51 @@ typeof HTMLElement == "function" && (Bo = class extends HTMLElement { * @param {*} $$slots * @param {ShadowRootInit | undefined} shadow_root_init */ - constructor(t, n, r) { + constructor(e, n, r) { super(); /** The Svelte component constructor */ - he(this, "$$ctor"); + ht(this, "$$ctor"); /** Slots */ - he(this, "$$s"); + ht(this, "$$s"); /** @type {any} The Svelte component instance */ - he(this, "$$c"); + ht(this, "$$c"); /** Whether or not the custom element is connected */ - he(this, "$$cn", !1); + ht(this, "$$cn", !1); /** @type {Record} Component props data */ - he(this, "$$d", {}); + ht(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - he(this, "$$r", !1); + ht(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - he(this, "$$p_d", {}); + ht(this, "$$p_d", {}); /** @type {Record} Event listeners */ - he(this, "$$l", {}); + ht(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - he(this, "$$l_u", /* @__PURE__ */ new Map()); + ht(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - he(this, "$$me"); + ht(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - he(this, "$$shadowRoot", null); - this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); + ht(this, "$$shadowRoot", null); + this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - addEventListener(t, n, r) { - if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) { - const i = this.$$c.$on(t, n); + addEventListener(e, n, r) { + if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) { + const i = this.$$c.$on(e, n); this.$$l_u.set(n, i); } - super.addEventListener(t, n, r); + super.addEventListener(e, n, r); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - removeEventListener(t, n, r) { - if (super.removeEventListener(t, n, r), this.$$c) { + removeEventListener(e, n, r) { + if (super.removeEventListener(e, n, r), this.$$c) { const i = this.$$l_u.get(n); i && (i(), this.$$l_u.delete(n)); } @@ -2763,10 +2763,10 @@ typeof HTMLElement == "function" && (Bo = class extends HTMLElement { let n = function(s) { return (a) => { const o = Ps("slot"); - s !== "default" && (o.name = s), Ke(a, o); + s !== "default" && (o.name = s), Kt(a, o); }; }; - var t = n; + var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; const r = {}, i = cf(this); @@ -2819,9 +2819,9 @@ typeof HTMLElement == "function" && (Bo = class extends HTMLElement { * @param {string} _oldValue * @param {string} newValue */ - attributeChangedCallback(t, n, r) { + attributeChangedCallback(e, n, r) { var i; - 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] })); + this.$$r || (e = this.$$g_p(e), this.$$d[e] = vi(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2831,71 +2831,71 @@ typeof HTMLElement == "function" && (Bo = class extends HTMLElement { /** * @param {string} attribute_name */ - $$g_p(t) { + $$g_p(e) { return xi(this.$$p_d).find( - (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t - ) || t; + (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e + ) || e; } }); -function vi(e, t, n, r) { +function vi(t, e, 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]) - return t; + const i = (s = n[t]) == null ? void 0 : s.type; + if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) + return e; if (r === "toAttribute") switch (i) { case "Object": case "Array": - return t == null ? null : JSON.stringify(t); + return e == null ? null : JSON.stringify(e); case "Boolean": - return t ? "" : null; + return e ? "" : null; case "Number": - return t ?? null; + return e ?? null; default: - return t; + return e; } else switch (i) { case "Object": case "Array": - return t && JSON.parse(t); + return e && JSON.parse(e); case "Boolean": - return t; + return e; // conversion already handled above case "Number": - return t != null ? +t : t; + return e != null ? +e : e; default: - return t; + return e; } } -function cf(e) { - const t = {}; - return e.childNodes.forEach((n) => { - t[ +function cf(t) { + const e = {}; + return t.childNodes.forEach((n) => { + e[ /** @type {Element} node */ n.slot || "default" ] = !0; - }), t; + }), e; } -function Hs(e, t, n, r, i, s) { +function Hs(t, e, n, r, i, s) { let a = class extends Bo { constructor() { - super(e, n, i), this.$$p_d = t; + super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return xi(t).map( - (o) => (t[o].attribute || o).toLowerCase() + return xi(e).map( + (o) => (e[o].attribute || o).toLowerCase() ); } }; - return xi(t).forEach((o) => { + return xi(e).forEach((o) => { bi(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { var h; - l = vi(o, l, t), this.$$d[o] = l; + l = vi(o, l, e), this.$$d[o] = l; var u = this.$$c; if (u) { var f = (h = Vn(u, o)) == null ? void 0 : h.get; @@ -2910,69 +2910,69 @@ function Hs(e, t, n, r, i, s) { return (l = this.$$c) == null ? void 0 : l[o]; } }); - }), e.element = /** @type {any} */ + }), t.element = /** @type {any} */ a, a; } var hf = { value: () => { } }; function Xo() { - 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); + for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { + if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } return new gi(n); } -function gi(e) { - this._ = e; +function gi(t) { + this._ = t; } -function df(e, t) { - return e.trim().split(/^|\s+/).map(function(n) { +function df(t, e) { + return t.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); + if (i >= 0 && (r = n.slice(i + 1), n = n.slice(0, i)), n && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n); return { type: n, name: r }; }); } gi.prototype = Xo.prototype = { constructor: gi, - on: function(e, t) { - var n = this._, r = df(e + "", n), i, s = -1, a = r.length; + on: function(t, e) { + var n = this._, r = df(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = pf(n[i], e.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = pf(n[i], t.name))) return i; return; } - if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); + if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++s < a; ) - if (i = (e = r[s]).type) n[i] = ba(n[i], e.name, t); - else if (t == null) for (i in n) n[i] = ba(n[i], e.name, null); + if (i = (t = r[s]).type) n[i] = ba(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = ba(n[i], t.name, null); return this; }, copy: function() { - var e = {}, t = this._; - for (var n in t) e[n] = t[n].slice(); - return new gi(e); + var t = {}, e = this._; + for (var n in e) t[n] = e[n].slice(); + return new gi(t); }, - call: function(e, t) { + call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, s; r < i; ++r) n[r] = arguments[r + 2]; - if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); - for (s = this._[e], r = 0, i = s.length; r < i; ++r) s[r].value.apply(t, n); + if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); + for (s = this._[t], r = 0, i = s.length; r < i; ++r) s[r].value.apply(e, n); }, - apply: function(e, t, n) { - if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); - for (var r = this._[e], i = 0, s = r.length; i < s; ++i) r[i].value.apply(t, n); + apply: function(t, e, n) { + if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); + for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function pf(e, t) { - for (var n = 0, r = e.length, i; n < r; ++n) - if ((i = e[n]).name === t) +function pf(t, e) { + for (var n = 0, r = t.length, i; n < r; ++n) + if ((i = t[n]).name === e) return i.value; } -function ba(e, t, n) { - for (var r = 0, i = e.length; r < i; ++r) - if (e[r].name === t) { - e[r] = hf, e = e.slice(0, r).concat(e.slice(r + 1)); +function ba(t, e, n) { + for (var r = 0, i = t.length; r < i; ++r) + if (t[r].name === e) { + t[r] = hf, t = t.slice(0, r).concat(t.slice(r + 1)); break; } - return n != null && e.push({ name: t, value: n }), e; + return n != null && t.push({ name: e, value: n }), t; } var ys = "http://www.w3.org/1999/xhtml"; const $a = { @@ -2982,401 +2982,401 @@ const $a = { xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Xi(e) { - var t = e += "", n = t.indexOf(":"); - return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), $a.hasOwnProperty(t) ? { space: $a[t], local: e } : e; +function Xi(t) { + var e = t += "", n = e.indexOf(":"); + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), $a.hasOwnProperty(e) ? { space: $a[e], local: t } : t; } -function vf(e) { +function vf(t) { return function() { - var t = this.ownerDocument, n = this.namespaceURI; - return n === ys && t.documentElement.namespaceURI === ys ? t.createElement(e) : t.createElementNS(n, e); + var e = this.ownerDocument, n = this.namespaceURI; + return n === ys && e.documentElement.namespaceURI === ys ? e.createElement(t) : e.createElementNS(n, t); }; } -function gf(e) { +function gf(t) { return function() { - return this.ownerDocument.createElementNS(e.space, e.local); + return this.ownerDocument.createElementNS(t.space, t.local); }; } -function Wo(e) { - var t = Xi(e); - return (t.local ? gf : vf)(t); +function Wo(t) { + var e = Xi(t); + return (e.local ? gf : vf)(e); } function _f() { } -function Ys(e) { - return e == null ? _f : function() { - return this.querySelector(e); +function Ys(t) { + return t == null ? _f : function() { + return this.querySelector(t); }; } -function mf(e) { - typeof e != "function" && (e = Ys(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 at(r, this._parents); +function mf(t) { + typeof t != "function" && (t = Ys(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) + (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); + return new ae(r, this._parents); } -function yf(e) { - return e == null ? [] : Array.isArray(e) ? e : Array.from(e); +function yf(t) { + return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function wf() { return []; } -function Uo(e) { - return e == null ? wf : function() { - return this.querySelectorAll(e); +function Uo(t) { + return t == null ? wf : function() { + return this.querySelectorAll(t); }; } -function xf(e) { +function xf(t) { return function() { - return yf(e.apply(this, arguments)); + return yf(t.apply(this, arguments)); }; } -function bf(e) { - typeof e == "function" ? e = xf(e) : e = Uo(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 at(r, i); +function bf(t) { + typeof t == "function" ? t = xf(t) : t = Uo(t); + for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) + for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) + (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); + return new ae(r, i); } -function Go(e) { +function Go(t) { return function() { - return this.matches(e); + return this.matches(t); }; } -function Ko(e) { - return function(t) { - return t.matches(e); +function Ko(t) { + return function(e) { + return e.matches(t); }; } var $f = Array.prototype.find; -function Af(e) { +function Af(t) { return function() { - return $f.call(this.children, e); + return $f.call(this.children, t); }; } function Ef() { return this.firstElementChild; } -function Tf(e) { - return this.select(e == null ? Ef : Af(typeof e == "function" ? e : Ko(e))); +function Tf(t) { + return this.select(t == null ? Ef : Af(typeof t == "function" ? t : Ko(t))); } var Rf = Array.prototype.filter; function Cf() { return Array.from(this.children); } -function Sf(e) { +function Sf(t) { return function() { - return Rf.call(this.children, e); + return Rf.call(this.children, t); }; } -function Nf(e) { - return this.selectAll(e == null ? Cf : Sf(typeof e == "function" ? e : Ko(e))); +function Nf(t) { + return this.selectAll(t == null ? Cf : Sf(typeof t == "function" ? t : Ko(t))); } -function kf(e) { - typeof e != "function" && (e = Go(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 at(r, this._parents); +function kf(t) { + typeof t != "function" && (t = Go(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); + return new ae(r, this._parents); } -function jo(e) { - return new Array(e.length); +function jo(t) { + return new Array(t.length); } function Mf() { - return new at(this._enter || this._groups.map(jo), this._parents); + return new ae(this._enter || this._groups.map(jo), this._parents); } -function Ai(e, t) { - this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; +function Ai(t, e) { + this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } Ai.prototype = { constructor: Ai, - appendChild: function(e) { - return this._parent.insertBefore(e, this._next); + appendChild: function(t) { + return this._parent.insertBefore(t, this._next); }, - insertBefore: function(e, t) { - return this._parent.insertBefore(e, t); + insertBefore: function(t, e) { + return this._parent.insertBefore(t, e); }, - querySelector: function(e) { - return this._parent.querySelector(e); + querySelector: function(t) { + return this._parent.querySelector(t); }, - querySelectorAll: function(e) { - return this._parent.querySelectorAll(e); + querySelectorAll: function(t) { + return this._parent.querySelectorAll(t); } }; -function Pf(e) { +function Pf(t) { return function() { - return e; + return t; }; } -function Df(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 Ai(e, s[a]); +function Df(t, e, n, r, i, s) { + for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ai(t, s[a]); for (; a < l; ++a) - (o = t[a]) && (i[a] = o); + (o = e[a]) && (i[a] = o); } -function If(e, t, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = t.length, h = s.length, c = new Array(f), p; +function If(t, e, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = e.length, h = s.length, c = new Array(f), p; for (o = 0; o < f; ++o) - (l = t[o]) && (c[o] = p = a.call(l, l.__data__, o, t) + "", u.has(p) ? i[o] = l : u.set(p, l)); + (l = e[o]) && (c[o] = p = a.call(l, l.__data__, o, e) + "", u.has(p) ? i[o] = l : u.set(p, l)); for (o = 0; o < h; ++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]); + p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new Ai(t, s[o]); for (o = 0; o < f; ++o) - (l = t[o]) && u.get(c[o]) === l && (i[o] = l); + (l = e[o]) && u.get(c[o]) === l && (i[o] = l); } -function Ff(e) { - return e.__data__; +function Ff(t) { + return t.__data__; } -function Of(e, t) { +function Of(t, e) { if (!arguments.length) return Array.from(this, Ff); - var n = t ? If : Df, r = this._parents, i = this._groups; - typeof e != "function" && (e = Pf(e)); + var n = e ? If : Df, r = this._parents, i = this._groups; + typeof t != "function" && (t = Pf(t)); 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], h = i[u], c = h.length, p = Lf(e.call(f, f && f.__data__, u, r)), m = p.length, $ = o[u] = new Array(m), _ = a[u] = new Array(m), x = l[u] = new Array(c); - n(f, h, $, _, x, p, t); + var f = r[u], h = i[u], c = h.length, p = Lf(t.call(f, f && f.__data__, u, r)), m = p.length, $ = o[u] = new Array(m), _ = a[u] = new Array(m), x = l[u] = new Array(c); + n(f, h, $, _, x, p, e); for (var F = 0, S = 0, M, D; F < m; ++F) if (M = $[F]) { for (F >= S && (S = F + 1); !(D = _[S]) && ++S < m; ) ; M._next = D || null; } } - return a = new at(a, r), a._enter = o, a._exit = l, a; + return a = new ae(a, r), a._enter = o, a._exit = l, a; } -function Lf(e) { - return typeof e == "object" && "length" in e ? e : Array.from(e); +function Lf(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); } function qf() { - return new at(this._exit || this._groups.map(jo), this._parents); + return new ae(this._exit || this._groups.map(jo), this._parents); } -function Vf(e, t, n) { +function Vf(t, e, 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; + return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; } -function Hf(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) +function Hf(t) { + for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._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], h = u.length, c = o[l] = new Array(h), p, m = 0; m < h; ++m) (p = u[m] || f[m]) && (c[m] = p); for (; l < i; ++l) o[l] = n[l]; - return new at(o, this._parents); + return new ae(o, this._parents); } function Yf() { - 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; ) + for (var t = this._groups, e = -1, n = t.length; ++e < n; ) + for (var r = t[e], 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 zf(e) { - e || (e = Bf); - function t(h, c) { - return h && c ? e(h.__data__, c.__data__) : !h - !c; +function zf(t) { + t || (t = Bf); + function e(h, c) { + return h && c ? t(h.__data__, c.__data__) : !h - !c; } 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); + l.sort(e); } - return new at(i, this._parents).order(); + return new ae(i, this._parents).order(); } -function Bf(e, t) { - return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; +function Bf(t, e) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } function Xf() { - var e = arguments[0]; - return arguments[0] = this, e.apply(null, arguments), this; + var t = arguments[0]; + return arguments[0] = this, t.apply(null, arguments), this; } function Wf() { return Array.from(this); } function Uf() { - 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) { + for (var t = this._groups, e = 0, n = t.length; e < n; ++e) + for (var r = t[e], i = 0, s = r.length; i < s; ++i) { var a = r[i]; if (a) return a; } return null; } function Gf() { - let e = 0; - for (const t of this) ++e; - return e; + let t = 0; + for (const e of this) ++t; + return t; } function Kf() { return !this.node(); } -function jf(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); +function jf(t) { + for (var e = this._groups, n = 0, r = e.length; n < r; ++n) + for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) + (o = i[s]) && t.call(o, o.__data__, s, i); return this; } -function Jf(e) { +function Jf(t) { return function() { - this.removeAttribute(e); + this.removeAttribute(t); }; } -function Zf(e) { +function Zf(t) { return function() { - this.removeAttributeNS(e.space, e.local); + this.removeAttributeNS(t.space, t.local); }; } -function Qf(e, t) { +function Qf(t, e) { return function() { - this.setAttribute(e, t); + this.setAttribute(t, e); }; } -function ec(e, t) { +function tc(t, e) { return function() { - this.setAttributeNS(e.space, e.local, t); + this.setAttributeNS(t.space, t.local, e); }; } -function tc(e, t) { +function ec(t, e) { return function() { - var n = t.apply(this, arguments); - n == null ? this.removeAttribute(e) : this.setAttribute(e, n); + var n = e.apply(this, arguments); + n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function nc(e, t) { +function nc(t, e) { return function() { - var n = t.apply(this, arguments); - n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n); + var n = e.apply(this, arguments); + n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); }; } -function rc(e, t) { - var n = Xi(e); +function rc(t, e) { + var n = Xi(t); 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 ? Zf : Jf : typeof t == "function" ? n.local ? nc : tc : n.local ? ec : Qf)(n, t)); + return this.each((e == null ? n.local ? Zf : Jf : typeof e == "function" ? n.local ? nc : ec : n.local ? tc : Qf)(n, e)); } -function Jo(e) { - return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; +function Jo(t) { + return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function ic(e) { +function ic(t) { return function() { - this.style.removeProperty(e); + this.style.removeProperty(t); }; } -function sc(e, t, n) { +function sc(t, e, n) { return function() { - this.style.setProperty(e, t, n); + this.style.setProperty(t, e, n); }; } -function ac(e, t, n) { +function ac(t, e, n) { return function() { - var r = t.apply(this, arguments); - r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); + var r = e.apply(this, arguments); + r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function oc(e, t, n) { - return arguments.length > 1 ? this.each((t == null ? ic : typeof t == "function" ? ac : sc)(e, t, n ?? "")) : _r(this.node(), e); +function oc(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? ic : typeof e == "function" ? ac : sc)(t, e, n ?? "")) : _r(this.node(), t); } -function _r(e, t) { - return e.style.getPropertyValue(t) || Jo(e).getComputedStyle(e, null).getPropertyValue(t); +function _r(t, e) { + return t.style.getPropertyValue(e) || Jo(t).getComputedStyle(t, null).getPropertyValue(e); } -function lc(e) { +function lc(t) { return function() { - delete this[e]; + delete this[t]; }; } -function uc(e, t) { +function uc(t, e) { return function() { - this[e] = t; + this[t] = e; }; } -function fc(e, t) { +function fc(t, e) { return function() { - var n = t.apply(this, arguments); - n == null ? delete this[e] : this[e] = n; + var n = e.apply(this, arguments); + n == null ? delete this[t] : this[t] = n; }; } -function cc(e, t) { - return arguments.length > 1 ? this.each((t == null ? lc : typeof t == "function" ? fc : uc)(e, t)) : this.node()[e]; +function cc(t, e) { + return arguments.length > 1 ? this.each((e == null ? lc : typeof e == "function" ? fc : uc)(t, e)) : this.node()[t]; } -function Zo(e) { - return e.trim().split(/^|\s+/); +function Zo(t) { + return t.trim().split(/^|\s+/); } -function zs(e) { - return e.classList || new Qo(e); +function zs(t) { + return t.classList || new Qo(t); } -function Qo(e) { - this._node = e, this._names = Zo(e.getAttribute("class") || ""); +function Qo(t) { + this._node = t, this._names = Zo(t.getAttribute("class") || ""); } Qo.prototype = { - add: function(e) { - var t = this._names.indexOf(e); - t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" "))); + add: function(t) { + var e = this._names.indexOf(t); + e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); }, - remove: function(e) { - var t = this._names.indexOf(e); - t >= 0 && (this._names.splice(t, 1), this._node.setAttribute("class", this._names.join(" "))); + remove: function(t) { + var e = this._names.indexOf(t); + e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" "))); }, - contains: function(e) { - return this._names.indexOf(e) >= 0; + contains: function(t) { + return this._names.indexOf(t) >= 0; } }; -function el(e, t) { - for (var n = zs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); +function tl(t, e) { + for (var n = zs(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function tl(e, t) { - for (var n = zs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); +function el(t, e) { + for (var n = zs(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function hc(e) { +function hc(t) { return function() { - el(this, e); + tl(this, t); }; } -function dc(e) { +function dc(t) { return function() { - tl(this, e); + el(this, t); }; } -function pc(e, t) { +function pc(t, e) { return function() { - (t.apply(this, arguments) ? el : tl)(this, e); + (e.apply(this, arguments) ? tl : el)(this, t); }; } -function vc(e, t) { - var n = Zo(e + ""); +function vc(t, e) { + var n = Zo(t + ""); if (arguments.length < 2) { for (var r = zs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof t == "function" ? pc : t ? hc : dc)(n, t)); + return this.each((typeof e == "function" ? pc : e ? hc : dc)(n, e)); } function gc() { this.textContent = ""; } -function _c(e) { +function _c(t) { return function() { - this.textContent = e; + this.textContent = t; }; } -function mc(e) { +function mc(t) { return function() { - var t = e.apply(this, arguments); - this.textContent = t ?? ""; + var e = t.apply(this, arguments); + this.textContent = e ?? ""; }; } -function yc(e) { - return arguments.length ? this.each(e == null ? gc : (typeof e == "function" ? mc : _c)(e)) : this.node().textContent; +function yc(t) { + return arguments.length ? this.each(t == null ? gc : (typeof t == "function" ? mc : _c)(t)) : this.node().textContent; } function wc() { this.innerHTML = ""; } -function xc(e) { +function xc(t) { return function() { - this.innerHTML = e; + this.innerHTML = t; }; } -function bc(e) { +function bc(t) { return function() { - var t = e.apply(this, arguments); - this.innerHTML = t ?? ""; + var e = t.apply(this, arguments); + this.innerHTML = e ?? ""; }; } -function $c(e) { - return arguments.length ? this.each(e == null ? wc : (typeof e == "function" ? bc : xc)(e)) : this.node().innerHTML; +function $c(t) { + return arguments.length ? this.each(t == null ? wc : (typeof t == "function" ? bc : xc)(t)) : this.node().innerHTML; } function Ac() { this.nextSibling && this.parentNode.appendChild(this); @@ -3390,78 +3390,78 @@ function Tc() { function Rc() { return this.each(Tc); } -function Cc(e) { - var t = typeof e == "function" ? e : Wo(e); +function Cc(t) { + var e = typeof t == "function" ? t : Wo(t); return this.select(function() { - return this.appendChild(t.apply(this, arguments)); + return this.appendChild(e.apply(this, arguments)); }); } function Sc() { return null; } -function Nc(e, t) { - var n = typeof e == "function" ? e : Wo(e), r = t == null ? Sc : typeof t == "function" ? t : Ys(t); +function Nc(t, e) { + var n = typeof t == "function" ? t : Wo(t), r = e == null ? Sc : typeof e == "function" ? e : Ys(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } function kc() { - var e = this.parentNode; - e && e.removeChild(this); + var t = this.parentNode; + t && t.removeChild(this); } function Mc() { return this.each(kc); } function Pc() { - var e = this.cloneNode(!1), t = this.parentNode; - return t ? t.insertBefore(e, this.nextSibling) : e; + var t = this.cloneNode(!1), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; } function Dc() { - var e = this.cloneNode(!0), t = this.parentNode; - return t ? t.insertBefore(e, this.nextSibling) : e; + var t = this.cloneNode(!0), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; } -function Ic(e) { - return this.select(e ? Dc : Pc); +function Ic(t) { + return this.select(t ? Dc : Pc); } -function Fc(e) { - return arguments.length ? this.property("__data__", e) : this.node().__data__; +function Fc(t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; } -function Oc(e) { - return function(t) { - e.call(this, t, this.__data__); +function Oc(t) { + return function(e) { + t.call(this, e, this.__data__); }; } -function Lc(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 Lc(t) { + return t.trim().split(/^|\s+/).map(function(e) { + var n = "", r = e.indexOf("."); + return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n }; }); } -function qc(e) { +function qc(t) { return function() { - var t = this.__on; - if (t) { - for (var n = 0, r = -1, i = t.length, s; n < i; ++n) - s = t[n], (!e.type || s.type === e.type) && s.name === e.name ? this.removeEventListener(s.type, s.listener, s.options) : t[++r] = s; - ++r ? t.length = r : delete this.__on; + var e = this.__on; + if (e) { + for (var n = 0, r = -1, i = e.length, s; n < i; ++n) + s = e[n], (!t.type || s.type === t.type) && s.name === t.name ? this.removeEventListener(s.type, s.listener, s.options) : e[++r] = s; + ++r ? e.length = r : delete this.__on; } }; } -function Vc(e, t, n) { +function Vc(t, e, n) { return function() { - var r = this.__on, i, s = Oc(t); + var r = this.__on, i, s = Oc(e); if (r) { for (var a = 0, o = r.length; a < o; ++a) - if ((i = r[a]).type === e.type && i.name === e.name) { - this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = t; + if ((i = r[a]).type === t.type && i.name === t.name) { + this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = e; return; } } - 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]; + this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; }; } -function Hc(e, t, n) { - var r = Lc(e + ""), i, s = r.length, a; +function Hc(t, e, n) { + var r = Lc(t + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3472,43 +3472,43 @@ function Hc(e, t, n) { } return; } - for (o = t ? Vc : qc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); + for (o = e ? Vc : qc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); return this; } -function nl(e, t, n) { - var r = Jo(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 nl(t, e, n) { + var r = Jo(t), i = r.CustomEvent; + typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); } -function Yc(e, t) { +function Yc(t, e) { return function() { - return nl(this, e, t); + return nl(this, t, e); }; } -function zc(e, t) { +function zc(t, e) { return function() { - return nl(this, e, t.apply(this, arguments)); + return nl(this, t, e.apply(this, arguments)); }; } -function Bc(e, t) { - return this.each((typeof t == "function" ? zc : Yc)(e, t)); +function Bc(t, e) { + return this.each((typeof e == "function" ? zc : Yc)(t, e)); } function* Xc() { - 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) + for (var t = this._groups, e = 0, n = t.length; e < n; ++e) + for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) (a = r[i]) && (yield a); } var rl = [null]; -function at(e, t) { - this._groups = e, this._parents = t; +function ae(t, e) { + this._groups = t, this._parents = e; } function xr() { - return new at([[document.documentElement]], rl); + return new ae([[document.documentElement]], rl); } function Wc() { return this; } -at.prototype = xr.prototype = { - constructor: at, +ae.prototype = xr.prototype = { + constructor: ae, select: mf, selectAll: bf, selectChild: Tf, @@ -3545,20 +3545,20 @@ at.prototype = xr.prototype = { dispatch: Bc, [Symbol.iterator]: Xc }; -function ue(e) { - return typeof e == "string" ? new at([[document.querySelector(e)]], [document.documentElement]) : new at([[e]], rl); +function ct(t) { + return typeof t == "string" ? new ae([[document.querySelector(t)]], [document.documentElement]) : new ae([[t]], rl); } -function Bs(e, t, n) { - e.prototype = t.prototype = n, n.constructor = e; +function Bs(t, e, n) { + t.prototype = e.prototype = n, n.constructor = t; } -function il(e, t) { - var n = Object.create(e.prototype); - for (var r in t) n[r] = t[r]; +function il(t, e) { + var n = Object.create(t.prototype); + for (var r in e) n[r] = e[r]; return n; } function Kr() { } -var Lr = 0.7, Ei = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Dt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Uc = /^#([0-9a-f]{3,8})$/, Gc = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), Kc = new RegExp(`^rgb\\(${Dt},${Dt},${Dt}\\)$`), jc = new RegExp(`^rgba\\(${nr},${nr},${nr},${qr}\\)$`), Jc = new RegExp(`^rgba\\(${Dt},${Dt},${Dt},${qr}\\)$`), Zc = new RegExp(`^hsl\\(${qr},${Dt},${Dt}\\)$`), Qc = new RegExp(`^hsla\\(${qr},${Dt},${Dt},${qr}\\)$`), Aa = { +var Lr = 0.7, Ei = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", De = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Uc = /^#([0-9a-f]{3,8})$/, Gc = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), Kc = new RegExp(`^rgb\\(${De},${De},${De}\\)$`), jc = new RegExp(`^rgba\\(${nr},${nr},${nr},${qr}\\)$`), Jc = new RegExp(`^rgba\\(${De},${De},${De},${qr}\\)$`), Zc = new RegExp(`^hsl\\(${qr},${De},${De}\\)$`), Qc = new RegExp(`^hsla\\(${qr},${De},${De},${qr}\\)$`), Aa = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3709,8 +3709,8 @@ var Lr = 0.7, Ei = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\ yellowgreen: 10145074 }; Bs(Kr, Wn, { - copy(e) { - return Object.assign(new this.constructor(), this, e); + copy(t) { + return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); @@ -3718,54 +3718,54 @@ Bs(Kr, Wn, { hex: Ea, // Deprecated! Use color.formatHex. formatHex: Ea, - formatHex8: eh, - formatHsl: th, + formatHex8: th, + formatHsl: eh, formatRgb: Ta, toString: Ta }); function Ea() { return this.rgb().formatHex(); } -function eh() { +function th() { return this.rgb().formatHex8(); } -function th() { +function eh() { return sl(this).formatHsl(); } function Ta() { return this.rgb().formatRgb(); } -function Wn(e) { - var t, n; - return e = (e + "").trim().toLowerCase(), (t = Uc.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Ra(t) : n === 3 ? new Ze(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 = Gc.exec(e)) ? new Ze(t[1], t[2], t[3], 1) : (t = Kc.exec(e)) ? new Ze(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = jc.exec(e)) ? si(t[1], t[2], t[3], t[4]) : (t = Jc.exec(e)) ? si(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = Zc.exec(e)) ? Na(t[1], t[2] / 100, t[3] / 100, 1) : (t = Qc.exec(e)) ? Na(t[1], t[2] / 100, t[3] / 100, t[4]) : Aa.hasOwnProperty(e) ? Ra(Aa[e]) : e === "transparent" ? new Ze(NaN, NaN, NaN, 0) : null; +function Wn(t) { + var e, n; + return t = (t + "").trim().toLowerCase(), (e = Uc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ra(e) : n === 3 ? new Zt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? si(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? si(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Gc.exec(t)) ? new Zt(e[1], e[2], e[3], 1) : (e = Kc.exec(t)) ? new Zt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = jc.exec(t)) ? si(e[1], e[2], e[3], e[4]) : (e = Jc.exec(t)) ? si(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Zc.exec(t)) ? Na(e[1], e[2] / 100, e[3] / 100, 1) : (e = Qc.exec(t)) ? Na(e[1], e[2] / 100, e[3] / 100, e[4]) : Aa.hasOwnProperty(t) ? Ra(Aa[t]) : t === "transparent" ? new Zt(NaN, NaN, NaN, 0) : null; } -function Ra(e) { - return new Ze(e >> 16 & 255, e >> 8 & 255, e & 255, 1); +function Ra(t) { + return new Zt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function si(e, t, n, r) { - return r <= 0 && (e = t = n = NaN), new Ze(e, t, n, r); +function si(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new Zt(t, e, n, r); } -function nh(e) { - return e instanceof Kr || (e = Wn(e)), e ? (e = e.rgb(), new Ze(e.r, e.g, e.b, e.opacity)) : new Ze(); +function nh(t) { + return t instanceof Kr || (t = Wn(t)), t ? (t = t.rgb(), new Zt(t.r, t.g, t.b, t.opacity)) : new Zt(); } -function ws(e, t, n, r) { - return arguments.length === 1 ? nh(e) : new Ze(e, t, n, r ?? 1); +function ws(t, e, n, r) { + return arguments.length === 1 ? nh(t) : new Zt(t, e, n, r ?? 1); } -function Ze(e, t, n, r) { - this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; +function Zt(t, e, n, r) { + this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -Bs(Ze, ws, il(Kr, { - brighter(e) { - return e = e == null ? Ei : Math.pow(Ei, e), new Ze(this.r * e, this.g * e, this.b * e, this.opacity); +Bs(Zt, ws, il(Kr, { + brighter(t) { + return t = t == null ? Ei : Math.pow(Ei, t), new Zt(this.r * t, this.g * t, this.b * t, this.opacity); }, - darker(e) { - return e = e == null ? Lr : Math.pow(Lr, e), new Ze(this.r * e, this.g * e, this.b * e, this.opacity); + darker(t) { + return t = t == null ? Lr : Math.pow(Lr, t), new Zt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new Ze(zn(this.r), zn(this.g), zn(this.b), Ti(this.opacity)); + return new Zt(zn(this.r), zn(this.g), zn(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; @@ -3784,165 +3784,165 @@ function rh() { return `#${Pn(this.r)}${Pn(this.g)}${Pn(this.b)}${Pn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Sa() { - const e = Ti(this.opacity); - return `${e === 1 ? "rgb(" : "rgba("}${zn(this.r)}, ${zn(this.g)}, ${zn(this.b)}${e === 1 ? ")" : `, ${e})`}`; + const t = Ti(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${zn(this.r)}, ${zn(this.g)}, ${zn(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function Ti(e) { - return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); +function Ti(t) { + return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function zn(e) { - return Math.max(0, Math.min(255, Math.round(e) || 0)); +function zn(t) { + return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function Pn(e) { - return e = zn(e), (e < 16 ? "0" : "") + e.toString(16); +function Pn(t) { + return t = zn(t), (t < 16 ? "0" : "") + t.toString(16); } -function Na(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 Na(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new be(t, e, n, r); } -function sl(e) { - if (e instanceof bt) return new bt(e.h, e.s, e.l, e.opacity); - if (e instanceof Kr || (e = Wn(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 bt(a, o, l, e.opacity); +function sl(t) { + if (t instanceof be) return new be(t.h, t.s, t.l, t.opacity); + if (t instanceof Kr || (t = Wn(t)), !t) return new be(); + if (t instanceof be) return t; + t = t.rgb(); + var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; + return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new be(a, o, l, t.opacity); } -function ih(e, t, n, r) { - return arguments.length === 1 ? sl(e) : new bt(e, t, n, r ?? 1); +function ih(t, e, n, r) { + return arguments.length === 1 ? sl(t) : new be(t, e, n, r ?? 1); } -function bt(e, t, n, r) { - this.h = +e, this.s = +t, this.l = +n, this.opacity = +r; +function be(t, e, n, r) { + this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -Bs(bt, ih, il(Kr, { - brighter(e) { - return e = e == null ? Ei : Math.pow(Ei, e), new bt(this.h, this.s, this.l * e, this.opacity); +Bs(be, ih, il(Kr, { + brighter(t) { + return t = t == null ? Ei : Math.pow(Ei, t), new be(this.h, this.s, this.l * t, this.opacity); }, - darker(e) { - return e = e == null ? Lr : Math.pow(Lr, e), new bt(this.h, this.s, this.l * e, this.opacity); + darker(t) { + return t = t == null ? Lr : Math.pow(Lr, t), new be(this.h, this.s, this.l * t, 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 Ze( - ts(e >= 240 ? e - 240 : e + 120, i, r), - ts(e, i, r), - ts(e < 120 ? e + 240 : e - 120, i, r), + var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; + return new Zt( + es(t >= 240 ? t - 240 : t + 120, i, r), + es(t, i, r), + es(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new bt(ka(this.h), ai(this.s), ai(this.l), Ti(this.opacity)); + return new be(ka(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 = Ti(this.opacity); - return `${e === 1 ? "hsl(" : "hsla("}${ka(this.h)}, ${ai(this.s) * 100}%, ${ai(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; + const t = Ti(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${ka(this.h)}, ${ai(this.s) * 100}%, ${ai(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function ka(e) { - return e = (e || 0) % 360, e < 0 ? e + 360 : e; +function ka(t) { + return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function ai(e) { - return Math.max(0, Math.min(1, e || 0)); +function ai(t) { + return Math.max(0, Math.min(1, t || 0)); } -function ts(e, t, n) { - return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255; +function es(t, e, n) { + return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; } -const Xs = (e) => () => e; -function sh(e, t) { +const Xs = (t) => () => t; +function sh(t, e) { return function(n) { - return e + n * t; + return t + n * e; }; } -function ah(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 ah(t, e, n) { + return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) { + return Math.pow(t + r * e, n); }; } -function oh(e) { - return (e = +e) == 1 ? al : function(t, n) { - return n - t ? ah(t, n, e) : Xs(isNaN(t) ? n : t); +function oh(t) { + return (t = +t) == 1 ? al : function(e, n) { + return n - e ? ah(e, n, t) : Xs(isNaN(e) ? n : e); }; } -function al(e, t) { - var n = t - e; - return n ? sh(e, n) : Xs(isNaN(e) ? t : e); +function al(t, e) { + var n = e - t; + return n ? sh(t, n) : Xs(isNaN(t) ? e : t); } -const Ri = (function e(t) { - var n = oh(t); +const Ri = (function t(e) { + var n = oh(e); function r(i, s) { var a = n((i = ws(i)).r, (s = ws(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = al(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; + return r.gamma = t, r; })(1); -function lh(e, t) { - t || (t = []); - var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i; +function lh(t, e) { + e || (e = []); + var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { - for (i = 0; i < n; ++i) r[i] = e[i] * (1 - s) + t[i] * s; + for (i = 0; i < n; ++i) r[i] = t[i] * (1 - s) + e[i] * s; return r; }; } -function uh(e) { - return ArrayBuffer.isView(e) && !(e instanceof DataView); +function uh(t) { + return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function fh(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] = Gt(e[a], t[a]); - for (; a < n; ++a) s[a] = t[a]; +function fh(t, e) { + var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; + for (a = 0; a < r; ++a) i[a] = Ge(t[a], e[a]); + for (; a < n; ++a) s[a] = e[a]; return function(o) { for (a = 0; a < r; ++a) s[a] = i[a](o); return s; }; } -function ch(e, t) { +function ch(t, e) { var n = /* @__PURE__ */ new Date(); - return e = +e, t = +t, function(r) { - return n.setTime(e * (1 - r) + t * r), n; + return t = +t, e = +e, function(r) { + return n.setTime(t * (1 - r) + e * r), n; }; } -function Pt(e, t) { - return e = +e, t = +t, function(n) { - return e * (1 - n) + t * n; +function Pe(t, e) { + return t = +t, e = +e, function(n) { + return t * (1 - n) + e * n; }; } -function hh(e, t) { +function hh(t, e) { 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] = Gt(e[i], t[i]) : r[i] = t[i]; + (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); + for (i in e) + i in t ? n[i] = Ge(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } var xs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ns = new RegExp(xs.source, "g"); -function dh(e) { +function dh(t) { return function() { - return e; + return t; }; } -function ph(e) { - return function(t) { - return e(t) + ""; +function ph(t) { + return function(e) { + return t(e) + ""; }; } -function ol(e, t) { +function ol(t, e) { var n = xs.lastIndex = ns.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (e = e + "", t = t + ""; (r = xs.exec(e)) && (i = ns.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: Pt(r, i) })), n = ns.lastIndex; - return n < t.length && (s = t.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? ph(l[0].x) : dh(t) : (t = l.length, function(u) { - for (var f = 0, h; f < t; ++f) o[(h = l[f]).i] = h.x(u); + for (t = t + "", e = e + ""; (r = xs.exec(t)) && (i = ns.exec(e)); ) + (s = i.index) > n && (s = e.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: Pe(r, i) })), n = ns.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? ph(l[0].x) : dh(e) : (e = l.length, function(u) { + for (var f = 0, h; f < e; ++f) o[(h = l[f]).i] = h.x(u); return o.join(""); }); } -function Gt(e, t) { - var n = typeof t, r; - return t == null || n === "boolean" ? Xs(t) : (n === "number" ? Pt : n === "string" ? (r = Wn(t)) ? (t = r, Ri) : ol : t instanceof Wn ? Ri : t instanceof Date ? ch : uh(t) ? lh : Array.isArray(t) ? fh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? hh : Pt)(e, t); +function Ge(t, e) { + var n = typeof e, r; + return e == null || n === "boolean" ? Xs(e) : (n === "number" ? Pe : n === "string" ? (r = Wn(e)) ? (e = r, Ri) : ol : e instanceof Wn ? Ri : e instanceof Date ? ch : uh(e) ? lh : Array.isArray(e) ? fh : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? hh : Pe)(t, e); } var Ma = 180 / Math.PI, bs = { translateX: 0, @@ -3952,57 +3952,57 @@ var Ma = 180 / Math.PI, bs = { scaleX: 1, scaleY: 1 }; -function ll(e, t, n, r, i, s) { +function ll(t, e, 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), { + return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(t, e) * Ma, + rotate: Math.atan2(e, t) * Ma, skewX: Math.atan(l) * Ma, scaleX: a, scaleY: o }; } var oi; -function vh(e) { - const t = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(e + ""); - return t.isIdentity ? bs : ll(t.a, t.b, t.c, t.d, t.e, t.f); +function vh(t) { + const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); + return e.isIdentity ? bs : ll(e.a, e.b, e.c, e.d, e.e, e.f); } -function gh(e) { - return e == null || (oi || (oi = document.createElementNS("http://www.w3.org/2000/svg", "g")), oi.setAttribute("transform", e), !(e = oi.transform.baseVal.consolidate())) ? bs : (e = e.matrix, ll(e.a, e.b, e.c, e.d, e.e, e.f)); +function gh(t) { + return t == null || (oi || (oi = document.createElementNS("http://www.w3.org/2000/svg", "g")), oi.setAttribute("transform", t), !(t = oi.transform.baseVal.consolidate())) ? bs : (t = t.matrix, ll(t.a, t.b, t.c, t.d, t.e, t.f)); } -function ul(e, t, n, r) { +function ul(t, e, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } function s(u, f, h, c, p, m) { if (u !== h || f !== c) { - var $ = p.push("translate(", null, t, null, n); - m.push({ i: $ - 4, x: Pt(u, h) }, { i: $ - 2, x: Pt(f, c) }); - } else (h || c) && p.push("translate(" + h + t + c + n); + var $ = p.push("translate(", null, e, null, n); + m.push({ i: $ - 4, x: Pe(u, h) }, { i: $ - 2, x: Pe(f, c) }); + } else (h || c) && p.push("translate(" + h + e + c + n); } function a(u, f, h, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Pt(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Pe(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); } function o(u, f, h, c) { - u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Pt(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); + u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Pe(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); } function l(u, f, h, c, p, m) { if (u !== h || f !== c) { var $ = p.push(i(p) + "scale(", null, ",", null, ")"); - m.push({ i: $ - 4, x: Pt(u, h) }, { i: $ - 2, x: Pt(f, c) }); + m.push({ i: $ - 4, x: Pe(u, h) }, { i: $ - 2, x: Pe(f, c) }); } else (h !== 1 || c !== 1) && p.push(i(p) + "scale(" + h + "," + c + ")"); } return function(u, f) { var h = [], c = []; - return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, h, c), a(u.rotate, f.rotate, h, c), o(u.skewX, f.skewX, h, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, h, c), u = f = null, function(p) { + return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, h, c), a(u.rotate, f.rotate, h, c), o(u.skewX, f.skewX, h, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, h, c), u = f = null, function(p) { for (var m = -1, $ = c.length, _; ++m < $; ) h[(_ = c[m]).i] = _.x(p); return h.join(""); }; }; } -var _h = ul(vh, "px, ", "px)", "deg)"), mh = ul(gh, ", ", ")", ")"), mr = 0, Nr = 0, Cr = 0, fl = 1e3, Ci, kr, Si = 0, Un = 0, Wi = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, cl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { - setTimeout(e, 17); +var _h = ul(vh, "px, ", "px)", "deg)"), mh = ul(gh, ", ", ")", ")"), mr = 0, Nr = 0, Cr = 0, fl = 1e3, Ci, kr, Si = 0, Un = 0, Wi = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, cl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { + setTimeout(t, 17); }; function Ws() { return Un || (cl(yh), Un = Vr.now() + Wi); @@ -4015,22 +4015,22 @@ function Ni() { } Ni.prototype = hl.prototype = { constructor: Ni, - restart: function(e, t, n) { - if (typeof e != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Ws() : +n) + (t == null ? 0 : +t), !this._next && kr !== this && (kr ? kr._next = this : Ci = this, kr = this), this._call = e, this._time = n, $s(); + restart: function(t, e, n) { + if (typeof t != "function") throw new TypeError("callback is not a function"); + n = (n == null ? Ws() : +n) + (e == null ? 0 : +e), !this._next && kr !== this && (kr ? kr._next = this : Ci = this, kr = this), this._call = t, this._time = n, $s(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, $s()); } }; -function hl(e, t, n) { +function hl(t, e, n) { var r = new Ni(); - return r.restart(e, t, n), r; + return r.restart(t, e, n), r; } function wh() { Ws(), ++mr; - for (var e = Ci, t; e; ) - (t = Un - e._time) >= 0 && e._call.call(void 0, t), e = e._next; + for (var t = Ci, e; t; ) + (e = Un - t._time) >= 0 && t._call.call(void 0, e), t = t._next; --mr; } function Pa() { @@ -4042,34 +4042,34 @@ function Pa() { } } function xh() { - var e = Vr.now(), t = e - Si; - t > fl && (Wi -= t, Si = e); + var t = Vr.now(), e = t - Si; + e > fl && (Wi -= e, Si = t); } function bh() { - for (var e, t = Ci, 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 : Ci = n); - kr = e, $s(r); + for (var t, e = Ci, n, r = 1 / 0; e; ) + e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : Ci = n); + kr = t, $s(r); } -function $s(e) { +function $s(t) { if (!mr) { Nr && (Nr = clearTimeout(Nr)); - var t = e - Un; - t > 24 ? (e < 1 / 0 && (Nr = setTimeout(Pa, e - Vr.now() - Wi)), Cr && (Cr = clearInterval(Cr))) : (Cr || (Si = Vr.now(), Cr = setInterval(xh, fl)), mr = 1, cl(Pa)); + var e = t - Un; + e > 24 ? (t < 1 / 0 && (Nr = setTimeout(Pa, t - Vr.now() - Wi)), Cr && (Cr = clearInterval(Cr))) : (Cr || (Si = Vr.now(), Cr = setInterval(xh, fl)), mr = 1, cl(Pa)); } } -function Da(e, t, n) { +function Da(t, e, n) { var r = new Ni(); - return t = t == null ? 0 : +t, r.restart((i) => { - r.stop(), e(i + t); - }, t, n), r; + return e = e == null ? 0 : +e, r.restart((i) => { + r.stop(), t(i + e); + }, e, n), r; } var $h = Xo("start", "end", "cancel", "interrupt"), Ah = [], dl = 0, Ia = 1, As = 2, _i = 3, Fa = 4, Es = 5, mi = 6; -function Ui(e, t, n, r, i, s) { - var a = e.__transition; - if (!a) e.__transition = {}; +function Ui(t, e, n, r, i, s) { + var a = t.__transition; + if (!a) t.__transition = {}; else if (n in a) return; - Eh(e, n, { - name: t, + Eh(t, n, { + name: e, index: r, // For context during callback. group: i, @@ -4084,24 +4084,24 @@ function Ui(e, t, n, r, i, s) { state: dl }); } -function Us(e, t) { - var n = Rt(e, t); +function Us(t, e) { + var n = Re(t, e); if (n.state > dl) throw new Error("too late; already scheduled"); return n; } -function Vt(e, t) { - var n = Rt(e, t); +function Ve(t, e) { + var n = Re(t, e); if (n.state > _i) throw new Error("too late; already running"); return n; } -function Rt(e, t) { - var n = e.__transition; - if (!n || !(n = n[t])) throw new Error("transition not found"); +function Re(t, e) { + var n = t.__transition; + if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Eh(e, t, n) { - var r = e.__transition, i; - r[t] = n, n.timer = hl(s, 0, n.time); +function Eh(t, e, n) { + var r = t.__transition, i; + r[e] = n, n.timer = hl(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); } @@ -4111,54 +4111,54 @@ function Eh(e, t, n) { for (f in r) if (p = r[f], p.name === n.name) { if (p.state === _i) return Da(a); - p.state === Fa ? (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]); + p.state === Fa ? (p.state = mi, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = mi, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); } if (Da(function() { n.state === _i && (n.state = Fa, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = As, n.on.call("start", e, e.__data__, n.index, n.group), n.state === As) { + }), n.state = As, n.on.call("start", t, t.__data__, n.index, n.group), n.state === As) { for (n.state = _i, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) - (p = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++h] = p); + (p = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = p); i.length = h + 1; } } function o(u) { for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Es, 1), h = -1, c = i.length; ++h < c; ) - i[h].call(e, f); - n.state === Es && (n.on.call("end", e, e.__data__, n.index, n.group), l()); + i[h].call(t, f); + n.state === Es && (n.on.call("end", t, t.__data__, n.index, n.group), l()); } function l() { - n.state = mi, n.timer.stop(), delete r[t]; + n.state = mi, n.timer.stop(), delete r[e]; for (var u in r) return; - delete e.__transition; + delete t.__transition; } } -function Th(e, t) { - var n = e.__transition, r, i, s = !0, a; +function Th(t, e) { + var n = t.__transition, r, i, s = !0, a; if (n) { - t = t == null ? null : t + ""; + e = e == null ? null : e + ""; for (a in n) { - if ((r = n[a]).name !== t) { + if ((r = n[a]).name !== e) { s = !1; continue; } - i = r.state > As && r.state < Es, r.state = mi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; + i = r.state > As && r.state < Es, r.state = mi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } - s && delete e.__transition; + s && delete t.__transition; } } -function Rh(e) { +function Rh(t) { return this.each(function() { - Th(this, e); + Th(this, t); }); } -function Ch(e, t) { +function Ch(t, e) { var n, r; return function() { - var i = Vt(this, e), s = i.tween; + var i = Ve(this, t), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) - if (r[a].name === t) { + if (r[a].name === e) { r = r.slice(), r.splice(a, 1); break; } @@ -4166,15 +4166,15 @@ function Ch(e, t) { i.tween = r; }; } -function Sh(e, t, n) { +function Sh(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Vt(this, e), a = s.tween; + var s = Ve(this, t), 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) - if (i[l].name === t) { + for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) + if (i[l].name === e) { i[l] = o; break; } @@ -4183,365 +4183,365 @@ function Sh(e, t, n) { s.tween = i; }; } -function Nh(e, t) { +function Nh(t, e) { 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) - if ((a = r[i]).name === e) + if (t += "", arguments.length < 2) { + for (var r = Re(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + if ((a = r[i]).name === t) return a.value; return null; } - return this.each((t == null ? Ch : Sh)(n, e, t)); + return this.each((e == null ? Ch : Sh)(n, t, e)); } -function Gs(e, t, n) { - var r = e._id; - return e.each(function() { - var i = Vt(this, r); - (i.value || (i.value = {}))[t] = n.apply(this, arguments); +function Gs(t, e, n) { + var r = t._id; + return t.each(function() { + var i = Ve(this, r); + (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return Rt(i, r).value[t]; + return Re(i, r).value[e]; }; } -function pl(e, t) { +function pl(t, e) { var n; - return (typeof t == "number" ? Pt : t instanceof Wn ? Ri : (n = Wn(t)) ? (t = n, Ri) : ol)(e, t); + return (typeof e == "number" ? Pe : e instanceof Wn ? Ri : (n = Wn(e)) ? (e = n, Ri) : ol)(t, e); } -function kh(e) { +function kh(t) { return function() { - this.removeAttribute(e); + this.removeAttribute(t); }; } -function Mh(e) { +function Mh(t) { return function() { - this.removeAttributeNS(e.space, e.local); + this.removeAttributeNS(t.space, t.local); }; } -function Ph(e, t, n) { +function Ph(t, e, 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); + var a = this.getAttribute(t); + return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function Dh(e, t, n) { +function Dh(t, e, 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); + var a = this.getAttributeNS(t.space, t.local); + return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function Ih(e, t, n) { +function Ih(t, e, 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))); + return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function Fh(e, t, n) { +function Fh(t, e, 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))); + return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); }; } -function Oh(e, t) { - var n = Xi(e), r = n === "transform" ? mh : pl; - return this.attrTween(e, typeof t == "function" ? (n.local ? Fh : Ih)(n, r, Gs(this, "attr." + e, t)) : t == null ? (n.local ? Mh : kh)(n) : (n.local ? Dh : Ph)(n, r, t)); +function Oh(t, e) { + var n = Xi(t), r = n === "transform" ? mh : pl; + return this.attrTween(t, typeof e == "function" ? (n.local ? Fh : Ih)(n, r, Gs(this, "attr." + t, e)) : e == null ? (n.local ? Mh : kh)(n) : (n.local ? Dh : Ph)(n, r, e)); } -function Lh(e, t) { +function Lh(t, e) { return function(n) { - this.setAttribute(e, t.call(this, n)); + this.setAttribute(t, e.call(this, n)); }; } -function qh(e, t) { +function qh(t, e) { return function(n) { - this.setAttributeNS(e.space, e.local, t.call(this, n)); + this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function Vh(e, t) { +function Vh(t, e) { var n, r; function i() { - var s = t.apply(this, arguments); - return s !== r && (n = (r = s) && qh(e, s)), n; + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && qh(t, s)), n; } - return i._value = t, i; + return i._value = e, i; } -function Hh(e, t) { +function Hh(t, e) { var n, r; function i() { - var s = t.apply(this, arguments); - return s !== r && (n = (r = s) && Lh(e, s)), n; + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && Lh(t, s)), n; } - return i._value = t, i; + return i._value = e, i; } -function Yh(e, t) { - var n = "attr." + e; +function Yh(t, e) { + var n = "attr." + t; 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 = Xi(e); - return this.tween(n, (r.local ? Vh : Hh)(r, t)); + if (e == null) return this.tween(n, null); + if (typeof e != "function") throw new Error(); + var r = Xi(t); + return this.tween(n, (r.local ? Vh : Hh)(r, e)); } -function zh(e, t) { +function zh(t, e) { return function() { - Us(this, e).delay = +t.apply(this, arguments); + Us(this, t).delay = +e.apply(this, arguments); }; } -function Bh(e, t) { - return t = +t, function() { - Us(this, e).delay = t; +function Bh(t, e) { + return e = +e, function() { + Us(this, t).delay = e; }; } -function Xh(e) { - var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? zh : Bh)(t, e)) : Rt(this.node(), t).delay; +function Xh(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? zh : Bh)(e, t)) : Re(this.node(), e).delay; } -function Wh(e, t) { +function Wh(t, e) { return function() { - Vt(this, e).duration = +t.apply(this, arguments); + Ve(this, t).duration = +e.apply(this, arguments); }; } -function Uh(e, t) { - return t = +t, function() { - Vt(this, e).duration = t; +function Uh(t, e) { + return e = +e, function() { + Ve(this, t).duration = e; }; } -function Gh(e) { - var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Wh : Uh)(t, e)) : Rt(this.node(), t).duration; +function Gh(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? Wh : Uh)(e, t)) : Re(this.node(), e).duration; } -function Kh(e, t) { - if (typeof t != "function") throw new Error(); +function Kh(t, e) { + if (typeof e != "function") throw new Error(); return function() { - Vt(this, e).ease = t; + Ve(this, t).ease = e; }; } -function jh(e) { - var t = this._id; - return arguments.length ? this.each(Kh(t, e)) : Rt(this.node(), t).ease; +function jh(t) { + var e = this._id; + return arguments.length ? this.each(Kh(e, t)) : Re(this.node(), e).ease; } -function Jh(e, t) { +function Jh(t, e) { return function() { - var n = t.apply(this, arguments); + var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - Vt(this, e).ease = n; + Ve(this, t).ease = n; }; } -function Zh(e) { - if (typeof e != "function") throw new Error(); - return this.each(Jh(this._id, e)); +function Zh(t) { + if (typeof t != "function") throw new Error(); + return this.each(Jh(this._id, t)); } -function Qh(e) { - typeof e != "function" && (e = Go(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); +function Qh(t) { + typeof t != "function" && (t = Go(t)); + for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) + for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) + (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); return new on(r, this._parents, this._name, this._id); } -function ed(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, h = a[o] = new Array(f), c, p = 0; p < f; ++p) +function td(t) { + if (t._id !== this._id) throw new Error(); + for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) + for (var l = e[o], u = n[o], f = l.length, h = a[o] = new Array(f), c, p = 0; p < f; ++p) (c = l[p] || u[p]) && (h[p] = c); for (; o < r; ++o) - a[o] = t[o]; + a[o] = e[o]; return new on(a, this._parents, this._name, this._id); } -function td(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 ed(t) { + return (t + "").trim().split(/^|\s+/).every(function(e) { + var n = e.indexOf("."); + return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; }); } -function nd(e, t, n) { - var r, i, s = td(t) ? Us : Vt; +function nd(t, e, n) { + var r, i, s = ed(e) ? Us : Ve; return function() { - var a = s(this, e), o = a.on; - o !== r && (i = (r = o).copy()).on(t, n), a.on = i; + var a = s(this, t), o = a.on; + o !== r && (i = (r = o).copy()).on(e, n), a.on = i; }; } -function rd(e, t) { +function rd(t, e) { var n = this._id; - return arguments.length < 2 ? Rt(this.node(), n).on.on(e) : this.each(nd(n, e, t)); + return arguments.length < 2 ? Re(this.node(), n).on.on(t) : this.each(nd(n, t, e)); } -function id(e) { +function id(t) { return function() { - var t = this.parentNode; - for (var n in this.__transition) if (+n !== e) return; - t && t.removeChild(this); + var e = this.parentNode; + for (var n in this.__transition) if (+n !== t) return; + e && e.removeChild(this); }; } function sd() { return this.on("end.remove", id(this._id)); } -function ad(e) { - var t = this._name, n = this._id; - typeof e != "function" && (e = Ys(e)); +function ad(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = Ys(t)); 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, h, c = 0; c < l; ++c) - (f = o[c]) && (h = e.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Ui(u[c], t, n, c, u, Rt(f, n))); - return new on(s, this._parents, t, n); + (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Ui(u[c], e, n, c, u, Re(f, n))); + return new on(s, this._parents, e, n); } -function od(e) { - var t = this._name, n = this._id; - typeof e != "function" && (e = Uo(e)); +function od(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = Uo(t)); for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) for (var l = r[o], u = l.length, f, h = 0; h < u; ++h) if (f = l[h]) { - for (var c = e.call(f, f.__data__, h, l), p, m = Rt(f, n), $ = 0, _ = c.length; $ < _; ++$) - (p = c[$]) && Ui(p, t, n, $, c, m); + for (var c = t.call(f, f.__data__, h, l), p, m = Re(f, n), $ = 0, _ = c.length; $ < _; ++$) + (p = c[$]) && Ui(p, e, n, $, c, m); s.push(c), a.push(f); } - return new on(s, a, t, n); + return new on(s, a, e, n); } var ld = xr.prototype.constructor; function ud() { return new ld(this._groups, this._parents); } -function fd(e, t) { +function fd(t, e) { var n, r, i; return function() { - var s = _r(this, e), a = (this.style.removeProperty(e), _r(this, e)); - return s === a ? null : s === n && a === r ? i : i = t(n = s, r = a); + var s = _r(this, t), a = (this.style.removeProperty(t), _r(this, t)); + return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function vl(e) { +function vl(t) { return function() { - this.style.removeProperty(e); + this.style.removeProperty(t); }; } -function cd(e, t, n) { +function cd(t, e, n) { var r, i = n + "", s; return function() { - var a = _r(this, e); - return a === i ? null : a === r ? s : s = t(r = a, n); + var a = _r(this, t); + return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function hd(e, t, n) { +function hd(t, e, 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 = _r(this, t), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(t), _r(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); }; } -function dd(e, t) { - var n, r, i, s = "style." + t, a = "end." + s, o; +function dd(t, e) { + var n, r, i, s = "style." + e, a = "end." + s, o; return function() { - var l = Vt(this, e), u = l.on, f = l.value[s] == null ? o || (o = vl(t)) : void 0; + var l = Ve(this, t), u = l.on, f = l.value[s] == null ? o || (o = vl(e)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function pd(e, t, n) { - var r = (e += "") == "transform" ? _h : pl; - return t == null ? this.styleTween(e, fd(e, r)).on("end.style." + e, vl(e)) : typeof t == "function" ? this.styleTween(e, hd(e, r, Gs(this, "style." + e, t))).each(dd(this._id, e)) : this.styleTween(e, cd(e, r, t), n).on("end.style." + e, null); +function pd(t, e, n) { + var r = (t += "") == "transform" ? _h : pl; + return e == null ? this.styleTween(t, fd(t, r)).on("end.style." + t, vl(t)) : typeof e == "function" ? this.styleTween(t, hd(t, r, Gs(this, "style." + t, e))).each(dd(this._id, t)) : this.styleTween(t, cd(t, r, e), n).on("end.style." + t, null); } -function vd(e, t, n) { +function vd(t, e, n) { return function(r) { - this.style.setProperty(e, t.call(this, r), n); + this.style.setProperty(t, e.call(this, r), n); }; } -function gd(e, t, n) { +function gd(t, e, n) { var r, i; function s() { - var a = t.apply(this, arguments); - return a !== i && (r = (i = a) && vd(e, a, n)), r; + var a = e.apply(this, arguments); + return a !== i && (r = (i = a) && vd(t, a, n)), r; } - return s._value = t, s; + return s._value = e, s; } -function _d(e, t, n) { - var r = "style." + (e += ""); +function _d(t, e, n) { + var r = "style." + (t += ""); 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, gd(e, t, n ?? "")); + if (e == null) return this.tween(r, null); + if (typeof e != "function") throw new Error(); + return this.tween(r, gd(t, e, n ?? "")); } -function md(e) { +function md(t) { return function() { - this.textContent = e; + this.textContent = t; }; } -function yd(e) { +function yd(t) { return function() { - var t = e(this); - this.textContent = t ?? ""; + var e = t(this); + this.textContent = e ?? ""; }; } -function wd(e) { - return this.tween("text", typeof e == "function" ? yd(Gs(this, "text", e)) : md(e == null ? "" : e + "")); +function wd(t) { + return this.tween("text", typeof t == "function" ? yd(Gs(this, "text", t)) : md(t == null ? "" : t + "")); } -function xd(e) { - return function(t) { - this.textContent = e.call(this, t); +function xd(t) { + return function(e) { + this.textContent = t.call(this, e); }; } -function bd(e) { - var t, n; +function bd(t) { + var e, n; function r() { - var i = e.apply(this, arguments); - return i !== n && (t = (n = i) && xd(i)), t; + var i = t.apply(this, arguments); + return i !== n && (e = (n = i) && xd(i)), e; } - return r._value = e, r; + return r._value = t, r; } -function $d(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, bd(e)); +function $d(t) { + var e = "text"; + if (arguments.length < 1) return (e = this.tween(e)) && e._value; + if (t == null) return this.tween(e, null); + if (typeof t != "function") throw new Error(); + return this.tween(e, bd(t)); } function Ad() { - for (var e = this._name, t = this._id, n = gl(), r = this._groups, i = r.length, s = 0; s < i; ++s) + for (var t = this._name, e = this._id, n = gl(), 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); - Ui(l, e, n, u, a, { + var f = Re(l, e); + Ui(l, t, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new on(r, this._parents, e, n); + return new on(r, this._parents, t, n); } function Ed() { - var e, t, n = this, r = n._id, i = n.size(); + var t, e, 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 = Vt(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; + var u = Ve(this, r), f = u.on; + f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; }), i === 0 && s(); }); } var Td = 0; -function on(e, t, n, r) { - this._groups = e, this._parents = t, this._name = n, this._id = r; +function on(t, e, n, r) { + this._groups = t, this._parents = e, this._name = n, this._id = r; } -function yi(e) { - return xr().transition(e); +function yi(t) { + return xr().transition(t); } function gl() { return ++Td; } -var Ut = xr.prototype; +var Ue = xr.prototype; on.prototype = yi.prototype = { constructor: on, select: ad, selectAll: od, - selectChild: Ut.selectChild, - selectChildren: Ut.selectChildren, + selectChild: Ue.selectChild, + selectChildren: Ue.selectChildren, filter: Qh, - merge: ed, + merge: td, selection: ud, transition: Ad, - call: Ut.call, - nodes: Ut.nodes, - node: Ut.node, - size: Ut.size, - empty: Ut.empty, - each: Ut.each, + call: Ue.call, + nodes: Ue.nodes, + node: Ue.node, + size: Ue.size, + empty: Ue.empty, + each: Ue.each, on: rd, attr: Oh, attrTween: Yh, @@ -4556,10 +4556,10 @@ on.prototype = yi.prototype = { ease: jh, easeVarying: Zh, end: Ed, - [Symbol.iterator]: Ut[Symbol.iterator] + [Symbol.iterator]: Ue[Symbol.iterator] }; -function Rd(e) { - return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; +function Rd(t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } var Cd = { time: null, @@ -4568,33 +4568,33 @@ var Cd = { duration: 250, ease: Rd }; -function Sd(e, t) { - for (var n; !(n = e.__transition) || !(n = n[t]); ) - if (!(e = e.parentNode)) - throw new Error(`transition ${t} not found`); +function Sd(t, e) { + for (var n; !(n = t.__transition) || !(n = n[e]); ) + if (!(t = t.parentNode)) + throw new Error(`transition ${e} not found`); return n; } -function Nd(e) { - var t, n; - e instanceof on ? (t = e._id, e = e._name) : (t = gl(), (n = Cd).time = Ws(), e = e == null ? null : e + ""); +function Nd(t) { + var e, n; + t instanceof on ? (e = t._id, t = t._name) : (e = gl(), (n = Cd).time = Ws(), t = t == null ? null : t + ""); 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]) && Ui(l, e, t, u, a, n || Sd(l, t)); - return new on(r, this._parents, e, t); + (l = a[u]) && Ui(l, t, e, u, a, n || Sd(l, e)); + return new on(r, this._parents, t, e); } xr.prototype.interrupt = Rh; xr.prototype.transition = Nd; const Ts = Math.PI, Rs = 2 * Ts, Cn = 1e-6, kd = Rs - Cn; -function _l(e) { - this._ += e[0]; - for (let t = 1, n = e.length; t < n; ++t) - this._ += arguments[t] + e[t]; -} -function Md(e) { - let t = Math.floor(e); - if (!(t >= 0)) throw new Error(`invalid digits: ${e}`); - if (t > 15) return _l; - const n = 10 ** t; +function _l(t) { + this._ += t[0]; + for (let e = 1, n = t.length; e < n; ++e) + this._ += arguments[e] + t[e]; +} +function Md(t) { + let e = Math.floor(t); + if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); + if (e > 15) return _l; + const n = 10 ** e; return function(r) { this._ += r[0]; for (let i = 1, s = r.length; i < s; ++i) @@ -4602,176 +4602,176 @@ function Md(e) { }; } class Pd { - constructor(t) { + constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = t == null ? _l : Md(t); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? _l : Md(e); } - moveTo(t, n) { - this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`; + moveTo(e, n) { + this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; } closePath() { this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`); } - lineTo(t, n) { - this._append`L${this._x1 = +t},${this._y1 = +n}`; + lineTo(e, n) { + this._append`L${this._x1 = +e},${this._y1 = +n}`; } - quadraticCurveTo(t, n, r, i) { - this._append`Q${+t},${+n},${this._x1 = +r},${this._y1 = +i}`; + quadraticCurveTo(e, n, r, i) { + this._append`Q${+e},${+n},${this._x1 = +r},${this._y1 = +i}`; } - bezierCurveTo(t, n, r, i, s, a) { - this._append`C${+t},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; + bezierCurveTo(e, n, r, i, s, a) { + this._append`C${+e},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; } - 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, h = o - n, c = f * f + h * h; + arcTo(e, n, r, i, s) { + if (e = +e, 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 - e, u = i - n, f = a - e, h = o - n, c = f * f + h * h; if (this._x1 === null) - this._append`M${this._x1 = t},${this._y1 = n}`; + this._append`M${this._x1 = e},${this._y1 = n}`; else if (c > Cn) if (!(Math.abs(h * l - u * f) > Cn) || !s) - this._append`L${this._x1 = t},${this._y1 = n}`; + this._append`L${this._x1 = e},${this._y1 = n}`; else { let p = r - a, m = i - o, $ = l * l + u * u, _ = p * p + m * m, x = Math.sqrt($), F = Math.sqrt(c), S = s * Math.tan((Ts - Math.acos(($ + c - _) / (2 * x * F))) / 2), M = S / F, D = S / x; - Math.abs(M - 1) > Cn && this._append`L${t + M * f},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * p > f * m)},${this._x1 = t + D * l},${this._y1 = n + D * u}`; + Math.abs(M - 1) > Cn && this._append`L${e + M * f},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * p > f * m)},${this._x1 = e + D * l},${this._y1 = n + D * 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, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Cn || Math.abs(this._y1 - f) > Cn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Rs + Rs), c > kd ? this._append`A${r},${r},0,1,${h},${t - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > Cn && this._append`A${r},${r},0,${+(c >= Ts)},${h},${this._x1 = t + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + arc(e, n, r, i, s, a) { + if (e = +e, 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 = e + o, f = n + l, h = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Cn || Math.abs(this._y1 - f) > Cn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Rs + Rs), c > kd ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > Cn && this._append`A${r},${r},0,${+(c >= Ts)},${h},${this._x1 = e + 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`; + rect(e, n, r, i) { + this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; } toString() { return this._; } } -function Dd(e) { - for (var t = e.length / 6 | 0, n = new Array(t), r = 0; r < t; ) n[r] = "#" + e.slice(r * 6, ++r * 6); +function Dd(t) { + for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); return n; } const Id = Dd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Ve(e) { +function Vt(t) { return function() { - return e; + return t; }; } -const Oa = Math.abs, De = Math.atan2, Rn = Math.cos, Fd = Math.max, rs = Math.min, Ct = Math.sin, tr = Math.sqrt, We = 1e-12, Hr = Math.PI, ki = Hr / 2, wi = 2 * Hr; -function Od(e) { - return e > 1 ? 0 : e < -1 ? Hr : Math.acos(e); +const Oa = Math.abs, Dt = Math.atan2, Rn = Math.cos, Fd = Math.max, rs = Math.min, Ce = Math.sin, er = Math.sqrt, Wt = 1e-12, Hr = Math.PI, ki = Hr / 2, wi = 2 * Hr; +function Od(t) { + return t > 1 ? 0 : t < -1 ? Hr : Math.acos(t); } -function La(e) { - return e >= 1 ? ki : e <= -1 ? -ki : Math.asin(e); +function La(t) { + return t >= 1 ? ki : t <= -1 ? -ki : Math.asin(t); } -function Ld(e) { - let t = 3; - return e.digits = function(n) { - if (!arguments.length) return t; +function Ld(t) { + let e = 3; + return t.digits = function(n) { + if (!arguments.length) return e; if (n == null) - t = null; + e = null; else { const r = Math.floor(n); if (!(r >= 0)) throw new RangeError(`invalid digits: ${n}`); - t = r; + e = r; } - return e; - }, () => new Pd(t); + return t; + }, () => new Pd(e); } -function qd(e) { - return e.innerRadius; +function qd(t) { + return t.innerRadius; } -function Vd(e) { - return e.outerRadius; +function Vd(t) { + return t.outerRadius; } -function Hd(e) { - return e.startAngle; +function Hd(t) { + return t.startAngle; } -function Yd(e) { - return e.endAngle; +function Yd(t) { + return t.endAngle; } -function zd(e) { - return e && e.padAngle; +function zd(t) { + return t && t.padAngle; } -function Bd(e, t, n, r, i, s, a, o) { - var l = n - e, u = r - t, f = a - i, h = o - s, c = h * l - f * u; - if (!(c * c < We)) - return c = (f * (t - s) - h * (e - i)) / c, [e + c * l, t + c * u]; +function Bd(t, e, n, r, i, s, a, o) { + var l = n - t, u = r - e, f = a - i, h = o - s, c = h * l - f * u; + if (!(c * c < Wt)) + return c = (f * (e - s) - h * (t - i)) / c, [t + c * l, e + c * u]; } -function li(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, h = -u * o, c = e + f, p = t + h, m = n + f, $ = r + h, _ = (c + m) / 2, x = (p + $) / 2, F = m - c, S = $ - p, M = F * F + S * S, D = i - s, W = c * $ - m * p, K = (S < 0 ? -1 : 1) * tr(Fd(0, D * D * M - W * W)), Q = (W * S - F * K) / M, ee = (-W * F - S * K) / M, J = (W * S + F * K) / M, ae = (-W * F + S * K) / M, oe = Q - _, N = ee - x, H = J - _, Ie = ae - x; - return oe * oe + N * N > H * H + Ie * Ie && (Q = J, ee = ae), { +function li(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / er(o * o + l * l), f = u * l, h = -u * o, c = t + f, p = e + h, m = n + f, $ = r + h, _ = (c + m) / 2, x = (p + $) / 2, F = m - c, S = $ - p, M = F * F + S * S, D = i - s, W = c * $ - m * p, K = (S < 0 ? -1 : 1) * er(Fd(0, D * D * M - W * W)), Q = (W * S - F * K) / M, tt = (-W * F - S * K) / M, J = (W * S + F * K) / M, at = (-W * F + S * K) / M, ot = Q - _, N = tt - x, H = J - _, It = at - x; + return ot * ot + N * N > H * H + It * It && (Q = J, tt = at), { cx: Q, - cy: ee, + cy: tt, x01: -f, y01: -h, x11: Q * (i / D - 1), - y11: ee * (i / D - 1) + y11: tt * (i / D - 1) }; } -function yt() { - var e = qd, t = Vd, n = Ve(0), r = null, i = Hd, s = Yd, a = zd, o = null, l = Ld(u); +function ye() { + var t = qd, e = Vd, n = Vt(0), r = null, i = Hd, s = Yd, a = zd, o = null, l = Ld(u); function u() { - var f, h, c = +e.apply(this, arguments), p = +t.apply(this, arguments), m = i.apply(this, arguments) - ki, $ = s.apply(this, arguments) - ki, _ = Oa($ - m), x = $ > m; - if (o || (o = f = l()), p < c && (h = p, p = c, c = h), !(p > We)) o.moveTo(0, 0); - else if (_ > wi - We) - o.moveTo(p * Rn(m), p * Ct(m)), o.arc(0, 0, p, m, $, !x), c > We && (o.moveTo(c * Rn($), c * Ct($)), o.arc(0, 0, c, $, m, x)); + var f, h, c = +t.apply(this, arguments), p = +e.apply(this, arguments), m = i.apply(this, arguments) - ki, $ = s.apply(this, arguments) - ki, _ = Oa($ - m), x = $ > m; + if (o || (o = f = l()), p < c && (h = p, p = c, c = h), !(p > Wt)) o.moveTo(0, 0); + else if (_ > wi - Wt) + o.moveTo(p * Rn(m), p * Ce(m)), o.arc(0, 0, p, m, $, !x), c > Wt && (o.moveTo(c * Rn($), c * Ce($)), o.arc(0, 0, c, $, m, x)); else { - var F = m, S = $, M = m, D = $, W = _, K = _, Q = a.apply(this, arguments) / 2, ee = Q > We && (r ? +r.apply(this, arguments) : tr(c * c + p * p)), J = rs(Oa(p - c) / 2, +n.apply(this, arguments)), ae = J, oe = J, N, H; - if (ee > We) { - var Ie = La(ee / c * Ct(Q)), Me = La(ee / p * Ct(Q)); - (W -= Ie * 2) > We ? (Ie *= x ? 1 : -1, M += Ie, D -= Ie) : (W = 0, M = D = (m + $) / 2), (K -= Me * 2) > We ? (Me *= x ? 1 : -1, F += Me, S -= Me) : (K = 0, F = S = (m + $) / 2); + var F = m, S = $, M = m, D = $, W = _, K = _, Q = a.apply(this, arguments) / 2, tt = Q > Wt && (r ? +r.apply(this, arguments) : er(c * c + p * p)), J = rs(Oa(p - c) / 2, +n.apply(this, arguments)), at = J, ot = J, N, H; + if (tt > Wt) { + var It = La(tt / c * Ce(Q)), Mt = La(tt / p * Ce(Q)); + (W -= It * 2) > Wt ? (It *= x ? 1 : -1, M += It, D -= It) : (W = 0, M = D = (m + $) / 2), (K -= Mt * 2) > Wt ? (Mt *= x ? 1 : -1, F += Mt, S -= Mt) : (K = 0, F = S = (m + $) / 2); } - var xe = p * Rn(F), ce = p * Ct(F), le = c * Rn(D), z = c * Ct(D); - if (J > We) { - var Fe = p * Rn(S), _t = p * Ct(S), ne = c * Rn(M), bn = c * Ct(M), Oe; + var xt = p * Rn(F), ft = p * Ce(F), lt = c * Rn(D), z = c * Ce(D); + if (J > Wt) { + var Ft = p * Rn(S), _e = p * Ce(S), rt = c * Rn(M), bn = c * Ce(M), Ot; if (_ < Hr) - if (Oe = Bd(xe, ce, ne, bn, Fe, _t, le, z)) { - var ot = xe - Oe[0], $n = ce - Oe[1], we = Fe - Oe[0], mt = _t - Oe[1], Ht = 1 / Ct(Od((ot * we + $n * mt) / (tr(ot * ot + $n * $n) * tr(we * we + mt * mt))) / 2), An = tr(Oe[0] * Oe[0] + Oe[1] * Oe[1]); - ae = rs(J, (c - An) / (Ht - 1)), oe = rs(J, (p - An) / (Ht + 1)); + if (Ot = Bd(xt, ft, rt, bn, Ft, _e, lt, z)) { + var oe = xt - Ot[0], $n = ft - Ot[1], wt = Ft - Ot[0], me = _e - Ot[1], He = 1 / Ce(Od((oe * wt + $n * me) / (er(oe * oe + $n * $n) * er(wt * wt + me * me))) / 2), An = er(Ot[0] * Ot[0] + Ot[1] * Ot[1]); + at = rs(J, (c - An) / (He - 1)), ot = rs(J, (p - An) / (He + 1)); } else - ae = oe = 0; + at = ot = 0; } - K > We ? oe > We ? (N = li(ne, bn, xe, ce, p, oe, x), H = li(Fe, _t, le, z, p, oe, x), o.moveTo(N.cx + N.x01, N.cy + N.y01), oe < J ? o.arc(N.cx, N.cy, oe, De(N.y01, N.x01), De(H.y01, H.x01), !x) : (o.arc(N.cx, N.cy, oe, De(N.y01, N.x01), De(N.y11, N.x11), !x), o.arc(0, 0, p, De(N.cy + N.y11, N.cx + N.x11), De(H.cy + H.y11, H.cx + H.x11), !x), o.arc(H.cx, H.cy, oe, De(H.y11, H.x11), De(H.y01, H.x01), !x))) : (o.moveTo(xe, ce), o.arc(0, 0, p, F, S, !x)) : o.moveTo(xe, ce), !(c > We) || !(W > We) ? o.lineTo(le, z) : ae > We ? (N = li(le, z, Fe, _t, c, -ae, x), H = li(xe, ce, ne, bn, c, -ae, x), o.lineTo(N.cx + N.x01, N.cy + N.y01), ae < J ? o.arc(N.cx, N.cy, ae, De(N.y01, N.x01), De(H.y01, H.x01), !x) : (o.arc(N.cx, N.cy, ae, De(N.y01, N.x01), De(N.y11, N.x11), !x), o.arc(0, 0, c, De(N.cy + N.y11, N.cx + N.x11), De(H.cy + H.y11, H.cx + H.x11), x), o.arc(H.cx, H.cy, ae, De(H.y11, H.x11), De(H.y01, H.x01), !x))) : o.arc(0, 0, c, D, M, x); + K > Wt ? ot > Wt ? (N = li(rt, bn, xt, ft, p, ot, x), H = li(Ft, _e, lt, z, p, ot, x), o.moveTo(N.cx + N.x01, N.cy + N.y01), ot < J ? o.arc(N.cx, N.cy, ot, Dt(N.y01, N.x01), Dt(H.y01, H.x01), !x) : (o.arc(N.cx, N.cy, ot, Dt(N.y01, N.x01), Dt(N.y11, N.x11), !x), o.arc(0, 0, p, Dt(N.cy + N.y11, N.cx + N.x11), Dt(H.cy + H.y11, H.cx + H.x11), !x), o.arc(H.cx, H.cy, ot, Dt(H.y11, H.x11), Dt(H.y01, H.x01), !x))) : (o.moveTo(xt, ft), o.arc(0, 0, p, F, S, !x)) : o.moveTo(xt, ft), !(c > Wt) || !(W > Wt) ? o.lineTo(lt, z) : at > Wt ? (N = li(lt, z, Ft, _e, c, -at, x), H = li(xt, ft, rt, bn, c, -at, x), o.lineTo(N.cx + N.x01, N.cy + N.y01), at < J ? o.arc(N.cx, N.cy, at, Dt(N.y01, N.x01), Dt(H.y01, H.x01), !x) : (o.arc(N.cx, N.cy, at, Dt(N.y01, N.x01), Dt(N.y11, N.x11), !x), o.arc(0, 0, c, Dt(N.cy + N.y11, N.cx + N.x11), Dt(H.cy + H.y11, H.cx + H.x11), x), o.arc(H.cx, H.cy, at, Dt(H.y11, H.x11), Dt(H.y01, H.x01), !x))) : o.arc(0, 0, c, D, M, x); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+e.apply(this, arguments) + +t.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Hr / 2; - return [Rn(h) * f, Ct(h) * f]; + var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Hr / 2; + return [Rn(h) * f, Ce(h) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Ve(+f), u) : e; + return arguments.length ? (t = typeof f == "function" ? f : Vt(+f), u) : t; }, u.outerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Ve(+f), u) : t; + return arguments.length ? (e = typeof f == "function" ? f : Vt(+f), u) : e; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Ve(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Vt(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Ve(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Vt(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Ve(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Vt(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Ve(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Vt(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Ve(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Vt(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function Xd(e) { - return typeof e == "object" && "length" in e ? e : Array.from(e); +function Xd(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); } -function Wd(e, t) { - return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; +function Wd(t, e) { + return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function Ud(e) { - return e; +function Ud(t) { + return t; } function is() { - var e = Ud, t = Wd, n = null, r = Ve(0), i = Ve(wi), s = Ve(0); + var t = Ud, e = Wd, n = null, r = Vt(0), i = Vt(wi), s = Vt(0); function a(o) { var l, u = (o = Xd(o)).length, f, h, c = 0, p = new Array(u), m = new Array(u), $ = +r.apply(this, arguments), _ = Math.min(wi, Math.max(-wi, i.apply(this, arguments) - $)), x, F = Math.min(Math.abs(_) / u, s.apply(this, arguments)), S = F * (_ < 0 ? -1 : 1), M; for (l = 0; l < u; ++l) - (M = m[p[l] = l] = +e(o[l], l, o)) > 0 && (c += M); - for (t != null ? p.sort(function(D, W) { - return t(m[D], m[W]); + (M = m[p[l] = l] = +t(o[l], l, o)) > 0 && (c += M); + for (e != null ? p.sort(function(D, W) { + return e(m[D], m[W]); }) : n != null && p.sort(function(D, W) { return n(o[D], o[W]); }), l = 0, h = c ? (_ - u * S) / c : 0; l < u; ++l, $ = x) @@ -4786,53 +4786,53 @@ function is() { return m; } return a.value = function(o) { - return arguments.length ? (e = typeof o == "function" ? o : Ve(+o), a) : e; + return arguments.length ? (t = typeof o == "function" ? o : Vt(+o), a) : t; }, a.sortValues = function(o) { - return arguments.length ? (t = o, n = null, a) : t; + return arguments.length ? (e = o, n = null, a) : e; }, a.sort = function(o) { - return arguments.length ? (n = o, t = null, a) : n; + return arguments.length ? (n = o, e = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Ve(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Vt(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Ve(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Vt(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Ve(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Vt(+o), a) : s; }, a; } -function Mr(e, t, n) { - this.k = e, this.x = t, this.y = n; +function Mr(t, e, n) { + this.k = t, this.x = e, this.y = n; } Mr.prototype = { constructor: Mr, - scale: function(e) { - return e === 1 ? this : new Mr(this.k * e, this.x, this.y); + scale: function(t) { + return t === 1 ? this : new Mr(this.k * t, 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); + translate: function(t, e) { + return t === 0 & e === 0 ? this : new Mr(this.k, this.x + this.k * t, this.y + this.k * e); }, - apply: function(e) { - return [e[0] * this.k + this.x, e[1] * this.k + this.y]; + apply: function(t) { + return [t[0] * this.k + this.x, t[1] * this.k + this.y]; }, - applyX: function(e) { - return e * this.k + this.x; + applyX: function(t) { + return t * this.k + this.x; }, - applyY: function(e) { - return e * this.k + this.y; + applyY: function(t) { + return t * this.k + this.y; }, - invert: function(e) { - return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k]; + invert: function(t) { + return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k]; }, - invertX: function(e) { - return (e - this.x) / this.k; + invertX: function(t) { + return (t - this.x) / this.k; }, - invertY: function(e) { - return (e - this.y) / this.k; + invertY: function(t) { + return (t - this.y) / this.k; }, - rescaleX: function(e) { - return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e)); + rescaleX: function(t) { + return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t)); }, - rescaleY: function(e) { - return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e)); + rescaleY: function(t) { + return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t)); }, toString: function() { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; @@ -4847,49 +4847,49 @@ const Kd = { @media (max-width: 768px) {.pie-chart-svg.svelte-80ulj4 {max-height:60vh;} }` }; -function ml(e, t) { - qi(t, !0), Vs(e, Kd); - let n = fe(t, "jsonData", 7), r = fe(t, "currentRound", 7, 1), i = fe(t, "mouseEventType", 15), s = fe(t, "mouseData", 15), a = fe(t, "mouseX", 15), o = fe(t, "mouseY", 15), l = fe(t, "requestRoundChange", 7, (d) => { - }), u = fe(t, "candidateColors", 23, () => []), f = fe(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = fe(t, "firstRoundDeterminesPercentages", 7, !1), c = fe(t, "displayPhase", 15, 0); +function ml(t, e) { + qi(e, !0), Vs(t, Kd); + let n = ut(e, "jsonData", 7), r = ut(e, "currentRound", 7, 1), i = ut(e, "mouseEventType", 15), s = ut(e, "mouseData", 15), a = ut(e, "mouseX", 15), o = ut(e, "mouseY", 15), l = ut(e, "requestRoundChange", 7, (d) => { + }), u = ut(e, "candidateColors", 23, () => []), f = ut(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = ut(e, "firstRoundDeterminesPercentages", 7, !1), c = ut(e, "displayPhase", 15, 0); function p(d) { return d.isTransfer ? `${d.label}__transfer` : d.transferIndex != null ? `${d.label}__${d.transferIndex}` : d.label; } - const m = 800, $ = 800, _ = Math.min(m, $) * 0.3, x = m / 2, F = $ / 2, S = "Pie", M = "PieOutline", D = "Donut", W = "TextLayer", K = "url(#cross-hatch)", Q = 1.15, ee = 750, J = 800, ae = "white", oe = 1, N = "#ff00ff", H = 3; - function Ie(d) { + const m = 800, $ = 800, _ = Math.min(m, $) * 0.3, x = m / 2, F = $ / 2, S = "Pie", M = "PieOutline", D = "Donut", W = "TextLayer", K = "url(#cross-hatch)", Q = 1.15, tt = 750, J = 800, at = "white", ot = 1, N = "#ff00ff", H = 3; + function It(d) { return "hatch-" + d.replace(/[^a-zA-Z0-9]/g, "-"); } - let Me = [], xe = [], ce = [], le = 0, z = 0; - const Fe = {}, _t = "No Further Rankings"; - let ne = /* @__PURE__ */ Ee(null); + let Mt = [], xt = [], ft = [], lt = 0, z = 0; + const Ft = {}, _e = "No Further Rankings"; + let rt = /* @__PURE__ */ Et(null); function bn() { - const d = ue(b(ne)); + const d = ct(b(rt)); d.select("#" + S).remove(), d.select("#" + M).remove(), d.select("#" + D).remove(), d.select("#" + W).remove(); } - function Oe(d) { - l() && (me = d, l()(d)); + function Ot(d) { + l() && (mt = d, l()(d)); } - function ot(d) { - bn(), ce = $n(d), Me = Zs(d, S, ce, x, F, 0, we()), Zs(d, M, ce, x, F, 0, we(), !1, !1, !0), Er(); + function oe(d) { + bn(), ft = $n(d), Mt = Zs(d, S, ft, x, F, 0, wt()), Zs(d, M, ft, x, F, 0, wt(), !1, !1, !0), Er(); } ju(() => { - ie(), setTimeout( + it(), setTimeout( () => { - ot(r()); + oe(r()); }, 0 ); }); function $n(d) { - const g = te(d); - return le = Kn(d), g; + const g = et(d); + return lt = Kn(d), g; } - function we() { + function wt() { return _; } - function mt() { - return we() * 1.41; + function me() { + return wt() * 1.41; } - function Ht(d) { + function He(d) { let g = 0; for (let y = 1; y < d; y++) { const E = n().results[y - 1].tallyResults; @@ -4904,7 +4904,7 @@ function ml(e, t) { return g; } function An(d, g) { - if (d === "exhausted") return Ht(g); + if (d === "exhausted") return He(g); { const y = n().results[g - 1].tally; return Number(y[d]); @@ -4914,7 +4914,7 @@ function ml(e, t) { return An(d, g).toLocaleString("en-US"); } function Jr(d, g) { - const y = h() ? le : Gi(g); + const y = h() ? lt : Gi(g); return (An(d, g) / y).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } function Kn(d) { @@ -4967,21 +4967,21 @@ function ml(e, t) { return E; } function Y(d, g) { - d.some((y) => un(y.label)) || d.push({ label: "exhausted", value: Ht(g) }); + d.some((y) => un(y.label)) || d.push({ label: "exhausted", value: He(g) }); } - function te(d) { + function et(d) { const g = []; for (let [y, E] of Object.entries(n().results[d - 1].tally)) g.push({ label: y, value: Number(E) }); return Y(g, d), g; } - function ve(d) { + function vt(d) { const g = n().results[Math.max(0, d - 2)].tally, y = n().results[d - 1].tally, E = []; for (let [A] of Object.entries(g)) E.push({ label: A, value: Number(y[A] ?? 0) }); return Y(E, d), E; } - function be(d, g) { + function bt(d, g) { const y = []; for (const E of d) { if (E.label === "exhausted" || E.isTransfer) { @@ -4997,49 +4997,49 @@ function ml(e, t) { } return y; } - function ie() { - const d = ue(b(ne)).select("defs").select("#cross-hatch"); + function it() { + const d = ct(b(rt)).select("defs").select("#cross-hatch"); let g = 0; for (let [y, E] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? g < 10 ? Fe[y] = Id[g] : Fe[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Fe[y] = u()[g % u().length], g++; + !u() || u().length === 0 ? g < 10 ? Ft[y] = Id[g] : Ft[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ft[y] = u()[g % u().length], g++; { const A = d.clone(!0); - A.attr("id", Ie(y)).select("rect").attr("fill", Fe[y]), A.selectAll("circle").attr("fill", "#383838"); + A.attr("id", It(y)).select("rect").attr("fill", Ft[y]), A.selectAll("circle").attr("fill", "#383838"); } } - Fe.exhausted = K, Fe["Inactive Ballots"] = K; + Ft.exhausted = K, Ft["Inactive Ballots"] = K; } - function ze() { - ue(b(ne)).select("#" + D).remove(); + function zt() { + ct(b(rt)).select("#" + D).remove(); } - function lt(d, g) { + function le(d, g) { const y = yi("global").duration(J); g && y.on("end", g); - const E = be(ce, d), R = is().sort(null).value((I) => I.value)(E); - na(d, S, R, 0, we()), na(d, M, R, 0, we(), !0), ce = E, Me = R, ze(), Xt(d), El(), Rl(0, we()), Er(); + const E = bt(ft, d), R = is().sort(null).value((I) => I.value)(E); + na(d, S, R, 0, wt()), na(d, M, R, 0, wt(), !0), ft = E, Mt = R, zt(), Xe(d), El(), Rl(0, wt()), Er(); } - function Be(d, g) { + function Bt(d, g) { const y = yi("global").duration(J); - g && y.on("end", g), Wt(d); + g && y.on("end", g), We(d); } - function ut(d, g) { + function ue(d, g) { const y = yi("global").duration(J); - g && y.on("end", g), $r(d), Ar(we(), mt()); + g && y.on("end", g), $r(d), Ar(wt(), me()); } - let ge = !1, _e = []; - function $e() { - Er(), ge = !1, Le(); + let gt = !1, _t = []; + function $t() { + Er(), gt = !1, Lt(); } - function Le() { - if (_e.length === 0) { - me !== r() && (r() === me + 1 && me > 0 && r() <= n().results.length ? (me = r(), Yt(r())) : r() >= 1 && r() <= n().results.length && (me = r(), c(0), ot(r()))); + function Lt() { + if (_t.length === 0) { + mt !== r() && (r() === mt + 1 && mt > 0 && r() <= n().results.length ? (mt = r(), Ye(r())) : r() >= 1 && r() <= n().results.length && (mt = r(), c(0), oe(r()))); return; } - const d = _e.shift(); + const d = _t.shift(); switch (d.type) { case "round": { const g = d.round; - g === me + 1 && me > 0 && g <= n().results.length ? (me = g, Yt(g)) : (g !== me && g >= 1 && g <= n().results.length && (me = g, c(0), ot(g)), Le()); + g === mt + 1 && mt > 0 && g <= n().results.length ? (mt = g, Ye(g)) : (g !== mt && g >= 1 && g <= n().results.length && (mt = g, c(0), oe(g)), Lt()); break; } case "step": @@ -5047,62 +5047,62 @@ function ml(e, t) { break; } } - function Yt(d) { + function Ye(d) { if (d <= 1 || d > n().results.length) { - Le(); + Lt(); return; } - ge = !0, z = d, c(0), lt(z - 1, () => { - c(1), Be(z - 1, () => { - c(2), ut(z, () => { - c(0), $e(); + gt = !0, z = d, c(0), le(z - 1, () => { + c(1), Bt(z - 1, () => { + c(2), ue(z, () => { + c(0), $t(); }); }); }); } function jn() { - ge || (ge = !0, z = r(), En()); + gt || (gt = !0, z = r(), En()); } function En() { if (c( 0 // if in the middle of "one small step" animation, reset to 0. - ), _e.length > 0) { - $e(); + ), _t.length > 0) { + $t(); return; } const d = z < n().results.length - 1 ? En : () => { - c(0), $e(); + c(0), $t(); }; - lt(z, () => { - c(1), Be(z, () => { - c(2), z++, Oe(z), ut(z, d); + le(z, () => { + c(1), Bt(z, () => { + c(2), z++, Ot(z), ue(z, d); }); }); } Is(() => { - zt(); + ze(); }); - let me = 0; - function zt() { - if (me != r()) { - if (ge) { - _e.push({ type: "round", round: r() }); + let mt = 0; + function ze() { + if (mt != r()) { + if (gt) { + _t.push({ type: "round", round: r() }); return; } - me == r() - 1 && me > 0 ? Jn() : Bt(r()), me = r(); + mt == r() - 1 && mt > 0 ? Jn() : Be(r()), mt = r(); } } - function Bt(d) { - if (ge) { - _e.push({ type: "round", round: d }); + function Be(d) { + if (gt) { + _t.push({ type: "round", round: d }); return; } - c(0), ot(d); + c(0), oe(d); } function Jn() { - if (ge) { - _e.push({ type: "round", round: r() }); + if (gt) { + _t.push({ type: "round", round: r() }); return; } if (r() <= 1) { @@ -5110,54 +5110,54 @@ function ml(e, t) { return; } if (z = r(), z > n().results.length) { - Er(), ge = !1; + Er(), gt = !1; return; } - ge = !0, c() === 0 ? lt(z - 1, () => { - c(1), Be(z - 1, () => { - c(2), ut(z, () => { - c(0), $e(); + gt = !0, c() === 0 ? le(z - 1, () => { + c(1), Bt(z - 1, () => { + c(2), ue(z, () => { + c(0), $t(); }); }); - }) : c() === 1 ? Be(z - 1, () => { - c(2), ut(z, () => { - c(0), $e(); + }) : c() === 1 ? Bt(z - 1, () => { + c(2), ue(z, () => { + c(0), $t(); }); - }) : c() === 2 && ut(z, () => { - c(0), $e(); + }) : c() === 2 && ue(z, () => { + c(0), $t(); }); } function Zn() { if (r() > n().results.length) { - Er(), ge = !1; + Er(), gt = !1; return; } - if (ge) { - _e.push({ type: "step" }); + if (gt) { + _t.push({ type: "step" }); return; } - ge = !0, z = r(), c() === 0 ? lt(z, () => { - c(1), $e(); - }) : c() === 1 ? Be(z, () => { - c(2), $e(); - }) : c() === 2 ? (z++, Oe(z), ut(z, () => { - c(0), $e(); - })) : (ge = !1, console.warn("displayPhase out of range at ", c())); + gt = !0, z = r(), c() === 0 ? le(z, () => { + c(1), $t(); + }) : c() === 1 ? Bt(z, () => { + c(2), $t(); + }) : c() === 2 ? (z++, Ot(z), ue(z, () => { + c(0), $t(); + })) : (gt = !1, console.warn("displayPhase out of range at ", c())); } function $r(d) { - ce = ve(d), Me = ea(d, S, ce, 0, we(), !0), ea(d, M, ce, 0, we(), !1, !0), ue(b(ne)).select("#" + M).selectAll(".eliminated").remove(); + ft = vt(d), Mt = ta(d, S, ft, 0, wt(), !0), ta(d, M, ft, 0, wt(), !1, !0); } function Ar(d, g) { - const y = ue(b(ne)).select("#" + D), A = ue(b(ne)).select("#" + S), R = {}; - for (const P of Me) { - const k = P.data.label; - if (P.data.isTransfer) continue; - const T = A.select("#" + CSS.escape(p(P.data))); - T.empty() || (R[k] = { + const y = ct(b(rt)).select("#" + D), A = ct(b(rt)).select("#" + S), R = {}; + for (const k of Mt) { + const P = k.data.label; + if (k.data.isTransfer) continue; + const T = A.select("#" + CSS.escape(p(k.data))); + T.empty() || (R[P] = { oldStart: Number(T.attr("prevStart")), oldEnd: Number(T.attr("prevEnd")), - newStart: P.startAngle, - newEnd: P.endAngle + newStart: k.startAngle, + newEnd: k.endAngle }); } const I = y.selectAll(".slice"); @@ -5165,32 +5165,32 @@ function ml(e, t) { function O() { q--, q === 0 && Tl(); } - I.select("path").transition("global").duration(ee).attrTween("d", function(P) { - const k = P.startAngle, T = P.endAngle, C = T - k, Pe = R[P.data.label]; - let Z, Xe; - if (Pe) { - const Qn = (Pe.oldStart + Pe.oldEnd) / 2, kl = (Pe.newStart + Pe.newEnd) / 2, Ml = k - Qn; - Z = kl + Ml, Xe = Z + C; + I.select("path").transition("global").duration(tt).attrTween("d", function(k) { + const P = k.startAngle, T = k.endAngle, C = T - P, Pt = R[k.data.label]; + let Z, Xt; + if (Pt) { + const Qn = (Pt.oldStart + Pt.oldEnd) / 2, kl = (Pt.newStart + Pt.newEnd) / 2, Ml = P - Qn; + Z = kl + Ml, Xt = Z + C; } else - Z = k, Xe = T; - const re = Gt(k, Z), Re = Gt(T, Xe), ei = Gt(g, d), Tr = yt(); + Z = P, Xt = T; + const nt = Ge(P, Z), Rt = Ge(T, Xt), ti = Ge(g, d), Tr = ye(); return function(Qn) { - return Tr.innerRadius(Math.min(ei(Qn), d) - 1).outerRadius(ei(Qn)).startAngle(re(Qn)).endAngle(Re(Qn)), Tr(P); + return Tr.innerRadius(Math.min(ti(Qn), d) - 1).outerRadius(ti(Qn)).startAngle(nt(Qn)).endAngle(Rt(Qn)), Tr(k); }; - }).on("end", (P) => O()); + }).on("end", (k) => O()); } - function Xt(d) { - const g = xl(d, Me); - xe = Qs(d, D, g, x, F, we(), mt(), !1, !0); - const y = ue(b(ne)); + function Xe(d) { + const g = xl(d, Mt); + xt = Qs(d, D, g, x, F, wt(), me(), !1, !0); + const y = ct(b(rt)); y.select("#" + S).raise(), y.select("#" + M).raise(); } - function Wt(d) { - const g = $l(d, xe, Me); - xe = ra(d, D, g, we(), mt(), !1); + function We(d) { + const g = $l(d, xt, Mt); + xt = ra(d, D, g, wt(), me(), !1); } function Tn(d) { - return Fe[d.data.label]; + return Ft[d.data.label]; } function wl(d) { const g = {}, y = n().results[d - 1].tallyResults; @@ -5211,7 +5211,7 @@ function ml(e, t) { return g; } function xl(d, g) { - const y = [], E = le, A = n().results[d - 1].tallyResults; + const y = [], E = lt, A = n().results[d - 1].tallyResults; for (let R = 0; R < A.length; R++) { let I = A[R].eliminated; if (I === void 0 && (I = A[R].elected), I === void 0) { @@ -5223,37 +5223,37 @@ function ml(e, t) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let O = g.find((k) => k.data.label == I && k.data.isTransfer); - O === void 0 && (O = g.find((k) => k.data.label == I && !k.data.isTransfer)); - let P = 0; - if (O) P = O.startAngle; + let O = g.find((P) => P.data.label == I && P.data.isTransfer); + O === void 0 && (O = g.find((P) => P.data.label == I && !P.data.isTransfer)); + let k = 0; + if (O) k = O.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [k, T] of Object.entries(q)) { + for (let [P, T] of Object.entries(q)) { let C; - const Pe = g.find((re) => re.data.label == k); - if (Pe) - C = structuredClone(Pe); - else if (k == "exhausted") + const Pt = g.find((nt) => nt.data.label == P); + if (Pt) + C = structuredClone(Pt); + else if (P == "exhausted") C = { - data: { label: k, value: Number(T) }, + data: { label: P, value: Number(T) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (k == "residual surplus") { + else if (P == "residual surplus") { console.warn("makeDonutInfo: residual surplus = ", T); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", k); + console.warn("makeDonutInfo: unrecognized name in transfers ", P); continue; } - const Xe = Number(T) / E * 2 * Math.PI; - C.startAngle = P, P = C.endAngle = P + Xe, C.index = R, C.data.transferIndex = R, y.push(C); + const Xt = Number(T) / E * 2 * Math.PI; + C.startAngle = k, k = C.endAngle = k + Xt, C.index = R, C.data.transferIndex = R, y.push(C); } } return y; @@ -5261,7 +5261,7 @@ function ml(e, t) { function bl(d, g, y) { const E = {}; for (let [A, R] of Object.entries(d)) { - const I = y.find((P) => A == P.data.label); + const I = y.find((k) => A == k.data.label); if (I === void 0) { console.warn("getTransferStartAngles: mainPieObj not found for ", A); continue; @@ -5272,105 +5272,105 @@ function ml(e, t) { return E; } function $l(d, g, y) { - const E = [], A = le, R = wl(d), I = bl(R, A, y); + const E = [], A = lt, R = wl(d), I = bl(R, A, y); for (let [q, O] of g.entries()) { - const P = structuredClone(O), k = O.endAngle - O.startAngle, T = y.find((C) => O.data.label === C.data.label && !C.data.isTransfer); + const k = structuredClone(O), P = O.endAngle - O.startAngle, T = y.find((C) => O.data.label === C.data.label && !C.data.isTransfer); if (T) { const C = T.data.label; - P.startAngle = I[C], I[C] += k, P.endAngle = P.startAngle + k; + k.startAngle = I[C], I[C] += P, k.endAngle = k.startAngle + P; } else if (O.data.label === "exhausted") - P.startAngle = O.startAngle, P.endAngle = O.endAngle; + k.startAngle = O.startAngle, k.endAngle = O.endAngle; else { console.warn("updateDonutInfo: unrecognized slice name ", O.data.label); continue; } - P.index = q, E.push(P); + k.index = q, E.push(k); } return E; } function js(d, g, y, E) { - const A = yt().innerRadius(y * Q).outerRadius(y * Q), R = g.filter((k) => !k.data.isTransfer && k.data.value > 0), I = [], q = E.append("g").attr("opacity", 0); - for (const k of R) { - const T = k.data.label === "exhausted" ? _t : k.data.label, C = A.centroid(k), Pe = Qr(k.startAngle, k.endAngle), Z = jr(k.data.label, d); - let Xe; - !h() && un(k.data.label) ? Xe = Z : Xe = Z + " (" + Jr(k.data.label, d) + ")"; - const re = q.append("text").attr("transform", `translate(${C})`).attr("text-anchor", Pe).text(T); - re.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Xe); - const Re = re.node().getBBox(); + const A = ye().innerRadius(y * Q).outerRadius(y * Q), R = g.filter((P) => !P.data.isTransfer && P.data.value > 0), I = [], q = E.append("g").attr("opacity", 0); + for (const P of R) { + const T = P.data.label === "exhausted" ? _e : P.data.label, C = A.centroid(P), Pt = Qr(P.startAngle, P.endAngle), Z = jr(P.data.label, d); + let Xt; + !h() && un(P.data.label) ? Xt = Z : Xt = Z + " (" + Jr(P.data.label, d) + ")"; + const nt = q.append("text").attr("transform", `translate(${C})`).attr("text-anchor", Pt).text(T); + nt.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Xt); + const Rt = nt.node().getBBox(); I.push({ - label: k.data.label, - value: k.data.value, - bbox: new DOMRect(Re.x + C[0], Re.y + C[1], Re.width, Re.height) + label: P.data.label, + value: P.data.value, + bbox: new DOMRect(Rt.x + C[0], Rt.y + C[1], Rt.width, Rt.height) }); } - q.remove(), I.sort((k, T) => T.value - k.value); - const O = [], P = /* @__PURE__ */ new Set(); - for (const k of I) - O.some((C) => k.bbox.left < C.right && k.bbox.right > C.left && k.bbox.top < C.bottom && k.bbox.bottom > C.top) || (P.add(k.label), O.push(k.bbox)); - return P; + q.remove(), I.sort((P, T) => T.value - P.value); + const O = [], k = /* @__PURE__ */ new Set(); + for (const P of I) + O.some((C) => P.bbox.left < C.right && P.bbox.right > C.left && P.bbox.top < C.bottom && P.bbox.bottom > C.top) || (k.add(P.label), O.push(P.bbox)); + return k; } function Js(d, g, y, E, A, R) { - const q = ue(b(ne)).append("g").attr("id", W).attr("transform", `translate(${y}, ${E})`), O = yt().innerRadius(A * Q).outerRadius(A * Q), P = js(d, g, A, q); - q.selectAll("text").data(g).enter().each(function(k) { - !k.data.isTransfer && P.has(k.data.label) && ue(this).append("g").attr("id", (T) => p(T.data)).classed("eliminated", (T) => R.includes(T.data.label) || T.data.isTransfer === !0).each(function(T, C) { - T.data.label === "exhausted" && ue(this).on("mouseenter", (Pe, Z) => Cl(Pe)).on("mouseleave", (Pe, Z) => Sl()); - }).append("text").attr("transform", (T) => `translate(${O.centroid(T)})`).attr("text-anchor", (T) => Qr(T.startAngle, T.endAngle)).text((T) => T.data.label === "exhausted" ? _t : T.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((T) => { + const q = ct(b(rt)).append("g").attr("id", W).attr("transform", `translate(${y}, ${E})`), O = ye().innerRadius(A * Q).outerRadius(A * Q), k = js(d, g, A, q); + q.selectAll("text").data(g).enter().each(function(P) { + !P.data.isTransfer && k.has(P.data.label) && ct(this).append("g").attr("id", (T) => p(T.data)).classed("eliminated", (T) => R.includes(T.data.label) || T.data.isTransfer === !0).each(function(T, C) { + T.data.label === "exhausted" && ct(this).on("mouseenter", (Pt, Z) => Cl(Pt)).on("mouseleave", (Pt, Z) => Sl()); + }).append("text").attr("transform", (T) => `translate(${O.centroid(T)})`).attr("text-anchor", (T) => Qr(T.startAngle, T.endAngle)).text((T) => T.data.label === "exhausted" ? _e : T.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((T) => { const C = jr(T.data.label, d); return !h() && un(T.data.label) ? C : C + " (" + Jr(T.data.label, d) + ")"; }); }); } function Al(d, g, y, E) { - const R = ue(b(ne)).select("#" + W), I = js(d, g, y, R); + const R = ct(b(rt)).select("#" + W), I = js(d, g, y, R); R.selectAll("g").each(function(C) { - C && C.data && !C.data.isTransfer && !I.has(C.data.label) && ue(this).remove(); + C && C.data && !C.data.isTransfer && !I.has(C.data.label) && ct(this).remove(); }); - const q = R.selectAll("tspan"), O = R.selectAll("g").data(g, (C) => p(C.data)).classed("eliminated", (C) => E.includes(C.data.label) || C.data.isTransfer === !0), P = yt().innerRadius(y * Q).outerRadius(y * Q + 1); - q.transition("global").duration(ee).attr("transform", (C) => `translate(${P.centroid(C)})`).attr("text-anchor", (C) => Qr(C.startAngle, C.endAngle)), O.select("text").transition("global").duration(ee).attr("transform", (C) => `translate(${P.centroid(C)})`).attr("text-anchor", (C) => Qr(C.startAngle, C.endAngle)).on("end", (C) => T()); - let k = O.size(); + const q = R.selectAll("tspan"), O = R.selectAll("g").data(g, (C) => p(C.data)).classed("eliminated", (C) => E.includes(C.data.label) || C.data.isTransfer === !0), k = ye().innerRadius(y * Q).outerRadius(y * Q + 1); + q.transition("global").duration(tt).attr("transform", (C) => `translate(${k.centroid(C)})`).attr("text-anchor", (C) => Qr(C.startAngle, C.endAngle)), O.select("text").transition("global").duration(tt).attr("transform", (C) => `translate(${k.centroid(C)})`).attr("text-anchor", (C) => Qr(C.startAngle, C.endAngle)).on("end", (C) => T()); + let P = O.size(); function T(C) { - k--, k === 0 && (R.remove(), Js(d, g, x, F, y, E)); + P--, P === 0 && (R.remove(), Js(d, g, x, F, y, E)); } } - function Zs(d, g, y, E, A, R, I, q = !0, O = !1, P = !1) { + function Zs(d, g, y, E, A, R, I, q = !0, O = !1, k = !1) { const T = is().sort(null).value((C) => C.value)(y); - return Qs(d, g, T, E, A, R, I, q, O, P), T; + return Qs(d, g, T, E, A, R, I, q, O, k), T; } function Er() { - ue(b(ne)).select("#" + M).selectAll(".elected").select("path").style("stroke", N).style("stroke-width", `${H}px`); + ct(b(rt)).select("#" + M).selectAll(".elected").select("path").style("stroke", N).style("stroke-width", `${H}px`); } - function Qs(d, g, y, E, A, R, I, q, O, P = !1) { - const k = fn(d), T = br(d), Z = ue(b(ne)).attr("viewBox", `0 0 ${m} ${$}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${E}, ${A})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (re) => k.includes(re.data.label) || re.data.isTransfer === !0).classed("elected", (re) => T.includes(re.data.label) && !re.data.isTransfer).attr("id", (re) => p(re.data)); - P ? Z.style("pointer-events", "none") : Z.on("mouseenter", (re, Re) => ji(re, Re)).on("mouseleave", (re, Re) => Ji(re, Re)); - const Xe = yt().outerRadius(I).innerRadius(R); + function Qs(d, g, y, E, A, R, I, q, O, k = !1) { + const P = fn(d), T = br(d), Z = ct(b(rt)).attr("viewBox", `0 0 ${m} ${$}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${E}, ${A})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (nt) => P.includes(nt.data.label) || nt.data.isTransfer === !0).classed("elected", (nt) => T.includes(nt.data.label) && !nt.data.isTransfer).attr("id", (nt) => p(nt.data)); + k ? Z.style("pointer-events", "none") : Z.on("mouseenter", (nt, Rt) => ji(nt, Rt)).on("mouseleave", (nt, Rt) => Ji(nt, Rt)); + const Xt = ye().outerRadius(I).innerRadius(R); if (O) { - const re = yt().outerRadius(R + 1).innerRadius(R); - Z.append("path").attr("d", re).attr("stroke", P ? "none" : R === 0 ? ae : "none").attr("stroke-width", P ? 0 : R === 0 ? oe : 0).attr("fill", P ? "none" : (Re) => Tn(Re)).transition("global").duration(ee).attr("d", (Re) => Xe(Re)).on("end", (Re) => { - P || Ki(); + const nt = ye().outerRadius(R + 1).innerRadius(R); + Z.append("path").attr("d", nt).attr("stroke", k ? "none" : R === 0 ? at : "none").attr("stroke-width", k ? 0 : R === 0 ? ot : 0).attr("fill", k ? "none" : (Rt) => Tn(Rt)).transition("global").duration(tt).attr("d", (Rt) => Xt(Rt)).on("end", (Rt) => { + k || Ki(); }); } else - Z.append("path").attr("d", (re) => Xe(re)).attr("fill", P ? "none" : (re) => Tn(re)).attr("stroke", P ? "none" : ae).attr("stroke-width", P ? 0 : oe), P || Ki(); - return q && !P && Js(d, y, E, A, I, k), y; + Z.append("path").attr("d", (nt) => Xt(nt)).attr("fill", k ? "none" : (nt) => Tn(nt)).attr("stroke", k ? "none" : at).attr("stroke-width", k ? 0 : ot), k || Ki(); + return q && !k && Js(d, y, E, A, I, P), y; } function El() { - const y = ue(b(ne)).select("#" + W).selectAll(".eliminated"); + const y = ct(b(rt)).select("#" + W).selectAll(".eliminated"); y.size() > 0 && y.classed("finished", !0); } function Tl() { - const y = ue(b(ne)).select("#" + W).selectAll(".finished"); + const y = ct(b(rt)).select("#" + W).selectAll(".finished"); y.size() > 0 && y.remove(); } function Rl(d, g) { - const A = ue(b(ne)).select("#" + S).selectAll(".eliminated"), R = yt().innerRadius(d), I = yt().outerRadius(g); - A.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(ee).attrTween("d", function(q) { - const O = Gt(g, d); - return function(P) { - return I.innerRadius(O(P)), I(q); + const A = ct(b(rt)).select("#" + S).selectAll(".eliminated"), R = ye().innerRadius(d), I = ye().outerRadius(g); + A.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(tt).attrTween("d", function(q) { + const O = Ge(g, d); + return function(k) { + return I.innerRadius(O(k)), I(q); }; - }).attr("fill", (q) => `url(#${Ie(q.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(ee).attrTween("d", function(q) { - const O = Gt(g, d); - return function(P) { - return R.outerRadius(O(P)), R(q); + }).attr("fill", (q) => `url(#${It(q.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(tt).attrTween("d", function(q) { + const O = Ge(g, d); + return function(k) { + return R.outerRadius(O(k)), R(q); }; }).attr("fill", (q) => Tn(q)); } @@ -5379,36 +5379,38 @@ function ml(e, t) { return y > Math.PI * 11 / 6 || y < Math.PI * 1 / 6 || y > Math.PI * 5 / 6 && y < Math.PI * 7 / 6 ? "middle" : y < Math.PI ? "start" : "end"; } function Ki() { - ue(b( - ne + ct(b( + rt // force redisplay of text labels )).select("#" + W).raise().append("g").remove(); } - function ea(d, g, y, E, A, R, I = !1) { - const O = is().sort(null).value((P) => P.value)(y); + function ta(d, g, y, E, A, R, I = !1) { + const O = is().sort(null).value((k) => k.value)(y); return ra(d, g, O, E, A, R, I), O; } - function ta(d, g, y, E, A = !1) { - const R = fn(d), I = br(d), P = ue(b(ne)).select("#" + g).selectAll(".slice").data(y, (T) => p(T.data)), k = P.enter().append("g").attr("class", "slice").attr("id", (T) => p(T.data)).classed("eliminated", !0); - return A ? k.style("pointer-events", "none") : k.on("mouseenter", (T, C) => ji(T, C)).on("mouseleave", (T, C) => Ji(T, C)), k.append("path").attr("d", (T) => E(T)).attr("fill", A ? "none" : (T) => Tn(T)).attr("stroke", A ? "none" : ae).attr("stroke-width", A ? 0 : oe), P.classed("eliminated", (T) => R.includes(T.data.label)).classed("elected", (T) => I.includes(T.data.label)), A || P.on("mouseenter", (T, C) => ji(T, C)).on("mouseleave", (T, C) => Ji(T, C)), P; + function ea(d, g, y, E, A = !1) { + const R = fn(d), I = br(d), k = ct(b(rt)).select("#" + g).selectAll(".slice").data(y, (T) => p(T.data)); + k.exit().remove(); + const P = k.enter().append("g").attr("class", "slice").attr("id", (T) => p(T.data)).classed("eliminated", !0); + return A ? P.style("pointer-events", "none") : P.on("mouseenter", (T, C) => ji(T, C)).on("mouseleave", (T, C) => Ji(T, C)), P.append("path").attr("d", (T) => E(T)).attr("fill", A ? "none" : (T) => Tn(T)).attr("stroke", A ? "none" : at).attr("stroke-width", A ? 0 : ot), k.classed("eliminated", (T) => R.includes(T.data.label)).classed("elected", (T) => I.includes(T.data.label)), A || k.on("mouseenter", (T, C) => ji(T, C)).on("mouseleave", (T, C) => Ji(T, C)), k; } function na(d, g, y, E, A, R = !1) { - const I = yt().outerRadius(A).innerRadius(E); - ta(d, g, y, I, R).select("path").attr("d", (O) => I(O)).attr("fill", R ? "none" : (O) => Tn(O)); + const I = ye().outerRadius(A).innerRadius(E); + ea(d, g, y, I, R).select("path").attr("d", (O) => I(O)).attr("fill", R ? "none" : (O) => Tn(O)); } function ra(d, g, y, E, A, R, I = !1) { - const q = yt().outerRadius(A).innerRadius(E).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), O = yt().outerRadius(A).innerRadius(E), k = ue(b(ne)).select("#" + g); - k.selectAll(".slice").attr("prevStart", (Z) => Z.startAngle).attr("prevEnd", (Z) => Z.endAngle); - const T = ta(d, g, y, O, I); + const q = ye().outerRadius(A).innerRadius(E).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), O = ye().outerRadius(A).innerRadius(E); + ct(b(rt)).select("#" + g).selectAll(".slice").attr("prevStart", (Z) => Z.startAngle).attr("prevEnd", (Z) => Z.endAngle); + const T = ea(d, g, y, O, I); let C = T.size(); - function Pe() { - C--, C <= 0 && (I || Ki(), k.selectAll(".finished").remove()); + function Pt() { + C--, C <= 0 && (I || Ki()); } - return T.select("path").transition("global").duration(ee).attrTween("d", function(Z) { - const Xe = Number(ue(this.parentNode).attr("prevStart")), re = Number(ue(this.parentNode).attr("prevEnd")), Re = Gt(Xe, Z.startAngle), ei = Gt(re, Z.endAngle); - return (Tr) => (q.startAngle(Re(Tr)).endAngle(ei(Tr)), q(Z)); + return T.select("path").transition("global").duration(tt).attrTween("d", function(Z) { + const Xt = Number(ct(this.parentNode).attr("prevStart")), nt = Number(ct(this.parentNode).attr("prevEnd")), Rt = Ge(Xt, Z.startAngle), ti = Ge(nt, Z.endAngle); + return (Tr) => (q.startAngle(Rt(Tr)).endAngle(ti(Tr)), q(Z)); }).on("end", function(Z) { - Z.startAngle === Z.endAngle && ue(this).attr("stroke", "none"), Pe(); + Z.startAngle === Z.endAngle && ct(this).attr("stroke", "none"), Pt(); }), R && !I && Al(d, y, A, fn(d)), y; } function ji(d, g) { @@ -5424,9 +5426,9 @@ function ml(e, t) { i("hide-exhausted"); } var Nl = { - pieColors: Fe, - exhaustedLabel: _t, - countExhaustedVotes: Ht, + pieColors: Ft, + exhaustedLabel: _e, + countExhaustedVotes: He, getEliminatedCandidates: fn, getElectedCandidates: br, runFullAnimationFn: jn, @@ -5435,71 +5437,71 @@ function ml(e, t) { return n(); }, set jsonData(d) { - n(d), se(); + n(d), st(); }, get currentRound() { return r(); }, set currentRound(d = 1) { - r(d), se(); + r(d), st(); }, get mouseEventType() { return i(); }, set mouseEventType(d) { - i(d), se(); + i(d), st(); }, get mouseData() { return s(); }, set mouseData(d) { - s(d), se(); + s(d), st(); }, get mouseX() { return a(); }, set mouseX(d) { - a(d), se(); + a(d), st(); }, get mouseY() { return o(); }, set mouseY(d) { - o(d), se(); + o(d), st(); }, get requestRoundChange() { return l(); }, set requestRoundChange(d = (g) => { }) { - l(d), se(); + l(d), st(); }, get candidateColors() { return u(); }, set candidateColors(d = []) { - u(d), se(); + u(d), st(); }, get excludeFinalWinnerAndEliminatedCandidate() { return f(); }, set excludeFinalWinnerAndEliminatedCandidate(d = !1) { - f(d), se(); + f(d), st(); }, get firstRoundDeterminesPercentages() { return h(); }, set firstRoundDeterminesPercentages(d = !1) { - h(d), se(); + h(d), st(); }, get displayPhase() { return c(); }, set displayPhase(d = 0) { - c(d), se(); + c(d), st(); } }, ia = Gd(); - return pi(ia, (d) => de(ne, d), () => b(ne)), Ke(e, ia), Vi(Nl); + return pi(ia, (d) => dt(rt, d), () => b(rt)), Kt(t, ia), Vi(Nl); } Hs( ml, @@ -5528,14 +5530,14 @@ Hs( ], { mode: "open" } ); -var jd = /* @__PURE__ */ qt("
"), Jd = /* @__PURE__ */ qt('
', 1), Zd = /* @__PURE__ */ qt('
'); +var jd = /* @__PURE__ */ qe("
"), Jd = /* @__PURE__ */ qe('
', 1), Zd = /* @__PURE__ */ qe('
'); const Qd = { 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 yl(e, t) { - qi(t, !0), Vs(e, Qd); - let n = fe(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = fe(t, "currentStep", 7, 0), i = fe(t, "disabled", 7, !1), s = fe(t, "onAdvance", 7, () => { +function yl(t, e) { + qi(e, !0), Vs(t, Qd); + let n = ut(e, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = ut(e, "currentStep", 7, 0), i = ut(e, "disabled", 7, !1), s = ut(e, "onAdvance", 7, () => { }); function a() { i() || s()(); @@ -5548,26 +5550,26 @@ function yl(e, t) { return n(); }, set labels(h = ["Eliminate", "Transfer", "Consolidate"]) { - n(h), se(); + n(h), st(); }, get currentStep() { return r(); }, set currentStep(h = 0) { - r(h), se(); + r(h), st(); }, get disabled() { return i(); }, set disabled(h = !1) { - i(h), se(); + i(h), st(); }, get onAdvance() { return s(); }, set onAdvance(h = () => { }) { - s(h), se(); + s(h), st(); } }, u = Zd(); let f; @@ -5576,19 +5578,19 @@ function yl(e, t) { { var _ = (K) => { var Q = jd(); - let ee; - Kt(() => ee = ri(Q, 1, "connector svelte-1l4eyw0", null, ee, { completed: !i() && p <= r() })), Ke(K, Q); + let tt; + Ke(() => tt = ri(Q, 1, "connector svelte-1l4eyw0", null, tt, { completed: !i() && p <= r() })), Kt(K, Q); }; - er($, (K) => { + tr($, (K) => { p > 0 && K(_); }); } - var x = Qe($, 2), F = Ue(x); + var x = Qt($, 2), F = Ut(x); let S; - var M = Qe(F, 2); + var M = Qt(F, 2); let D; - var W = Ue(M, !0); - qe(M), qe(x), Kt(() => { + var W = Ut(M, !0); + qt(M), qt(x), Ke(() => { S = ri(F, 1, "dot svelte-1l4eyw0", null, S, { active: !i() && p === r(), completed: !i() && p < r() @@ -5596,14 +5598,14 @@ function yl(e, t) { active: !i() && p === r(), completed: !i() && p < r() }), pn(W, b(c)); - }), Ke(h, m); - }), qe(u), Kt(() => { + }), Kt(h, m); + }), qt(u), Ke(() => { f = ri(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), ya(u, "tabindex", i() ? -1 : 0), ya(u, "aria-disabled", i()); - }), Ke(e, u), Vi(l); + }), Kt(t, u), Vi(l); } Hu(["click", "keydown"]); Hs(yl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); -var ep = /* @__PURE__ */ qt(" ", 1), tp = /* @__PURE__ */ qt("About to eliminate: ", 1), np = /* @__PURE__ */ qt(" ", 1), rp = /* @__PURE__ */ qt(" ", 1), ip = /* @__PURE__ */ qt('

', 1), sp = /* @__PURE__ */ qt("
", 1), ap = /* @__PURE__ */ qt('


these ballots have already been eliminated.
', 1); +var tp = /* @__PURE__ */ qe(" ", 1), ep = /* @__PURE__ */ qe("About to eliminate: ", 1), np = /* @__PURE__ */ qe(" ", 1), rp = /* @__PURE__ */ qe(" ", 1), ip = /* @__PURE__ */ qe('

', 1), sp = /* @__PURE__ */ qe("
", 1), ap = /* @__PURE__ */ qe('


these ballots have already been eliminated.
', 1); const op = { 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;} @@ -5619,11 +5621,11 @@ const op = { }` }; -function lp(e, t) { - qi(t, !0), Vs(e, op); +function lp(t, e) { + qi(e, !0), Vs(t, op); const n = 0.85; - let r = fe(t, "electionSummary", 7), i = fe(t, "currentRound", 7, 1), s = fe(t, "requestRoundChange", 7, (w) => { - }), a = fe(t, "candidateColors", 23, () => []), o = fe(t, "textForWinner", 7, "elected"), l = fe(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = fe(t, "firstRoundDeterminesPercentages", 7, !1), f = fe(t, "showCaptions", 7, !1); + let r = ut(e, "electionSummary", 7), i = ut(e, "currentRound", 7, 1), s = ut(e, "requestRoundChange", 7, (w) => { + }), a = ut(e, "candidateColors", 23, () => []), o = ut(e, "textForWinner", 7, "elected"), l = ut(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = ut(e, "firstRoundDeterminesPercentages", 7, !1), f = ut(e, "showCaptions", 7, !1); const h = { elected: { caption: "Elected", @@ -5642,7 +5644,7 @@ function lp(e, t) { infinitive: "to take the lead" } }; - let c = /* @__PURE__ */ cn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ Ee(null), m = /* @__PURE__ */ Ee(null), $ = /* @__PURE__ */ Ee(""), _ = /* @__PURE__ */ Ee(kn([])), x = /* @__PURE__ */ Ee(""), F = /* @__PURE__ */ Ee(""), S = /* @__PURE__ */ Ee(0), M = /* @__PURE__ */ Ee(0), D = /* @__PURE__ */ cn(() => W(r())); + let c = /* @__PURE__ */ cn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ Et(null), m = /* @__PURE__ */ Et(null), $ = /* @__PURE__ */ Et(""), _ = /* @__PURE__ */ Et(kn([])), x = /* @__PURE__ */ Et(""), F = /* @__PURE__ */ Et(""), S = /* @__PURE__ */ Et(0), M = /* @__PURE__ */ Et(0), D = /* @__PURE__ */ cn(() => W(r())); function W(w) { if (typeof w == "string") try { @@ -5655,23 +5657,23 @@ function lp(e, t) { function K(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function Q(w, Y, te) { - w.style.left = Y + "px", w.style.top = te + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const ie = w.getBoundingClientRect(); - let ze = Y, lt = te + 20; - ze + ie.width > window.innerWidth - 12 && (ze = window.innerWidth - ie.width - 12), ze < 12 && (ze = 12), lt + ie.height > window.innerHeight - 12 && (lt = te - ie.height - 12), w.style.left = ze + "px", w.style.top = lt + "px"; + function Q(w, Y, et) { + w.style.left = Y + "px", w.style.top = et + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const it = w.getBoundingClientRect(); + let zt = Y, le = et + 20; + zt + it.width > window.innerWidth - 12 && (zt = window.innerWidth - it.width - 12), zt < 12 && (zt = 12), le + it.height > window.innerHeight - 12 && (le = et - it.height - 12), w.style.left = zt + "px", w.style.top = le + "px"; }); } - function ee() { + function tt() { switch (b(x)) { case "enter": ((w) => { var Y = Jl(w, 2); - de(_, Y[0], !0), de($, Y[1], !0); - })(ae(b(F), i())), b(p) && (Q(b(p), b(S) || 0, b(M) || 0), b(p).style.opacity = String(n)); + dt(_, Y[0], !0), dt($, Y[1], !0); + })(at(b(F), i())), b(p) && (Q(b(p), b(S) || 0, b(M) || 0), b(p).style.opacity = String(n)); break; case "leave": - b(p) && (b(p).style.opacity = "0"), de(_, [], !0), de($, ""); + b(p) && (b(p).style.opacity = "0"), dt(_, [], !0), dt($, ""); break; case "show-exhausted": b(m) && (Q(b(m), b(S) || 0, b(M) || 0), b(m).style.opacity = String(n)); @@ -5684,75 +5686,75 @@ function lp(e, t) { break; } } - Is(() => ee()); + Is(() => tt()); function J(w, Y) { return w === 1 ? Y ? "vote was" : "vote will be" : Y ? "votes were" : "votes will be"; } - function ae(w, Y) { - const te = [], ve = w === "exhausted" ? _t() : w; - let be; - w === "exhausted" ? be = z(1) : be = b(D).results[0].tally[w], te.push(`${ve} started with ${be} votes.`); - for (let ie = 1; ie <= Y; ie++) { - ie === Y && (w === "exhausted" ? be = z(Y) : be = b(D).results[Y - 1].tally[w], te.push(`${ve} has ${be} votes at round ${Y}.`)); - const ze = b(D).results[ie - 1].tallyResults, lt = xe(ie); - for (let Be = 0; Be < ze.length; Be++) { - const ut = ze[Be].transfers, ge = ze[Be].eliminated, _e = ze[Be].elected; - if (!lt) { - if (ge) - ge === w && te.push(`${ve} will be eliminated on round ${ie}.`); - else if (w === _e && (te.push(`${ve} ${b(c).event} on round ${ie}.`), ut)) - for (let [Le, Yt] of Object.entries(ut)) - te.push(`${Yt} ${J(Number(Yt), ie < Y)} transferred to ${Le} on round ${ie}.`); + function at(w, Y) { + const et = [], vt = w === "exhausted" ? _e() : w; + let bt; + w === "exhausted" ? bt = z(1) : bt = b(D).results[0].tally[w], et.push(`${vt} started with ${bt} votes.`); + for (let it = 1; it <= Y; it++) { + it === Y && (w === "exhausted" ? bt = z(Y) : bt = b(D).results[Y - 1].tally[w], et.push(`${vt} has ${bt} votes at round ${Y}.`)); + const zt = b(D).results[it - 1].tallyResults, le = xt(it); + for (let Bt = 0; Bt < zt.length; Bt++) { + const ue = zt[Bt].transfers, gt = zt[Bt].eliminated, _t = zt[Bt].elected; + if (!le) { + if (gt) + gt === w && et.push(`${vt} will be eliminated on round ${it}.`); + else if (w === _t && (et.push(`${vt} ${b(c).event} on round ${it}.`), ue)) + for (let [Lt, Ye] of Object.entries(ue)) + et.push(`${Ye} ${J(Number(Ye), it < Y)} transferred to ${Lt} on round ${it}.`); } - const $e = ge || _e; - if ($e) { - const Le = Number(ut[w]); - Le && te.push(`${Le} ${J(Le, ie < Y)} transferred from ${$e} on round ${ie}.`); + const $t = gt || _t; + if ($t) { + const Lt = Number(ue[w]); + Lt && et.push(`${Lt} ${J(Lt, it < Y)} transferred from ${$t} on round ${it}.`); } } } - return [te, ve]; + return [et, vt]; } - function oe() { + function ot() { let w = 0; for (let Y = 1; Y <= b(D).results.length; Y++) { - if (xe(Y)) continue; - const te = b(D).results[Y - 1].tallyResults; - for (let ve = 0; ve < te.length; ve++) - te[ve].elected && w++; + if (xt(Y)) continue; + const et = b(D).results[Y - 1].tallyResults; + for (let vt = 0; vt < et.length; vt++) + et[vt].elected && w++; } return w; } - let N, H = /* @__PURE__ */ Ee(0); - function Ie(w) { - var be; - return !((be = b(D)) != null && be.results) || w < 1 || w > b(D).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [b(D).results[w - 1].tallyResults.some((ie) => ie.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; + let N, H = /* @__PURE__ */ Et(0); + function It(w) { + var bt; + return !((bt = b(D)) != null && bt.results) || w < 1 || w > b(D).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [b(D).results[w - 1].tallyResults.some((it) => it.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; } - function Me(w) { - var te; - if (!((te = b(D)) != null && te.results) || w < 1 || w > b(D).results.length || w === b(D).results.length) return !0; + function Mt(w) { + var et; + if (!((et = b(D)) != null && et.results) || w < 1 || w > b(D).results.length || w === b(D).results.length) return !0; const Y = b(D).results[w - 1].tallyResults; - return Y.length === 0 || Y.every((ve) => Object.keys(ve.transfers).length === 0); + return Y.length === 0 || Y.every((vt) => Object.keys(vt.transfers).length === 0); } - function xe(w) { + function xt(w) { return l() && b(D).results && w === b(D).results.length; } - function ce(w) { - return xe(w) ? [] : N ? N.getEliminatedCandidates(w) : []; + function ft(w) { + return xt(w) ? [] : N ? N.getEliminatedCandidates(w) : []; } - function le(w) { - return xe(w) ? [] : N ? N.getElectedCandidates(w) : []; + function lt(w) { + return xt(w) ? [] : N ? N.getElectedCandidates(w) : []; } function z(w) { return N ? N.countExhaustedVotes(w) : 0; } - function Fe() { + function Ft() { N && N.animateOnePhaseFn && N.animateOnePhaseFn(); } - function _t() { + function _e() { return N ? N.exhaustedLabel : ""; } - function ne() { + function rt() { return N ? N.pieColors : {}; } var bn = { @@ -5760,54 +5762,54 @@ function lp(e, t) { return r(); }, set electionSummary(w) { - r(w), se(); + r(w), st(); }, get currentRound() { return i(); }, set currentRound(w = 1) { - i(w), se(); + i(w), st(); }, get requestRoundChange() { return s(); }, set requestRoundChange(w = (Y) => { }) { - s(w), se(); + s(w), st(); }, get candidateColors() { return a(); }, set candidateColors(w = []) { - a(w), se(); + a(w), st(); }, get textForWinner() { return o(); }, set textForWinner(w = "elected") { - o(w), se(); + o(w), st(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - l(w), se(); + l(w), st(); }, get firstRoundDeterminesPercentages() { return u(); }, set firstRoundDeterminesPercentages(w = !1) { - u(w), se(); + u(w), st(); }, get showCaptions() { return f(); }, set showCaptions(w = !1) { - f(w), se(); + f(w), st(); } - }, Oe = ap(), ot = dn(Oe), $n = Ue(ot); + }, Ot = ap(), oe = dn(Ot), $n = Ut(oe); { - let w = /* @__PURE__ */ cn(() => Ie(i())), Y = /* @__PURE__ */ cn(() => Me(i())); + let w = /* @__PURE__ */ cn(() => It(i())), Y = /* @__PURE__ */ cn(() => Mt(i())); yl($n, { get labels() { return b(w); @@ -5818,11 +5820,11 @@ function lp(e, t) { get disabled() { return b(Y); }, - onAdvance: Fe + onAdvance: Ft }); } - qe(ot); - var we = Qe(ot, 4), mt = Ue(we), Ht = Ue(mt), An = Ue(Ht); + qt(oe); + var wt = Qt(oe, 4), me = Ut(wt), He = Ut(me), An = Ut(He); pi( ml(An, { get jsonData() { @@ -5845,124 +5847,124 @@ function lp(e, t) { return b(x); }, set mouseEventType(w) { - de(x, w, !0); + dt(x, w, !0); }, get mouseData() { return b(F); }, set mouseData(w) { - de(F, w, !0); + dt(F, w, !0); }, get mouseX() { return b(S); }, set mouseX(w) { - de(S, w, !0); + dt(S, w, !0); }, get mouseY() { return b(M); }, set mouseY(w) { - de(M, w, !0); + dt(M, w, !0); }, get displayPhase() { return b(H); }, set displayPhase(w) { - de(H, w, !0); + dt(H, w, !0); } }), (w) => N = w, () => N - ), qe(Ht), qe(mt); - var jr = Qe(mt, 2); + ), qt(He), qt(me); + var jr = Qt(me, 2); { var Jr = (w) => { - var Y = ip(), te = dn(Y), ve = Ue(te); - qe(te); - var be = Qe(te, 2), ie = Ue(be); + var Y = ip(), et = dn(Y), vt = Ut(et); + qt(et); + var bt = Qt(et, 2), it = Ut(bt); { - var ze = (_e) => { - var $e = tp(), Le = Qe(dn($e)); - di(Le, 17, () => ce(i()), hi, (Yt, jn, En) => { - var me = ep(), zt = dn(me); - let Bt; - var Jn = Ue(zt, !0); - qe(zt); - var Zn = Qe(zt, 2); + var zt = (_t) => { + var $t = ep(), Lt = Qt(dn($t)); + di(Lt, 17, () => ft(i()), hi, (Ye, jn, En) => { + var mt = tp(), ze = dn(mt); + let Be; + var Jn = Ut(ze, !0); + qt(ze); + var Zn = Qt(ze, 2); { - var $r = (Xt) => { - var Wt = pa(", "); - Ke(Xt, Wt); - }, Ar = /* @__PURE__ */ cn(() => En < ce(i()).length - 1); - er(Zn, (Xt) => { - b(Ar) && Xt($r); + var $r = (Xe) => { + var We = pa(", "); + Kt(Xe, We); + }, Ar = /* @__PURE__ */ cn(() => En < ft(i()).length - 1); + tr(Zn, (Xe) => { + b(Ar) && Xe($r); }); } - Kt( - (Xt) => { - Bt = ma(zt, "", Bt, Xt), pn(Jn, b(jn)); + Ke( + (Xe) => { + Be = ma(ze, "", Be, Xe), pn(Jn, b(jn)); }, - [() => ({ color: ne()[b(jn)] })] - ), Ke(Yt, me); - }), Ke(_e, $e); - }, lt = /* @__PURE__ */ cn(() => ce(i()).length > 0); - er(ie, (_e) => { - b(lt) && _e(ze); + [() => ({ color: rt()[b(jn)] })] + ), Kt(Ye, mt); + }), Kt(_t, $t); + }, le = /* @__PURE__ */ cn(() => ft(i()).length > 0); + tr(it, (_t) => { + b(le) && _t(zt); }); } - var Be = Qe(ie, 2); + var Bt = Qt(it, 2); { - var ut = (_e) => { - var $e = rp(), Le = dn($e), Yt = Qe(Le); - di(Yt, 17, () => le(i()), hi, (jn, En, me) => { - var zt = np(), Bt = dn(zt); + var ue = (_t) => { + var $t = rp(), Lt = dn($t), Ye = Qt(Lt); + di(Ye, 17, () => lt(i()), hi, (jn, En, mt) => { + var ze = np(), Be = dn(ze); let Jn; - var Zn = Ue(Bt, !0); - qe(Bt); - var $r = Qe(Bt, 2); + var Zn = Ut(Be, !0); + qt(Be); + var $r = Qt(Be, 2); { - var Ar = (Wt) => { + var Ar = (We) => { var Tn = pa(", "); - Ke(Wt, Tn); - }, Xt = /* @__PURE__ */ cn(() => me < le(i()).length - 1); - er($r, (Wt) => { - b(Xt) && Wt(Ar); + Kt(We, Tn); + }, Xe = /* @__PURE__ */ cn(() => mt < lt(i()).length - 1); + tr($r, (We) => { + b(Xe) && We(Ar); }); } - Kt( - (Wt) => { - Jn = ma(Bt, "", Jn, Wt), pn(Zn, b(En)); + Ke( + (We) => { + Jn = ma(Be, "", Jn, We), pn(Zn, b(En)); }, - [() => ({ color: ne()[b(En)] })] - ), Ke(jn, zt); - }), Kt(() => pn(Le, `${b(c).caption ?? ""}: `)), Ke(_e, $e); - }, ge = /* @__PURE__ */ cn(() => le(i()).length > 0); - er(Be, (_e) => { - b(ge) && _e(ut); + [() => ({ color: rt()[b(En)] })] + ), Kt(jn, ze); + }), Ke(() => pn(Lt, `${b(c).caption ?? ""}: `)), Kt(_t, $t); + }, gt = /* @__PURE__ */ cn(() => lt(i()).length > 0); + tr(Bt, (_t) => { + b(gt) && _t(ue); }); } - qe(be), Kt((_e) => pn(ve, `${b(D).config.contest ?? ""}, ${_e ?? ""} ${b(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [oe]), Ke(w, Y); + qt(bt), Ke((_t) => pn(vt, `${b(D).config.contest ?? ""}, ${_t ?? ""} ${b(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [ot]), Kt(w, Y); }; - er(jr, (w) => { + tr(jr, (w) => { f() && w(Jr); }); } - qe(we); - var Kn = Qe(we, 2), un = Ue(Kn), Gi = Ue(un, !0); - qe(un); - var Zr = Qe(un, 2); + qt(wt); + var Kn = Qt(wt, 2), un = Ut(Kn), Gi = Ut(un, !0); + qt(un); + var Zr = Qt(un, 2); di(Zr, 17, () => b(_), hi, (w, Y) => { - var te = sp(), ve = dn(te), be = Ue(ve, !0); - qe(ve), os(2), Kt(() => pn(be, b(Y))), Ke(w, te); - }), qe(Kn), pi(Kn, (w) => de(p, w), () => b(p)); - var fn = Qe(Kn, 2), br = Ue(fn); - return os(2), qe(fn), pi(fn, (w) => de(m, w), () => b(m)), Kt( + var et = sp(), vt = dn(et), bt = Ut(vt, !0); + qt(vt), os(2), Ke(() => pn(bt, b(Y))), Kt(w, et); + }), qt(Kn), pi(Kn, (w) => dt(p, w), () => b(p)); + var fn = Qt(Kn, 2), br = Ut(fn); + return os(2), qt(fn), pi(fn, (w) => dt(m, w), () => b(m)), Ke( (w) => { pn(Gi, b($)), pn(br, `"${w ?? ""}" means all the candidates ranked on `); }, - [_t] - ), Ke(e, Oe), Vi(bn); + [_e] + ), Kt(t, Ot), Vi(bn); } customElements.define("pie-chart", Hs( lp, From a0c1078c4359ba09b7f997061ebd3502416c9209 Mon Sep 17 00:00:00 2001 From: skaphan Date: Mon, 6 Apr 2026 15:16:38 -0700 Subject: [PATCH 28/31] Revert to raw JSON for pie chart; move randomization to component The pie chart component now handles candidate scatter ordering internally via the randomizeOrder flag, so the server-side graphToRCtab converter is no longer needed. Co-Authored-By: Claude Opus 4.6 --- common/viewUtils.py | 2 - templates/pie/pie-nonblocking.html | 7 +- templates/pie/pie.html | 4 +- visualizer/common.py | 7 - visualizer/pie/__init__.py | 0 visualizer/pie/graphToRCtab.py | 152 -------------- visualizer/tests/testGraphToRCtab.py | 300 --------------------------- 7 files changed, 4 insertions(+), 468 deletions(-) delete mode 100644 visualizer/pie/__init__.py delete mode 100644 visualizer/pie/graphToRCtab.py delete mode 100644 visualizer/tests/testGraphToRCtab.py diff --git a/common/viewUtils.py b/common/viewUtils.py index b75e1ee5..49c13ce5 100644 --- a/common/viewUtils.py +++ b/common/viewUtils.py @@ -10,7 +10,6 @@ from visualizer.descriptors.textForWinnerUtils import as_caption from visualizer.graph.graphCreator import make_graph_with_file from visualizer.models import TextForWinner -from visualizer.pie.graphToRCtab import graph_to_rctab_json from visualizer.sankey.graphToD3 import D3Sankey from visualizer.sidecar.reader import SidecarReader from visualizer.tabular.tabular import TabulateByRoundInteractive, \ @@ -70,7 +69,6 @@ def get_data_for_graph(graph, config): 'tabularByRoundInteractive': tabularByRoundInteractive, 'graph': graph, 'rawData': graph._raw_JSON, - 'pieData': graph_to_rctab_json(graph), 'textForWinner': as_caption(config).lower(), } roundDescriberData = get_data_for_round_describer(graph, config) diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 9a7c185a..e00deef1 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -14,12 +14,8 @@ // Generate candidate colors from the election's color theme, // matching the palette used by the other visualizations. - // Generate enough colors for all tally entries (including Inactive Ballots) - // rather than config.numCandidates, to avoid color wrapping. - const _parsedSummary = JSON.parse(electionSummary); - const _numTallyEntries = Object.keys(_parsedSummary.results[0].tally).length; const colorGenerator = getColorGenerator(config.colorTheme); - const candidateColors = Array.from(colorGenerator(_numTallyEntries)); + const candidateColors = Array.from(colorGenerator({{ config.numCandidates }})); // Create the pie-chart element const pieChart = document.createElement("pie-chart"); @@ -33,6 +29,7 @@ pieChart.textForWinner = "{{ textForWinner }}"; pieChart.excludeFinalWinnerAndEliminatedCandidate = {{ config.excludeFinalWinnerAndEliminatedCandidate|yesno:"true,false" }}; pieChart.firstRoundDeterminesPercentages = false; + pieChart.randomizeOrder = true; pieChart.currentRound = {{ config.numRounds }}; // Append it to the div diff --git a/templates/pie/pie.html b/templates/pie/pie.html index 10584166..8c740660 100644 --- a/templates/pie/pie.html +++ b/templates/pie/pie.html @@ -1,6 +1,6 @@ - -{{ pieData|json_script:"rawDataId" }} + +{{ rawData|json_script:"rawDataId" }}
diff --git a/visualizer/common.py b/visualizer/common.py index 96edf434..8337433d 100644 --- a/visualizer/common.py +++ b/visualizer/common.py @@ -34,13 +34,6 @@ def percentify(numerator, denominator): return str(round(10000.0 * floatVal) / 100.0) + "%" -def stringify(value): - """ Convert a number to string, matching RCTab JSON convention. - Integers are formatted without decimals. """ - if isinstance(value, float) and value == int(value): - return str(int(value)) - return str(value) - def candidate_renames(): """ A dictionary mapping how we should rename candidate names """ diff --git a/visualizer/pie/__init__.py b/visualizer/pie/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/visualizer/pie/graphToRCtab.py b/visualizer/pie/graphToRCtab.py deleted file mode 100644 index 2bd7611d..00000000 --- a/visualizer/pie/graphToRCtab.py +++ /dev/null @@ -1,152 +0,0 @@ -""" -Convert a Graph object into an RCTab-compatible JSON dict for the pie chart. - -Other rcvis visualizations (bar chart, sankey, tabular) consume GraphSummary, -which respects config options like excludeFinalWinnerAndEliminatedCandidate. -The pie chart component expects RCTab's JSON format (results/tally/tallyResults). - -This module bridges the two: it reads from the processed Graph (which already -has config filters applied) and produces the JSON structure the pie chart needs. -""" - -from visualizer import common -from visualizer.graph.rcvResult import Elimination, WinTransfer - - -def _scatter_order(names): - """ - Shuffle candidate names deterministically to spread sizes around the pie. - - Uses a seeded random shuffle so the order is stable for the same set - of candidates (required for D3 pie animation across rounds). The seed - is derived from the sorted candidate names, so the same election - always produces the same order. - """ - import random - import hashlib - - if len(names) <= 3: - return list(names) - - seed = int(hashlib.md5('|'.join(sorted(names)).encode()).hexdigest(), 16) % (2**32) - rng = random.Random(seed) - result = list(names) - rng.shuffle(result) - return result - - -def graph_to_rctab_json(graph): - """ - Build an RCTab-compatible JSON dict from a processed Graph. - - The Graph has already been through config filters (e.g. - excludeFinalWinnerAndEliminatedCandidate) and migrations, - so the output respects those settings. - - All candidates present in the Graph are included in the tally, - including "Inactive Ballots" and "Residual Surplus" pseudo-candidates - (the pie chart handles these by name). - - Returns a dict matching the RCtabSummary TypeScript interface. - """ - summary = graph.summarize() - num_rounds = graph.numRounds - - # Count active (real) candidates for the summary - inactive_names = {common.INACTIVE_TEXT, common.RESIDUAL_SURPLUS_TEXT} - num_active_candidates = sum(1 for c in graph.candidates if c.name not in inactive_names) - - # Compute interleave order once from round 1, reuse for all rounds. - # Spreads sizes evenly around the circle using a stride-based approach: - # sort candidates by votes descending, then pick every Nth one to ensure - # large and small slices are distributed, not clustered. - # Inactive/residual entries always last. - # Order must be stable across rounds for D3 pie animation to work. - round1_nodes = graph.nodesPerRound[0] - active_items = [] - inactive_order = [] - for candidate, node in round1_nodes.items(): - if candidate.name in inactive_names: - inactive_order.append(candidate.name) - else: - active_items.append((candidate.name, node.count)) - active_items.sort(key=lambda item: item[1], reverse=True) - interleaved_order = _scatter_order([name for name, _ in active_items]) - interleaved_order.extend(inactive_order) - - results = [] - for round_i in range(num_rounds): - nodes_this_round = graph.nodesPerRound[round_i] - names_this_round = {c.name: (c, node) for c, node in nodes_this_round.items()} - - # Build tally using the stable interleaved order from round 1, - # including only candidates still present this round. - tally = {} - for name in interleaved_order: - if name in names_this_round: - candidate, node = names_this_round[name] - tally[name] = common.stringify(node.count) - - # Build tallyResults from transfersPerRound - tally_results = [] - for transfer in graph.transfersPerRound[round_i]: - tally_result = {} - - if isinstance(transfer, Elimination): - tally_result['eliminated'] = transfer.candidate.name - elif isinstance(transfer, WinTransfer): - tally_result['elected'] = transfer.candidate.name - else: - # Plain Transfer with no election/elimination action — skip - continue - - # Build transfers dict: target candidate name -> vote count - transfers = {} - for target_candidate, count in transfer.transfersByCandidate.items(): - if count != 0: - transfers[target_candidate.name] = common.stringify(count) - tally_result['transfers'] = transfers - - tally_results.append(tally_result) - - # Compute inactive ballots (exhausted choices) for the inactiveBallots field - inactive_ballots = {} - for candidate in graph.candidates: - if candidate.name == common.INACTIVE_TEXT and candidate in nodes_this_round: - exhausted = nodes_this_round[candidate].count - if exhausted > 0: - inactive_ballots['exhaustedChoices'] = common.stringify(exhausted) - break - - # Threshold: RCTab has per-round threshold, rcvis stores a single value - threshold = common.stringify(graph.threshold) if graph.threshold is not None else "0" - - results.append({ - 'round': round_i + 1, - 'tally': tally, - 'tallyResults': tally_results, - 'inactiveBallots': inactive_ballots, - 'threshold': threshold, - }) - - # Build summary - first_round_total = summary.rounds[0].totalActiveVotes if summary.rounds else 0 - - rctab_json = { - 'config': { - 'contest': graph.title, - }, - 'jsonFormatVersion': '1', - 'results': results, - 'summary': { - 'finalThreshold': common.stringify(graph.threshold) if graph.threshold is not None else "0", - 'numCandidates': num_active_candidates, - 'numWinners': summary.numWinners, - 'totalNumBallots': common.stringify(first_round_total), - }, - } - - if graph.dateString: - rctab_json['config']['date'] = graph.dateString - - return rctab_json diff --git a/visualizer/tests/testGraphToRCtab.py b/visualizer/tests/testGraphToRCtab.py deleted file mode 100644 index 6b5dc83f..00000000 --- a/visualizer/tests/testGraphToRCtab.py +++ /dev/null @@ -1,300 +0,0 @@ -""" -Tests for the graphToRCtab converter that builds RCTab-compatible JSON -from processed Graph objects. The converter bridges rcvis's internal Graph -representation to the RCTab JSON format consumed by the pie chart component. -These tests verify the conversion logic (structure, types, candidate handling), -not the pie chart rendering itself. -""" - -from django.test import TestCase - -from visualizer import common -from visualizer.graph.graphCreator import make_graph_with_file -from visualizer.common import stringify -from visualizer.pie.graphToRCtab import graph_to_rctab_json -from visualizer.tests import filenames - - -class StringifyTests(TestCase): - """ Tests for the _stringify helper """ - - def test_integer_unchanged(self): - self.assertEqual(stringify(42), "42") - - def test_integer_float_drops_decimal(self): - self.assertEqual(stringify(42.0), "42") - - def test_actual_float_kept(self): - self.assertEqual(stringify(42.5), "42.5") - - def test_zero(self): - self.assertEqual(stringify(0), "0") - - def test_zero_float(self): - self.assertEqual(stringify(0.0), "0") - - def test_string_passthrough(self): - """ RCTab JSON sometimes has string values already """ - self.assertEqual(stringify("100"), "100") - - -class OneRoundTests(TestCase): - """ Tests with a single-round election """ - - def setUp(self): - with open(filenames.ONE_ROUND, 'r', encoding='utf-8') as f: - self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) - self.result = graph_to_rctab_json(self.graph) - - def test_top_level_structure(self): - self.assertIn('config', self.result) - self.assertIn('results', self.result) - self.assertIn('summary', self.result) - self.assertIn('jsonFormatVersion', self.result) - - def test_single_round(self): - self.assertEqual(len(self.result['results']), 1) - - def test_round_has_required_fields(self): - rnd = self.result['results'][0] - self.assertIn('round', rnd) - self.assertIn('tally', rnd) - self.assertIn('tallyResults', rnd) - self.assertIn('inactiveBallots', rnd) - self.assertIn('threshold', rnd) - self.assertEqual(rnd['round'], 1) - - def test_tally_has_candidates(self): - tally = self.result['results'][0]['tally'] - self.assertGreater(len(tally), 0) - # All tally values should be strings (RCTab convention) - for val in tally.values(): - self.assertIsInstance(val, str) - - def test_winner_elected(self): - """ The single-round election should have an elected candidate """ - tally_results = self.result['results'][0]['tallyResults'] - elected = [tr for tr in tally_results if 'elected' in tr] - self.assertGreater(len(elected), 0) - - def test_config_has_contest(self): - self.assertIn('contest', self.result['config']) - self.assertIsInstance(self.result['config']['contest'], str) - self.assertGreater(len(self.result['config']['contest']), 0) - - -class ThreeRoundTests(TestCase): - """ Tests with a three-round single-winner election (medium-rcvis.json) """ - - def setUp(self): - with open(filenames.THREE_ROUND, 'r', encoding='utf-8') as f: - self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) - self.result = graph_to_rctab_json(self.graph) - - def test_round_count(self): - self.assertEqual(len(self.result['results']), 3) - - def test_rounds_numbered_sequentially(self): - for i, rnd in enumerate(self.result['results']): - self.assertEqual(rnd['round'], i + 1) - - def test_first_round_has_all_candidates(self): - """ The first round's tally should include all candidates from the graph """ - graph_candidates = {c.name for c in self.graph.candidates} - first_tally = set(self.result['results'][0]['tally'].keys()) - self.assertTrue(graph_candidates.issubset(first_tally), - f"Missing candidates: {graph_candidates - first_tally}") - - def test_eliminated_candidates_removed_in_later_rounds(self): - """ Eliminated candidates should not appear in subsequent rounds' tallies """ - # Banana is eliminated in round 1, so it should not be in round 2 or 3 - round_2_tally = set(self.result['results'][1]['tally'].keys()) - round_3_tally = set(self.result['results'][2]['tally'].keys()) - self.assertNotIn('Banana', round_2_tally) - self.assertNotIn('Banana', round_3_tally) - - def test_eliminations_present(self): - """ Earlier rounds should have eliminations """ - all_eliminated = [] - for rnd in self.result['results']: - for tr in rnd['tallyResults']: - if 'eliminated' in tr: - all_eliminated.append(tr['eliminated']) - self.assertGreater(len(all_eliminated), 0) - - def test_final_round_has_winner(self): - last_round = self.result['results'][-1] - elected = [tr for tr in last_round['tallyResults'] if 'elected' in tr] - self.assertEqual(len(elected), 1) - - def test_transfers_have_string_values(self): - """ All transfer values should be strings (RCTab convention) """ - for rnd in self.result['results']: - for tr in rnd['tallyResults']: - if 'transfers' in tr: - for val in tr['transfers'].values(): - self.assertIsInstance(val, str) - - def test_threshold_is_string(self): - for rnd in self.result['results']: - self.assertIsInstance(rnd['threshold'], str) - - def test_summary_fields(self): - summary = self.result['summary'] - self.assertIn('numCandidates', summary) - self.assertIn('numWinners', summary) - self.assertIn('totalNumBallots', summary) - self.assertIn('finalThreshold', summary) - - -class MultwinnerTests(TestCase): - """ Tests with a multi-winner surplus election (macomb-multiwinner-surplus.json) """ - - def setUp(self): - with open(filenames.MULTIWINNER, 'r', encoding='utf-8') as f: - self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) - self.result = graph_to_rctab_json(self.graph) - - def test_round_count(self): - self.assertEqual(len(self.result['results']), 5) - - def test_multiple_winners(self): - """ Multi-winner election should have multiple elected candidates """ - all_elected = [] - for rnd in self.result['results']: - for tr in rnd['tallyResults']: - if 'elected' in tr: - all_elected.append(tr['elected']) - self.assertGreater(len(all_elected), 1) - - def test_elected_have_transfers(self): - """ Elected candidates with surplus should have transfer entries """ - for rnd in self.result['results']: - for tr in rnd['tallyResults']: - if 'elected' in tr: - self.assertIn('transfers', tr) - - def test_num_candidates_excludes_pseudocandidates(self): - """ numCandidates in summary should not count Inactive Ballots or Residual Surplus """ - num = self.result['summary']['numCandidates'] - inactive_names = {common.INACTIVE_TEXT, common.RESIDUAL_SURPLUS_TEXT} - real_count = sum(1 for c in self.graph.candidates if c.name not in inactive_names) - self.assertEqual(num, real_count) - - -class InactiveBallotTests(TestCase): - """ Tests with a multiwinner election that has nonzero exhausted votes """ - - def setUp(self): - # Multiwinner election has Inactive Ballots count > 0 in round 5 - with open(filenames.MULTIWINNER, 'r', encoding='utf-8') as f: - self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) - self.result = graph_to_rctab_json(self.graph) - - def test_inactive_ballots_absent_when_zero(self): - """ Early rounds with zero exhausted votes should have empty inactiveBallots """ - first_round = self.result['results'][0] - inactive = first_round['inactiveBallots'] - self.assertNotIn('exhaustedChoices', inactive) - - def test_inactive_ballots_present_when_nonzero(self): - """ Round 5 has nonzero exhausted votes and should populate exhaustedChoices """ - last_round = self.result['results'][-1] - inactive = last_round['inactiveBallots'] - self.assertIn('exhaustedChoices', inactive) - self.assertGreater(float(inactive['exhaustedChoices']), 0) - - -class NoThresholdTests(TestCase): - """ Tests with an election that has no threshold in its config """ - - def setUp(self): - with open(filenames.NO_THRESHOLD, 'r', encoding='utf-8') as f: - self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) - self.result = graph_to_rctab_json(self.graph) - - def test_threshold_defaults_to_zero(self): - """ When no threshold, converter should output "0" rather than crash """ - for rnd in self.result['results']: - self.assertIsInstance(rnd['threshold'], str) - - def test_final_threshold_in_summary(self): - self.assertIn('finalThreshold', self.result['summary']) - - -class ExcludeFinalWinnerTests(TestCase): - """ Tests that excludeFinalWinnerAndEliminatedCandidate affects the output. - - The flag removes isWinner/isEliminated flags from the Graph's nodes, - but the WinTransfer/Elimination objects remain in transfersPerRound. - The converter still produces tallyResults entries — the flag's effect - is on visual markers (gold rings, etc.), not on transfer data. - The pie chart component handles suppression separately via its own - excludeFinalWinnerAndEliminatedCandidate prop. """ - - def test_with_exclude_flag_nodes_not_marked(self): - """ With the flag, the final round's nodes should have no winner/eliminated flags """ - with open(filenames.THREE_ROUND, 'r', encoding='utf-8') as f: - graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=True) - - last_round_nodes = graph.nodesPerRound[-1] - for candidate, node in last_round_nodes.items(): - self.assertFalse(node.isWinner, - f"{candidate.name} should not be marked as winner") - self.assertFalse(node.isEliminated, - f"{candidate.name} should not be marked as eliminated") - - def test_with_exclude_flag_transfers_preserved(self): - """ The converter still outputs tallyResults even with the flag, - because transfersPerRound is not affected by the flag """ - with open(filenames.THREE_ROUND, 'r', encoding='utf-8') as f: - graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=True) - result = graph_to_rctab_json(graph) - - last_round = result['results'][-1] - # WinTransfer is still present, so elected entry still appears - elected = [tr for tr in last_round['tallyResults'] if 'elected' in tr] - self.assertEqual(len(elected), 1) - - def test_without_exclude_flag(self): - """ Without the flag, the final round should have an elected candidate """ - with open(filenames.THREE_ROUND, 'r', encoding='utf-8') as f: - graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) - result = graph_to_rctab_json(graph) - - last_round = result['results'][-1] - elected = [tr for tr in last_round['tallyResults'] if 'elected' in tr] - self.assertEqual(len(elected), 1) - - -class SpecialCharacterTests(TestCase): - """ Tests that candidate names with special characters survive the conversion """ - - def setUp(self): - with open(filenames.CRAZY_NAMES, 'r', encoding='utf-8') as f: - self.graph = make_graph_with_file(f, excludeFinalWinnerAndEliminatedCandidate=False) - self.result = graph_to_rctab_json(self.graph) - - def test_conversion_succeeds(self): - """ graphToRCtab should not crash on names with HTML, quotes, commas, etc. """ - self.assertIn('results', self.result) - self.assertGreater(len(self.result['results']), 0) - - def test_html_name_preserved(self): - """ A candidate name containing HTML tags should appear verbatim in the tally """ - first_tally = self.result['results'][0]['tally'] - html_names = [n for n in first_tally if '' in n] - self.assertEqual(len(html_names), 1) - self.assertIn('A malicious name with html', first_tally) - - def test_quotes_preserved(self): - """ A candidate name with quotes and ticks should appear verbatim """ - first_tally = self.result['results'][0]['tally'] - self.assertIn('A malicious name with "quotes" and \'ticks\'', first_tally) - - def test_all_candidates_present_in_first_round(self): - """ All graph candidates should appear in the first round's tally """ - graph_candidates = {c.name for c in self.graph.candidates} - first_tally_names = set(self.result['results'][0]['tally'].keys()) - self.assertTrue(graph_candidates.issubset(first_tally_names), - f"Missing candidates: {graph_candidates - first_tally_names}") From b3ed82a3964939978d2d6ccc9596bb1a5e325821 Mon Sep 17 00:00:00 2001 From: skaphan Date: Mon, 6 Apr 2026 15:25:35 -0700 Subject: [PATCH 29/31] Sync pie chart --- static/pie/pie-chart.es.js | 6299 ++++++++++++++++++------------------ 1 file changed, 3172 insertions(+), 3127 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 37cd29b7..e7684102 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,300 +1,300 @@ -var Pl = Object.defineProperty; -var sa = (t) => { - throw TypeError(t); +var Ll = Object.defineProperty; +var oa = (e) => { + throw TypeError(e); }; -var Dl = (t, e, n) => e in t ? Pl(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var ht = (t, e, n) => Dl(t, typeof e != "symbol" ? e + "" : e, n), Zi = (t, e, n) => e.has(t) || sa("Cannot " + n); -var v = (t, e, n) => (Zi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), V = (t, e, n) => e.has(t) ? sa("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), L = (t, e, n, r) => (Zi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), At = (t, e, n) => (Zi(t, e, "access private method"), n); -var qa; -typeof window < "u" && ((qa = window.__svelte ?? (window.__svelte = {})).v ?? (qa.v = /* @__PURE__ */ new Set())).add("5"); -const Il = 1, Fl = 2, za = 4, Ol = 8, Ll = 16, ql = 1, Vl = 4, Hl = 8, Yl = 16, zl = 1, Bl = 2, Cs = "[", Di = "[!", Ss = "]", fr = {}, Ct = Symbol(), Ba = "http://www.w3.org/1999/xhtml", ss = !1; -var Xa = Array.isArray, Xl = Array.prototype.indexOf, cr = Array.prototype.includes, Ii = Array.from, xi = Object.keys, bi = Object.defineProperty, Vn = Object.getOwnPropertyDescriptor, Wl = Object.getOwnPropertyDescriptors, Ul = Object.prototype, Gl = Array.prototype, Wa = Object.getPrototypeOf, aa = Object.isExtensible; -const Kl = () => { +var ql = (e, t, n) => t in e ? Ll(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; +var ce = (e, t, n) => ql(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 Vl = 1, zl = 2, Xa = 4, Hl = 8, Yl = 16, Bl = 1, Xl = 4, Wl = 8, Ul = 16, Gl = 1, Kl = 2, Ns = "[", Oi = "[!", ks = "]", ur = {}, Re = Symbol(), Wa = "http://www.w3.org/1999/xhtml", os = !1; +var Ua = Array.isArray, jl = Array.prototype.indexOf, fr = Array.prototype.includes, Ii = Array.from, bi = Object.keys, $i = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, Jl = Object.getOwnPropertyDescriptors, Zl = Object.prototype, Ql = Array.prototype, Ga = Object.getPrototypeOf, la = Object.isExtensible; +const eu = () => { }; -function jl(t) { - for (var e = 0; e < t.length; e++) - t[e](); +function tu(e) { + for (var t = 0; t < e.length; t++) + e[t](); } -function Ua() { - var t, e, n = new Promise((r, i) => { - t = r, e = i; +function Ka() { + var e, t, n = new Promise((r, i) => { + e = r, t = i; }); - return { promise: n, resolve: t, reject: e }; + return { promise: n, resolve: e, reject: t }; } -function Jl(t, e) { - if (Array.isArray(t)) - return t; - if (!(Symbol.iterator in t)) - return Array.from(t); +function nu(e, t) { + if (Array.isArray(e)) + return e; + if (!(Symbol.iterator in e)) + return Array.from(e); const n = []; - for (const r of t) - if (n.push(r), n.length === e) break; + for (const r of e) + if (n.push(r), n.length === t) break; return n; } -const Nt = 2, Fr = 4, Fi = 8, Ga = 1 << 24, ln = 16, Te = 32, xn = 64, Ka = 128, pe = 512, Tt = 1024, kt = 2048, Ee = 4096, re = 8192, rn = 16384, yr = 32768, hr = 65536, oa = 1 << 17, ja = 1 << 18, Gn = 1 << 19, Zl = 1 << 20, en = 1 << 25, Bn = 65536, as = 1 << 21, Ns = 1 << 22, gn = 1 << 23, Pr = Symbol("$state"), Ja = Symbol("legacy props"), Ql = Symbol(""), Sn = new class extends Error { +const Ne = 2, Ir = 4, Fi = 8, ja = 1 << 24, cn = 16, At = 32, En = 64, Ja = 128, pt = 512, Ae = 1024, ke = 2048, $t = 4096, rt = 8192, on = 16384, mr = 32768, cr = 65536, ua = 1 << 17, Za = 1 << 18, jn = 1 << 19, ru = 1 << 20, sn = 1 << 25, Wn = 65536, ls = 1 << 21, Ms = 1 << 22, wn = 1 << 23, Pr = Symbol("$state"), Qa = Symbol("legacy props"), iu = Symbol(""), kn = new class extends Error { constructor() { super(...arguments); - ht(this, "name", "StaleReactionError"); - ht(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); + ce(this, "name", "StaleReactionError"); + ce(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed"); } }(); -var Va; -const tu = ((Va = globalThis.document) == null ? void 0 : /* @__PURE__ */ Va.contentType.includes("xml")) ?? !1, Ur = 3, wr = 8; -function eu(t) { +var Ha; +const su = ((Ha = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ha.contentType.includes("xml")) ?? !1, Ur = 3, yr = 8; +function au(e) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function nu() { +function ou() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function ru(t, e, n) { +function lu(e, t, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function iu(t) { +function uu(e) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function su() { +function fu() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function au(t) { +function cu(e) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function ou() { +function hu() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function lu() { +function du() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function uu(t) { +function pu(e) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function fu() { +function vu() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function cu() { +function gu() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function hu() { +function _u() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function du() { +function mu() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Oi(t) { +function Li(e) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function pu() { +function yu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } -let G = !1; -function nn(t) { - G = t; +let j = !1; +function an(e) { + j = e; } let X; -function Ht(t) { - if (t === null) - throw Oi(), fr; - return X = t; +function qe(e) { + if (e === null) + throw Li(), ur; + return X = e; } -function Li() { - return Ht(/* @__PURE__ */ Oe(X)); +function qi() { + return qe(/* @__PURE__ */ Vt(X)); } -function qt(t) { - if (G) { - if (/* @__PURE__ */ Oe(X) !== null) - throw Oi(), fr; - X = t; +function Fe(e) { + if (j) { + if (/* @__PURE__ */ Vt(X) !== null) + throw Li(), ur; + X = e; } } -function os(t = 1) { - if (G) { - for (var e = t, n = X; e--; ) +function us(e = 1) { + if (j) { + for (var t = e, n = X; t--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Oe(n); + /* @__PURE__ */ Vt(n); X = n; } } -function $i(t = !0) { - for (var e = 0, n = X; ; ) { - if (n.nodeType === wr) { +function Ai(e = !0) { + for (var t = 0, n = X; ; ) { + if (n.nodeType === yr) { var r = ( /** @type {Comment} */ n.data ); - if (r === Ss) { - if (e === 0) return n; - e -= 1; - } else (r === Cs || r === Di || // "[1", "[2", etc. for if blocks - r[0] === "[" && !isNaN(Number(r.slice(1)))) && (e += 1); + if (r === ks) { + if (t === 0) return n; + t -= 1; + } else (r === Ns || r === Oi || // "[1", "[2", etc. for if blocks + r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Oe(n) + /* @__PURE__ */ Vt(n) ); - t && n.remove(), n = i; + e && n.remove(), n = i; } } -function Za(t) { - if (!t || t.nodeType !== wr) - throw Oi(), fr; +function eo(e) { + if (!e || e.nodeType !== yr) + throw Li(), ur; return ( /** @type {Comment} */ - t.data + e.data ); } -function Qa(t) { - return t === this.v; +function to(e) { + return e === this.v; } -function vu(t, e) { - return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; +function wu(e, t) { + return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; } -function to(t) { - return !vu(t, this.v); +function no(e) { + return !wu(e, this.v); } -let gu = !1, se = null; -function dr(t) { - se = t; +let xu = !1, st = null; +function hr(e) { + st = e; } -function qi(t, e = !1, n) { - se = { - p: se, +function Vi(e, t = !1, n) { + st = { + p: st, i: !1, c: null, e: null, - s: t, + s: e, x: null, l: null }; } -function Vi(t) { - var e = ( +function zi(e) { + var t = ( /** @type {ComponentContext} */ - se - ), n = e.e; + st + ), n = t.e; if (n !== null) { - e.e = null; + t.e = null; for (var r of n) - To(r); + Ro(r); } - return t !== void 0 && (e.x = t), e.i = !0, se = e.p, t ?? /** @type {T} */ + return e !== void 0 && (t.x = e), t.i = !0, st = t.p, e ?? /** @type {T} */ {}; } -function eo() { +function ro() { return !0; } -let Nn = []; -function no() { - var t = Nn; - Nn = [], jl(t); +let Mn = []; +function io() { + var e = Mn; + Mn = [], tu(e); } -function _n(t) { - if (Nn.length === 0 && !Dr) { - var e = Nn; +function xn(e) { + if (Mn.length === 0 && !Dr) { + var t = Mn; queueMicrotask(() => { - e === Nn && no(); + t === Mn && io(); }); } - Nn.push(t); + Mn.push(e); } -function _u() { - for (; Nn.length > 0; ) - no(); +function bu() { + for (; Mn.length > 0; ) + io(); } -function ro(t) { - var e = j; - if (e === null) - return B.f |= gn, t; - if ((e.f & yr) === 0 && (e.f & Fr) === 0) - throw t; - pr(t, e); +function so(e) { + var t = J; + if (t === null) + return B.f |= wn, e; + if ((t.f & mr) === 0 && (t.f & Ir) === 0) + throw e; + dr(e, t); } -function pr(t, e) { - for (; e !== null; ) { - if ((e.f & Ka) !== 0) { - if ((e.f & yr) === 0) - throw t; +function dr(e, t) { + for (; t !== null; ) { + if ((t.f & Ja) !== 0) { + if ((t.f & mr) === 0) + throw e; try { - e.b.error(t); + t.b.error(e); return; } catch (n) { - t = n; + e = n; } } - e = e.parent; + t = t.parent; } - throw t; + throw e; } -const mu = -7169; -function pt(t, e) { - t.f = t.f & mu | e; +const $u = -7169; +function de(e, t) { + e.f = e.f & $u | t; } -function ks(t) { - (t.f & pe) !== 0 || t.deps === null ? pt(t, Tt) : pt(t, Ee); +function Ps(e) { + (e.f & pt) !== 0 || e.deps === null ? de(e, Ae) : de(e, $t); } -function io(t) { - if (t !== null) - for (const e of t) - (e.f & Nt) === 0 || (e.f & Bn) === 0 || (e.f ^= Bn, io( +function ao(e) { + if (e !== null) + for (const t of e) + (t.f & Ne) === 0 || (t.f & Wn) === 0 || (t.f ^= Wn, ao( /** @type {Derived} */ - e.deps + t.deps )); } -function so(t, e, n) { - (t.f & kt) !== 0 ? e.add(t) : (t.f & Ee) !== 0 && n.add(t), io(t.deps), pt(t, Tt); +function oo(e, t, n) { + (e.f & ke) !== 0 ? t.add(e) : (e.f & $t) !== 0 && n.add(e), ao(e.deps), de(e, Ae); } -const ei = /* @__PURE__ */ new Set(); -let U = null, St = null, jt = [], Hi = null, ls = !1, Dr = !1; -var rr, ir, Dn, sr, Yr, zr, In, je, ar, Fe, us, fs, ao; -const Ks = class Ks { +const ni = /* @__PURE__ */ new Set(); +let K = null, Se = null, Ke = [], Hi = null, fs = !1, Dr = !1; +var nr, rr, In, ir, Hr, Yr, Fn, Qt, sr, qt, cs, hs, lo; +const Js = class Js { constructor() { - V(this, Fe); - ht(this, "committed", !1); + H(this, qt); + ce(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} */ - ht(this, "current", /* @__PURE__ */ new Map()); + ce(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} */ - ht(this, "previous", /* @__PURE__ */ new Map()); + ce(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>} */ - V(this, rr, /* @__PURE__ */ new Set()); + H(this, nr, /* @__PURE__ */ new Set()); /** * If a fork is discarded, we need to destroy any effects that are no longer needed * @type {Set<(batch: Batch) => void>} */ - V(this, ir, /* @__PURE__ */ new Set()); + H(this, rr, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - V(this, Dn, 0); + H(this, In, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - V(this, sr, 0); + H(this, ir, 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} */ - V(this, Yr, null); + H(this, Hr, null); /** * Deferred effects (which run after async work has completed) that are DIRTY * @type {Set} */ - V(this, zr, /* @__PURE__ */ new Set()); + H(this, Yr, /* @__PURE__ */ new Set()); /** * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - V(this, In, /* @__PURE__ */ new Set()); + H(this, Fn, /* @__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,54 +302,54 @@ const Ks = class Ks { * so they can be rescheduled if the branch survives. * @type {Map} */ - V(this, je, /* @__PURE__ */ new Map()); - ht(this, "is_fork", !1); - V(this, ar, !1); + H(this, Qt, /* @__PURE__ */ new Map()); + ce(this, "is_fork", !1); + H(this, sr, !1); } is_deferred() { - return this.is_fork || v(this, sr) > 0; + return this.is_fork || v(this, ir) > 0; } /** * Add an effect to the #skipped_branches map and reset its children * @param {Effect} effect */ - skip_effect(e) { - v(this, je).has(e) || v(this, je).set(e, { d: [], m: [] }); + skip_effect(t) { + v(this, Qt).has(t) || v(this, Qt).set(t, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule * any tracked dirty/maybe_dirty child effects * @param {Effect} effect */ - unskip_effect(e) { - var n = v(this, je).get(e); + unskip_effect(t) { + var n = v(this, Qt).get(t); if (n) { - v(this, je).delete(e); + v(this, Qt).delete(t); for (var r of n.d) - pt(r, kt), $e(r); + de(r, ke), xt(r); for (r of n.m) - pt(r, Ee), $e(r); + de(r, $t), xt(r); } } /** * * @param {Effect[]} root_effects */ - process(e) { + process(t) { var i; - jt = [], this.apply(); + Ke = [], this.apply(); var n = [], r = []; - for (const s of e) - At(this, Fe, us).call(this, s, n, r); + for (const s of t) + be(this, qt, cs).call(this, s, n, r); if (this.is_deferred()) { - At(this, Fe, fs).call(this, r), At(this, Fe, fs).call(this, n); - for (const [s, a] of v(this, je)) - fo(s, a); + be(this, qt, hs).call(this, r), be(this, qt, hs).call(this, n); + for (const [s, a] of v(this, Qt)) + ho(s, a); } else { - for (const s of v(this, rr)) s(); - v(this, rr).clear(), v(this, Dn) === 0 && At(this, Fe, ao).call(this), U = null, la(r), la(n), (i = v(this, Yr)) == null || i.resolve(); + for (const s of v(this, nr)) s(); + v(this, nr).clear(), v(this, In) === 0 && be(this, qt, lo).call(this), K = null, fa(r), fa(n), (i = v(this, Hr)) == null || i.resolve(); } - St = null; + Se = null; } /** * Associate a change to a given source with the current @@ -357,107 +357,107 @@ const Ks = class Ks { * @param {Source} source * @param {any} value */ - capture(e, n) { - n !== Ct && !this.previous.has(e) && this.previous.set(e, n), (e.f & gn) === 0 && (this.current.set(e, e.v), St == null || St.set(e, e.v)); + capture(t, n) { + n !== Re && !this.previous.has(t) && this.previous.set(t, n), (t.f & wn) === 0 && (this.current.set(t, t.v), Se == null || Se.set(t, t.v)); } activate() { - U = this, this.apply(); + K = this, this.apply(); } deactivate() { - U === this && (U = null, St = null); + K === this && (K = null, Se = null); } flush() { - if (this.activate(), jt.length > 0) { - if (oo(), U !== null && U !== this) + if (this.activate(), Ke.length > 0) { + if (uo(), K !== null && K !== this) return; - } else v(this, Dn) === 0 && this.process([]); + } else v(this, In) === 0 && this.process([]); this.deactivate(); } discard() { - for (const e of v(this, ir)) e(this); - v(this, ir).clear(); + for (const t of v(this, rr)) t(this); + v(this, rr).clear(); } /** * * @param {boolean} blocking */ - increment(e) { - L(this, Dn, v(this, Dn) + 1), e && L(this, sr, v(this, sr) + 1); + increment(t) { + V(this, In, v(this, In) + 1), t && V(this, ir, v(this, ir) + 1); } /** * * @param {boolean} blocking */ - decrement(e) { - L(this, Dn, v(this, Dn) - 1), e && L(this, sr, v(this, sr) - 1), !v(this, ar) && (L(this, ar, !0), _n(() => { - L(this, ar, !1), this.is_deferred() ? jt.length > 0 && this.flush() : this.revive(); + decrement(t) { + V(this, In, v(this, In) - 1), t && V(this, ir, v(this, ir) - 1), !v(this, sr) && (V(this, sr, !0), xn(() => { + V(this, sr, !1), this.is_deferred() ? Ke.length > 0 && this.flush() : this.revive(); })); } revive() { - for (const e of v(this, zr)) - v(this, In).delete(e), pt(e, kt), $e(e); - for (const e of v(this, In)) - pt(e, Ee), $e(e); + for (const t of v(this, Yr)) + v(this, Fn).delete(t), de(t, ke), xt(t); + for (const t of v(this, Fn)) + de(t, $t), xt(t); this.flush(); } /** @param {() => void} fn */ - oncommit(e) { - v(this, rr).add(e); + oncommit(t) { + v(this, nr).add(t); } /** @param {(batch: Batch) => void} fn */ - ondiscard(e) { - v(this, ir).add(e); + ondiscard(t) { + v(this, rr).add(t); } settled() { - return (v(this, Yr) ?? L(this, Yr, Ua())).promise; + return (v(this, Hr) ?? V(this, Hr, Ka())).promise; } static ensure() { - if (U === null) { - const e = U = new Ks(); - ei.add(U), Dr || _n(() => { - U === e && e.flush(); + if (K === null) { + const t = K = new Js(); + ni.add(K), Dr || xn(() => { + K === t && t.flush(); }); } - return U; + return K; } apply() { } }; -rr = new WeakMap(), ir = new WeakMap(), Dn = new WeakMap(), sr = new WeakMap(), Yr = new WeakMap(), zr = new WeakMap(), In = new WeakMap(), je = new WeakMap(), ar = new WeakMap(), Fe = new WeakSet(), /** +nr = new WeakMap(), rr = new WeakMap(), In = new WeakMap(), ir = new WeakMap(), Hr = new WeakMap(), Yr = new WeakMap(), Fn = new WeakMap(), Qt = new WeakMap(), sr = new WeakMap(), qt = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root * @param {Effect[]} effects * @param {Effect[]} render_effects */ -us = function(e, n, r) { - e.f ^= Tt; - for (var i = e.first, s = null; i !== null; ) { - var a = i.f, o = (a & (Te | xn)) !== 0, l = o && (a & Tt) !== 0, u = l || (a & re) !== 0 || v(this, je).has(i); +cs = function(t, n, r) { + t.f ^= Ae; + for (var i = t.first, s = null; i !== null; ) { + var a = i.f, o = (a & (At | En)) !== 0, l = o && (a & Ae) !== 0, u = l || (a & rt) !== 0 || v(this, Qt).has(i); if (!u && i.fn !== null) { - o ? i.f ^= Tt : s !== null && (a & (Fr | Fi | Ga)) !== 0 ? s.b.defer_effect(i) : (a & Fr) !== 0 ? n.push(i) : Gr(i) && ((a & ln) !== 0 && v(this, In).add(i), gr(i)); + o ? i.f ^= Ae : s !== null && (a & (Ir | Fi | ja)) !== 0 ? s.b.defer_effect(i) : (a & Ir) !== 0 ? n.push(i) : Gr(i) && ((a & cn) !== 0 && v(this, Fn).add(i), vr(i)); var f = i.first; if (f !== null) { i = f; continue; } } - var h = i.parent; - for (i = i.next; i === null && h !== null; ) - h === s && (s = null), i = h.next, h = h.parent; + var p = i.parent; + for (i = i.next; i === null && p !== null; ) + p === s && (s = null), i = p.next, p = p.parent; } }, /** * @param {Effect[]} effects */ -fs = function(e) { - for (var n = 0; n < e.length; n += 1) - so(e[n], v(this, zr), v(this, In)); -}, ao = function() { +hs = function(t) { + for (var n = 0; n < t.length; n += 1) + oo(t[n], v(this, Yr), v(this, Fn)); +}, lo = function() { var i; - if (ei.size > 1) { + if (ni.size > 1) { this.previous.clear(); - var e = St, n = !0; - for (const s of ei) { + var t = Se, n = !0; + for (const s of ni) { if (s === this) { n = !1; continue; @@ -475,114 +475,114 @@ fs = function(e) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = jt; - jt = []; + var r = Ke; + Ke = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) - lo(f, o, l, u); - if (jt.length > 0) { - U = s, s.apply(); - for (const f of jt) - At(i = s, Fe, us).call(i, f, [], []); + fo(f, o, l, u); + if (Ke.length > 0) { + K = s, s.apply(); + for (const f of Ke) + be(i = s, qt, cs).call(i, f, [], []); s.deactivate(); } - jt = r; + Ke = r; } } - U = null, St = e; + K = null, Se = t; } - this.committed = !0, ei.delete(this); + this.committed = !0, ni.delete(this); }; -let sn = Ks; -function st(t) { - var e = Dr; +let ln = Js; +function re(e) { + var t = Dr; Dr = !0; try { for (var n; ; ) { - if (_u(), jt.length === 0 && (U == null || U.flush(), jt.length === 0)) + if (bu(), Ke.length === 0 && (K == null || K.flush(), Ke.length === 0)) return Hi = null, /** @type {T} */ n; - oo(); + uo(); } } finally { - Dr = e; + Dr = t; } } -function oo() { - ls = !0; - var t = null; +function uo() { + fs = !0; + var e = null; try { - for (var e = 0; jt.length > 0; ) { - var n = sn.ensure(); - if (e++ > 1e3) { + for (var t = 0; Ke.length > 0; ) { + var n = ln.ensure(); + if (t++ > 1e3) { var r, i; - yu(); + Au(); } - n.process(jt), mn.clear(); + n.process(Ke), bn.clear(); } } finally { - jt = [], ls = !1, Hi = null; + Ke = [], fs = !1, Hi = null; } } -function yu() { +function Au() { try { - ou(); - } catch (t) { - pr(t, Hi); - } -} -let we = null; -function la(t) { - var e = t.length; - if (e !== 0) { - for (var n = 0; n < e; ) { - var r = t[n++]; - if ((r.f & (rn | re)) === 0 && Gr(r) && (we = /* @__PURE__ */ new Set(), gr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && So(r), (we == null ? void 0 : we.size) > 0)) { - mn.clear(); - for (const i of we) { - if ((i.f & (rn | re)) !== 0) continue; + hu(); + } catch (e) { + dr(e, Hi); + } +} +let mt = null; +function fa(e) { + var t = e.length; + if (t !== 0) { + for (var n = 0; n < t; ) { + var r = e[n++]; + if ((r.f & (on | rt)) === 0 && Gr(r) && (mt = /* @__PURE__ */ new Set(), vr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && ko(r), (mt == null ? void 0 : mt.size) > 0)) { + bn.clear(); + for (const i of mt) { + if ((i.f & (on | rt)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - we.has(a) && (we.delete(a), s.push(a)), a = a.parent; + mt.has(a) && (mt.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (rn | re)) === 0 && gr(l); + (l.f & (on | rt)) === 0 && vr(l); } } - we.clear(); + mt.clear(); } } - we = null; + mt = null; } } -function lo(t, e, n, r) { - if (!n.has(t) && (n.add(t), t.reactions !== null)) - for (const i of t.reactions) { +function fo(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 & Nt) !== 0 ? lo( + (s & Ne) !== 0 ? fo( /** @type {Derived} */ i, - e, + t, n, r - ) : (s & (Ns | ln)) !== 0 && (s & kt) === 0 && uo(i, e, r) && (pt(i, kt), $e( + ) : (s & (Ms | cn)) !== 0 && (s & ke) === 0 && co(i, t, r) && (de(i, ke), xt( /** @type {Effect} */ i )); } } -function uo(t, e, n) { - const r = n.get(t); +function co(e, t, n) { + const r = n.get(e); if (r !== void 0) return r; - if (t.deps !== null) - for (const i of t.deps) { - if (cr.call(e, i)) + if (e.deps !== null) + for (const i of e.deps) { + if (fr.call(t, i)) return !0; - if ((i.f & Nt) !== 0 && uo( + if ((i.f & Ne) !== 0 && co( /** @type {Derived} */ i, - e, + t, n )) return n.set( @@ -591,82 +591,82 @@ function uo(t, e, n) { !0 ), !0; } - return n.set(t, !1), !1; + return n.set(e, !1), !1; } -function $e(t) { - for (var e = Hi = t; e.parent !== null; ) { - e = e.parent; - var n = e.f; - if (ls && e === j && (n & ln) !== 0 && (n & ja) === 0) +function xt(e) { + for (var t = Hi = e; t.parent !== null; ) { + t = t.parent; + var n = t.f; + if (fs && t === J && (n & cn) !== 0 && (n & Za) === 0) return; - if ((n & (xn | Te)) !== 0) { - if ((n & Tt) === 0) return; - e.f ^= Tt; + if ((n & (En | At)) !== 0) { + if ((n & Ae) === 0) return; + t.f ^= Ae; } } - jt.push(e); + Ke.push(t); } -function fo(t, e) { - if (!((t.f & Te) !== 0 && (t.f & Tt) !== 0)) { - (t.f & kt) !== 0 ? e.d.push(t) : (t.f & Ee) !== 0 && e.m.push(t), pt(t, Tt); - for (var n = t.first; n !== null; ) - fo(n, e), n = n.next; +function ho(e, t) { + if (!((e.f & At) !== 0 && (e.f & Ae) !== 0)) { + (e.f & ke) !== 0 ? t.d.push(e) : (e.f & $t) !== 0 && t.m.push(e), de(e, Ae); + for (var n = e.first; n !== null; ) + ho(n, t), n = n.next; } } -function wu(t) { - let e = 0, n = Xn(0), r; +function Eu(e) { + let t = 0, n = Un(0), r; return () => { - Ds() && (b(n), Fs(() => (e === 0 && (r = Bi(() => t(() => Ir(n)))), e += 1, () => { - _n(() => { - e -= 1, e === 0 && (r == null || r(), r = void 0, Ir(n)); + Is() && (x(n), Ls(() => (t === 0 && (r = Xi(() => e(() => Or(n)))), t += 1, () => { + xn(() => { + t -= 1, t === 0 && (r == null || r(), r = void 0, Or(n)); }); }))); }; } -var xu = hr | Gn | Ka; -function bu(t, e, n) { - new $u(t, e, n); +var Tu = cr | jn | Ja; +function Cu(e, t, n) { + new Ru(e, t, n); } -var ee, Br, Se, Fn, Ne, ce, Gt, ke, Je, vn, On, Ze, or, Ln, lr, ur, Qe, Mi, yt, co, ho, cs, ui, fi, hs; -class $u { +var tt, Br, Mt, Ln, Pt, ct, Ue, Dt, en, yn, qn, tn, ar, Vn, or, lr, nn, Pi, ge, po, vo, ds, fi, ci, ps; +class Ru { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ - constructor(e, n, r) { - V(this, yt); + constructor(t, n, r) { + H(this, ge); /** @type {Boundary | null} */ - ht(this, "parent"); - ht(this, "is_pending", !1); + ce(this, "parent"); + ce(this, "is_pending", !1); /** @type {TemplateNode} */ - V(this, ee); + H(this, tt); /** @type {TemplateNode | null} */ - V(this, Br, G ? X : null); + H(this, Br, j ? X : null); /** @type {BoundaryProps} */ - V(this, Se); + H(this, Mt); /** @type {((anchor: Node) => void)} */ - V(this, Fn); + H(this, Ln); /** @type {Effect} */ - V(this, Ne); + H(this, Pt); /** @type {Effect | null} */ - V(this, ce, null); + H(this, ct, null); /** @type {Effect | null} */ - V(this, Gt, null); + H(this, Ue, null); /** @type {Effect | null} */ - V(this, ke, null); + H(this, Dt, null); /** @type {DocumentFragment | null} */ - V(this, Je, null); + H(this, en, null); /** @type {TemplateNode | null} */ - V(this, vn, null); - V(this, On, 0); - V(this, Ze, 0); - V(this, or, !1); - V(this, Ln, !1); + H(this, yn, null); + H(this, qn, 0); + H(this, tn, 0); + H(this, ar, !1); + H(this, Vn, !1); /** @type {Set} */ - V(this, lr, /* @__PURE__ */ new Set()); + H(this, or, /* @__PURE__ */ new Set()); /** @type {Set} */ - V(this, ur, /* @__PURE__ */ new Set()); + H(this, lr, /* @__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 $u { * calls followed by no-op flushes * @type {Source | null} */ - V(this, Qe, null); - V(this, Mi, wu(() => (L(this, Qe, Xn(v(this, On))), () => { - L(this, Qe, null); + H(this, nn, null); + H(this, Pi, Eu(() => (V(this, nn, Un(v(this, qn))), () => { + V(this, nn, null); }))); - L(this, ee, e), L(this, Se, n), L(this, Fn, r), this.parent = /** @type {Effect} */ - j.b, this.is_pending = !!v(this, Se).pending, L(this, Ne, Os(() => { - if (j.b = this, G) { + V(this, tt, t), V(this, Mt, n), V(this, Ln, r), this.parent = /** @type {Effect} */ + J.b, this.is_pending = !!v(this, Mt).pending, V(this, Pt, qs(() => { + if (J.b = this, j) { const s = v(this, Br); - Li(), /** @type {Comment} */ - s.nodeType === wr && /** @type {Comment} */ - s.data === Di ? At(this, yt, ho).call(this) : (At(this, yt, co).call(this), v(this, Ze) === 0 && (this.is_pending = !1)); + qi(), /** @type {Comment} */ + s.nodeType === yr && /** @type {Comment} */ + s.data === Oi ? be(this, ge, vo).call(this) : (be(this, ge, po).call(this), v(this, tn) === 0 && (this.is_pending = !1)); } else { - var i = At(this, yt, cs).call(this); + var i = be(this, ge, ds).call(this); try { - L(this, ce, de(() => r(i))); + V(this, ct, dt(() => r(i))); } catch (s) { this.error(s); } - v(this, Ze) > 0 ? At(this, yt, fi).call(this) : this.is_pending = !1; + v(this, tn) > 0 ? be(this, ge, ci).call(this) : this.is_pending = !1; } return () => { var s; - (s = v(this, vn)) == null || s.remove(); + (s = v(this, yn)) == null || s.remove(); }; - }, xu)), G && L(this, ee, X); + }, Tu)), j && V(this, tt, X); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ - defer_effect(e) { - so(e, v(this, lr), v(this, ur)); + defer_effect(t) { + oo(t, v(this, or), v(this, lr)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -715,7 +715,7 @@ class $u { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, Se).pending; + return !!v(this, Mt).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -723,200 +723,200 @@ class $u { * Do not call from inside the class * @param {1 | -1} d */ - update_pending_count(e) { - At(this, yt, hs).call(this, e), L(this, On, v(this, On) + e), !(!v(this, Qe) || v(this, or)) && (L(this, or, !0), _n(() => { - L(this, or, !1), v(this, Qe) && vr(v(this, Qe), v(this, On)); + update_pending_count(t) { + be(this, ge, ps).call(this, t), V(this, qn, v(this, qn) + t), !(!v(this, nn) || v(this, ar)) && (V(this, ar, !0), xn(() => { + V(this, ar, !1), v(this, nn) && pr(v(this, nn), v(this, qn)); })); } get_effect_pending() { - return v(this, Mi).call(this), b( + return v(this, Pi).call(this), x( /** @type {Source} */ - v(this, Qe) + v(this, nn) ); } /** @param {unknown} error */ - error(e) { - var n = v(this, Se).onerror; - let r = v(this, Se).failed; - if (v(this, Ln) || !n && !r) - throw e; - v(this, ce) && (Yt(v(this, ce)), L(this, ce, null)), v(this, Gt) && (Yt(v(this, Gt)), L(this, Gt, null)), v(this, ke) && (Yt(v(this, ke)), L(this, ke, null)), G && (Ht( + error(t) { + var n = v(this, Mt).onerror; + let r = v(this, Mt).failed; + if (v(this, Vn) || !n && !r) + throw t; + v(this, ct) && (Ve(v(this, ct)), V(this, ct, null)), v(this, Ue) && (Ve(v(this, Ue)), V(this, Ue, null)), v(this, Dt) && (Ve(v(this, Dt)), V(this, Dt, null)), j && (qe( /** @type {TemplateNode} */ v(this, Br) - ), os(), Ht($i())); + ), us(), qe(Ai())); var i = !1, s = !1; const a = () => { if (i) { - pu(); + yu(); return; } - i = !0, s && du(), sn.ensure(), L(this, On, 0), v(this, ke) !== null && Hn(v(this, ke), () => { - L(this, ke, null); - }), this.is_pending = this.has_pending_snippet(), L(this, ce, At(this, yt, ui).call(this, () => (L(this, Ln, !1), de(() => v(this, Fn).call(this, v(this, ee)))))), v(this, Ze) > 0 ? At(this, yt, fi).call(this) : this.is_pending = !1; + i = !0, s && mu(), ln.ensure(), V(this, qn, 0), v(this, Dt) !== null && Yn(v(this, Dt), () => { + V(this, Dt, null); + }), this.is_pending = this.has_pending_snippet(), V(this, ct, be(this, ge, fi).call(this, () => (V(this, Vn, !1), dt(() => v(this, Ln).call(this, v(this, tt)))))), v(this, tn) > 0 ? be(this, ge, ci).call(this) : this.is_pending = !1; }; - _n(() => { + xn(() => { try { - s = !0, n == null || n(e, a), s = !1; + s = !0, n == null || n(t, a), s = !1; } catch (o) { - pr(o, v(this, Ne) && v(this, Ne).parent); + dr(o, v(this, Pt) && v(this, Pt).parent); } - r && L(this, ke, At(this, yt, ui).call(this, () => { - sn.ensure(), L(this, Ln, !0); + r && V(this, Dt, be(this, ge, fi).call(this, () => { + ln.ensure(), V(this, Vn, !0); try { - return de(() => { + return dt(() => { r( - v(this, ee), - () => e, + v(this, tt), + () => t, () => a ); }); } catch (o) { - return pr( + return dr( o, /** @type {Effect} */ - v(this, Ne).parent + v(this, Pt).parent ), null; } finally { - L(this, Ln, !1); + V(this, Vn, !1); } })); }); } } -ee = new WeakMap(), Br = new WeakMap(), Se = new WeakMap(), Fn = new WeakMap(), Ne = new WeakMap(), ce = new WeakMap(), Gt = new WeakMap(), ke = new WeakMap(), Je = new WeakMap(), vn = new WeakMap(), On = new WeakMap(), Ze = new WeakMap(), or = new WeakMap(), Ln = new WeakMap(), lr = new WeakMap(), ur = new WeakMap(), Qe = new WeakMap(), Mi = new WeakMap(), yt = new WeakSet(), co = function() { +tt = new WeakMap(), Br = new WeakMap(), Mt = new WeakMap(), Ln = new WeakMap(), Pt = new WeakMap(), ct = new WeakMap(), Ue = new WeakMap(), Dt = new WeakMap(), en = new WeakMap(), yn = new WeakMap(), qn = new WeakMap(), tn = new WeakMap(), ar = new WeakMap(), Vn = new WeakMap(), or = new WeakMap(), lr = new WeakMap(), nn = new WeakMap(), Pi = new WeakMap(), ge = new WeakSet(), po = function() { try { - L(this, ce, de(() => v(this, Fn).call(this, v(this, ee)))); - } catch (e) { - this.error(e); + V(this, ct, dt(() => v(this, Ln).call(this, v(this, tt)))); + } catch (t) { + this.error(t); } -}, ho = function() { - const e = v(this, Se).pending; - e && (L(this, Gt, de(() => e(v(this, ee)))), _n(() => { - var n = At(this, yt, cs).call(this); - L(this, ce, At(this, yt, ui).call(this, () => (sn.ensure(), de(() => v(this, Fn).call(this, n))))), v(this, Ze) > 0 ? At(this, yt, fi).call(this) : (Hn( +}, vo = function() { + const t = v(this, Mt).pending; + t && (V(this, Ue, dt(() => t(v(this, tt)))), xn(() => { + var n = be(this, ge, ds).call(this); + V(this, ct, be(this, ge, fi).call(this, () => (ln.ensure(), dt(() => v(this, Ln).call(this, n))))), v(this, tn) > 0 ? be(this, ge, ci).call(this) : (Yn( /** @type {Effect} */ - v(this, Gt), + v(this, Ue), () => { - L(this, Gt, null); + V(this, Ue, null); } ), this.is_pending = !1); })); -}, cs = function() { - var e = v(this, ee); - return this.is_pending && (L(this, vn, ie()), v(this, ee).before(v(this, vn)), e = v(this, vn)), e; +}, ds = function() { + var t = v(this, tt); + return this.is_pending && (V(this, yn, it()), v(this, tt).before(v(this, yn)), t = v(this, yn)), t; }, /** * @param {() => Effect | null} fn */ -ui = function(e) { - var n = j, r = B, i = se; - Ie(v(this, Ne)), ge(v(this, Ne)), dr(v(this, Ne).ctx); +fi = function(t) { + var n = J, r = B, i = st; + Lt(v(this, Pt)), gt(v(this, Pt)), hr(v(this, Pt).ctx); try { - return e(); + return t(); } catch (s) { - return ro(s), null; + return so(s), null; } finally { - Ie(n), ge(r), dr(i); + Lt(n), gt(r), hr(i); } -}, fi = function() { - const e = ( +}, ci = function() { + const t = ( /** @type {(anchor: Node) => void} */ - v(this, Se).pending + v(this, Mt).pending ); - v(this, ce) !== null && (L(this, Je, document.createDocumentFragment()), v(this, Je).append( + v(this, ct) !== null && (V(this, en, document.createDocumentFragment()), v(this, en).append( /** @type {TemplateNode} */ - v(this, vn) - ), Mo(v(this, ce), v(this, Je))), v(this, Gt) === null && L(this, Gt, de(() => e(v(this, ee)))); + v(this, yn) + ), Do(v(this, ct), v(this, en))), v(this, Ue) === null && V(this, Ue, dt(() => t(v(this, tt)))); }, /** * 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 * @param {1 | -1} d */ -hs = function(e) { +ps = function(t) { var n; if (!this.has_pending_snippet()) { - this.parent && At(n = this.parent, yt, hs).call(n, e); + this.parent && be(n = this.parent, ge, ps).call(n, t); return; } - if (L(this, Ze, v(this, Ze) + e), v(this, Ze) === 0) { + if (V(this, tn, v(this, tn) + t), v(this, tn) === 0) { this.is_pending = !1; + for (const r of v(this, or)) + de(r, ke), xt(r); for (const r of v(this, lr)) - pt(r, kt), $e(r); - for (const r of v(this, ur)) - pt(r, Ee), $e(r); - v(this, lr).clear(), v(this, ur).clear(), v(this, Gt) && Hn(v(this, Gt), () => { - L(this, Gt, null); - }), v(this, Je) && (v(this, ee).before(v(this, Je)), L(this, Je, null)); + de(r, $t), xt(r); + v(this, or).clear(), v(this, lr).clear(), v(this, Ue) && Yn(v(this, Ue), () => { + V(this, Ue, null); + }), v(this, en) && (v(this, tt).before(v(this, en)), V(this, en, null)); } }; -function Au(t, e, n, r) { +function Su(e, t, n, r) { const i = Yi; - var s = t.filter((c) => !c.settled); + var s = e.filter((c) => !c.settled); if (n.length === 0 && s.length === 0) { - r(e.map(i)); + r(t.map(i)); return; } - var a = U, o = ( + var a = K, o = ( /** @type {Effect} */ - j - ), l = Eu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; + J + ), l = Nu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; function f(c) { l(); try { r(c); - } catch (p) { - (o.f & rn) === 0 && pr(p, o); + } catch (d) { + (o.f & on) === 0 && dr(d, o); } - a == null || a.deactivate(), ds(); + a == null || a.deactivate(), vs(); } if (n.length === 0) { - u.then(() => f(e.map(i))); + u.then(() => f(t.map(i))); return; } - function h() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ Tu(c))).then((c) => f([...e.map(i), ...c])).catch((c) => pr(c, o)); + function p() { + l(), Promise.all(n.map((c) => /* @__PURE__ */ ku(c))).then((c) => f([...t.map(i), ...c])).catch((c) => dr(c, o)); } - u ? u.then(h) : h(); + u ? u.then(p) : p(); } -function Eu() { - var t = j, e = B, n = se, r = U; +function Nu() { + var e = J, t = B, n = st, r = K; return function(s = !0) { - Ie(t), ge(e), dr(n), s && (r == null || r.activate()); + Lt(e), gt(t), hr(n), s && (r == null || r.activate()); }; } -function ds() { - Ie(null), ge(null), dr(null); +function vs() { + Lt(null), gt(null), hr(null); } // @__NO_SIDE_EFFECTS__ -function Yi(t) { - var e = Nt | kt, n = B !== null && (B.f & Nt) !== 0 ? ( +function Yi(e) { + var t = Ne | ke, n = B !== null && (B.f & Ne) !== 0 ? ( /** @type {Derived} */ B ) : null; - return j !== null && (j.f |= Gn), { - ctx: se, + return J !== null && (J.f |= jn), { + ctx: st, deps: null, effects: null, - equals: Qa, - f: e, - fn: t, + equals: to, + f: t, + fn: e, reactions: null, rv: 0, v: ( /** @type {V} */ - Ct + Re ), wv: 0, - parent: n ?? j, + parent: n ?? J, ac: null }; } // @__NO_SIDE_EFFECTS__ -function Tu(t, e, n) { +function ku(e, t, n) { let r = ( /** @type {Effect | null} */ - j + J ); - r === null && nu(); + r === null && ou(); var i = ( /** @type {Boundary} */ r.b @@ -924,244 +924,244 @@ function Tu(t, e, n) { /** @type {Promise} */ /** @type {unknown} */ void 0 - ), a = Xn( + ), a = Un( /** @type {V} */ - Ct + Re ), o = !B, l = /* @__PURE__ */ new Map(); - return Fu(() => { - var p; - var u = Ua(); + return zu(() => { + var d; + var u = Ka(); s = u.promise; try { - Promise.resolve(t()).then(u.resolve, u.reject).then(() => { - f === U && f.committed && f.deactivate(), ds(); + Promise.resolve(e()).then(u.resolve, u.reject).then(() => { + f === K && f.committed && f.deactivate(), vs(); }); - } catch (m) { - u.reject(m), ds(); + } catch (y) { + u.reject(y), vs(); } var f = ( /** @type {Batch} */ - U + K ); if (o) { - var h = i.is_rendered(); - i.update_pending_count(1), f.increment(h), (p = l.get(f)) == null || p.reject(Sn), l.delete(f), l.set(f, u); + 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); } - const c = (m, $ = void 0) => { - if (f.activate(), $) - $ !== Sn && (a.f |= gn, vr(a, $)); + const c = (y, b = void 0) => { + if (f.activate(), b) + b !== kn && (a.f |= wn, pr(a, b)); else { - (a.f & gn) !== 0 && (a.f ^= gn), vr(a, m); - for (const [_, x] of l) { - if (l.delete(_), _ === f) break; - x.reject(Sn); + (a.f & wn) !== 0 && (a.f ^= wn), pr(a, y); + for (const [m, $] of l) { + if (l.delete(m), m === f) break; + $.reject(kn); } } - o && (i.update_pending_count(-1), f.decrement(h)); + o && (i.update_pending_count(-1), f.decrement(p)); }; - u.promise.then(c, (m) => c(null, m || "unknown")); - }), Pu(() => { + u.promise.then(c, (y) => c(null, y || "unknown")); + }), Lu(() => { for (const u of l.values()) - u.reject(Sn); + u.reject(kn); }), new Promise((u) => { - function f(h) { + function f(p) { function c() { - h === s ? u(a) : f(s); + p === s ? u(a) : f(s); } - h.then(c, c); + p.then(c, c); } f(s); }); } // @__NO_SIDE_EFFECTS__ -function cn(t) { - const e = /* @__PURE__ */ Yi(t); - return Po(e), e; +function vn(e) { + const t = /* @__PURE__ */ Yi(e); + return Oo(t), t; } // @__NO_SIDE_EFFECTS__ -function po(t) { - const e = /* @__PURE__ */ Yi(t); - return e.equals = to, e; -} -function Ru(t) { - var e = t.effects; - if (e !== null) { - t.effects = null; - for (var n = 0; n < e.length; n += 1) - Yt( +function go(e) { + const t = /* @__PURE__ */ Yi(e); + return t.equals = no, t; +} +function Mu(e) { + var t = e.effects; + if (t !== null) { + e.effects = null; + for (var n = 0; n < t.length; n += 1) + Ve( /** @type {Effect} */ - e[n] + t[n] ); } } -function Cu(t) { - for (var e = t.parent; e !== null; ) { - if ((e.f & Nt) === 0) - return (e.f & rn) === 0 ? ( +function Pu(e) { + for (var t = e.parent; t !== null; ) { + if ((t.f & Ne) === 0) + return (t.f & on) === 0 ? ( /** @type {Effect} */ - e + t ) : null; - e = e.parent; + t = t.parent; } return null; } -function Ms(t) { - var e, n = j; - Ie(Cu(t)); +function Ds(e) { + var t, n = J; + Lt(Pu(e)); try { - t.f &= ~Bn, Ru(t), e = Oo(t); + e.f &= ~Wn, Mu(e), t = qo(e); } finally { - Ie(n); + Lt(n); } - return e; + return t; } -function vo(t) { - var e = Ms(t); - if (!t.equals(e) && (t.wv = Io(), (!(U != null && U.is_fork) || t.deps === null) && (t.v = e, t.deps === null))) { - pt(t, Tt); +function _o(e) { + var t = Ds(e); + if (!e.equals(t) && (e.wv = Fo(), (!(K != null && K.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { + de(e, Ae); return; } - wn || (St !== null ? (Ds() || U != null && U.is_fork) && St.set(t, e) : ks(t)); + An || (Se !== null ? (Is() || K != null && K.is_fork) && Se.set(e, t) : Ps(e)); } -function Su(t) { - var e, n; - if (t.effects !== null) - for (const r of t.effects) - (r.teardown || r.ac) && ((e = r.teardown) == null || e.call(r), (n = r.ac) == null || n.abort(Sn), r.teardown = Kl, r.ac = null, Or(r, 0), Ls(r)); +function Du(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 = eu, r.ac = null, Fr(r, 0), Vs(r)); } -function go(t) { - if (t.effects !== null) - for (const e of t.effects) - e.teardown && gr(e); +function mo(e) { + if (e.effects !== null) + for (const t of e.effects) + t.teardown && vr(t); } -let ps = /* @__PURE__ */ new Set(); -const mn = /* @__PURE__ */ new Map(); -let _o = !1; -function Xn(t, e) { +let gs = /* @__PURE__ */ new Set(); +const bn = /* @__PURE__ */ new Map(); +let yo = !1; +function Un(e, t) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors - v: t, + v: e, reactions: null, - equals: Qa, + equals: to, rv: 0, wv: 0 }; return n; } // @__NO_SIDE_EFFECTS__ -function Et(t, e) { - const n = Xn(t); - return Po(n), n; +function $e(e, t) { + const n = Un(e); + return Oo(n), n; } // @__NO_SIDE_EFFECTS__ -function mo(t, e = !1, n = !0) { - const r = Xn(t); - return e || (r.equals = to), r; +function wo(e, t = !1, n = !0) { + const r = Un(e); + return t || (r.equals = no), r; } -function dt(t, e, n = !1) { +function he(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 - (!Ae || (B.f & oa) !== 0) && eo() && (B.f & (Nt | ln | Ns | oa)) !== 0 && (ve === null || !cr.call(ve, t)) && hu(); - let r = n ? kn(e) : e; - return vr(t, r); -} -function vr(t, e) { - if (!t.equals(e)) { - var n = t.v; - wn ? mn.set(t, e) : mn.set(t, n), t.v = e; - var r = sn.ensure(); - if (r.capture(t, n), (t.f & Nt) !== 0) { + (!bt || (B.f & ua) !== 0) && ro() && (B.f & (Ne | cn | Ms | ua)) !== 0 && (vt === null || !fr.call(vt, e)) && _u(); + let r = n ? Pn(t) : t; + return pr(e, r); +} +function pr(e, t) { + if (!e.equals(t)) { + var n = e.v; + An ? bn.set(e, t) : bn.set(e, n), e.v = t; + var r = ln.ensure(); + if (r.capture(e, n), (e.f & Ne) !== 0) { const i = ( /** @type {Derived} */ - t + e ); - (t.f & kt) !== 0 && Ms(i), ks(i); + (e.f & ke) !== 0 && Ds(i), Ps(i); } - t.wv = Io(), yo(t, kt), j !== null && (j.f & Tt) !== 0 && (j.f & (Te | xn)) === 0 && (fe === null ? qu([t]) : fe.push(t)), !r.is_fork && ps.size > 0 && !_o && Nu(); + e.wv = Fo(), xo(e, ke), J !== null && (J.f & Ae) !== 0 && (J.f & (At | En)) === 0 && (ft === null ? Bu([e]) : ft.push(e)), !r.is_fork && gs.size > 0 && !yo && Ou(); } - return e; + return t; } -function Nu() { - _o = !1; - for (const t of ps) - (t.f & Tt) !== 0 && pt(t, Ee), Gr(t) && gr(t); - ps.clear(); +function Ou() { + yo = !1; + for (const e of gs) + (e.f & Ae) !== 0 && de(e, $t), Gr(e) && vr(e); + gs.clear(); } -function Ir(t) { - dt(t, t.v + 1); +function Or(e) { + he(e, e.v + 1); } -function yo(t, e) { - var n = t.reactions; +function xo(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 & kt) === 0; - if (o && pt(s, e), (a & Nt) !== 0) { + var s = n[i], a = s.f, o = (a & ke) === 0; + if (o && de(s, t), (a & Ne) !== 0) { var l = ( /** @type {Derived} */ s ); - St == null || St.delete(l), (a & Bn) === 0 && (a & pe && (s.f |= Bn), yo(l, Ee)); - } else o && ((a & ln) !== 0 && we !== null && we.add( + Se == null || Se.delete(l), (a & Wn) === 0 && (a & pt && (s.f |= Wn), xo(l, $t)); + } else o && ((a & cn) !== 0 && mt !== null && mt.add( /** @type {Effect} */ s - ), $e( + ), xt( /** @type {Effect} */ s )); } } -function kn(t) { - if (typeof t != "object" || t === null || Pr in t) - return t; - const e = Wa(t); - if (e !== Ul && e !== Gl) - return t; - var n = /* @__PURE__ */ new Map(), r = Xa(t), i = /* @__PURE__ */ Et(0), s = Yn, a = (o) => { - if (Yn === s) +function Pn(e) { + if (typeof e != "object" || e === null || Pr in e) + return e; + const t = Ga(e); + if (t !== Zl && t !== Ql) + return e; + var n = /* @__PURE__ */ new Map(), r = Ua(e), i = /* @__PURE__ */ $e(0), s = Bn, a = (o) => { + if (Bn === s) return o(); - var l = B, u = Yn; - ge(null), ca(s); + var l = B, u = Bn; + gt(null), da(s); var f = o(); - return ge(l), ca(u), f; + return gt(l), da(u), f; }; - return r && n.set("length", /* @__PURE__ */ Et( + return r && n.set("length", /* @__PURE__ */ $e( /** @type {any[]} */ - t.length + e.length )), new Proxy( /** @type {any} */ - t, + e, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && fu(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && vu(); var f = n.get(l); return f === void 0 ? a(() => { - var h = /* @__PURE__ */ Et(u.value); - return n.set(l, h), h; - }) : dt(f, u.value, !0), !0; + var p = /* @__PURE__ */ $e(u.value); + return n.set(l, p), p; + }) : he(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__ */ Et(Ct)); - n.set(l, f), Ir(i); + const f = a(() => /* @__PURE__ */ $e(Re)); + n.set(l, f), Or(i); } } else - dt(u, Ct), Ir(i); + he(u, Re), Or(i); return !0; }, get(o, l, u) { - var p; + var d; if (l === Pr) - return t; - var f = n.get(l), h = l in o; - if (f === void 0 && (!h || (p = Vn(o, l)) != null && p.writable) && (f = a(() => { - var m = kn(h ? o[l] : Ct), $ = /* @__PURE__ */ Et(m); - return $; + 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] : Re), b = /* @__PURE__ */ $e(y); + return b; }), n.set(l, f)), f !== void 0) { - var c = b(f); - return c === Ct ? void 0 : c; + var c = x(f); + return c === Re ? void 0 : c; } return Reflect.get(o, l, u); }, @@ -1169,10 +1169,10 @@ function kn(t) { var u = Reflect.getOwnPropertyDescriptor(o, l); if (u && "value" in u) { var f = n.get(l); - f && (u.value = b(f)); + f && (u.value = x(f)); } else if (u === void 0) { - var h = n.get(l), c = h == null ? void 0 : h.v; - if (h !== void 0 && c !== Ct) + var p = n.get(l), c = p == null ? void 0 : p.v; + if (p !== void 0 && c !== Re) return { enumerable: !0, configurable: !0, @@ -1186,188 +1186,188 @@ function kn(t) { var c; if (l === Pr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== Ct || Reflect.has(o, l); - if (u !== void 0 || j !== null && (!f || (c = Vn(o, l)) != null && c.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== Re || Reflect.has(o, l); + if (u !== void 0 || J !== null && (!f || (c = Hn(o, l)) != null && c.writable)) { u === void 0 && (u = a(() => { - var p = f ? kn(o[l]) : Ct, m = /* @__PURE__ */ Et(p); - return m; + var d = f ? Pn(o[l]) : Re, y = /* @__PURE__ */ $e(d); + return y; }), n.set(l, u)); - var h = b(u); - if (h === Ct) + var p = x(u); + if (p === Re) return !1; } return f; }, set(o, l, u, f) { - var S; - var h = n.get(l), c = l in o; + var M; + var p = n.get(l), c = l in o; if (r && l === "length") - for (var p = u; p < /** @type {Source} */ - h.v; p += 1) { - var m = n.get(p + ""); - m !== void 0 ? dt(m, Ct) : p in o && (m = a(() => /* @__PURE__ */ Et(Ct)), n.set(p + "", m)); + for (var d = u; d < /** @type {Source} */ + p.v; d += 1) { + var y = n.get(d + ""); + y !== void 0 ? he(y, Re) : d in o && (y = a(() => /* @__PURE__ */ $e(Re)), n.set(d + "", y)); } - if (h === void 0) - (!c || (S = Vn(o, l)) != null && S.writable) && (h = a(() => /* @__PURE__ */ Et(void 0)), dt(h, kn(u)), n.set(l, h)); + if (p === void 0) + (!c || (M = Hn(o, l)) != null && M.writable) && (p = a(() => /* @__PURE__ */ $e(void 0)), he(p, Pn(u)), n.set(l, p)); else { - c = h.v !== Ct; - var $ = a(() => kn(u)); - dt(h, $); + c = p.v !== Re; + var b = a(() => Pn(u)); + he(p, b); } - var _ = Reflect.getOwnPropertyDescriptor(o, l); - if (_ != null && _.set && _.set.call(f, u), !c) { + var m = Reflect.getOwnPropertyDescriptor(o, l); + if (m != null && m.set && m.set.call(f, u), !c) { if (r && typeof l == "string") { - var x = ( + var $ = ( /** @type {Source} */ n.get("length") - ), F = Number(l); - Number.isInteger(F) && F >= x.v && dt(x, F + 1); + ), D = Number(l); + Number.isInteger(D) && D >= $.v && he($, D + 1); } - Ir(i); + Or(i); } return !0; }, ownKeys(o) { - b(i); - var l = Reflect.ownKeys(o).filter((h) => { - var c = n.get(h); - return c === void 0 || c.v !== Ct; + x(i); + var l = Reflect.ownKeys(o).filter((p) => { + var c = n.get(p); + return c === void 0 || c.v !== Re; }); for (var [u, f] of n) - f.v !== Ct && !(u in o) && l.push(u); + f.v !== Re && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - cu(); + gu(); } } ); } -var ua, wo, xo, bo; -function vs() { - if (ua === void 0) { - ua = window, wo = /Firefox/.test(navigator.userAgent); - var t = Element.prototype, e = Node.prototype, n = Text.prototype; - xo = Vn(e, "firstChild").get, bo = Vn(e, "nextSibling").get, aa(t) && (t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__style = void 0, t.__e = void 0), aa(n) && (n.__t = void 0); +var ca, bo, $o, Ao; +function _s() { + if (ca === void 0) { + ca = window, bo = /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); } } -function ie(t = "") { - return document.createTextNode(t); +function it(e = "") { + return document.createTextNode(e); } // @__NO_SIDE_EFFECTS__ -function an(t) { +function un(e) { return ( /** @type {TemplateNode | null} */ - xo.call(t) + $o.call(e) ); } // @__NO_SIDE_EFFECTS__ -function Oe(t) { +function Vt(e) { return ( /** @type {TemplateNode | null} */ - bo.call(t) + Ao.call(e) ); } -function Ut(t, e) { - if (!G) - return /* @__PURE__ */ an(t); - var n = /* @__PURE__ */ an(X); +function We(e, t) { + if (!j) + return /* @__PURE__ */ un(e); + var n = /* @__PURE__ */ un(X); if (n === null) - n = X.appendChild(ie()); - else if (e && n.nodeType !== Ur) { - var r = ie(); - return n == null || n.before(r), Ht(r), r; + n = X.appendChild(it()); + else if (t && n.nodeType !== Ur) { + var r = it(); + return n == null || n.before(r), qe(r), r; } - return e && zi( + return t && Bi( /** @type {Text} */ n - ), Ht(n), n; + ), qe(n), n; } -function dn(t, e = !1) { - if (!G) { - var n = /* @__PURE__ */ an(t); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Oe(n) : n; +function _n(e, t = !1) { + if (!j) { + var n = /* @__PURE__ */ un(e); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Vt(n) : n; } - if (e) { + if (t) { if ((X == null ? void 0 : X.nodeType) !== Ur) { - var r = ie(); - return X == null || X.before(r), Ht(r), r; + var r = it(); + return X == null || X.before(r), qe(r), r; } - zi( + Bi( /** @type {Text} */ X ); } return X; } -function Qt(t, e = 1, n = !1) { - let r = G ? X : t; - for (var i; e--; ) +function Qe(e, t = 1, n = !1) { + let r = j ? X : e; + for (var i; t--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Oe(r); - if (!G) + /* @__PURE__ */ Vt(r); + if (!j) return r; if (n) { if ((r == null ? void 0 : r.nodeType) !== Ur) { - var s = ie(); - return r === null ? i == null || i.after(s) : r.before(s), Ht(s), s; + var s = it(); + return r === null ? i == null || i.after(s) : r.before(s), qe(s), s; } - zi( + Bi( /** @type {Text} */ r ); } - return Ht(r), r; + return qe(r), r; } -function $o(t) { - t.textContent = ""; +function Eo(e) { + e.textContent = ""; } -function Ao() { +function To() { return !1; } -function Ps(t, e, n) { +function Os(e, t, n) { return ( /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ - document.createElementNS(Ba, t, void 0) + document.createElementNS(Wa, e, void 0) ); } -function zi(t) { +function Bi(e) { if ( /** @type {string} */ - t.nodeValue.length < 65536 + e.nodeValue.length < 65536 ) return; - let e = t.nextSibling; - for (; e !== null && e.nodeType === Ur; ) - e.remove(), t.nodeValue += /** @type {string} */ - e.nodeValue, e = t.nextSibling; -} -function Eo(t) { - var e = B, n = j; - ge(null), Ie(null); + let t = e.nextSibling; + for (; t !== null && t.nodeType === Ur; ) + t.remove(), e.nodeValue += /** @type {string} */ + t.nodeValue, t = e.nextSibling; +} +function Co(e) { + var t = B, n = J; + gt(null), Lt(null); try { - return t(); + return e(); } finally { - ge(e), Ie(n); + gt(t), Lt(n); } } -function ku(t) { - j === null && (B === null && au(), su()), wn && iu(); +function Iu(e) { + J === null && (B === null && cu(), fu()), An && uu(); } -function Mu(t, e) { - var n = e.last; - n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); +function Fu(e, t) { + var n = t.last; + n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); } -function Le(t, e, n) { - var r = j; - r !== null && (r.f & re) !== 0 && (t |= re); +function zt(e, t, n) { + var r = J; + r !== null && (r.f & rt) !== 0 && (e |= rt); var i = { - ctx: se, + ctx: st, deps: null, nodes: null, - f: t | kt | pe, + f: e | ke | pt, first: null, - fn: e, + fn: t, last: null, next: null, parent: r, @@ -1379,14 +1379,14 @@ function Le(t, e, n) { }; if (n) try { - gr(i); + vr(i); } catch (o) { - throw Yt(i), o; + throw Ve(i), o; } - else e !== null && $e(i); + else t !== null && xt(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 & Gn) === 0 && (s = s.first, (t & ln) !== 0 && (t & hr) !== 0 && s !== null && (s.f |= hr)), s !== null && (s.parent = r, r !== null && Mu(s, r), B !== null && (B.f & Nt) !== 0 && (t & xn) === 0)) { + (s.f & jn) === 0 && (s = s.first, (e & cn) !== 0 && (e & cr) !== 0 && s !== null && (s.f |= cr)), s !== null && (s.parent = r, r !== null && Fu(s, r), B !== null && (B.f & Ne) !== 0 && (e & En) === 0)) { var a = ( /** @type {Derived} */ B @@ -1395,127 +1395,127 @@ function Le(t, e, n) { } return i; } -function Ds() { - return B !== null && !Ae; +function Is() { + return B !== null && !bt; } -function Pu(t) { - const e = Le(Fi, null, !1); - return pt(e, Tt), e.teardown = t, e; +function Lu(e) { + const t = zt(Fi, null, !1); + return de(t, Ae), t.teardown = e, t; } -function Is(t) { - ku(); - var e = ( +function Fs(e) { + Iu(); + var t = ( /** @type {Effect} */ - j.f - ), n = !B && (e & Te) !== 0 && (e & yr) === 0; + J.f + ), n = !B && (t & At) !== 0 && (t & mr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - se + st ); - (r.e ?? (r.e = [])).push(t); + (r.e ?? (r.e = [])).push(e); } else - return To(t); + return Ro(e); } -function To(t) { - return Le(Fr | Zl, t, !1); +function Ro(e) { + return zt(Ir | ru, e, !1); } -function Du(t) { - sn.ensure(); - const e = Le(xn | Gn, t, !0); +function qu(e) { + ln.ensure(); + const t = zt(En | jn, e, !0); return () => { - Yt(e); + Ve(t); }; } -function Iu(t) { - sn.ensure(); - const e = Le(xn | Gn, t, !0); +function Vu(e) { + ln.ensure(); + const t = zt(En | jn, e, !0); return (n = {}) => new Promise((r) => { - n.outro ? Hn(e, () => { - Yt(e), r(void 0); - }) : (Yt(e), r(void 0)); + n.outro ? Yn(t, () => { + Ve(t), r(void 0); + }) : (Ve(t), r(void 0)); }); } -function Ro(t) { - return Le(Fr, t, !1); +function So(e) { + return zt(Ir, e, !1); } -function Fu(t) { - return Le(Ns | Gn, t, !0); +function zu(e) { + return zt(Ms | jn, e, !0); } -function Fs(t, e = 0) { - return Le(Fi | e, t, !0); +function Ls(e, t = 0) { + return zt(Fi | t, e, !0); } -function Ke(t, e = [], n = [], r = []) { - Au(r, e, n, (i) => { - Le(Fi, () => t(...i.map(b)), !0); +function Zt(e, t = [], n = [], r = []) { + Su(r, t, n, (i) => { + zt(Fi, () => e(...i.map(x)), !0); }); } -function Os(t, e = 0) { - var n = Le(ln | e, t, !0); +function qs(e, t = 0) { + var n = zt(cn | t, e, !0); return n; } -function de(t) { - return Le(Te | Gn, t, !0); +function dt(e) { + return zt(At | jn, e, !0); } -function Co(t) { - var e = t.teardown; - if (e !== null) { - const n = wn, r = B; - fa(!0), ge(null); +function No(e) { + var t = e.teardown; + if (t !== null) { + const n = An, r = B; + ha(!0), gt(null); try { - e.call(null); + t.call(null); } finally { - fa(n), ge(r); + ha(n), gt(r); } } } -function Ls(t, e = !1) { - var n = t.first; - for (t.first = t.last = null; n !== null; ) { +function Vs(e, t = !1) { + var n = e.first; + for (e.first = e.last = null; n !== null; ) { const i = n.ac; - i !== null && Eo(() => { - i.abort(Sn); + i !== null && Co(() => { + i.abort(kn); }); var r = n.next; - (n.f & xn) !== 0 ? n.parent = null : Yt(n, e), n = r; + (n.f & En) !== 0 ? n.parent = null : Ve(n, t), n = r; } } -function Ou(t) { - for (var e = t.first; e !== null; ) { - var n = e.next; - (e.f & Te) === 0 && Yt(e), e = n; +function Hu(e) { + for (var t = e.first; t !== null; ) { + var n = t.next; + (t.f & At) === 0 && Ve(t), t = n; } } -function Yt(t, e = !0) { +function Ve(e, t = !0) { var n = !1; - (e || (t.f & ja) !== 0) && t.nodes !== null && t.nodes.end !== null && (Lu( - t.nodes.start, + (t || (e.f & Za) !== 0) && e.nodes !== null && e.nodes.end !== null && (Yu( + e.nodes.start, /** @type {TemplateNode} */ - t.nodes.end - ), n = !0), Ls(t, e && !n), Or(t, 0), pt(t, rn); - var r = t.nodes && t.nodes.t; + e.nodes.end + ), n = !0), Vs(e, t && !n), Fr(e, 0), de(e, on); + var r = e.nodes && e.nodes.t; if (r !== null) for (const s of r) s.stop(); - Co(t); - var i = t.parent; - i !== null && i.first !== null && So(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes = t.ac = null; + No(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; } -function Lu(t, e) { - for (; t !== null; ) { - var n = t === e ? null : /* @__PURE__ */ Oe(t); - t.remove(), t = n; +function Yu(e, t) { + for (; e !== null; ) { + var n = e === t ? null : /* @__PURE__ */ Vt(e); + e.remove(), e = n; } } -function So(t) { - var e = t.parent, n = t.prev, r = t.next; - n !== null && (n.next = r), r !== null && (r.prev = n), e !== null && (e.first === t && (e.first = r), e.last === t && (e.last = n)); +function ko(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 Hn(t, e, n = !0) { +function Yn(e, t, n = !0) { var r = []; - No(t, r, !0); + Mo(e, r, !0); var i = () => { - n && Yt(t), e && e(); + n && Ve(e), t && t(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1524,559 +1524,559 @@ function Hn(t, e, n = !0) { } else i(); } -function No(t, e, n) { - if ((t.f & re) === 0) { - t.f ^= re; - var r = t.nodes && t.nodes.t; +function Mo(e, t, n) { + if ((e.f & rt) === 0) { + e.f ^= rt; + var r = e.nodes && e.nodes.t; if (r !== null) for (const o of r) - (o.is_global || n) && e.push(o); - for (var i = t.first; i !== null; ) { - var s = i.next, a = (i.f & hr) !== 0 || // If this is a branch effect without a block effect parent, + (o.is_global || n) && t.push(o); + for (var i = e.first; i !== null; ) { + var s = i.next, a = (i.f & cr) !== 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 & Te) !== 0 && (t.f & ln) !== 0; - No(i, e, a ? n : !1), i = s; + (i.f & At) !== 0 && (e.f & cn) !== 0; + Mo(i, t, a ? n : !1), i = s; } } } -function qs(t) { - ko(t, !0); +function zs(e) { + Po(e, !0); } -function ko(t, e) { - if ((t.f & re) !== 0) { - t.f ^= re, (t.f & Tt) === 0 && (pt(t, kt), $e(t)); - for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & hr) !== 0 || (n.f & Te) !== 0; - ko(n, i ? e : !1), n = r; +function Po(e, t) { + if ((e.f & rt) !== 0) { + e.f ^= rt, (e.f & Ae) === 0 && (de(e, ke), xt(e)); + for (var n = e.first; n !== null; ) { + var r = n.next, i = (n.f & cr) !== 0 || (n.f & At) !== 0; + Po(n, i ? t : !1), n = r; } - var s = t.nodes && t.nodes.t; + var s = e.nodes && e.nodes.t; if (s !== null) for (const a of s) - (a.is_global || e) && a.in(); + (a.is_global || t) && a.in(); } } -function Mo(t, e) { - if (t.nodes) - for (var n = t.nodes.start, r = t.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Oe(n); - e.append(n), n = i; +function Do(e, t) { + if (e.nodes) + for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { + var i = n === r ? null : /* @__PURE__ */ Vt(n); + t.append(n), n = i; } } -let ci = !1, wn = !1; -function fa(t) { - wn = t; +let hi = !1, An = !1; +function ha(e) { + An = e; } -let B = null, Ae = !1; -function ge(t) { - B = t; +let B = null, bt = !1; +function gt(e) { + B = e; } -let j = null; -function Ie(t) { - j = t; +let J = null; +function Lt(e) { + J = e; } -let ve = null; -function Po(t) { - B !== null && (ve === null ? ve = [t] : ve.push(t)); +let vt = null; +function Oo(e) { + B !== null && (vt === null ? vt = [e] : vt.push(e)); } -let Jt = null, te = 0, fe = null; -function qu(t) { - fe = t; +let je = null, et = 0, ft = null; +function Bu(e) { + ft = e; } -let Do = 1, Mn = 0, Yn = Mn; -function ca(t) { - Yn = t; +let Io = 1, Dn = 0, Bn = Dn; +function da(e) { + Bn = e; } -function Io() { - return ++Do; +function Fo() { + return ++Io; } -function Gr(t) { - var e = t.f; - if ((e & kt) !== 0) +function Gr(e) { + var t = e.f; + if ((t & ke) !== 0) return !0; - if (e & Nt && (t.f &= ~Bn), (e & Ee) !== 0) { + if (t & Ne && (e.f &= ~Wn), (t & $t) !== 0) { for (var n = ( /** @type {Value[]} */ - t.deps + e.deps ), r = n.length, i = 0; i < r; i++) { var s = n[i]; if (Gr( /** @type {Derived} */ s - ) && vo( + ) && _o( /** @type {Derived} */ s - ), s.wv > t.wv) + ), s.wv > e.wv) return !0; } - (e & pe) !== 0 && // During time traveling we don't want to reset the status so that + (t & pt) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - St === null && pt(t, Tt); + Se === null && de(e, Ae); } return !1; } -function Fo(t, e, n = !0) { - var r = t.reactions; - if (r !== null && !(ve !== null && cr.call(ve, t))) +function Lo(e, t, n = !0) { + var r = e.reactions; + if (r !== null && !(vt !== null && fr.call(vt, e))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Nt) !== 0 ? Fo( + (s.f & Ne) !== 0 ? Lo( /** @type {Derived} */ s, - e, + t, !1 - ) : e === s && (n ? pt(s, kt) : (s.f & Tt) !== 0 && pt(s, Ee), $e( + ) : t === s && (n ? de(s, ke) : (s.f & Ae) !== 0 && de(s, $t), xt( /** @type {Effect} */ s )); } } -function Oo(t) { - var $; - var e = Jt, n = te, r = fe, i = B, s = ve, a = se, o = Ae, l = Yn, u = t.f; - Jt = /** @type {null | Value[]} */ - null, te = 0, fe = null, B = (u & (Te | xn)) === 0 ? t : null, ve = null, dr(t.ctx), Ae = !1, Yn = ++Mn, t.ac !== null && (Eo(() => { - t.ac.abort(Sn); - }), t.ac = null); +function qo(e) { + var b; + var t = je, n = et, r = ft, i = B, s = vt, a = st, o = bt, l = Bn, u = e.f; + je = /** @type {null | Value[]} */ + null, et = 0, ft = null, B = (u & (At | En)) === 0 ? e : null, vt = null, hr(e.ctx), bt = !1, Bn = ++Dn, e.ac !== null && (Co(() => { + e.ac.abort(kn); + }), e.ac = null); try { - t.f |= as; + e.f |= ls; var f = ( /** @type {Function} */ - t.fn - ), h = f(); - t.f |= yr; - var c = t.deps, p = U == null ? void 0 : U.is_fork; - if (Jt !== null) { - var m; - if (p || Or(t, te), c !== null && te > 0) - for (c.length = te + Jt.length, m = 0; m < Jt.length; m++) - c[te + m] = Jt[m]; + e.fn + ), p = f(); + e.f |= mr; + var c = e.deps, d = K == null ? void 0 : K.is_fork; + if (je !== null) { + var y; + if (d || Fr(e, et), c !== null && et > 0) + for (c.length = et + je.length, y = 0; y < je.length; y++) + c[et + y] = je[y]; else - t.deps = c = Jt; - if (Ds() && (t.f & pe) !== 0) - for (m = te; m < c.length; m++) - (($ = c[m]).reactions ?? ($.reactions = [])).push(t); - } else !p && c !== null && te < c.length && (Or(t, te), c.length = te); - if (eo() && fe !== null && !Ae && c !== null && (t.f & (Nt | Ee | kt)) === 0) - for (m = 0; m < /** @type {Source[]} */ - fe.length; m++) - Fo( - fe[m], + e.deps = c = je; + if (Is() && (e.f & pt) !== 0) + for (y = et; y < c.length; y++) + ((b = c[y]).reactions ?? (b.reactions = [])).push(e); + } else !d && c !== null && et < c.length && (Fr(e, et), c.length = et); + if (ro() && ft !== null && !bt && c !== null && (e.f & (Ne | $t | ke)) === 0) + for (y = 0; y < /** @type {Source[]} */ + ft.length; y++) + Lo( + ft[y], /** @type {Effect} */ - t + e ); - if (i !== null && i !== t) { - if (Mn++, i.deps !== null) - for (let _ = 0; _ < n; _ += 1) - i.deps[_].rv = Mn; - if (e !== null) - for (const _ of e) - _.rv = Mn; - fe !== null && (r === null ? r = fe : r.push(.../** @type {Source[]} */ - fe)); + if (i !== null && i !== e) { + if (Dn++, i.deps !== null) + for (let m = 0; m < n; m += 1) + i.deps[m].rv = Dn; + if (t !== null) + for (const m of t) + m.rv = Dn; + ft !== null && (r === null ? r = ft : r.push(.../** @type {Source[]} */ + ft)); } - return (t.f & gn) !== 0 && (t.f ^= gn), h; - } catch (_) { - return ro(_); + return (e.f & wn) !== 0 && (e.f ^= wn), p; + } catch (m) { + return so(m); } finally { - t.f ^= as, Jt = e, te = n, fe = r, B = i, ve = s, dr(a), Ae = o, Yn = l; + e.f ^= ls, je = t, et = n, ft = r, B = i, vt = s, hr(a), bt = o, Bn = l; } } -function Vu(t, e) { - let n = e.reactions; +function Xu(e, t) { + let n = t.reactions; if (n !== null) { - var r = Xl.call(n, t); + var r = jl.call(n, e); if (r !== -1) { var i = n.length - 1; - i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); + i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop()); } } - if (n === null && (e.f & Nt) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (t.f & Ne) !== 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 - (Jt === null || !cr.call(Jt, e))) { + (je === null || !fr.call(je, t))) { var s = ( /** @type {Derived} */ - e + t ); - (s.f & pe) !== 0 && (s.f ^= pe, s.f &= ~Bn), ks(s), Su(s), Or(s, 0); + (s.f & pt) !== 0 && (s.f ^= pt, s.f &= ~Wn), Ps(s), Du(s), Fr(s, 0); } } -function Or(t, e) { - var n = t.deps; +function Fr(e, t) { + var n = e.deps; if (n !== null) - for (var r = e; r < n.length; r++) - Vu(t, n[r]); -} -function gr(t) { - var e = t.f; - if ((e & rn) === 0) { - pt(t, Tt); - var n = j, r = ci; - j = t, ci = !0; + for (var r = t; r < n.length; r++) + Xu(e, n[r]); +} +function vr(e) { + var t = e.f; + if ((t & on) === 0) { + de(e, Ae); + var n = J, r = hi; + J = e, hi = !0; try { - (e & (ln | Ga)) !== 0 ? Ou(t) : Ls(t), Co(t); - var i = Oo(t); - t.teardown = typeof i == "function" ? i : null, t.wv = Do; + (t & (cn | ja)) !== 0 ? Hu(e) : Vs(e), No(e); + var i = qo(e); + e.teardown = typeof i == "function" ? i : null, e.wv = Io; var s; - ss && gu && (t.f & kt) !== 0 && t.deps; + os && xu && (e.f & ke) !== 0 && e.deps; } finally { - ci = r, j = n; + hi = r, J = n; } } } -function b(t) { - var e = t.f, n = (e & Nt) !== 0; - if (B !== null && !Ae) { - var r = j !== null && (j.f & rn) !== 0; - if (!r && (ve === null || !cr.call(ve, t))) { +function x(e) { + var t = e.f, n = (t & Ne) !== 0; + if (B !== null && !bt) { + var r = J !== null && (J.f & on) !== 0; + if (!r && (vt === null || !fr.call(vt, e))) { var i = B.deps; - if ((B.f & as) !== 0) - t.rv < Mn && (t.rv = Mn, Jt === null && i !== null && i[te] === t ? te++ : Jt === null ? Jt = [t] : Jt.push(t)); + if ((B.f & ls) !== 0) + e.rv < Dn && (e.rv = Dn, je === null && i !== null && i[et] === e ? et++ : je === null ? je = [e] : je.push(e)); else { - (B.deps ?? (B.deps = [])).push(t); - var s = t.reactions; - s === null ? t.reactions = [B] : cr.call(s, B) || s.push(B); + (B.deps ?? (B.deps = [])).push(e); + var s = e.reactions; + s === null ? e.reactions = [B] : fr.call(s, B) || s.push(B); } } } - if (wn && mn.has(t)) - return mn.get(t); + if (An && bn.has(e)) + return bn.get(e); if (n) { var a = ( /** @type {Derived} */ - t + e ); - if (wn) { + if (An) { var o = a.v; - return ((a.f & Tt) === 0 && a.reactions !== null || qo(a)) && (o = Ms(a)), mn.set(a, o), o; + return ((a.f & Ae) === 0 && a.reactions !== null || zo(a)) && (o = Ds(a)), bn.set(a, o), o; } - var l = (a.f & pe) === 0 && !Ae && B !== null && (ci || (B.f & pe) !== 0), u = (a.f & yr) === 0; - Gr(a) && (l && (a.f |= pe), vo(a)), l && !u && (go(a), Lo(a)); - } - if (St != null && St.has(t)) - return St.get(t); - if ((t.f & gn) !== 0) - throw t.v; - return t.v; -} -function Lo(t) { - if (t.f |= pe, t.deps !== null) - for (const e of t.deps) - (e.reactions ?? (e.reactions = [])).push(t), (e.f & Nt) !== 0 && (e.f & pe) === 0 && (go( + var l = (a.f & pt) === 0 && !bt && B !== null && (hi || (B.f & pt) !== 0), u = (a.f & mr) === 0; + Gr(a) && (l && (a.f |= pt), _o(a)), l && !u && (mo(a), Vo(a)); + } + if (Se != null && Se.has(e)) + return Se.get(e); + if ((e.f & wn) !== 0) + throw e.v; + return e.v; +} +function Vo(e) { + if (e.f |= pt, e.deps !== null) + for (const t of e.deps) + (t.reactions ?? (t.reactions = [])).push(e), (t.f & Ne) !== 0 && (t.f & pt) === 0 && (mo( /** @type {Derived} */ - e - ), Lo( + t + ), Vo( /** @type {Derived} */ - e + t )); } -function qo(t) { - if (t.v === Ct) return !0; - if (t.deps === null) return !1; - for (const e of t.deps) - if (mn.has(e) || (e.f & Nt) !== 0 && qo( +function zo(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 & Ne) !== 0 && zo( /** @type {Derived} */ - e + t )) return !0; return !1; } -function Bi(t) { - var e = Ae; +function Xi(e) { + var t = bt; try { - return Ae = !0, t(); + return bt = !0, e(); } finally { - Ae = e; + bt = t; } } -const Vo = /* @__PURE__ */ new Set(), gs = /* @__PURE__ */ new Set(); -function Hu(t) { - for (var e = 0; e < t.length; e++) - Vo.add(t[e]); - for (var n of gs) - n(t); +const Ho = /* @__PURE__ */ new Set(), ms = /* @__PURE__ */ new Set(); +function Wu(e) { + for (var t = 0; t < e.length; t++) + Ho.add(e[t]); + for (var n of ms) + n(e); } -let ha = null; -function da(t) { - var _; - var e = this, n = ( +let pa = null; +function va(e) { + var m; + var t = this, n = ( /** @type {Node} */ - e.ownerDocument - ), r = t.type, i = ((_ = t.composedPath) == null ? void 0 : _.call(t)) || [], s = ( + t.ownerDocument + ), r = e.type, i = ((m = e.composedPath) == null ? void 0 : m.call(e)) || [], s = ( /** @type {null | Element} */ - i[0] || t.target + i[0] || e.target ); - ha = t; - var a = 0, o = ha === t && t.__root; + pa = e; + var a = 0, o = pa === e && e.__root; if (o) { var l = i.indexOf(o); - if (l !== -1 && (e === document || e === /** @type {any} */ + if (l !== -1 && (t === document || t === /** @type {any} */ window)) { - t.__root = e; + e.__root = t; return; } - var u = i.indexOf(e); + var u = i.indexOf(t); if (u === -1) return; l <= u && (a = l); } if (s = /** @type {Element} */ - i[a] || t.target, s !== e) { - bi(t, "currentTarget", { + i[a] || e.target, s !== t) { + $i(e, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = B, h = j; - ge(null), Ie(null); + var f = B, p = J; + gt(null), Lt(null); try { - for (var c, p = []; s !== null; ) { - var m = s.assignedSlot || s.parentNode || /** @type {any} */ + for (var c, d = []; s !== null; ) { + var y = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { - var $ = s["__" + r]; - $ != null && (!/** @type {any} */ + var b = s["__" + r]; + b != 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 - t.target === s) && $.call(s, t); - } catch (x) { - c ? p.push(x) : c = x; + e.target === s) && b.call(s, e); + } catch ($) { + c ? d.push($) : c = $; } - if (t.cancelBubble || m === e || m === null) + if (e.cancelBubble || y === t || y === null) break; - s = m; + s = y; } if (c) { - for (let x of p) + for (let $ of d) queueMicrotask(() => { - throw x; + throw $; }); throw c; } } finally { - t.__root = e, delete t.currentTarget, ge(f), Ie(h); + e.__root = t, delete e.currentTarget, gt(f), Lt(p); } } } -var Ha, Ya; -const Qi = (Ya = (Ha = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ha.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ya.createPolicy( +var Ya, Ba; +const ts = (Ba = (Ya = globalThis == null ? void 0 : globalThis.window) == null ? void 0 : Ya.trustedTypes) == null ? void 0 : /* @__PURE__ */ Ba.createPolicy( "svelte-trusted-html", { /** @param {string} html */ - createHTML: (t) => t + createHTML: (e) => e } ); -function Yu(t) { +function Uu(e) { return ( /** @type {string} */ - (Qi == null ? void 0 : Qi.createHTML(t)) ?? t + (ts == null ? void 0 : ts.createHTML(e)) ?? e ); } -function Ho(t, e = !1) { - var n = Ps("template"); - return t = t.replaceAll("", ""), n.innerHTML = e ? Yu(t) : t, n.content; +function Yo(e, t = !1) { + var n = Os("template"); + return e = e.replaceAll("", ""), n.innerHTML = t ? Uu(e) : e, n.content; } -function yn(t, e) { +function $n(e, t) { var n = ( /** @type {Effect} */ - j + J ); - n.nodes === null && (n.nodes = { start: t, end: e, a: null, t: null }); + n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function qe(t, e) { - var n = (e & zl) !== 0, r = (e & Bl) !== 0, i, s = !t.startsWith(""); +function Ht(e, t) { + var n = (t & Gl) !== 0, r = (t & Kl) !== 0, i, s = !e.startsWith(""); return () => { - if (G) - return yn(X, null), X; - i === void 0 && (i = Ho(s ? t : "" + t, !0), n || (i = /** @type {TemplateNode} */ - /* @__PURE__ */ an(i))); + if (j) + return $n(X, null), X; + i === void 0 && (i = Yo(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ + /* @__PURE__ */ un(i))); var a = ( /** @type {TemplateNode} */ - r || wo ? document.importNode(i, !0) : i.cloneNode(!0) + r || bo ? document.importNode(i, !0) : i.cloneNode(!0) ); if (n) { var o = ( /** @type {TemplateNode} */ - /* @__PURE__ */ an(a) + /* @__PURE__ */ un(a) ), l = ( /** @type {TemplateNode} */ a.lastChild ); - yn(o, l); + $n(o, l); } else - yn(a, a); + $n(a, a); return a; }; } // @__NO_SIDE_EFFECTS__ -function zu(t, e, n = "svg") { - var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; +function Gu(e, t, n = "svg") { + var r = !e.startsWith(""), i = `<${n}>${r ? e : "" + e}`, s; return () => { - if (G) - return yn(X, null), X; + if (j) + return $n(X, null), X; if (!s) { var a = ( /** @type {DocumentFragment} */ - Ho(i, !0) + Yo(i, !0) ), o = ( /** @type {Element} */ - /* @__PURE__ */ an(a) + /* @__PURE__ */ un(a) ); s = /** @type {Element} */ - /* @__PURE__ */ an(o); + /* @__PURE__ */ un(o); } var l = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return yn(l, l), l; + return $n(l, l), l; }; } // @__NO_SIDE_EFFECTS__ -function Bu(t, e) { - return /* @__PURE__ */ zu(t, e, "svg"); +function Ku(e, t) { + return /* @__PURE__ */ Gu(e, t, "svg"); } -function pa(t = "") { - if (!G) { - var e = ie(t + ""); - return yn(e, e), e; +function ga(e = "") { + if (!j) { + var t = it(e + ""); + return $n(t, t), t; } var n = X; - return n.nodeType !== Ur ? (n.before(n = ie()), Ht(n)) : zi( + return n.nodeType !== Ur ? (n.before(n = it()), qe(n)) : Bi( /** @type {Text} */ n - ), yn(n, n), n; + ), $n(n, n), n; } -function Kt(t, e) { - if (G) { +function Ge(e, t) { + if (j) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ - j + J ); - ((n.f & yr) === 0 || n.nodes.end === null) && (n.nodes.end = X), Li(); + ((n.f & mr) === 0 || n.nodes.end === null) && (n.nodes.end = X), qi(); return; } - t !== null && t.before( + e !== null && e.before( /** @type {Node} */ - e + t ); } -const Xu = ["touchstart", "touchmove"]; -function Wu(t) { - return Xu.includes(t); +const ju = ["touchstart", "touchmove"]; +function Ju(e) { + return ju.includes(e); } -function pn(t, e) { - var n = e == null ? "" : typeof e == "object" ? e + "" : e; - n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); +function mn(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 Yo(t, e) { - return zo(t, e); +function Bo(e, t) { + return Xo(e, t); } -function Uu(t, e) { - vs(), e.intro = e.intro ?? !1; - const n = e.target, r = G, i = X; +function Zu(e, t) { + _s(), t.intro = t.intro ?? !1; + const n = t.target, r = j, i = X; try { - for (var s = /* @__PURE__ */ an(n); s && (s.nodeType !== wr || /** @type {Comment} */ - s.data !== Cs); ) - s = /* @__PURE__ */ Oe(s); + for (var s = /* @__PURE__ */ un(n); s && (s.nodeType !== yr || /** @type {Comment} */ + s.data !== Ns); ) + s = /* @__PURE__ */ Vt(s); if (!s) - throw fr; - nn(!0), Ht( + throw ur; + an(!0), qe( /** @type {Comment} */ s ); - const a = zo(t, { ...e, anchor: s }); - return nn(!1), /** @type {Exports} */ + const a = Xo(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), e.recover === !1 && lu(), vs(), $o(n), nn(!1), Yo(t, e); + return a !== ur && console.warn("Failed to hydrate: ", a), t.recover === !1 && du(), _s(), Eo(n), an(!1), Bo(e, t); } finally { - nn(r), Ht(i); - } -} -const ni = /* @__PURE__ */ new Map(); -function zo(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - vs(); - var o = /* @__PURE__ */ new Set(), l = (h) => { - for (var c = 0; c < h.length; c++) { - var p = h[c]; - if (!o.has(p)) { - o.add(p); - var m = Wu(p); - for (const x of [e, document]) { - var $ = ni.get(x); - $ === void 0 && ($ = /* @__PURE__ */ new Map(), ni.set(x, $)); - var _ = $.get(p); - _ === void 0 ? (x.addEventListener(p, da, { passive: m }), $.set(p, 1)) : $.set(p, _ + 1); + an(r), qe(i); + } +} +const ri = /* @__PURE__ */ new Map(); +function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + _s(); + var o = /* @__PURE__ */ new Set(), l = (p) => { + for (var c = 0; c < p.length; c++) { + var d = p[c]; + if (!o.has(d)) { + o.add(d); + var y = Ju(d); + for (const $ of [t, document]) { + var b = ri.get($); + b === void 0 && (b = /* @__PURE__ */ new Map(), ri.set($, b)); + var m = b.get(d); + m === void 0 ? ($.addEventListener(d, va, { passive: y }), b.set(d, 1)) : b.set(d, m + 1); } } } }; - l(Ii(Vo)), gs.add(l); - var u = void 0, f = Iu(() => { - var h = n ?? e.appendChild(ie()); - return bu( + l(Ii(Ho)), ms.add(l); + var u = void 0, f = Vu(() => { + var p = n ?? t.appendChild(it()); + return Cu( /** @type {TemplateNode} */ - h, + p, { pending: () => { } }, (c) => { - qi({}); - var p = ( + Vi({}); + var d = ( /** @type {ComponentContext} */ - se + st ); - if (s && (p.c = s), i && (r.$$events = i), G && yn( + if (s && (d.c = s), i && (r.$$events = i), j && $n( /** @type {TemplateNode} */ c, null - ), u = t(c, r) || {}, G && (j.nodes.end = X, X === null || X.nodeType !== wr || /** @type {Comment} */ - X.data !== Ss)) - throw Oi(), fr; - Vi(); + ), u = e(c, r) || {}, j && (J.nodes.end = X, X === null || X.nodeType !== yr || /** @type {Comment} */ + X.data !== ks)) + throw Li(), ur; + zi(); } ), () => { - var $; + var b; for (var c of o) - for (const _ of [e, document]) { - var p = ( + for (const m of [t, document]) { + var d = ( /** @type {Map} */ - ni.get(_) - ), m = ( + ri.get(m) + ), y = ( /** @type {number} */ - p.get(c) + d.get(c) ); - --m == 0 ? (_.removeEventListener(c, da), p.delete(c), p.size === 0 && ni.delete(_)) : p.set(c, m); + --y == 0 ? (m.removeEventListener(c, va), d.delete(c), d.size === 0 && ri.delete(m)) : d.set(c, y); } - gs.delete(l), h !== n && (($ = h.parentNode) == null || $.removeChild(h)); + ms.delete(l), p !== n && ((b = p.parentNode) == null || b.removeChild(p)); }; }); - return _s.set(u, f), u; + return ys.set(u, f), u; } -let _s = /* @__PURE__ */ new WeakMap(); -function Gu(t, e) { - const n = _s.get(t); - return n ? (_s.delete(t), n(e)) : Promise.resolve(); +let ys = /* @__PURE__ */ new WeakMap(); +function Qu(e, t) { + const n = ys.get(e); + return n ? (ys.delete(e), n(t)) : Promise.resolve(); } -var xe, Me, ne, qn, Xr, Wr, Pi; -class Ku { +var yt, Ot, nt, zn, Xr, Wr, Di; +class ef { /** * @param {TemplateNode} anchor * @param {boolean} transition */ - constructor(e, n = !0) { + constructor(t, n = !0) { /** @type {TemplateNode} */ - ht(this, "anchor"); + ce(this, "anchor"); /** @type {Map} */ - V(this, xe, /* @__PURE__ */ new Map()); + H(this, yt, /* @__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,150 +2091,150 @@ class Ku { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - V(this, Me, /* @__PURE__ */ new Map()); + H(this, Ot, /* @__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} */ - V(this, ne, /* @__PURE__ */ new Map()); + H(this, nt, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} */ - V(this, qn, /* @__PURE__ */ new Set()); + H(this, zn, /* @__PURE__ */ new Set()); /** * Whether to pause (i.e. outro) on change, or destroy immediately. * This is necessary for `` */ - V(this, Xr, !0); - V(this, Wr, () => { - var e = ( + H(this, Xr, !0); + H(this, Wr, () => { + var t = ( /** @type {Batch} */ - U + K ); - if (v(this, xe).has(e)) { + if (v(this, yt).has(t)) { var n = ( /** @type {Key} */ - v(this, xe).get(e) - ), r = v(this, Me).get(n); + v(this, yt).get(t) + ), r = v(this, Ot).get(n); if (r) - qs(r), v(this, qn).delete(n); + zs(r), v(this, zn).delete(n); else { - var i = v(this, ne).get(n); - i && (v(this, Me).set(n, i.effect), v(this, ne).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, nt).get(n); + i && (v(this, Ot).set(n, i.effect), v(this, nt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, xe)) { - if (v(this, xe).delete(s), s === e) + for (const [s, a] of v(this, yt)) { + if (v(this, yt).delete(s), s === t) break; - const o = v(this, ne).get(a); - o && (Yt(o.effect), v(this, ne).delete(a)); + const o = v(this, nt).get(a); + o && (Ve(o.effect), v(this, nt).delete(a)); } - for (const [s, a] of v(this, Me)) { - if (s === n || v(this, qn).has(s)) continue; + for (const [s, a] of v(this, Ot)) { + if (s === n || v(this, zn).has(s)) continue; const o = () => { - if (Array.from(v(this, xe).values()).includes(s)) { + if (Array.from(v(this, yt).values()).includes(s)) { var u = document.createDocumentFragment(); - Mo(a, u), u.append(ie()), v(this, ne).set(s, { effect: a, fragment: u }); + Do(a, u), u.append(it()), v(this, nt).set(s, { effect: a, fragment: u }); } else - Yt(a); - v(this, qn).delete(s), v(this, Me).delete(s); + Ve(a); + v(this, zn).delete(s), v(this, Ot).delete(s); }; - v(this, Xr) || !r ? (v(this, qn).add(s), Hn(a, o, !1)) : o(); + v(this, Xr) || !r ? (v(this, zn).add(s), Yn(a, o, !1)) : o(); } } }); /** * @param {Batch} batch */ - V(this, Pi, (e) => { - v(this, xe).delete(e); - const n = Array.from(v(this, xe).values()); - for (const [r, i] of v(this, ne)) - n.includes(r) || (Yt(i.effect), v(this, ne).delete(r)); + H(this, Di, (t) => { + v(this, yt).delete(t); + const n = Array.from(v(this, yt).values()); + for (const [r, i] of v(this, nt)) + n.includes(r) || (Ve(i.effect), v(this, nt).delete(r)); }); - this.anchor = e, L(this, Xr, n); + this.anchor = t, V(this, Xr, n); } /** * * @param {any} key * @param {null | ((target: TemplateNode) => void)} fn */ - ensure(e, n) { + ensure(t, n) { var r = ( /** @type {Batch} */ - U - ), i = Ao(); - if (n && !v(this, Me).has(e) && !v(this, ne).has(e)) + K + ), i = To(); + if (n && !v(this, Ot).has(t) && !v(this, nt).has(t)) if (i) { - var s = document.createDocumentFragment(), a = ie(); - s.append(a), v(this, ne).set(e, { - effect: de(() => n(a)), + var s = document.createDocumentFragment(), a = it(); + s.append(a), v(this, nt).set(t, { + effect: dt(() => n(a)), fragment: s }); } else - v(this, Me).set( - e, - de(() => n(this.anchor)) + v(this, Ot).set( + t, + dt(() => n(this.anchor)) ); - if (v(this, xe).set(r, e), i) { - for (const [o, l] of v(this, Me)) - o === e ? r.unskip_effect(l) : r.skip_effect(l); - for (const [o, l] of v(this, ne)) - o === e ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, Wr)), r.ondiscard(v(this, Pi)); + if (v(this, yt).set(r, t), i) { + for (const [o, l] of v(this, Ot)) + o === t ? r.unskip_effect(l) : r.skip_effect(l); + for (const [o, l] of v(this, nt)) + o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); + r.oncommit(v(this, Wr)), r.ondiscard(v(this, Di)); } else - G && (this.anchor = X), v(this, Wr).call(this); + j && (this.anchor = X), v(this, Wr).call(this); } } -xe = new WeakMap(), Me = new WeakMap(), ne = new WeakMap(), qn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Pi = new WeakMap(); -function ju(t) { - se === null && eu(), Is(() => { - const e = Bi(t); - if (typeof e == "function") return ( +yt = new WeakMap(), Ot = new WeakMap(), nt = new WeakMap(), zn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Di = new WeakMap(); +function tf(e) { + st === null && au(), Fs(() => { + const t = Xi(e); + if (typeof t == "function") return ( /** @type {() => void} */ - e + t ); }); } -function tr(t, e, n = !1) { - G && Li(); - var r = new Ku(t), i = n ? hr : 0; +function Qn(e, t, n = !1) { + j && qi(); + var r = new ef(e), i = n ? cr : 0; function s(a, o) { - if (G) { - const f = Za(t); + if (j) { + const f = eo(e); var l; - if (f === Cs ? l = 0 : f === Di ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = $i(); - Ht(u), r.anchor = u, nn(!1), r.ensure(a, o), nn(!0); + if (f === Ns ? l = 0 : f === Oi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = Ai(); + qe(u), r.anchor = u, an(!1), r.ensure(a, o), an(!0); return; } } r.ensure(a, o); } - Os(() => { + qs(() => { var a = !1; - e((o, l = 0) => { + t((o, l = 0) => { a = !0, s(l, o); }), a || s(!1, null); }, i); } -function hi(t, e) { - return e; +function di(e, t) { + return t; } -function Ju(t, e, n) { - for (var r = [], i = e.length, s, a = e.length, o = 0; o < i; o++) { - let h = e[o]; - Hn( - h, +function nf(e, t, n) { + for (var r = [], i = t.length, s, a = t.length, o = 0; o < i; o++) { + let p = t[o]; + Yn( + p, () => { if (s) { - if (s.pending.delete(h), s.done.add(h), s.pending.size === 0) { + if (s.pending.delete(p), s.done.add(p), s.pending.size === 0) { var c = ( /** @type {Set} */ - t.outrogroups + e.outrogroups ); - ms(Ii(s.done)), c.delete(s), c.size === 0 && (t.outrogroups = null); + ws(Ii(s.done)), c.delete(s), c.size === 0 && (e.outrogroups = null); } } else a -= 1; @@ -2252,188 +2252,188 @@ function Ju(t, e, n) { /** @type {Element} */ u.parentNode ); - $o(f), f.append(u), t.items.clear(); + Eo(f), f.append(u), e.items.clear(); } - ms(e, !l); + ws(t, !l); } else s = { - pending: new Set(e), + pending: new Set(t), done: /* @__PURE__ */ new Set() - }, (t.outrogroups ?? (t.outrogroups = /* @__PURE__ */ new Set())).add(s); + }, (e.outrogroups ?? (e.outrogroups = /* @__PURE__ */ new Set())).add(s); } -function ms(t, e = !0) { - for (var n = 0; n < t.length; n++) - Yt(t[n], e); +function ws(e, t = !0) { + for (var n = 0; n < e.length; n++) + Ve(e[n], t); } -var va; -function di(t, e, n, r, i, s = null) { - var a = t, o = /* @__PURE__ */ new Map(), l = (e & za) !== 0; +var _a; +function pi(e, t, n, r, i, s = null) { + var a = e, o = /* @__PURE__ */ new Map(), l = (t & Xa) !== 0; if (l) { var u = ( /** @type {Element} */ - t + e ); - a = G ? Ht(/* @__PURE__ */ an(u)) : u.appendChild(ie()); - } - G && Li(); - var f = null, h = /* @__PURE__ */ po(() => { - var x = n(); - return Xa(x) ? x : x == null ? [] : Ii(x); - }), c, p = !0; - function m() { - _.fallback = f, Zu(_, c, a, e, r), f !== null && (c.length === 0 ? (f.f & en) === 0 ? qs(f) : (f.f ^= en, Sr(f, null, a)) : Hn(f, () => { + a = j ? qe(/* @__PURE__ */ un(u)) : u.appendChild(it()); + } + j && qi(); + var f = null, p = /* @__PURE__ */ go(() => { + var $ = n(); + return Ua($) ? $ : $ == null ? [] : Ii($); + }), c, d = !0; + function y() { + m.fallback = f, rf(m, c, a, t, r), f !== null && (c.length === 0 ? (f.f & sn) === 0 ? zs(f) : (f.f ^= sn, Sr(f, null, a)) : Yn(f, () => { f = null; })); } - var $ = Os(() => { + var b = qs(() => { c = /** @type {V[]} */ - b(h); - var x = c.length; - let F = !1; - if (G) { - var S = Za(a) === Di; - S !== (x === 0) && (a = $i(), Ht(a), nn(!1), F = !0); + x(p); + var $ = c.length; + let D = !1; + if (j) { + var M = eo(a) === Oi; + M !== ($ === 0) && (a = Ai(), qe(a), an(!1), D = !0); } - for (var M = /* @__PURE__ */ new Set(), D = ( + for (var S = /* @__PURE__ */ new Set(), F = ( /** @type {Batch} */ - U - ), W = Ao(), K = 0; K < x; K += 1) { - G && X.nodeType === wr && /** @type {Comment} */ - X.data === Ss && (a = /** @type {Comment} */ - X, F = !0, nn(!1)); - var Q = c[K], tt = r(Q, K), J = p ? null : o.get(tt); - J ? (J.v && vr(J.v, Q), J.i && vr(J.i, K), W && D.unskip_effect(J.e)) : (J = Qu( + K + ), L = To(), W = 0; W < $; W += 1) { + j && X.nodeType === yr && /** @type {Comment} */ + X.data === ks && (a = /** @type {Comment} */ + X, D = !0, an(!1)); + var oe = c[W], Q = r(oe, W), U = d ? null : o.get(Q); + U ? (U.v && pr(U.v, oe), U.i && pr(U.i, W), L && F.unskip_effect(U.e)) : (U = sf( o, - p ? a : va ?? (va = ie()), + d ? a : _a ?? (_a = it()), + oe, Q, - tt, - K, + W, i, - e, + t, n - ), p || (J.e.f |= en), o.set(tt, J)), M.add(tt); + ), d || (U.e.f |= sn), o.set(Q, U)), S.add(Q); } - if (x === 0 && s && !f && (p ? f = de(() => s(a)) : (f = de(() => s(va ?? (va = ie()))), f.f |= en)), x > M.size && ru(), G && x > 0 && Ht($i()), !p) - if (W) { - for (const [at, ot] of o) - M.has(at) || D.skip_effect(ot.e); - D.oncommit(m), D.ondiscard(() => { + if ($ === 0 && s && !f && (d ? f = dt(() => s(a)) : (f = dt(() => s(_a ?? (_a = it()))), f.f |= sn)), $ > S.size && lu(), j && $ > 0 && qe(Ai()), !d) + if (L) { + for (const [le, ue] of o) + S.has(le) || F.skip_effect(ue.e); + F.oncommit(y), F.ondiscard(() => { }); } else - m(); - F && nn(!0), b(h); - }), _ = { effect: $, items: o, outrogroups: null, fallback: f }; - p = !1, G && (a = X); -} -function Rr(t) { - for (; t !== null && (t.f & Te) === 0; ) - t = t.next; - return t; + y(); + D && an(!0), x(p); + }), m = { effect: b, items: o, outrogroups: null, fallback: f }; + d = !1, j && (a = X); +} +function Cr(e) { + for (; e !== null && (e.f & At) === 0; ) + e = e.next; + return e; } -function Zu(t, e, n, r, i) { - var J, at, ot, N, H, It, Mt, xt, ft; - var s = (r & Ol) !== 0, a = e.length, o = t.items, l = Rr(t.effect.first), u, f = null, h, c = [], p = [], m, $, _, x; +function rf(e, t, n, r, i) { + var U, le, ue, O, I, Me, ot, ye, we; + var s = (r & Hl) !== 0, a = t.length, o = e.items, l = Cr(e.effect.first), u, f = null, p, c = [], d = [], y, b, m, $; if (s) - for (x = 0; x < a; x += 1) - m = e[x], $ = i(m, x), _ = /** @type {EachItem} */ - o.get($).e, (_.f & en) === 0 && ((at = (J = _.nodes) == null ? void 0 : J.a) == null || at.measure(), (h ?? (h = /* @__PURE__ */ new Set())).add(_)); - for (x = 0; x < a; x += 1) { - if (m = e[x], $ = i(m, x), _ = /** @type {EachItem} */ - o.get($).e, t.outrogroups !== null) - for (const lt of t.outrogroups) - lt.pending.delete(_), lt.done.delete(_); - if ((_.f & en) !== 0) - if (_.f ^= en, _ === l) - Sr(_, null, n); + for ($ = 0; $ < a; $ += 1) + y = t[$], b = i(y, $), m = /** @type {EachItem} */ + o.get(b).e, (m.f & sn) === 0 && ((le = (U = m.nodes) == null ? void 0 : U.a) == null || le.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 ee of e.outrogroups) + ee.pending.delete(m), ee.done.delete(m); + if ((m.f & sn) !== 0) + if (m.f ^= sn, m === l) + Sr(m, null, n); else { - var F = f ? f.next : l; - _ === t.effect.last && (t.effect.last = _.prev), _.prev && (_.prev.next = _.next), _.next && (_.next.prev = _.prev), hn(t, f, _), hn(t, _, F), Sr(_, F, n), f = _, c = [], p = [], l = Rr(f.next); + 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, c = [], d = [], l = Cr(f.next); continue; } - if ((_.f & re) !== 0 && (qs(_), s && ((N = (ot = _.nodes) == null ? void 0 : ot.a) == null || N.unfix(), (h ?? (h = /* @__PURE__ */ new Set())).delete(_))), _ !== l) { - if (u !== void 0 && u.has(_)) { - if (c.length < p.length) { - var S = p[0], M; - f = S.prev; - var D = c[0], W = c[c.length - 1]; - for (M = 0; M < c.length; M += 1) - Sr(c[M], S, n); - for (M = 0; M < p.length; M += 1) - u.delete(p[M]); - hn(t, D.prev, W.next), hn(t, f, D), hn(t, W, S), l = S, f = W, x -= 1, c = [], p = []; + if ((m.f & rt) !== 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 (c.length < d.length) { + var M = d[0], S; + f = M.prev; + var F = c[0], L = c[c.length - 1]; + for (S = 0; S < c.length; S += 1) + Sr(c[S], M, n); + for (S = 0; S < d.length; S += 1) + u.delete(d[S]); + gn(e, F.prev, L.next), gn(e, f, F), gn(e, L, M), l = M, f = L, $ -= 1, c = [], d = []; } else - u.delete(_), Sr(_, l, n), hn(t, _.prev, _.next), hn(t, _, f === null ? t.effect.first : f.next), hn(t, f, _), f = _; + 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; continue; } - for (c = [], p = []; l !== null && l !== _; ) - (u ?? (u = /* @__PURE__ */ new Set())).add(l), p.push(l), l = Rr(l.next); + for (c = [], d = []; l !== null && l !== m; ) + (u ?? (u = /* @__PURE__ */ new Set())).add(l), d.push(l), l = Cr(l.next); if (l === null) continue; } - (_.f & en) === 0 && c.push(_), f = _, l = Rr(_.next); + (m.f & sn) === 0 && c.push(m), f = m, l = Cr(m.next); } - if (t.outrogroups !== null) { - for (const lt of t.outrogroups) - lt.pending.size === 0 && (ms(Ii(lt.done)), (H = t.outrogroups) == null || H.delete(lt)); - t.outrogroups.size === 0 && (t.outrogroups = null); + if (e.outrogroups !== null) { + for (const ee of e.outrogroups) + ee.pending.size === 0 && (ws(Ii(ee.done)), (I = e.outrogroups) == null || I.delete(ee)); + e.outrogroups.size === 0 && (e.outrogroups = null); } if (l !== null || u !== void 0) { - var K = []; + var W = []; if (u !== void 0) - for (_ of u) - (_.f & re) === 0 && K.push(_); + for (m of u) + (m.f & rt) === 0 && W.push(m); for (; l !== null; ) - (l.f & re) === 0 && l !== t.fallback && K.push(l), l = Rr(l.next); - var Q = K.length; - if (Q > 0) { - var tt = (r & za) !== 0 && a === 0 ? n : null; + (l.f & rt) === 0 && l !== e.fallback && W.push(l), l = Cr(l.next); + var oe = W.length; + if (oe > 0) { + var Q = (r & Xa) !== 0 && a === 0 ? n : null; if (s) { - for (x = 0; x < Q; x += 1) - (Mt = (It = K[x].nodes) == null ? void 0 : It.a) == null || Mt.measure(); - for (x = 0; x < Q; x += 1) - (ft = (xt = K[x].nodes) == null ? void 0 : xt.a) == null || ft.fix(); + for ($ = 0; $ < oe; $ += 1) + (ot = (Me = W[$].nodes) == null ? void 0 : Me.a) == null || ot.measure(); + for ($ = 0; $ < oe; $ += 1) + (we = (ye = W[$].nodes) == null ? void 0 : ye.a) == null || we.fix(); } - Ju(t, K, tt); + nf(e, W, Q); } } - s && _n(() => { - var lt, z; - if (h !== void 0) - for (_ of h) - (z = (lt = _.nodes) == null ? void 0 : lt.a) == null || z.apply(); + s && xn(() => { + var ee, Pe; + if (p !== void 0) + for (m of p) + (Pe = (ee = m.nodes) == null ? void 0 : ee.a) == null || Pe.apply(); }); } -function Qu(t, e, n, r, i, s, a, o) { - var l = (a & Il) !== 0 ? (a & Ll) === 0 ? /* @__PURE__ */ mo(n, !1, !1) : Xn(n) : null, u = (a & Fl) !== 0 ? Xn(i) : null; +function sf(e, t, n, r, i, s, a, o) { + var l = (a & Vl) !== 0 ? (a & Yl) === 0 ? /* @__PURE__ */ wo(n, !1, !1) : Un(n) : null, u = (a & zl) !== 0 ? Un(i) : null; return { v: l, i: u, - e: de(() => (s(e, l ?? n, u ?? i, o), () => { - t.delete(r); + e: dt(() => (s(t, l ?? n, u ?? i, o), () => { + e.delete(r); })) }; } -function Sr(t, e, n) { - if (t.nodes) - for (var r = t.nodes.start, i = t.nodes.end, s = e && (e.f & en) === 0 ? ( +function Sr(e, t, n) { + if (e.nodes) + for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & sn) === 0 ? ( /** @type {EffectNodes} */ - e.nodes.start + t.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Oe(r) + /* @__PURE__ */ Vt(r) ); if (s.before(r), r === i) return; r = a; } } -function hn(t, e, n) { - e === null ? t.effect.first = n : e.next = n, n === null ? t.effect.last = e : n.prev = e; +function gn(e, t, n) { + t === null ? e.effect.first = n : t.next = n, n === null ? e.effect.last = t : n.prev = t; } -function Vs(t, e) { - Ro(() => { - var n = t.getRootNode(), r = ( +function Hs(e, t) { + So(() => { + var n = e.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( /** @type {ShadowRoot} */ @@ -2444,16 +2444,16 @@ function Vs(t, e) { n.ownerDocument.head ) ); - if (!r.querySelector("#" + e.hash)) { - const i = Ps("style"); - i.id = e.hash, i.textContent = e.code, r.appendChild(i); + if (!r.querySelector("#" + t.hash)) { + const i = Os("style"); + i.id = t.hash, i.textContent = t.code, r.appendChild(i); } }); } -const ga = [...` +const ma = [...` \r\f \v\uFEFF`]; -function tf(t, e, n) { - var r = t == null ? "" : "" + t; +function af(e, t, n) { + var r = e == null ? "" : "" + e; if (n) { for (var i in n) if (n[i]) @@ -2461,112 +2461,112 @@ function tf(t, e, n) { else if (r.length) for (var s = i.length, a = 0; (a = r.indexOf(i, a)) >= 0; ) { var o = a + s; - (a === 0 || ga.includes(r[a - 1])) && (o === r.length || ga.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; + (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; } } return r === "" ? null : r; } -function _a(t, e = !1) { - var n = e ? " !important;" : ";", r = ""; - for (var i in t) { - var s = t[i]; +function ya(e, t = !1) { + var n = t ? " !important;" : ";", r = ""; + for (var i in e) { + var s = e[i]; s != null && s !== "" && (r += " " + i + ": " + s + n); } return r; } -function ef(t, e) { - if (e) { +function of(e, t) { + if (t) { var n = "", r, i; - return Array.isArray(e) ? (r = e[0], i = e[1]) : r = e, r && (n += _a(r)), i && (n += _a(i, !0)), n = n.trim(), n === "" ? null : n; + 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 String(t); + return String(e); } -function ri(t, e, n, r, i, s) { - var a = t.__className; - if (G || a !== n || a === void 0) { - var o = tf(n, r, s); - (!G || o !== t.getAttribute("class")) && (o == null ? t.removeAttribute("class") : t.className = o), t.__className = n; +function ii(e, t, n, r, i, s) { + var a = e.__className; + if (j || a !== n || a === void 0) { + var o = af(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) { var u = !!s[l]; - (i == null || u !== !!i[l]) && t.classList.toggle(l, u); + (i == null || u !== !!i[l]) && e.classList.toggle(l, u); } return s; } -function ts(t, e = {}, n, r) { +function ns(e, t = {}, n, r) { for (var i in n) { var s = n[i]; - e[i] !== s && (n[i] == null ? t.style.removeProperty(i) : t.style.setProperty(i, s, r)); + t[i] !== s && (n[i] == null ? e.style.removeProperty(i) : e.style.setProperty(i, s, r)); } } -function ma(t, e, n, r) { - var i = t.__style; - if (G || i !== e) { - var s = ef(e, r); - (!G || s !== t.getAttribute("style")) && (s == null ? t.removeAttribute("style") : t.style.cssText = s), t.__style = e; - } else r && (Array.isArray(r) ? (ts(t, n == null ? void 0 : n[0], r[0]), ts(t, n == null ? void 0 : n[1], r[1], "important")) : ts(t, n, r)); +function wa(e, t, n, r) { + var i = e.__style; + if (j || i !== t) { + var s = of(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 nf = Symbol("is custom element"), rf = Symbol("is html"), sf = tu ? "link" : "LINK"; -function ya(t, e, n, r) { - var i = af(t); - G && (i[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === sf) || i[e] !== (i[e] = n) && (e === "loading" && (t[Ql] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && of(t).includes(e) ? t[e] = n : t.setAttribute(e, n)); +const lf = Symbol("is custom element"), uf = Symbol("is html"), ff = su ? "link" : "LINK"; +function xa(e, t, n, r) { + var i = cf(e); + j && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ff) || i[t] !== (i[t] = n) && (t === "loading" && (e[iu] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && hf(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); } -function af(t) { +function cf(e) { return ( /** @type {Record} **/ // @ts-expect-error - t.__attributes ?? (t.__attributes = { - [nf]: t.nodeName.includes("-"), - [rf]: t.namespaceURI === Ba + e.__attributes ?? (e.__attributes = { + [lf]: e.nodeName.includes("-"), + [uf]: e.namespaceURI === Wa }) ); } -var wa = /* @__PURE__ */ new Map(); -function of(t) { - var e = t.getAttribute("is") || t.nodeName, n = wa.get(e); +var ba = /* @__PURE__ */ new Map(); +function hf(e) { + var t = e.getAttribute("is") || e.nodeName, n = ba.get(t); if (n) return n; - wa.set(e, n = []); - for (var r, i = t, s = Element.prototype; s !== i; ) { - r = Wl(i); + ba.set(t, n = []); + for (var r, i = e, s = Element.prototype; s !== i; ) { + r = Jl(i); for (var a in r) r[a].set && n.push(a); - i = Wa(i); + i = Ga(i); } return n; } -function xa(t, e) { - return t === e || (t == null ? void 0 : t[Pr]) === e; +function $a(e, t) { + return e === t || (e == null ? void 0 : e[Pr]) === t; } -function pi(t = {}, e, n, r) { - return Ro(() => { +function vi(e = {}, t, n, r) { + return So(() => { var i, s; - return Fs(() => { - i = s, s = [], Bi(() => { - t !== n(...s) && (e(t, ...s), i && xa(n(...i), t) && e(null, ...i)); + return Ls(() => { + i = s, s = [], Xi(() => { + e !== n(...s) && (t(e, ...s), i && $a(n(...i), e) && t(null, ...i)); }); }), () => { - _n(() => { - s && xa(n(...s), t) && e(null, ...s); + xn(() => { + s && $a(n(...s), e) && t(null, ...s); }); }; - }), t; + }), e; } -let ii = !1; -function lf(t) { - var e = ii; +let si = !1; +function df(e) { + var t = si; try { - return ii = !1, [t(), ii]; + return si = !1, [e(), si]; } finally { - ii = e; + si = t; } } -function ut(t, e, n, r) { - var F; - var i = (n & Hl) !== 0, s = (n & Yl) !== 0, a = ( +function ae(e, t, n, r) { + var D; + var i = (n & Wl) !== 0, s = (n & Ul) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? Bi( + ), o = !0, l = () => (o && (o = !1, a = s ? Xi( /** @type {() => V} */ r ) : ( @@ -2574,186 +2574,186 @@ function ut(t, e, n, r) { r )), a), u; if (i) { - var f = Pr in t || Ja in t; - u = ((F = Vn(t, e)) == null ? void 0 : F.set) ?? (f && e in t ? (S) => t[e] = S : void 0); + 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 h, c = !1; - i ? [h, c] = lf(() => ( + var p, c = !1; + i ? [p, c] = df(() => ( /** @type {V} */ - t[e] - )) : h = /** @type {V} */ - t[e], h === void 0 && r !== void 0 && (h = l(), u && (uu(), u(h))); - var p; - if (p = () => { - var S = ( + e[t] + )) : p = /** @type {V} */ + e[t], p === void 0 && r !== void 0 && (p = l(), u && (pu(), u(p))); + var d; + if (d = () => { + var M = ( /** @type {V} */ - t[e] + e[t] ); - return S === void 0 ? l() : (o = !0, S); - }, (n & Vl) === 0) - return p; + return M === void 0 ? l() : (o = !0, M); + }, (n & Xl) === 0) + return d; if (u) { - var m = t.$$legacy; + var y = e.$$legacy; return ( /** @type {() => V} */ - (function(S, M) { - return arguments.length > 0 ? ((!M || m || c) && u(M ? p() : S), S) : p(); + (function(M, S) { + return arguments.length > 0 ? ((!S || y || c) && u(S ? d() : M), M) : d(); }) ); } - var $ = !1, _ = ((n & ql) !== 0 ? Yi : po)(() => ($ = !1, p())); - i && b(_); - var x = ( + var b = !1, m = ((n & Bl) !== 0 ? Yi : go)(() => (b = !1, d())); + i && x(m); + var $ = ( /** @type {Effect} */ - j + J ); return ( /** @type {() => V} */ - (function(S, M) { + (function(M, S) { if (arguments.length > 0) { - const D = M ? b(_) : i ? kn(S) : S; - return dt(_, D), $ = !0, a !== void 0 && (a = D), S; + const F = S ? x(m) : i ? Pn(M) : M; + return he(m, F), b = !0, a !== void 0 && (a = F), M; } - return wn && $ || (x.f & rn) !== 0 ? _.v : b(_); + return An && b || ($.f & on) !== 0 ? m.v : x(m); }) ); } -function uf(t) { - return new ff(t); +function pf(e) { + return new vf(e); } -var tn, he; -class ff { +var rn, ht; +class vf { /** * @param {ComponentConstructorOptions & { * component: any; * }} options */ - constructor(e) { + constructor(t) { /** @type {any} */ - V(this, tn); + H(this, rn); /** @type {Record} */ - V(this, he); + H(this, ht); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ mo(o, !1, !1); + var l = /* @__PURE__ */ wo(o, !1, !1); return n.set(a, l), l; }; const i = new Proxy( - { ...e.props || {}, $$events: {} }, + { ...t.props || {}, $$events: {} }, { get(a, o) { - return b(n.get(o) ?? r(o, Reflect.get(a, o))); + return x(n.get(o) ?? r(o, Reflect.get(a, o))); }, has(a, o) { - return o === Ja ? !0 : (b(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + return o === Qa ? !0 : (x(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); }, set(a, o, l) { - return dt(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + return he(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); } } ); - L(this, he, (e.hydrate ? Uu : Yo)(e.component, { - target: e.target, - anchor: e.anchor, + V(this, ht, (t.hydrate ? Zu : Bo)(t.component, { + target: t.target, + anchor: t.anchor, props: i, - context: e.context, - intro: e.intro ?? !1, - recover: e.recover - })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && st(), L(this, tn, i.$$events); - for (const a of Object.keys(v(this, he))) - a === "$set" || a === "$destroy" || a === "$on" || bi(this, a, { + 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, rn, i.$$events); + for (const a of Object.keys(v(this, ht))) + a === "$set" || a === "$destroy" || a === "$on" || $i(this, a, { get() { - return v(this, he)[a]; + return v(this, ht)[a]; }, /** @param {any} value */ set(o) { - v(this, he)[a] = o; + v(this, ht)[a] = o; }, enumerable: !0 }); - v(this, he).$set = /** @param {Record} next */ + v(this, ht).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, he).$destroy = () => { - Gu(v(this, he)); + }, v(this, ht).$destroy = () => { + Qu(v(this, ht)); }; } /** @param {Record} props */ - $set(e) { - v(this, he).$set(e); + $set(t) { + v(this, ht).$set(t); } /** * @param {string} event * @param {(...args: any[]) => any} callback * @returns {any} */ - $on(e, n) { - v(this, tn)[e] = v(this, tn)[e] || []; + $on(t, n) { + v(this, rn)[t] = v(this, rn)[t] || []; const r = (...i) => n.call(this, ...i); - return v(this, tn)[e].push(r), () => { - v(this, tn)[e] = v(this, tn)[e].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, he).$destroy(); + v(this, ht).$destroy(); } } -tn = new WeakMap(), he = new WeakMap(); -let Bo; -typeof HTMLElement == "function" && (Bo = class extends HTMLElement { +rn = new WeakMap(), ht = new WeakMap(); +let Wo; +typeof HTMLElement == "function" && (Wo = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots * @param {ShadowRootInit | undefined} shadow_root_init */ - constructor(e, n, r) { + constructor(t, n, r) { super(); /** The Svelte component constructor */ - ht(this, "$$ctor"); + ce(this, "$$ctor"); /** Slots */ - ht(this, "$$s"); + ce(this, "$$s"); /** @type {any} The Svelte component instance */ - ht(this, "$$c"); + ce(this, "$$c"); /** Whether or not the custom element is connected */ - ht(this, "$$cn", !1); + ce(this, "$$cn", !1); /** @type {Record} Component props data */ - ht(this, "$$d", {}); + ce(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - ht(this, "$$r", !1); + ce(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - ht(this, "$$p_d", {}); + ce(this, "$$p_d", {}); /** @type {Record} Event listeners */ - ht(this, "$$l", {}); + ce(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - ht(this, "$$l_u", /* @__PURE__ */ new Map()); + ce(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - ht(this, "$$me"); + ce(this, "$$me"); /** @type {ShadowRoot | null} The ShadowRoot of the custom element */ - ht(this, "$$shadowRoot", null); - this.$$ctor = e, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); + ce(this, "$$shadowRoot", null); + this.$$ctor = t, this.$$s = n, r && (this.$$shadowRoot = this.attachShadow(r)); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - addEventListener(e, n, r) { - if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(n), this.$$c) { - const i = this.$$c.$on(e, n); + addEventListener(t, n, r) { + if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(n), this.$$c) { + const i = this.$$c.$on(t, n); this.$$l_u.set(n, i); } - super.addEventListener(e, n, r); + super.addEventListener(t, n, r); } /** * @param {string} type * @param {EventListenerOrEventListenerObject} listener * @param {boolean | AddEventListenerOptions} [options] */ - removeEventListener(e, n, r) { - if (super.removeEventListener(e, n, r), this.$$c) { + removeEventListener(t, n, r) { + if (super.removeEventListener(t, n, r), this.$$c) { const i = this.$$l_u.get(n); i && (i(), this.$$l_u.delete(n)); } @@ -2762,23 +2762,23 @@ typeof HTMLElement == "function" && (Bo = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const o = Ps("slot"); - s !== "default" && (o.name = s), Kt(a, o); + const o = Os("slot"); + s !== "default" && (o.name = s), Ge(a, o); }; }; - var e = n; + var t = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = cf(this); + const r = {}, i = gf(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] = vi(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = gi(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 = uf({ + this.$$c = pf({ component: this.$$ctor, target: this.$$shadowRoot || this, props: { @@ -2786,14 +2786,14 @@ typeof HTMLElement == "function" && (Bo = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = Du(() => { - Fs(() => { + }), this.$$me = qu(() => { + Ls(() => { var s; this.$$r = !0; - for (const a of xi(this.$$c)) { + for (const a of bi(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = vi( + const o = gi( a, this.$$d[a], this.$$p_d, @@ -2819,9 +2819,9 @@ typeof HTMLElement == "function" && (Bo = class extends HTMLElement { * @param {string} _oldValue * @param {string} newValue */ - attributeChangedCallback(e, n, r) { + attributeChangedCallback(t, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = vi(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); + this.$$r || (t = this.$$g_p(t), this.$$d[t] = gi(t, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [t]: this.$$d[t] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -2831,637 +2831,637 @@ typeof HTMLElement == "function" && (Bo = class extends HTMLElement { /** * @param {string} attribute_name */ - $$g_p(e) { - return xi(this.$$p_d).find( - (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e - ) || e; + $$g_p(t) { + return bi(this.$$p_d).find( + (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t + ) || t; } }); -function vi(t, e, n, r) { +function gi(e, t, n, r) { var s; - const i = (s = n[t]) == null ? void 0 : s.type; - if (e = i === "Boolean" && typeof e != "boolean" ? e != null : e, !r || !n[t]) - return e; + const i = (s = n[e]) == null ? void 0 : s.type; + if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !r || !n[e]) + return t; if (r === "toAttribute") switch (i) { case "Object": case "Array": - return e == null ? null : JSON.stringify(e); + return t == null ? null : JSON.stringify(t); case "Boolean": - return e ? "" : null; + return t ? "" : null; case "Number": - return e ?? null; + return t ?? null; default: - return e; + return t; } else switch (i) { case "Object": case "Array": - return e && JSON.parse(e); + return t && JSON.parse(t); case "Boolean": - return e; + return t; // conversion already handled above case "Number": - return e != null ? +e : e; + return t != null ? +t : t; default: - return e; + return t; } } -function cf(t) { - const e = {}; - return t.childNodes.forEach((n) => { - e[ +function gf(e) { + const t = {}; + return e.childNodes.forEach((n) => { + t[ /** @type {Element} node */ n.slot || "default" ] = !0; - }), e; + }), t; } -function Hs(t, e, n, r, i, s) { - let a = class extends Bo { +function Ys(e, t, n, r, i, s) { + let a = class extends Wo { constructor() { - super(t, n, i), this.$$p_d = e; + super(e, n, i), this.$$p_d = t; } static get observedAttributes() { - return xi(e).map( - (o) => (e[o].attribute || o).toLowerCase() + return bi(t).map( + (o) => (t[o].attribute || o).toLowerCase() ); } }; - return xi(e).forEach((o) => { - bi(a.prototype, o, { + return bi(t).forEach((o) => { + $i(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { - var h; - l = vi(o, l, e), this.$$d[o] = l; + var p; + l = gi(o, l, t), this.$$d[o] = l; var u = this.$$c; if (u) { - var f = (h = Vn(u, o)) == null ? void 0 : h.get; + var f = (p = Hn(u, o)) == null ? void 0 : p.get; f ? u[o] = l : u.$set({ [o]: l }); } } }); }), r.forEach((o) => { - bi(a.prototype, o, { + $i(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; } }); - }), t.element = /** @type {any} */ + }), e.element = /** @type {any} */ a, a; } -var hf = { value: () => { +var _f = { value: () => { } }; -function Xo() { - for (var t = 0, e = arguments.length, n = {}, r; t < e; ++t) { - if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); +function Uo() { + 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 gi(n); + return new _i(n); } -function gi(t) { - this._ = t; +function _i(e) { + this._ = e; } -function df(t, e) { - return t.trim().split(/^|\s+/).map(function(n) { +function mf(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 && !e.hasOwnProperty(n)) throw new Error("unknown type: " + n); + 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 }; }); } -gi.prototype = Xo.prototype = { - constructor: gi, - on: function(t, e) { - var n = this._, r = df(t + "", n), i, s = -1, a = r.length; +_i.prototype = Uo.prototype = { + constructor: _i, + on: function(e, t) { + var n = this._, r = mf(e + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = pf(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = yf(n[i], e.name))) return i; return; } - if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); + if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); for (; ++s < a; ) - if (i = (t = r[s]).type) n[i] = ba(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = ba(n[i], t.name, null); + 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); return this; }, copy: function() { - var t = {}, e = this._; - for (var n in e) t[n] = e[n].slice(); - return new gi(t); + var e = {}, t = this._; + for (var n in t) e[n] = t[n].slice(); + return new _i(e); }, - call: function(t, 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]; - if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); - for (s = this._[t], r = 0, i = s.length; r < i; ++r) s[r].value.apply(e, n); + if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); + for (s = this._[e], r = 0, i = s.length; r < i; ++r) s[r].value.apply(t, n); }, - apply: function(t, e, n) { - if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); - for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); + apply: function(e, t, n) { + if (!this._.hasOwnProperty(e)) throw new Error("unknown type: " + e); + for (var r = this._[e], i = 0, s = r.length; i < s; ++i) r[i].value.apply(t, n); } }; -function pf(t, e) { - for (var n = 0, r = t.length, i; n < r; ++n) - if ((i = t[n]).name === e) +function yf(e, t) { + for (var n = 0, r = e.length, i; n < r; ++n) + if ((i = e[n]).name === t) return i.value; } -function ba(t, e, n) { - for (var r = 0, i = t.length; r < i; ++r) - if (t[r].name === e) { - t[r] = hf, t = t.slice(0, r).concat(t.slice(r + 1)); +function Aa(e, t, n) { + for (var r = 0, i = e.length; r < i; ++r) + if (e[r].name === t) { + e[r] = _f, e = e.slice(0, r).concat(e.slice(r + 1)); break; } - return n != null && t.push({ name: e, value: n }), t; + return n != null && e.push({ name: t, value: n }), e; } -var ys = "http://www.w3.org/1999/xhtml"; -const $a = { +var xs = "http://www.w3.org/1999/xhtml"; +const Ea = { svg: "http://www.w3.org/2000/svg", - xhtml: ys, + 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 Xi(t) { - var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), $a.hasOwnProperty(e) ? { space: $a[e], local: t } : t; +function Wi(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; } -function vf(t) { +function wf(e) { return function() { - var e = this.ownerDocument, n = this.namespaceURI; - return n === ys && e.documentElement.namespaceURI === ys ? e.createElement(t) : e.createElementNS(n, t); + var t = this.ownerDocument, n = this.namespaceURI; + return n === xs && t.documentElement.namespaceURI === xs ? t.createElement(e) : t.createElementNS(n, e); }; } -function gf(t) { +function xf(e) { return function() { - return this.ownerDocument.createElementNS(t.space, t.local); + return this.ownerDocument.createElementNS(e.space, e.local); }; } -function Wo(t) { - var e = Xi(t); - return (e.local ? gf : vf)(e); +function Go(e) { + var t = Wi(e); + return (t.local ? xf : wf)(t); } -function _f() { +function bf() { } -function Ys(t) { - return t == null ? _f : function() { - return this.querySelector(t); +function Bs(e) { + return e == null ? bf : function() { + return this.querySelector(e); }; } -function mf(t) { - typeof t != "function" && (t = Ys(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = new Array(a), l, u, f = 0; f < a; ++f) - (l = s[f]) && (u = t.call(l, l.__data__, f, s)) && ("__data__" in l && (u.__data__ = l.__data__), o[f] = u); - return new ae(r, this._parents); +function $f(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 at(r, this._parents); } -function yf(t) { - return t == null ? [] : Array.isArray(t) ? t : Array.from(t); +function Af(e) { + return e == null ? [] : Array.isArray(e) ? e : Array.from(e); } -function wf() { +function Ef() { return []; } -function Uo(t) { - return t == null ? wf : function() { - return this.querySelectorAll(t); +function Ko(e) { + return e == null ? Ef : function() { + return this.querySelectorAll(e); }; } -function xf(t) { +function Tf(e) { return function() { - return yf(t.apply(this, arguments)); + return Af(e.apply(this, arguments)); }; } -function bf(t) { - typeof t == "function" ? t = xf(t) : t = Uo(t); - for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) - for (var a = e[s], o = a.length, l, u = 0; u < o; ++u) - (l = a[u]) && (r.push(t.call(l, l.__data__, u, a)), i.push(l)); - return new ae(r, i); +function Cf(e) { + typeof e == "function" ? e = Tf(e) : e = Ko(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 at(r, i); } -function Go(t) { +function jo(e) { return function() { - return this.matches(t); + return this.matches(e); }; } -function Ko(t) { - return function(e) { - return e.matches(t); +function Jo(e) { + return function(t) { + return t.matches(e); }; } -var $f = Array.prototype.find; -function Af(t) { +var Rf = Array.prototype.find; +function Sf(e) { return function() { - return $f.call(this.children, t); + return Rf.call(this.children, e); }; } -function Ef() { +function Nf() { return this.firstElementChild; } -function Tf(t) { - return this.select(t == null ? Ef : Af(typeof t == "function" ? t : Ko(t))); +function kf(e) { + return this.select(e == null ? Nf : Sf(typeof e == "function" ? e : Jo(e))); } -var Rf = Array.prototype.filter; -function Cf() { +var Mf = Array.prototype.filter; +function Pf() { return Array.from(this.children); } -function Sf(t) { +function Df(e) { return function() { - return Rf.call(this.children, t); + return Mf.call(this.children, e); }; } -function Nf(t) { - return this.selectAll(t == null ? Cf : Sf(typeof t == "function" ? t : Ko(t))); +function Of(e) { + return this.selectAll(e == null ? Pf : Df(typeof e == "function" ? e : Jo(e))); } -function kf(t) { - typeof t != "function" && (t = Go(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new ae(r, this._parents); +function If(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 at(r, this._parents); } -function jo(t) { - return new Array(t.length); +function Zo(e) { + return new Array(e.length); } -function Mf() { - return new ae(this._enter || this._groups.map(jo), this._parents); +function Ff() { + return new at(this._enter || this._groups.map(Zo), this._parents); } -function Ai(t, e) { - this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; +function Ei(e, t) { + this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; } -Ai.prototype = { - constructor: Ai, - appendChild: function(t) { - return this._parent.insertBefore(t, this._next); +Ei.prototype = { + constructor: Ei, + appendChild: function(e) { + return this._parent.insertBefore(e, this._next); }, - insertBefore: function(t, e) { - return this._parent.insertBefore(t, e); + insertBefore: function(e, t) { + return this._parent.insertBefore(e, t); }, - querySelector: function(t) { - return this._parent.querySelector(t); + querySelector: function(e) { + return this._parent.querySelector(e); }, - querySelectorAll: function(t) { - return this._parent.querySelectorAll(t); + querySelectorAll: function(e) { + return this._parent.querySelectorAll(e); } }; -function Pf(t) { +function Lf(e) { return function() { - return t; + return e; }; } -function Df(t, e, n, r, i, s) { - for (var a = 0, o, l = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ai(t, s[a]); +function qf(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 Ei(e, s[a]); for (; a < l; ++a) - (o = e[a]) && (i[a] = o); + (o = t[a]) && (i[a] = o); } -function If(t, e, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = e.length, h = s.length, c = new Array(f), p; +function Vf(e, t, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = t.length, p = s.length, c = new Array(f), d; for (o = 0; o < f; ++o) - (l = e[o]) && (c[o] = p = a.call(l, l.__data__, o, e) + "", u.has(p) ? i[o] = l : u.set(p, l)); - for (o = 0; o < h; ++o) - p = a.call(t, s[o], o, s) + "", (l = u.get(p)) ? (r[o] = l, l.__data__ = s[o], u.delete(p)) : n[o] = new Ai(t, s[o]); + (l = t[o]) && (c[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 Ei(e, s[o]); for (o = 0; o < f; ++o) - (l = e[o]) && u.get(c[o]) === l && (i[o] = l); + (l = t[o]) && u.get(c[o]) === l && (i[o] = l); } -function Ff(t) { - return t.__data__; +function zf(e) { + return e.__data__; } -function Of(t, e) { - if (!arguments.length) return Array.from(this, Ff); - var n = e ? If : Df, r = this._parents, i = this._groups; - typeof t != "function" && (t = Pf(t)); +function Hf(e, t) { + if (!arguments.length) return Array.from(this, zf); + var n = t ? Vf : qf, r = this._parents, i = this._groups; + typeof e != "function" && (e = Lf(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], h = i[u], c = h.length, p = Lf(t.call(f, f && f.__data__, u, r)), m = p.length, $ = o[u] = new Array(m), _ = a[u] = new Array(m), x = l[u] = new Array(c); - n(f, h, $, _, x, p, e); - for (var F = 0, S = 0, M, D; F < m; ++F) - if (M = $[F]) { - for (F >= S && (S = F + 1); !(D = _[S]) && ++S < m; ) ; - M._next = D || null; + var f = r[u], p = i[u], c = p.length, d = Yf(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(c); + n(f, p, b, m, $, d, t); + for (var D = 0, M = 0, S, F; D < y; ++D) + if (S = b[D]) { + for (D >= M && (M = D + 1); !(F = m[M]) && ++M < y; ) ; + S._next = F || null; } } - return a = new ae(a, r), a._enter = o, a._exit = l, a; + return a = new at(a, r), a._enter = o, a._exit = l, a; } -function Lf(t) { - return typeof t == "object" && "length" in t ? t : Array.from(t); +function Yf(e) { + return typeof e == "object" && "length" in e ? e : Array.from(e); } -function qf() { - return new ae(this._exit || this._groups.map(jo), this._parents); +function Bf() { + return new at(this._exit || this._groups.map(Zo), this._parents); } -function Vf(t, e, n) { +function Xf(e, t, n) { var r = this.enter(), i = this, s = this.exit(); - return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? s.remove() : n(s), r && i ? r.merge(i).order() : i; + 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 Hf(t) { - for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._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], h = u.length, c = o[l] = new Array(h), p, m = 0; m < h; ++m) - (p = u[m] || f[m]) && (c[m] = p); +function Wf(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, c = o[l] = new Array(p), d, y = 0; y < p; ++y) + (d = u[y] || f[y]) && (c[y] = d); for (; l < i; ++l) o[l] = n[l]; - return new ae(o, this._parents); + return new at(o, this._parents); } -function Yf() { - for (var t = this._groups, e = -1, n = t.length; ++e < n; ) - for (var r = t[e], i = r.length - 1, s = r[i], a; --i >= 0; ) +function Uf() { + 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 zf(t) { - t || (t = Bf); - function e(h, c) { - return h && c ? t(h.__data__, c.__data__) : !h - !c; +function Gf(e) { + e || (e = Kf); + function t(p, c) { + return p && c ? e(p.__data__, c.__data__) : !p - !c; } 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(e); + l.sort(t); } - return new ae(i, this._parents).order(); + return new at(i, this._parents).order(); } -function Bf(t, e) { - return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; +function Kf(e, t) { + return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function Xf() { - var t = arguments[0]; - return arguments[0] = this, t.apply(null, arguments), this; +function jf() { + var e = arguments[0]; + return arguments[0] = this, e.apply(null, arguments), this; } -function Wf() { +function Jf() { return Array.from(this); } -function Uf() { - for (var t = this._groups, e = 0, n = t.length; e < n; ++e) - for (var r = t[e], i = 0, s = r.length; i < s; ++i) { +function Zf() { + 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]; if (a) return a; } return null; } -function Gf() { - let t = 0; - for (const e of this) ++t; - return t; +function Qf() { + let e = 0; + for (const t of this) ++e; + return e; } -function Kf() { +function ec() { return !this.node(); } -function jf(t) { - for (var e = this._groups, n = 0, r = e.length; n < r; ++n) - for (var i = e[n], s = 0, a = i.length, o; s < a; ++s) - (o = i[s]) && t.call(o, o.__data__, s, i); +function tc(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 Jf(t) { +function nc(e) { return function() { - this.removeAttribute(t); + this.removeAttribute(e); }; } -function Zf(t) { +function rc(e) { return function() { - this.removeAttributeNS(t.space, t.local); + this.removeAttributeNS(e.space, e.local); }; } -function Qf(t, e) { +function ic(e, t) { return function() { - this.setAttribute(t, e); + this.setAttribute(e, t); }; } -function tc(t, e) { +function sc(e, t) { return function() { - this.setAttributeNS(t.space, t.local, e); + this.setAttributeNS(e.space, e.local, t); }; } -function ec(t, e) { +function ac(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? this.removeAttribute(t) : this.setAttribute(t, n); + var n = t.apply(this, arguments); + n == null ? this.removeAttribute(e) : this.setAttribute(e, n); }; } -function nc(t, e) { +function oc(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, n); + var n = t.apply(this, arguments); + n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n); }; } -function rc(t, e) { - var n = Xi(t); +function lc(e, t) { + var n = Wi(e); if (arguments.length < 2) { var r = this.node(); return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n); } - return this.each((e == null ? n.local ? Zf : Jf : typeof e == "function" ? n.local ? nc : ec : n.local ? tc : Qf)(n, e)); + return this.each((t == null ? n.local ? rc : nc : typeof t == "function" ? n.local ? oc : ac : n.local ? sc : ic)(n, t)); } -function Jo(t) { - return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; +function Qo(e) { + return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; } -function ic(t) { +function uc(e) { return function() { - this.style.removeProperty(t); + this.style.removeProperty(e); }; } -function sc(t, e, n) { +function fc(e, t, n) { return function() { - this.style.setProperty(t, e, n); + this.style.setProperty(e, t, n); }; } -function ac(t, e, n) { +function cc(e, t, n) { return function() { - var r = e.apply(this, arguments); - r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); + var r = t.apply(this, arguments); + r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); }; } -function oc(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? ic : typeof e == "function" ? ac : sc)(t, e, n ?? "")) : _r(this.node(), t); +function hc(e, t, n) { + return arguments.length > 1 ? this.each((t == null ? uc : typeof t == "function" ? cc : fc)(e, t, n ?? "")) : gr(this.node(), e); } -function _r(t, e) { - return t.style.getPropertyValue(e) || Jo(t).getComputedStyle(t, null).getPropertyValue(e); +function gr(e, t) { + return e.style.getPropertyValue(t) || Qo(e).getComputedStyle(e, null).getPropertyValue(t); } -function lc(t) { +function dc(e) { return function() { - delete this[t]; + delete this[e]; }; } -function uc(t, e) { +function pc(e, t) { return function() { - this[t] = e; + this[e] = t; }; } -function fc(t, e) { +function vc(e, t) { return function() { - var n = e.apply(this, arguments); - n == null ? delete this[t] : this[t] = n; + var n = t.apply(this, arguments); + n == null ? delete this[e] : this[e] = n; }; } -function cc(t, e) { - return arguments.length > 1 ? this.each((e == null ? lc : typeof e == "function" ? fc : uc)(t, e)) : this.node()[t]; +function gc(e, t) { + return arguments.length > 1 ? this.each((t == null ? dc : typeof t == "function" ? vc : pc)(e, t)) : this.node()[e]; } -function Zo(t) { - return t.trim().split(/^|\s+/); +function el(e) { + return e.trim().split(/^|\s+/); } -function zs(t) { - return t.classList || new Qo(t); +function Xs(e) { + return e.classList || new tl(e); } -function Qo(t) { - this._node = t, this._names = Zo(t.getAttribute("class") || ""); +function tl(e) { + this._node = e, this._names = el(e.getAttribute("class") || ""); } -Qo.prototype = { - add: function(t) { - var e = this._names.indexOf(t); - e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); +tl.prototype = { + add: function(e) { + var t = this._names.indexOf(e); + t < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" "))); }, - remove: function(t) { - var e = this._names.indexOf(t); - e >= 0 && (this._names.splice(e, 1), this._node.setAttribute("class", this._names.join(" "))); + remove: function(e) { + var t = this._names.indexOf(e); + t >= 0 && (this._names.splice(t, 1), this._node.setAttribute("class", this._names.join(" "))); }, - contains: function(t) { - return this._names.indexOf(t) >= 0; + contains: function(e) { + return this._names.indexOf(e) >= 0; } }; -function tl(t, e) { - for (var n = zs(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +function nl(e, t) { + for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.add(t[r]); } -function el(t, e) { - for (var n = zs(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +function rl(e, t) { + for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); } -function hc(t) { +function _c(e) { return function() { - tl(this, t); + nl(this, e); }; } -function dc(t) { +function mc(e) { return function() { - el(this, t); + rl(this, e); }; } -function pc(t, e) { +function yc(e, t) { return function() { - (e.apply(this, arguments) ? tl : el)(this, t); + (t.apply(this, arguments) ? nl : rl)(this, e); }; } -function vc(t, e) { - var n = Zo(t + ""); +function wc(e, t) { + var n = el(e + ""); if (arguments.length < 2) { - for (var r = zs(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + 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 e == "function" ? pc : e ? hc : dc)(n, e)); + return this.each((typeof t == "function" ? yc : t ? _c : mc)(n, t)); } -function gc() { +function xc() { this.textContent = ""; } -function _c(t) { +function bc(e) { return function() { - this.textContent = t; + this.textContent = e; }; } -function mc(t) { +function $c(e) { return function() { - var e = t.apply(this, arguments); - this.textContent = e ?? ""; + var t = e.apply(this, arguments); + this.textContent = t ?? ""; }; } -function yc(t) { - return arguments.length ? this.each(t == null ? gc : (typeof t == "function" ? mc : _c)(t)) : this.node().textContent; +function Ac(e) { + return arguments.length ? this.each(e == null ? xc : (typeof e == "function" ? $c : bc)(e)) : this.node().textContent; } -function wc() { +function Ec() { this.innerHTML = ""; } -function xc(t) { +function Tc(e) { return function() { - this.innerHTML = t; + this.innerHTML = e; }; } -function bc(t) { +function Cc(e) { return function() { - var e = t.apply(this, arguments); - this.innerHTML = e ?? ""; + var t = e.apply(this, arguments); + this.innerHTML = t ?? ""; }; } -function $c(t) { - return arguments.length ? this.each(t == null ? wc : (typeof t == "function" ? bc : xc)(t)) : this.node().innerHTML; +function Rc(e) { + return arguments.length ? this.each(e == null ? Ec : (typeof e == "function" ? Cc : Tc)(e)) : this.node().innerHTML; } -function Ac() { +function Sc() { this.nextSibling && this.parentNode.appendChild(this); } -function Ec() { - return this.each(Ac); +function Nc() { + return this.each(Sc); } -function Tc() { +function kc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function Rc() { - return this.each(Tc); +function Mc() { + return this.each(kc); } -function Cc(t) { - var e = typeof t == "function" ? t : Wo(t); +function Pc(e) { + var t = typeof e == "function" ? e : Go(e); return this.select(function() { - return this.appendChild(e.apply(this, arguments)); + return this.appendChild(t.apply(this, arguments)); }); } -function Sc() { +function Dc() { return null; } -function Nc(t, e) { - var n = typeof t == "function" ? t : Wo(t), r = e == null ? Sc : typeof e == "function" ? e : Ys(e); +function Oc(e, t) { + var n = typeof e == "function" ? e : Go(e), r = t == null ? Dc : typeof t == "function" ? t : Bs(t); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function kc() { - var t = this.parentNode; - t && t.removeChild(this); +function Ic() { + var e = this.parentNode; + e && e.removeChild(this); } -function Mc() { - return this.each(kc); +function Fc() { + return this.each(Ic); } -function Pc() { - var t = this.cloneNode(!1), e = this.parentNode; - return e ? e.insertBefore(t, this.nextSibling) : t; +function Lc() { + var e = this.cloneNode(!1), t = this.parentNode; + return t ? t.insertBefore(e, this.nextSibling) : e; } -function Dc() { - var t = this.cloneNode(!0), e = this.parentNode; - return e ? e.insertBefore(t, this.nextSibling) : t; +function qc() { + var e = this.cloneNode(!0), t = this.parentNode; + return t ? t.insertBefore(e, this.nextSibling) : e; } -function Ic(t) { - return this.select(t ? Dc : Pc); +function Vc(e) { + return this.select(e ? qc : Lc); } -function Fc(t) { - return arguments.length ? this.property("__data__", t) : this.node().__data__; +function zc(e) { + return arguments.length ? this.property("__data__", e) : this.node().__data__; } -function Oc(t) { - return function(e) { - t.call(this, e, this.__data__); +function Hc(e) { + return function(t) { + e.call(this, t, this.__data__); }; } -function Lc(t) { - return t.trim().split(/^|\s+/).map(function(e) { - var n = "", r = e.indexOf("."); - return r >= 0 && (n = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: n }; +function Yc(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 qc(t) { +function Bc(e) { return function() { - var e = this.__on; - if (e) { - for (var n = 0, r = -1, i = e.length, s; n < i; ++n) - s = e[n], (!t.type || s.type === t.type) && s.name === t.name ? this.removeEventListener(s.type, s.listener, s.options) : e[++r] = s; - ++r ? e.length = r : delete this.__on; + var t = this.__on; + if (t) { + for (var n = 0, r = -1, i = t.length, s; n < i; ++n) + s = t[n], (!e.type || s.type === e.type) && s.name === e.name ? this.removeEventListener(s.type, s.listener, s.options) : t[++r] = s; + ++r ? t.length = r : delete this.__on; } }; } -function Vc(t, e, n) { +function Xc(e, t, n) { return function() { - var r = this.__on, i, s = Oc(e); + var r = this.__on, i, s = Hc(t); if (r) { for (var a = 0, o = r.length; a < o; ++a) - if ((i = r[a]).type === t.type && i.name === t.name) { - this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = e; + if ((i = r[a]).type === e.type && i.name === e.name) { + this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = s, i.options = n), i.value = t; return; } } - this.addEventListener(t.type, s, n), i = { type: t.type, name: t.name, value: e, listener: s, options: n }, r ? r.push(i) : this.__on = [i]; + 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 Hc(t, e, n) { - var r = Lc(t + ""), i, s = r.length, a; +function Wc(e, t, n) { + var r = Yc(e + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3472,93 +3472,93 @@ function Hc(t, e, n) { } return; } - for (o = e ? Vc : qc, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + for (o = t ? Xc : Bc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); return this; } -function nl(t, e, n) { - var r = Jo(t), i = r.CustomEvent; - typeof i == "function" ? i = new i(e, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(e, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(e, !1, !1)), t.dispatchEvent(i); +function il(e, t, n) { + var r = Qo(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 Yc(t, e) { +function Uc(e, t) { return function() { - return nl(this, t, e); + return il(this, e, t); }; } -function zc(t, e) { +function Gc(e, t) { return function() { - return nl(this, t, e.apply(this, arguments)); + return il(this, e, t.apply(this, arguments)); }; } -function Bc(t, e) { - return this.each((typeof e == "function" ? zc : Yc)(t, e)); +function Kc(e, t) { + return this.each((typeof t == "function" ? Gc : Uc)(e, t)); } -function* Xc() { - for (var t = this._groups, e = 0, n = t.length; e < n; ++e) - for (var r = t[e], i = 0, s = r.length, a; i < s; ++i) +function* jc() { + 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 rl = [null]; -function ae(t, e) { - this._groups = t, this._parents = e; +var sl = [null]; +function at(e, t) { + this._groups = e, this._parents = t; } -function xr() { - return new ae([[document.documentElement]], rl); +function wr() { + return new at([[document.documentElement]], sl); } -function Wc() { +function Jc() { return this; } -ae.prototype = xr.prototype = { - constructor: ae, - select: mf, - selectAll: bf, - selectChild: Tf, - selectChildren: Nf, - filter: kf, - data: Of, - enter: Mf, - exit: qf, - join: Vf, - merge: Hf, - selection: Wc, - order: Yf, - sort: zf, - call: Xf, - nodes: Wf, - node: Uf, - size: Gf, - empty: Kf, - each: jf, - attr: rc, - style: oc, - property: cc, - classed: vc, - text: yc, - html: $c, - raise: Ec, - lower: Rc, - append: Cc, - insert: Nc, - remove: Mc, - clone: Ic, - datum: Fc, - on: Hc, - dispatch: Bc, - [Symbol.iterator]: Xc +at.prototype = wr.prototype = { + constructor: at, + select: $f, + selectAll: Cf, + selectChild: kf, + selectChildren: Of, + filter: If, + data: Hf, + enter: Ff, + exit: Bf, + join: Xf, + merge: Wf, + selection: Jc, + order: Uf, + sort: Gf, + call: jf, + nodes: Jf, + node: Zf, + size: Qf, + empty: ec, + each: tc, + attr: lc, + style: hc, + property: gc, + classed: wc, + text: Ac, + html: Rc, + raise: Nc, + lower: Mc, + append: Pc, + insert: Oc, + remove: Fc, + clone: Vc, + datum: zc, + on: Wc, + dispatch: Kc, + [Symbol.iterator]: jc }; -function ct(t) { - return typeof t == "string" ? new ae([[document.querySelector(t)]], [document.documentElement]) : new ae([[t]], rl); +function fe(e) { + return typeof e == "string" ? new at([[document.querySelector(e)]], [document.documentElement]) : new at([[e]], sl); } -function Bs(t, e, n) { - t.prototype = e.prototype = n, n.constructor = t; +function Ws(e, t, n) { + e.prototype = t.prototype = n, n.constructor = e; } -function il(t, e) { - var n = Object.create(t.prototype); - for (var r in e) n[r] = e[r]; +function al(e, t) { + var n = Object.create(e.prototype); + for (var r in t) n[r] = t[r]; return n; } function Kr() { } -var Lr = 0.7, Ei = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", De = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Uc = /^#([0-9a-f]{3,8})$/, Gc = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), Kc = new RegExp(`^rgb\\(${De},${De},${De}\\)$`), jc = new RegExp(`^rgba\\(${nr},${nr},${nr},${qr}\\)$`), Jc = new RegExp(`^rgba\\(${De},${De},${De},${qr}\\)$`), Zc = new RegExp(`^hsl\\(${qr},${De},${De}\\)$`), Qc = new RegExp(`^hsla\\(${qr},${De},${De},${qr}\\)$`), Aa = { +var Lr = 0.7, Ti = 1 / Lr, tr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Ft = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Zc = /^#([0-9a-f]{3,8})$/, Qc = new RegExp(`^rgb\\(${tr},${tr},${tr}\\)$`), eh = new RegExp(`^rgb\\(${Ft},${Ft},${Ft}\\)$`), th = new RegExp(`^rgba\\(${tr},${tr},${tr},${qr}\\)$`), nh = new RegExp(`^rgba\\(${Ft},${Ft},${Ft},${qr}\\)$`), rh = new RegExp(`^hsl\\(${qr},${Ft},${Ft}\\)$`), ih = new RegExp(`^hsla\\(${qr},${Ft},${Ft},${qr}\\)$`), Ta = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3708,243 +3708,243 @@ var Lr = 0.7, Ei = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Bs(Kr, Wn, { - copy(t) { - return Object.assign(new this.constructor(), this, t); +Ws(Kr, Gn, { + copy(e) { + return Object.assign(new this.constructor(), this, e); }, displayable() { return this.rgb().displayable(); }, - hex: Ea, + hex: Ca, // Deprecated! Use color.formatHex. - formatHex: Ea, - formatHex8: th, - formatHsl: eh, - formatRgb: Ta, - toString: Ta + formatHex: Ca, + formatHex8: sh, + formatHsl: ah, + formatRgb: Ra, + toString: Ra }); -function Ea() { +function Ca() { return this.rgb().formatHex(); } -function th() { +function sh() { return this.rgb().formatHex8(); } -function eh() { - return sl(this).formatHsl(); +function ah() { + return ol(this).formatHsl(); } -function Ta() { +function Ra() { return this.rgb().formatRgb(); } -function Wn(t) { - var e, n; - return t = (t + "").trim().toLowerCase(), (e = Uc.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ra(e) : n === 3 ? new Zt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? si(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? si(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = Gc.exec(t)) ? new Zt(e[1], e[2], e[3], 1) : (e = Kc.exec(t)) ? new Zt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = jc.exec(t)) ? si(e[1], e[2], e[3], e[4]) : (e = Jc.exec(t)) ? si(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Zc.exec(t)) ? Na(e[1], e[2] / 100, e[3] / 100, 1) : (e = Qc.exec(t)) ? Na(e[1], e[2] / 100, e[3] / 100, e[4]) : Aa.hasOwnProperty(t) ? Ra(Aa[t]) : t === "transparent" ? new Zt(NaN, NaN, NaN, 0) : null; +function Gn(e) { + var t, n; + return e = (e + "").trim().toLowerCase(), (t = Zc.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 ? ai(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? ai(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 = Qc.exec(e)) ? new Je(t[1], t[2], t[3], 1) : (t = eh.exec(e)) ? new Je(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = th.exec(e)) ? ai(t[1], t[2], t[3], t[4]) : (t = nh.exec(e)) ? ai(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = rh.exec(e)) ? Ma(t[1], t[2] / 100, t[3] / 100, 1) : (t = ih.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; } -function Ra(t) { - return new Zt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +function Sa(e) { + return new Je(e >> 16 & 255, e >> 8 & 255, e & 255, 1); } -function si(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new Zt(t, e, n, r); +function ai(e, t, n, r) { + return r <= 0 && (e = t = n = NaN), new Je(e, t, n, r); } -function nh(t) { - return t instanceof Kr || (t = Wn(t)), t ? (t = t.rgb(), new Zt(t.r, t.g, t.b, t.opacity)) : new Zt(); +function oh(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 ws(t, e, n, r) { - return arguments.length === 1 ? nh(t) : new Zt(t, e, n, r ?? 1); +function bs(e, t, n, r) { + return arguments.length === 1 ? oh(e) : new Je(e, t, n, r ?? 1); } -function Zt(t, e, n, r) { - this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; +function Je(e, t, n, r) { + this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; } -Bs(Zt, ws, il(Kr, { - brighter(t) { - return t = t == null ? Ei : Math.pow(Ei, t), new Zt(this.r * t, this.g * t, this.b * t, this.opacity); +Ws(Je, bs, al(Kr, { + brighter(e) { + return e = e == null ? Ti : Math.pow(Ti, e), new Je(this.r * e, this.g * e, this.b * e, this.opacity); }, - darker(t) { - return t = t == null ? Lr : Math.pow(Lr, t), new Zt(this.r * t, this.g * t, this.b * t, 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); }, rgb() { return this; }, clamp() { - return new Zt(zn(this.r), zn(this.g), zn(this.b), Ti(this.opacity)); + return new Je(Xn(this.r), Xn(this.g), Xn(this.b), Ci(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: Ca, + hex: Na, // Deprecated! Use color.formatHex. - formatHex: Ca, - formatHex8: rh, - formatRgb: Sa, - toString: Sa + formatHex: Na, + formatHex8: lh, + formatRgb: ka, + toString: ka })); -function Ca() { - return `#${Pn(this.r)}${Pn(this.g)}${Pn(this.b)}`; +function Na() { + return `#${On(this.r)}${On(this.g)}${On(this.b)}`; } -function rh() { - return `#${Pn(this.r)}${Pn(this.g)}${Pn(this.b)}${Pn((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function lh() { + return `#${On(this.r)}${On(this.g)}${On(this.b)}${On((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function Sa() { - const t = Ti(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${zn(this.r)}, ${zn(this.g)}, ${zn(this.b)}${t === 1 ? ")" : `, ${t})`}`; +function ka() { + const e = Ci(this.opacity); + return `${e === 1 ? "rgb(" : "rgba("}${Xn(this.r)}, ${Xn(this.g)}, ${Xn(this.b)}${e === 1 ? ")" : `, ${e})`}`; } -function Ti(t) { - return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); +function Ci(e) { + return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); } -function zn(t) { - return Math.max(0, Math.min(255, Math.round(t) || 0)); +function Xn(e) { + return Math.max(0, Math.min(255, Math.round(e) || 0)); } -function Pn(t) { - return t = zn(t), (t < 16 ? "0" : "") + t.toString(16); +function On(e) { + return e = Xn(e), (e < 16 ? "0" : "") + e.toString(16); } -function Na(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new be(t, e, n, r); +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 wt(e, t, n, r); } -function sl(t) { - if (t instanceof be) return new be(t.h, t.s, t.l, t.opacity); - if (t instanceof Kr || (t = Wn(t)), !t) return new be(); - if (t instanceof be) return t; - t = t.rgb(); - var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), s = Math.max(e, n, r), a = NaN, o = s - i, l = (s + i) / 2; - return o ? (e === s ? a = (n - r) / o + (n < r) * 6 : n === s ? a = (r - e) / o + 2 : a = (e - n) / o + 4, o /= l < 0.5 ? s + i : 2 - s - i, a *= 60) : o = l > 0 && l < 1 ? 0 : a, new be(a, o, l, t.opacity); +function ol(e) { + if (e instanceof wt) return new wt(e.h, e.s, e.l, e.opacity); + if (e instanceof Kr || (e = Gn(e)), !e) return new wt(); + if (e instanceof wt) 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 wt(a, o, l, e.opacity); } -function ih(t, e, n, r) { - return arguments.length === 1 ? sl(t) : new be(t, e, n, r ?? 1); +function uh(e, t, n, r) { + return arguments.length === 1 ? ol(e) : new wt(e, t, n, r ?? 1); } -function be(t, e, n, r) { - this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; +function wt(e, t, n, r) { + this.h = +e, this.s = +t, this.l = +n, this.opacity = +r; } -Bs(be, ih, il(Kr, { - brighter(t) { - return t = t == null ? Ei : Math.pow(Ei, t), new be(this.h, this.s, this.l * t, this.opacity); +Ws(wt, uh, al(Kr, { + brighter(e) { + return e = e == null ? Ti : Math.pow(Ti, e), new wt(this.h, this.s, this.l * e, this.opacity); }, - darker(t) { - return t = t == null ? Lr : Math.pow(Lr, t), new be(this.h, this.s, this.l * t, this.opacity); + darker(e) { + return e = e == null ? Lr : Math.pow(Lr, e), new wt(this.h, this.s, this.l * e, this.opacity); }, rgb() { - var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; - return new Zt( - es(t >= 240 ? t - 240 : t + 120, i, r), - es(t, i, r), - es(t < 120 ? t + 240 : t - 120, i, r), + 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( + rs(e >= 240 ? e - 240 : e + 120, i, r), + rs(e, i, r), + rs(e < 120 ? e + 240 : e - 120, i, r), this.opacity ); }, clamp() { - return new be(ka(this.h), ai(this.s), ai(this.l), Ti(this.opacity)); + return new wt(Pa(this.h), oi(this.s), oi(this.l), Ci(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 t = Ti(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${ka(this.h)}, ${ai(this.s) * 100}%, ${ai(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const e = Ci(this.opacity); + return `${e === 1 ? "hsl(" : "hsla("}${Pa(this.h)}, ${oi(this.s) * 100}%, ${oi(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; } })); -function ka(t) { - return t = (t || 0) % 360, t < 0 ? t + 360 : t; +function Pa(e) { + return e = (e || 0) % 360, e < 0 ? e + 360 : e; } -function ai(t) { - return Math.max(0, Math.min(1, t || 0)); +function oi(e) { + return Math.max(0, Math.min(1, e || 0)); } -function es(t, e, n) { - return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; +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 Xs = (t) => () => t; -function sh(t, e) { +const Us = (e) => () => e; +function fh(e, t) { return function(n) { - return t + n * e; + return e + n * t; }; } -function ah(t, e, n) { - return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) { - return Math.pow(t + r * e, n); +function ch(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 oh(t) { - return (t = +t) == 1 ? al : function(e, n) { - return n - e ? ah(e, n, t) : Xs(isNaN(e) ? n : e); +function hh(e) { + return (e = +e) == 1 ? ll : function(t, n) { + return n - t ? ch(t, n, e) : Us(isNaN(t) ? n : t); }; } -function al(t, e) { - var n = e - t; - return n ? sh(t, n) : Xs(isNaN(t) ? e : t); +function ll(e, t) { + var n = t - e; + return n ? fh(e, n) : Us(isNaN(e) ? t : e); } -const Ri = (function t(e) { - var n = oh(e); +const Ri = (function e(t) { + var n = hh(t); function r(i, s) { - var a = n((i = ws(i)).r, (s = ws(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = al(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 = ll(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 = t, r; + return r.gamma = e, r; })(1); -function lh(t, e) { - e || (e = []); - var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; +function dh(e, t) { + t || (t = []); + var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i; return function(s) { - for (i = 0; i < n; ++i) r[i] = t[i] * (1 - s) + e[i] * s; + for (i = 0; i < n; ++i) r[i] = e[i] * (1 - s) + t[i] * s; return r; }; } -function uh(t) { - return ArrayBuffer.isView(t) && !(t instanceof DataView); +function ph(e) { + return ArrayBuffer.isView(e) && !(e instanceof DataView); } -function fh(t, e) { - var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), s = new Array(n), a; - for (a = 0; a < r; ++a) i[a] = Ge(t[a], e[a]); - for (; a < n; ++a) s[a] = e[a]; +function vh(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] = 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 ch(t, e) { +function gh(e, t) { var n = /* @__PURE__ */ new Date(); - return t = +t, e = +e, function(r) { - return n.setTime(t * (1 - r) + e * r), n; + return e = +e, t = +t, function(r) { + return n.setTime(e * (1 - r) + t * r), n; }; } -function Pe(t, e) { - return t = +t, e = +e, function(n) { - return t * (1 - n) + e * n; +function It(e, t) { + return e = +e, t = +t, function(n) { + return e * (1 - n) + t * n; }; } -function hh(t, e) { +function _h(e, t) { var n = {}, r = {}, i; - (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); - for (i in e) - i in t ? n[i] = Ge(t[i], e[i]) : r[i] = e[i]; + (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {}); + for (i in t) + 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 xs = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ns = new RegExp(xs.source, "g"); -function dh(t) { +var $s = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, is = new RegExp($s.source, "g"); +function mh(e) { return function() { - return t; + return e; }; } -function ph(t) { - return function(e) { - return t(e) + ""; +function yh(e) { + return function(t) { + return e(t) + ""; }; } -function ol(t, e) { - var n = xs.lastIndex = ns.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = xs.exec(t)) && (i = ns.exec(e)); ) - (s = i.index) > n && (s = e.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: Pe(r, i) })), n = ns.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? ph(l[0].x) : dh(e) : (e = l.length, function(u) { - for (var f = 0, h; f < e; ++f) o[(h = l[f]).i] = h.x(u); +function ul(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: It(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] ? yh(l[0].x) : mh(t) : (t = l.length, function(u) { + for (var f = 0, p; f < t; ++f) o[(p = l[f]).i] = p.x(u); return o.join(""); }); } -function Ge(t, e) { - var n = typeof e, r; - return e == null || n === "boolean" ? Xs(e) : (n === "number" ? Pe : n === "string" ? (r = Wn(e)) ? (e = r, Ri) : ol : e instanceof Wn ? Ri : e instanceof Date ? ch : uh(e) ? lh : Array.isArray(e) ? fh : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? hh : Pe)(t, e); +function Jt(e, t) { + var n = typeof t, r; + return t == null || n === "boolean" ? Us(t) : (n === "number" ? It : n === "string" ? (r = Gn(t)) ? (t = r, Ri) : ul : t instanceof Gn ? Ri : t instanceof Date ? gh : ph(t) ? dh : Array.isArray(t) ? vh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? _h : It)(e, t); } -var Ma = 180 / Math.PI, bs = { +var Da = 180 / Math.PI, As = { translateX: 0, translateY: 0, rotate: 0, @@ -3952,213 +3952,213 @@ var Ma = 180 / Math.PI, bs = { scaleX: 1, scaleY: 1 }; -function ll(t, e, n, r, i, s) { +function fl(e, t, n, r, i, s) { var a, o, l; - return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (l = t * n + e * r) && (n -= t * l, r -= e * l), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, l /= o), t * r < e * n && (t = -t, e = -e, l = -l, a = -a), { + 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(e, t) * Ma, - skewX: Math.atan(l) * Ma, + rotate: Math.atan2(t, e) * Da, + skewX: Math.atan(l) * Da, scaleX: a, scaleY: o }; } -var oi; -function vh(t) { - const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? bs : ll(e.a, e.b, e.c, e.d, e.e, e.f); +var li; +function wh(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); } -function gh(t) { - return t == null || (oi || (oi = document.createElementNS("http://www.w3.org/2000/svg", "g")), oi.setAttribute("transform", t), !(t = oi.transform.baseVal.consolidate())) ? bs : (t = t.matrix, ll(t.a, t.b, t.c, t.d, t.e, t.f)); +function xh(e) { + return e == null || (li || (li = document.createElementNS("http://www.w3.org/2000/svg", "g")), li.setAttribute("transform", e), !(e = li.transform.baseVal.consolidate())) ? As : (e = e.matrix, fl(e.a, e.b, e.c, e.d, e.e, e.f)); } -function ul(t, e, n, r) { +function cl(e, t, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } - function s(u, f, h, c, p, m) { - if (u !== h || f !== c) { - var $ = p.push("translate(", null, e, null, n); - m.push({ i: $ - 4, x: Pe(u, h) }, { i: $ - 2, x: Pe(f, c) }); - } else (h || c) && p.push("translate(" + h + e + c + n); + function s(u, f, p, c, d, y) { + if (u !== p || f !== c) { + var b = d.push("translate(", null, t, null, n); + y.push({ i: b - 4, x: It(u, p) }, { i: b - 2, x: It(f, c) }); + } else (p || c) && d.push("translate(" + p + t + c + n); } - function a(u, f, h, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Pe(u, f) })) : f && h.push(i(h) + "rotate(" + f + r); + function a(u, f, p, c) { + u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: p.push(i(p) + "rotate(", null, r) - 2, x: It(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); } - function o(u, f, h, c) { - u !== f ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Pe(u, f) }) : f && h.push(i(h) + "skewX(" + f + r); + function o(u, f, p, c) { + u !== f ? c.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: It(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); } - function l(u, f, h, c, p, m) { - if (u !== h || f !== c) { - var $ = p.push(i(p) + "scale(", null, ",", null, ")"); - m.push({ i: $ - 4, x: Pe(u, h) }, { i: $ - 2, x: Pe(f, c) }); - } else (h !== 1 || c !== 1) && p.push(i(p) + "scale(" + h + "," + c + ")"); + function l(u, f, p, c, d, y) { + if (u !== p || f !== c) { + var b = d.push(i(d) + "scale(", null, ",", null, ")"); + y.push({ i: b - 4, x: It(u, p) }, { i: b - 2, x: It(f, c) }); + } else (p !== 1 || c !== 1) && d.push(i(d) + "scale(" + p + "," + c + ")"); } return function(u, f) { - var h = [], c = []; - return u = t(u), f = t(f), s(u.translateX, u.translateY, f.translateX, f.translateY, h, c), a(u.rotate, f.rotate, h, c), o(u.skewX, f.skewX, h, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, h, c), u = f = null, function(p) { - for (var m = -1, $ = c.length, _; ++m < $; ) h[(_ = c[m]).i] = _.x(p); - return h.join(""); + var p = [], c = []; + return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, p, c), a(u.rotate, f.rotate, p, c), o(u.skewX, f.skewX, p, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, p, c), u = f = null, function(d) { + for (var y = -1, b = c.length, m; ++y < b; ) p[(m = c[y]).i] = m.x(d); + return p.join(""); }; }; } -var _h = ul(vh, "px, ", "px)", "deg)"), mh = ul(gh, ", ", ")", ")"), mr = 0, Nr = 0, Cr = 0, fl = 1e3, Ci, kr, Si = 0, Un = 0, Wi = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, cl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { - setTimeout(t, 17); +var bh = cl(wh, "px, ", "px)", "deg)"), $h = cl(xh, ", ", ")", ")"), _r = 0, Nr = 0, Rr = 0, hl = 1e3, Si, kr, Ni = 0, Kn = 0, Ui = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, dl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { + setTimeout(e, 17); }; -function Ws() { - return Un || (cl(yh), Un = Vr.now() + Wi); +function Gs() { + return Kn || (dl(Ah), Kn = Vr.now() + Ui); } -function yh() { - Un = 0; +function Ah() { + Kn = 0; } -function Ni() { +function ki() { this._call = this._time = this._next = null; } -Ni.prototype = hl.prototype = { - constructor: Ni, - restart: function(t, e, n) { - if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Ws() : +n) + (e == null ? 0 : +e), !this._next && kr !== this && (kr ? kr._next = this : Ci = this, kr = this), this._call = t, this._time = n, $s(); +ki.prototype = pl.prototype = { + constructor: ki, + 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 : Si = this, kr = this), this._call = e, this._time = n, Es(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, $s()); + this._call && (this._call = null, this._time = 1 / 0, Es()); } }; -function hl(t, e, n) { - var r = new Ni(); - return r.restart(t, e, n), r; -} -function wh() { - Ws(), ++mr; - for (var t = Ci, e; t; ) - (e = Un - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --mr; -} -function Pa() { - Un = (Si = Vr.now()) + Wi, mr = Nr = 0; +function pl(e, t, n) { + var r = new ki(); + return r.restart(e, t, n), r; +} +function Eh() { + Gs(), ++_r; + for (var e = Si, t; e; ) + (t = Kn - e._time) >= 0 && e._call.call(void 0, t), e = e._next; + --_r; +} +function Oa() { + Kn = (Ni = Vr.now()) + Ui, _r = Nr = 0; try { - wh(); + Eh(); } finally { - mr = 0, bh(), Un = 0; + _r = 0, Ch(), Kn = 0; } } -function xh() { - var t = Vr.now(), e = t - Si; - e > fl && (Wi -= e, Si = t); +function Th() { + var e = Vr.now(), t = e - Ni; + t > hl && (Ui -= t, Ni = e); } -function bh() { - for (var t, e = Ci, n, r = 1 / 0; e; ) - e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : Ci = n); - kr = t, $s(r); +function Ch() { + 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); + kr = e, Es(r); } -function $s(t) { - if (!mr) { +function Es(e) { + if (!_r) { Nr && (Nr = clearTimeout(Nr)); - var e = t - Un; - e > 24 ? (t < 1 / 0 && (Nr = setTimeout(Pa, t - Vr.now() - Wi)), Cr && (Cr = clearInterval(Cr))) : (Cr || (Si = Vr.now(), Cr = setInterval(xh, fl)), mr = 1, cl(Pa)); + var t = e - Kn; + t > 24 ? (e < 1 / 0 && (Nr = setTimeout(Oa, e - Vr.now() - Ui)), Rr && (Rr = clearInterval(Rr))) : (Rr || (Ni = Vr.now(), Rr = setInterval(Th, hl)), _r = 1, dl(Oa)); } } -function Da(t, e, n) { - var r = new Ni(); - return e = e == null ? 0 : +e, r.restart((i) => { - r.stop(), t(i + e); - }, e, n), r; +function Ia(e, t, n) { + var r = new ki(); + return t = t == null ? 0 : +t, r.restart((i) => { + r.stop(), e(i + t); + }, t, n), r; } -var $h = Xo("start", "end", "cancel", "interrupt"), Ah = [], dl = 0, Ia = 1, As = 2, _i = 3, Fa = 4, Es = 5, mi = 6; -function Ui(t, e, n, r, i, s) { - var a = t.__transition; - if (!a) t.__transition = {}; +var Rh = Uo("start", "end", "cancel", "interrupt"), Sh = [], vl = 0, Fa = 1, Ts = 2, mi = 3, La = 4, Cs = 5, yi = 6; +function Gi(e, t, n, r, i, s) { + var a = e.__transition; + if (!a) e.__transition = {}; else if (n in a) return; - Eh(t, n, { - name: e, + Nh(e, n, { + name: t, index: r, // For context during callback. group: i, // For context during callback. - on: $h, - tween: Ah, + on: Rh, + tween: Sh, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: dl + state: vl }); } -function Us(t, e) { - var n = Re(t, e); - if (n.state > dl) throw new Error("too late; already scheduled"); +function Ks(e, t) { + var n = Et(e, t); + if (n.state > vl) throw new Error("too late; already scheduled"); return n; } -function Ve(t, e) { - var n = Re(t, e); - if (n.state > _i) throw new Error("too late; already running"); +function Yt(e, t) { + var n = Et(e, t); + if (n.state > mi) throw new Error("too late; already running"); return n; } -function Re(t, e) { - var n = t.__transition; - if (!n || !(n = n[e])) throw new Error("transition not found"); +function Et(e, t) { + var n = e.__transition; + if (!n || !(n = n[t])) throw new Error("transition not found"); return n; } -function Eh(t, e, n) { - var r = t.__transition, i; - r[e] = n, n.timer = hl(s, 0, n.time); +function Nh(e, t, n) { + var r = e.__transition, i; + r[t] = n, n.timer = pl(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 = Fa, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { - var f, h, c, p; - if (n.state !== Ia) return l(); + var f, p, c, d; + if (n.state !== Fa) return l(); for (f in r) - if (p = r[f], p.name === n.name) { - if (p.state === _i) return Da(a); - p.state === Fa ? (p.state = mi, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[f]) : +f < e && (p.state = mi, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[f]); + if (d = r[f], d.name === n.name) { + if (d.state === mi) return Ia(a); + d.state === La ? (d.state = yi, d.timer.stop(), d.on.call("interrupt", e, e.__data__, d.index, d.group), delete r[f]) : +f < t && (d.state = yi, d.timer.stop(), d.on.call("cancel", e, e.__data__, d.index, d.group), delete r[f]); } - if (Da(function() { - n.state === _i && (n.state = Fa, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = As, n.on.call("start", t, t.__data__, n.index, n.group), n.state === As) { - for (n.state = _i, i = new Array(c = n.tween.length), f = 0, h = -1; f < c; ++f) - (p = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = p); - i.length = h + 1; + if (Ia(function() { + n.state === mi && (n.state = La, 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 = mi, i = new Array(c = n.tween.length), f = 0, p = -1; f < c; ++f) + (d = n.tween[f].value.call(e, e.__data__, n.index, n.group)) && (i[++p] = d); + i.length = p + 1; } } function o(u) { - for (var f = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(l), n.state = Es, 1), h = -1, c = i.length; ++h < c; ) - i[h].call(t, f); - n.state === Es && (n.on.call("end", t, t.__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 = Cs, 1), p = -1, c = i.length; ++p < c; ) + i[p].call(e, f); + n.state === Cs && (n.on.call("end", e, e.__data__, n.index, n.group), l()); } function l() { - n.state = mi, n.timer.stop(), delete r[e]; + n.state = yi, n.timer.stop(), delete r[t]; for (var u in r) return; - delete t.__transition; + delete e.__transition; } } -function Th(t, e) { - var n = t.__transition, r, i, s = !0, a; +function kh(e, t) { + var n = e.__transition, r, i, s = !0, a; if (n) { - e = e == null ? null : e + ""; + t = t == null ? null : t + ""; for (a in n) { - if ((r = n[a]).name !== e) { + if ((r = n[a]).name !== t) { s = !1; continue; } - i = r.state > As && r.state < Es, r.state = mi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > Ts && r.state < Cs, r.state = yi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; } - s && delete t.__transition; + s && delete e.__transition; } } -function Rh(t) { +function Mh(e) { return this.each(function() { - Th(this, t); + kh(this, e); }); } -function Ch(t, e) { +function Ph(e, t) { var n, r; return function() { - var i = Ve(this, t), s = i.tween; + var i = Yt(this, e), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) - if (r[a].name === e) { + if (r[a].name === t) { r = r.slice(), r.splice(a, 1); break; } @@ -4166,15 +4166,15 @@ function Ch(t, e) { i.tween = r; }; } -function Sh(t, e, n) { +function Dh(e, t, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Ve(this, t), a = s.tween; + var s = Yt(this, e), a = s.tween; if (a !== r) { i = (r = a).slice(); - for (var o = { name: e, value: n }, l = 0, u = i.length; l < u; ++l) - if (i[l].name === e) { + for (var o = { name: t, value: n }, l = 0, u = i.length; l < u; ++l) + if (i[l].name === t) { i[l] = o; break; } @@ -4183,1328 +4183,1362 @@ function Sh(t, e, n) { s.tween = i; }; } -function Nh(t, e) { +function Oh(e, t) { var n = this._id; - if (t += "", arguments.length < 2) { - for (var r = Re(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) - if ((a = r[i]).name === t) + if (e += "", arguments.length < 2) { + for (var r = Et(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + if ((a = r[i]).name === e) return a.value; return null; } - return this.each((e == null ? Ch : Sh)(n, t, e)); + return this.each((t == null ? Ph : Dh)(n, e, t)); } -function Gs(t, e, n) { - var r = t._id; - return t.each(function() { - var i = Ve(this, r); - (i.value || (i.value = {}))[e] = n.apply(this, arguments); +function js(e, t, n) { + var r = e._id; + return e.each(function() { + var i = Yt(this, r); + (i.value || (i.value = {}))[t] = n.apply(this, arguments); }), function(i) { - return Re(i, r).value[e]; + return Et(i, r).value[t]; }; } -function pl(t, e) { +function gl(e, t) { var n; - return (typeof e == "number" ? Pe : e instanceof Wn ? Ri : (n = Wn(e)) ? (e = n, Ri) : ol)(t, e); + return (typeof t == "number" ? It : t instanceof Gn ? Ri : (n = Gn(t)) ? (t = n, Ri) : ul)(e, t); } -function kh(t) { +function Ih(e) { return function() { - this.removeAttribute(t); + this.removeAttribute(e); }; } -function Mh(t) { +function Fh(e) { return function() { - this.removeAttributeNS(t.space, t.local); + this.removeAttributeNS(e.space, e.local); }; } -function Ph(t, e, n) { +function Lh(e, t, n) { var r, i = n + "", s; return function() { - var a = this.getAttribute(t); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = this.getAttribute(e); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function Dh(t, e, n) { +function qh(e, t, n) { var r, i = n + "", s; return function() { - var a = this.getAttributeNS(t.space, t.local); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = this.getAttributeNS(e.space, e.local); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function Ih(t, e, n) { +function Vh(e, t, n) { var r, i, s; return function() { var a, o = n(this), l; - return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); + 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 Fh(t, e, n) { +function zh(e, t, n) { var r, i, s; return function() { var a, o = n(this), l; - return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), l = o + "", a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o))); + 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 Oh(t, e) { - var n = Xi(t), r = n === "transform" ? mh : pl; - return this.attrTween(t, typeof e == "function" ? (n.local ? Fh : Ih)(n, r, Gs(this, "attr." + t, e)) : e == null ? (n.local ? Mh : kh)(n) : (n.local ? Dh : Ph)(n, r, e)); +function Hh(e, t) { + var n = Wi(e), r = n === "transform" ? $h : gl; + return this.attrTween(e, typeof t == "function" ? (n.local ? zh : Vh)(n, r, js(this, "attr." + e, t)) : t == null ? (n.local ? Fh : Ih)(n) : (n.local ? qh : Lh)(n, r, t)); } -function Lh(t, e) { +function Yh(e, t) { return function(n) { - this.setAttribute(t, e.call(this, n)); + this.setAttribute(e, t.call(this, n)); }; } -function qh(t, e) { +function Bh(e, t) { return function(n) { - this.setAttributeNS(t.space, t.local, e.call(this, n)); + this.setAttributeNS(e.space, e.local, t.call(this, n)); }; } -function Vh(t, e) { +function Xh(e, t) { var n, r; function i() { - var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && qh(t, s)), n; + var s = t.apply(this, arguments); + return s !== r && (n = (r = s) && Bh(e, s)), n; } - return i._value = e, i; + return i._value = t, i; } -function Hh(t, e) { +function Wh(e, t) { var n, r; function i() { - var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Lh(t, s)), n; + var s = t.apply(this, arguments); + return s !== r && (n = (r = s) && Yh(e, s)), n; } - return i._value = e, i; + return i._value = t, i; } -function Yh(t, e) { - var n = "attr." + t; +function Uh(e, t) { + var n = "attr." + e; if (arguments.length < 2) return (n = this.tween(n)) && n._value; - if (e == null) return this.tween(n, null); - if (typeof e != "function") throw new Error(); - var r = Xi(t); - return this.tween(n, (r.local ? Vh : Hh)(r, e)); + if (t == null) return this.tween(n, null); + if (typeof t != "function") throw new Error(); + var r = Wi(e); + return this.tween(n, (r.local ? Xh : Wh)(r, t)); } -function zh(t, e) { +function Gh(e, t) { return function() { - Us(this, t).delay = +e.apply(this, arguments); + Ks(this, e).delay = +t.apply(this, arguments); }; } -function Bh(t, e) { - return e = +e, function() { - Us(this, t).delay = e; +function Kh(e, t) { + return t = +t, function() { + Ks(this, e).delay = t; }; } -function Xh(t) { - var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? zh : Bh)(e, t)) : Re(this.node(), e).delay; +function jh(e) { + var t = this._id; + return arguments.length ? this.each((typeof e == "function" ? Gh : Kh)(t, e)) : Et(this.node(), t).delay; } -function Wh(t, e) { +function Jh(e, t) { return function() { - Ve(this, t).duration = +e.apply(this, arguments); + Yt(this, e).duration = +t.apply(this, arguments); }; } -function Uh(t, e) { - return e = +e, function() { - Ve(this, t).duration = e; +function Zh(e, t) { + return t = +t, function() { + Yt(this, e).duration = t; }; } -function Gh(t) { - var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Wh : Uh)(e, t)) : Re(this.node(), e).duration; +function Qh(e) { + var t = this._id; + return arguments.length ? this.each((typeof e == "function" ? Jh : Zh)(t, e)) : Et(this.node(), t).duration; } -function Kh(t, e) { - if (typeof e != "function") throw new Error(); +function ed(e, t) { + if (typeof t != "function") throw new Error(); return function() { - Ve(this, t).ease = e; + Yt(this, e).ease = t; }; } -function jh(t) { - var e = this._id; - return arguments.length ? this.each(Kh(e, t)) : Re(this.node(), e).ease; +function td(e) { + var t = this._id; + return arguments.length ? this.each(ed(t, e)) : Et(this.node(), t).ease; } -function Jh(t, e) { +function nd(e, t) { return function() { - var n = e.apply(this, arguments); + var n = t.apply(this, arguments); if (typeof n != "function") throw new Error(); - Ve(this, t).ease = n; + Yt(this, e).ease = n; }; } -function Zh(t) { - if (typeof t != "function") throw new Error(); - return this.each(Jh(this._id, t)); -} -function Qh(t) { - typeof t != "function" && (t = Go(t)); - for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) - for (var s = e[i], a = s.length, o = r[i] = [], l, u = 0; u < a; ++u) - (l = s[u]) && t.call(l, l.__data__, u, s) && o.push(l); - return new on(r, this._parents, this._name, this._id); -} -function td(t) { - if (t._id !== this._id) throw new Error(); - for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), o = 0; o < s; ++o) - for (var l = e[o], u = n[o], f = l.length, h = a[o] = new Array(f), c, p = 0; p < f; ++p) - (c = l[p] || u[p]) && (h[p] = c); +function rd(e) { + if (typeof e != "function") throw new Error(); + return this.each(nd(this._id, e)); +} +function id(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 fn(r, this._parents, this._name, this._id); +} +function sd(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), c, d = 0; d < f; ++d) + (c = l[d] || u[d]) && (p[d] = c); for (; o < r; ++o) - a[o] = e[o]; - return new on(a, this._parents, this._name, this._id); + a[o] = t[o]; + return new fn(a, this._parents, this._name, this._id); } -function ed(t) { - return (t + "").trim().split(/^|\s+/).every(function(e) { - var n = e.indexOf("."); - return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; +function ad(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 nd(t, e, n) { - var r, i, s = ed(e) ? Us : Ve; +function od(e, t, n) { + var r, i, s = ad(t) ? Ks : Yt; return function() { - var a = s(this, t), o = a.on; - o !== r && (i = (r = o).copy()).on(e, n), a.on = i; + var a = s(this, e), o = a.on; + o !== r && (i = (r = o).copy()).on(t, n), a.on = i; }; } -function rd(t, e) { +function ld(e, t) { var n = this._id; - return arguments.length < 2 ? Re(this.node(), n).on.on(t) : this.each(nd(n, t, e)); + return arguments.length < 2 ? Et(this.node(), n).on.on(e) : this.each(od(n, e, t)); } -function id(t) { +function ud(e) { return function() { - var e = this.parentNode; - for (var n in this.__transition) if (+n !== t) return; - e && e.removeChild(this); + var t = this.parentNode; + for (var n in this.__transition) if (+n !== e) return; + t && t.removeChild(this); }; } -function sd() { - return this.on("end.remove", id(this._id)); +function fd() { + return this.on("end.remove", ud(this._id)); } -function ad(t) { - var e = this._name, n = this._id; - typeof t != "function" && (t = Ys(t)); +function cd(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, h, c = 0; c < l; ++c) - (f = o[c]) && (h = t.call(f, f.__data__, c, o)) && ("__data__" in f && (h.__data__ = f.__data__), u[c] = h, Ui(u[c], e, n, c, u, Re(f, n))); - return new on(s, this._parents, e, n); + for (var o = r[a], l = o.length, u = s[a] = new Array(l), f, p, c = 0; c < l; ++c) + (f = o[c]) && (p = e.call(f, f.__data__, c, o)) && ("__data__" in f && (p.__data__ = f.__data__), u[c] = p, Gi(u[c], t, n, c, u, Et(f, n))); + return new fn(s, this._parents, t, n); } -function od(t) { - var e = this._name, n = this._id; - typeof t != "function" && (t = Uo(t)); +function hd(e) { + var t = this._name, n = this._id; + typeof e != "function" && (e = Ko(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, h = 0; h < u; ++h) - if (f = l[h]) { - for (var c = t.call(f, f.__data__, h, l), p, m = Re(f, n), $ = 0, _ = c.length; $ < _; ++$) - (p = c[$]) && Ui(p, e, n, $, c, m); + for (var l = r[o], u = l.length, f, p = 0; p < u; ++p) + if (f = l[p]) { + for (var c = e.call(f, f.__data__, p, l), d, y = Et(f, n), b = 0, m = c.length; b < m; ++b) + (d = c[b]) && Gi(d, t, n, b, c, y); s.push(c), a.push(f); } - return new on(s, a, e, n); + return new fn(s, a, t, n); } -var ld = xr.prototype.constructor; -function ud() { - return new ld(this._groups, this._parents); +var dd = wr.prototype.constructor; +function pd() { + return new dd(this._groups, this._parents); } -function fd(t, e) { +function vd(e, t) { var n, r, i; return function() { - var s = _r(this, t), a = (this.style.removeProperty(t), _r(this, t)); - return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); + var s = gr(this, e), a = (this.style.removeProperty(e), gr(this, e)); + return s === a ? null : s === n && a === r ? i : i = t(n = s, r = a); }; } -function vl(t) { +function _l(e) { return function() { - this.style.removeProperty(t); + this.style.removeProperty(e); }; } -function cd(t, e, n) { +function gd(e, t, n) { var r, i = n + "", s; return function() { - var a = _r(this, t); - return a === i ? null : a === r ? s : s = e(r = a, n); + var a = gr(this, e); + return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function hd(t, e, n) { +function _d(e, t, n) { var r, i, s; return function() { - var a = _r(this, t), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(t), _r(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + var a = gr(this, e), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(e), gr(this, e))), a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o)); }; } -function dd(t, e) { - var n, r, i, s = "style." + e, a = "end." + s, o; +function md(e, t) { + var n, r, i, s = "style." + t, a = "end." + s, o; return function() { - var l = Ve(this, t), u = l.on, f = l.value[s] == null ? o || (o = vl(e)) : void 0; + var l = Yt(this, e), u = l.on, f = l.value[s] == null ? o || (o = _l(t)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function pd(t, e, n) { - var r = (t += "") == "transform" ? _h : pl; - return e == null ? this.styleTween(t, fd(t, r)).on("end.style." + t, vl(t)) : typeof e == "function" ? this.styleTween(t, hd(t, r, Gs(this, "style." + t, e))).each(dd(this._id, t)) : this.styleTween(t, cd(t, r, e), n).on("end.style." + t, null); +function yd(e, t, n) { + var r = (e += "") == "transform" ? bh : gl; + return t == null ? this.styleTween(e, vd(e, r)).on("end.style." + e, _l(e)) : typeof t == "function" ? this.styleTween(e, _d(e, r, js(this, "style." + e, t))).each(md(this._id, e)) : this.styleTween(e, gd(e, r, t), n).on("end.style." + e, null); } -function vd(t, e, n) { +function wd(e, t, n) { return function(r) { - this.style.setProperty(t, e.call(this, r), n); + this.style.setProperty(e, t.call(this, r), n); }; } -function gd(t, e, n) { +function xd(e, t, n) { var r, i; function s() { - var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && vd(t, a, n)), r; + var a = t.apply(this, arguments); + return a !== i && (r = (i = a) && wd(e, a, n)), r; } - return s._value = e, s; + return s._value = t, s; } -function _d(t, e, n) { - var r = "style." + (t += ""); +function bd(e, t, n) { + var r = "style." + (e += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; - if (e == null) return this.tween(r, null); - if (typeof e != "function") throw new Error(); - return this.tween(r, gd(t, e, n ?? "")); + if (t == null) return this.tween(r, null); + if (typeof t != "function") throw new Error(); + return this.tween(r, xd(e, t, n ?? "")); } -function md(t) { +function $d(e) { return function() { - this.textContent = t; + this.textContent = e; }; } -function yd(t) { +function Ad(e) { return function() { - var e = t(this); - this.textContent = e ?? ""; + var t = e(this); + this.textContent = t ?? ""; }; } -function wd(t) { - return this.tween("text", typeof t == "function" ? yd(Gs(this, "text", t)) : md(t == null ? "" : t + "")); +function Ed(e) { + return this.tween("text", typeof e == "function" ? Ad(js(this, "text", e)) : $d(e == null ? "" : e + "")); } -function xd(t) { - return function(e) { - this.textContent = t.call(this, e); +function Td(e) { + return function(t) { + this.textContent = e.call(this, t); }; } -function bd(t) { - var e, n; +function Cd(e) { + var t, n; function r() { - var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && xd(i)), e; + var i = e.apply(this, arguments); + return i !== n && (t = (n = i) && Td(i)), t; } - return r._value = t, r; + return r._value = e, r; } -function $d(t) { - var e = "text"; - if (arguments.length < 1) return (e = this.tween(e)) && e._value; - if (t == null) return this.tween(e, null); - if (typeof t != "function") throw new Error(); - return this.tween(e, bd(t)); +function Rd(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, Cd(e)); } -function Ad() { - for (var t = this._name, e = this._id, n = gl(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function Sd() { + for (var e = this._name, t = this._id, n = ml(), 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 = Re(l, e); - Ui(l, t, n, u, a, { + var f = Et(l, t); + Gi(l, e, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, ease: f.ease }); } - return new on(r, this._parents, t, n); + return new fn(r, this._parents, e, n); } -function Ed() { - var t, e, n = this, r = n._id, i = n.size(); +function Nd() { + 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 = Ve(this, r), f = u.on; - f !== t && (e = (t = f).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(l)), u.on = e; + var u = Yt(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 Td = 0; -function on(t, e, n, r) { - this._groups = t, this._parents = e, this._name = n, this._id = r; -} -function yi(t) { - return xr().transition(t); -} -function gl() { - return ++Td; -} -var Ue = xr.prototype; -on.prototype = yi.prototype = { - constructor: on, - select: ad, - selectAll: od, - selectChild: Ue.selectChild, - selectChildren: Ue.selectChildren, - filter: Qh, - merge: td, - selection: ud, - transition: Ad, - call: Ue.call, - nodes: Ue.nodes, - node: Ue.node, - size: Ue.size, - empty: Ue.empty, - each: Ue.each, - on: rd, - attr: Oh, - attrTween: Yh, - style: pd, - styleTween: _d, - text: wd, - textTween: $d, - remove: sd, - tween: Nh, - delay: Xh, - duration: Gh, - ease: jh, - easeVarying: Zh, - end: Ed, - [Symbol.iterator]: Ue[Symbol.iterator] +var kd = 0; +function fn(e, t, n, r) { + this._groups = e, this._parents = t, this._name = n, this._id = r; +} +function wi(e) { + return wr().transition(e); +} +function ml() { + return ++kd; +} +var jt = wr.prototype; +fn.prototype = wi.prototype = { + constructor: fn, + select: cd, + selectAll: hd, + selectChild: jt.selectChild, + selectChildren: jt.selectChildren, + filter: id, + merge: sd, + selection: pd, + transition: Sd, + call: jt.call, + nodes: jt.nodes, + node: jt.node, + size: jt.size, + empty: jt.empty, + each: jt.each, + on: ld, + attr: Hh, + attrTween: Uh, + style: yd, + styleTween: bd, + text: Ed, + textTween: Rd, + remove: fd, + tween: Oh, + delay: jh, + duration: Qh, + ease: td, + easeVarying: rd, + end: Nd, + [Symbol.iterator]: jt[Symbol.iterator] }; -function Rd(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +function Md(e) { + return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; } -var Cd = { +var Pd = { time: null, // Set on use. delay: 0, duration: 250, - ease: Rd + ease: Md }; -function Sd(t, e) { - for (var n; !(n = t.__transition) || !(n = n[e]); ) - if (!(t = t.parentNode)) - throw new Error(`transition ${e} not found`); +function Dd(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 Nd(t) { - var e, n; - t instanceof on ? (e = t._id, t = t._name) : (e = gl(), (n = Cd).time = Ws(), t = t == null ? null : t + ""); +function Od(e) { + var t, n; + e instanceof fn ? (t = e._id, e = e._name) : (t = ml(), (n = Pd).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]) && Ui(l, t, e, u, a, n || Sd(l, e)); - return new on(r, this._parents, t, e); -} -xr.prototype.interrupt = Rh; -xr.prototype.transition = Nd; -const Ts = Math.PI, Rs = 2 * Ts, Cn = 1e-6, kd = Rs - Cn; -function _l(t) { - this._ += t[0]; - for (let e = 1, n = t.length; e < n; ++e) - this._ += arguments[e] + t[e]; -} -function Md(t) { - let e = Math.floor(t); - if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return _l; - const n = 10 ** e; + (l = a[u]) && Gi(l, e, t, u, a, n || Dd(l, t)); + return new fn(r, this._parents, e, t); +} +wr.prototype.interrupt = Mh; +wr.prototype.transition = Od; +const Rs = Math.PI, Ss = 2 * Rs, Nn = 1e-6, Id = Ss - Nn; +function yl(e) { + this._ += e[0]; + for (let t = 1, n = e.length; t < n; ++t) + this._ += arguments[t] + e[t]; +} +function Fd(e) { + let t = Math.floor(e); + if (!(t >= 0)) throw new Error(`invalid digits: ${e}`); + if (t > 15) return yl; + const n = 10 ** t; return function(r) { this._ += r[0]; for (let i = 1, s = r.length; i < s; ++i) this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Pd { - constructor(e) { +class Ld { + constructor(t) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? _l : Md(e); + this._x1 = this._y1 = null, this._ = "", this._append = t == null ? yl : Fd(t); } - moveTo(e, n) { - this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; + moveTo(t, n) { + this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`; } closePath() { this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`); } - lineTo(e, n) { - this._append`L${this._x1 = +e},${this._y1 = +n}`; + lineTo(t, n) { + this._append`L${this._x1 = +t},${this._y1 = +n}`; } - quadraticCurveTo(e, n, r, i) { - this._append`Q${+e},${+n},${this._x1 = +r},${this._y1 = +i}`; + quadraticCurveTo(t, n, r, i) { + this._append`Q${+t},${+n},${this._x1 = +r},${this._y1 = +i}`; } - bezierCurveTo(e, n, r, i, s, a) { - this._append`C${+e},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; + bezierCurveTo(t, n, r, i, s, a) { + this._append`C${+t},${+n},${+r},${+i},${this._x1 = +s},${this._y1 = +a}`; } - arcTo(e, n, r, i, s) { - if (e = +e, 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 - e, u = i - n, f = a - e, h = o - n, c = f * f + h * h; + 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, c = f * f + p * p; if (this._x1 === null) - this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > Cn) if (!(Math.abs(h * l - u * f) > Cn) || !s) - this._append`L${this._x1 = e},${this._y1 = n}`; + this._append`M${this._x1 = t},${this._y1 = n}`; + else if (c > Nn) if (!(Math.abs(p * l - u * f) > Nn) || !s) + this._append`L${this._x1 = t},${this._y1 = n}`; else { - let p = r - a, m = i - o, $ = l * l + u * u, _ = p * p + m * m, x = Math.sqrt($), F = Math.sqrt(c), S = s * Math.tan((Ts - Math.acos(($ + c - _) / (2 * x * F))) / 2), M = S / F, D = S / x; - Math.abs(M - 1) > Cn && this._append`L${e + M * f},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * p > f * m)},${this._x1 = e + D * l},${this._y1 = n + D * u}`; + let d = r - a, y = i - o, b = l * l + u * u, m = d * d + y * y, $ = Math.sqrt(b), D = Math.sqrt(c), M = s * Math.tan((Rs - Math.acos((b + c - m) / (2 * $ * D))) / 2), S = M / D, F = 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 + F * l},${this._y1 = n + F * u}`; } } - arc(e, n, r, i, s, a) { - if (e = +e, 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 = e + o, f = n + l, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${f}` : (Math.abs(this._x1 - u) > Cn || Math.abs(this._y1 - f) > Cn) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Rs + Rs), c > kd ? this._append`A${r},${r},0,1,${h},${e - o},${n - l}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = f}` : c > Cn && this._append`A${r},${r},0,${+(c >= Ts)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + 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, c = 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 && (c < 0 && (c = c % Ss + Ss), c > 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}` : c > Nn && this._append`A${r},${r},0,${+(c >= Rs)},${p},${this._x1 = t + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); } - rect(e, n, r, i) { - this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`; + 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`; } toString() { return this._; } } -function Dd(t) { - for (var e = t.length / 6 | 0, n = new Array(e), r = 0; r < e; ) n[r] = "#" + t.slice(r * 6, ++r * 6); +function qd(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 Id = Dd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Vt(t) { +const Vd = qd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Le(e) { return function() { - return t; + return e; }; } -const Oa = Math.abs, Dt = Math.atan2, Rn = Math.cos, Fd = Math.max, rs = Math.min, Ce = Math.sin, er = Math.sqrt, Wt = 1e-12, Hr = Math.PI, ki = Hr / 2, wi = 2 * Hr; -function Od(t) { - return t > 1 ? 0 : t < -1 ? Hr : Math.acos(t); +const qa = Math.abs, Oe = Math.atan2, Sn = Math.cos, zd = Math.max, ss = Math.min, kt = Math.sin, er = Math.sqrt, Xe = 1e-12, zr = Math.PI, Mi = zr / 2, xi = 2 * zr; +function Hd(e) { + return e > 1 ? 0 : e < -1 ? zr : Math.acos(e); } -function La(t) { - return t >= 1 ? ki : t <= -1 ? -ki : Math.asin(t); +function Va(e) { + return e >= 1 ? Mi : e <= -1 ? -Mi : Math.asin(e); } -function Ld(t) { - let e = 3; - return t.digits = function(n) { - if (!arguments.length) return e; +function Yd(e) { + let t = 3; + return e.digits = function(n) { + if (!arguments.length) return t; if (n == null) - e = null; + t = null; else { const r = Math.floor(n); if (!(r >= 0)) throw new RangeError(`invalid digits: ${n}`); - e = r; + t = r; } - return t; - }, () => new Pd(e); + return e; + }, () => new Ld(t); } -function qd(t) { - return t.innerRadius; +function Bd(e) { + return e.innerRadius; } -function Vd(t) { - return t.outerRadius; +function Xd(e) { + return e.outerRadius; } -function Hd(t) { - return t.startAngle; +function Wd(e) { + return e.startAngle; } -function Yd(t) { - return t.endAngle; +function Ud(e) { + return e.endAngle; } -function zd(t) { - return t && t.padAngle; +function Gd(e) { + return e && e.padAngle; } -function Bd(t, e, n, r, i, s, a, o) { - var l = n - t, u = r - e, f = a - i, h = o - s, c = h * l - f * u; - if (!(c * c < Wt)) - return c = (f * (e - s) - h * (t - i)) / c, [t + c * l, e + c * u]; +function Kd(e, t, n, r, i, s, a, o) { + var l = n - e, u = r - t, f = a - i, p = o - s, c = p * l - f * u; + if (!(c * c < Xe)) + return c = (f * (t - s) - p * (e - i)) / c, [e + c * l, t + c * u]; } -function li(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / er(o * o + l * l), f = u * l, h = -u * o, c = t + f, p = e + h, m = n + f, $ = r + h, _ = (c + m) / 2, x = (p + $) / 2, F = m - c, S = $ - p, M = F * F + S * S, D = i - s, W = c * $ - m * p, K = (S < 0 ? -1 : 1) * er(Fd(0, D * D * M - W * W)), Q = (W * S - F * K) / M, tt = (-W * F - S * K) / M, J = (W * S + F * K) / M, at = (-W * F + S * K) / M, ot = Q - _, N = tt - x, H = J - _, It = at - x; - return ot * ot + N * N > H * H + It * It && (Q = J, tt = at), { - cx: Q, - cy: tt, +function ui(e, t, n, r, i, s, a) { + var o = e - n, l = t - r, u = (a ? s : -s) / er(o * o + l * l), f = u * l, p = -u * o, c = e + f, d = t + p, y = n + f, b = r + p, m = (c + y) / 2, $ = (d + b) / 2, D = y - c, M = b - d, S = D * D + M * M, F = i - s, L = c * b - y * d, W = (M < 0 ? -1 : 1) * er(zd(0, F * F * S - L * L)), oe = (L * M - D * W) / S, Q = (-L * D - M * W) / S, U = (L * M + D * W) / S, le = (-L * D + M * W) / S, ue = oe - m, O = Q - $, I = U - m, Me = le - $; + return ue * ue + O * O > I * I + Me * Me && (oe = U, Q = le), { + cx: oe, + cy: Q, x01: -f, - y01: -h, - x11: Q * (i / D - 1), - y11: tt * (i / D - 1) + y01: -p, + x11: oe * (i / F - 1), + y11: Q * (i / F - 1) }; } -function ye() { - var t = qd, e = Vd, n = Vt(0), r = null, i = Hd, s = Yd, a = zd, o = null, l = Ld(u); +function _t() { + var e = Bd, t = Xd, n = Le(0), r = null, i = Wd, s = Ud, a = Gd, o = null, l = Yd(u); function u() { - var f, h, c = +t.apply(this, arguments), p = +e.apply(this, arguments), m = i.apply(this, arguments) - ki, $ = s.apply(this, arguments) - ki, _ = Oa($ - m), x = $ > m; - if (o || (o = f = l()), p < c && (h = p, p = c, c = h), !(p > Wt)) o.moveTo(0, 0); - else if (_ > wi - Wt) - o.moveTo(p * Rn(m), p * Ce(m)), o.arc(0, 0, p, m, $, !x), c > Wt && (o.moveTo(c * Rn($), c * Ce($)), o.arc(0, 0, c, $, m, x)); + var f, p, c = +e.apply(this, arguments), d = +t.apply(this, arguments), y = i.apply(this, arguments) - Mi, b = s.apply(this, arguments) - Mi, m = qa(b - y), $ = b > y; + if (o || (o = f = l()), d < c && (p = d, d = c, c = p), !(d > Xe)) o.moveTo(0, 0); + else if (m > xi - Xe) + o.moveTo(d * Sn(y), d * kt(y)), o.arc(0, 0, d, y, b, !$), c > Xe && (o.moveTo(c * Sn(b), c * kt(b)), o.arc(0, 0, c, b, y, $)); else { - var F = m, S = $, M = m, D = $, W = _, K = _, Q = a.apply(this, arguments) / 2, tt = Q > Wt && (r ? +r.apply(this, arguments) : er(c * c + p * p)), J = rs(Oa(p - c) / 2, +n.apply(this, arguments)), at = J, ot = J, N, H; - if (tt > Wt) { - var It = La(tt / c * Ce(Q)), Mt = La(tt / p * Ce(Q)); - (W -= It * 2) > Wt ? (It *= x ? 1 : -1, M += It, D -= It) : (W = 0, M = D = (m + $) / 2), (K -= Mt * 2) > Wt ? (Mt *= x ? 1 : -1, F += Mt, S -= Mt) : (K = 0, F = S = (m + $) / 2); + var D = y, M = b, S = y, F = b, L = m, W = m, oe = a.apply(this, arguments) / 2, Q = oe > Xe && (r ? +r.apply(this, arguments) : er(c * c + d * d)), U = ss(qa(d - c) / 2, +n.apply(this, arguments)), le = U, ue = U, O, I; + if (Q > Xe) { + var Me = Va(Q / c * kt(oe)), ot = Va(Q / d * kt(oe)); + (L -= Me * 2) > Xe ? (Me *= $ ? 1 : -1, S += Me, F -= Me) : (L = 0, S = F = (y + b) / 2), (W -= ot * 2) > Xe ? (ot *= $ ? 1 : -1, D += ot, M -= ot) : (W = 0, D = M = (y + b) / 2); } - var xt = p * Rn(F), ft = p * Ce(F), lt = c * Rn(D), z = c * Ce(D); - if (J > Wt) { - var Ft = p * Rn(S), _e = p * Ce(S), rt = c * Rn(M), bn = c * Ce(M), Ot; - if (_ < Hr) - if (Ot = Bd(xt, ft, rt, bn, Ft, _e, lt, z)) { - var oe = xt - Ot[0], $n = ft - Ot[1], wt = Ft - Ot[0], me = _e - Ot[1], He = 1 / Ce(Od((oe * wt + $n * me) / (er(oe * oe + $n * $n) * er(wt * wt + me * me))) / 2), An = er(Ot[0] * Ot[0] + Ot[1] * Ot[1]); - at = rs(J, (c - An) / (He - 1)), ot = rs(J, (p - An) / (He + 1)); + var ye = d * Sn(D), we = d * kt(D), ee = c * Sn(F), Pe = c * kt(F); + if (U > Xe) { + var G = d * Sn(M), Ie = d * kt(M), Tt = c * Sn(S), ie = c * kt(S), Ze; + if (m < zr) + if (Ze = Kd(ye, we, Tt, ie, G, Ie, ee, Pe)) { + var Bt = ye - Ze[0], lt = we - Ze[1], Tn = G - Ze[0], _e = Ie - Ze[1], Ct = 1 / kt(Hd((Bt * Tn + lt * _e) / (er(Bt * Bt + lt * lt) * er(Tn * Tn + _e * _e))) / 2), Xt = er(Ze[0] * Ze[0] + Ze[1] * Ze[1]); + le = ss(U, (c - Xt) / (Ct - 1)), ue = ss(U, (d - Xt) / (Ct + 1)); } else - at = ot = 0; + le = ue = 0; } - K > Wt ? ot > Wt ? (N = li(rt, bn, xt, ft, p, ot, x), H = li(Ft, _e, lt, z, p, ot, x), o.moveTo(N.cx + N.x01, N.cy + N.y01), ot < J ? o.arc(N.cx, N.cy, ot, Dt(N.y01, N.x01), Dt(H.y01, H.x01), !x) : (o.arc(N.cx, N.cy, ot, Dt(N.y01, N.x01), Dt(N.y11, N.x11), !x), o.arc(0, 0, p, Dt(N.cy + N.y11, N.cx + N.x11), Dt(H.cy + H.y11, H.cx + H.x11), !x), o.arc(H.cx, H.cy, ot, Dt(H.y11, H.x11), Dt(H.y01, H.x01), !x))) : (o.moveTo(xt, ft), o.arc(0, 0, p, F, S, !x)) : o.moveTo(xt, ft), !(c > Wt) || !(W > Wt) ? o.lineTo(lt, z) : at > Wt ? (N = li(lt, z, Ft, _e, c, -at, x), H = li(xt, ft, rt, bn, c, -at, x), o.lineTo(N.cx + N.x01, N.cy + N.y01), at < J ? o.arc(N.cx, N.cy, at, Dt(N.y01, N.x01), Dt(H.y01, H.x01), !x) : (o.arc(N.cx, N.cy, at, Dt(N.y01, N.x01), Dt(N.y11, N.x11), !x), o.arc(0, 0, c, Dt(N.cy + N.y11, N.cx + N.x11), Dt(H.cy + H.y11, H.cx + H.x11), x), o.arc(H.cx, H.cy, at, Dt(H.y11, H.x11), Dt(H.y01, H.x01), !x))) : o.arc(0, 0, c, D, M, x); + W > Xe ? ue > Xe ? (O = ui(Tt, ie, ye, we, d, ue, $), I = ui(G, Ie, ee, Pe, d, ue, $), o.moveTo(O.cx + O.x01, O.cy + O.y01), ue < U ? o.arc(O.cx, O.cy, ue, Oe(O.y01, O.x01), Oe(I.y01, I.x01), !$) : (o.arc(O.cx, O.cy, ue, Oe(O.y01, O.x01), Oe(O.y11, O.x11), !$), o.arc(0, 0, d, Oe(O.cy + O.y11, O.cx + O.x11), Oe(I.cy + I.y11, I.cx + I.x11), !$), o.arc(I.cx, I.cy, ue, Oe(I.y11, I.x11), Oe(I.y01, I.x01), !$))) : (o.moveTo(ye, we), o.arc(0, 0, d, D, M, !$)) : o.moveTo(ye, we), !(c > Xe) || !(L > Xe) ? o.lineTo(ee, Pe) : le > Xe ? (O = ui(ee, Pe, G, Ie, c, -le, $), I = ui(ye, we, Tt, ie, c, -le, $), o.lineTo(O.cx + O.x01, O.cy + O.y01), le < U ? o.arc(O.cx, O.cy, le, Oe(O.y01, O.x01), Oe(I.y01, I.x01), !$) : (o.arc(O.cx, O.cy, le, Oe(O.y01, O.x01), Oe(O.y11, O.x11), !$), o.arc(0, 0, c, Oe(O.cy + O.y11, O.cx + O.x11), Oe(I.cy + I.y11, I.cx + I.x11), $), o.arc(I.cx, I.cy, le, Oe(I.y11, I.x11), Oe(I.y01, I.x01), !$))) : o.arc(0, 0, c, F, S, $); } if (o.closePath(), f) return o = null, f + "" || null; } return u.centroid = function() { - var f = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - Hr / 2; - return [Rn(h) * f, Ce(h) * f]; + 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, kt(p) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Vt(+f), u) : t; + return arguments.length ? (e = typeof f == "function" ? f : Le(+f), u) : e; }, u.outerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Vt(+f), u) : e; + return arguments.length ? (t = typeof f == "function" ? f : Le(+f), u) : t; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Vt(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : Le(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Vt(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Le(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Vt(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : Le(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Vt(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : Le(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Vt(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : Le(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function Xd(t) { - return typeof t == "object" && "length" in t ? t : Array.from(t); +function jd(e) { + return typeof e == "object" && "length" in e ? e : Array.from(e); } -function Wd(t, e) { - return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; +function Jd(e, t) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function Ud(t) { - return t; +function Zd(e) { + return e; } -function is() { - var t = Ud, e = Wd, n = null, r = Vt(0), i = Vt(wi), s = Vt(0); +function as() { + var e = Zd, t = Jd, n = null, r = Le(0), i = Le(xi), s = Le(0); function a(o) { - var l, u = (o = Xd(o)).length, f, h, c = 0, p = new Array(u), m = new Array(u), $ = +r.apply(this, arguments), _ = Math.min(wi, Math.max(-wi, i.apply(this, arguments) - $)), x, F = Math.min(Math.abs(_) / u, s.apply(this, arguments)), S = F * (_ < 0 ? -1 : 1), M; + var l, u = (o = jd(o)).length, f, p, c = 0, d = new Array(u), y = new Array(u), b = +r.apply(this, arguments), m = Math.min(xi, Math.max(-xi, i.apply(this, arguments) - b)), $, D = Math.min(Math.abs(m) / u, s.apply(this, arguments)), M = D * (m < 0 ? -1 : 1), S; for (l = 0; l < u; ++l) - (M = m[p[l] = l] = +t(o[l], l, o)) > 0 && (c += M); - for (e != null ? p.sort(function(D, W) { - return e(m[D], m[W]); - }) : n != null && p.sort(function(D, W) { - return n(o[D], o[W]); - }), l = 0, h = c ? (_ - u * S) / c : 0; l < u; ++l, $ = x) - f = p[l], M = m[f], x = $ + (M > 0 ? M * h : 0) + S, m[f] = { + (S = y[d[l] = l] = +e(o[l], l, o)) > 0 && (c += S); + for (t != null ? d.sort(function(F, L) { + return t(y[F], y[L]); + }) : n != null && d.sort(function(F, L) { + return n(o[F], o[L]); + }), l = 0, p = c ? (m - u * M) / c : 0; l < u; ++l, b = $) + f = d[l], S = y[f], $ = b + (S > 0 ? S * p : 0) + M, y[f] = { data: o[f], index: l, - value: M, - startAngle: $, - endAngle: x, - padAngle: F + value: S, + startAngle: b, + endAngle: $, + padAngle: D }; - return m; + return y; } return a.value = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : Vt(+o), a) : t; + return arguments.length ? (e = typeof o == "function" ? o : Le(+o), a) : e; }, a.sortValues = function(o) { - return arguments.length ? (e = o, n = null, a) : e; + return arguments.length ? (t = o, n = null, a) : t; }, a.sort = function(o) { - return arguments.length ? (n = o, e = null, a) : n; + return arguments.length ? (n = o, t = null, a) : n; }, a.startAngle = function(o) { - return arguments.length ? (r = typeof o == "function" ? o : Vt(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : Le(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Vt(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : Le(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Vt(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : Le(+o), a) : s; }, a; } -function Mr(t, e, n) { - this.k = t, this.x = e, this.y = n; +function Mr(e, t, n) { + this.k = e, this.x = t, this.y = n; } Mr.prototype = { constructor: Mr, - scale: function(t) { - return t === 1 ? this : new Mr(this.k * t, this.x, this.y); + scale: function(e) { + return e === 1 ? this : new Mr(this.k * e, this.x, this.y); }, - translate: function(t, e) { - return t === 0 & e === 0 ? this : new Mr(this.k, this.x + this.k * t, this.y + this.k * e); + translate: function(e, t) { + return e === 0 & t === 0 ? this : new Mr(this.k, this.x + this.k * e, this.y + this.k * t); }, - apply: function(t) { - return [t[0] * this.k + this.x, t[1] * this.k + this.y]; + apply: function(e) { + return [e[0] * this.k + this.x, e[1] * this.k + this.y]; }, - applyX: function(t) { - return t * this.k + this.x; + applyX: function(e) { + return e * this.k + this.x; }, - applyY: function(t) { - return t * this.k + this.y; + applyY: function(e) { + return e * this.k + this.y; }, - invert: function(t) { - return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k]; + invert: function(e) { + return [(e[0] - this.x) / this.k, (e[1] - this.y) / this.k]; }, - invertX: function(t) { - return (t - this.x) / this.k; + invertX: function(e) { + return (e - this.x) / this.k; }, - invertY: function(t) { - return (t - this.y) / this.k; + invertY: function(e) { + return (e - this.y) / this.k; }, - rescaleX: function(t) { - return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t)); + rescaleX: function(e) { + return e.copy().domain(e.range().map(this.invertX, this).map(e.invert, e)); }, - rescaleY: function(t) { - return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t)); + rescaleY: function(e) { + return e.copy().domain(e.range().map(this.invertY, this).map(e.invert, e)); }, toString: function() { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; Mr.prototype; -var Gd = /* @__PURE__ */ Bu(''); -const Kd = { +var Qd = /* @__PURE__ */ Ku(''); +const ep = { 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 ml(t, e) { - qi(e, !0), Vs(t, Kd); - let n = ut(e, "jsonData", 7), r = ut(e, "currentRound", 7, 1), i = ut(e, "mouseEventType", 15), s = ut(e, "mouseData", 15), a = ut(e, "mouseX", 15), o = ut(e, "mouseY", 15), l = ut(e, "requestRoundChange", 7, (d) => { - }), u = ut(e, "candidateColors", 23, () => []), f = ut(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), h = ut(e, "firstRoundDeterminesPercentages", 7, !1), c = ut(e, "displayPhase", 15, 0); - function p(d) { - return d.isTransfer ? `${d.label}__transfer` : d.transferIndex != null ? `${d.label}__${d.transferIndex}` : d.label; - } - const m = 800, $ = 800, _ = Math.min(m, $) * 0.3, x = m / 2, F = $ / 2, S = "Pie", M = "PieOutline", D = "Donut", W = "TextLayer", K = "url(#cross-hatch)", Q = 1.15, tt = 750, J = 800, at = "white", ot = 1, N = "#ff00ff", H = 3; - function It(d) { - return "hatch-" + d.replace(/[^a-zA-Z0-9]/g, "-"); - } - let Mt = [], xt = [], ft = [], lt = 0, z = 0; - const Ft = {}, _e = "No Further Rankings"; - let rt = /* @__PURE__ */ Et(null); - function bn() { - const d = ct(b(rt)); - d.select("#" + S).remove(), d.select("#" + M).remove(), d.select("#" + D).remove(), d.select("#" + W).remove(); - } - function Ot(d) { - l() && (mt = d, l()(d)); - } - function oe(d) { - bn(), ft = $n(d), Mt = Zs(d, S, ft, x, F, 0, wt()), Zs(d, M, ft, x, F, 0, wt(), !1, !1, !0), Er(); - } - ju(() => { - it(), setTimeout( +function wl(e, t) { + Vi(t, !0), Hs(e, ep); + let n = ae(t, "jsonData", 7), r = ae(t, "currentRound", 7, 1), i = ae(t, "mouseEventType", 15), s = ae(t, "mouseData", 15), a = ae(t, "mouseX", 15), o = ae(t, "mouseY", 15), l = ae(t, "requestRoundChange", 7, (h) => { + }), u = ae(t, "candidateColors", 23, () => []), f = ae(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), p = ae(t, "firstRoundDeterminesPercentages", 7, !1), c = ae(t, "randomizeOrder", 7, !1), d = ae(t, "displayPhase", 15, 0); + function y(h) { + return h.isTransfer ? `${h.label}__transfer` : h.transferIndex != null ? `${h.label}__${h.transferIndex}` : h.label; + } + const b = 800, m = 800, $ = Math.min(b, m) * 0.3, D = b / 2, M = m / 2, S = "Pie", F = "PieOutline", L = "Donut", W = "TextLayer", oe = "url(#cross-hatch)", Q = 1.15, U = 750, le = 800, ue = "white", O = 1, I = "#ff00ff", Me = 3; + function ot(h) { + return "hatch-" + h.replace(/[^a-zA-Z0-9]/g, "-"); + } + let ye = [], we = [], ee = [], Pe = 0, G = 0; + const Ie = {}, Tt = "No Further Rankings"; + let ie = /* @__PURE__ */ $e(null); + function Ze() { + const h = fe(x(ie)); + h.select("#" + S).remove(), h.select("#" + F).remove(), h.select("#" + L).remove(), h.select("#" + W).remove(); + } + function Bt(h) { + l() && (me = h, l()(h)); + } + function lt(h) { + Ze(), ee = Tn(h), ye = ea(h, S, ee, D, M, 0, _e()), ea(h, F, ee, D, M, 0, _e(), !1, !1, !0), Er(); + } + tf(() => { + Cn(), setTimeout( () => { - oe(r()); + lt(r()); }, 0 ); }); - function $n(d) { - const g = et(d); - return lt = Kn(d), g; + function Tn(h) { + const g = ze(h); + return Pe = Jn(h), g; } - function wt() { - return _; + function _e() { + return $; } - function me() { - return wt() * 1.41; + function Ct() { + return _e() * 1.41; } - function He(d) { + function Xt(h) { let g = 0; - for (let y = 1; y < d; y++) { - const E = n().results[y - 1].tallyResults; - for (let A = 0; A < E.length; A++) { - const R = E[A].transfers; - if (R) { - const I = R.exhausted; - I && (g += Number(I)); + for (let _ = 1; _ < h; _++) { + const A = n().results[_ - 1].tallyResults; + for (let E = 0; E < A.length; E++) { + const T = A[E].transfers; + if (T) { + const P = T.exhausted; + P && (g += Number(P)); } } } return g; } - function An(d, g) { - if (d === "exhausted") return He(g); + function jr(h, g) { + if (h === "exhausted") return Xt(g); { - const y = n().results[g - 1].tally; - return Number(y[d]); + const _ = n().results[g - 1].tally; + return Number(_[h]); } } - function jr(d, g) { - return An(d, g).toLocaleString("en-US"); + function Jr(h, g) { + return jr(h, g).toLocaleString("en-US"); } - function Jr(d, g) { - const y = h() ? lt : Gi(g); - return (An(d, g) / y).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Zr(h, g) { + const _ = p() ? Pe : Ki(g); + return (jr(h, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function Kn(d) { - const g = n().results[d - 1].tally; - let y = 0; - for (let [E, A] of Object.entries(g)) - y += Number(A); - return y; + function Jn(h) { + const g = n().results[h - 1].tally; + let _ = 0; + for (let [A, E] of Object.entries(g)) + _ += Number(E); + return _; } - function un(d) { - return d === "exhausted" || d === "Inactive Ballots"; + function hn(h) { + return h === "exhausted" || h === "Inactive Ballots"; } - function Gi(d) { - const g = n().results[d - 1].tally; - let y = 0; - for (let [E, A] of Object.entries(g)) - un(E) || (y += Number(A)); - return y; + function Ki(h) { + const g = n().results[h - 1].tally; + let _ = 0; + for (let [A, E] of Object.entries(g)) + hn(A) || (_ += Number(E)); + return _; } - function Zr(d, g) { - if (!d || d < 1 || d > n().results.length) + function Qr(h, g) { + if (!h || h < 1 || h > n().results.length) return console.warn("In chosenCandidates: round ${round} is out of range."), []; - if (f() && d === n().results.length) + if (f() && h === n().results.length) return []; - const y = n().results[d - 1].tallyResults, E = []; - for (let A = 0; A < y.length; A++) { - const R = y[A][g]; - R != null && E.push(R); + const _ = n().results[h - 1].tallyResults, A = []; + for (let E = 0; E < _.length; E++) { + const T = _[E][g]; + T != null && A.push(T); } - return E; + return A; } - function fn(d) { - return Zr(d, "eliminated"); + function dn(h) { + return Qr(h, "eliminated"); } - function br(d) { + function xr(h) { let g = []; - for (let y = 1; y <= d; y++) g = g.concat(Zr(y, "elected")); + for (let _ = 1; _ <= h; _++) g = g.concat(Qr(_, "elected")); return [...new Set(g)]; } - function w(d, g) { - const y = n().results[g - 1].tallyResults; - let E = 0; - const A = y.findIndex((R) => (R == null ? void 0 : R.elected) && d == R.elected); - if (A >= 0) { - const R = y[A].transfers; - if (R) - for (let [I, q] of Object.entries(R)) E += Number(q); + function w(h, g) { + const _ = n().results[g - 1].tallyResults; + let A = 0; + const E = _.findIndex((T) => (T == null ? void 0 : T.elected) && h == T.elected); + if (E >= 0) { + const T = _[E].transfers; + if (T) + for (let [P, z] of Object.entries(T)) A += Number(z); } else return 0; - return E; - } - function Y(d, g) { - d.some((y) => un(y.label)) || d.push({ label: "exhausted", value: He(g) }); - } - function et(d) { - const g = []; - for (let [y, E] of Object.entries(n().results[d - 1].tally)) - g.push({ label: y, value: Number(E) }); - return Y(g, d), g; - } - function vt(d) { - const g = n().results[Math.max(0, d - 2)].tally, y = n().results[d - 1].tally, E = []; - for (let [A] of Object.entries(g)) - E.push({ label: A, value: Number(y[A] ?? 0) }); - return Y(E, d), E; - } - function bt(d, g) { - const y = []; - for (const E of d) { - if (E.label === "exhausted" || E.isTransfer) { - y.push(E); + return A; + } + function Y(h, g) { + h.some((_) => hn(_.label)) || h.push({ label: "exhausted", value: Xt(g) }); + } + function te(h) { + let g = h | 0; + return () => { + g = g + 1831565813 | 0; + let _ = Math.imul(g ^ g >>> 15, 1 | g); + return _ = _ + Math.imul(_ ^ _ >>> 7, 61 | _) ^ _, ((_ ^ _ >>> 14) >>> 0) / 4294967296; + }; + } + function pe(h) { + let g = 5381; + for (let _ = 0; _ < h.length; _++) + g = (g << 5) + g + h.charCodeAt(_) | 0; + return g; + } + function xe(h) { + var E; + if (h.length <= 3) return h; + const g = pe(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = te(g), A = [...h]; + for (let T = A.length - 1; T > 0; T--) { + const P = Math.floor(_() * (T + 1)); + [A[T], A[P]] = [A[P], A[T]]; + } + return A; + } + function se() { + const h = Object.keys(n().results[0].tally); + return c() ? xe(h) : h; + } + function ze(h) { + const g = n().results[h - 1].tally, _ = []; + for (const A of se()) + A in g && _.push({ label: A, value: Number(g[A]) }); + return Y(_, h), _; + } + function Wt(h) { + const g = n().results[h - 1].tally, _ = []; + for (const A of se()) + _.push({ label: A, value: Number(g[A] ?? 0) }); + return Y(_, h), _; + } + function Rt(h, g) { + const _ = []; + for (const A of h) { + if (A.label === "exhausted" || A.isTransfer) { + _.push(A); continue; } - const A = w(E.label, g); - A > 0 ? (y.push({ - label: E.label, - value: A, + const E = w(A.label, g); + E > 0 ? (_.push({ + label: A.label, + value: E, isTransfer: !0 - }), y.push({ ...E, value: E.value - A })) : y.push(E); + }), _.push({ ...A, value: A.value - E })) : _.push(A); } - return y; + return _; } - function it() { - const d = ct(b(rt)).select("defs").select("#cross-hatch"); + function Cn() { + const h = fe(x(ie)).select("defs").select("#cross-hatch"); let g = 0; - for (let [y, E] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? g < 10 ? Ft[y] = Id[g] : Ft[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ft[y] = u()[g % u().length], g++; + for (let [_, A] of Object.entries(n().results[0].tally)) { + !u() || u().length === 0 ? g < 10 ? Ie[_] = Vd[g] : Ie[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ie[_] = u()[g % u().length], g++; { - const A = d.clone(!0); - A.attr("id", It(y)).select("rect").attr("fill", Ft[y]), A.selectAll("circle").attr("fill", "#383838"); + const E = h.clone(!0); + E.attr("id", ot(_)).select("rect").attr("fill", Ie[_]), E.selectAll("circle").attr("fill", "#383838"); } } - Ft.exhausted = K, Ft["Inactive Ballots"] = K; + Ie.exhausted = oe, Ie["Inactive Ballots"] = oe; } - function zt() { - ct(b(rt)).select("#" + D).remove(); + function pn() { + fe(x(ie)).select("#" + L).remove(); } - function le(d, g) { - const y = yi("global").duration(J); - g && y.on("end", g); - const E = bt(ft, d), R = is().sort(null).value((I) => I.value)(E); - na(d, S, R, 0, wt()), na(d, M, R, 0, wt(), !0), ft = E, Mt = R, zt(), Xe(d), El(), Rl(0, wt()), Er(); + function Ee(h, g) { + const _ = wi("global").duration(le); + g && _.on("end", g); + const A = Rt(ee, h), T = as().sort(null).value((P) => P.value)(A); + ia(h, S, T, 0, _e()), ia(h, F, T, 0, _e(), !0), ee = A, ye = T, pn(), $l(h), Nl(), Ml(0, _e()), Er(); } - function Bt(d, g) { - const y = yi("global").duration(J); - g && y.on("end", g), We(d); + function He(h, g) { + const _ = wi("global").duration(le); + g && _.on("end", g), Al(h); } - function ue(d, g) { - const y = yi("global").duration(J); - g && y.on("end", g), $r(d), Ar(wt(), me()); + function Te(h, g) { + const _ = wi("global").duration(le); + g && _.on("end", g), ji(h), bl(_e(), Ct()); } - let gt = !1, _t = []; - function $t() { - Er(), gt = !1, Lt(); + let ve = !1, ut = []; + function Ye() { + Er(), ve = !1, Ut(); } - function Lt() { - if (_t.length === 0) { - mt !== r() && (r() === mt + 1 && mt > 0 && r() <= n().results.length ? (mt = r(), Ye(r())) : r() >= 1 && r() <= n().results.length && (mt = r(), c(0), oe(r()))); + function Ut() { + if (ut.length === 0) { + me !== r() && (r() === me + 1 && me > 0 && r() <= n().results.length ? (me = r(), St(r())) : r() >= 1 && r() <= n().results.length && (me = r(), d(0), lt(r()))); return; } - const d = _t.shift(); - switch (d.type) { + const h = ut.shift(); + switch (h.type) { case "round": { - const g = d.round; - g === mt + 1 && mt > 0 && g <= n().results.length ? (mt = g, Ye(g)) : (g !== mt && g >= 1 && g <= n().results.length && (mt = g, c(0), oe(g)), Lt()); + const g = h.round; + g === me + 1 && me > 0 && g <= n().results.length ? (me = g, St(g)) : (g !== me && g >= 1 && g <= n().results.length && (me = g, d(0), lt(g)), Ut()); break; } case "step": - Zn(); + Nt(); break; } } - function Ye(d) { - if (d <= 1 || d > n().results.length) { - Lt(); + function St(h) { + if (h <= 1 || h > n().results.length) { + Ut(); return; } - gt = !0, z = d, c(0), le(z - 1, () => { - c(1), Bt(z - 1, () => { - c(2), ue(z, () => { - c(0), $t(); + ve = !0, G = h, d(0), Ee(G - 1, () => { + d(1), He(G - 1, () => { + d(2), Te(G, () => { + d(0), Ye(); }); }); }); } - function jn() { - gt || (gt = !0, z = r(), En()); + function Gt() { + ve || (ve = !0, G = r(), Rn()); } - function En() { - if (c( + function Rn() { + if (d( 0 // if in the middle of "one small step" animation, reset to 0. - ), _t.length > 0) { - $t(); + ), ut.length > 0) { + Ye(); return; } - const d = z < n().results.length - 1 ? En : () => { - c(0), $t(); + const h = G < n().results.length - 1 ? Rn : () => { + d(0), Ye(); }; - le(z, () => { - c(1), Bt(z, () => { - c(2), z++, Ot(z), ue(z, d); + Ee(G, () => { + d(1), He(G, () => { + d(2), G++, Bt(G), Te(G, h); }); }); } - Is(() => { - ze(); + Fs(() => { + br(); }); - let mt = 0; - function ze() { - if (mt != r()) { - if (gt) { - _t.push({ type: "round", round: r() }); + let me = 0; + function br() { + if (me != r()) { + if (ve) { + ut.push({ type: "round", round: r() }); return; } - mt == r() - 1 && mt > 0 ? Jn() : Be(r()), mt = r(); + me == r() - 1 && me > 0 ? Kt() : $r(r()), me = r(); } } - function Be(d) { - if (gt) { - _t.push({ type: "round", round: d }); + function $r(h) { + if (ve) { + ut.push({ type: "round", round: h }); return; } - c(0), oe(d); + d(0), lt(h); } - function Jn() { - if (gt) { - _t.push({ type: "round", round: r() }); + function Kt() { + if (ve) { + ut.push({ type: "round", round: r() }); return; } if (r() <= 1) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (z = r(), z > n().results.length) { - Er(), gt = !1; + if (G = r(), G > n().results.length) { + Er(), ve = !1; return; } - gt = !0, c() === 0 ? le(z - 1, () => { - c(1), Bt(z - 1, () => { - c(2), ue(z, () => { - c(0), $t(); + ve = !0, d() === 0 ? Ee(G - 1, () => { + d(1), He(G - 1, () => { + d(2), Te(G, () => { + d(0), Ye(); }); }); - }) : c() === 1 ? Bt(z - 1, () => { - c(2), ue(z, () => { - c(0), $t(); + }) : d() === 1 ? He(G - 1, () => { + d(2), Te(G, () => { + d(0), Ye(); }); - }) : c() === 2 && ue(z, () => { - c(0), $t(); + }) : d() === 2 && Te(G, () => { + d(0), Ye(); }); } - function Zn() { + function Nt() { if (r() > n().results.length) { - Er(), gt = !1; + Er(), ve = !1; return; } - if (gt) { - _t.push({ type: "step" }); + if (ve) { + ut.push({ type: "step" }); return; } - gt = !0, z = r(), c() === 0 ? le(z, () => { - c(1), $t(); - }) : c() === 1 ? Bt(z, () => { - c(2), $t(); - }) : c() === 2 ? (z++, Ot(z), ue(z, () => { - c(0), $t(); - })) : (gt = !1, console.warn("displayPhase out of range at ", c())); - } - function $r(d) { - ft = vt(d), Mt = ta(d, S, ft, 0, wt(), !0), ta(d, M, ft, 0, wt(), !1, !0); - } - function Ar(d, g) { - const y = ct(b(rt)).select("#" + D), A = ct(b(rt)).select("#" + S), R = {}; - for (const k of Mt) { - const P = k.data.label; - if (k.data.isTransfer) continue; - const T = A.select("#" + CSS.escape(p(k.data))); - T.empty() || (R[P] = { - oldStart: Number(T.attr("prevStart")), - oldEnd: Number(T.attr("prevEnd")), - newStart: k.startAngle, - newEnd: k.endAngle + ve = !0, G = r(), d() === 0 ? Ee(G, () => { + d(1), Ye(); + }) : d() === 1 ? He(G, () => { + d(2), Ye(); + }) : d() === 2 ? (G++, Bt(G), Te(G, () => { + d(0), Ye(); + })) : (ve = !1, console.warn("displayPhase out of range at ", d())); + } + function ji(h) { + ee = Wt(h), ye = na(h, S, ee, 0, _e(), !0), na(h, F, ee, 0, _e(), !1, !0); + } + function bl(h, g) { + const _ = fe(x(ie)).select("#" + L), E = fe(x(ie)).select("#" + S), T = {}; + for (const N of ye) { + 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 }); } - const I = y.selectAll(".slice"); - let q = I.size(); - function O() { - q--, q === 0 && Tl(); + const P = _.selectAll(".slice"); + let z = P.size(); + function q() { + z--, z === 0 && kl(); } - I.select("path").transition("global").duration(tt).attrTween("d", function(k) { - const P = k.startAngle, T = k.endAngle, C = T - P, Pt = R[k.data.label]; - let Z, Xt; - if (Pt) { - const Qn = (Pt.oldStart + Pt.oldEnd) / 2, kl = (Pt.newStart + Pt.newEnd) / 2, Ml = P - Qn; - Z = kl + Ml, Xt = Z + C; + P.select("path").transition("global").duration(U).attrTween("d", function(N) { + const k = N.startAngle, C = N.endAngle, R = C - k, De = T[N.data.label]; + let Z, Be; + if (De) { + const Zn = (De.oldStart + De.oldEnd) / 2, Il = (De.newStart + De.newEnd) / 2, Fl = k - Zn; + Z = Il + Fl, Be = Z + R; } else - Z = P, Xt = T; - const nt = Ge(P, Z), Rt = Ge(T, Xt), ti = Ge(g, d), Tr = ye(); - return function(Qn) { - return Tr.innerRadius(Math.min(ti(Qn), d) - 1).outerRadius(ti(Qn)).startAngle(nt(Qn)).endAngle(Rt(Qn)), Tr(k); + Z = k, Be = C; + const ne = Jt(k, Z), Ce = Jt(C, Be), ti = Jt(g, h), Tr = _t(); + return function(Zn) { + return Tr.innerRadius(Math.min(ti(Zn), h) - 1).outerRadius(ti(Zn)).startAngle(ne(Zn)).endAngle(Ce(Zn)), Tr(N); }; - }).on("end", (k) => O()); - } - function Xe(d) { - const g = xl(d, Mt); - xt = Qs(d, D, g, x, F, wt(), me(), !1, !0); - const y = ct(b(rt)); - y.select("#" + S).raise(), y.select("#" + M).raise(); - } - function We(d) { - const g = $l(d, xt, Mt); - xt = ra(d, D, g, wt(), me(), !1); - } - function Tn(d) { - return Ft[d.data.label]; - } - function wl(d) { - const g = {}, y = n().results[d - 1].tallyResults; - for (let E = 0; E < y.length; E++) { - let A = y[E].eliminated; - if (A === void 0 && (A = y[E].elected), A === void 0) { + }).on("end", (N) => q()); + } + function $l(h) { + const g = Tl(h, ye); + we = ta(h, L, g, D, M, _e(), Ct(), !1, !0); + const _ = fe(x(ie)); + _.select("#" + S).raise(), _.select("#" + F).raise(); + } + function Al(h) { + const g = Rl(h, we, ye); + we = sa(h, L, g, _e(), Ct(), !1); + } + function Ar(h) { + return Ie[h.data.label]; + } + function El(h) { + const g = {}, _ = n().results[h - 1].tallyResults; + for (let A = 0; A < _.length; A++) { + let E = _[A].eliminated; + if (E === void 0 && (E = _[A].elected), E === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const R = y[E].transfers; - if (R === void 0) { + const T = _[A].transfers; + if (T === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [I, q] of Object.entries(R)) - g[I] === void 0 ? g[I] = Number(q) : g[I] += Number(q); + for (let [P, z] of Object.entries(T)) + g[P] === void 0 ? g[P] = Number(z) : g[P] += Number(z); } return g; } - function xl(d, g) { - const y = [], E = lt, A = n().results[d - 1].tallyResults; - for (let R = 0; R < A.length; R++) { - let I = A[R].eliminated; - if (I === void 0 && (I = A[R].elected), I === void 0) { + function Tl(h, g) { + const _ = [], A = Pe, E = n().results[h - 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 q = A[R].transfers; - if (q === void 0) { + const z = E[T].transfers; + if (z === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let O = g.find((P) => P.data.label == I && P.data.isTransfer); - O === void 0 && (O = g.find((P) => P.data.label == I && !P.data.isTransfer)); - let k = 0; - if (O) k = O.startAngle; + 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; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [P, T] of Object.entries(q)) { - let C; - const Pt = g.find((nt) => nt.data.label == P); - if (Pt) - C = structuredClone(Pt); - else if (P == "exhausted") - C = { - data: { label: P, value: Number(T) }, + for (let [k, C] of Object.entries(z)) { + let R; + const De = g.find((ne) => ne.data.label == k); + if (De) + R = structuredClone(De); + else if (k == "exhausted") + R = { + data: { label: k, value: Number(C) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (P == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", T); + else if (k == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", C); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", P); + console.warn("makeDonutInfo: unrecognized name in transfers ", k); continue; } - const Xt = Number(T) / E * 2 * Math.PI; - C.startAngle = k, k = C.endAngle = k + Xt, C.index = R, C.data.transferIndex = R, y.push(C); + const Be = Number(C) / A * 2 * Math.PI; + R.startAngle = N, N = R.endAngle = N + Be, R.index = T, R.data.transferIndex = T, _.push(R); } } - return y; + return _; } - function bl(d, g, y) { - const E = {}; - for (let [A, R] of Object.entries(d)) { - const I = y.find((k) => A == k.data.label); - if (I === void 0) { - console.warn("getTransferStartAngles: mainPieObj not found for ", A); + function Cl(h, g, _) { + const A = {}; + for (let [E, T] of Object.entries(h)) { + const P = _.find((N) => E == N.data.label); + if (P === void 0) { + console.warn("getTransferStartAngles: mainPieObj not found for ", E); continue; } - const q = (I.startAngle + I.endAngle) / 2, O = d[I.data.label] / g * 2 * Math.PI; - E[I.data.label] = q - O / 2; + const z = (P.startAngle + P.endAngle) / 2, q = h[P.data.label] / g * 2 * Math.PI; + A[P.data.label] = z - q / 2; } - return E; - } - function $l(d, g, y) { - const E = [], A = lt, R = wl(d), I = bl(R, A, y); - for (let [q, O] of g.entries()) { - const k = structuredClone(O), P = O.endAngle - O.startAngle, T = y.find((C) => O.data.label === C.data.label && !C.data.isTransfer); - if (T) { - const C = T.data.label; - k.startAngle = I[C], I[C] += P, k.endAngle = k.startAngle + P; - } else if (O.data.label === "exhausted") - k.startAngle = O.startAngle, k.endAngle = O.endAngle; + return A; + } + function Rl(h, g, _) { + const A = [], E = Pe, T = El(h), P = Cl(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; else { - console.warn("updateDonutInfo: unrecognized slice name ", O.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", q.data.label); continue; } - k.index = q, E.push(k); + N.index = z, A.push(N); } - return E; - } - function js(d, g, y, E) { - const A = ye().innerRadius(y * Q).outerRadius(y * Q), R = g.filter((P) => !P.data.isTransfer && P.data.value > 0), I = [], q = E.append("g").attr("opacity", 0); - for (const P of R) { - const T = P.data.label === "exhausted" ? _e : P.data.label, C = A.centroid(P), Pt = Qr(P.startAngle, P.endAngle), Z = jr(P.data.label, d); - let Xt; - !h() && un(P.data.label) ? Xt = Z : Xt = Z + " (" + Jr(P.data.label, d) + ")"; - const nt = q.append("text").attr("transform", `translate(${C})`).attr("text-anchor", Pt).text(T); - nt.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Xt); - const Rt = nt.node().getBBox(); - I.push({ - label: P.data.label, - value: P.data.value, - bbox: new DOMRect(Rt.x + C[0], Rt.y + C[1], Rt.width, Rt.height) + return A; + } + function Zs(h, g, _, A) { + const E = _t().innerRadius(_ * Q).outerRadius(_ * Q), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], z = A.append("g").attr("opacity", 0); + for (const k of T) { + const C = k.data.label === "exhausted" ? Tt : k.data.label, R = E.centroid(k), De = ei(k.startAngle, k.endAngle), Z = Jr(k.data.label, h); + let Be; + !p() && hn(k.data.label) ? Be = Z : Be = Z + " (" + Zr(k.data.label, h) + ")"; + const ne = z.append("text").attr("transform", `translate(${R})`).attr("text-anchor", De).text(C); + ne.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Be); + const Ce = ne.node().getBBox(); + P.push({ + label: k.data.label, + value: k.data.value, + bbox: new DOMRect(Ce.x + R[0], Ce.y + R[1], Ce.width, Ce.height) }); } - q.remove(), I.sort((P, T) => T.value - P.value); - const O = [], k = /* @__PURE__ */ new Set(); - for (const P of I) - O.some((C) => P.bbox.left < C.right && P.bbox.right > C.left && P.bbox.top < C.bottom && P.bbox.bottom > C.top) || (k.add(P.label), O.push(P.bbox)); - return k; - } - function Js(d, g, y, E, A, R) { - const q = ct(b(rt)).append("g").attr("id", W).attr("transform", `translate(${y}, ${E})`), O = ye().innerRadius(A * Q).outerRadius(A * Q), k = js(d, g, A, q); - q.selectAll("text").data(g).enter().each(function(P) { - !P.data.isTransfer && k.has(P.data.label) && ct(this).append("g").attr("id", (T) => p(T.data)).classed("eliminated", (T) => R.includes(T.data.label) || T.data.isTransfer === !0).each(function(T, C) { - T.data.label === "exhausted" && ct(this).on("mouseenter", (Pt, Z) => Cl(Pt)).on("mouseleave", (Pt, Z) => Sl()); - }).append("text").attr("transform", (T) => `translate(${O.centroid(T)})`).attr("text-anchor", (T) => Qr(T.startAngle, T.endAngle)).text((T) => T.data.label === "exhausted" ? _e : T.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((T) => { - const C = jr(T.data.label, d); - return !h() && un(T.data.label) ? C : C + " (" + Jr(T.data.label, d) + ")"; + z.remove(), P.sort((k, C) => C.value - k.value); + const q = [], N = /* @__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(h, g, _, A, E, T) { + const z = fe(x(ie)).append("g").attr("id", W).attr("transform", `translate(${_}, ${A})`), q = _t().innerRadius(E * Q).outerRadius(E * Q), N = Zs(h, 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", (De, Z) => Pl(De)).on("mouseleave", (De, Z) => Dl()); + }).append("text").attr("transform", (C) => `translate(${q.centroid(C)})`).attr("text-anchor", (C) => ei(C.startAngle, C.endAngle)).text((C) => C.data.label === "exhausted" ? Tt : C.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((C) => { + const R = Jr(C.data.label, h); + return !p() && hn(C.data.label) ? R : R + " (" + Zr(C.data.label, h) + ")"; }); }); } - function Al(d, g, y, E) { - const R = ct(b(rt)).select("#" + W), I = js(d, g, y, R); - R.selectAll("g").each(function(C) { - C && C.data && !C.data.isTransfer && !I.has(C.data.label) && ct(this).remove(); + function Sl(h, g, _, A) { + const T = fe(x(ie)).select("#" + W), P = Zs(h, g, _, T); + T.selectAll("g").each(function(R) { + R && R.data && !R.data.isTransfer && !P.has(R.data.label) && fe(this).remove(); }); - const q = R.selectAll("tspan"), O = R.selectAll("g").data(g, (C) => p(C.data)).classed("eliminated", (C) => E.includes(C.data.label) || C.data.isTransfer === !0), k = ye().innerRadius(y * Q).outerRadius(y * Q + 1); - q.transition("global").duration(tt).attr("transform", (C) => `translate(${k.centroid(C)})`).attr("text-anchor", (C) => Qr(C.startAngle, C.endAngle)), O.select("text").transition("global").duration(tt).attr("transform", (C) => `translate(${k.centroid(C)})`).attr("text-anchor", (C) => Qr(C.startAngle, C.endAngle)).on("end", (C) => T()); - let P = O.size(); - function T(C) { - P--, P === 0 && (R.remove(), Js(d, g, x, F, y, E)); + 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 = _t().innerRadius(_ * Q).outerRadius(_ * Q + 1); + z.transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)), q.select("text").transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)).on("end", (R) => C()); + let k = q.size(); + function C(R) { + k--, k === 0 && (T.remove(), Qs(h, g, D, M, _, A)); } } - function Zs(d, g, y, E, A, R, I, q = !0, O = !1, k = !1) { - const T = is().sort(null).value((C) => C.value)(y); - return Qs(d, g, T, E, A, R, I, q, O, k), T; + function ea(h, g, _, A, E, T, P, z = !0, q = !1, N = !1) { + const C = as().sort(null).value((R) => R.value)(_); + return ta(h, g, C, A, E, T, P, z, q, N), C; } function Er() { - ct(b(rt)).select("#" + M).selectAll(".elected").select("path").style("stroke", N).style("stroke-width", `${H}px`); - } - function Qs(d, g, y, E, A, R, I, q, O, k = !1) { - const P = fn(d), T = br(d), Z = ct(b(rt)).attr("viewBox", `0 0 ${m} ${$}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${E}, ${A})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (nt) => P.includes(nt.data.label) || nt.data.isTransfer === !0).classed("elected", (nt) => T.includes(nt.data.label) && !nt.data.isTransfer).attr("id", (nt) => p(nt.data)); - k ? Z.style("pointer-events", "none") : Z.on("mouseenter", (nt, Rt) => ji(nt, Rt)).on("mouseleave", (nt, Rt) => Ji(nt, Rt)); - const Xt = ye().outerRadius(I).innerRadius(R); - if (O) { - const nt = ye().outerRadius(R + 1).innerRadius(R); - Z.append("path").attr("d", nt).attr("stroke", k ? "none" : R === 0 ? at : "none").attr("stroke-width", k ? 0 : R === 0 ? ot : 0).attr("fill", k ? "none" : (Rt) => Tn(Rt)).transition("global").duration(tt).attr("d", (Rt) => Xt(Rt)).on("end", (Rt) => { - k || Ki(); + fe(x(ie)).select("#" + F).selectAll(".elected").select("path").style("stroke", I).style("stroke-width", `${Me}px`); + } + function ta(h, g, _, A, E, T, P, z, q, N = !1) { + const k = dn(h), C = xr(h), 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, Ce) => Zi(ne, Ce)).on("mouseleave", (ne, Ce) => Qi(ne, Ce)); + const Be = _t().outerRadius(P).innerRadius(T); + if (q) { + const ne = _t().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" : (Ce) => Ar(Ce)).transition("global").duration(U).attr("d", (Ce) => Be(Ce)).on("end", (Ce) => { + N || Ji(); }); } else - Z.append("path").attr("d", (nt) => Xt(nt)).attr("fill", k ? "none" : (nt) => Tn(nt)).attr("stroke", k ? "none" : at).attr("stroke-width", k ? 0 : ot), k || Ki(); - return q && !k && Js(d, y, E, A, I, P), y; - } - function El() { - const y = ct(b(rt)).select("#" + W).selectAll(".eliminated"); - y.size() > 0 && y.classed("finished", !0); - } - function Tl() { - const y = ct(b(rt)).select("#" + W).selectAll(".finished"); - y.size() > 0 && y.remove(); - } - function Rl(d, g) { - const A = ct(b(rt)).select("#" + S).selectAll(".eliminated"), R = ye().innerRadius(d), I = ye().outerRadius(g); - A.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(tt).attrTween("d", function(q) { - const O = Ge(g, d); - return function(k) { - return I.innerRadius(O(k)), I(q); + Z.append("path").attr("d", (ne) => Be(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(h, _, A, E, P, k), _; + } + function Nl() { + const _ = fe(x(ie)).select("#" + W).selectAll(".eliminated"); + _.size() > 0 && _.classed("finished", !0); + } + function kl() { + const _ = fe(x(ie)).select("#" + W).selectAll(".finished"); + _.size() > 0 && _.remove(); + } + function Ml(h, g) { + const E = fe(x(ie)).select("#" + S).selectAll(".eliminated"), T = _t().innerRadius(h), P = _t().outerRadius(g); + E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(U).attrTween("d", function(z) { + const q = Jt(g, h); + return function(N) { + return P.innerRadius(q(N)), P(z); }; - }).attr("fill", (q) => `url(#${It(q.data.label)})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(tt).attrTween("d", function(q) { - const O = Ge(g, d); - return function(k) { - return R.outerRadius(O(k)), R(q); + }).attr("fill", (z) => `url(#${ot(z.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(U).attrTween("d", function(z) { + const q = Jt(g, h); + return function(N) { + return T.outerRadius(q(N)), T(z); }; - }).attr("fill", (q) => Tn(q)); + }).attr("fill", (z) => Ar(z)); } - function Qr(d, g) { - const y = (d + g) / 2; - return y > Math.PI * 11 / 6 || y < Math.PI * 1 / 6 || y > Math.PI * 5 / 6 && y < Math.PI * 7 / 6 ? "middle" : y < Math.PI ? "start" : "end"; + function ei(h, g) { + const _ = (h + 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 Ki() { - ct(b( - rt + function Ji() { + fe(x( + ie // force redisplay of text labels )).select("#" + W).raise().append("g").remove(); } - function ta(d, g, y, E, A, R, I = !1) { - const O = is().sort(null).value((k) => k.value)(y); - return ra(d, g, O, E, A, R, I), O; - } - function ea(d, g, y, E, A = !1) { - const R = fn(d), I = br(d), k = ct(b(rt)).select("#" + g).selectAll(".slice").data(y, (T) => p(T.data)); - k.exit().remove(); - const P = k.enter().append("g").attr("class", "slice").attr("id", (T) => p(T.data)).classed("eliminated", !0); - return A ? P.style("pointer-events", "none") : P.on("mouseenter", (T, C) => ji(T, C)).on("mouseleave", (T, C) => Ji(T, C)), P.append("path").attr("d", (T) => E(T)).attr("fill", A ? "none" : (T) => Tn(T)).attr("stroke", A ? "none" : at).attr("stroke-width", A ? 0 : ot), k.classed("eliminated", (T) => R.includes(T.data.label)).classed("elected", (T) => I.includes(T.data.label)), A || k.on("mouseenter", (T, C) => ji(T, C)).on("mouseleave", (T, C) => Ji(T, C)), k; - } - function na(d, g, y, E, A, R = !1) { - const I = ye().outerRadius(A).innerRadius(E); - ea(d, g, y, I, R).select("path").attr("d", (O) => I(O)).attr("fill", R ? "none" : (O) => Tn(O)); - } - function ra(d, g, y, E, A, R, I = !1) { - const q = ye().outerRadius(A).innerRadius(E).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), O = ye().outerRadius(A).innerRadius(E); - ct(b(rt)).select("#" + g).selectAll(".slice").attr("prevStart", (Z) => Z.startAngle).attr("prevEnd", (Z) => Z.endAngle); - const T = ea(d, g, y, O, I); - let C = T.size(); - function Pt() { - C--, C <= 0 && (I || Ki()); + function na(h, g, _, A, E, T, P = !1) { + const q = as().sort(null).value((N) => N.value)(_); + return sa(h, g, q, A, E, T, P), q; + } + function ra(h, g, _, A, E = !1) { + const T = dn(h), P = xr(h), 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(h, g, _, A, E, T = !1) { + const P = _t().outerRadius(E).innerRadius(A); + ra(h, g, _, P, T).select("path").attr("d", (q) => P(q)).attr("fill", T ? "none" : (q) => Ar(q)); + } + function sa(h, g, _, A, E, T, P = !1) { + const z = _t().outerRadius(E).innerRadius(A).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), q = _t().outerRadius(E).innerRadius(A); + fe(x(ie)).select("#" + g).selectAll(".slice").attr("prevStart", (Z) => Z.startAngle).attr("prevEnd", (Z) => Z.endAngle); + const C = ra(h, g, _, q, P); + let R = C.size(); + function De() { + R--, R <= 0 && (P || Ji()); } - return T.select("path").transition("global").duration(tt).attrTween("d", function(Z) { - const Xt = Number(ct(this.parentNode).attr("prevStart")), nt = Number(ct(this.parentNode).attr("prevEnd")), Rt = Ge(Xt, Z.startAngle), ti = Ge(nt, Z.endAngle); - return (Tr) => (q.startAngle(Rt(Tr)).endAngle(ti(Tr)), q(Z)); + return C.select("path").transition("global").duration(U).attrTween("d", function(Z) { + const Be = Number(fe(this.parentNode).attr("prevStart")), ne = Number(fe(this.parentNode).attr("prevEnd")), Ce = Jt(Be, Z.startAngle), ti = Jt(ne, Z.endAngle); + return (Tr) => (z.startAngle(Ce(Tr)).endAngle(ti(Tr)), z(Z)); }).on("end", function(Z) { - Z.startAngle === Z.endAngle && ct(this).attr("stroke", "none"), Pt(); - }), R && !I && Al(d, y, A, fn(d)), y; + Z.startAngle === Z.endAngle && fe(this).attr("stroke", "none"), De(); + }), T && !P && Sl(h, _, E, dn(h)), _; } - function ji(d, g) { - s(g.data.label), i("enter"), a(d.clientX), o(d.clientY); + function Zi(h, g) { + s(g.data.label), i("enter"), a(h.clientX), o(h.clientY); } - function Ji(d, g) { + function Qi(h, g) { s(g.data.label), i("leave"); } - function Cl(d, g) { - i("show-exhausted"), a(d.clientX), o(d.clientY); + function Pl(h, g) { + i("show-exhausted"), a(h.clientX), o(h.clientY); } - function Sl(d, g) { + function Dl(h, g) { i("hide-exhausted"); } - var Nl = { - pieColors: Ft, - exhaustedLabel: _e, - countExhaustedVotes: He, - getEliminatedCandidates: fn, - getElectedCandidates: br, - runFullAnimationFn: jn, - animateOnePhaseFn: Zn, + var Ol = { + pieColors: Ie, + exhaustedLabel: Tt, + countExhaustedVotes: Xt, + getEliminatedCandidates: dn, + getElectedCandidates: xr, + runFullAnimationFn: Gt, + animateOnePhaseFn: Nt, get jsonData() { return n(); }, - set jsonData(d) { - n(d), st(); + set jsonData(h) { + n(h), re(); }, get currentRound() { return r(); }, - set currentRound(d = 1) { - r(d), st(); + set currentRound(h = 1) { + r(h), re(); }, get mouseEventType() { return i(); }, - set mouseEventType(d) { - i(d), st(); + set mouseEventType(h) { + i(h), re(); }, get mouseData() { return s(); }, - set mouseData(d) { - s(d), st(); + set mouseData(h) { + s(h), re(); }, get mouseX() { return a(); }, - set mouseX(d) { - a(d), st(); + set mouseX(h) { + a(h), re(); }, get mouseY() { return o(); }, - set mouseY(d) { - o(d), st(); + set mouseY(h) { + o(h), re(); }, get requestRoundChange() { return l(); }, - set requestRoundChange(d = (g) => { + set requestRoundChange(h = (g) => { }) { - l(d), st(); + l(h), re(); }, get candidateColors() { return u(); }, - set candidateColors(d = []) { - u(d), st(); + set candidateColors(h = []) { + u(h), re(); }, get excludeFinalWinnerAndEliminatedCandidate() { return f(); }, - set excludeFinalWinnerAndEliminatedCandidate(d = !1) { - f(d), st(); + set excludeFinalWinnerAndEliminatedCandidate(h = !1) { + f(h), re(); }, get firstRoundDeterminesPercentages() { - return h(); + return p(); }, - set firstRoundDeterminesPercentages(d = !1) { - h(d), st(); + set firstRoundDeterminesPercentages(h = !1) { + p(h), re(); }, - get displayPhase() { + get randomizeOrder() { return c(); }, - set displayPhase(d = 0) { - c(d), st(); + set randomizeOrder(h = !1) { + c(h), re(); + }, + get displayPhase() { + return d(); + }, + set displayPhase(h = 0) { + d(h), re(); } - }, ia = Gd(); - return pi(ia, (d) => dt(rt, d), () => b(rt)), Kt(t, ia), Vi(Nl); + }, aa = Qd(); + return vi(aa, (h) => he(ie, h), () => x(ie)), Ge(e, aa), zi(Ol); } -Hs( - ml, +Ys( + wl, { jsonData: {}, currentRound: {}, @@ -5516,6 +5550,7 @@ Hs( candidateColors: {}, excludeFinalWinnerAndEliminatedCandidate: {}, firstRoundDeterminesPercentages: {}, + randomizeOrder: {}, displayPhase: {} }, [], @@ -5530,83 +5565,83 @@ Hs( ], { mode: "open" } ); -var jd = /* @__PURE__ */ qe("
"), Jd = /* @__PURE__ */ qe('
', 1), Zd = /* @__PURE__ */ qe('
'); -const Qd = { +var tp = /* @__PURE__ */ Ht("
"), np = /* @__PURE__ */ Ht('
', 1), rp = /* @__PURE__ */ Ht('
'); +const ip = { 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 yl(t, e) { - qi(e, !0), Vs(t, Qd); - let n = ut(e, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = ut(e, "currentStep", 7, 0), i = ut(e, "disabled", 7, !1), s = ut(e, "onAdvance", 7, () => { +function xl(e, t) { + Vi(t, !0), Hs(e, ip); + let n = ae(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = ae(t, "currentStep", 7, 0), i = ae(t, "disabled", 7, !1), s = ae(t, "onAdvance", 7, () => { }); function a() { i() || s()(); } - function o(h) { - (h.key === "Enter" || h.key === " ") && (h.preventDefault(), a()); + function o(p) { + (p.key === "Enter" || p.key === " ") && (p.preventDefault(), a()); } var l = { get labels() { return n(); }, - set labels(h = ["Eliminate", "Transfer", "Consolidate"]) { - n(h), st(); + set labels(p = ["Eliminate", "Transfer", "Consolidate"]) { + n(p), re(); }, get currentStep() { return r(); }, - set currentStep(h = 0) { - r(h), st(); + set currentStep(p = 0) { + r(p), re(); }, get disabled() { return i(); }, - set disabled(h = !1) { - i(h), st(); + set disabled(p = !1) { + i(p), re(); }, get onAdvance() { return s(); }, - set onAdvance(h = () => { + set onAdvance(p = () => { }) { - s(h), st(); + s(p), re(); } - }, u = Zd(); + }, u = rp(); let f; - return u.__click = a, u.__keydown = o, di(u, 21, n, hi, (h, c, p) => { - var m = Jd(), $ = dn(m); + return u.__click = a, u.__keydown = o, pi(u, 21, n, di, (p, c, d) => { + var y = np(), b = _n(y); { - var _ = (K) => { - var Q = jd(); - let tt; - Ke(() => tt = ri(Q, 1, "connector svelte-1l4eyw0", null, tt, { completed: !i() && p <= r() })), Kt(K, Q); + var m = (W) => { + var oe = tp(); + let Q; + Zt(() => Q = ii(oe, 1, "connector svelte-1l4eyw0", null, Q, { completed: !i() && d <= r() })), Ge(W, oe); }; - tr($, (K) => { - p > 0 && K(_); + Qn(b, (W) => { + d > 0 && W(m); }); } - var x = Qt($, 2), F = Ut(x); - let S; - var M = Qt(F, 2); - let D; - var W = Ut(M, !0); - qt(M), qt(x), Ke(() => { - S = ri(F, 1, "dot svelte-1l4eyw0", null, S, { - active: !i() && p === r(), - completed: !i() && p < r() - }), D = ri(M, 1, "label svelte-1l4eyw0", null, D, { - active: !i() && p === r(), - completed: !i() && p < r() - }), pn(W, b(c)); - }), Kt(h, m); - }), qt(u), Ke(() => { - f = ri(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), ya(u, "tabindex", i() ? -1 : 0), ya(u, "aria-disabled", i()); - }), Kt(t, u), Vi(l); -} -Hu(["click", "keydown"]); -Hs(yl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); -var tp = /* @__PURE__ */ qe(" ", 1), ep = /* @__PURE__ */ qe("About to eliminate: ", 1), np = /* @__PURE__ */ qe(" ", 1), rp = /* @__PURE__ */ qe(" ", 1), ip = /* @__PURE__ */ qe('

', 1), sp = /* @__PURE__ */ qe("
", 1), ap = /* @__PURE__ */ qe('


these ballots have already been eliminated.
', 1); -const op = { + var $ = Qe(b, 2), D = We($); + let M; + var S = Qe(D, 2); + let F; + var L = We(S, !0); + Fe(S), Fe($), Zt(() => { + M = ii(D, 1, "dot svelte-1l4eyw0", null, M, { + active: !i() && d === r(), + completed: !i() && d < r() + }), F = ii(S, 1, "label svelte-1l4eyw0", null, F, { + active: !i() && d === r(), + completed: !i() && d < r() + }), mn(L, x(c)); + }), Ge(p, y); + }), Fe(u), Zt(() => { + f = ii(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), xa(u, "tabindex", i() ? -1 : 0), xa(u, "aria-disabled", i()); + }), Ge(e, u), zi(l); +} +Wu(["click", "keydown"]); +Ys(xl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); +var sp = /* @__PURE__ */ Ht(" ", 1), ap = /* @__PURE__ */ Ht("About to eliminate: ", 1), op = /* @__PURE__ */ Ht(" ", 1), lp = /* @__PURE__ */ Ht(" ", 1), up = /* @__PURE__ */ Ht('

', 1), fp = /* @__PURE__ */ Ht("
", 1), cp = /* @__PURE__ */ Ht('


these ballots have already been eliminated.
', 1); +const hp = { 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;} @@ -5621,12 +5656,12 @@ const op = { }` }; -function lp(t, e) { - qi(e, !0), Vs(t, op); +function dp(e, t) { + Vi(t, !0), Hs(e, hp); const n = 0.85; - let r = ut(e, "electionSummary", 7), i = ut(e, "currentRound", 7, 1), s = ut(e, "requestRoundChange", 7, (w) => { - }), a = ut(e, "candidateColors", 23, () => []), o = ut(e, "textForWinner", 7, "elected"), l = ut(e, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = ut(e, "firstRoundDeterminesPercentages", 7, !1), f = ut(e, "showCaptions", 7, !1); - const h = { + let r = ae(t, "electionSummary", 7), i = ae(t, "currentRound", 7, 1), s = ae(t, "requestRoundChange", 7, (w) => { + }), a = ae(t, "candidateColors", 23, () => []), o = ae(t, "textForWinner", 7, "elected"), l = ae(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = ae(t, "firstRoundDeterminesPercentages", 7, !1), f = ae(t, "randomizeOrder", 7, !1), p = ae(t, "showCaptions", 7, !1); + const c = { elected: { caption: "Elected", event: "was elected", @@ -5644,7 +5679,7 @@ function lp(t, e) { infinitive: "to take the lead" } }; - let c = /* @__PURE__ */ cn(() => h[o()] ?? h.elected), p = /* @__PURE__ */ Et(null), m = /* @__PURE__ */ Et(null), $ = /* @__PURE__ */ Et(""), _ = /* @__PURE__ */ Et(kn([])), x = /* @__PURE__ */ Et(""), F = /* @__PURE__ */ Et(""), S = /* @__PURE__ */ Et(0), M = /* @__PURE__ */ Et(0), D = /* @__PURE__ */ cn(() => W(r())); + let d = /* @__PURE__ */ vn(() => c[o()] ?? c.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), F = /* @__PURE__ */ $e(0), L = /* @__PURE__ */ vn(() => W(r())); function W(w) { if (typeof w == "string") try { @@ -5654,186 +5689,192 @@ function lp(t, e) { } return w || {}; } - function K(w) { + function oe(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function Q(w, Y, et) { - w.style.left = Y + "px", w.style.top = et + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const it = w.getBoundingClientRect(); - let zt = Y, le = et + 20; - zt + it.width > window.innerWidth - 12 && (zt = window.innerWidth - it.width - 12), zt < 12 && (zt = 12), le + it.height > window.innerHeight - 12 && (le = et - it.height - 12), w.style.left = zt + "px", w.style.top = le + "px"; + function Q(w, Y, te) { + w.style.left = Y + "px", w.style.top = te + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { + const se = w.getBoundingClientRect(); + let ze = Y, Wt = te + 20; + ze + se.width > window.innerWidth - 12 && (ze = window.innerWidth - se.width - 12), ze < 12 && (ze = 12), Wt + se.height > window.innerHeight - 12 && (Wt = te - se.height - 12), w.style.left = ze + "px", w.style.top = Wt + "px"; }); } - function tt() { - switch (b(x)) { + function U() { + switch (x(D)) { case "enter": ((w) => { - var Y = Jl(w, 2); - dt(_, Y[0], !0), dt($, Y[1], !0); - })(at(b(F), i())), b(p) && (Q(b(p), b(S) || 0, b(M) || 0), b(p).style.opacity = String(n)); + var Y = nu(w, 2); + he($, Y[0], !0), he(m, Y[1], !0); + })(ue(x(M), i())), x(y) && (Q(x(y), x(S) || 0, x(F) || 0), x(y).style.opacity = String(n)); break; case "leave": - b(p) && (b(p).style.opacity = "0"), dt(_, [], !0), dt($, ""); + x(y) && (x(y).style.opacity = "0"), he($, [], !0), he(m, ""); break; case "show-exhausted": - b(m) && (Q(b(m), b(S) || 0, b(M) || 0), b(m).style.opacity = String(n)); + x(b) && (Q(x(b), x(S) || 0, x(F) || 0), x(b).style.opacity = String(n)); break; case "hide-exhausted": - b(m) && (b(m).style.opacity = "0"); + x(b) && (x(b).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", b(x)); + console.log("Unknown mouse event: ", x(D)); break; } } - Is(() => tt()); - function J(w, Y) { + Fs(() => U()); + function le(w, Y) { return w === 1 ? Y ? "vote was" : "vote will be" : Y ? "votes were" : "votes will be"; } - function at(w, Y) { - const et = [], vt = w === "exhausted" ? _e() : w; - let bt; - w === "exhausted" ? bt = z(1) : bt = b(D).results[0].tally[w], et.push(`${vt} started with ${bt} votes.`); - for (let it = 1; it <= Y; it++) { - it === Y && (w === "exhausted" ? bt = z(Y) : bt = b(D).results[Y - 1].tally[w], et.push(`${vt} has ${bt} votes at round ${Y}.`)); - const zt = b(D).results[it - 1].tallyResults, le = xt(it); - for (let Bt = 0; Bt < zt.length; Bt++) { - const ue = zt[Bt].transfers, gt = zt[Bt].eliminated, _t = zt[Bt].elected; - if (!le) { - if (gt) - gt === w && et.push(`${vt} will be eliminated on round ${it}.`); - else if (w === _t && (et.push(`${vt} ${b(c).event} on round ${it}.`), ue)) - for (let [Lt, Ye] of Object.entries(ue)) - et.push(`${Ye} ${J(Number(Ye), it < Y)} transferred to ${Lt} on round ${it}.`); + function ue(w, Y) { + const te = [], pe = w === "exhausted" ? Tt() : w; + let xe; + w === "exhausted" ? xe = G(1) : xe = x(L).results[0].tally[w], te.push(`${pe} started with ${xe} votes.`); + for (let se = 1; se <= Y; se++) { + se === Y && (w === "exhausted" ? xe = G(Y) : xe = x(L).results[Y - 1].tally[w], te.push(`${pe} has ${xe} votes at round ${Y}.`)); + const ze = x(L).results[se - 1].tallyResults, Wt = we(se); + for (let Rt = 0; Rt < ze.length; Rt++) { + const Cn = ze[Rt].transfers, pn = ze[Rt].eliminated, Ee = ze[Rt].elected; + if (!Wt) { + if (pn) + pn === w && te.push(`${pe} will be eliminated on round ${se}.`); + else if (w === Ee && (te.push(`${pe} ${x(d).event} on round ${se}.`), Cn)) + for (let [Te, ve] of Object.entries(Cn)) + te.push(`${ve} ${le(Number(ve), se < Y)} transferred to ${Te} on round ${se}.`); } - const $t = gt || _t; - if ($t) { - const Lt = Number(ue[w]); - Lt && et.push(`${Lt} ${J(Lt, it < Y)} transferred from ${$t} on round ${it}.`); + const He = pn || Ee; + if (He) { + const Te = Number(Cn[w]); + Te && te.push(`${Te} ${le(Te, se < Y)} transferred from ${He} on round ${se}.`); } } } - return [et, vt]; + return [te, pe]; } - function ot() { + function O() { let w = 0; - for (let Y = 1; Y <= b(D).results.length; Y++) { - if (xt(Y)) continue; - const et = b(D).results[Y - 1].tallyResults; - for (let vt = 0; vt < et.length; vt++) - et[vt].elected && w++; + for (let Y = 1; Y <= x(L).results.length; Y++) { + if (we(Y)) continue; + const te = x(L).results[Y - 1].tallyResults; + for (let pe = 0; pe < te.length; pe++) + te[pe].elected && w++; } return w; } - let N, H = /* @__PURE__ */ Et(0); - function It(w) { - var bt; - return !((bt = b(D)) != null && bt.results) || w < 1 || w > b(D).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [b(D).results[w - 1].tallyResults.some((it) => it.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; + let I, Me = /* @__PURE__ */ $e(0); + function ot(w) { + var xe; + return !((xe = x(L)) != null && xe.results) || w < 1 || w > x(L).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [x(L).results[w - 1].tallyResults.some((se) => se.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; } - function Mt(w) { - var et; - if (!((et = b(D)) != null && et.results) || w < 1 || w > b(D).results.length || w === b(D).results.length) return !0; - const Y = b(D).results[w - 1].tallyResults; - return Y.length === 0 || Y.every((vt) => Object.keys(vt.transfers).length === 0); + function ye(w) { + var te; + if (!((te = x(L)) != null && te.results) || w < 1 || w > x(L).results.length || w === x(L).results.length) return !0; + const Y = x(L).results[w - 1].tallyResults; + return Y.length === 0 || Y.every((pe) => Object.keys(pe.transfers).length === 0); } - function xt(w) { - return l() && b(D).results && w === b(D).results.length; + function we(w) { + return l() && x(L).results && w === x(L).results.length; } - function ft(w) { - return xt(w) ? [] : N ? N.getEliminatedCandidates(w) : []; + function ee(w) { + return we(w) ? [] : I ? I.getEliminatedCandidates(w) : []; } - function lt(w) { - return xt(w) ? [] : N ? N.getElectedCandidates(w) : []; + function Pe(w) { + return we(w) ? [] : I ? I.getElectedCandidates(w) : []; } - function z(w) { - return N ? N.countExhaustedVotes(w) : 0; + function G(w) { + return I ? I.countExhaustedVotes(w) : 0; } - function Ft() { - N && N.animateOnePhaseFn && N.animateOnePhaseFn(); + function Ie() { + I && I.animateOnePhaseFn && I.animateOnePhaseFn(); } - function _e() { - return N ? N.exhaustedLabel : ""; + function Tt() { + return I ? I.exhaustedLabel : ""; } - function rt() { - return N ? N.pieColors : {}; + function ie() { + return I ? I.pieColors : {}; } - var bn = { + var Ze = { get electionSummary() { return r(); }, set electionSummary(w) { - r(w), st(); + r(w), re(); }, get currentRound() { return i(); }, set currentRound(w = 1) { - i(w), st(); + i(w), re(); }, get requestRoundChange() { return s(); }, set requestRoundChange(w = (Y) => { }) { - s(w), st(); + s(w), re(); }, get candidateColors() { return a(); }, set candidateColors(w = []) { - a(w), st(); + a(w), re(); }, get textForWinner() { return o(); }, set textForWinner(w = "elected") { - o(w), st(); + o(w), re(); }, get excludeFinalWinnerAndEliminatedCandidate() { return l(); }, set excludeFinalWinnerAndEliminatedCandidate(w = !1) { - l(w), st(); + l(w), re(); }, get firstRoundDeterminesPercentages() { return u(); }, set firstRoundDeterminesPercentages(w = !1) { - u(w), st(); + u(w), re(); }, - get showCaptions() { + get randomizeOrder() { return f(); }, + set randomizeOrder(w = !1) { + f(w), re(); + }, + get showCaptions() { + return p(); + }, set showCaptions(w = !1) { - f(w), st(); + p(w), re(); } - }, Ot = ap(), oe = dn(Ot), $n = Ut(oe); + }, Bt = cp(), lt = _n(Bt), Tn = We(lt); { - let w = /* @__PURE__ */ cn(() => It(i())), Y = /* @__PURE__ */ cn(() => Mt(i())); - yl($n, { + let w = /* @__PURE__ */ vn(() => ot(i())), Y = /* @__PURE__ */ vn(() => ye(i())); + xl(Tn, { get labels() { - return b(w); + return x(w); }, get currentStep() { - return b(H); + return x(Me); }, get disabled() { - return b(Y); + return x(Y); }, - onAdvance: Ft + onAdvance: Ie }); } - qt(oe); - var wt = Qt(oe, 4), me = Ut(wt), He = Ut(me), An = Ut(He); - pi( - ml(An, { + Fe(lt); + var _e = Qe(lt, 4), Ct = We(_e), Xt = We(Ct), jr = We(Xt); + vi( + wl(jr, { get jsonData() { - return b(D); + return x(L); }, get currentRound() { return i(); }, - requestRoundChange: K, + requestRoundChange: oe, get candidateColors() { return a(); }, @@ -5843,131 +5884,134 @@ function lp(t, e) { get firstRoundDeterminesPercentages() { return u(); }, + get randomizeOrder() { + return f(); + }, get mouseEventType() { - return b(x); + return x(D); }, set mouseEventType(w) { - dt(x, w, !0); + he(D, w, !0); }, get mouseData() { - return b(F); + return x(M); }, set mouseData(w) { - dt(F, w, !0); + he(M, w, !0); }, get mouseX() { - return b(S); + return x(S); }, set mouseX(w) { - dt(S, w, !0); + he(S, w, !0); }, get mouseY() { - return b(M); + return x(F); }, set mouseY(w) { - dt(M, w, !0); + he(F, w, !0); }, get displayPhase() { - return b(H); + return x(Me); }, set displayPhase(w) { - dt(H, w, !0); + he(Me, w, !0); } }), - (w) => N = w, - () => N - ), qt(He), qt(me); - var jr = Qt(me, 2); + (w) => I = w, + () => I + ), Fe(Xt), Fe(Ct); + var Jr = Qe(Ct, 2); { - var Jr = (w) => { - var Y = ip(), et = dn(Y), vt = Ut(et); - qt(et); - var bt = Qt(et, 2), it = Ut(bt); + var Zr = (w) => { + var Y = up(), te = _n(Y), pe = We(te); + Fe(te); + var xe = Qe(te, 2), se = We(xe); { - var zt = (_t) => { - var $t = ep(), Lt = Qt(dn($t)); - di(Lt, 17, () => ft(i()), hi, (Ye, jn, En) => { - var mt = tp(), ze = dn(mt); - let Be; - var Jn = Ut(ze, !0); - qt(ze); - var Zn = Qt(ze, 2); + var ze = (Ee) => { + var He = ap(), Te = Qe(_n(He)); + pi(Te, 17, () => ee(i()), di, (ve, ut, Ye) => { + var Ut = sp(), St = _n(Ut); + let Gt; + var Rn = We(St, !0); + Fe(St); + var me = Qe(St, 2); { - var $r = (Xe) => { - var We = pa(", "); - Kt(Xe, We); - }, Ar = /* @__PURE__ */ cn(() => En < ft(i()).length - 1); - tr(Zn, (Xe) => { - b(Ar) && Xe($r); + var br = (Kt) => { + var Nt = ga(", "); + Ge(Kt, Nt); + }, $r = /* @__PURE__ */ vn(() => Ye < ee(i()).length - 1); + Qn(me, (Kt) => { + x($r) && Kt(br); }); } - Ke( - (Xe) => { - Be = ma(ze, "", Be, Xe), pn(Jn, b(jn)); + Zt( + (Kt) => { + Gt = wa(St, "", Gt, Kt), mn(Rn, x(ut)); }, - [() => ({ color: rt()[b(jn)] })] - ), Kt(Ye, mt); - }), Kt(_t, $t); - }, le = /* @__PURE__ */ cn(() => ft(i()).length > 0); - tr(it, (_t) => { - b(le) && _t(zt); + [() => ({ color: ie()[x(ut)] })] + ), Ge(ve, Ut); + }), Ge(Ee, He); + }, Wt = /* @__PURE__ */ vn(() => ee(i()).length > 0); + Qn(se, (Ee) => { + x(Wt) && Ee(ze); }); } - var Bt = Qt(it, 2); + var Rt = Qe(se, 2); { - var ue = (_t) => { - var $t = rp(), Lt = dn($t), Ye = Qt(Lt); - di(Ye, 17, () => lt(i()), hi, (jn, En, mt) => { - var ze = np(), Be = dn(ze); - let Jn; - var Zn = Ut(Be, !0); - qt(Be); - var $r = Qt(Be, 2); + var Cn = (Ee) => { + var He = lp(), Te = _n(He), ve = Qe(Te); + pi(ve, 17, () => Pe(i()), di, (ut, Ye, Ut) => { + var St = op(), Gt = _n(St); + let Rn; + var me = We(Gt, !0); + Fe(Gt); + var br = Qe(Gt, 2); { - var Ar = (We) => { - var Tn = pa(", "); - Kt(We, Tn); - }, Xe = /* @__PURE__ */ cn(() => mt < lt(i()).length - 1); - tr($r, (We) => { - b(Xe) && We(Ar); + var $r = (Nt) => { + var ji = ga(", "); + Ge(Nt, ji); + }, Kt = /* @__PURE__ */ vn(() => Ut < Pe(i()).length - 1); + Qn(br, (Nt) => { + x(Kt) && Nt($r); }); } - Ke( - (We) => { - Jn = ma(Be, "", Jn, We), pn(Zn, b(En)); + Zt( + (Nt) => { + Rn = wa(Gt, "", Rn, Nt), mn(me, x(Ye)); }, - [() => ({ color: rt()[b(En)] })] - ), Kt(jn, ze); - }), Ke(() => pn(Lt, `${b(c).caption ?? ""}: `)), Kt(_t, $t); - }, gt = /* @__PURE__ */ cn(() => lt(i()).length > 0); - tr(Bt, (_t) => { - b(gt) && _t(ue); + [() => ({ color: ie()[x(Ye)] })] + ), Ge(ut, St); + }), Zt(() => mn(Te, `${x(d).caption ?? ""}: `)), Ge(Ee, He); + }, pn = /* @__PURE__ */ vn(() => Pe(i()).length > 0); + Qn(Rt, (Ee) => { + x(pn) && Ee(Cn); }); } - qt(bt), Ke((_t) => pn(vt, `${b(D).config.contest ?? ""}, ${_t ?? ""} ${b(c).infinitive ?? ""}, Round ${i() ?? ""}.`), [ot]), Kt(w, Y); + Fe(xe), Zt((Ee) => mn(pe, `${x(L).config.contest ?? ""}, ${Ee ?? ""} ${x(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ge(w, Y); }; - tr(jr, (w) => { - f() && w(Jr); + Qn(Jr, (w) => { + p() && w(Zr); }); } - qt(wt); - var Kn = Qt(wt, 2), un = Ut(Kn), Gi = Ut(un, !0); - qt(un); - var Zr = Qt(un, 2); - di(Zr, 17, () => b(_), hi, (w, Y) => { - var et = sp(), vt = dn(et), bt = Ut(vt, !0); - qt(vt), os(2), Ke(() => pn(bt, b(Y))), Kt(w, et); - }), qt(Kn), pi(Kn, (w) => dt(p, w), () => b(p)); - var fn = Qt(Kn, 2), br = Ut(fn); - return os(2), qt(fn), pi(fn, (w) => dt(m, w), () => b(m)), Ke( + Fe(_e); + var Jn = Qe(_e, 2), hn = We(Jn), Ki = We(hn, !0); + Fe(hn); + var Qr = Qe(hn, 2); + pi(Qr, 17, () => x($), di, (w, Y) => { + var te = fp(), pe = _n(te), xe = We(pe, !0); + Fe(pe), us(2), Zt(() => mn(xe, x(Y))), Ge(w, te); + }), Fe(Jn), vi(Jn, (w) => he(y, w), () => x(y)); + var dn = Qe(Jn, 2), xr = We(dn); + return us(2), Fe(dn), vi(dn, (w) => he(b, w), () => x(b)), Zt( (w) => { - pn(Gi, b($)), pn(br, `"${w ?? ""}" means all the candidates ranked on `); + mn(Ki, x(m)), mn(xr, `"${w ?? ""}" means all the candidates ranked on `); }, - [_e] - ), Kt(t, Ot), Vi(bn); + [Tt] + ), Ge(e, Bt), zi(Ze); } -customElements.define("pie-chart", Hs( - lp, +customElements.define("pie-chart", Ys( + dp, { electionSummary: {}, currentRound: {}, @@ -5976,6 +6020,7 @@ customElements.define("pie-chart", Hs( textForWinner: {}, excludeFinalWinnerAndEliminatedCandidate: {}, firstRoundDeterminesPercentages: {}, + randomizeOrder: {}, showCaptions: {} }, [], From 30ad6d0d771f1b971131ff016a5579909d97262b Mon Sep 17 00:00:00 2001 From: skaphan Date: Mon, 6 Apr 2026 16:31:35 -0700 Subject: [PATCH 30/31] Sync pie chart --- static/pie/pie-chart.es.js | 3384 ++++++++++++++++++------------------ 1 file changed, 1697 insertions(+), 1687 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index e7684102..94f9095f 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,17 +1,17 @@ -var Ll = Object.defineProperty; +var ql = Object.defineProperty; var oa = (e) => { throw TypeError(e); }; -var ql = (e, t, n) => t in e ? Ll(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; -var ce = (e, t, n) => ql(e, typeof t != "symbol" ? t + "" : t, n), es = (e, t, n) => t.has(e) || oa("Cannot " + n); +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 Vl = 1, zl = 2, Xa = 4, Hl = 8, Yl = 16, Bl = 1, Xl = 4, Wl = 8, Ul = 16, Gl = 1, Kl = 2, Ns = "[", Oi = "[!", ks = "]", ur = {}, Re = Symbol(), Wa = "http://www.w3.org/1999/xhtml", os = !1; -var Ua = Array.isArray, jl = Array.prototype.indexOf, fr = Array.prototype.includes, Ii = Array.from, bi = Object.keys, $i = Object.defineProperty, Hn = Object.getOwnPropertyDescriptor, Jl = Object.getOwnPropertyDescriptors, Zl = Object.prototype, Ql = Array.prototype, Ga = Object.getPrototypeOf, la = Object.isExtensible; -const eu = () => { +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 = () => { }; -function tu(e) { +function nu(e) { for (var t = 0; t < e.length; t++) e[t](); } @@ -21,7 +21,7 @@ function Ka() { }); return { promise: n, resolve: e, reject: t }; } -function nu(e, t) { +function ru(e, t) { if (Array.isArray(e)) return e; if (!(Symbol.iterator in e)) @@ -31,7 +31,7 @@ function nu(e, t) { if (n.push(r), n.length === t) break; return n; } -const Ne = 2, Ir = 4, Fi = 8, ja = 1 << 24, cn = 16, At = 32, En = 64, Ja = 128, pt = 512, Ae = 1024, ke = 2048, $t = 4096, rt = 8192, on = 16384, mr = 32768, cr = 65536, ua = 1 << 17, Za = 1 << 18, jn = 1 << 19, ru = 1 << 20, sn = 1 << 25, Wn = 65536, ls = 1 << 21, Ms = 1 << 22, wn = 1 << 23, Pr = Symbol("$state"), Qa = Symbol("legacy props"), iu = Symbol(""), kn = new class extends Error { +const Re = 2, Fr = 4, Li = 8, ja = 1 << 24, cn = 16, Ct = 32, En = 64, Ja = 128, gt = 512, Ae = 1024, Se = 2048, Tt = 4096, at = 8192, on = 16384, yr = 32768, hr = 65536, ua = 1 << 17, Za = 1 << 18, jn = 1 << 19, iu = 1 << 20, sn = 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 { constructor() { super(...arguments); ce(this, "name", "StaleReactionError"); @@ -39,83 +39,83 @@ const Ne = 2, Ir = 4, Fi = 8, ja = 1 << 24, cn = 16, At = 32, En = 64, Ja = 128, } }(); var Ha; -const su = ((Ha = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ha.contentType.includes("xml")) ?? !1, Ur = 3, yr = 8; -function au(e) { +const au = ((Ha = globalThis.document) == null ? void 0 : /* @__PURE__ */ Ha.contentType.includes("xml")) ?? !1, Ur = 3, wr = 8; +function ou(e) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -function ou() { +function lu() { throw new Error("https://svelte.dev/e/async_derived_orphan"); } -function lu(e, t, n) { +function uu(e, t, n) { throw new Error("https://svelte.dev/e/each_key_duplicate"); } -function uu(e) { +function fu(e) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function fu() { +function cu() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function cu(e) { +function hu(e) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function hu() { +function du() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function du() { +function pu() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function pu(e) { +function vu(e) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function vu() { +function gu() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function gu() { +function _u() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function _u() { +function mu() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -function mu() { +function yu() { throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror"); } -function Li(e) { +function qi(e) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -function yu() { +function wu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } let j = !1; function an(e) { j = e; } -let X; -function qe(e) { +let W; +function Ve(e) { if (e === null) - throw Li(), ur; - return X = e; + throw qi(), fr; + return W = e; } -function qi() { - return qe(/* @__PURE__ */ Vt(X)); +function Vi() { + return Ve(/* @__PURE__ */ Ht(W)); } -function Fe(e) { +function Le(e) { if (j) { - if (/* @__PURE__ */ Vt(X) !== null) - throw Li(), ur; - X = e; + if (/* @__PURE__ */ Ht(W) !== null) + throw qi(), fr; + W = e; } } function us(e = 1) { if (j) { - for (var t = e, n = X; t--; ) + for (var t = e, n = W; t--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Vt(n); - X = n; + /* @__PURE__ */ Ht(n); + W = n; } } -function Ai(e = !0) { - for (var t = 0, n = X; ; ) { - if (n.nodeType === yr) { +function Ei(e = !0) { + for (var t = 0, n = W; ; ) { + if (n.nodeType === wr) { var r = ( /** @type {Comment} */ n.data @@ -123,19 +123,19 @@ function Ai(e = !0) { if (r === ks) { if (t === 0) return n; t -= 1; - } else (r === Ns || r === Oi || // "[1", "[2", etc. for if blocks + } else (r === Ns || r === Fi || // "[1", "[2", etc. for if blocks r[0] === "[" && !isNaN(Number(r.slice(1)))) && (t += 1); } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Vt(n) + /* @__PURE__ */ Ht(n) ); e && n.remove(), n = i; } } function eo(e) { - if (!e || e.nodeType !== yr) - throw Li(), ur; + if (!e || e.nodeType !== wr) + throw qi(), fr; return ( /** @type {Comment} */ e.data @@ -144,19 +144,19 @@ function eo(e) { function to(e) { return e === this.v; } -function wu(e, t) { +function xu(e, t) { return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function"; } function no(e) { - return !wu(e, this.v); + return !xu(e, this.v); } -let xu = !1, st = null; -function hr(e) { - st = e; +let bu = !1, lt = null; +function dr(e) { + lt = e; } -function Vi(e, t = !1, n) { - st = { - p: st, +function zi(e, t = !1, n) { + lt = { + p: lt, i: !1, c: null, e: null, @@ -165,17 +165,17 @@ function Vi(e, t = !1, n) { l: null }; } -function zi(e) { +function Hi(e) { var t = ( /** @type {ComponentContext} */ - st + lt ), n = t.e; if (n !== null) { t.e = null; for (var r of n) Ro(r); } - return e !== void 0 && (t.x = e), t.i = !0, st = t.p, e ?? /** @type {T} */ + return e !== void 0 && (t.x = e), t.i = !0, lt = t.p, e ?? /** @type {T} */ {}; } function ro() { @@ -184,7 +184,7 @@ function ro() { let Mn = []; function io() { var e = Mn; - Mn = [], tu(e); + Mn = [], nu(e); } function xn(e) { if (Mn.length === 0 && !Dr) { @@ -195,22 +195,22 @@ function xn(e) { } Mn.push(e); } -function bu() { +function $u() { for (; Mn.length > 0; ) io(); } function so(e) { var t = J; if (t === null) - return B.f |= wn, e; - if ((t.f & mr) === 0 && (t.f & Ir) === 0) + return X.f |= wn, e; + if ((t.f & yr) === 0 && (t.f & Fr) === 0) throw e; - dr(e, t); + pr(e, t); } -function dr(e, t) { +function pr(e, t) { for (; t !== null; ) { if ((t.f & Ja) !== 0) { - if ((t.f & mr) === 0) + if ((t.f & yr) === 0) throw e; try { t.b.error(e); @@ -223,30 +223,30 @@ function dr(e, t) { } throw e; } -const $u = -7169; +const Au = -7169; function de(e, t) { - e.f = e.f & $u | t; + e.f = e.f & Au | t; } function Ps(e) { - (e.f & pt) !== 0 || e.deps === null ? de(e, Ae) : de(e, $t); + (e.f & gt) !== 0 || e.deps === null ? de(e, Ae) : de(e, Tt); } function ao(e) { if (e !== null) for (const t of e) - (t.f & Ne) === 0 || (t.f & Wn) === 0 || (t.f ^= Wn, ao( + (t.f & Re) === 0 || (t.f & Wn) === 0 || (t.f ^= Wn, ao( /** @type {Derived} */ t.deps )); } function oo(e, t, n) { - (e.f & ke) !== 0 ? t.add(e) : (e.f & $t) !== 0 && n.add(e), ao(e.deps), de(e, Ae); + (e.f & Se) !== 0 ? t.add(e) : (e.f & Tt) !== 0 && n.add(e), ao(e.deps), de(e, Ae); } -const ni = /* @__PURE__ */ new Set(); -let K = null, Se = null, Ke = [], Hi = null, fs = !1, Dr = !1; -var nr, rr, In, ir, Hr, Yr, Fn, Qt, sr, qt, cs, hs, lo; +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, Qt, ar, zt, cs, hs, lo; const Js = class Js { constructor() { - H(this, qt); + H(this, zt); ce(this, "committed", !1); /** * The current values of any sources that are updated in this batch @@ -265,20 +265,20 @@ const Js = class Js { * and append new ones by calling the functions added inside (if/each/key/etc) blocks * @type {Set<() => void>} */ - H(this, nr, /* @__PURE__ */ new Set()); + H(this, rr, /* @__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, rr, /* @__PURE__ */ new Set()); + H(this, ir, /* @__PURE__ */ new Set()); /** * The number of async effects that are currently in flight */ - H(this, In, 0); + H(this, Fn, 0); /** * The number of async effects that are currently in flight, _not_ inside a pending boundary */ - H(this, ir, 0); + H(this, sr, 0); /** * A deferred that resolves when the batch is committed, used with `settled()` * TODO replace with Promise.withResolvers once supported widely enough @@ -294,7 +294,7 @@ const Js = class Js { * Deferred effects that are MAYBE_DIRTY * @type {Set} */ - H(this, Fn, /* @__PURE__ */ new Set()); + H(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`. @@ -304,10 +304,10 @@ const Js = class Js { */ H(this, Qt, /* @__PURE__ */ new Map()); ce(this, "is_fork", !1); - H(this, sr, !1); + H(this, ar, !1); } is_deferred() { - return this.is_fork || v(this, ir) > 0; + return this.is_fork || v(this, sr) > 0; } /** * Add an effect to the #skipped_branches map and reset its children @@ -326,9 +326,9 @@ const Js = class Js { if (n) { v(this, Qt).delete(t); for (var r of n.d) - de(r, ke), xt(r); + de(r, Se), At(r); for (r of n.m) - de(r, $t), xt(r); + de(r, Tt), At(r); } } /** @@ -337,19 +337,19 @@ const Js = class Js { */ process(t) { var i; - Ke = [], this.apply(); + Ge = [], this.apply(); var n = [], r = []; for (const s of t) - be(this, qt, cs).call(this, s, n, r); + be(this, zt, cs).call(this, s, n, r); if (this.is_deferred()) { - be(this, qt, hs).call(this, r), be(this, qt, hs).call(this, n); + be(this, zt, hs).call(this, r), be(this, zt, hs).call(this, n); for (const [s, a] of v(this, Qt)) ho(s, a); } else { - for (const s of v(this, nr)) s(); - v(this, nr).clear(), v(this, In) === 0 && be(this, qt, lo).call(this), K = null, fa(r), fa(n), (i = v(this, Hr)) == null || i.resolve(); + for (const s of v(this, rr)) s(); + v(this, rr).clear(), v(this, Fn) === 0 && be(this, zt, lo).call(this), K = null, fa(r), fa(n), (i = v(this, Hr)) == null || i.resolve(); } - Se = null; + Ce = null; } /** * Associate a change to a given source with the current @@ -358,55 +358,55 @@ const Js = class Js { * @param {any} value */ capture(t, n) { - n !== Re && !this.previous.has(t) && this.previous.set(t, n), (t.f & wn) === 0 && (this.current.set(t, t.v), Se == null || Se.set(t, t.v)); + 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)); } activate() { K = this, this.apply(); } deactivate() { - K === this && (K = null, Se = null); + K === this && (K = null, Ce = null); } flush() { - if (this.activate(), Ke.length > 0) { + if (this.activate(), Ge.length > 0) { if (uo(), K !== null && K !== this) return; - } else v(this, In) === 0 && this.process([]); + } else v(this, Fn) === 0 && this.process([]); this.deactivate(); } discard() { - for (const t of v(this, rr)) t(this); - v(this, rr).clear(); + for (const t of v(this, ir)) t(this); + v(this, ir).clear(); } /** * * @param {boolean} blocking */ increment(t) { - V(this, In, v(this, In) + 1), t && V(this, ir, v(this, ir) + 1); + V(this, Fn, v(this, Fn) + 1), t && V(this, sr, v(this, sr) + 1); } /** * * @param {boolean} blocking */ decrement(t) { - V(this, In, v(this, In) - 1), t && V(this, ir, v(this, ir) - 1), !v(this, sr) && (V(this, sr, !0), xn(() => { - V(this, sr, !1), this.is_deferred() ? Ke.length > 0 && this.flush() : this.revive(); + 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(); })); } revive() { for (const t of v(this, Yr)) - v(this, Fn).delete(t), de(t, ke), xt(t); - for (const t of v(this, Fn)) - de(t, $t), xt(t); + v(this, In).delete(t), de(t, Se), At(t); + for (const t of v(this, In)) + de(t, Tt), At(t); this.flush(); } /** @param {() => void} fn */ oncommit(t) { - v(this, nr).add(t); + v(this, rr).add(t); } /** @param {(batch: Batch) => void} fn */ ondiscard(t) { - v(this, rr).add(t); + v(this, ir).add(t); } settled() { return (v(this, Hr) ?? V(this, Hr, Ka())).promise; @@ -414,7 +414,7 @@ const Js = class Js { static ensure() { if (K === null) { const t = K = new Js(); - ni.add(K), Dr || xn(() => { + ri.add(K), Dr || xn(() => { K === t && t.flush(); }); } @@ -423,7 +423,7 @@ const Js = class Js { apply() { } }; -nr = new WeakMap(), rr = new WeakMap(), In = new WeakMap(), ir = new WeakMap(), Hr = new WeakMap(), Yr = new WeakMap(), Fn = new WeakMap(), Qt = new WeakMap(), sr = new WeakMap(), qt = new WeakSet(), /** +rr = new WeakMap(), ir = new WeakMap(), Fn = new WeakMap(), sr = new WeakMap(), Hr = new WeakMap(), Yr = new WeakMap(), In = new WeakMap(), Qt = new WeakMap(), ar = new WeakMap(), zt = new WeakSet(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root @@ -433,9 +433,9 @@ nr = new WeakMap(), rr = new WeakMap(), In = new WeakMap(), ir = 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 & (At | En)) !== 0, l = o && (a & Ae) !== 0, u = l || (a & rt) !== 0 || v(this, Qt).has(i); + var a = i.f, o = (a & (Ct | En)) !== 0, l = o && (a & Ae) !== 0, u = l || (a & at) !== 0 || v(this, Qt).has(i); if (!u && i.fn !== null) { - o ? i.f ^= Ae : s !== null && (a & (Ir | Fi | ja)) !== 0 ? s.b.defer_effect(i) : (a & Ir) !== 0 ? n.push(i) : Gr(i) && ((a & cn) !== 0 && v(this, Fn).add(i), vr(i)); + 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 & cn) !== 0 && v(this, In).add(i), gr(i)); var f = i.first; if (f !== null) { i = f; @@ -451,13 +451,13 @@ cs = function(t, n, r) { */ hs = function(t) { for (var n = 0; n < t.length; n += 1) - oo(t[n], v(this, Yr), v(this, Fn)); + oo(t[n], v(this, Yr), v(this, In)); }, lo = function() { var i; - if (ni.size > 1) { + if (ri.size > 1) { this.previous.clear(); - var t = Se, n = !0; - for (const s of ni) { + var t = Ce, n = !0; + for (const s of ri) { if (s === this) { n = !1; continue; @@ -475,23 +475,23 @@ hs = function(t) { continue; const o = [...s.current.keys()].filter((l) => !this.current.has(l)); if (o.length > 0) { - var r = Ke; - Ke = []; + var r = Ge; + Ge = []; const l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map(); for (const f of a) fo(f, o, l, u); - if (Ke.length > 0) { + if (Ge.length > 0) { K = s, s.apply(); - for (const f of Ke) - be(i = s, qt, cs).call(i, f, [], []); + for (const f of Ge) + be(i = s, zt, cs).call(i, f, [], []); s.deactivate(); } - Ke = r; + Ge = r; } } - K = null, Se = t; + K = null, Ce = t; } - this.committed = !0, ni.delete(this); + this.committed = !0, ri.delete(this); }; let ln = Js; function re(e) { @@ -499,8 +499,8 @@ function re(e) { Dr = !0; try { for (var n; ; ) { - if (bu(), Ke.length === 0 && (K == null || K.flush(), Ke.length === 0)) - return Hi = null, /** @type {T} */ + if ($u(), Ge.length === 0 && (K == null || K.flush(), Ge.length === 0)) + return Yi = null, /** @type {T} */ n; uo(); } @@ -512,61 +512,61 @@ function uo() { fs = !0; var e = null; try { - for (var t = 0; Ke.length > 0; ) { + for (var t = 0; Ge.length > 0; ) { var n = ln.ensure(); if (t++ > 1e3) { var r, i; - Au(); + Eu(); } - n.process(Ke), bn.clear(); + n.process(Ge), bn.clear(); } } finally { - Ke = [], fs = !1, Hi = null; + Ge = [], fs = !1, Yi = null; } } -function Au() { +function Eu() { try { - hu(); + du(); } catch (e) { - dr(e, Hi); + pr(e, Yi); } } -let mt = null; +let xt = null; function fa(e) { var t = e.length; if (t !== 0) { for (var n = 0; n < t; ) { var r = e[n++]; - if ((r.f & (on | rt)) === 0 && Gr(r) && (mt = /* @__PURE__ */ new Set(), vr(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && ko(r), (mt == null ? void 0 : mt.size) > 0)) { + if ((r.f & (on | 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 mt) { - if ((i.f & (on | rt)) !== 0) continue; + for (const i of xt) { + if ((i.f & (on | at)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) - mt.has(a) && (mt.delete(a), s.push(a)), a = a.parent; + xt.has(a) && (xt.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (on | rt)) === 0 && vr(l); + (l.f & (on | at)) === 0 && gr(l); } } - mt.clear(); + xt.clear(); } } - mt = null; + xt = null; } } function fo(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 & Ne) !== 0 ? fo( + (s & Re) !== 0 ? fo( /** @type {Derived} */ i, t, n, r - ) : (s & (Ms | cn)) !== 0 && (s & ke) === 0 && co(i, t, r) && (de(i, ke), xt( + ) : (s & (Ms | cn)) !== 0 && (s & Se) === 0 && co(i, t, r) && (de(i, Se), At( /** @type {Effect} */ i )); @@ -577,9 +577,9 @@ function co(e, t, n) { if (r !== void 0) return r; if (e.deps !== null) for (const i of e.deps) { - if (fr.call(t, i)) + if (cr.call(t, i)) return !0; - if ((i.f & Ne) !== 0 && co( + if ((i.f & Re) !== 0 && co( /** @type {Derived} */ i, t, @@ -593,80 +593,80 @@ function co(e, t, n) { } return n.set(e, !1), !1; } -function xt(e) { - for (var t = Hi = e; t.parent !== null; ) { +function At(e) { + for (var t = Yi = e; t.parent !== null; ) { t = t.parent; var n = t.f; if (fs && t === J && (n & cn) !== 0 && (n & Za) === 0) return; - if ((n & (En | At)) !== 0) { + if ((n & (En | Ct)) !== 0) { if ((n & Ae) === 0) return; t.f ^= Ae; } } - Ke.push(t); + Ge.push(t); } function ho(e, t) { - if (!((e.f & At) !== 0 && (e.f & Ae) !== 0)) { - (e.f & ke) !== 0 ? t.d.push(e) : (e.f & $t) !== 0 && t.m.push(e), de(e, Ae); + 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); for (var n = e.first; n !== null; ) ho(n, t), n = n.next; } } -function Eu(e) { +function Tu(e) { let t = 0, n = Un(0), r; return () => { - Is() && (x(n), Ls(() => (t === 0 && (r = Xi(() => e(() => Or(n)))), t += 1, () => { + 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)); }); }))); }; } -var Tu = cr | jn | Ja; -function Cu(e, t, n) { - new Ru(e, t, n); +var Cu = hr | jn | Ja; +function Ru(e, t, n) { + new Su(e, t, n); } -var tt, Br, Mt, Ln, Pt, ct, Ue, Dt, en, yn, qn, tn, ar, Vn, or, lr, nn, Pi, ge, po, vo, ds, fi, ci, ps; -class Ru { +var it, Br, Dt, Ln, Ot, dt, We, Ft, en, yn, qn, tn, or, Vn, lr, ur, nn, Di, ve, po, vo, ds, ci, hi, ps; +class Su { /** * @param {TemplateNode} node * @param {BoundaryProps} props * @param {((anchor: Node) => void)} children */ constructor(t, n, r) { - H(this, ge); + H(this, ve); /** @type {Boundary | null} */ ce(this, "parent"); ce(this, "is_pending", !1); /** @type {TemplateNode} */ - H(this, tt); + H(this, it); /** @type {TemplateNode | null} */ - H(this, Br, j ? X : null); + H(this, Br, j ? W : null); /** @type {BoundaryProps} */ - H(this, Mt); + H(this, Dt); /** @type {((anchor: Node) => void)} */ H(this, Ln); /** @type {Effect} */ - H(this, Pt); + H(this, Ot); /** @type {Effect | null} */ - H(this, ct, null); + H(this, dt, null); /** @type {Effect | null} */ - H(this, Ue, null); + H(this, We, null); /** @type {Effect | null} */ - H(this, Dt, null); + H(this, Ft, null); /** @type {DocumentFragment | null} */ H(this, en, null); /** @type {TemplateNode | null} */ H(this, yn, null); H(this, qn, 0); H(this, tn, 0); - H(this, ar, !1); + H(this, or, !1); H(this, Vn, !1); /** @type {Set} */ - H(this, or, /* @__PURE__ */ new Set()); - /** @type {Set} */ H(this, lr, /* @__PURE__ */ new Set()); + /** @type {Set} */ + H(this, ur, /* @__PURE__ */ new Set()); /** * A source containing the number of pending async deriveds/expressions. * Only created if `$effect.pending()` is used inside the boundary, @@ -675,37 +675,37 @@ class Ru { * @type {Source | null} */ H(this, nn, null); - H(this, Pi, Eu(() => (V(this, nn, Un(v(this, qn))), () => { + H(this, Di, Tu(() => (V(this, nn, Un(v(this, qn))), () => { V(this, nn, null); }))); - V(this, tt, t), V(this, Mt, n), V(this, Ln, r), this.parent = /** @type {Effect} */ - J.b, this.is_pending = !!v(this, Mt).pending, V(this, Pt, qs(() => { + V(this, it, t), V(this, Dt, n), V(this, Ln, r), this.parent = /** @type {Effect} */ + J.b, this.is_pending = !!v(this, Dt).pending, V(this, Ot, qs(() => { if (J.b = this, j) { const s = v(this, Br); - qi(), /** @type {Comment} */ - s.nodeType === yr && /** @type {Comment} */ - s.data === Oi ? be(this, ge, vo).call(this) : (be(this, ge, po).call(this), v(this, tn) === 0 && (this.is_pending = !1)); + 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, tn) === 0 && (this.is_pending = !1)); } else { - var i = be(this, ge, ds).call(this); + var i = be(this, ve, ds).call(this); try { - V(this, ct, dt(() => r(i))); + V(this, dt, vt(() => r(i))); } catch (s) { this.error(s); } - v(this, tn) > 0 ? be(this, ge, ci).call(this) : this.is_pending = !1; + v(this, tn) > 0 ? be(this, ve, hi).call(this) : this.is_pending = !1; } return () => { var s; (s = v(this, yn)) == null || s.remove(); }; - }, Tu)), j && V(this, tt, X); + }, Cu)), j && V(this, it, W); } /** * Defer an effect inside a pending boundary until the boundary resolves * @param {Effect} effect */ defer_effect(t) { - oo(t, v(this, or), v(this, lr)); + oo(t, v(this, lr), v(this, ur)); } /** * Returns `false` if the effect exists inside a boundary whose pending snippet is shown @@ -715,7 +715,7 @@ class Ru { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, Mt).pending; + return !!v(this, Dt).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -724,57 +724,57 @@ class Ru { * @param {1 | -1} d */ update_pending_count(t) { - be(this, ge, ps).call(this, t), V(this, qn, v(this, qn) + t), !(!v(this, nn) || v(this, ar)) && (V(this, ar, !0), xn(() => { - V(this, ar, !1), v(this, nn) && pr(v(this, nn), v(this, qn)); + be(this, ve, ps).call(this, t), V(this, qn, v(this, qn) + t), !(!v(this, nn) || v(this, or)) && (V(this, or, !0), xn(() => { + V(this, or, !1), v(this, nn) && vr(v(this, nn), v(this, qn)); })); } get_effect_pending() { - return v(this, Pi).call(this), x( + return v(this, Di).call(this), x( /** @type {Source} */ v(this, nn) ); } /** @param {unknown} error */ error(t) { - var n = v(this, Mt).onerror; - let r = v(this, Mt).failed; + var n = v(this, Dt).onerror; + let r = v(this, Dt).failed; if (v(this, Vn) || !n && !r) throw t; - v(this, ct) && (Ve(v(this, ct)), V(this, ct, null)), v(this, Ue) && (Ve(v(this, Ue)), V(this, Ue, null)), v(this, Dt) && (Ve(v(this, Dt)), V(this, Dt, null)), j && (qe( + v(this, dt) && (ze(v(this, dt)), V(this, dt, null)), v(this, We) && (ze(v(this, We)), V(this, We, null)), v(this, Ft) && (ze(v(this, Ft)), V(this, Ft, null)), j && (Ve( /** @type {TemplateNode} */ v(this, Br) - ), us(), qe(Ai())); + ), us(), Ve(Ei())); var i = !1, s = !1; const a = () => { if (i) { - yu(); + wu(); return; } - i = !0, s && mu(), ln.ensure(), V(this, qn, 0), v(this, Dt) !== null && Yn(v(this, Dt), () => { - V(this, Dt, null); - }), this.is_pending = this.has_pending_snippet(), V(this, ct, be(this, ge, fi).call(this, () => (V(this, Vn, !1), dt(() => v(this, Ln).call(this, v(this, tt)))))), v(this, tn) > 0 ? be(this, ge, ci).call(this) : this.is_pending = !1; + i = !0, s && yu(), ln.ensure(), V(this, qn, 0), v(this, Ft) !== null && Yn(v(this, Ft), () => { + V(this, Ft, 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, tn) > 0 ? be(this, ve, hi).call(this) : this.is_pending = !1; }; xn(() => { try { s = !0, n == null || n(t, a), s = !1; } catch (o) { - dr(o, v(this, Pt) && v(this, Pt).parent); + pr(o, v(this, Ot) && v(this, Ot).parent); } - r && V(this, Dt, be(this, ge, fi).call(this, () => { + r && V(this, Ft, be(this, ve, ci).call(this, () => { ln.ensure(), V(this, Vn, !0); try { - return dt(() => { + return vt(() => { r( - v(this, tt), + v(this, it), () => t, () => a ); }); } catch (o) { - return dr( + return pr( o, /** @type {Effect} */ - v(this, Pt).parent + v(this, Ot).parent ), null; } finally { V(this, Vn, !1); @@ -783,49 +783,49 @@ class Ru { }); } } -tt = new WeakMap(), Br = new WeakMap(), Mt = new WeakMap(), Ln = new WeakMap(), Pt = new WeakMap(), ct = new WeakMap(), Ue = new WeakMap(), Dt = new WeakMap(), en = new WeakMap(), yn = new WeakMap(), qn = new WeakMap(), tn = new WeakMap(), ar = new WeakMap(), Vn = new WeakMap(), or = new WeakMap(), lr = new WeakMap(), nn = new WeakMap(), Pi = new WeakMap(), ge = new WeakSet(), po = function() { +it = new WeakMap(), Br = new WeakMap(), Dt = new WeakMap(), Ln = new WeakMap(), Ot = new WeakMap(), dt = new WeakMap(), We = new WeakMap(), Ft = new WeakMap(), en = new WeakMap(), yn = new WeakMap(), qn = new WeakMap(), tn = new WeakMap(), or = new WeakMap(), Vn = new WeakMap(), lr = new WeakMap(), ur = new WeakMap(), nn = new WeakMap(), Di = new WeakMap(), ve = new WeakSet(), po = function() { try { - V(this, ct, dt(() => v(this, Ln).call(this, v(this, tt)))); + V(this, dt, vt(() => v(this, Ln).call(this, v(this, it)))); } catch (t) { this.error(t); } }, vo = function() { - const t = v(this, Mt).pending; - t && (V(this, Ue, dt(() => t(v(this, tt)))), xn(() => { - var n = be(this, ge, ds).call(this); - V(this, ct, be(this, ge, fi).call(this, () => (ln.ensure(), dt(() => v(this, Ln).call(this, n))))), v(this, tn) > 0 ? be(this, ge, ci).call(this) : (Yn( + const t = v(this, Dt).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, () => (ln.ensure(), vt(() => v(this, Ln).call(this, n))))), v(this, tn) > 0 ? be(this, ve, hi).call(this) : (Yn( /** @type {Effect} */ - v(this, Ue), + v(this, We), () => { - V(this, Ue, null); + V(this, We, null); } ), this.is_pending = !1); })); }, ds = function() { - var t = v(this, tt); - return this.is_pending && (V(this, yn, it()), v(this, tt).before(v(this, yn)), t = v(this, yn)), t; + 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; }, /** * @param {() => Effect | null} fn */ -fi = function(t) { - var n = J, r = B, i = st; - Lt(v(this, Pt)), gt(v(this, Pt)), hr(v(this, Pt).ctx); +ci = function(t) { + var n = J, r = X, i = lt; + Vt(v(this, Ot)), mt(v(this, Ot)), dr(v(this, Ot).ctx); try { return t(); } catch (s) { return so(s), null; } finally { - Lt(n), gt(r), hr(i); + Vt(n), mt(r), dr(i); } -}, ci = function() { +}, hi = function() { const t = ( /** @type {(anchor: Node) => void} */ - v(this, Mt).pending + v(this, Dt).pending ); - v(this, ct) !== null && (V(this, en, document.createDocumentFragment()), v(this, en).append( + v(this, dt) !== null && (V(this, en, document.createDocumentFragment()), v(this, en).append( /** @type {TemplateNode} */ v(this, yn) - ), Do(v(this, ct), v(this, en))), v(this, Ue) === null && V(this, Ue, dt(() => t(v(this, tt)))); + ), Do(v(this, dt), v(this, en))), v(this, We) === null && V(this, We, vt(() => t(v(this, it)))); }, /** * 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,23 +834,23 @@ fi = function(t) { ps = function(t) { var n; if (!this.has_pending_snippet()) { - this.parent && be(n = this.parent, ge, ps).call(n, t); + this.parent && be(n = this.parent, ve, ps).call(n, t); return; } if (V(this, tn, v(this, tn) + t), v(this, tn) === 0) { this.is_pending = !1; - for (const r of v(this, or)) - de(r, ke), xt(r); for (const r of v(this, lr)) - de(r, $t), xt(r); - v(this, or).clear(), v(this, lr).clear(), v(this, Ue) && Yn(v(this, Ue), () => { - V(this, Ue, null); - }), v(this, en) && (v(this, tt).before(v(this, en)), V(this, en, null)); + 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, en) && (v(this, it).before(v(this, en)), V(this, en, null)); } }; -function Su(e, t, n, r) { - const i = Yi; - var s = e.filter((c) => !c.settled); +function Nu(e, t, n, r) { + const i = Bi; + var s = e.filter((h) => !h.settled); if (n.length === 0 && s.length === 0) { r(t.map(i)); return; @@ -858,13 +858,13 @@ function Su(e, t, n, r) { var a = K, o = ( /** @type {Effect} */ J - ), l = Nu(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((c) => c.promise)) : null; - function f(c) { + ), l = ku(), u = s.length === 1 ? s[0].promise : s.length > 1 ? Promise.all(s.map((h) => h.promise)) : null; + function f(h) { l(); try { - r(c); + r(h); } catch (d) { - (o.f & on) === 0 && dr(d, o); + (o.f & on) === 0 && pr(d, o); } a == null || a.deactivate(), vs(); } @@ -873,27 +873,27 @@ function Su(e, t, n, r) { return; } function p() { - l(), Promise.all(n.map((c) => /* @__PURE__ */ ku(c))).then((c) => f([...t.map(i), ...c])).catch((c) => dr(c, o)); + l(), Promise.all(n.map((h) => /* @__PURE__ */ Mu(h))).then((h) => f([...t.map(i), ...h])).catch((h) => pr(h, o)); } u ? u.then(p) : p(); } -function Nu() { - var e = J, t = B, n = st, r = K; +function ku() { + var e = J, t = X, n = lt, r = K; return function(s = !0) { - Lt(e), gt(t), hr(n), s && (r == null || r.activate()); + Vt(e), mt(t), dr(n), s && (r == null || r.activate()); }; } function vs() { - Lt(null), gt(null), hr(null); + Vt(null), mt(null), dr(null); } // @__NO_SIDE_EFFECTS__ -function Yi(e) { - var t = Ne | ke, n = B !== null && (B.f & Ne) !== 0 ? ( +function Bi(e) { + var t = Re | Se, n = X !== null && (X.f & Re) !== 0 ? ( /** @type {Derived} */ - B + X ) : null; return J !== null && (J.f |= jn), { - ctx: st, + ctx: lt, deps: null, effects: null, equals: to, @@ -903,7 +903,7 @@ function Yi(e) { rv: 0, v: ( /** @type {V} */ - Re + Te ), wv: 0, parent: n ?? J, @@ -911,12 +911,12 @@ function Yi(e) { }; } // @__NO_SIDE_EFFECTS__ -function ku(e, t, n) { +function Mu(e, t, n) { let r = ( /** @type {Effect | null} */ J ); - r === null && ou(); + r === null && lu(); var i = ( /** @type {Boundary} */ r.b @@ -926,9 +926,9 @@ function ku(e, t, n) { void 0 ), a = Un( /** @type {V} */ - Re - ), o = !B, l = /* @__PURE__ */ new Map(); - return zu(() => { + Te + ), o = !X, l = /* @__PURE__ */ new Map(); + return Hu(() => { var d; var u = Ka(); s = u.promise; @@ -947,11 +947,11 @@ function ku(e, t, n) { 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); } - const c = (y, b = void 0) => { + const h = (y, b = void 0) => { if (f.activate(), b) - b !== kn && (a.f |= wn, pr(a, b)); + b !== kn && (a.f |= wn, vr(a, b)); else { - (a.f & wn) !== 0 && (a.f ^= wn), pr(a, y); + (a.f & wn) !== 0 && (a.f ^= wn), vr(a, y); for (const [m, $] of l) { if (l.delete(m), m === f) break; $.reject(kn); @@ -959,44 +959,44 @@ function ku(e, t, n) { } o && (i.update_pending_count(-1), f.decrement(p)); }; - u.promise.then(c, (y) => c(null, y || "unknown")); - }), Lu(() => { + u.promise.then(h, (y) => h(null, y || "unknown")); + }), qu(() => { for (const u of l.values()) u.reject(kn); }), new Promise((u) => { function f(p) { - function c() { + function h() { p === s ? u(a) : f(s); } - p.then(c, c); + p.then(h, h); } f(s); }); } // @__NO_SIDE_EFFECTS__ function vn(e) { - const t = /* @__PURE__ */ Yi(e); + const t = /* @__PURE__ */ Bi(e); return Oo(t), t; } // @__NO_SIDE_EFFECTS__ function go(e) { - const t = /* @__PURE__ */ Yi(e); + const t = /* @__PURE__ */ Bi(e); return t.equals = no, t; } -function Mu(e) { +function Pu(e) { var t = e.effects; if (t !== null) { e.effects = null; for (var n = 0; n < t.length; n += 1) - Ve( + ze( /** @type {Effect} */ t[n] ); } } -function Pu(e) { +function Du(e) { for (var t = e.parent; t !== null; ) { - if ((t.f & Ne) === 0) + if ((t.f & Re) === 0) return (t.f & on) === 0 ? ( /** @type {Effect} */ t @@ -1007,32 +1007,32 @@ function Pu(e) { } function Ds(e) { var t, n = J; - Lt(Pu(e)); + Vt(Du(e)); try { - e.f &= ~Wn, Mu(e), t = qo(e); + e.f &= ~Wn, Pu(e), t = qo(e); } finally { - Lt(n); + Vt(n); } return t; } function _o(e) { var t = Ds(e); - if (!e.equals(t) && (e.wv = Fo(), (!(K != null && K.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { + if (!e.equals(t) && (e.wv = Io(), (!(K != null && K.is_fork) || e.deps === null) && (e.v = t, e.deps === null))) { de(e, Ae); return; } - An || (Se !== null ? (Is() || K != null && K.is_fork) && Se.set(e, t) : Ps(e)); + An || (Ce !== null ? (Fs() || K != null && K.is_fork) && Ce.set(e, t) : Ps(e)); } -function Du(e) { +function Ou(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 = eu, r.ac = null, Fr(r, 0), Vs(r)); + (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)); } function mo(e) { if (e.effects !== null) for (const t of e.effects) - t.teardown && vr(t); + t.teardown && gr(t); } let gs = /* @__PURE__ */ new Set(); const bn = /* @__PURE__ */ new Map(); @@ -1060,32 +1060,32 @@ function wo(e, t = !1, n = !0) { return t || (r.equals = no), r; } function he(e, t, n = !1) { - B !== null && // since we are untracking the function inside `$inspect.with` we need to add this check + X !== 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 - (!bt || (B.f & ua) !== 0) && ro() && (B.f & (Ne | cn | Ms | ua)) !== 0 && (vt === null || !fr.call(vt, e)) && _u(); + (!Et || (X.f & ua) !== 0) && ro() && (X.f & (Re | cn | Ms | ua)) !== 0 && (_t === null || !cr.call(_t, e)) && mu(); let r = n ? Pn(t) : t; - return pr(e, r); + return vr(e, r); } -function pr(e, t) { +function vr(e, t) { if (!e.equals(t)) { var n = e.v; An ? bn.set(e, t) : bn.set(e, n), e.v = t; var r = ln.ensure(); - if (r.capture(e, n), (e.f & Ne) !== 0) { + if (r.capture(e, n), (e.f & Re) !== 0) { const i = ( /** @type {Derived} */ e ); - (e.f & ke) !== 0 && Ds(i), Ps(i); + (e.f & Se) !== 0 && Ds(i), Ps(i); } - e.wv = Fo(), xo(e, ke), J !== null && (J.f & Ae) !== 0 && (J.f & (At | En)) === 0 && (ft === null ? Bu([e]) : ft.push(e)), !r.is_fork && gs.size > 0 && !yo && Ou(); + 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(); } return t; } -function Ou() { +function Fu() { yo = !1; for (const e of gs) - (e.f & Ae) !== 0 && de(e, $t), Gr(e) && vr(e); + (e.f & Ae) !== 0 && de(e, Tt), Gr(e) && gr(e); gs.clear(); } function Or(e) { @@ -1095,17 +1095,17 @@ function xo(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 & ke) === 0; - if (o && de(s, t), (a & Ne) !== 0) { + var s = n[i], a = s.f, o = (a & Se) === 0; + if (o && de(s, t), (a & Re) !== 0) { var l = ( /** @type {Derived} */ s ); - Se == null || Se.delete(l), (a & Wn) === 0 && (a & pt && (s.f |= Wn), xo(l, $t)); - } else o && ((a & cn) !== 0 && mt !== null && mt.add( + Ce == null || Ce.delete(l), (a & Wn) === 0 && (a & gt && (s.f |= Wn), xo(l, Tt)); + } else o && ((a & cn) !== 0 && xt !== null && xt.add( /** @type {Effect} */ s - ), xt( + ), At( /** @type {Effect} */ s )); @@ -1115,15 +1115,15 @@ function Pn(e) { if (typeof e != "object" || e === null || Pr in e) return e; const t = Ga(e); - if (t !== Zl && t !== Ql) + if (t !== Ql && t !== eu) return e; var n = /* @__PURE__ */ new Map(), r = Ua(e), i = /* @__PURE__ */ $e(0), s = Bn, a = (o) => { if (Bn === s) return o(); - var l = B, u = Bn; - gt(null), da(s); + var l = X, u = Bn; + mt(null), da(s); var f = o(); - return gt(l), da(u), f; + return mt(l), da(u), f; }; return r && n.set("length", /* @__PURE__ */ $e( /** @type {any[]} */ @@ -1133,7 +1133,7 @@ function Pn(e) { e, { defineProperty(o, l, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && vu(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && gu(); var f = n.get(l); return f === void 0 ? a(() => { var p = /* @__PURE__ */ $e(u.value); @@ -1144,11 +1144,11 @@ function Pn(e) { var u = n.get(l); if (u === void 0) { if (l in o) { - const f = a(() => /* @__PURE__ */ $e(Re)); + const f = a(() => /* @__PURE__ */ $e(Te)); n.set(l, f), Or(i); } } else - he(u, Re), Or(i); + he(u, Te), Or(i); return !0; }, get(o, l, u) { @@ -1157,11 +1157,11 @@ function Pn(e) { 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] : Re), b = /* @__PURE__ */ $e(y); + var y = Pn(p ? o[l] : Te), b = /* @__PURE__ */ $e(y); return b; }), n.set(l, f)), f !== void 0) { - var c = x(f); - return c === Re ? void 0 : c; + var h = x(f); + return h === Te ? void 0 : h; } return Reflect.get(o, l, u); }, @@ -1171,51 +1171,51 @@ function Pn(e) { var f = n.get(l); f && (u.value = x(f)); } else if (u === void 0) { - var p = n.get(l), c = p == null ? void 0 : p.v; - if (p !== void 0 && c !== Re) + var p = n.get(l), h = p == null ? void 0 : p.v; + if (p !== void 0 && h !== Te) return { enumerable: !0, configurable: !0, - value: c, + value: h, writable: !0 }; } return u; }, has(o, l) { - var c; + var h; if (l === Pr) return !0; - var u = n.get(l), f = u !== void 0 && u.v !== Re || Reflect.has(o, l); - if (u !== void 0 || J !== null && (!f || (c = Hn(o, l)) != null && c.writable)) { + var u = n.get(l), f = u !== void 0 && u.v !== Te || 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]) : Re, y = /* @__PURE__ */ $e(d); + var d = f ? Pn(o[l]) : Te, y = /* @__PURE__ */ $e(d); return y; }), n.set(l, u)); var p = x(u); - if (p === Re) + if (p === Te) return !1; } return f; }, set(o, l, u, f) { var M; - var p = n.get(l), c = l in o; + var p = 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, Re) : d in o && (y = a(() => /* @__PURE__ */ $e(Re)), n.set(d + "", y)); + y !== void 0 ? he(y, Te) : d in o && (y = a(() => /* @__PURE__ */ $e(Te)), n.set(d + "", y)); } if (p === void 0) - (!c || (M = Hn(o, l)) != null && M.writable) && (p = a(() => /* @__PURE__ */ $e(void 0)), he(p, Pn(u)), n.set(l, p)); + (!h || (M = Hn(o, l)) != null && M.writable) && (p = a(() => /* @__PURE__ */ $e(void 0)), he(p, Pn(u)), n.set(l, p)); else { - c = p.v !== Re; + h = p.v !== Te; var b = a(() => Pn(u)); he(p, b); } var m = Reflect.getOwnPropertyDescriptor(o, l); - if (m != null && m.set && m.set.call(f, u), !c) { + if (m != null && m.set && m.set.call(f, u), !h) { if (r && typeof l == "string") { var $ = ( /** @type {Source} */ @@ -1230,15 +1230,15 @@ function Pn(e) { ownKeys(o) { x(i); var l = Reflect.ownKeys(o).filter((p) => { - var c = n.get(p); - return c === void 0 || c.v !== Re; + var h = n.get(p); + return h === void 0 || h.v !== Te; }); for (var [u, f] of n) - f.v !== Re && !(u in o) && l.push(u); + f.v !== Te && !(u in o) && l.push(u); return l; }, setPrototypeOf() { - gu(); + _u(); } } ); @@ -1251,7 +1251,7 @@ function _s() { $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); } } -function it(e = "") { +function ot(e = "") { return document.createTextNode(e); } // @__NO_SIDE_EFFECTS__ @@ -1262,62 +1262,62 @@ function un(e) { ); } // @__NO_SIDE_EFFECTS__ -function Vt(e) { +function Ht(e) { return ( /** @type {TemplateNode | null} */ Ao.call(e) ); } -function We(e, t) { +function Xe(e, t) { if (!j) return /* @__PURE__ */ un(e); - var n = /* @__PURE__ */ un(X); + var n = /* @__PURE__ */ un(W); if (n === null) - n = X.appendChild(it()); + n = W.appendChild(ot()); else if (t && n.nodeType !== Ur) { - var r = it(); - return n == null || n.before(r), qe(r), r; + var r = ot(); + return n == null || n.before(r), Ve(r), r; } - return t && Bi( + return t && Xi( /** @type {Text} */ n - ), qe(n), n; + ), Ve(n), n; } function _n(e, t = !1) { if (!j) { var n = /* @__PURE__ */ un(e); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Vt(n) : n; + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ht(n) : n; } if (t) { - if ((X == null ? void 0 : X.nodeType) !== Ur) { - var r = it(); - return X == null || X.before(r), qe(r), r; + if ((W == null ? void 0 : W.nodeType) !== Ur) { + var r = ot(); + return W == null || W.before(r), Ve(r), r; } - Bi( + Xi( /** @type {Text} */ - X + W ); } - return X; + return W; } -function Qe(e, t = 1, n = !1) { - let r = j ? X : e; +function nt(e, t = 1, n = !1) { + let r = j ? W : e; for (var i; t--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Vt(r); + /* @__PURE__ */ Ht(r); if (!j) return r; if (n) { if ((r == null ? void 0 : r.nodeType) !== Ur) { - var s = it(); - return r === null ? i == null || i.after(s) : r.before(s), qe(s), s; + var s = ot(); + return r === null ? i == null || i.after(s) : r.before(s), Ve(s), s; } - Bi( + Xi( /** @type {Text} */ r ); } - return qe(r), r; + return Ve(r), r; } function Eo(e) { e.textContent = ""; @@ -1331,7 +1331,7 @@ function Os(e, t, n) { document.createElementNS(Wa, e, void 0) ); } -function Bi(e) { +function Xi(e) { if ( /** @type {string} */ e.nodeValue.length < 65536 @@ -1343,29 +1343,29 @@ function Bi(e) { t.nodeValue, t = e.nextSibling; } function Co(e) { - var t = B, n = J; - gt(null), Lt(null); + var t = X, n = J; + mt(null), Vt(null); try { return e(); } finally { - gt(t), Lt(n); + mt(t), Vt(n); } } function Iu(e) { - J === null && (B === null && cu(), fu()), An && uu(); + J === null && (X === null && hu(), cu()), An && fu(); } -function Fu(e, t) { +function Lu(e, t) { var n = t.last; n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); } -function zt(e, t, n) { +function Yt(e, t, n) { var r = J; - r !== null && (r.f & rt) !== 0 && (e |= rt); + r !== null && (r.f & at) !== 0 && (e |= at); var i = { - ctx: st, + ctx: lt, deps: null, nodes: null, - f: e | ke | pt, + f: e | Se | gt, first: null, fn: t, last: null, @@ -1379,93 +1379,93 @@ function zt(e, t, n) { }; if (n) try { - vr(i); + gr(i); } catch (o) { - throw Ve(i), o; + throw ze(i), o; } - else t !== null && xt(i); + else t !== null && At(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 & cn) !== 0 && (e & cr) !== 0 && s !== null && (s.f |= cr)), s !== null && (s.parent = r, r !== null && Fu(s, r), B !== null && (B.f & Ne) !== 0 && (e & En) === 0)) { + (s.f & jn) === 0 && (s = s.first, (e & cn) !== 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)) { var a = ( /** @type {Derived} */ - B + X ); (a.effects ?? (a.effects = [])).push(s); } return i; } -function Is() { - return B !== null && !bt; +function Fs() { + return X !== null && !Et; } -function Lu(e) { - const t = zt(Fi, null, !1); +function qu(e) { + const t = Yt(Li, null, !1); return de(t, Ae), t.teardown = e, t; } -function Fs(e) { +function Is(e) { Iu(); var t = ( /** @type {Effect} */ J.f - ), n = !B && (t & At) !== 0 && (t & mr) === 0; + ), n = !X && (t & Ct) !== 0 && (t & yr) === 0; if (n) { var r = ( /** @type {ComponentContext} */ - st + lt ); (r.e ?? (r.e = [])).push(e); } else return Ro(e); } function Ro(e) { - return zt(Ir | ru, e, !1); + return Yt(Fr | iu, e, !1); } -function qu(e) { +function Vu(e) { ln.ensure(); - const t = zt(En | jn, e, !0); + const t = Yt(En | jn, e, !0); return () => { - Ve(t); + ze(t); }; } -function Vu(e) { +function zu(e) { ln.ensure(); - const t = zt(En | jn, e, !0); + const t = Yt(En | jn, e, !0); return (n = {}) => new Promise((r) => { n.outro ? Yn(t, () => { - Ve(t), r(void 0); - }) : (Ve(t), r(void 0)); + ze(t), r(void 0); + }) : (ze(t), r(void 0)); }); } function So(e) { - return zt(Ir, e, !1); + return Yt(Fr, e, !1); } -function zu(e) { - return zt(Ms | jn, e, !0); +function Hu(e) { + return Yt(Ms | jn, e, !0); } function Ls(e, t = 0) { - return zt(Fi | t, e, !0); + return Yt(Li | t, e, !0); } function Zt(e, t = [], n = [], r = []) { - Su(r, t, n, (i) => { - zt(Fi, () => e(...i.map(x)), !0); + Nu(r, t, n, (i) => { + Yt(Li, () => e(...i.map(x)), !0); }); } function qs(e, t = 0) { - var n = zt(cn | t, e, !0); + var n = Yt(cn | t, e, !0); return n; } -function dt(e) { - return zt(At | jn, e, !0); +function vt(e) { + return Yt(Ct | jn, e, !0); } function No(e) { var t = e.teardown; if (t !== null) { - const n = An, r = B; - ha(!0), gt(null); + const n = An, r = X; + ha(!0), mt(null); try { t.call(null); } finally { - ha(n), gt(r); + ha(n), mt(r); } } } @@ -1477,22 +1477,22 @@ function Vs(e, t = !1) { i.abort(kn); }); var r = n.next; - (n.f & En) !== 0 ? n.parent = null : Ve(n, t), n = r; + (n.f & En) !== 0 ? n.parent = null : ze(n, t), n = r; } } -function Hu(e) { +function Yu(e) { for (var t = e.first; t !== null; ) { var n = t.next; - (t.f & At) === 0 && Ve(t), t = n; + (t.f & Ct) === 0 && ze(t), t = n; } } -function Ve(e, t = !0) { +function ze(e, t = !0) { var n = !1; - (t || (e.f & Za) !== 0) && e.nodes !== null && e.nodes.end !== null && (Yu( + (t || (e.f & Za) !== 0) && e.nodes !== null && e.nodes.end !== null && (Bu( e.nodes.start, /** @type {TemplateNode} */ e.nodes.end - ), n = !0), Vs(e, t && !n), Fr(e, 0), de(e, on); + ), n = !0), Vs(e, t && !n), Ir(e, 0), de(e, on); var r = e.nodes && e.nodes.t; if (r !== null) for (const s of r) @@ -1501,9 +1501,9 @@ function Ve(e, t = !0) { 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; } -function Yu(e, t) { +function Bu(e, t) { for (; e !== null; ) { - var n = e === t ? null : /* @__PURE__ */ Vt(e); + var n = e === t ? null : /* @__PURE__ */ Ht(e); e.remove(), e = n; } } @@ -1515,7 +1515,7 @@ function Yn(e, t, n = !0) { var r = []; Mo(e, r, !0); var i = () => { - n && Ve(e), t && t(); + n && ze(e), t && t(); }, s = r.length; if (s > 0) { var a = () => --s || i(); @@ -1525,17 +1525,17 @@ function Yn(e, t, n = !0) { i(); } function Mo(e, t, n) { - if ((e.f & rt) === 0) { - e.f ^= rt; + if ((e.f & at) === 0) { + e.f ^= at; 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 & cr) !== 0 || // If this is a branch effect without a block effect parent, + var s = i.next, a = (i.f & hr) !== 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 & At) !== 0 && (e.f & cn) !== 0; + (i.f & Ct) !== 0 && (e.f & cn) !== 0; Mo(i, t, a ? n : !1), i = s; } } @@ -1544,10 +1544,10 @@ function zs(e) { Po(e, !0); } function Po(e, t) { - if ((e.f & rt) !== 0) { - e.f ^= rt, (e.f & Ae) === 0 && (de(e, ke), xt(e)); + if ((e.f & at) !== 0) { + e.f ^= at, (e.f & Ae) === 0 && (de(e, Se), At(e)); for (var n = e.first; n !== null; ) { - var r = n.next, i = (n.f & cr) !== 0 || (n.f & At) !== 0; + var r = n.next, i = (n.f & hr) !== 0 || (n.f & Ct) !== 0; Po(n, i ? t : !1), n = r; } var s = e.nodes && e.nodes.t; @@ -1559,42 +1559,42 @@ function Po(e, t) { function Do(e, t) { if (e.nodes) for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Vt(n); + var i = n === r ? null : /* @__PURE__ */ Ht(n); t.append(n), n = i; } } -let hi = !1, An = !1; +let di = !1, An = !1; function ha(e) { An = e; } -let B = null, bt = !1; -function gt(e) { - B = e; +let X = null, Et = !1; +function mt(e) { + X = e; } let J = null; -function Lt(e) { +function Vt(e) { J = e; } -let vt = null; +let _t = null; function Oo(e) { - B !== null && (vt === null ? vt = [e] : vt.push(e)); + X !== null && (_t === null ? _t = [e] : _t.push(e)); } -let je = null, et = 0, ft = null; -function Bu(e) { - ft = e; +let Ke = null, rt = 0, ht = null; +function Xu(e) { + ht = e; } -let Io = 1, Dn = 0, Bn = Dn; +let Fo = 1, Dn = 0, Bn = Dn; function da(e) { Bn = e; } -function Fo() { - return ++Io; +function Io() { + return ++Fo; } function Gr(e) { var t = e.f; - if ((t & ke) !== 0) + if ((t & Se) !== 0) return !0; - if (t & Ne && (e.f &= ~Wn), (t & $t) !== 0) { + if (t & Re && (e.f &= ~Wn), (t & Tt) !== 0) { for (var n = ( /** @type {Value[]} */ e.deps @@ -1609,23 +1609,23 @@ function Gr(e) { ), s.wv > e.wv) return !0; } - (t & pt) !== 0 && // During time traveling we don't want to reset the status so that + (t & gt) !== 0 && // During time traveling we don't want to reset the status so that // traversal of the graph in the other batches still happens - Se === null && de(e, Ae); + Ce === null && de(e, Ae); } return !1; } function Lo(e, t, n = !0) { var r = e.reactions; - if (r !== null && !(vt !== null && fr.call(vt, e))) + if (r !== null && !(_t !== null && cr.call(_t, e))) for (var i = 0; i < r.length; i++) { var s = r[i]; - (s.f & Ne) !== 0 ? Lo( + (s.f & Re) !== 0 ? Lo( /** @type {Derived} */ s, t, !1 - ) : t === s && (n ? de(s, ke) : (s.f & Ae) !== 0 && de(s, $t), xt( + ) : t === s && (n ? de(s, Se) : (s.f & Ae) !== 0 && de(s, Tt), At( /** @type {Effect} */ s )); @@ -1633,9 +1633,9 @@ function Lo(e, t, n = !0) { } function qo(e) { var b; - var t = je, n = et, r = ft, i = B, s = vt, a = st, o = bt, l = Bn, u = e.f; - je = /** @type {null | Value[]} */ - null, et = 0, ft = null, B = (u & (At | En)) === 0 ? e : null, vt = null, hr(e.ctx), bt = !1, Bn = ++Dn, e.ac !== null && (Co(() => { + 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(() => { e.ac.abort(kn); }), e.ac = null); try { @@ -1644,24 +1644,24 @@ function qo(e) { /** @type {Function} */ e.fn ), p = f(); - e.f |= mr; - var c = e.deps, d = K == null ? void 0 : K.is_fork; - if (je !== null) { + e.f |= yr; + var h = e.deps, d = K == null ? void 0 : K.is_fork; + if (Ke !== null) { var y; - if (d || Fr(e, et), c !== null && et > 0) - for (c.length = et + je.length, y = 0; y < je.length; y++) - c[et + y] = je[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]; else - e.deps = c = je; - if (Is() && (e.f & pt) !== 0) - for (y = et; y < c.length; y++) - ((b = c[y]).reactions ?? (b.reactions = [])).push(e); - } else !d && c !== null && et < c.length && (Fr(e, et), c.length = et); - if (ro() && ft !== null && !bt && c !== null && (e.f & (Ne | $t | ke)) === 0) + 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[]} */ - ft.length; y++) + ht.length; y++) Lo( - ft[y], + ht[y], /** @type {Effect} */ e ); @@ -1672,71 +1672,71 @@ function qo(e) { if (t !== null) for (const m of t) m.rv = Dn; - ft !== null && (r === null ? r = ft : r.push(.../** @type {Source[]} */ - ft)); + ht !== null && (r === null ? r = ht : r.push(.../** @type {Source[]} */ + ht)); } return (e.f & wn) !== 0 && (e.f ^= wn), p; } catch (m) { return so(m); } finally { - e.f ^= ls, je = t, et = n, ft = r, B = i, vt = s, hr(a), bt = o, Bn = l; + e.f ^= ls, Ke = t, rt = n, ht = r, X = i, _t = s, dr(a), Et = o, Bn = l; } } -function Xu(e, t) { +function Wu(e, t) { let n = t.reactions; if (n !== null) { - var r = jl.call(n, e); + var r = Jl.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 & Ne) !== 0 && // Destroying a child effect while updating a parent effect can cause a dependency to appear + if (n === null && (t.f & Re) !== 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 - (je === null || !fr.call(je, t))) { + (Ke === null || !cr.call(Ke, t))) { var s = ( /** @type {Derived} */ t ); - (s.f & pt) !== 0 && (s.f ^= pt, s.f &= ~Wn), Ps(s), Du(s), Fr(s, 0); + (s.f & gt) !== 0 && (s.f ^= gt, s.f &= ~Wn), Ps(s), Ou(s), Ir(s, 0); } } -function Fr(e, t) { +function Ir(e, t) { var n = e.deps; if (n !== null) for (var r = t; r < n.length; r++) - Xu(e, n[r]); + Wu(e, n[r]); } -function vr(e) { +function gr(e) { var t = e.f; if ((t & on) === 0) { de(e, Ae); - var n = J, r = hi; - J = e, hi = !0; + var n = J, r = di; + J = e, di = !0; try { - (t & (cn | ja)) !== 0 ? Hu(e) : Vs(e), No(e); + (t & (cn | ja)) !== 0 ? Yu(e) : Vs(e), No(e); var i = qo(e); - e.teardown = typeof i == "function" ? i : null, e.wv = Io; + e.teardown = typeof i == "function" ? i : null, e.wv = Fo; var s; - os && xu && (e.f & ke) !== 0 && e.deps; + os && bu && (e.f & Se) !== 0 && e.deps; } finally { - hi = r, J = n; + di = r, J = n; } } } function x(e) { - var t = e.f, n = (t & Ne) !== 0; - if (B !== null && !bt) { + var t = e.f, n = (t & Re) !== 0; + if (X !== null && !Et) { var r = J !== null && (J.f & on) !== 0; - if (!r && (vt === null || !fr.call(vt, e))) { - var i = B.deps; - if ((B.f & ls) !== 0) - e.rv < Dn && (e.rv = Dn, je === null && i !== null && i[et] === e ? et++ : je === null ? je = [e] : je.push(e)); + 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)); else { - (B.deps ?? (B.deps = [])).push(e); + (X.deps ?? (X.deps = [])).push(e); var s = e.reactions; - s === null ? e.reactions = [B] : fr.call(s, B) || s.push(B); + s === null ? e.reactions = [X] : cr.call(s, X) || s.push(X); } } } @@ -1751,19 +1751,19 @@ function x(e) { var o = a.v; return ((a.f & Ae) === 0 && a.reactions !== null || zo(a)) && (o = Ds(a)), bn.set(a, o), o; } - var l = (a.f & pt) === 0 && !bt && B !== null && (hi || (B.f & pt) !== 0), u = (a.f & mr) === 0; - Gr(a) && (l && (a.f |= pt), _o(a)), l && !u && (mo(a), Vo(a)); + 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)); } - if (Se != null && Se.has(e)) - return Se.get(e); + if (Ce != null && Ce.has(e)) + return Ce.get(e); if ((e.f & wn) !== 0) throw e.v; return e.v; } function Vo(e) { - if (e.f |= pt, e.deps !== null) + if (e.f |= gt, e.deps !== null) for (const t of e.deps) - (t.reactions ?? (t.reactions = [])).push(e), (t.f & Ne) !== 0 && (t.f & pt) === 0 && (mo( + (t.reactions ?? (t.reactions = [])).push(e), (t.f & Re) !== 0 && (t.f & gt) === 0 && (mo( /** @type {Derived} */ t ), Vo( @@ -1772,26 +1772,26 @@ function Vo(e) { )); } function zo(e) { - if (e.v === Re) return !0; + if (e.v === Te) return !0; if (e.deps === null) return !1; for (const t of e.deps) - if (bn.has(t) || (t.f & Ne) !== 0 && zo( + if (bn.has(t) || (t.f & Re) !== 0 && zo( /** @type {Derived} */ t )) return !0; return !1; } -function Xi(e) { - var t = bt; +function Wi(e) { + var t = Et; try { - return bt = !0, e(); + return Et = !0, e(); } finally { - bt = t; + Et = t; } } const Ho = /* @__PURE__ */ new Set(), ms = /* @__PURE__ */ new Set(); -function Wu(e) { +function Uu(e) { for (var t = 0; t < e.length; t++) Ho.add(e[t]); for (var n of ms) @@ -1823,16 +1823,16 @@ function va(e) { } if (s = /** @type {Element} */ i[a] || e.target, s !== t) { - $i(e, "currentTarget", { + Ai(e, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = B, p = J; - gt(null), Lt(null); + var f = X, p = J; + mt(null), Vt(null); try { - for (var c, d = []; s !== null; ) { + for (var h, d = []; s !== null; ) { var y = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { @@ -1842,21 +1842,21 @@ function va(e) { // -> the target could not have been disabled because it emits the event in the first place e.target === s) && b.call(s, e); } catch ($) { - c ? d.push($) : c = $; + h ? d.push($) : h = $; } if (e.cancelBubble || y === t || y === null) break; s = y; } - if (c) { + if (h) { for (let $ of d) queueMicrotask(() => { throw $; }); - throw c; + throw h; } } finally { - e.__root = t, delete e.currentTarget, gt(f), Lt(p); + e.__root = t, delete e.currentTarget, mt(f), Vt(p); } } } @@ -1868,7 +1868,7 @@ const ts = (Ba = (Ya = globalThis == null ? void 0 : globalThis.window) == null createHTML: (e) => e } ); -function Uu(e) { +function Gu(e) { return ( /** @type {string} */ (ts == null ? void 0 : ts.createHTML(e)) ?? e @@ -1876,7 +1876,7 @@ function Uu(e) { } function Yo(e, t = !1) { var n = Os("template"); - return e = e.replaceAll("", ""), n.innerHTML = t ? Uu(e) : e, n.content; + return e = e.replaceAll("", ""), n.innerHTML = t ? Gu(e) : e, n.content; } function $n(e, t) { var n = ( @@ -1886,11 +1886,11 @@ function $n(e, t) { n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function Ht(e, t) { - var n = (t & Gl) !== 0, r = (t & Kl) !== 0, i, s = !e.startsWith(""); +function Bt(e, t) { + var n = (t & Kl) !== 0, r = (t & jl) !== 0, i, s = !e.startsWith(""); return () => { if (j) - return $n(X, null), X; + return $n(W, null), W; i === void 0 && (i = Yo(s ? e : "" + e, !0), n || (i = /** @type {TemplateNode} */ /* @__PURE__ */ un(i))); var a = ( @@ -1912,11 +1912,11 @@ function Ht(e, t) { }; } // @__NO_SIDE_EFFECTS__ -function Gu(e, t, n = "svg") { +function Ku(e, t, n = "svg") { var r = !e.startsWith(""), i = `<${n}>${r ? e : "" + e}`, s; return () => { if (j) - return $n(X, null), X; + return $n(W, null), W; if (!s) { var a = ( /** @type {DocumentFragment} */ @@ -1936,27 +1936,27 @@ function Gu(e, t, n = "svg") { }; } // @__NO_SIDE_EFFECTS__ -function Ku(e, t) { - return /* @__PURE__ */ Gu(e, t, "svg"); +function ju(e, t) { + return /* @__PURE__ */ Ku(e, t, "svg"); } function ga(e = "") { if (!j) { - var t = it(e + ""); + var t = ot(e + ""); return $n(t, t), t; } - var n = X; - return n.nodeType !== Ur ? (n.before(n = it()), qe(n)) : Bi( + var n = W; + return n.nodeType !== Ur ? (n.before(n = ot()), Ve(n)) : Xi( /** @type {Text} */ n ), $n(n, n), n; } -function Ge(e, t) { +function Ue(e, t) { if (j) { var n = ( /** @type {Effect & { nodes: EffectNodes }} */ J ); - ((n.f & mr) === 0 || n.nodes.end === null) && (n.nodes.end = X), qi(); + ((n.f & yr) === 0 || n.nodes.end === null) && (n.nodes.end = W), Vi(); return; } e !== null && e.before( @@ -1964,9 +1964,9 @@ function Ge(e, t) { t ); } -const ju = ["touchstart", "touchmove"]; -function Ju(e) { - return ju.includes(e); +const Ju = ["touchstart", "touchmove"]; +function Zu(e) { + return Ju.includes(e); } function mn(e, t) { var n = t == null ? "" : typeof t == "object" ? t + "" : t; @@ -1975,16 +1975,16 @@ function mn(e, t) { function Bo(e, t) { return Xo(e, t); } -function Zu(e, t) { +function Qu(e, t) { _s(), t.intro = t.intro ?? !1; - const n = t.target, r = j, i = X; + const n = t.target, r = j, i = W; try { - for (var s = /* @__PURE__ */ un(n); s && (s.nodeType !== yr || /** @type {Comment} */ + for (var s = /* @__PURE__ */ un(n); s && (s.nodeType !== wr || /** @type {Comment} */ s.data !== Ns); ) - s = /* @__PURE__ */ Vt(s); + s = /* @__PURE__ */ Ht(s); if (!s) - throw ur; - an(!0), qe( + throw fr; + an(!0), Ve( /** @type {Comment} */ s ); @@ -1995,23 +1995,23 @@ function Zu(e, t) { if (a instanceof Error && a.message.split(` `).some((o) => o.startsWith("https://svelte.dev/e/"))) throw a; - return a !== ur && console.warn("Failed to hydrate: ", a), t.recover === !1 && du(), _s(), Eo(n), an(!1), Bo(e, t); + return a !== fr && console.warn("Failed to hydrate: ", a), t.recover === !1 && pu(), _s(), Eo(n), an(!1), Bo(e, t); } finally { - an(r), qe(i); + an(r), Ve(i); } } -const ri = /* @__PURE__ */ new Map(); +const ii = /* @__PURE__ */ new Map(); function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { _s(); var o = /* @__PURE__ */ new Set(), l = (p) => { - for (var c = 0; c < p.length; c++) { - var d = p[c]; + for (var h = 0; h < p.length; h++) { + var d = p[h]; if (!o.has(d)) { o.add(d); - var y = Ju(d); + var y = Zu(d); for (const $ of [t, document]) { - var b = ri.get($); - b === void 0 && (b = /* @__PURE__ */ new Map(), ri.set($, b)); + 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); } @@ -2019,42 +2019,42 @@ function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int } }; l(Ii(Ho)), ms.add(l); - var u = void 0, f = Vu(() => { - var p = n ?? t.appendChild(it()); - return Cu( + var u = void 0, f = zu(() => { + var p = n ?? t.appendChild(ot()); + return Ru( /** @type {TemplateNode} */ p, { pending: () => { } }, - (c) => { - Vi({}); + (h) => { + zi({}); var d = ( /** @type {ComponentContext} */ - st + lt ); if (s && (d.c = s), i && (r.$$events = i), j && $n( /** @type {TemplateNode} */ - c, + h, null - ), u = e(c, r) || {}, j && (J.nodes.end = X, X === null || X.nodeType !== yr || /** @type {Comment} */ - X.data !== ks)) - throw Li(), ur; - zi(); + ), u = e(h, r) || {}, j && (J.nodes.end = W, W === null || W.nodeType !== wr || /** @type {Comment} */ + W.data !== ks)) + throw qi(), fr; + Hi(); } ), () => { var b; - for (var c of o) + for (var h of o) for (const m of [t, document]) { var d = ( /** @type {Map} */ - ri.get(m) + ii.get(m) ), y = ( /** @type {number} */ - d.get(c) + d.get(h) ); - --y == 0 ? (m.removeEventListener(c, va), d.delete(c), d.size === 0 && ri.delete(m)) : d.set(c, y); + --y == 0 ? (m.removeEventListener(h, va), d.delete(h), d.size === 0 && ii.delete(m)) : d.set(h, y); } ms.delete(l), p !== n && ((b = p.parentNode) == null || b.removeChild(p)); }; @@ -2062,12 +2062,12 @@ function Xo(e, { target: t, anchor: n, props: r = {}, events: i, context: s, int return ys.set(u, f), u; } let ys = /* @__PURE__ */ new WeakMap(); -function Qu(e, t) { +function ef(e, t) { const n = ys.get(e); return n ? (ys.delete(e), n(t)) : Promise.resolve(); } -var yt, Ot, nt, zn, Xr, Wr, Di; -class ef { +var bt, It, st, zn, Xr, Wr, Oi; +class tf { /** * @param {TemplateNode} anchor * @param {boolean} transition @@ -2076,7 +2076,7 @@ class ef { /** @type {TemplateNode} */ ce(this, "anchor"); /** @type {Map} */ - H(this, yt, /* @__PURE__ */ new Map()); + H(this, bt, /* @__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,13 +2091,13 @@ class ef { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - H(this, Ot, /* @__PURE__ */ new Map()); + H(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, nt, /* @__PURE__ */ new Map()); + H(this, st, /* @__PURE__ */ new Map()); /** * Keys of effects that are currently outroing * @type {Set} @@ -2113,32 +2113,32 @@ class ef { /** @type {Batch} */ K ); - if (v(this, yt).has(t)) { + if (v(this, bt).has(t)) { var n = ( /** @type {Key} */ - v(this, yt).get(t) - ), r = v(this, Ot).get(n); + v(this, bt).get(t) + ), r = v(this, It).get(n); if (r) zs(r), v(this, zn).delete(n); else { - var i = v(this, nt).get(n); - i && (v(this, Ot).set(n, i.effect), v(this, nt).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + var i = v(this, st).get(n); + i && (v(this, It).set(n, i.effect), v(this, st).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); } - for (const [s, a] of v(this, yt)) { - if (v(this, yt).delete(s), s === t) + for (const [s, a] of v(this, bt)) { + if (v(this, bt).delete(s), s === t) break; - const o = v(this, nt).get(a); - o && (Ve(o.effect), v(this, nt).delete(a)); + const o = v(this, st).get(a); + o && (ze(o.effect), v(this, st).delete(a)); } - for (const [s, a] of v(this, Ot)) { + for (const [s, a] of v(this, It)) { if (s === n || v(this, zn).has(s)) continue; const o = () => { - if (Array.from(v(this, yt).values()).includes(s)) { + if (Array.from(v(this, bt).values()).includes(s)) { var u = document.createDocumentFragment(); - Do(a, u), u.append(it()), v(this, nt).set(s, { effect: a, fragment: u }); + Do(a, u), u.append(ot()), v(this, st).set(s, { effect: a, fragment: u }); } else - Ve(a); - v(this, zn).delete(s), v(this, Ot).delete(s); + ze(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(); } @@ -2147,11 +2147,11 @@ class ef { /** * @param {Batch} batch */ - H(this, Di, (t) => { - v(this, yt).delete(t); - const n = Array.from(v(this, yt).values()); - for (const [r, i] of v(this, nt)) - n.includes(r) || (Ve(i.effect), v(this, nt).delete(r)); + 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)); }); this.anchor = t, V(this, Xr, n); } @@ -2165,48 +2165,48 @@ class ef { /** @type {Batch} */ K ), i = To(); - if (n && !v(this, Ot).has(t) && !v(this, nt).has(t)) + if (n && !v(this, It).has(t) && !v(this, st).has(t)) if (i) { - var s = document.createDocumentFragment(), a = it(); - s.append(a), v(this, nt).set(t, { - effect: dt(() => n(a)), + var s = document.createDocumentFragment(), a = ot(); + s.append(a), v(this, st).set(t, { + effect: vt(() => n(a)), fragment: s }); } else - v(this, Ot).set( + v(this, It).set( t, - dt(() => n(this.anchor)) + vt(() => n(this.anchor)) ); - if (v(this, yt).set(r, t), i) { - for (const [o, l] of v(this, Ot)) + if (v(this, bt).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, nt)) + for (const [o, l] of v(this, st)) o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); - r.oncommit(v(this, Wr)), r.ondiscard(v(this, Di)); + r.oncommit(v(this, Wr)), r.ondiscard(v(this, Oi)); } else - j && (this.anchor = X), v(this, Wr).call(this); + j && (this.anchor = W), v(this, Wr).call(this); } } -yt = new WeakMap(), Ot = new WeakMap(), nt = new WeakMap(), zn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Di = new WeakMap(); -function tf(e) { - st === null && au(), Fs(() => { - const t = Xi(e); +bt = new WeakMap(), It = 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); if (typeof t == "function") return ( /** @type {() => void} */ t ); }); } -function Qn(e, t, n = !1) { - j && qi(); - var r = new ef(e), i = n ? cr : 0; +function er(e, t, n = !1) { + j && Vi(); + var r = new tf(e), i = n ? hr : 0; function s(a, o) { if (j) { const f = eo(e); var l; - if (f === Ns ? l = 0 : f === Oi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { - var u = Ai(); - qe(u), r.anchor = u, an(!1), r.ensure(a, o), an(!0); + if (f === Ns ? l = 0 : f === Fi ? l = !1 : l = parseInt(f.substring(1)), a !== l) { + var u = Ei(); + Ve(u), r.anchor = u, an(!1), r.ensure(a, o), an(!0); return; } } @@ -2219,10 +2219,10 @@ function Qn(e, t, n = !1) { }), a || s(!1, null); }, i); } -function di(e, t) { +function pi(e, t) { return t; } -function nf(e, t, n) { +function rf(e, t, n) { for (var r = [], i = t.length, s, a = t.length, o = 0; o < i; o++) { let p = t[o]; Yn( @@ -2230,11 +2230,11 @@ function nf(e, t, n) { () => { if (s) { if (s.pending.delete(p), s.done.add(p), s.pending.size === 0) { - var c = ( + var h = ( /** @type {Set} */ e.outrogroups ); - ws(Ii(s.done)), c.delete(s), c.size === 0 && (e.outrogroups = null); + ws(Ii(s.done)), h.delete(s), h.size === 0 && (e.outrogroups = null); } } else a -= 1; @@ -2263,152 +2263,152 @@ function nf(e, t, n) { } function ws(e, t = !0) { for (var n = 0; n < e.length; n++) - Ve(e[n], t); + ze(e[n], t); } var _a; -function pi(e, t, n, r, i, s = null) { +function vi(e, t, n, r, i, s = null) { var a = e, o = /* @__PURE__ */ new Map(), l = (t & Xa) !== 0; if (l) { var u = ( /** @type {Element} */ e ); - a = j ? qe(/* @__PURE__ */ un(u)) : u.appendChild(it()); + a = j ? Ve(/* @__PURE__ */ un(u)) : u.appendChild(ot()); } - j && qi(); + j && Vi(); var f = null, p = /* @__PURE__ */ go(() => { var $ = n(); return Ua($) ? $ : $ == null ? [] : Ii($); - }), c, d = !0; + }), h, d = !0; function y() { - m.fallback = f, rf(m, c, a, t, r), f !== null && (c.length === 0 ? (f.f & sn) === 0 ? zs(f) : (f.f ^= sn, Sr(f, null, a)) : Yn(f, () => { + m.fallback = f, sf(m, h, a, t, r), f !== null && (h.length === 0 ? (f.f & sn) === 0 ? zs(f) : (f.f ^= sn, Sr(f, null, a)) : Yn(f, () => { f = null; })); } var b = qs(() => { - c = /** @type {V[]} */ + h = /** @type {V[]} */ x(p); - var $ = c.length; + var $ = h.length; let D = !1; if (j) { - var M = eo(a) === Oi; - M !== ($ === 0) && (a = Ai(), qe(a), an(!1), D = !0); + var M = eo(a) === Fi; + M !== ($ === 0) && (a = Ei(), Ve(a), an(!1), D = !0); } - for (var S = /* @__PURE__ */ new Set(), F = ( + for (var S = /* @__PURE__ */ new Set(), I = ( /** @type {Batch} */ K - ), L = To(), W = 0; W < $; W += 1) { - j && X.nodeType === yr && /** @type {Comment} */ - X.data === ks && (a = /** @type {Comment} */ - X, D = !0, an(!1)); - var oe = c[W], Q = r(oe, W), U = d ? null : o.get(Q); - U ? (U.v && pr(U.v, oe), U.i && pr(U.i, W), L && F.unskip_effect(U.e)) : (U = sf( + ), L = To(), U = 0; U < $; U += 1) { + j && W.nodeType === wr && /** @type {Comment} */ + W.data === ks && (a = /** @type {Comment} */ + W, D = !0, an(!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( o, - d ? a : _a ?? (_a = it()), - oe, + d ? a : _a ?? (_a = ot()), + ae, Q, - W, + U, i, t, n - ), d || (U.e.f |= sn), o.set(Q, U)), S.add(Q); + ), d || (G.e.f |= sn), o.set(Q, G)), S.add(Q); } - if ($ === 0 && s && !f && (d ? f = dt(() => s(a)) : (f = dt(() => s(_a ?? (_a = it()))), f.f |= sn)), $ > S.size && lu(), j && $ > 0 && qe(Ai()), !d) + if ($ === 0 && s && !f && (d ? f = vt(() => s(a)) : (f = vt(() => s(_a ?? (_a = ot()))), f.f |= sn)), $ > S.size && uu(), j && $ > 0 && Ve(Ei()), !d) if (L) { - for (const [le, ue] of o) - S.has(le) || F.skip_effect(ue.e); - F.oncommit(y), F.ondiscard(() => { + for (const [oe, ue] of o) + S.has(oe) || I.skip_effect(ue.e); + I.oncommit(y), I.ondiscard(() => { }); } else y(); D && an(!0), x(p); }), m = { effect: b, items: o, outrogroups: null, fallback: f }; - d = !1, j && (a = X); + d = !1, j && (a = W); } function Cr(e) { - for (; e !== null && (e.f & At) === 0; ) + for (; e !== null && (e.f & Ct) === 0; ) e = e.next; return e; } -function rf(e, t, n, r, i) { - var U, le, ue, O, I, Me, ot, ye, we; - var s = (r & Hl) !== 0, a = t.length, o = e.items, l = Cr(e.effect.first), u, f = null, p, c = [], d = [], y, b, m, $; +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, $; if (s) for ($ = 0; $ < a; $ += 1) y = t[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, (m.f & sn) === 0 && ((le = (U = m.nodes) == null ? void 0 : U.a) == null || le.measure(), (p ?? (p = /* @__PURE__ */ new Set())).add(m)); + o.get(b).e, (m.f & sn) === 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 ee of e.outrogroups) - ee.pending.delete(m), ee.done.delete(m); + for (const te of e.outrogroups) + te.pending.delete(m), te.done.delete(m); if ((m.f & sn) !== 0) if (m.f ^= sn, m === l) Sr(m, 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, c = [], d = [], l = Cr(f.next); + 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); continue; } - if ((m.f & rt) !== 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 ((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 (c.length < d.length) { + if (h.length < d.length) { var M = d[0], S; f = M.prev; - var F = c[0], L = c[c.length - 1]; - for (S = 0; S < c.length; S += 1) - Sr(c[S], M, n); + 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, F.prev, L.next), gn(e, f, F), gn(e, L, M), l = M, f = L, $ -= 1, c = [], d = []; + gn(e, I.prev, L.next), gn(e, f, I), gn(e, L, M), l = M, f = L, $ -= 1, h = [], d = []; } 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; continue; } - for (c = [], d = []; l !== null && l !== m; ) + for (h = [], d = []; l !== null && l !== m; ) (u ?? (u = /* @__PURE__ */ new Set())).add(l), d.push(l), l = Cr(l.next); if (l === null) continue; } - (m.f & sn) === 0 && c.push(m), f = m, l = Cr(m.next); + (m.f & sn) === 0 && h.push(m), f = m, l = Cr(m.next); } if (e.outrogroups !== null) { - for (const ee of e.outrogroups) - ee.pending.size === 0 && (ws(Ii(ee.done)), (I = e.outrogroups) == null || I.delete(ee)); + for (const te of e.outrogroups) + te.pending.size === 0 && (ws(Ii(te.done)), (F = e.outrogroups) == null || F.delete(te)); e.outrogroups.size === 0 && (e.outrogroups = null); } if (l !== null || u !== void 0) { - var W = []; + var U = []; if (u !== void 0) for (m of u) - (m.f & rt) === 0 && W.push(m); + (m.f & at) === 0 && U.push(m); for (; l !== null; ) - (l.f & rt) === 0 && l !== e.fallback && W.push(l), l = Cr(l.next); - var oe = W.length; - if (oe > 0) { + (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; if (s) { - for ($ = 0; $ < oe; $ += 1) - (ot = (Me = W[$].nodes) == null ? void 0 : Me.a) == null || ot.measure(); - for ($ = 0; $ < oe; $ += 1) - (we = (ye = W[$].nodes) == null ? void 0 : ye.a) == null || we.fix(); + 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(); } - nf(e, W, Q); + rf(e, U, Q); } } s && xn(() => { - var ee, Pe; + var te, ke; if (p !== void 0) for (m of p) - (Pe = (ee = m.nodes) == null ? void 0 : ee.a) == null || Pe.apply(); + (ke = (te = m.nodes) == null ? void 0 : te.a) == null || ke.apply(); }); } -function sf(e, t, n, r, i, s, a, o) { - var l = (a & Vl) !== 0 ? (a & Yl) === 0 ? /* @__PURE__ */ wo(n, !1, !1) : Un(n) : null, u = (a & zl) !== 0 ? Un(i) : null; +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; return { v: l, i: u, - e: dt(() => (s(t, l ?? n, u ?? i, o), () => { + e: vt(() => (s(t, l ?? n, u ?? i, o), () => { e.delete(r); })) }; @@ -2421,7 +2421,7 @@ function Sr(e, t, n) { ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Vt(r) + /* @__PURE__ */ Ht(r) ); if (s.before(r), r === i) return; @@ -2452,7 +2452,7 @@ function Hs(e, t) { } const ma = [...` \r\f \v\uFEFF`]; -function af(e, t, n) { +function of(e, t, n) { var r = e == null ? "" : "" + e; if (n) { for (var i in n) @@ -2474,17 +2474,17 @@ function ya(e, t = !1) { } return r; } -function of(e, t) { +function lf(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 String(e); } -function ii(e, t, n, r, i, s) { +function si(e, t, n, r, i, s) { var a = e.__className; if (j || a !== n || a === void 0) { - var o = af(n, r, s); + var o = of(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) { @@ -2502,33 +2502,33 @@ function ns(e, t = {}, n, r) { function wa(e, t, n, r) { var i = e.__style; if (j || i !== t) { - var s = of(t, r); + var s = lf(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 lf = Symbol("is custom element"), uf = Symbol("is html"), ff = su ? "link" : "LINK"; +const uf = Symbol("is custom element"), ff = Symbol("is html"), cf = au ? "link" : "LINK"; function xa(e, t, n, r) { - var i = cf(e); - j && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === ff) || i[t] !== (i[t] = n) && (t === "loading" && (e[iu] = n), n == null ? e.removeAttribute(t) : typeof n != "string" && hf(e).includes(t) ? e[t] = n : e.setAttribute(t, n)); + 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)); } -function cf(e) { +function hf(e) { return ( /** @type {Record} **/ // @ts-expect-error e.__attributes ?? (e.__attributes = { - [lf]: e.nodeName.includes("-"), - [uf]: e.namespaceURI === Wa + [uf]: e.nodeName.includes("-"), + [ff]: e.namespaceURI === Wa }) ); } var ba = /* @__PURE__ */ new Map(); -function hf(e) { +function df(e) { var t = e.getAttribute("is") || e.nodeName, n = ba.get(t); if (n) return n; ba.set(t, n = []); for (var r, i = e, s = Element.prototype; s !== i; ) { - r = Jl(i); + r = Zl(i); for (var a in r) r[a].set && n.push(a); i = Ga(i); @@ -2538,11 +2538,11 @@ function hf(e) { function $a(e, t) { return e === t || (e == null ? void 0 : e[Pr]) === t; } -function vi(e = {}, t, n, r) { +function gi(e = {}, t, n, r) { return So(() => { var i, s; return Ls(() => { - i = s, s = [], Xi(() => { + i = s, s = [], Wi(() => { e !== n(...s) && (t(e, ...s), i && $a(n(...i), e) && t(null, ...i)); }); }), () => { @@ -2552,21 +2552,21 @@ function vi(e = {}, t, n, r) { }; }), e; } -let si = !1; -function df(e) { - var t = si; +let ai = !1; +function pf(e) { + var t = ai; try { - return si = !1, [e(), si]; + return ai = !1, [e(), ai]; } finally { - si = t; + ai = t; } } -function ae(e, t, n, r) { +function se(e, t, n, r) { var D; - var i = (n & Wl) !== 0, s = (n & Ul) !== 0, a = ( + var i = (n & Ul) !== 0, s = (n & Gl) !== 0, a = ( /** @type {V} */ r - ), o = !0, l = () => (o && (o = !1, a = s ? Xi( + ), o = !0, l = () => (o && (o = !1, a = s ? Wi( /** @type {() => V} */ r ) : ( @@ -2577,12 +2577,12 @@ function ae(e, t, n, r) { 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 p, c = !1; - i ? [p, c] = df(() => ( + var p, h = !1; + i ? [p, h] = pf(() => ( /** @type {V} */ e[t] )) : p = /** @type {V} */ - e[t], p === void 0 && r !== void 0 && (p = l(), u && (pu(), u(p))); + e[t], p === void 0 && r !== void 0 && (p = l(), u && (vu(), u(p))); var d; if (d = () => { var M = ( @@ -2590,18 +2590,18 @@ function ae(e, t, n, r) { e[t] ); return M === void 0 ? l() : (o = !0, M); - }, (n & Xl) === 0) + }, (n & Wl) === 0) return d; if (u) { var y = e.$$legacy; return ( /** @type {() => V} */ (function(M, S) { - return arguments.length > 0 ? ((!S || y || c) && u(S ? d() : M), M) : d(); + return arguments.length > 0 ? ((!S || y || h) && u(S ? d() : M), M) : d(); }) ); } - var b = !1, m = ((n & Bl) !== 0 ? Yi : go)(() => (b = !1, d())); + var b = !1, m = ((n & Xl) !== 0 ? Bi : go)(() => (b = !1, d())); i && x(m); var $ = ( /** @type {Effect} */ @@ -2611,18 +2611,18 @@ function ae(e, t, n, r) { /** @type {() => V} */ (function(M, S) { if (arguments.length > 0) { - const F = S ? x(m) : i ? Pn(M) : M; - return he(m, F), b = !0, a !== void 0 && (a = F), M; + const I = S ? x(m) : i ? Pn(M) : M; + return he(m, I), b = !0, a !== void 0 && (a = I), M; } return An && b || ($.f & on) !== 0 ? m.v : x(m); }) ); } -function pf(e) { - return new vf(e); +function vf(e) { + return new gf(e); } -var rn, ht; -class vf { +var rn, pt; +class gf { /** * @param {ComponentConstructorOptions & { * component: any; @@ -2632,7 +2632,7 @@ class vf { /** @type {any} */ H(this, rn); /** @type {Record} */ - H(this, ht); + H(this, pt); var s; var n = /* @__PURE__ */ new Map(), r = (a, o) => { var l = /* @__PURE__ */ wo(o, !1, !1); @@ -2652,7 +2652,7 @@ class vf { } } ); - V(this, ht, (t.hydrate ? Zu : Bo)(t.component, { + V(this, pt, (t.hydrate ? Qu : Bo)(t.component, { target: t.target, anchor: t.anchor, props: i, @@ -2660,27 +2660,27 @@ class vf { intro: t.intro ?? !1, recover: t.recover })), (!((s = t == null ? void 0 : t.props) != null && s.$$host) || t.sync === !1) && re(), V(this, rn, i.$$events); - for (const a of Object.keys(v(this, ht))) - a === "$set" || a === "$destroy" || a === "$on" || $i(this, a, { + for (const a of Object.keys(v(this, pt))) + a === "$set" || a === "$destroy" || a === "$on" || Ai(this, a, { get() { - return v(this, ht)[a]; + return v(this, pt)[a]; }, /** @param {any} value */ set(o) { - v(this, ht)[a] = o; + v(this, pt)[a] = o; }, enumerable: !0 }); - v(this, ht).$set = /** @param {Record} next */ + v(this, pt).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, v(this, ht).$destroy = () => { - Qu(v(this, ht)); + }, v(this, pt).$destroy = () => { + ef(v(this, pt)); }; } /** @param {Record} props */ $set(t) { - v(this, ht).$set(t); + v(this, pt).$set(t); } /** * @param {string} event @@ -2698,10 +2698,10 @@ class vf { }; } $destroy() { - v(this, ht).$destroy(); + v(this, pt).$destroy(); } } -rn = new WeakMap(), ht = new WeakMap(); +rn = new WeakMap(), pt = new WeakMap(); let Wo; typeof HTMLElement == "function" && (Wo = class extends HTMLElement { /** @@ -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), Ge(a, o); + s !== "default" && (o.name = s), Ue(a, o); }; }; var t = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = gf(this); + const r = {}, i = _f(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] = gi(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = _i(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 = pf({ + this.$$c = vf({ 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 = qu(() => { + }), this.$$me = Vu(() => { Ls(() => { var s; this.$$r = !0; - for (const a of bi(this.$$c)) { + for (const a of $i(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = gi( + const o = _i( 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] = gi(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] = _i(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 bi(this.$$p_d).find( + return $i(this.$$p_d).find( (n) => this.$$p_d[n].attribute === t || !this.$$p_d[n].attribute && n.toLowerCase() === t ) || t; } }); -function gi(e, t, n, r) { +function _i(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 gi(e, t, n, r) { return t; } } -function gf(e) { +function _f(e) { const t = {}; return e.childNodes.forEach((n) => { t[ @@ -2883,19 +2883,19 @@ function Ys(e, t, n, r, i, s) { super(e, n, i), this.$$p_d = t; } static get observedAttributes() { - return bi(t).map( + return $i(t).map( (o) => (t[o].attribute || o).toLowerCase() ); } }; - return bi(t).forEach((o) => { - $i(a.prototype, o, { + return $i(t).forEach((o) => { + Ai(a.prototype, o, { get() { return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; }, set(l) { var p; - l = gi(o, l, t), this.$$d[o] = l; + l = _i(o, l, t), this.$$d[o] = l; var u = this.$$c; if (u) { var f = (p = Hn(u, o)) == null ? void 0 : p.get; @@ -2904,7 +2904,7 @@ function Ys(e, t, n, r, i, s) { } }); }), r.forEach((o) => { - $i(a.prototype, o, { + Ai(a.prototype, o, { get() { var l; return (l = this.$$c) == null ? void 0 : l[o]; @@ -2913,31 +2913,31 @@ function Ys(e, t, n, r, i, s) { }), e.element = /** @type {any} */ a, a; } -var _f = { value: () => { +var mf = { value: () => { } }; function Uo() { 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 _i(n); + return new mi(n); } -function _i(e) { +function mi(e) { this._ = e; } -function mf(e, t) { +function yf(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 }; }); } -_i.prototype = Uo.prototype = { - constructor: _i, +mi.prototype = Uo.prototype = { + constructor: mi, on: function(e, t) { - var n = this._, r = mf(e + "", n), i, s = -1, a = r.length; + var n = this._, r = yf(e + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = yf(n[i], e.name))) return i; + for (; ++s < a; ) if ((i = (e = r[s]).type) && (i = wf(n[i], e.name))) return i; return; } if (t != null && typeof t != "function") throw new Error("invalid callback: " + t); @@ -2949,7 +2949,7 @@ _i.prototype = Uo.prototype = { copy: function() { var e = {}, t = this._; for (var n in t) e[n] = t[n].slice(); - return new _i(e); + return new mi(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,7 +2961,7 @@ _i.prototype = Uo.prototype = { for (var r = this._[e], i = 0, s = r.length; i < s; ++i) r[i].value.apply(t, n); } }; -function yf(e, t) { +function wf(e, t) { for (var n = 0, r = e.length, i; n < r; ++n) if ((i = e[n]).name === t) return i.value; @@ -2969,7 +2969,7 @@ function yf(e, t) { function Aa(e, t, n) { for (var r = 0, i = e.length; r < i; ++r) if (e[r].name === t) { - e[r] = _f, e = e.slice(0, r).concat(e.slice(r + 1)); + e[r] = mf, e = e.slice(0, r).concat(e.slice(r + 1)); break; } return n != null && e.push({ name: t, value: n }), e; @@ -2982,61 +2982,61 @@ const Ea = { xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Wi(e) { +function Ui(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; } -function wf(e) { +function xf(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 xf(e) { +function bf(e) { return function() { return this.ownerDocument.createElementNS(e.space, e.local); }; } function Go(e) { - var t = Wi(e); - return (t.local ? xf : wf)(t); + var t = Ui(e); + return (t.local ? bf : xf)(t); } -function bf() { +function $f() { } function Bs(e) { - return e == null ? bf : function() { + return e == null ? $f : function() { return this.querySelector(e); }; } -function $f(e) { +function Af(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 at(r, this._parents); + return new ut(r, this._parents); } -function Af(e) { +function Ef(e) { return e == null ? [] : Array.isArray(e) ? e : Array.from(e); } -function Ef() { +function Tf() { return []; } function Ko(e) { - return e == null ? Ef : function() { + return e == null ? Tf : function() { return this.querySelectorAll(e); }; } -function Tf(e) { +function Cf(e) { return function() { - return Af(e.apply(this, arguments)); + return Ef(e.apply(this, arguments)); }; } -function Cf(e) { - typeof e == "function" ? e = Tf(e) : e = Ko(e); +function Rf(e) { + typeof e == "function" ? e = Cf(e) : e = Ko(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 at(r, i); + return new ut(r, i); } function jo(e) { return function() { @@ -3048,48 +3048,48 @@ function Jo(e) { return t.matches(e); }; } -var Rf = Array.prototype.find; -function Sf(e) { +var Sf = Array.prototype.find; +function Nf(e) { return function() { - return Rf.call(this.children, e); + return Sf.call(this.children, e); }; } -function Nf() { +function kf() { return this.firstElementChild; } -function kf(e) { - return this.select(e == null ? Nf : Sf(typeof e == "function" ? e : Jo(e))); +function Mf(e) { + return this.select(e == null ? kf : Nf(typeof e == "function" ? e : Jo(e))); } -var Mf = Array.prototype.filter; -function Pf() { +var Pf = Array.prototype.filter; +function Df() { return Array.from(this.children); } -function Df(e) { +function Of(e) { return function() { - return Mf.call(this.children, e); + return Pf.call(this.children, e); }; } -function Of(e) { - return this.selectAll(e == null ? Pf : Df(typeof e == "function" ? e : Jo(e))); +function Ff(e) { + return this.selectAll(e == null ? Df : Of(typeof e == "function" ? e : Jo(e))); } function If(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 at(r, this._parents); + return new ut(r, this._parents); } function Zo(e) { return new Array(e.length); } -function Ff() { - return new at(this._enter || this._groups.map(Zo), this._parents); +function Lf() { + return new ut(this._enter || this._groups.map(Zo), this._parents); } -function Ei(e, t) { +function Ti(e, t) { this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t; } -Ei.prototype = { - constructor: Ei, +Ti.prototype = { + constructor: Ti, appendChild: function(e) { return this._parent.insertBefore(e, this._next); }, @@ -3103,91 +3103,91 @@ Ei.prototype = { return this._parent.querySelectorAll(e); } }; -function Lf(e) { +function qf(e) { return function() { return e; }; } -function qf(e, t, n, r, i, s) { +function Vf(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 Ei(e, s[a]); + (o = t[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Ti(e, s[a]); for (; a < l; ++a) (o = t[a]) && (i[a] = o); } -function Vf(e, t, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = t.length, p = s.length, c = new Array(f), d; +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; for (o = 0; o < f; ++o) - (l = t[o]) && (c[o] = d = a.call(l, l.__data__, o, t) + "", u.has(d) ? i[o] = l : u.set(d, l)); + (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 Ei(e, s[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]); for (o = 0; o < f; ++o) - (l = t[o]) && u.get(c[o]) === l && (i[o] = l); + (l = t[o]) && u.get(h[o]) === l && (i[o] = l); } -function zf(e) { +function Hf(e) { return e.__data__; } -function Hf(e, t) { - if (!arguments.length) return Array.from(this, zf); - var n = t ? Vf : qf, r = this._parents, i = this._groups; - typeof e != "function" && (e = Lf(e)); +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)); 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], c = p.length, d = Yf(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(c); + 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, F; D < y; ++D) + for (var D = 0, M = 0, S, I; D < y; ++D) if (S = b[D]) { - for (D >= M && (M = D + 1); !(F = m[M]) && ++M < y; ) ; - S._next = F || null; + for (D >= M && (M = D + 1); !(I = m[M]) && ++M < y; ) ; + S._next = I || null; } } - return a = new at(a, r), a._enter = o, a._exit = l, a; + return a = new ut(a, r), a._enter = o, a._exit = l, a; } -function Yf(e) { +function Bf(e) { return typeof e == "object" && "length" in e ? e : Array.from(e); } -function Bf() { - return new at(this._exit || this._groups.map(Zo), this._parents); +function Xf() { + return new ut(this._exit || this._groups.map(Zo), this._parents); } -function Xf(e, t, n) { +function Wf(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 Wf(e) { +function Uf(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, c = o[l] = new Array(p), d, y = 0; y < p; ++y) - (d = u[y] || f[y]) && (c[y] = d); + 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 (; l < i; ++l) o[l] = n[l]; - return new at(o, this._parents); + return new ut(o, this._parents); } -function Uf() { +function Gf() { 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 Gf(e) { - e || (e = Kf); - function t(p, c) { - return p && c ? e(p.__data__, c.__data__) : !p - !c; +function Kf(e) { + e || (e = jf); + function t(p, h) { + return p && h ? e(p.__data__, h.__data__) : !p - !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 at(i, this._parents).order(); + return new ut(i, this._parents).order(); } -function Kf(e, t) { +function jf(e, t) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function jf() { +function Jf() { var e = arguments[0]; return arguments[0] = this, e.apply(null, arguments), this; } -function Jf() { +function Zf() { return Array.from(this); } -function Zf() { +function Qf() { 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,103 +3195,103 @@ function Zf() { } return null; } -function Qf() { +function ec() { let e = 0; for (const t of this) ++e; return e; } -function ec() { +function tc() { return !this.node(); } -function tc(e) { +function nc(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 nc(e) { +function rc(e) { return function() { this.removeAttribute(e); }; } -function rc(e) { +function ic(e) { return function() { this.removeAttributeNS(e.space, e.local); }; } -function ic(e, t) { +function sc(e, t) { return function() { this.setAttribute(e, t); }; } -function sc(e, t) { +function ac(e, t) { return function() { this.setAttributeNS(e.space, e.local, t); }; } -function ac(e, t) { +function oc(e, t) { return function() { var n = t.apply(this, arguments); n == null ? this.removeAttribute(e) : this.setAttribute(e, n); }; } -function oc(e, t) { +function lc(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 lc(e, t) { - var n = Wi(e); +function uc(e, t) { + var n = Ui(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 ? rc : nc : typeof t == "function" ? n.local ? oc : ac : n.local ? sc : ic)(n, t)); + return this.each((t == null ? n.local ? ic : rc : typeof t == "function" ? n.local ? lc : oc : n.local ? ac : sc)(n, t)); } function Qo(e) { return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView; } -function uc(e) { +function fc(e) { return function() { this.style.removeProperty(e); }; } -function fc(e, t, n) { +function cc(e, t, n) { return function() { this.style.setProperty(e, t, n); }; } -function cc(e, t, n) { +function hc(e, t, n) { return function() { var r = t.apply(this, arguments); r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n); }; } -function hc(e, t, n) { - return arguments.length > 1 ? this.each((t == null ? uc : typeof t == "function" ? cc : fc)(e, t, n ?? "")) : gr(this.node(), e); +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 gr(e, t) { +function _r(e, t) { return e.style.getPropertyValue(t) || Qo(e).getComputedStyle(e, null).getPropertyValue(t); } -function dc(e) { +function pc(e) { return function() { delete this[e]; }; } -function pc(e, t) { +function vc(e, t) { return function() { this[e] = t; }; } -function vc(e, t) { +function gc(e, t) { return function() { var n = t.apply(this, arguments); n == null ? delete this[e] : this[e] = n; }; } -function gc(e, t) { - return arguments.length > 1 ? this.each((t == null ? dc : typeof t == "function" ? vc : pc)(e, t)) : this.node()[e]; +function _c(e, t) { + return arguments.length > 1 ? this.each((t == null ? pc : typeof t == "function" ? gc : vc)(e, t)) : this.node()[e]; } function el(e) { return e.trim().split(/^|\s+/); @@ -3321,86 +3321,86 @@ function nl(e, t) { function rl(e, t) { for (var n = Xs(e), r = -1, i = t.length; ++r < i; ) n.remove(t[r]); } -function _c(e) { +function mc(e) { return function() { nl(this, e); }; } -function mc(e) { +function yc(e) { return function() { rl(this, e); }; } -function yc(e, t) { +function wc(e, t) { return function() { (t.apply(this, arguments) ? nl : rl)(this, e); }; } -function wc(e, t) { +function xc(e, t) { var n = el(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" ? yc : t ? _c : mc)(n, t)); + return this.each((typeof t == "function" ? wc : t ? mc : yc)(n, t)); } -function xc() { +function bc() { this.textContent = ""; } -function bc(e) { +function $c(e) { return function() { this.textContent = e; }; } -function $c(e) { +function Ac(e) { return function() { var t = e.apply(this, arguments); this.textContent = t ?? ""; }; } -function Ac(e) { - return arguments.length ? this.each(e == null ? xc : (typeof e == "function" ? $c : bc)(e)) : this.node().textContent; +function Ec(e) { + return arguments.length ? this.each(e == null ? bc : (typeof e == "function" ? Ac : $c)(e)) : this.node().textContent; } -function Ec() { +function Tc() { this.innerHTML = ""; } -function Tc(e) { +function Cc(e) { return function() { this.innerHTML = e; }; } -function Cc(e) { +function Rc(e) { return function() { var t = e.apply(this, arguments); this.innerHTML = t ?? ""; }; } -function Rc(e) { - return arguments.length ? this.each(e == null ? Ec : (typeof e == "function" ? Cc : Tc)(e)) : this.node().innerHTML; -} -function Sc() { - this.nextSibling && this.parentNode.appendChild(this); +function Sc(e) { + return arguments.length ? this.each(e == null ? Tc : (typeof e == "function" ? Rc : Cc)(e)) : this.node().innerHTML; } function Nc() { - return this.each(Sc); + this.nextSibling && this.parentNode.appendChild(this); } function kc() { - this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); + return this.each(Nc); } function Mc() { - return this.each(kc); + this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); +} +function Pc() { + return this.each(Mc); } -function Pc(e) { +function Dc(e) { var t = typeof e == "function" ? e : Go(e); return this.select(function() { return this.appendChild(t.apply(this, arguments)); }); } -function Dc() { +function Oc() { return null; } -function Oc(e, t) { - var n = typeof e == "function" ? e : Go(e), r = t == null ? Dc : typeof t == "function" ? t : Bs(t); +function Fc(e, t) { + var n = typeof e == "function" ? e : Go(e), r = t == null ? Oc : typeof t == "function" ? t : Bs(t); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); @@ -3409,35 +3409,35 @@ function Ic() { var e = this.parentNode; e && e.removeChild(this); } -function Fc() { +function Lc() { return this.each(Ic); } -function Lc() { +function qc() { var e = this.cloneNode(!1), t = this.parentNode; return t ? t.insertBefore(e, this.nextSibling) : e; } -function qc() { +function Vc() { var e = this.cloneNode(!0), t = this.parentNode; return t ? t.insertBefore(e, this.nextSibling) : e; } -function Vc(e) { - return this.select(e ? qc : Lc); -} function zc(e) { - return arguments.length ? this.property("__data__", e) : this.node().__data__; + return this.select(e ? Vc : qc); } function Hc(e) { + return arguments.length ? this.property("__data__", e) : this.node().__data__; +} +function Yc(e) { return function(t) { e.call(this, t, this.__data__); }; } -function Yc(e) { +function Bc(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 Bc(e) { +function Xc(e) { return function() { var t = this.__on; if (t) { @@ -3447,9 +3447,9 @@ function Bc(e) { } }; } -function Xc(e, t, n) { +function Wc(e, t, n) { return function() { - var r = this.__on, i, s = Hc(t); + var r = this.__on, i, s = Yc(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 Xc(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 Wc(e, t, n) { - var r = Yc(e + ""), i, s = r.length, a; +function Uc(e, t, n) { + var r = Bc(e + ""), i, s = r.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -3472,81 +3472,81 @@ function Wc(e, t, n) { } return; } - for (o = t ? Xc : Bc, i = 0; i < s; ++i) this.each(o(r[i], t, n)); + for (o = t ? Wc : Xc, 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; 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 Uc(e, t) { +function Gc(e, t) { return function() { return il(this, e, t); }; } -function Gc(e, t) { +function Kc(e, t) { return function() { return il(this, e, t.apply(this, arguments)); }; } -function Kc(e, t) { - return this.each((typeof t == "function" ? Gc : Uc)(e, t)); +function jc(e, t) { + return this.each((typeof t == "function" ? Kc : Gc)(e, t)); } -function* jc() { +function* Jc() { 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 at(e, t) { +function ut(e, t) { this._groups = e, this._parents = t; } -function wr() { - return new at([[document.documentElement]], sl); +function xr() { + return new ut([[document.documentElement]], sl); } -function Jc() { +function Zc() { return this; } -at.prototype = wr.prototype = { - constructor: at, - select: $f, - selectAll: Cf, - selectChild: kf, - selectChildren: Of, +ut.prototype = xr.prototype = { + constructor: ut, + select: Af, + selectAll: Rf, + selectChild: Mf, + selectChildren: Ff, filter: If, - data: Hf, - enter: Ff, - exit: Bf, - join: Xf, - merge: Wf, - selection: Jc, - order: Uf, - sort: Gf, - call: jf, - nodes: Jf, - node: Zf, - size: Qf, - empty: ec, - each: tc, - attr: lc, - style: hc, - property: gc, - classed: wc, - text: Ac, - html: Rc, - raise: Nc, - lower: Mc, - append: Pc, - insert: Oc, - remove: Fc, - clone: Vc, - datum: zc, - on: Wc, - dispatch: Kc, - [Symbol.iterator]: jc + 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 }; function fe(e) { - return typeof e == "string" ? new at([[document.querySelector(e)]], [document.documentElement]) : new at([[e]], sl); + return typeof e == "string" ? new ut([[document.querySelector(e)]], [document.documentElement]) : new ut([[e]], sl); } function Ws(e, t, n) { e.prototype = t.prototype = n, n.constructor = e; @@ -3558,7 +3558,7 @@ function al(e, t) { } function Kr() { } -var Lr = 0.7, Ti = 1 / Lr, tr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Ft = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Zc = /^#([0-9a-f]{3,8})$/, Qc = new RegExp(`^rgb\\(${tr},${tr},${tr}\\)$`), eh = new RegExp(`^rgb\\(${Ft},${Ft},${Ft}\\)$`), th = new RegExp(`^rgba\\(${tr},${tr},${tr},${qr}\\)$`), nh = new RegExp(`^rgba\\(${Ft},${Ft},${Ft},${qr}\\)$`), rh = new RegExp(`^hsl\\(${qr},${Ft},${Ft}\\)$`), ih = new RegExp(`^hsla\\(${qr},${Ft},${Ft},${qr}\\)$`), Ta = { +var Lr = 0.7, Ci = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", qt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Qc = /^#([0-9a-f]{3,8})$/, eh = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), th = new RegExp(`^rgb\\(${qt},${qt},${qt}\\)$`), nh = new RegExp(`^rgba\\(${nr},${nr},${nr},${qr}\\)$`), rh = new RegExp(`^rgba\\(${qt},${qt},${qt},${qr}\\)$`), ih = new RegExp(`^hsl\\(${qr},${qt},${qt}\\)$`), sh = new RegExp(`^hsla\\(${qr},${qt},${qt},${qr}\\)$`), Ta = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3718,18 +3718,18 @@ Ws(Kr, Gn, { hex: Ca, // Deprecated! Use color.formatHex. formatHex: Ca, - formatHex8: sh, - formatHsl: ah, + formatHex8: ah, + formatHsl: oh, formatRgb: Ra, toString: Ra }); function Ca() { return this.rgb().formatHex(); } -function sh() { +function ah() { return this.rgb().formatHex8(); } -function ah() { +function oh() { return ol(this).formatHsl(); } function Ra() { @@ -3737,35 +3737,35 @@ function Ra() { } function Gn(e) { var t, n; - return e = (e + "").trim().toLowerCase(), (t = Zc.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 ? ai(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? ai(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 = Qc.exec(e)) ? new Je(t[1], t[2], t[3], 1) : (t = eh.exec(e)) ? new Je(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = th.exec(e)) ? ai(t[1], t[2], t[3], t[4]) : (t = nh.exec(e)) ? ai(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = rh.exec(e)) ? Ma(t[1], t[2] / 100, t[3] / 100, 1) : (t = ih.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 = 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; } function Sa(e) { - return new Je(e >> 16 & 255, e >> 8 & 255, e & 255, 1); + return new je(e >> 16 & 255, e >> 8 & 255, e & 255, 1); } -function ai(e, t, n, r) { - return r <= 0 && (e = t = n = NaN), new Je(e, t, n, r); +function oi(e, t, n, r) { + return r <= 0 && (e = t = n = NaN), new je(e, t, n, r); } -function oh(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 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 bs(e, t, n, r) { - return arguments.length === 1 ? oh(e) : new Je(e, t, n, r ?? 1); + return arguments.length === 1 ? lh(e) : new je(e, t, n, r ?? 1); } -function Je(e, t, n, r) { +function je(e, t, n, r) { this.r = +e, this.g = +t, this.b = +n, this.opacity = +r; } -Ws(Je, bs, al(Kr, { +Ws(je, bs, al(Kr, { brighter(e) { - return e = e == null ? Ti : Math.pow(Ti, e), new Je(this.r * e, this.g * e, this.b * e, this.opacity); + return e = e == null ? Ci : Math.pow(Ci, e), new je(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 ? Lr : Math.pow(Lr, e), new je(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), Ci(this.opacity)); + return new je(Xn(this.r), Xn(this.g), Xn(this.b), Ri(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; @@ -3773,21 +3773,21 @@ Ws(Je, bs, al(Kr, { hex: Na, // Deprecated! Use color.formatHex. formatHex: Na, - formatHex8: lh, + formatHex8: uh, formatRgb: ka, toString: ka })); function Na() { return `#${On(this.r)}${On(this.g)}${On(this.b)}`; } -function lh() { +function uh() { return `#${On(this.r)}${On(this.g)}${On(this.b)}${On((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function ka() { - const e = Ci(this.opacity); + const e = Ri(this.opacity); return `${e === 1 ? "rgb(" : "rgba("}${Xn(this.r)}, ${Xn(this.g)}, ${Xn(this.b)}${e === 1 ? ")" : `, ${e})`}`; } -function Ci(e) { +function Ri(e) { return isNaN(e) ? 1 : Math.max(0, Math.min(1, e)); } function Xn(e) { @@ -3797,32 +3797,32 @@ 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 wt(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 ol(e) { - if (e instanceof wt) return new wt(e.h, e.s, e.l, e.opacity); - if (e instanceof Kr || (e = Gn(e)), !e) return new wt(); - if (e instanceof wt) return 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; 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 wt(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 $t(a, o, l, e.opacity); } -function uh(e, t, n, r) { - return arguments.length === 1 ? ol(e) : new wt(e, t, n, r ?? 1); +function fh(e, t, n, r) { + return arguments.length === 1 ? ol(e) : new $t(e, t, n, r ?? 1); } -function wt(e, t, n, r) { +function $t(e, t, n, r) { this.h = +e, this.s = +t, this.l = +n, this.opacity = +r; } -Ws(wt, uh, al(Kr, { +Ws($t, fh, al(Kr, { brighter(e) { - return e = e == null ? Ti : Math.pow(Ti, e), new wt(this.h, this.s, this.l * e, this.opacity); + return e = e == null ? Ci : Math.pow(Ci, e), new $t(this.h, this.s, this.l * e, this.opacity); }, darker(e) { - return e = e == null ? Lr : Math.pow(Lr, e), new wt(this.h, this.s, this.l * e, this.opacity); + return e = e == null ? Lr : Math.pow(Lr, e), new $t(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 je( rs(e >= 240 ? e - 240 : e + 120, i, r), rs(e, i, r), rs(e < 120 ? e + 240 : e - 120, i, r), @@ -3830,47 +3830,47 @@ Ws(wt, uh, al(Kr, { ); }, clamp() { - return new wt(Pa(this.h), oi(this.s), oi(this.l), Ci(this.opacity)); + return new $t(Pa(this.h), li(this.s), li(this.l), Ri(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 = Ci(this.opacity); - return `${e === 1 ? "hsl(" : "hsla("}${Pa(this.h)}, ${oi(this.s) * 100}%, ${oi(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; + const e = Ri(this.opacity); + return `${e === 1 ? "hsl(" : "hsla("}${Pa(this.h)}, ${li(this.s) * 100}%, ${li(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`; } })); function Pa(e) { return e = (e || 0) % 360, e < 0 ? e + 360 : e; } -function oi(e) { +function li(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 fh(e, t) { +function ch(e, t) { return function(n) { return e + n * t; }; } -function ch(e, t, n) { +function hh(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 hh(e) { +function dh(e) { return (e = +e) == 1 ? ll : function(t, n) { - return n - t ? ch(t, n, e) : Us(isNaN(t) ? n : t); + return n - t ? hh(t, n, e) : Us(isNaN(t) ? n : t); }; } function ll(e, t) { var n = t - e; - return n ? fh(e, n) : Us(isNaN(e) ? t : e); + return n ? ch(e, n) : Us(isNaN(e) ? t : e); } -const Ri = (function e(t) { - var n = hh(t); +const Si = (function e(t) { + var n = dh(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); return function(f) { @@ -3879,7 +3879,7 @@ const Ri = (function e(t) { } return r.gamma = e, r; })(1); -function dh(e, t) { +function ph(e, t) { t || (t = []); var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i; return function(s) { @@ -3887,10 +3887,10 @@ function dh(e, t) { return r; }; } -function ph(e) { +function vh(e) { return ArrayBuffer.isView(e) && !(e instanceof DataView); } -function vh(e, t) { +function gh(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] = Jt(e[a], t[a]); for (; a < n; ++a) s[a] = t[a]; @@ -3899,18 +3899,18 @@ function vh(e, t) { return s; }; } -function gh(e, t) { +function _h(e, t) { var n = /* @__PURE__ */ new Date(); return e = +e, t = +t, function(r) { return n.setTime(e * (1 - r) + t * r), n; }; } -function It(e, t) { +function Lt(e, t) { return e = +e, t = +t, function(n) { return e * (1 - n) + t * n; }; } -function _h(e, t) { +function mh(e, t) { var n = {}, r = {}, i; (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {}); for (i in t) @@ -3921,12 +3921,12 @@ function _h(e, t) { }; } var $s = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, is = new RegExp($s.source, "g"); -function mh(e) { +function yh(e) { return function() { return e; }; } -function yh(e) { +function wh(e) { return function(t) { return e(t) + ""; }; @@ -3934,15 +3934,15 @@ function yh(e) { function ul(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: It(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] ? yh(l[0].x) : mh(t) : (t = l.length, function(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] ? 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); return o.join(""); }); } function Jt(e, t) { var n = typeof t, r; - return t == null || n === "boolean" ? Us(t) : (n === "number" ? It : n === "string" ? (r = Gn(t)) ? (t = r, Ri) : ul : t instanceof Gn ? Ri : t instanceof Date ? gh : ph(t) ? dh : Array.isArray(t) ? vh : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? _h : It)(e, t); + return t == null || n === "boolean" ? Us(t) : (n === "number" ? Lt : 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 : Lt)(e, t); } var Da = 180 / Math.PI, As = { translateX: 0, @@ -3963,119 +3963,119 @@ function fl(e, t, n, r, i, s) { scaleY: o }; } -var li; -function wh(e) { +var ui; +function xh(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); } -function xh(e) { - return e == null || (li || (li = document.createElementNS("http://www.w3.org/2000/svg", "g")), li.setAttribute("transform", e), !(e = li.transform.baseVal.consolidate())) ? As : (e = e.matrix, fl(e.a, e.b, e.c, e.d, e.e, e.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 cl(e, t, n, r) { function i(u) { return u.length ? u.pop() + " " : ""; } - function s(u, f, p, c, d, y) { - if (u !== p || f !== c) { + 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: It(u, p) }, { i: b - 2, x: It(f, c) }); - } else (p || c) && d.push("translate(" + p + t + c + n); + y.push({ i: b - 4, x: Lt(u, p) }, { i: b - 2, x: Lt(f, h) }); + } else (p || h) && d.push("translate(" + p + t + h + n); } - function a(u, f, p, c) { - u !== f ? (u - f > 180 ? f += 360 : f - u > 180 && (u += 360), c.push({ i: p.push(i(p) + "rotate(", null, r) - 2, x: It(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); + 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: Lt(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); } - function o(u, f, p, c) { - u !== f ? c.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: It(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); + function o(u, f, p, h) { + u !== f ? h.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: Lt(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); } - function l(u, f, p, c, d, y) { - if (u !== p || f !== c) { + 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: It(u, p) }, { i: b - 2, x: It(f, c) }); - } else (p !== 1 || c !== 1) && d.push(i(d) + "scale(" + p + "," + c + ")"); + y.push({ i: b - 4, x: Lt(u, p) }, { i: b - 2, x: Lt(f, h) }); + } else (p !== 1 || h !== 1) && d.push(i(d) + "scale(" + p + "," + h + ")"); } return function(u, f) { - var p = [], c = []; - return u = e(u), f = e(f), s(u.translateX, u.translateY, f.translateX, f.translateY, p, c), a(u.rotate, f.rotate, p, c), o(u.skewX, f.skewX, p, c), l(u.scaleX, u.scaleY, f.scaleX, f.scaleY, p, c), u = f = null, function(d) { - for (var y = -1, b = c.length, m; ++y < b; ) p[(m = c[y]).i] = m.x(d); + 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 bh = cl(wh, "px, ", "px)", "deg)"), $h = cl(xh, ", ", ")", ")"), _r = 0, Nr = 0, Rr = 0, hl = 1e3, Si, kr, Ni = 0, Kn = 0, Ui = 0, Vr = typeof performance == "object" && performance.now ? performance : Date, dl = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) { +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) { setTimeout(e, 17); }; function Gs() { - return Kn || (dl(Ah), Kn = Vr.now() + Ui); + return Kn || (dl(Eh), Kn = Vr.now() + Gi); } -function Ah() { +function Eh() { Kn = 0; } -function ki() { +function Mi() { this._call = this._time = this._next = null; } -ki.prototype = pl.prototype = { - constructor: ki, +Mi.prototype = pl.prototype = { + constructor: Mi, 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 : Si = this, kr = this), this._call = e, this._time = n, Es(); + 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(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, Es()); } }; function pl(e, t, n) { - var r = new ki(); + var r = new Mi(); return r.restart(e, t, n), r; } -function Eh() { - Gs(), ++_r; - for (var e = Si, t; e; ) +function Th() { + Gs(), ++mr; + for (var e = Ni, t; e; ) (t = Kn - e._time) >= 0 && e._call.call(void 0, t), e = e._next; - --_r; + --mr; } function Oa() { - Kn = (Ni = Vr.now()) + Ui, _r = Nr = 0; + Kn = (ki = Vr.now()) + Gi, mr = Nr = 0; try { - Eh(); + Th(); } finally { - _r = 0, Ch(), Kn = 0; + mr = 0, Rh(), Kn = 0; } } -function Th() { - var e = Vr.now(), t = e - Ni; - t > hl && (Ui -= t, Ni = e); -} function Ch() { - 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); + var e = Vr.now(), t = e - ki; + t > hl && (Gi -= t, ki = 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 Es(e) { - if (!_r) { + if (!mr) { Nr && (Nr = clearTimeout(Nr)); var t = e - Kn; - t > 24 ? (e < 1 / 0 && (Nr = setTimeout(Oa, e - Vr.now() - Ui)), Rr && (Rr = clearInterval(Rr))) : (Rr || (Ni = Vr.now(), Rr = setInterval(Th, hl)), _r = 1, dl(Oa)); + 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)); } } -function Ia(e, t, n) { - var r = new ki(); +function Fa(e, t, n) { + var r = new Mi(); return t = t == null ? 0 : +t, r.restart((i) => { r.stop(), e(i + t); }, t, n), r; } -var Rh = Uo("start", "end", "cancel", "interrupt"), Sh = [], vl = 0, Fa = 1, Ts = 2, mi = 3, La = 4, Cs = 5, yi = 6; -function Gi(e, t, n, r, i, s) { +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 a = e.__transition; if (!a) e.__transition = {}; else if (n in a) return; - Nh(e, n, { + kh(e, n, { name: t, index: r, // For context during callback. group: i, // For context during callback. - on: Rh, - tween: Sh, + on: Sh, + tween: Nh, time: s.time, delay: s.delay, duration: s.duration, @@ -4085,54 +4085,54 @@ function Gi(e, t, n, r, i, s) { }); } function Ks(e, t) { - var n = Et(e, t); + var n = Rt(e, t); if (n.state > vl) throw new Error("too late; already scheduled"); return n; } -function Yt(e, t) { - var n = Et(e, t); - if (n.state > mi) throw new Error("too late; already running"); +function Xt(e, t) { + var n = Rt(e, t); + if (n.state > yi) throw new Error("too late; already running"); return n; } -function Et(e, t) { +function Rt(e, t) { var n = e.__transition; if (!n || !(n = n[t])) throw new Error("transition not found"); return n; } -function Nh(e, t, n) { +function kh(e, t, n) { var r = e.__transition, i; r[t] = n, n.timer = pl(s, 0, n.time); function s(u) { - n.state = Fa, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + n.state = Ia, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); } function a(u) { - var f, p, c, d; - if (n.state !== Fa) return l(); + var f, p, h, d; + if (n.state !== Ia) return l(); for (f in r) if (d = r[f], d.name === n.name) { - if (d.state === mi) return Ia(a); - d.state === La ? (d.state = yi, d.timer.stop(), d.on.call("interrupt", e, e.__data__, d.index, d.group), delete r[f]) : +f < t && (d.state = yi, d.timer.stop(), d.on.call("cancel", e, e.__data__, d.index, d.group), delete r[f]); + 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 (Ia(function() { - n.state === mi && (n.state = La, n.timer.restart(o, n.delay, n.time), o(u)); + if (Fa(function() { + n.state === yi && (n.state = La, 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 = mi, i = new Array(c = n.tween.length), f = 0, p = -1; f < c; ++f) + 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; } } 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, c = i.length; ++p < c; ) + 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()); } function l() { - n.state = yi, n.timer.stop(), delete r[t]; + n.state = wi, n.timer.stop(), delete r[t]; for (var u in r) return; delete e.__transition; } } -function kh(e, t) { +function Mh(e, t) { var n = e.__transition, r, i, s = !0, a; if (n) { t = t == null ? null : t + ""; @@ -4141,20 +4141,20 @@ function kh(e, t) { s = !1; continue; } - i = r.state > Ts && r.state < Cs, r.state = yi, 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 < Cs, r.state = wi, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", e, e.__data__, r.index, r.group), delete n[a]; } s && delete e.__transition; } } -function Mh(e) { +function Ph(e) { return this.each(function() { - kh(this, e); + Mh(this, e); }); } -function Ph(e, t) { +function Dh(e, t) { var n, r; return function() { - var i = Yt(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 Ph(e, t) { i.tween = r; }; } -function Dh(e, t, n) { +function Oh(e, t, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Yt(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,225 +4183,225 @@ function Dh(e, t, n) { s.tween = i; }; } -function Oh(e, t) { +function Fh(e, t) { var n = this._id; if (e += "", arguments.length < 2) { - for (var r = Et(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = Rt(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) if ((a = r[i]).name === e) return a.value; return null; } - return this.each((t == null ? Ph : Dh)(n, e, t)); + return this.each((t == null ? Dh : Oh)(n, e, t)); } function js(e, t, n) { var r = e._id; return e.each(function() { - var i = Yt(this, r); + var i = Xt(this, r); (i.value || (i.value = {}))[t] = n.apply(this, arguments); }), function(i) { - return Et(i, r).value[t]; + return Rt(i, r).value[t]; }; } function gl(e, t) { var n; - return (typeof t == "number" ? It : t instanceof Gn ? Ri : (n = Gn(t)) ? (t = n, Ri) : ul)(e, t); + return (typeof t == "number" ? Lt : t instanceof Gn ? Si : (n = Gn(t)) ? (t = n, Si) : ul)(e, t); } function Ih(e) { return function() { this.removeAttribute(e); }; } -function Fh(e) { +function Lh(e) { return function() { this.removeAttributeNS(e.space, e.local); }; } -function Lh(e, t, n) { +function qh(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 qh(e, t, n) { +function Vh(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 Vh(e, t, n) { +function zh(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 zh(e, t, n) { +function Hh(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 Hh(e, t) { - var n = Wi(e), r = n === "transform" ? $h : gl; - return this.attrTween(e, typeof t == "function" ? (n.local ? zh : Vh)(n, r, js(this, "attr." + e, t)) : t == null ? (n.local ? Fh : Ih)(n) : (n.local ? qh : Lh)(n, r, t)); -} 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 Bh(e, t) { return function(n) { this.setAttribute(e, t.call(this, n)); }; } -function Bh(e, t) { +function Xh(e, t) { return function(n) { this.setAttributeNS(e.space, e.local, t.call(this, n)); }; } -function Xh(e, t) { +function Wh(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) && Xh(e, s)), n; } return i._value = t, i; } -function Wh(e, t) { +function Uh(e, t) { var n, r; function i() { var s = t.apply(this, arguments); - return s !== r && (n = (r = s) && Yh(e, s)), n; + return s !== r && (n = (r = s) && Bh(e, s)), n; } return i._value = t, i; } -function Uh(e, t) { +function Gh(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 = Wi(e); - return this.tween(n, (r.local ? Xh : Wh)(r, t)); + var r = Ui(e); + return this.tween(n, (r.local ? Wh : Uh)(r, t)); } -function Gh(e, t) { +function Kh(e, t) { return function() { Ks(this, e).delay = +t.apply(this, arguments); }; } -function Kh(e, t) { +function jh(e, t) { return t = +t, function() { Ks(this, e).delay = t; }; } -function jh(e) { +function Jh(e) { var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Gh : Kh)(t, e)) : Et(this.node(), t).delay; + return arguments.length ? this.each((typeof e == "function" ? Kh : jh)(t, e)) : Rt(this.node(), t).delay; } -function Jh(e, t) { +function Zh(e, t) { return function() { - Yt(this, e).duration = +t.apply(this, arguments); + Xt(this, e).duration = +t.apply(this, arguments); }; } -function Zh(e, t) { +function Qh(e, t) { return t = +t, function() { - Yt(this, e).duration = t; + Xt(this, e).duration = t; }; } -function Qh(e) { +function ed(e) { var t = this._id; - return arguments.length ? this.each((typeof e == "function" ? Jh : Zh)(t, e)) : Et(this.node(), t).duration; + return arguments.length ? this.each((typeof e == "function" ? Zh : Qh)(t, e)) : Rt(this.node(), t).duration; } -function ed(e, t) { +function td(e, t) { if (typeof t != "function") throw new Error(); return function() { - Yt(this, e).ease = t; + Xt(this, e).ease = t; }; } -function td(e) { +function nd(e) { var t = this._id; - return arguments.length ? this.each(ed(t, e)) : Et(this.node(), t).ease; + return arguments.length ? this.each(td(t, e)) : Rt(this.node(), t).ease; } -function nd(e, t) { +function rd(e, t) { return function() { var n = t.apply(this, arguments); if (typeof n != "function") throw new Error(); - Yt(this, e).ease = n; + Xt(this, e).ease = n; }; } -function rd(e) { +function id(e) { if (typeof e != "function") throw new Error(); - return this.each(nd(this._id, e)); + return this.each(rd(this._id, e)); } -function id(e) { +function sd(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 fn(r, this._parents, this._name, this._id); } -function sd(e) { +function ad(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), c, d = 0; d < f; ++d) - (c = l[d] || u[d]) && (p[d] = c); + 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 (; o < r; ++o) a[o] = t[o]; return new fn(a, this._parents, this._name, this._id); } -function ad(e) { +function od(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 od(e, t, n) { - var r, i, s = ad(t) ? Ks : Yt; +function ld(e, t, n) { + var r, i, s = od(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 ld(e, t) { +function ud(e, t) { var n = this._id; - return arguments.length < 2 ? Et(this.node(), n).on.on(e) : this.each(od(n, e, t)); + return arguments.length < 2 ? Rt(this.node(), n).on.on(e) : this.each(ld(n, e, t)); } -function ud(e) { +function fd(e) { return function() { var t = this.parentNode; for (var n in this.__transition) if (+n !== e) return; t && t.removeChild(this); }; } -function fd() { - return this.on("end.remove", ud(this._id)); +function cd() { + return this.on("end.remove", fd(this._id)); } -function cd(e) { +function hd(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, c = 0; c < l; ++c) - (f = o[c]) && (p = e.call(f, f.__data__, c, o)) && ("__data__" in f && (p.__data__ = f.__data__), u[c] = p, Gi(u[c], t, n, c, u, Et(f, n))); + 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 fn(s, this._parents, t, n); } -function hd(e) { +function dd(e) { var t = this._name, n = this._id; typeof e != "function" && (e = Ko(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 c = e.call(f, f.__data__, p, l), d, y = Et(f, n), b = 0, m = c.length; b < m; ++b) - (d = c[b]) && Gi(d, t, n, b, c, y); - s.push(c), a.push(f); + 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); + s.push(h), a.push(f); } return new fn(s, a, t, n); } -var dd = wr.prototype.constructor; -function pd() { - return new dd(this._groups, this._parents); +var pd = xr.prototype.constructor; +function vd() { + return new pd(this._groups, this._parents); } -function vd(e, t) { +function gd(e, t) { var n, r, i; return function() { - var s = gr(this, e), a = (this.style.removeProperty(e), gr(this, e)); + var s = _r(this, e), a = (this.style.removeProperty(e), _r(this, e)); return s === a ? null : s === n && a === r ? i : i = t(n = s, r = a); }; } @@ -4410,91 +4410,91 @@ function _l(e) { this.style.removeProperty(e); }; } -function gd(e, t, n) { +function _d(e, t, n) { var r, i = n + "", s; return function() { - var a = gr(this, e); + var a = _r(this, e); return a === i ? null : a === r ? s : s = t(r = a, n); }; } -function _d(e, t, n) { +function md(e, t, n) { var r, i, s; return function() { - var a = gr(this, e), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(e), gr(this, e))), a === l ? null : a === r && l === i ? s : (i = l, s = t(r = a, o)); + 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)); }; } -function md(e, t) { +function yd(e, t) { var n, r, i, s = "style." + t, a = "end." + s, o; return function() { - var l = Yt(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 = _l(t)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } -function yd(e, t, n) { - var r = (e += "") == "transform" ? bh : gl; - return t == null ? this.styleTween(e, vd(e, r)).on("end.style." + e, _l(e)) : typeof t == "function" ? this.styleTween(e, _d(e, r, js(this, "style." + e, t))).each(md(this._id, e)) : this.styleTween(e, gd(e, r, t), n).on("end.style." + e, null); -} 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 xd(e, t, n) { return function(r) { this.style.setProperty(e, t.call(this, r), n); }; } -function xd(e, t, n) { +function bd(e, t, n) { var r, i; function s() { var a = t.apply(this, arguments); - return a !== i && (r = (i = a) && wd(e, a, n)), r; + return a !== i && (r = (i = a) && xd(e, a, n)), r; } return s._value = t, s; } -function bd(e, t, n) { +function $d(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, xd(e, t, n ?? "")); + return this.tween(r, bd(e, t, n ?? "")); } -function $d(e) { +function Ad(e) { return function() { this.textContent = e; }; } -function Ad(e) { +function Ed(e) { return function() { var t = e(this); this.textContent = t ?? ""; }; } -function Ed(e) { - return this.tween("text", typeof e == "function" ? Ad(js(this, "text", e)) : $d(e == null ? "" : e + "")); -} function Td(e) { + return this.tween("text", typeof e == "function" ? Ed(js(this, "text", e)) : Ad(e == null ? "" : e + "")); +} +function Cd(e) { return function(t) { this.textContent = e.call(this, t); }; } -function Cd(e) { +function Rd(e) { var t, n; function r() { var i = e.apply(this, arguments); - return i !== n && (t = (n = i) && Td(i)), t; + return i !== n && (t = (n = i) && Cd(i)), t; } return r._value = e, r; } -function Rd(e) { +function Sd(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, Cd(e)); + return this.tween(t, Rd(e)); } -function Sd() { +function Nd() { for (var e = this._name, t = this._id, n = ml(), 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 = Et(l, t); - Gi(l, e, n, u, a, { + var f = Rt(l, t); + Ki(l, e, n, u, a, { time: f.time + f.delay + f.duration, delay: 0, duration: f.duration, @@ -4503,94 +4503,94 @@ function Sd() { } return new fn(r, this._parents, e, n); } -function Nd() { +function kd() { 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 = Yt(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 kd = 0; +var Md = 0; function fn(e, t, n, r) { this._groups = e, this._parents = t, this._name = n, this._id = r; } -function wi(e) { - return wr().transition(e); +function xi(e) { + return xr().transition(e); } function ml() { - return ++kd; + return ++Md; } -var jt = wr.prototype; -fn.prototype = wi.prototype = { +var jt = xr.prototype; +fn.prototype = xi.prototype = { constructor: fn, - select: cd, - selectAll: hd, + select: hd, + selectAll: dd, selectChild: jt.selectChild, selectChildren: jt.selectChildren, - filter: id, - merge: sd, - selection: pd, - transition: Sd, + 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: ld, - attr: Hh, - attrTween: Uh, - style: yd, - styleTween: bd, - text: Ed, - textTween: Rd, - remove: fd, - tween: Oh, - delay: jh, - duration: Qh, - ease: td, - easeVarying: rd, - end: Nd, + 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 Md(e) { +function Pd(e) { return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; } -var Pd = { +var Dd = { time: null, // Set on use. delay: 0, duration: 250, - ease: Md + ease: Pd }; -function Dd(e, t) { +function Od(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 Od(e) { +function Fd(e) { var t, n; - e instanceof fn ? (t = e._id, e = e._name) : (t = ml(), (n = Pd).time = Gs(), e = e == null ? null : e + ""); + e instanceof fn ? (t = e._id, e = e._name) : (t = ml(), (n = Dd).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]) && Gi(l, e, t, u, a, n || Dd(l, t)); + (l = a[u]) && Ki(l, e, t, u, a, n || Od(l, t)); return new fn(r, this._parents, e, t); } -wr.prototype.interrupt = Mh; -wr.prototype.transition = Od; +xr.prototype.interrupt = Ph; +xr.prototype.transition = Fd; const Rs = Math.PI, Ss = 2 * Rs, Nn = 1e-6, Id = Ss - Nn; function yl(e) { this._ += e[0]; for (let t = 1, n = e.length; t < n; ++t) this._ += arguments[t] + e[t]; } -function Fd(e) { +function Ld(e) { let t = Math.floor(e); if (!(t >= 0)) throw new Error(`invalid digits: ${e}`); if (t > 15) return yl; @@ -4601,10 +4601,10 @@ function Fd(e) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Ld { +class qd { constructor(t) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = t == null ? yl : Fd(t); + this._x1 = this._y1 = null, this._ = "", this._append = t == null ? yl : Ld(t); } moveTo(t, n) { this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`; @@ -4623,20 +4623,20 @@ class Ld { } 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, c = f * f + p * p; + let a = this._x1, o = this._y1, l = r - t, u = i - n, f = a - t, p = o - n, h = f * f + p * p; if (this._x1 === null) this._append`M${this._x1 = t},${this._y1 = n}`; - else if (c > Nn) if (!(Math.abs(p * l - u * f) > Nn) || !s) + else if (h > Nn) if (!(Math.abs(p * 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(c), M = s * Math.tan((Rs - Math.acos((b + c - m) / (2 * $ * D))) / 2), S = M / D, F = 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 + F * l},${this._y1 = n + F * u}`; + 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}`; } } 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, c = 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 && (c < 0 && (c = c % Ss + Ss), c > 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}` : c > Nn && this._append`A${r},${r},0,${+(c >= 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, 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)}`); } 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 Ld { return this._; } } -function qd(e) { +function Vd(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 Vd = qd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Le(e) { +const zd = Vd("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function qe(e) { return function() { return e; }; } -const qa = Math.abs, Oe = Math.atan2, Sn = Math.cos, zd = Math.max, ss = Math.min, kt = Math.sin, er = Math.sqrt, Xe = 1e-12, zr = Math.PI, Mi = zr / 2, xi = 2 * zr; -function Hd(e) { +const qa = Math.abs, De = Math.atan2, Sn = Math.cos, Hd = Math.max, ss = Math.min, Pt = 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); } function Va(e) { - return e >= 1 ? Mi : e <= -1 ? -Mi : Math.asin(e); + return e >= 1 ? Pi : e <= -1 ? -Pi : Math.asin(e); } -function Yd(e) { +function Bd(e) { let t = 3; return e.digits = function(n) { if (!arguments.length) return t; @@ -4674,107 +4674,107 @@ function Yd(e) { t = r; } return e; - }, () => new Ld(t); + }, () => new qd(t); } -function Bd(e) { +function Xd(e) { return e.innerRadius; } -function Xd(e) { +function Wd(e) { return e.outerRadius; } -function Wd(e) { +function Ud(e) { return e.startAngle; } -function Ud(e) { +function Gd(e) { return e.endAngle; } -function Gd(e) { +function Kd(e) { return e && e.padAngle; } -function Kd(e, t, n, r, i, s, a, o) { - var l = n - e, u = r - t, f = a - i, p = o - s, c = p * l - f * u; - if (!(c * c < Xe)) - return c = (f * (t - s) - p * (e - i)) / c, [e + c * l, t + c * u]; +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 ui(e, t, n, r, i, s, a) { - var o = e - n, l = t - r, u = (a ? s : -s) / er(o * o + l * l), f = u * l, p = -u * o, c = e + f, d = t + p, y = n + f, b = r + p, m = (c + y) / 2, $ = (d + b) / 2, D = y - c, M = b - d, S = D * D + M * M, F = i - s, L = c * b - y * d, W = (M < 0 ? -1 : 1) * er(zd(0, F * F * S - L * L)), oe = (L * M - D * W) / S, Q = (-L * D - M * W) / S, U = (L * M + D * W) / S, le = (-L * D + M * W) / S, ue = oe - m, O = Q - $, I = U - m, Me = le - $; - return ue * ue + O * O > I * I + Me * Me && (oe = U, Q = le), { - cx: oe, +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, x01: -f, y01: -p, - x11: oe * (i / F - 1), - y11: Q * (i / F - 1) + x11: ae * (i / I - 1), + y11: Q * (i / I - 1) }; } -function _t() { - var e = Bd, t = Xd, n = Le(0), r = null, i = Wd, s = Ud, a = Gd, o = null, l = Yd(u); +function wt() { + var e = Xd, t = Wd, n = qe(0), r = null, i = Ud, s = Gd, a = Kd, o = null, l = Bd(u); function u() { - var f, p, c = +e.apply(this, arguments), d = +t.apply(this, arguments), y = i.apply(this, arguments) - Mi, b = s.apply(this, arguments) - Mi, m = qa(b - y), $ = b > y; - if (o || (o = f = l()), d < c && (p = d, d = c, c = p), !(d > Xe)) o.moveTo(0, 0); - else if (m > xi - Xe) - o.moveTo(d * Sn(y), d * kt(y)), o.arc(0, 0, d, y, b, !$), c > Xe && (o.moveTo(c * Sn(b), c * kt(b)), o.arc(0, 0, c, b, y, $)); + 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 * Pt(y)), o.arc(0, 0, d, y, b, !$), h > Be && (o.moveTo(h * Sn(b), h * Pt(b)), o.arc(0, 0, h, b, y, $)); else { - var D = y, M = b, S = y, F = b, L = m, W = m, oe = a.apply(this, arguments) / 2, Q = oe > Xe && (r ? +r.apply(this, arguments) : er(c * c + d * d)), U = ss(qa(d - c) / 2, +n.apply(this, arguments)), le = U, ue = U, O, I; - if (Q > Xe) { - var Me = Va(Q / c * kt(oe)), ot = Va(Q / d * kt(oe)); - (L -= Me * 2) > Xe ? (Me *= $ ? 1 : -1, S += Me, F -= Me) : (L = 0, S = F = (y + b) / 2), (W -= ot * 2) > Xe ? (ot *= $ ? 1 : -1, D += ot, M -= ot) : (W = 0, D = M = (y + b) / 2); + 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 * Pt(ae)), ft = Va(Q / d * Pt(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 ye = d * Sn(D), we = d * kt(D), ee = c * Sn(F), Pe = c * kt(F); - if (U > Xe) { - var G = d * Sn(M), Ie = d * kt(M), Tt = c * Sn(S), ie = c * kt(S), Ze; + var me = d * Sn(D), ye = d * Pt(D), te = h * Sn(I), ke = h * Pt(I); + if (G > Be) { + var Y = d * Sn(M), Oe = d * Pt(M), St = h * Sn(S), ie = h * Pt(S), Je; if (m < zr) - if (Ze = Kd(ye, we, Tt, ie, G, Ie, ee, Pe)) { - var Bt = ye - Ze[0], lt = we - Ze[1], Tn = G - Ze[0], _e = Ie - Ze[1], Ct = 1 / kt(Hd((Bt * Tn + lt * _e) / (er(Bt * Bt + lt * lt) * er(Tn * Tn + _e * _e))) / 2), Xt = er(Ze[0] * Ze[0] + Ze[1] * Ze[1]); - le = ss(U, (c - Xt) / (Ct - 1)), ue = ss(U, (d - Xt) / (Ct + 1)); + 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 / Pt(Yd((yt * Tn + Ze * ge) / (tr(yt * yt + Ze * Ze) * tr(Tn * Tn + ge * ge))) / 2), Wt = tr(Je[0] * Je[0] + Je[1] * Je[1]); + oe = ss(G, (h - Wt) / (Nt - 1)), ue = ss(G, (d - Wt) / (Nt + 1)); } else - le = ue = 0; + oe = ue = 0; } - W > Xe ? ue > Xe ? (O = ui(Tt, ie, ye, we, d, ue, $), I = ui(G, Ie, ee, Pe, d, ue, $), o.moveTo(O.cx + O.x01, O.cy + O.y01), ue < U ? o.arc(O.cx, O.cy, ue, Oe(O.y01, O.x01), Oe(I.y01, I.x01), !$) : (o.arc(O.cx, O.cy, ue, Oe(O.y01, O.x01), Oe(O.y11, O.x11), !$), o.arc(0, 0, d, Oe(O.cy + O.y11, O.cx + O.x11), Oe(I.cy + I.y11, I.cx + I.x11), !$), o.arc(I.cx, I.cy, ue, Oe(I.y11, I.x11), Oe(I.y01, I.x01), !$))) : (o.moveTo(ye, we), o.arc(0, 0, d, D, M, !$)) : o.moveTo(ye, we), !(c > Xe) || !(L > Xe) ? o.lineTo(ee, Pe) : le > Xe ? (O = ui(ee, Pe, G, Ie, c, -le, $), I = ui(ye, we, Tt, ie, c, -le, $), o.lineTo(O.cx + O.x01, O.cy + O.y01), le < U ? o.arc(O.cx, O.cy, le, Oe(O.y01, O.x01), Oe(I.y01, I.x01), !$) : (o.arc(O.cx, O.cy, le, Oe(O.y01, O.x01), Oe(O.y11, O.x11), !$), o.arc(0, 0, c, Oe(O.cy + O.y11, O.cx + O.x11), Oe(I.cy + I.y11, I.cx + I.x11), $), o.arc(I.cx, I.cy, le, Oe(I.y11, I.x11), Oe(I.y01, I.x01), !$))) : o.arc(0, 0, c, F, S, $); + 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, $); } 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, kt(p) * f]; + return [Sn(p) * f, Pt(p) * f]; }, u.innerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Le(+f), u) : e; + return arguments.length ? (e = typeof f == "function" ? f : qe(+f), u) : e; }, u.outerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Le(+f), u) : t; + return arguments.length ? (t = typeof f == "function" ? f : qe(+f), u) : t; }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Le(+f), u) : n; + return arguments.length ? (n = typeof f == "function" ? f : qe(+f), u) : n; }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Le(+f), u) : r; + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : qe(+f), u) : r; }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Le(+f), u) : i; + return arguments.length ? (i = typeof f == "function" ? f : qe(+f), u) : i; }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Le(+f), u) : s; + return arguments.length ? (s = typeof f == "function" ? f : qe(+f), u) : s; }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Le(+f), u) : a; + return arguments.length ? (a = typeof f == "function" ? f : qe(+f), u) : a; }, u.context = function(f) { return arguments.length ? (o = f ?? null, u) : o; }, u; } -function jd(e) { +function Jd(e) { return typeof e == "object" && "length" in e ? e : Array.from(e); } -function Jd(e, t) { +function Zd(e, t) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function Zd(e) { +function Qd(e) { return e; } function as() { - var e = Zd, t = Jd, n = null, r = Le(0), i = Le(xi), s = Le(0); + var e = Qd, t = Zd, n = null, r = qe(0), i = qe(bi), s = qe(0); function a(o) { - var l, u = (o = jd(o)).length, f, p, c = 0, d = new Array(u), y = new Array(u), b = +r.apply(this, arguments), m = Math.min(xi, Math.max(-xi, 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 = 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; for (l = 0; l < u; ++l) - (S = y[d[l] = l] = +e(o[l], l, o)) > 0 && (c += S); - for (t != null ? d.sort(function(F, L) { - return t(y[F], y[L]); - }) : n != null && d.sort(function(F, L) { - return n(o[F], o[L]); - }), l = 0, p = c ? (m - u * M) / c : 0; l < u; ++l, b = $) + (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] = { data: o[f], index: l, @@ -4786,17 +4786,17 @@ function as() { return y; } return a.value = function(o) { - return arguments.length ? (e = typeof o == "function" ? o : Le(+o), a) : e; + return arguments.length ? (e = typeof o == "function" ? o : qe(+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 : Le(+o), a) : r; + return arguments.length ? (r = typeof o == "function" ? o : qe(+o), a) : r; }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Le(+o), a) : i; + return arguments.length ? (i = typeof o == "function" ? o : qe(+o), a) : i; }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Le(+o), a) : s; + return arguments.length ? (s = typeof o == "function" ? o : qe(+o), a) : s; }, a; } function Mr(e, t, n) { @@ -4839,8 +4839,8 @@ Mr.prototype = { } }; Mr.prototype; -var Qd = /* @__PURE__ */ Ku(''); -const ep = { +var ep = /* @__PURE__ */ ju(''); +const tp = { 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;} @@ -4848,50 +4848,50 @@ const ep = { }` }; function wl(e, t) { - Vi(t, !0), Hs(e, ep); - let n = ae(t, "jsonData", 7), r = ae(t, "currentRound", 7, 1), i = ae(t, "mouseEventType", 15), s = ae(t, "mouseData", 15), a = ae(t, "mouseX", 15), o = ae(t, "mouseY", 15), l = ae(t, "requestRoundChange", 7, (h) => { - }), u = ae(t, "candidateColors", 23, () => []), f = ae(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), p = ae(t, "firstRoundDeterminesPercentages", 7, !1), c = ae(t, "randomizeOrder", 7, !1), d = ae(t, "displayPhase", 15, 0); - function y(h) { - return h.isTransfer ? `${h.label}__transfer` : h.transferIndex != null ? `${h.label}__${h.transferIndex}` : h.label; - } - const b = 800, m = 800, $ = Math.min(b, m) * 0.3, D = b / 2, M = m / 2, S = "Pie", F = "PieOutline", L = "Donut", W = "TextLayer", oe = "url(#cross-hatch)", Q = 1.15, U = 750, le = 800, ue = "white", O = 1, I = "#ff00ff", Me = 3; - function ot(h) { - return "hatch-" + h.replace(/[^a-zA-Z0-9]/g, "-"); - } - let ye = [], we = [], ee = [], Pe = 0, G = 0; - const Ie = {}, Tt = "No Further Rankings"; + 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) { + 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) { + 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 Ze() { - const h = fe(x(ie)); - h.select("#" + S).remove(), h.select("#" + F).remove(), h.select("#" + L).remove(), h.select("#" + W).remove(); + function Je() { + const c = fe(x(ie)); + c.select("#" + S).remove(), c.select("#" + I).remove(), c.select("#" + L).remove(), c.select("#" + U).remove(); } - function Bt(h) { - l() && (me = h, l()(h)); + function yt(c) { + l() && (_e = c, l()(c)); } - function lt(h) { - Ze(), ee = Tn(h), ye = ea(h, S, ee, D, M, 0, _e()), ea(h, F, ee, D, M, 0, _e(), !1, !1, !0), Er(); + 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(); } - tf(() => { - Cn(), setTimeout( + nf(() => { + pn(), setTimeout( () => { - lt(r()); + Ze(r()); }, 0 ); }); - function Tn(h) { - const g = ze(h); - return Pe = Jn(h), g; + function Tn(c) { + const g = Ut(c); + return ke = Jn(c), g; } - function _e() { + function ge() { return $; } - function Ct() { - return _e() * 1.41; + function Nt() { + return ge() * 1.41; } - function Xt(h) { + function Wt(c) { let g = 0; - for (let _ = 1; _ < h; _++) { + for (let _ = 1; _ < c; _++) { const A = n().results[_ - 1].tallyResults; for (let E = 0; E < A.length; E++) { const T = A[E].transfers; @@ -4903,61 +4903,61 @@ function wl(e, t) { } return g; } - function jr(h, g) { - if (h === "exhausted") return Xt(g); + function jr(c, g) { + if (c === "exhausted") return Wt(g); { const _ = n().results[g - 1].tally; - return Number(_[h]); + return Number(_[c]); } } - function Jr(h, g) { - return jr(h, g).toLocaleString("en-US"); + function Jr(c, g) { + return jr(c, g).toLocaleString("en-US"); } - function Zr(h, g) { - const _ = p() ? Pe : Ki(g); - return (jr(h, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Zr(c, g) { + const _ = p() ? ke : ji(g); + return (jr(c, g) / _).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function Jn(h) { - const g = n().results[h - 1].tally; + function Jn(c) { + const g = n().results[c - 1].tally; let _ = 0; for (let [A, E] of Object.entries(g)) _ += Number(E); return _; } - function hn(h) { - return h === "exhausted" || h === "Inactive Ballots"; + function hn(c) { + return c === "exhausted" || c === "Inactive Ballots"; } - function Ki(h) { - const g = n().results[h - 1].tally; + function ji(c) { + const g = n().results[c - 1].tally; let _ = 0; for (let [A, E] of Object.entries(g)) hn(A) || (_ += Number(E)); return _; } - function Qr(h, g) { - if (!h || h < 1 || h > n().results.length) + function Qr(c, g) { + if (!c || c < 1 || c > n().results.length) return console.warn("In chosenCandidates: round ${round} is out of range."), []; - if (f() && h === n().results.length) + if (f() && c === n().results.length) return []; - const _ = n().results[h - 1].tallyResults, A = []; + const _ = n().results[c - 1].tallyResults, A = []; for (let E = 0; E < _.length; E++) { const T = _[E][g]; T != null && A.push(T); } return A; } - function dn(h) { - return Qr(h, "eliminated"); + function dn(c) { + return Qr(c, "eliminated"); } - function xr(h) { + function br(c) { let g = []; - for (let _ = 1; _ <= h; _++) g = g.concat(Qr(_, "elected")); + for (let _ = 1; _ <= c; _++) g = g.concat(Qr(_, "elected")); return [...new Set(g)]; } - function w(h, g) { + function w(c, g) { const _ = n().results[g - 1].tallyResults; let A = 0; - const E = _.findIndex((T) => (T == null ? void 0 : T.elected) && h == T.elected); + const E = _.findIndex((T) => (T == null ? void 0 : T.elected) && c == T.elected); if (E >= 0) { const T = _[E].transfers; if (T) @@ -4966,52 +4966,57 @@ function wl(e, t) { return 0; return A; } - function Y(h, g) { - h.some((_) => hn(_.label)) || h.push({ label: "exhausted", value: Xt(g) }); + 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((_) => hn(_.label)) || c.push({ label: "exhausted", value: Wt(g) }); } - function te(h) { - let g = h | 0; + function pe(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; }; } - function pe(h) { + function we(c) { let g = 5381; - for (let _ = 0; _ < h.length; _++) - g = (g << 5) + g + h.charCodeAt(_) | 0; + for (let _ = 0; _ < c.length; _++) + g = (g << 5) + g + c.charCodeAt(_) | 0; return g; } - function xe(h) { + function le(c) { var E; - if (h.length <= 3) return h; - const g = pe(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = te(g), A = [...h]; + if (c.length <= 3) return c; + const g = we(((E = n().config) == null ? void 0 : E.contest) ?? ""), _ = pe(g), A = [...c]; for (let T = A.length - 1; T > 0; T--) { const P = Math.floor(_() * (T + 1)); [A[T], A[P]] = [A[P], A[T]]; } return A; } - function se() { - const h = Object.keys(n().results[0].tally); - return c() ? xe(h) : h; + function Fe() { + const c = Object.keys(n().results[0].tally); + return h() ? le(c) : c; } - function ze(h) { - const g = n().results[h - 1].tally, _ = []; - for (const A of se()) + function Ut(c) { + const g = n().results[c - 1].tally, _ = []; + for (const A of Fe()) A in g && _.push({ label: A, value: Number(g[A]) }); - return Y(_, h), _; + return ee(_, c), _; } - function Wt(h) { - const g = n().results[h - 1].tally, _ = []; - for (const A of se()) + function kt(c) { + const g = n().results[c - 1].tally, _ = []; + for (const A of Fe()) _.push({ label: A, value: Number(g[A] ?? 0) }); - return Y(_, h), _; + return ee(_, c), _; } - function Rt(h, g) { + function Cn(c, g) { const _ = []; - for (const A of h) { + for (const A of c) { if (A.label === "exhausted" || A.isTransfer) { _.push(A); continue; @@ -5025,159 +5030,163 @@ function wl(e, t) { } return _; } - function Cn() { - const h = fe(x(ie)).select("defs").select("#cross-hatch"); + function pn() { + const c = fe(x(ie)).select("defs").select("#cross-hatch"); let g = 0; for (let [_, A] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? g < 10 ? Ie[_] = Vd[g] : Ie[_] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Ie[_] = u()[g % u().length], g++; + !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++; { - const E = h.clone(!0); - E.attr("id", ot(_)).select("rect").attr("fill", Ie[_]), E.selectAll("circle").attr("fill", "#383838"); + const E = c.clone(!0); + E.attr("id", ft(_)).select("rect").attr("fill", Oe[_]), E.selectAll("circle").attr("fill", "#383838"); } } - Ie.exhausted = oe, Ie["Inactive Ballots"] = oe; + Oe.exhausted = ae, Oe["Inactive Ballots"] = ae; } - function pn() { + function He() { fe(x(ie)).select("#" + L).remove(); } - function Ee(h, g) { - const _ = wi("global").duration(le); + function Qe(c, g) { + const _ = xi("global").duration(oe); g && _.on("end", g); - const A = Rt(ee, h), T = as().sort(null).value((P) => P.value)(A); - ia(h, S, T, 0, _e()), ia(h, F, T, 0, _e(), !0), ee = A, ye = T, pn(), $l(h), Nl(), Ml(0, _e()), Er(); + 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 He(h, g) { - const _ = wi("global").duration(le); - g && _.on("end", g), Al(h); + function Me(c, g) { + const _ = xi("global").duration(oe); + g && _.on("end", g), El(c); } - function Te(h, g) { - const _ = wi("global").duration(le); - g && _.on("end", g), ji(h), bl(_e(), Ct()); + function et(c, g) { + const _ = xi("global").duration(oe); + g && _.on("end", g), bl(c), $l(ge(), Nt()); } - let ve = !1, ut = []; - function Ye() { - Er(), ve = !1, Ut(); + let xe = !1, tt = []; + function Ie() { + Er(), xe = !1, tt.length === 0 && r() < n().results.length && !B(r()) && yt(r() + 1), ct(); } - function Ut() { - if (ut.length === 0) { - me !== r() && (r() === me + 1 && me > 0 && r() <= n().results.length ? (me = r(), St(r())) : r() >= 1 && r() <= n().results.length && (me = r(), d(0), lt(r()))); + function ct() { + if (tt.length === 0) { + _e !== r() && (r() === _e + 1 && _e > 0 && r() <= n().results.length ? (_e = r(), Mt(r())) : r() >= 1 && r() <= n().results.length && (_e = r(), d(0), Ze(r()))); return; } - const h = ut.shift(); - switch (h.type) { + const c = tt.shift(); + switch (c.type) { case "round": { - const g = h.round; - g === me + 1 && me > 0 && g <= n().results.length ? (me = g, St(g)) : (g !== me && g >= 1 && g <= n().results.length && (me = g, d(0), lt(g)), Ut()); + const g = c.round; + g === _e + 1 && _e > 0 && g <= n().results.length ? (_e = g, Mt(g)) : (g !== _e && g >= 1 && g <= n().results.length && (_e = g, d(0), Ze(g)), ct()); break; } case "step": - Nt(); + ei(); break; } } - function St(h) { - if (h <= 1 || h > n().results.length) { - Ut(); + function Mt(c) { + if (c <= 1 || c > n().results.length) { + ct(); return; } - ve = !0, G = h, d(0), Ee(G - 1, () => { - d(1), He(G - 1, () => { - d(2), Te(G, () => { - d(0), Ye(); + xe = !0, Y = c, d(0), Qe(Y - 1, () => { + d(1), Me(Y - 1, () => { + d(2), et(Y, () => { + d(0), Ie(); }); }); }); } - function Gt() { - ve || (ve = !0, G = r(), Rn()); + function Zn() { + xe || (xe = !0, Y = r(), Rn()); } function Rn() { if (d( 0 // if in the middle of "one small step" animation, reset to 0. - ), ut.length > 0) { - Ye(); + ), tt.length > 0) { + Ie(); return; } - const h = G < n().results.length - 1 ? Rn : () => { - d(0), Ye(); + if (!B(Y)) { + Y++, yt(Y), Ze(Y), Y < n().results.length ? Rn() : (d(0), Ie()); + return; + } + const c = Y < n().results.length - 1 ? Rn : () => { + d(0), Ie(); }; - Ee(G, () => { - d(1), He(G, () => { - d(2), G++, Bt(G), Te(G, h); + Qe(Y, () => { + d(1), Me(Y, () => { + d(2), Y++, yt(Y), et(Y, c); }); }); } - Fs(() => { - br(); + Is(() => { + $r(); }); - let me = 0; - function br() { - if (me != r()) { - if (ve) { - ut.push({ type: "round", round: r() }); + let _e = 0; + function $r() { + if (_e != r()) { + if (xe) { + tt.push({ type: "round", round: r() }); return; } - me == r() - 1 && me > 0 ? Kt() : $r(r()), me = r(); + _e == r() - 1 && _e > 0 ? Kt() : Gt(r()), _e = r(); } } - function $r(h) { - if (ve) { - ut.push({ type: "round", round: h }); + function Gt(c) { + if (xe) { + tt.push({ type: "round", round: c }); return; } - d(0), lt(h); + d(0), Ze(c); } function Kt() { - if (ve) { - ut.push({ type: "round", round: r() }); + if (xe) { + tt.push({ type: "round", round: r() }); return; } if (r() <= 1) { console.warn(`animateOneRoundFn: can't animate to round ${r()}`); return; } - if (G = r(), G > n().results.length) { - Er(), ve = !1; + if (Y = r(), Y > n().results.length) { + Er(), xe = !1; return; } - ve = !0, d() === 0 ? Ee(G - 1, () => { - d(1), He(G - 1, () => { - d(2), Te(G, () => { - d(0), Ye(); + xe = !0, d() === 0 ? Qe(Y - 1, () => { + d(1), Me(Y - 1, () => { + d(2), et(Y, () => { + d(0), Ie(); }); }); - }) : d() === 1 ? He(G - 1, () => { - d(2), Te(G, () => { - d(0), Ye(); + }) : d() === 1 ? Me(Y - 1, () => { + d(2), et(Y, () => { + d(0), Ie(); }); - }) : d() === 2 && Te(G, () => { - d(0), Ye(); + }) : d() === 2 && et(Y, () => { + d(0), Ie(); }); } - function Nt() { + function ei() { if (r() > n().results.length) { - Er(), ve = !1; + Er(), xe = !1; return; } - if (ve) { - ut.push({ type: "step" }); + if (xe) { + tt.push({ type: "step" }); return; } - ve = !0, G = r(), d() === 0 ? Ee(G, () => { - d(1), Ye(); - }) : d() === 1 ? He(G, () => { - d(2), Ye(); - }) : d() === 2 ? (G++, Bt(G), Te(G, () => { - d(0), Ye(); - })) : (ve = !1, console.warn("displayPhase out of range at ", d())); - } - function ji(h) { - ee = Wt(h), ye = na(h, S, ee, 0, _e(), !0), na(h, F, ee, 0, _e(), !1, !0); - } - function bl(h, g) { + 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 = kt(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 ye) { + for (const N of me) { const k = N.data.label; if (N.data.isTransfer) continue; const C = E.select("#" + CSS.escape(y(N.data))); @@ -5191,37 +5200,37 @@ function wl(e, t) { const P = _.selectAll(".slice"); let z = P.size(); function q() { - z--, z === 0 && kl(); + z--, z === 0 && Ml(); } - P.select("path").transition("global").duration(U).attrTween("d", function(N) { - const k = N.startAngle, C = N.endAngle, R = C - k, De = T[N.data.label]; - let Z, Be; - if (De) { - const Zn = (De.oldStart + De.oldEnd) / 2, Il = (De.newStart + De.newEnd) / 2, Fl = k - Zn; - Z = Il + Fl, Be = Z + R; + 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; } else - Z = k, Be = C; - const ne = Jt(k, Z), Ce = Jt(C, Be), ti = Jt(g, h), Tr = _t(); - return function(Zn) { - return Tr.innerRadius(Math.min(ti(Zn), h) - 1).outerRadius(ti(Zn)).startAngle(ne(Zn)).endAngle(Ce(Zn)), Tr(N); + Z = k, Ye = C; + const ne = Jt(k, Z), Ee = Jt(C, Ye), ni = Jt(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); }; }).on("end", (N) => q()); } - function $l(h) { - const g = Tl(h, ye); - we = ta(h, L, g, D, M, _e(), Ct(), !1, !0); + 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("#" + F).raise(); + _.select("#" + S).raise(), _.select("#" + I).raise(); } - function Al(h) { - const g = Rl(h, we, ye); - we = sa(h, L, g, _e(), Ct(), !1); + function El(c) { + const g = Sl(c, ye, me); + ye = sa(c, L, g, ge(), Nt(), !1); } - function Ar(h) { - return Ie[h.data.label]; + function Ar(c) { + return Oe[c.data.label]; } - function El(h) { - const g = {}, _ = n().results[h - 1].tallyResults; + 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) { @@ -5238,8 +5247,8 @@ function wl(e, t) { } return g; } - function Tl(h, g) { - const _ = [], A = Pe, E = n().results[h - 1].tallyResults; + function Cl(c, g) { + const _ = [], A = ke, 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) { @@ -5261,9 +5270,9 @@ function wl(e, t) { } for (let [k, C] of Object.entries(z)) { let R; - const De = g.find((ne) => ne.data.label == k); - if (De) - R = structuredClone(De); + const Pe = g.find((ne) => ne.data.label == k); + if (Pe) + R = structuredClone(Pe); else if (k == "exhausted") R = { data: { label: k, value: Number(C) }, @@ -5273,34 +5282,33 @@ function wl(e, t) { endAngle: 0, padAngle: 0 }; - else if (k == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", C); - continue; - } else { + else { + if (k == "residual surplus") + continue; console.warn("makeDonutInfo: unrecognized name in transfers ", k); continue; } - const Be = Number(C) / A * 2 * Math.PI; - R.startAngle = N, N = R.endAngle = N + Be, R.index = T, R.data.transferIndex = T, _.push(R); + 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); } } return _; } - function Cl(h, g, _) { + function Rl(c, g, _) { const A = {}; - for (let [E, T] of Object.entries(h)) { + for (let [E, T] of Object.entries(c)) { const P = _.find((N) => E == N.data.label); if (P === void 0) { - console.warn("getTransferStartAngles: mainPieObj not found for ", E); + E !== "residual surplus" && console.warn("getTransferStartAngles: mainPieObj not found for ", E); continue; } - const z = (P.startAngle + P.endAngle) / 2, q = h[P.data.label] / g * 2 * Math.PI; + const z = (P.startAngle + P.endAngle) / 2, q = c[P.data.label] / g * 2 * Math.PI; A[P.data.label] = z - q / 2; } return A; } - function Rl(h, g, _) { - const A = [], E = Pe, T = El(h), P = Cl(T, E, _); + 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) { @@ -5316,19 +5324,19 @@ function wl(e, t) { } return A; } - function Zs(h, g, _, A) { - const E = _t().innerRadius(_ * Q).outerRadius(_ * Q), T = g.filter((k) => !k.data.isTransfer && k.data.value > 0), P = [], z = A.append("g").attr("opacity", 0); + 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); for (const k of T) { - const C = k.data.label === "exhausted" ? Tt : k.data.label, R = E.centroid(k), De = ei(k.startAngle, k.endAngle), Z = Jr(k.data.label, h); - let Be; - !p() && hn(k.data.label) ? Be = Z : Be = Z + " (" + Zr(k.data.label, h) + ")"; - const ne = z.append("text").attr("transform", `translate(${R})`).attr("text-anchor", De).text(C); - ne.append("tspan").attr("x", 0).attr("dy", "1.2em").text(Be); - const Ce = ne.node().getBBox(); + 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() && hn(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(); P.push({ label: k.data.label, value: k.data.value, - bbox: new DOMRect(Ce.x + R[0], Ce.y + R[1], Ce.width, Ce.height) + bbox: new DOMRect(Ee.x + R[0], Ee.y + R[1], Ee.width, Ee.height) }); } z.remove(), P.sort((k, C) => C.value - k.value); @@ -5337,205 +5345,205 @@ function wl(e, t) { 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(h, g, _, A, E, T) { - const z = fe(x(ie)).append("g").attr("id", W).attr("transform", `translate(${_}, ${A})`), q = _t().innerRadius(E * Q).outerRadius(E * Q), N = Zs(h, g, E, z); + 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", (De, Z) => Pl(De)).on("mouseleave", (De, Z) => Dl()); - }).append("text").attr("transform", (C) => `translate(${q.centroid(C)})`).attr("text-anchor", (C) => ei(C.startAngle, C.endAngle)).text((C) => C.data.label === "exhausted" ? Tt : C.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((C) => { - const R = Jr(C.data.label, h); - return !p() && hn(C.data.label) ? R : R + " (" + Zr(C.data.label, h) + ")"; + 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() && hn(C.data.label) ? R : R + " (" + Zr(C.data.label, c) + ")"; }); }); } - function Sl(h, g, _, A) { - const T = fe(x(ie)).select("#" + W), P = Zs(h, g, _, T); + 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(); }); - 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 = _t().innerRadius(_ * Q).outerRadius(_ * Q + 1); - z.transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)), q.select("text").transition("global").duration(U).attr("transform", (R) => `translate(${N.centroid(R)})`).attr("text-anchor", (R) => ei(R.startAngle, R.endAngle)).on("end", (R) => C()); + 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(h, g, D, M, _, A)); + k--, k === 0 && (T.remove(), Qs(c, g, D, M, _, A)); } } - function ea(h, g, _, A, E, T, P, z = !0, q = !1, N = !1) { + 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(h, g, C, A, E, T, P, z, q, N), C; + return ta(c, g, C, A, E, T, P, z, q, N), C; } function Er() { - fe(x(ie)).select("#" + F).selectAll(".elected").select("path").style("stroke", I).style("stroke-width", `${Me}px`); + fe(x(ie)).select("#" + I).selectAll(".elected").select("path").style("stroke", F).style("stroke-width", `${Ne}px`); } - function ta(h, g, _, A, E, T, P, z, q, N = !1) { - const k = dn(h), C = xr(h), 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, Ce) => Zi(ne, Ce)).on("mouseleave", (ne, Ce) => Qi(ne, Ce)); - const Be = _t().outerRadius(P).innerRadius(T); + 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 = _t().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" : (Ce) => Ar(Ce)).transition("global").duration(U).attr("d", (Ce) => Be(Ce)).on("end", (Ce) => { + 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(); }); } else - Z.append("path").attr("d", (ne) => Be(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(h, _, A, E, P, k), _; + 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 Nl() { - const _ = fe(x(ie)).select("#" + W).selectAll(".eliminated"); + function kl() { + const _ = fe(x(ie)).select("#" + U).selectAll(".eliminated"); _.size() > 0 && _.classed("finished", !0); } - function kl() { - const _ = fe(x(ie)).select("#" + W).selectAll(".finished"); + function Ml() { + const _ = fe(x(ie)).select("#" + U).selectAll(".finished"); _.size() > 0 && _.remove(); } - function Ml(h, g) { - const E = fe(x(ie)).select("#" + S).selectAll(".eliminated"), T = _t().innerRadius(h), P = _t().outerRadius(g); - E.classed("finished", !0).select("path").attr("stroke", "none").transition("global").duration(U).attrTween("d", function(z) { - const q = Jt(g, h); + 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 = Jt(g, c); return function(N) { return P.innerRadius(q(N)), P(z); }; - }).attr("fill", (z) => `url(#${ot(z.data.label)})`), E.clone(!0).classed("finished", !0).select("path").transition("global").duration(U).attrTween("d", function(z) { - const q = Jt(g, h); + }).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 = Jt(g, c); return function(N) { return T.outerRadius(q(N)), T(z); }; }).attr("fill", (z) => Ar(z)); } - function ei(h, g) { - const _ = (h + g) / 2; + 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 Ji() { fe(x( ie // force redisplay of text labels - )).select("#" + W).raise().append("g").remove(); + )).select("#" + U).raise().append("g").remove(); } - function na(h, g, _, A, E, T, P = !1) { + function na(c, g, _, A, E, T, P = !1) { const q = as().sort(null).value((N) => N.value)(_); - return sa(h, g, q, A, E, T, P), q; + return sa(c, g, q, A, E, T, P), q; } - function ra(h, g, _, A, E = !1) { - const T = dn(h), P = xr(h), N = fe(x(ie)).select("#" + g).selectAll(".slice").data(_, (C) => y(C.data)); + 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(h, g, _, A, E, T = !1) { - const P = _t().outerRadius(E).innerRadius(A); - ra(h, g, _, P, T).select("path").attr("d", (q) => P(q)).attr("fill", T ? "none" : (q) => Ar(q)); + 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(h, g, _, A, E, T, P = !1) { - const z = _t().outerRadius(E).innerRadius(A).startAngle((Z) => Z.startAngle).endAngle((Z) => Z.endAngle), q = _t().outerRadius(E).innerRadius(A); + 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(h, g, _, q, P); + const C = ra(c, g, _, q, P); let R = C.size(); - function De() { + function Pe() { R--, R <= 0 && (P || Ji()); } - return C.select("path").transition("global").duration(U).attrTween("d", function(Z) { - const Be = Number(fe(this.parentNode).attr("prevStart")), ne = Number(fe(this.parentNode).attr("prevEnd")), Ce = Jt(Be, Z.startAngle), ti = Jt(ne, Z.endAngle); - return (Tr) => (z.startAngle(Ce(Tr)).endAngle(ti(Tr)), z(Z)); + 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 = Jt(Ye, Z.startAngle), ni = Jt(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"), De(); - }), T && !P && Sl(h, _, E, dn(h)), _; + Z.startAngle === Z.endAngle && fe(this).attr("stroke", "none"), Pe(); + }), T && !P && Nl(c, _, E, dn(c)), _; } - function Zi(h, g) { - s(g.data.label), i("enter"), a(h.clientX), o(h.clientY); + function Zi(c, g) { + s(g.data.label), i("enter"), a(c.clientX), o(c.clientY); } - function Qi(h, g) { + function Qi(c, g) { s(g.data.label), i("leave"); } - function Pl(h, g) { - i("show-exhausted"), a(h.clientX), o(h.clientY); + function Dl(c, g) { + i("show-exhausted"), a(c.clientX), o(c.clientY); } - function Dl(h, g) { + function Ol(c, g) { i("hide-exhausted"); } - var Ol = { - pieColors: Ie, - exhaustedLabel: Tt, - countExhaustedVotes: Xt, + var Fl = { + pieColors: Oe, + exhaustedLabel: St, + countExhaustedVotes: Wt, getEliminatedCandidates: dn, - getElectedCandidates: xr, - runFullAnimationFn: Gt, - animateOnePhaseFn: Nt, + getElectedCandidates: br, + runFullAnimationFn: Zn, + animateOnePhaseFn: ei, get jsonData() { return n(); }, - set jsonData(h) { - n(h), re(); + set jsonData(c) { + n(c), re(); }, get currentRound() { return r(); }, - set currentRound(h = 1) { - r(h), re(); + set currentRound(c = 1) { + r(c), re(); }, get mouseEventType() { return i(); }, - set mouseEventType(h) { - i(h), re(); + set mouseEventType(c) { + i(c), re(); }, get mouseData() { return s(); }, - set mouseData(h) { - s(h), re(); + set mouseData(c) { + s(c), re(); }, get mouseX() { return a(); }, - set mouseX(h) { - a(h), re(); + set mouseX(c) { + a(c), re(); }, get mouseY() { return o(); }, - set mouseY(h) { - o(h), re(); + set mouseY(c) { + o(c), re(); }, get requestRoundChange() { return l(); }, - set requestRoundChange(h = (g) => { + set requestRoundChange(c = (g) => { }) { - l(h), re(); + l(c), re(); }, get candidateColors() { return u(); }, - set candidateColors(h = []) { - u(h), re(); + set candidateColors(c = []) { + u(c), re(); }, get excludeFinalWinnerAndEliminatedCandidate() { return f(); }, - set excludeFinalWinnerAndEliminatedCandidate(h = !1) { - f(h), re(); + set excludeFinalWinnerAndEliminatedCandidate(c = !1) { + f(c), re(); }, get firstRoundDeterminesPercentages() { return p(); }, - set firstRoundDeterminesPercentages(h = !1) { - p(h), re(); + set firstRoundDeterminesPercentages(c = !1) { + p(c), re(); }, get randomizeOrder() { - return c(); + return h(); }, - set randomizeOrder(h = !1) { - c(h), re(); + set randomizeOrder(c = !1) { + h(c), re(); }, get displayPhase() { return d(); }, - set displayPhase(h = 0) { - d(h), re(); + set displayPhase(c = 0) { + d(c), re(); } - }, aa = Qd(); - return vi(aa, (h) => he(ie, h), () => x(ie)), Ge(e, aa), zi(Ol); + }, aa = ep(); + return gi(aa, (c) => he(ie, c), () => x(ie)), Ue(e, aa), Hi(Fl); } Ys( wl, @@ -5565,14 +5573,14 @@ Ys( ], { mode: "open" } ); -var tp = /* @__PURE__ */ Ht("
"), np = /* @__PURE__ */ Ht('
', 1), rp = /* @__PURE__ */ Ht('
'); -const ip = { +var np = /* @__PURE__ */ Bt("
"), rp = /* @__PURE__ */ Bt('
', 1), ip = /* @__PURE__ */ Bt('
'); +const sp = { 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) { - Vi(t, !0), Hs(e, ip); - let n = ae(t, "labels", 23, () => ["Eliminate", "Transfer", "Consolidate"]), r = ae(t, "currentStep", 7, 0), i = ae(t, "disabled", 7, !1), s = ae(t, "onAdvance", 7, () => { + 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 a() { i() || s()(); @@ -5606,42 +5614,42 @@ function xl(e, t) { }) { s(p), re(); } - }, u = rp(); + }, u = ip(); let f; - return u.__click = a, u.__keydown = o, pi(u, 21, n, di, (p, c, d) => { - var y = np(), b = _n(y); + return u.__click = a, u.__keydown = o, vi(u, 21, n, pi, (p, h, d) => { + var y = rp(), b = _n(y); { - var m = (W) => { - var oe = tp(); + var m = (U) => { + var ae = np(); let Q; - Zt(() => Q = ii(oe, 1, "connector svelte-1l4eyw0", null, Q, { completed: !i() && d <= r() })), Ge(W, oe); + Zt(() => Q = si(ae, 1, "connector svelte-1l4eyw0", null, Q, { completed: !i() && d <= r() })), Ue(U, ae); }; - Qn(b, (W) => { - d > 0 && W(m); + er(b, (U) => { + d > 0 && U(m); }); } - var $ = Qe(b, 2), D = We($); + var $ = nt(b, 2), D = Xe($); let M; - var S = Qe(D, 2); - let F; - var L = We(S, !0); - Fe(S), Fe($), Zt(() => { - M = ii(D, 1, "dot svelte-1l4eyw0", null, M, { + var S = nt(D, 2); + let I; + var L = Xe(S, !0); + Le(S), Le($), Zt(() => { + M = si(D, 1, "dot svelte-1l4eyw0", null, M, { active: !i() && d === r(), completed: !i() && d < r() - }), F = ii(S, 1, "label svelte-1l4eyw0", null, F, { + }), I = si(S, 1, "label svelte-1l4eyw0", null, I, { active: !i() && d === r(), completed: !i() && d < r() - }), mn(L, x(c)); - }), Ge(p, y); - }), Fe(u), Zt(() => { - f = ii(u, 1, "stepper svelte-1l4eyw0", null, f, { disabled: i() }), xa(u, "tabindex", i() ? -1 : 0), xa(u, "aria-disabled", i()); - }), Ge(e, u), zi(l); + }), mn(L, x(h)); + }), Ue(p, y); + }), Le(u), Zt(() => { + 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); } -Wu(["click", "keydown"]); +Uu(["click", "keydown"]); Ys(xl, { labels: {}, currentStep: {}, disabled: {}, onAdvance: {} }, [], [], { mode: "open" }); -var sp = /* @__PURE__ */ Ht(" ", 1), ap = /* @__PURE__ */ Ht("About to eliminate: ", 1), op = /* @__PURE__ */ Ht(" ", 1), lp = /* @__PURE__ */ Ht(" ", 1), up = /* @__PURE__ */ Ht('

', 1), fp = /* @__PURE__ */ Ht("
", 1), cp = /* @__PURE__ */ Ht('


these ballots have already been eliminated.
', 1); -const hp = { +var ap = /* @__PURE__ */ Bt(" ", 1), op = /* @__PURE__ */ Bt("About to eliminate: ", 1), lp = /* @__PURE__ */ Bt(" ", 1), up = /* @__PURE__ */ Bt(" ", 1), fp = /* @__PURE__ */ Bt('

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


these ballots have already been eliminated.
', 1); +const dp = { 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;} @@ -5656,12 +5664,12 @@ const hp = { }` }; -function dp(e, t) { - Vi(t, !0), Hs(e, hp); +function pp(e, t) { + zi(t, !0), Hs(e, dp); const n = 0.85; - let r = ae(t, "electionSummary", 7), i = ae(t, "currentRound", 7, 1), s = ae(t, "requestRoundChange", 7, (w) => { - }), a = ae(t, "candidateColors", 23, () => []), o = ae(t, "textForWinner", 7, "elected"), l = ae(t, "excludeFinalWinnerAndEliminatedCandidate", 7, !1), u = ae(t, "firstRoundDeterminesPercentages", 7, !1), f = ae(t, "randomizeOrder", 7, !1), p = ae(t, "showCaptions", 7, !1); - const c = { + 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 = { elected: { caption: "Elected", event: "was elected", @@ -5679,120 +5687,122 @@ function dp(e, t) { infinitive: "to take the lead" } }; - let d = /* @__PURE__ */ vn(() => c[o()] ?? c.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), F = /* @__PURE__ */ $e(0), L = /* @__PURE__ */ vn(() => W(r())); - function W(w) { + 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) { if (typeof w == "string") try { w = JSON.parse(w); - } catch (Y) { - return console.error("Failed to parse JSON string:", Y), {}; + } catch (B) { + return console.error("Failed to parse JSON string:", B), {}; } return w || {}; } - function oe(w) { + function ae(w) { s() ? s()(w) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function Q(w, Y, te) { - w.style.left = Y + "px", w.style.top = te + 20 + "px", w.style.transform = "none", requestAnimationFrame(() => { - const se = w.getBoundingClientRect(); - let ze = Y, Wt = te + 20; - ze + se.width > window.innerWidth - 12 && (ze = window.innerWidth - se.width - 12), ze < 12 && (ze = 12), Wt + se.height > window.innerHeight - 12 && (Wt = te - se.height - 12), w.style.left = ze + "px", w.style.top = Wt + "px"; + 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, Ut = ee + 20; + Fe + le.width > window.innerWidth - 12 && (Fe = window.innerWidth - le.width - 12), Fe < 12 && (Fe = 12), Ut + le.height > window.innerHeight - 12 && (Ut = ee - le.height - 12), w.style.left = Fe + "px", w.style.top = Ut + "px"; }); } - function U() { + function G() { switch (x(D)) { case "enter": ((w) => { - var Y = nu(w, 2); - he($, Y[0], !0), he(m, Y[1], !0); - })(ue(x(M), i())), x(y) && (Q(x(y), x(S) || 0, x(F) || 0), x(y).style.opacity = String(n)); + 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)); break; case "leave": x(y) && (x(y).style.opacity = "0"), he($, [], !0), he(m, ""); break; case "show-exhausted": - x(b) && (Q(x(b), x(S) || 0, x(F) || 0), x(b).style.opacity = String(n)); + x(b) && (Q(x(b), x(S) || 0, x(I) || 0), x(b).style.opacity = String(n)); break; case "hide-exhausted": x(b) && (x(b).style.opacity = "0"); break; + case "": + break; default: console.log("Unknown mouse event: ", x(D)); break; } } - Fs(() => U()); - function le(w, Y) { - return w === 1 ? Y ? "vote was" : "vote will be" : Y ? "votes were" : "votes will be"; - } - function ue(w, Y) { - const te = [], pe = w === "exhausted" ? Tt() : w; - let xe; - w === "exhausted" ? xe = G(1) : xe = x(L).results[0].tally[w], te.push(`${pe} started with ${xe} votes.`); - for (let se = 1; se <= Y; se++) { - se === Y && (w === "exhausted" ? xe = G(Y) : xe = x(L).results[Y - 1].tally[w], te.push(`${pe} has ${xe} votes at round ${Y}.`)); - const ze = x(L).results[se - 1].tallyResults, Wt = we(se); - for (let Rt = 0; Rt < ze.length; Rt++) { - const Cn = ze[Rt].transfers, pn = ze[Rt].eliminated, Ee = ze[Rt].elected; - if (!Wt) { + 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, Ut = ye(le); + for (let kt = 0; kt < Fe.length; kt++) { + const Cn = Fe[kt].transfers, pn = Fe[kt].eliminated, He = Fe[kt].elected; + if (!Ut) { if (pn) - pn === w && te.push(`${pe} will be eliminated on round ${se}.`); - else if (w === Ee && (te.push(`${pe} ${x(d).event} on round ${se}.`), Cn)) - for (let [Te, ve] of Object.entries(Cn)) - te.push(`${ve} ${le(Number(ve), se < Y)} transferred to ${Te} on round ${se}.`); + 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}.`); } - const He = pn || Ee; - if (He) { - const Te = Number(Cn[w]); - Te && te.push(`${Te} ${le(Te, se < Y)} transferred from ${He} on round ${se}.`); + 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}.`); } } } - return [te, pe]; + return [ee, pe]; } function O() { let w = 0; - for (let Y = 1; Y <= x(L).results.length; Y++) { - if (we(Y)) continue; - const te = x(L).results[Y - 1].tallyResults; - for (let pe = 0; pe < te.length; pe++) - te[pe].elected && w++; + 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++; } return w; } - let I, Me = /* @__PURE__ */ $e(0); - function ot(w) { - var xe; - return !((xe = x(L)) != null && xe.results) || w < 1 || w > x(L).results.length ? ["Eliminate", "Transfer", "Consolidate"] : [x(L).results[w - 1].tallyResults.some((se) => se.eliminated) ? "Eliminate" : "Surplus", "Transfer", "Consolidate"]; + 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"]; } - function ye(w) { - var te; - if (!((te = x(L)) != null && te.results) || w < 1 || w > x(L).results.length || w === x(L).results.length) return !0; - const Y = x(L).results[w - 1].tallyResults; - return Y.length === 0 || Y.every((pe) => Object.keys(pe.transfers).length === 0); + 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 we(w) { + function ye(w) { return l() && x(L).results && w === x(L).results.length; } - function ee(w) { - return we(w) ? [] : I ? I.getEliminatedCandidates(w) : []; + function te(w) { + return ye(w) ? [] : F ? F.getEliminatedCandidates(w) : []; } - function Pe(w) { - return we(w) ? [] : I ? I.getElectedCandidates(w) : []; + function ke(w) { + return ye(w) ? [] : F ? F.getElectedCandidates(w) : []; } - function G(w) { - return I ? I.countExhaustedVotes(w) : 0; + function Y(w) { + return F ? F.countExhaustedVotes(w) : 0; } - function Ie() { - I && I.animateOnePhaseFn && I.animateOnePhaseFn(); + function Oe() { + F && F.animateOnePhaseFn && F.animateOnePhaseFn(); } - function Tt() { - return I ? I.exhaustedLabel : ""; + function St() { + return F ? F.exhaustedLabel : ""; } function ie() { - return I ? I.pieColors : {}; + return F ? F.pieColors : {}; } - var Ze = { + var Je = { get electionSummary() { return r(); }, @@ -5808,7 +5818,7 @@ function dp(e, t) { get requestRoundChange() { return s(); }, - set requestRoundChange(w = (Y) => { + set requestRoundChange(w = (B) => { }) { s(w), re(); }, @@ -5848,25 +5858,25 @@ function dp(e, t) { set showCaptions(w = !1) { p(w), re(); } - }, Bt = cp(), lt = _n(Bt), Tn = We(lt); + }, yt = hp(), Ze = _n(yt), Tn = Xe(Ze); { - let w = /* @__PURE__ */ vn(() => ot(i())), Y = /* @__PURE__ */ vn(() => ye(i())); + let w = /* @__PURE__ */ vn(() => ft(i())), B = /* @__PURE__ */ vn(() => me(i())); xl(Tn, { get labels() { return x(w); }, get currentStep() { - return x(Me); + return x(Ne); }, get disabled() { - return x(Y); + return x(B); }, - onAdvance: Ie + onAdvance: Oe }); } - Fe(lt); - var _e = Qe(lt, 4), Ct = We(_e), Xt = We(Ct), jr = We(Xt); - vi( + Le(Ze); + var ge = nt(Ze, 4), Nt = Xe(ge), Wt = Xe(Nt), jr = Xe(Wt); + gi( wl(jr, { get jsonData() { return x(L); @@ -5874,7 +5884,7 @@ function dp(e, t) { get currentRound() { return i(); }, - requestRoundChange: oe, + requestRoundChange: ae, get candidateColors() { return a(); }, @@ -5906,112 +5916,112 @@ function dp(e, t) { he(S, w, !0); }, get mouseY() { - return x(F); + return x(I); }, set mouseY(w) { - he(F, w, !0); + he(I, w, !0); }, get displayPhase() { - return x(Me); + return x(Ne); }, set displayPhase(w) { - he(Me, w, !0); + he(Ne, w, !0); } }), - (w) => I = w, - () => I - ), Fe(Xt), Fe(Ct); - var Jr = Qe(Ct, 2); + (w) => F = w, + () => F + ), Le(Wt), Le(Nt); + var Jr = nt(Nt, 2); { var Zr = (w) => { - var Y = up(), te = _n(Y), pe = We(te); - Fe(te); - var xe = Qe(te, 2), se = We(xe); + var B = fp(), ee = _n(B), pe = Xe(ee); + Le(ee); + var we = nt(ee, 2), le = Xe(we); { - var ze = (Ee) => { - var He = ap(), Te = Qe(_n(He)); - pi(Te, 17, () => ee(i()), di, (ve, ut, Ye) => { - var Ut = sp(), St = _n(Ut); - let Gt; - var Rn = We(St, !0); - Fe(St); - var me = Qe(St, 2); + 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 Mt; + var Zn = Xe(ct, !0); + Le(ct); + var Rn = nt(ct, 2); { - var br = (Kt) => { - var Nt = ga(", "); - Ge(Kt, Nt); - }, $r = /* @__PURE__ */ vn(() => Ye < ee(i()).length - 1); - Qn(me, (Kt) => { - x($r) && Kt(br); + var _e = (Gt) => { + var Kt = ga(", "); + Ue(Gt, Kt); + }, $r = /* @__PURE__ */ vn(() => tt < te(i()).length - 1); + er(Rn, (Gt) => { + x($r) && Gt(_e); }); } Zt( - (Kt) => { - Gt = wa(St, "", Gt, Kt), mn(Rn, x(ut)); + (Gt) => { + Mt = wa(ct, "", Mt, Gt), mn(Zn, x(xe)); }, - [() => ({ color: ie()[x(ut)] })] - ), Ge(ve, Ut); - }), Ge(Ee, He); - }, Wt = /* @__PURE__ */ vn(() => ee(i()).length > 0); - Qn(se, (Ee) => { - x(Wt) && Ee(ze); + [() => ({ color: ie()[x(xe)] })] + ), Ue(et, Ie); + }), Ue(He, Qe); + }, Ut = /* @__PURE__ */ vn(() => te(i()).length > 0); + er(le, (He) => { + x(Ut) && He(Fe); }); } - var Rt = Qe(se, 2); + var kt = nt(le, 2); { - var Cn = (Ee) => { - var He = lp(), Te = _n(He), ve = Qe(Te); - pi(ve, 17, () => Pe(i()), di, (ut, Ye, Ut) => { - var St = op(), Gt = _n(St); - let Rn; - var me = We(Gt, !0); - Fe(Gt); - var br = Qe(Gt, 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(), Mt = _n(ct); + let Zn; + var Rn = Xe(Mt, !0); + Le(Mt); + var _e = nt(Mt, 2); { - var $r = (Nt) => { - var ji = ga(", "); - Ge(Nt, ji); - }, Kt = /* @__PURE__ */ vn(() => Ut < Pe(i()).length - 1); - Qn(br, (Nt) => { - x(Kt) && Nt($r); + var $r = (Kt) => { + var ei = ga(", "); + Ue(Kt, ei); + }, Gt = /* @__PURE__ */ vn(() => Ie < ke(i()).length - 1); + er(_e, (Kt) => { + x(Gt) && Kt($r); }); } Zt( - (Nt) => { - Rn = wa(Gt, "", Rn, Nt), mn(me, x(Ye)); + (Kt) => { + Zn = wa(Mt, "", Zn, Kt), mn(Rn, x(tt)); }, - [() => ({ color: ie()[x(Ye)] })] - ), Ge(ut, St); - }), Zt(() => mn(Te, `${x(d).caption ?? ""}: `)), Ge(Ee, He); - }, pn = /* @__PURE__ */ vn(() => Pe(i()).length > 0); - Qn(Rt, (Ee) => { - x(pn) && Ee(Cn); + [() => ({ color: ie()[x(tt)] })] + ), Ue(xe, ct); + }), Zt(() => mn(Me, `${x(d).caption ?? ""}: `)), Ue(He, Qe); + }, pn = /* @__PURE__ */ vn(() => ke(i()).length > 0); + er(kt, (He) => { + x(pn) && He(Cn); }); } - Fe(xe), Zt((Ee) => mn(pe, `${x(L).config.contest ?? ""}, ${Ee ?? ""} ${x(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ge(w, Y); + Le(we), Zt((He) => mn(pe, `${x(L).config.contest ?? ""}, ${He ?? ""} ${x(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ue(w, B); }; - Qn(Jr, (w) => { + er(Jr, (w) => { p() && w(Zr); }); } - Fe(_e); - var Jn = Qe(_e, 2), hn = We(Jn), Ki = We(hn, !0); - Fe(hn); - var Qr = Qe(hn, 2); - pi(Qr, 17, () => x($), di, (w, Y) => { - var te = fp(), pe = _n(te), xe = We(pe, !0); - Fe(pe), us(2), Zt(() => mn(xe, x(Y))), Ge(w, te); - }), Fe(Jn), vi(Jn, (w) => he(y, w), () => x(y)); - var dn = Qe(Jn, 2), xr = We(dn); - return us(2), Fe(dn), vi(dn, (w) => he(b, w), () => x(b)), Zt( + Le(ge); + var Jn = nt(ge, 2), hn = Xe(Jn), ji = Xe(hn, !0); + Le(hn); + var Qr = nt(hn, 2); + vi(Qr, 17, () => x($), pi, (w, B) => { + var ee = cp(), pe = _n(ee), we = Xe(pe, !0); + Le(pe), us(2), Zt(() => 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)), Zt( (w) => { - mn(Ki, x(m)), mn(xr, `"${w ?? ""}" means all the candidates ranked on `); + mn(ji, x(m)), mn(br, `"${w ?? ""}" means all the candidates ranked on `); }, - [Tt] - ), Ge(e, Bt), zi(Ze); + [St] + ), Ue(e, yt), Hi(Je); } customElements.define("pie-chart", Ys( - dp, + pp, { electionSummary: {}, currentRound: {}, From 3ec93b466e34fd2b793f1edbcb2d7ba611a05be1 Mon Sep 17 00:00:00 2001 From: skaphan Date: Mon, 6 Apr 2026 16:38:13 -0700 Subject: [PATCH 31/31] Sync pie chart --- static/pie/pie-chart.es.js | 540 ++++++++++++++++++------------------- 1 file changed, 270 insertions(+), 270 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 94f9095f..7d91865f 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -31,7 +31,7 @@ function ru(e, t) { if (n.push(r), n.length === t) break; return n; } -const Re = 2, Fr = 4, Li = 8, ja = 1 << 24, cn = 16, Ct = 32, En = 64, Ja = 128, gt = 512, Ae = 1024, Se = 2048, Tt = 4096, at = 8192, on = 16384, yr = 32768, hr = 65536, ua = 1 << 17, Za = 1 << 18, jn = 1 << 19, iu = 1 << 20, sn = 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 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 { constructor() { super(...arguments); ce(this, "name", "StaleReactionError"); @@ -86,7 +86,7 @@ function wu() { console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"); } let j = !1; -function an(e) { +function on(e) { j = e; } let W; @@ -96,11 +96,11 @@ function Ve(e) { return W = e; } function Vi() { - return Ve(/* @__PURE__ */ Ht(W)); + return Ve(/* @__PURE__ */ Yt(W)); } function Le(e) { if (j) { - if (/* @__PURE__ */ Ht(W) !== null) + if (/* @__PURE__ */ Yt(W) !== null) throw qi(), fr; W = e; } @@ -109,7 +109,7 @@ function us(e = 1) { if (j) { for (var t = e, n = W; t--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ Ht(n); + /* @__PURE__ */ Yt(n); W = n; } } @@ -128,7 +128,7 @@ function Ei(e = !0) { } var i = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Ht(n) + /* @__PURE__ */ Yt(n) ); e && n.remove(), n = i; } @@ -243,10 +243,10 @@ function oo(e, t, n) { } 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, Qt, ar, zt, cs, hs, lo; +var rr, ir, Fn, sr, Hr, Yr, In, en, ar, Ht, cs, hs, lo; const Js = class Js { constructor() { - H(this, zt); + H(this, Ht); ce(this, "committed", !1); /** * The current values of any sources that are updated in this batch @@ -302,7 +302,7 @@ const Js = class Js { * so they can be rescheduled if the branch survives. * @type {Map} */ - H(this, Qt, /* @__PURE__ */ new Map()); + H(this, en, /* @__PURE__ */ new Map()); ce(this, "is_fork", !1); H(this, ar, !1); } @@ -314,7 +314,7 @@ const Js = class Js { * @param {Effect} effect */ skip_effect(t) { - v(this, Qt).has(t) || v(this, Qt).set(t, { d: [], m: [] }); + v(this, en).has(t) || v(this, en).set(t, { d: [], m: [] }); } /** * Remove an effect from the #skipped_branches map and reschedule @@ -322,9 +322,9 @@ const Js = class Js { * @param {Effect} effect */ unskip_effect(t) { - var n = v(this, Qt).get(t); + var n = v(this, en).get(t); if (n) { - v(this, Qt).delete(t); + v(this, en).delete(t); for (var r of n.d) de(r, Se), At(r); for (r of n.m) @@ -340,14 +340,14 @@ const Js = class Js { Ge = [], this.apply(); var n = [], r = []; for (const s of t) - be(this, zt, cs).call(this, s, n, r); + be(this, Ht, cs).call(this, s, n, r); if (this.is_deferred()) { - be(this, zt, hs).call(this, r), be(this, zt, hs).call(this, n); - for (const [s, a] of v(this, Qt)) + 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); } else { for (const s of v(this, rr)) s(); - v(this, rr).clear(), v(this, Fn) === 0 && be(this, zt, lo).call(this), K = null, fa(r), fa(n), (i = v(this, Hr)) == null || i.resolve(); + 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(); } Ce = null; } @@ -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(), Qt = new WeakMap(), ar = new WeakMap(), zt = new WeakSet(), /** +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(), /** * Traverse the effect tree, executing effects or stashing * them for later execution as appropriate * @param {Effect} root @@ -433,9 +433,9 @@ 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, Qt).has(i); + var a = i.f, o = (a & (Ct | En)) !== 0, l = o && (a & Ae) !== 0, u = l || (a & at) !== 0 || v(this, en).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 & cn) !== 0 && v(this, In).add(i), gr(i)); + 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)); var f = i.first; if (f !== null) { i = f; @@ -483,7 +483,7 @@ hs = function(t) { if (Ge.length > 0) { K = s, s.apply(); for (const f of Ge) - be(i = s, zt, cs).call(i, f, [], []); + be(i = s, Ht, cs).call(i, f, [], []); s.deactivate(); } Ge = r; @@ -493,7 +493,7 @@ hs = function(t) { } this.committed = !0, ri.delete(this); }; -let ln = Js; +let un = Js; function re(e) { var t = Dr; Dr = !0; @@ -513,7 +513,7 @@ function uo() { var e = null; try { for (var t = 0; Ge.length > 0; ) { - var n = ln.ensure(); + var n = un.ensure(); if (t++ > 1e3) { var r, i; Eu(); @@ -537,17 +537,17 @@ function fa(e) { if (t !== 0) { for (var n = 0; n < t; ) { var r = e[n++]; - if ((r.f & (on | 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)) { + 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 & (on | at)) !== 0) continue; + if ((i.f & (ln | at)) !== 0) continue; const s = [i]; let a = i.parent; for (; a !== null; ) xt.has(a) && (xt.delete(a), s.push(a)), a = a.parent; for (let o = s.length - 1; o >= 0; o--) { const l = s[o]; - (l.f & (on | at)) === 0 && gr(l); + (l.f & (ln | at)) === 0 && gr(l); } } xt.clear(); @@ -566,7 +566,7 @@ function fo(e, t, n, r) { t, n, r - ) : (s & (Ms | cn)) !== 0 && (s & Se) === 0 && co(i, t, r) && (de(i, Se), At( + ) : (s & (Ms | hn)) !== 0 && (s & Se) === 0 && co(i, t, r) && (de(i, Se), At( /** @type {Effect} */ i )); @@ -597,7 +597,7 @@ function At(e) { for (var t = Yi = e; t.parent !== null; ) { t = t.parent; var n = t.f; - if (fs && t === J && (n & cn) !== 0 && (n & Za) === 0) + if (fs && t === J && (n & hn) !== 0 && (n & Za) === 0) return; if ((n & (En | Ct)) !== 0) { if ((n & Ae) === 0) return; @@ -627,7 +627,7 @@ var Cu = hr | jn | Ja; function Ru(e, t, n) { new Su(e, t, n); } -var it, Br, Dt, Ln, Ot, dt, We, Ft, en, yn, qn, tn, or, Vn, lr, ur, nn, Di, ve, po, vo, ds, ci, hi, ps; +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 { /** * @param {TemplateNode} node @@ -644,23 +644,23 @@ class Su { /** @type {TemplateNode | null} */ H(this, Br, j ? W : null); /** @type {BoundaryProps} */ - H(this, Dt); + H(this, Ot); /** @type {((anchor: Node) => void)} */ H(this, Ln); /** @type {Effect} */ - H(this, Ot); + H(this, Ft); /** @type {Effect | null} */ H(this, dt, null); /** @type {Effect | null} */ H(this, We, null); /** @type {Effect | null} */ - H(this, Ft, null); + H(this, It, null); /** @type {DocumentFragment | null} */ - H(this, en, null); + H(this, tn, null); /** @type {TemplateNode | null} */ H(this, yn, null); H(this, qn, 0); - H(this, tn, 0); + H(this, nn, 0); H(this, or, !1); H(this, Vn, !1); /** @type {Set} */ @@ -674,17 +674,17 @@ class Su { * calls followed by no-op flushes * @type {Source | null} */ - H(this, nn, null); - H(this, Di, Tu(() => (V(this, nn, Un(v(this, qn))), () => { - V(this, nn, null); + H(this, rn, null); + H(this, Di, Tu(() => (V(this, rn, Un(v(this, qn))), () => { + V(this, rn, null); }))); - V(this, it, t), V(this, Dt, n), V(this, Ln, r), this.parent = /** @type {Effect} */ - J.b, this.is_pending = !!v(this, Dt).pending, V(this, Ot, qs(() => { + 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(() => { 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, tn) === 0 && (this.is_pending = !1)); + s.data === Fi ? be(this, ve, vo).call(this) : (be(this, ve, po).call(this), v(this, nn) === 0 && (this.is_pending = !1)); } else { var i = be(this, ve, ds).call(this); try { @@ -692,7 +692,7 @@ class Su { } catch (s) { this.error(s); } - v(this, tn) > 0 ? be(this, ve, hi).call(this) : this.is_pending = !1; + v(this, nn) > 0 ? be(this, ve, hi).call(this) : this.is_pending = !1; } return () => { var s; @@ -715,7 +715,7 @@ class Su { return !this.is_pending && (!this.parent || this.parent.is_rendered()); } has_pending_snippet() { - return !!v(this, Dt).pending; + return !!v(this, Ot).pending; } /** * Update the source that powers `$effect.pending()` inside this boundary, @@ -724,23 +724,23 @@ 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, nn) || v(this, or)) && (V(this, or, !0), xn(() => { - V(this, or, !1), v(this, nn) && vr(v(this, nn), v(this, qn)); + 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)); })); } get_effect_pending() { return v(this, Di).call(this), x( /** @type {Source} */ - v(this, nn) + v(this, rn) ); } /** @param {unknown} error */ error(t) { - var n = v(this, Dt).onerror; - let r = v(this, Dt).failed; + var n = v(this, Ot).onerror; + let r = v(this, Ot).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, Ft) && (ze(v(this, Ft)), V(this, Ft, null)), j && (Ve( + 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( /** @type {TemplateNode} */ v(this, Br) ), us(), Ve(Ei())); @@ -750,18 +750,18 @@ class Su { wu(); return; } - i = !0, s && yu(), ln.ensure(), V(this, qn, 0), v(this, Ft) !== null && Yn(v(this, Ft), () => { - V(this, Ft, 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, tn) > 0 ? be(this, ve, hi).call(this) : this.is_pending = !1; + 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; }; xn(() => { try { s = !0, n == null || n(t, a), s = !1; } catch (o) { - pr(o, v(this, Ot) && v(this, Ot).parent); + pr(o, v(this, Ft) && v(this, Ft).parent); } - r && V(this, Ft, be(this, ve, ci).call(this, () => { - ln.ensure(), V(this, Vn, !0); + r && V(this, It, be(this, ve, ci).call(this, () => { + un.ensure(), V(this, Vn, !0); try { return vt(() => { r( @@ -774,7 +774,7 @@ class Su { return pr( o, /** @type {Effect} */ - v(this, Ot).parent + v(this, Ft).parent ), null; } finally { V(this, Vn, !1); @@ -783,17 +783,17 @@ class Su { }); } } -it = new WeakMap(), Br = new WeakMap(), Dt = new WeakMap(), Ln = new WeakMap(), Ot = new WeakMap(), dt = new WeakMap(), We = new WeakMap(), Ft = new WeakMap(), en = new WeakMap(), yn = new WeakMap(), qn = new WeakMap(), tn = new WeakMap(), or = new WeakMap(), Vn = new WeakMap(), lr = new WeakMap(), ur = new WeakMap(), nn = new WeakMap(), Di = new WeakMap(), ve = new WeakSet(), po = function() { +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() { try { V(this, dt, vt(() => v(this, Ln).call(this, v(this, it)))); } catch (t) { this.error(t); } }, vo = function() { - const t = v(this, Dt).pending; + 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, () => (ln.ensure(), vt(() => v(this, Ln).call(this, n))))), v(this, tn) > 0 ? be(this, ve, hi).call(this) : (Yn( + 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( /** @type {Effect} */ v(this, We), () => { @@ -809,23 +809,23 @@ it = new WeakMap(), Br = new WeakMap(), Dt = new WeakMap(), Ln = new WeakMap(), */ ci = function(t) { var n = J, r = X, i = lt; - Vt(v(this, Ot)), mt(v(this, Ot)), dr(v(this, Ot).ctx); + zt(v(this, Ft)), mt(v(this, Ft)), dr(v(this, Ft).ctx); try { return t(); } catch (s) { return so(s), null; } finally { - Vt(n), mt(r), dr(i); + zt(n), mt(r), dr(i); } }, hi = function() { const t = ( /** @type {(anchor: Node) => void} */ - v(this, Dt).pending + v(this, Ot).pending ); - v(this, dt) !== null && (V(this, en, document.createDocumentFragment()), v(this, en).append( + v(this, dt) !== null && (V(this, tn, document.createDocumentFragment()), v(this, tn).append( /** @type {TemplateNode} */ v(this, yn) - ), Do(v(this, dt), v(this, en))), v(this, We) === null && V(this, We, vt(() => t(v(this, it)))); + ), Do(v(this, dt), v(this, tn))), v(this, We) === null && V(this, We, vt(() => t(v(this, it)))); }, /** * 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 @@ -837,7 +837,7 @@ ps = function(t) { this.parent && be(n = this.parent, ve, ps).call(n, t); return; } - if (V(this, tn, v(this, tn) + t), v(this, tn) === 0) { + if (V(this, nn, v(this, nn) + t), v(this, nn) === 0) { this.is_pending = !1; for (const r of v(this, lr)) de(r, Se), At(r); @@ -845,7 +845,7 @@ ps = function(t) { 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, en) && (v(this, it).before(v(this, en)), V(this, en, null)); + }), v(this, tn) && (v(this, it).before(v(this, tn)), V(this, tn, null)); } }; function Nu(e, t, n, r) { @@ -864,7 +864,7 @@ function Nu(e, t, n, r) { try { r(h); } catch (d) { - (o.f & on) === 0 && pr(d, o); + (o.f & ln) === 0 && pr(d, o); } a == null || a.deactivate(), vs(); } @@ -880,11 +880,11 @@ function Nu(e, t, n, r) { function ku() { var e = J, t = X, n = lt, r = K; return function(s = !0) { - Vt(e), mt(t), dr(n), s && (r == null || r.activate()); + zt(e), mt(t), dr(n), s && (r == null || r.activate()); }; } function vs() { - Vt(null), mt(null), dr(null); + zt(null), mt(null), dr(null); } // @__NO_SIDE_EFFECTS__ function Bi(e) { @@ -997,7 +997,7 @@ function Pu(e) { function Du(e) { for (var t = e.parent; t !== null; ) { if ((t.f & Re) === 0) - return (t.f & on) === 0 ? ( + return (t.f & ln) === 0 ? ( /** @type {Effect} */ t ) : null; @@ -1007,11 +1007,11 @@ function Du(e) { } function Ds(e) { var t, n = J; - Vt(Du(e)); + zt(Du(e)); try { e.f &= ~Wn, Pu(e), t = qo(e); } finally { - Vt(n); + zt(n); } return t; } @@ -1062,7 +1062,7 @@ function wo(e, t = !1, n = !0) { function he(e, t, n = !1) { X !== 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 | cn | Ms | ua)) !== 0 && (_t === null || !cr.call(_t, e)) && mu(); + (!Et || (X.f & ua) !== 0) && ro() && (X.f & (Re | hn | Ms | ua)) !== 0 && (_t === null || !cr.call(_t, e)) && mu(); let r = n ? Pn(t) : t; return vr(e, r); } @@ -1070,7 +1070,7 @@ function vr(e, t) { if (!e.equals(t)) { var n = e.v; An ? bn.set(e, t) : bn.set(e, n), e.v = t; - var r = ln.ensure(); + var r = un.ensure(); if (r.capture(e, n), (e.f & Re) !== 0) { const i = ( /** @type {Derived} */ @@ -1102,7 +1102,7 @@ function xo(e, t) { s ); Ce == null || Ce.delete(l), (a & Wn) === 0 && (a & gt && (s.f |= Wn), xo(l, Tt)); - } else o && ((a & cn) !== 0 && xt !== null && xt.add( + } else o && ((a & hn) !== 0 && xt !== null && xt.add( /** @type {Effect} */ s ), At( @@ -1255,14 +1255,14 @@ function ot(e = "") { return document.createTextNode(e); } // @__NO_SIDE_EFFECTS__ -function un(e) { +function fn(e) { return ( /** @type {TemplateNode | null} */ $o.call(e) ); } // @__NO_SIDE_EFFECTS__ -function Ht(e) { +function Yt(e) { return ( /** @type {TemplateNode | null} */ Ao.call(e) @@ -1270,8 +1270,8 @@ function Ht(e) { } function Xe(e, t) { if (!j) - return /* @__PURE__ */ un(e); - var n = /* @__PURE__ */ un(W); + return /* @__PURE__ */ fn(e); + var n = /* @__PURE__ */ fn(W); if (n === null) n = W.appendChild(ot()); else if (t && n.nodeType !== Ur) { @@ -1285,8 +1285,8 @@ function Xe(e, t) { } function _n(e, t = !1) { if (!j) { - var n = /* @__PURE__ */ un(e); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Ht(n) : n; + var n = /* @__PURE__ */ fn(e); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ Yt(n) : n; } if (t) { if ((W == null ? void 0 : W.nodeType) !== Ur) { @@ -1304,7 +1304,7 @@ function nt(e, t = 1, n = !1) { let r = j ? W : e; for (var i; t--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ Ht(r); + /* @__PURE__ */ Yt(r); if (!j) return r; if (n) { @@ -1344,11 +1344,11 @@ function Xi(e) { } function Co(e) { var t = X, n = J; - mt(null), Vt(null); + mt(null), zt(null); try { return e(); } finally { - mt(t), Vt(n); + mt(t), zt(n); } } function Iu(e) { @@ -1358,7 +1358,7 @@ function Lu(e, t) { var n = t.last; n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e); } -function Yt(e, t, n) { +function Bt(e, t, n) { var r = J; r !== null && (r.f & at) !== 0 && (e |= at); var i = { @@ -1386,7 +1386,7 @@ function Yt(e, t, n) { else t !== null && At(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 & cn) !== 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 & 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)) { var a = ( /** @type {Derived} */ X @@ -1399,7 +1399,7 @@ function Fs() { return X !== null && !Et; } function qu(e) { - const t = Yt(Li, null, !1); + const t = Bt(Li, null, !1); return de(t, Ae), t.teardown = e, t; } function Is(e) { @@ -1418,18 +1418,18 @@ function Is(e) { return Ro(e); } function Ro(e) { - return Yt(Fr | iu, e, !1); + return Bt(Fr | iu, e, !1); } function Vu(e) { - ln.ensure(); - const t = Yt(En | jn, e, !0); + un.ensure(); + const t = Bt(En | jn, e, !0); return () => { ze(t); }; } function zu(e) { - ln.ensure(); - const t = Yt(En | jn, e, !0); + un.ensure(); + const t = Bt(En | jn, e, !0); return (n = {}) => new Promise((r) => { n.outro ? Yn(t, () => { ze(t), r(void 0); @@ -1437,25 +1437,25 @@ function zu(e) { }); } function So(e) { - return Yt(Fr, e, !1); + return Bt(Fr, e, !1); } function Hu(e) { - return Yt(Ms | jn, e, !0); + return Bt(Ms | jn, e, !0); } function Ls(e, t = 0) { - return Yt(Li | t, e, !0); + return Bt(Li | t, e, !0); } -function Zt(e, t = [], n = [], r = []) { +function Qt(e, t = [], n = [], r = []) { Nu(r, t, n, (i) => { - Yt(Li, () => e(...i.map(x)), !0); + Bt(Li, () => e(...i.map(x)), !0); }); } function qs(e, t = 0) { - var n = Yt(cn | t, e, !0); + var n = Bt(hn | t, e, !0); return n; } function vt(e) { - return Yt(Ct | jn, e, !0); + return Bt(Ct | jn, e, !0); } function No(e) { var t = e.teardown; @@ -1492,7 +1492,7 @@ function ze(e, t = !0) { e.nodes.start, /** @type {TemplateNode} */ e.nodes.end - ), n = !0), Vs(e, t && !n), Ir(e, 0), de(e, on); + ), n = !0), Vs(e, t && !n), Ir(e, 0), de(e, ln); var r = e.nodes && e.nodes.t; if (r !== null) for (const s of r) @@ -1503,7 +1503,7 @@ function ze(e, t = !0) { } function Bu(e, t) { for (; e !== null; ) { - var n = e === t ? null : /* @__PURE__ */ Ht(e); + var n = e === t ? null : /* @__PURE__ */ Yt(e); e.remove(), e = n; } } @@ -1535,7 +1535,7 @@ function Mo(e, t, n) { var s = i.next, a = (i.f & hr) !== 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 & cn) !== 0; + (i.f & Ct) !== 0 && (e.f & hn) !== 0; Mo(i, t, a ? n : !1), i = s; } } @@ -1559,7 +1559,7 @@ function Po(e, t) { function Do(e, t) { if (e.nodes) for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) { - var i = n === r ? null : /* @__PURE__ */ Ht(n); + var i = n === r ? null : /* @__PURE__ */ Yt(n); t.append(n), n = i; } } @@ -1572,7 +1572,7 @@ function mt(e) { X = e; } let J = null; -function Vt(e) { +function zt(e) { J = e; } let _t = null; @@ -1710,12 +1710,12 @@ function Ir(e, t) { } function gr(e) { var t = e.f; - if ((t & on) === 0) { + if ((t & ln) === 0) { de(e, Ae); var n = J, r = di; J = e, di = !0; try { - (t & (cn | ja)) !== 0 ? Yu(e) : Vs(e), No(e); + (t & (hn | ja)) !== 0 ? Yu(e) : Vs(e), No(e); var i = qo(e); e.teardown = typeof i == "function" ? i : null, e.wv = Fo; var s; @@ -1728,7 +1728,7 @@ function gr(e) { function x(e) { var t = e.f, n = (t & Re) !== 0; if (X !== null && !Et) { - var r = J !== null && (J.f & on) !== 0; + 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) @@ -1830,7 +1830,7 @@ function va(e) { } }); var f = X, p = J; - mt(null), Vt(null); + mt(null), zt(null); try { for (var h, d = []; s !== null; ) { var y = s.assignedSlot || s.parentNode || /** @type {any} */ @@ -1856,7 +1856,7 @@ function va(e) { throw h; } } finally { - e.__root = t, delete e.currentTarget, mt(f), Vt(p); + e.__root = t, delete e.currentTarget, mt(f), zt(p); } } } @@ -1886,13 +1886,13 @@ function $n(e, t) { n.nodes === null && (n.nodes = { start: e, end: t, a: null, t: null }); } // @__NO_SIDE_EFFECTS__ -function Bt(e, t) { +function Xt(e, t) { var n = (t & Kl) !== 0, r = (t & jl) !== 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__ */ un(i))); + /* @__PURE__ */ fn(i))); var a = ( /** @type {TemplateNode} */ r || bo ? document.importNode(i, !0) : i.cloneNode(!0) @@ -1900,7 +1900,7 @@ function Bt(e, t) { if (n) { var o = ( /** @type {TemplateNode} */ - /* @__PURE__ */ un(a) + /* @__PURE__ */ fn(a) ), l = ( /** @type {TemplateNode} */ a.lastChild @@ -1923,10 +1923,10 @@ function Ku(e, t, n = "svg") { Yo(i, !0) ), o = ( /** @type {Element} */ - /* @__PURE__ */ un(a) + /* @__PURE__ */ fn(a) ); s = /** @type {Element} */ - /* @__PURE__ */ un(o); + /* @__PURE__ */ fn(o); } var l = ( /** @type {TemplateNode} */ @@ -1979,25 +1979,25 @@ function Qu(e, t) { _s(), t.intro = t.intro ?? !1; const n = t.target, r = j, i = W; try { - for (var s = /* @__PURE__ */ un(n); s && (s.nodeType !== wr || /** @type {Comment} */ + for (var s = /* @__PURE__ */ fn(n); s && (s.nodeType !== wr || /** @type {Comment} */ s.data !== Ns); ) - s = /* @__PURE__ */ Ht(s); + s = /* @__PURE__ */ Yt(s); if (!s) throw fr; - an(!0), Ve( + on(!0), Ve( /** @type {Comment} */ s ); const a = Xo(e, { ...t, anchor: s }); - return an(!1), /** @type {Exports} */ + return on(!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), an(!1), Bo(e, t); + return a !== fr && console.warn("Failed to hydrate: ", a), t.recover === !1 && pu(), _s(), Eo(n), on(!1), Bo(e, t); } finally { - an(r), Ve(i); + on(r), Ve(i); } } const ii = /* @__PURE__ */ new Map(); @@ -2066,7 +2066,7 @@ function ef(e, t) { const n = ys.get(e); return n ? (ys.delete(e), n(t)) : Promise.resolve(); } -var bt, It, st, zn, Xr, Wr, Oi; +var bt, Lt, st, zn, Xr, Wr, Oi; class tf { /** * @param {TemplateNode} anchor @@ -2091,7 +2091,7 @@ class tf { * Can result in the entries `true->Effect` and `false->Effect` * @type {Map} */ - H(this, It, /* @__PURE__ */ new Map()); + H(this, Lt, /* @__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. @@ -2117,12 +2117,12 @@ class tf { var n = ( /** @type {Key} */ v(this, bt).get(t) - ), r = v(this, It).get(n); + ), r = v(this, Lt).get(n); if (r) zs(r), v(this, zn).delete(n); else { var i = v(this, st).get(n); - i && (v(this, It).set(n, i.effect), v(this, st).delete(n), i.fragment.lastChild.remove(), this.anchor.before(i.fragment), r = i.effect); + 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); } for (const [s, a] of v(this, bt)) { if (v(this, bt).delete(s), s === t) @@ -2130,7 +2130,7 @@ class tf { const o = v(this, st).get(a); o && (ze(o.effect), v(this, st).delete(a)); } - for (const [s, a] of v(this, It)) { + for (const [s, a] of v(this, Lt)) { if (s === n || v(this, zn).has(s)) continue; const o = () => { if (Array.from(v(this, bt).values()).includes(s)) { @@ -2138,7 +2138,7 @@ class tf { Do(a, u), u.append(ot()), v(this, st).set(s, { effect: a, fragment: u }); } else ze(a); - v(this, zn).delete(s), v(this, It).delete(s); + v(this, zn).delete(s), v(this, Lt).delete(s); }; v(this, Xr) || !r ? (v(this, zn).add(s), Yn(a, o, !1)) : o(); } @@ -2165,7 +2165,7 @@ class tf { /** @type {Batch} */ K ), i = To(); - if (n && !v(this, It).has(t) && !v(this, st).has(t)) + if (n && !v(this, Lt).has(t) && !v(this, st).has(t)) if (i) { var s = document.createDocumentFragment(), a = ot(); s.append(a), v(this, st).set(t, { @@ -2173,12 +2173,12 @@ class tf { fragment: s }); } else - v(this, It).set( + v(this, Lt).set( t, vt(() => n(this.anchor)) ); if (v(this, bt).set(r, t), i) { - for (const [o, l] of v(this, It)) + for (const [o, l] of v(this, Lt)) o === t ? r.unskip_effect(l) : r.skip_effect(l); for (const [o, l] of v(this, st)) o === t ? r.unskip_effect(l.effect) : r.skip_effect(l.effect); @@ -2187,7 +2187,7 @@ class tf { j && (this.anchor = W), v(this, Wr).call(this); } } -bt = new WeakMap(), It = new WeakMap(), st = new WeakMap(), zn = new WeakMap(), Xr = new WeakMap(), Wr = new WeakMap(), Oi = new WeakMap(); +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); @@ -2206,7 +2206,7 @@ function er(e, t, n = !1) { 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, an(!1), r.ensure(a, o), an(!0); + Ve(u), r.anchor = u, on(!1), r.ensure(a, o), on(!0); return; } } @@ -2273,7 +2273,7 @@ function vi(e, t, n, r, i, s = null) { /** @type {Element} */ e ); - a = j ? Ve(/* @__PURE__ */ un(u)) : u.appendChild(ot()); + a = j ? Ve(/* @__PURE__ */ fn(u)) : u.appendChild(ot()); } j && Vi(); var f = null, p = /* @__PURE__ */ go(() => { @@ -2281,7 +2281,7 @@ function vi(e, t, n, r, i, s = null) { 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 & sn) === 0 ? zs(f) : (f.f ^= sn, Sr(f, null, a)) : Yn(f, () => { + 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, () => { f = null; })); } @@ -2292,7 +2292,7 @@ function vi(e, t, n, r, i, s = null) { let D = !1; if (j) { var M = eo(a) === Fi; - M !== ($ === 0) && (a = Ei(), Ve(a), an(!1), D = !0); + M !== ($ === 0) && (a = Ei(), Ve(a), on(!1), D = !0); } for (var S = /* @__PURE__ */ new Set(), I = ( /** @type {Batch} */ @@ -2300,7 +2300,7 @@ function vi(e, t, n, r, i, s = null) { ), L = To(), U = 0; U < $; U += 1) { j && W.nodeType === wr && /** @type {Comment} */ W.data === ks && (a = /** @type {Comment} */ - W, D = !0, an(!1)); + 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( o, @@ -2311,9 +2311,9 @@ function vi(e, t, n, r, i, s = null) { i, t, n - ), d || (G.e.f |= sn), o.set(Q, G)), S.add(Q); + ), d || (G.e.f |= an), o.set(Q, G)), S.add(Q); } - if ($ === 0 && s && !f && (d ? f = vt(() => s(a)) : (f = vt(() => s(_a ?? (_a = ot()))), f.f |= sn)), $ > S.size && uu(), j && $ > 0 && Ve(Ei()), !d) + 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); @@ -2321,7 +2321,7 @@ function vi(e, t, n, r, i, s = null) { }); } else y(); - D && an(!0), x(p); + D && on(!0), x(p); }), m = { effect: b, items: o, outrogroups: null, fallback: f }; d = !1, j && (a = W); } @@ -2336,14 +2336,14 @@ function sf(e, t, n, r, i) { if (s) for ($ = 0; $ < a; $ += 1) y = t[$], b = i(y, $), m = /** @type {EachItem} */ - o.get(b).e, (m.f & sn) === 0 && ((oe = (G = m.nodes) == null ? void 0 : G.a) == null || oe.measure(), (p ?? (p = /* @__PURE__ */ new Set())).add(m)); + 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 & sn) !== 0) - if (m.f ^= sn, m === l) + if ((m.f & an) !== 0) + if (m.f ^= an, m === l) Sr(m, null, n); else { var D = f ? f.next : l; @@ -2370,7 +2370,7 @@ function sf(e, t, n, r, i) { if (l === null) continue; } - (m.f & sn) === 0 && h.push(m), f = m, l = Cr(m.next); + (m.f & an) === 0 && h.push(m), f = m, l = Cr(m.next); } if (e.outrogroups !== null) { for (const te of e.outrogroups) @@ -2415,13 +2415,13 @@ function af(e, t, n, r, i, s, a, o) { } function Sr(e, t, n) { if (e.nodes) - for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & sn) === 0 ? ( + for (var r = e.nodes.start, i = e.nodes.end, s = t && (t.f & an) === 0 ? ( /** @type {EffectNodes} */ t.nodes.start ) : n; r !== null; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Ht(r) + /* @__PURE__ */ Yt(r) ); if (s.before(r), r === i) return; @@ -2614,14 +2614,14 @@ function se(e, t, n, r) { const I = S ? x(m) : i ? Pn(M) : M; return he(m, I), b = !0, a !== void 0 && (a = I), M; } - return An && b || ($.f & on) !== 0 ? m.v : x(m); + return An && b || ($.f & ln) !== 0 ? m.v : x(m); }) ); } function vf(e) { return new gf(e); } -var rn, pt; +var sn, pt; class gf { /** * @param {ComponentConstructorOptions & { @@ -2630,7 +2630,7 @@ class gf { */ constructor(t) { /** @type {any} */ - H(this, rn); + H(this, sn); /** @type {Record} */ H(this, pt); var s; @@ -2659,7 +2659,7 @@ class gf { 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, rn, i.$$events); + })), (!((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, { get() { @@ -2688,10 +2688,10 @@ class gf { * @returns {any} */ $on(t, n) { - v(this, rn)[t] = v(this, rn)[t] || []; + v(this, sn)[t] = v(this, sn)[t] || []; const r = (...i) => n.call(this, ...i); - return v(this, rn)[t].push(r), () => { - v(this, rn)[t] = v(this, rn)[t].filter( + return v(this, sn)[t].push(r), () => { + v(this, sn)[t] = v(this, sn)[t].filter( /** @param {any} fn */ (i) => i !== r ); @@ -2701,7 +2701,7 @@ class gf { v(this, pt).$destroy(); } } -rn = new WeakMap(), pt = new WeakMap(); +sn = new WeakMap(), pt = new WeakMap(); let Wo; typeof HTMLElement == "function" && (Wo = class extends HTMLElement { /** @@ -3558,7 +3558,7 @@ function al(e, t) { } function Kr() { } -var Lr = 0.7, Ci = 1 / Lr, nr = "\\s*([+-]?\\d+)\\s*", qr = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", qt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Qc = /^#([0-9a-f]{3,8})$/, eh = new RegExp(`^rgb\\(${nr},${nr},${nr}\\)$`), th = new RegExp(`^rgb\\(${qt},${qt},${qt}\\)$`), nh = new RegExp(`^rgba\\(${nr},${nr},${nr},${qr}\\)$`), rh = new RegExp(`^rgba\\(${qt},${qt},${qt},${qr}\\)$`), ih = new RegExp(`^hsl\\(${qr},${qt},${qt}\\)$`), sh = new RegExp(`^hsla\\(${qr},${qt},${qt},${qr}\\)$`), Ta = { +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 = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -3892,7 +3892,7 @@ function vh(e) { } function gh(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] = Jt(e[a], t[a]); + for (a = 0; a < r; ++a) i[a] = Zt(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); @@ -3905,7 +3905,7 @@ function _h(e, t) { return n.setTime(e * (1 - r) + t * r), n; }; } -function Lt(e, t) { +function qt(e, t) { return e = +e, t = +t, function(n) { return e * (1 - n) + t * n; }; @@ -3914,7 +3914,7 @@ function mh(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] = Jt(e[i], t[i]) : r[i] = t[i]; + i in e ? n[i] = Zt(e[i], t[i]) : r[i] = t[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; @@ -3934,15 +3934,15 @@ function wh(e) { function ul(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: Lt(r, i) })), n = is.lastIndex; + (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); return o.join(""); }); } -function Jt(e, t) { +function Zt(e, t) { var n = typeof t, r; - return t == null || n === "boolean" ? Us(t) : (n === "number" ? Lt : 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 : Lt)(e, t); + 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); } var Da = 180 / Math.PI, As = { translateX: 0, @@ -3978,19 +3978,19 @@ function cl(e, t, n, r) { 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: Lt(u, p) }, { i: b - 2, x: Lt(f, h) }); + 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 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: Lt(u, f) })) : f && p.push(i(p) + "rotate(" + f + r); + 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 o(u, f, p, h) { - u !== f ? h.push({ i: p.push(i(p) + "skewX(", null, r) - 2, x: Lt(u, f) }) : f && p.push(i(p) + "skewX(" + f + r); + 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 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: Lt(u, p) }, { i: b - 2, x: Lt(f, h) }); + 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 + ")"); } return function(u, f) { @@ -4089,7 +4089,7 @@ function Ks(e, t) { if (n.state > vl) throw new Error("too late; already scheduled"); return n; } -function Xt(e, t) { +function Wt(e, t) { var n = Rt(e, t); if (n.state > yi) throw new Error("too late; already running"); return n; @@ -4154,7 +4154,7 @@ function Ph(e) { function Dh(e, t) { var n, r; return function() { - var i = Xt(this, e), s = i.tween; + var i = Wt(this, e), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, o = r.length; a < o; ++a) @@ -4170,7 +4170,7 @@ function Oh(e, t, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Xt(this, e), a = s.tween; + var s = Wt(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) @@ -4196,7 +4196,7 @@ function Fh(e, t) { function js(e, t, n) { var r = e._id; return e.each(function() { - var i = Xt(this, r); + var i = Wt(this, r); (i.value || (i.value = {}))[t] = n.apply(this, arguments); }), function(i) { return Rt(i, r).value[t]; @@ -4204,7 +4204,7 @@ function js(e, t, n) { } function gl(e, t) { var n; - return (typeof t == "number" ? Lt : t instanceof Gn ? Si : (n = Gn(t)) ? (t = n, Si) : ul)(e, t); + return (typeof t == "number" ? qt : t instanceof Gn ? Si : (n = Gn(t)) ? (t = n, Si) : ul)(e, t); } function Ih(e) { return function() { @@ -4298,12 +4298,12 @@ function Jh(e) { } function Zh(e, t) { return function() { - Xt(this, e).duration = +t.apply(this, arguments); + Wt(this, e).duration = +t.apply(this, arguments); }; } function Qh(e, t) { return t = +t, function() { - Xt(this, e).duration = t; + Wt(this, e).duration = t; }; } function ed(e) { @@ -4313,7 +4313,7 @@ function ed(e) { function td(e, t) { if (typeof t != "function") throw new Error(); return function() { - Xt(this, e).ease = t; + Wt(this, e).ease = t; }; } function nd(e) { @@ -4324,7 +4324,7 @@ function rd(e, t) { return function() { var n = t.apply(this, arguments); if (typeof n != "function") throw new Error(); - Xt(this, e).ease = n; + Wt(this, e).ease = n; }; } function id(e) { @@ -4336,7 +4336,7 @@ function sd(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 fn(r, this._parents, this._name, this._id); + return new cn(r, this._parents, this._name, this._id); } function ad(e) { if (e._id !== this._id) throw new Error(); @@ -4345,7 +4345,7 @@ function ad(e) { (h = l[d] || u[d]) && (p[d] = h); for (; o < r; ++o) a[o] = t[o]; - return new fn(a, this._parents, this._name, this._id); + return new cn(a, this._parents, this._name, this._id); } function od(e) { return (e + "").trim().split(/^|\s+/).every(function(t) { @@ -4354,7 +4354,7 @@ function od(e) { }); } function ld(e, t, n) { - var r, i, s = od(t) ? Ks : Xt; + var r, i, s = od(t) ? Ks : Wt; return function() { var a = s(this, e), o = a.on; o !== r && (i = (r = o).copy()).on(t, n), a.on = i; @@ -4380,7 +4380,7 @@ function hd(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 fn(s, this._parents, t, n); + return new cn(s, this._parents, t, n); } function dd(e) { var t = this._name, n = this._id; @@ -4392,7 +4392,7 @@ function dd(e) { (d = h[b]) && Ki(d, t, n, b, h, y); s.push(h), a.push(f); } - return new fn(s, a, t, n); + return new cn(s, a, t, n); } var pd = xr.prototype.constructor; function vd() { @@ -4427,7 +4427,7 @@ function md(e, t, n) { function yd(e, t) { var n, r, i, s = "style." + t, a = "end." + s, o; return function() { - var l = Xt(this, e), u = l.on, f = l.value[s] == null ? o || (o = _l(t)) : void 0; + var l = Wt(this, e), u = l.on, f = l.value[s] == null ? o || (o = _l(t)) : void 0; (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; }; } @@ -4501,7 +4501,7 @@ function Nd() { ease: f.ease }); } - return new fn(r, this._parents, e, n); + return new cn(r, this._parents, e, n); } function kd() { var e, t, n = this, r = n._id, i = n.size(); @@ -4510,13 +4510,13 @@ function kd() { --i === 0 && s(); } }; n.each(function() { - var u = Xt(this, r), f = u.on; + var u = Wt(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 fn(e, t, n, r) { +function cn(e, t, n, r) { this._groups = e, this._parents = t, this._name = n, this._id = r; } function xi(e) { @@ -4525,23 +4525,23 @@ function xi(e) { function ml() { return ++Md; } -var jt = xr.prototype; -fn.prototype = xi.prototype = { - constructor: fn, +var Jt = xr.prototype; +cn.prototype = xi.prototype = { + constructor: cn, select: hd, selectAll: dd, - selectChild: jt.selectChild, - selectChildren: jt.selectChildren, + 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, + call: Jt.call, + nodes: Jt.nodes, + node: Jt.node, + size: Jt.size, + empty: Jt.empty, + each: Jt.each, on: ud, attr: Yh, attrTween: Gh, @@ -4556,7 +4556,7 @@ fn.prototype = xi.prototype = { ease: nd, easeVarying: id, end: kd, - [Symbol.iterator]: jt[Symbol.iterator] + [Symbol.iterator]: Jt[Symbol.iterator] }; function Pd(e) { return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2; @@ -4576,11 +4576,11 @@ function Od(e, t) { } function Fd(e) { var t, n; - e instanceof fn ? (t = e._id, e = e._name) : (t = ml(), (n = Dd).time = Gs(), e = e == null ? null : e + ""); + e instanceof cn ? (t = e._id, e = e._name) : (t = ml(), (n = Dd).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 fn(r, this._parents, e, t); + return new cn(r, this._parents, e, t); } xr.prototype.interrupt = Ph; xr.prototype.transition = Fd; @@ -4655,7 +4655,7 @@ function qe(e) { return e; }; } -const qa = Math.abs, De = Math.atan2, Sn = Math.cos, Hd = Math.max, ss = Math.min, Pt = Math.sin, tr = Math.sqrt, Be = 1e-12, zr = Math.PI, Pi = zr / 2, bi = 2 * zr; +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); } @@ -4713,20 +4713,20 @@ function wt() { 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 * Pt(y)), o.arc(0, 0, d, y, b, !$), h > Be && (o.moveTo(h * Sn(b), h * Pt(b)), o.arc(0, 0, h, b, y, $)); + 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, $)); 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 * Pt(ae)), ft = Va(Q / d * Pt(ae)); + 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 me = d * Sn(D), ye = d * Pt(D), te = h * Sn(I), ke = h * Pt(I); + 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 * Pt(M), St = h * Sn(S), ie = h * Pt(S), Je; + 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 / Pt(Yd((yt * Tn + Ze * ge) / (tr(yt * yt + Ze * Ze) * tr(Tn * Tn + ge * ge))) / 2), Wt = tr(Je[0] * Je[0] + Je[1] * Je[1]); - oe = ss(G, (h - Wt) / (Nt - 1)), ue = ss(G, (d - Wt) / (Nt + 1)); + 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)); } else oe = ue = 0; } @@ -4736,7 +4736,7 @@ function wt() { } 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, Pt(p) * f]; + return [Sn(p) * f, Dt(p) * f]; }, u.innerRadius = function(f) { return arguments.length ? (e = typeof f == "function" ? f : qe(+f), u) : e; }, u.outerRadius = function(f) { @@ -4880,7 +4880,7 @@ function wl(e, t) { ); }); function Tn(c) { - const g = Ut(c); + const g = Gt(c); return ke = Jn(c), g; } function ge() { @@ -4889,7 +4889,7 @@ function wl(e, t) { function Nt() { return ge() * 1.41; } - function Wt(c) { + function Ut(c) { let g = 0; for (let _ = 1; _ < c; _++) { const A = n().results[_ - 1].tallyResults; @@ -4904,7 +4904,7 @@ function wl(e, t) { return g; } function jr(c, g) { - if (c === "exhausted") return Wt(g); + if (c === "exhausted") return Ut(g); { const _ = n().results[g - 1].tally; return Number(_[c]); @@ -4924,14 +4924,14 @@ function wl(e, t) { _ += Number(E); return _; } - function hn(c) { + function kt(c) { return c === "exhausted" || c === "Inactive Ballots"; } function ji(c) { const g = n().results[c - 1].tally; let _ = 0; for (let [A, E] of Object.entries(g)) - hn(A) || (_ += Number(E)); + kt(A) || (_ += Number(E)); return _; } function Qr(c, g) { @@ -4972,7 +4972,7 @@ function wl(e, t) { return g.length > 0 && g.some((_) => Object.keys(_.transfers).length > 0); } function ee(c, g) { - c.some((_) => hn(_.label)) || c.push({ label: "exhausted", value: Wt(g) }); + c.some((_) => kt(_.label)) || c.push({ label: "exhausted", value: Ut(g) }); } function pe(c) { let g = c | 0; @@ -4999,16 +4999,16 @@ function wl(e, t) { return A; } function Fe() { - const c = Object.keys(n().results[0].tally); - return h() ? le(c) : c; + 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 Ut(c) { + 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 kt(c) { + function Mt(c) { const g = n().results[c - 1].tally, _ = []; for (const A of Fe()) _.push({ label: A, value: Number(g[A] ?? 0) }); @@ -5065,14 +5065,14 @@ function wl(e, t) { } function ct() { if (tt.length === 0) { - _e !== r() && (r() === _e + 1 && _e > 0 && r() <= n().results.length ? (_e = r(), Mt(r())) : r() >= 1 && r() <= n().results.length && (_e = r(), d(0), Ze(r()))); + _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()))); return; } const c = tt.shift(); switch (c.type) { case "round": { const g = c.round; - g === _e + 1 && _e > 0 && g <= n().results.length ? (_e = g, Mt(g)) : (g !== _e && g >= 1 && g <= n().results.length && (_e = g, d(0), Ze(g)), ct()); + 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()); break; } case "step": @@ -5080,7 +5080,7 @@ function wl(e, t) { break; } } - function Mt(c) { + function Pt(c) { if (c <= 1 || c > n().results.length) { ct(); return; @@ -5127,17 +5127,17 @@ function wl(e, t) { tt.push({ type: "round", round: r() }); return; } - _e == r() - 1 && _e > 0 ? Kt() : Gt(r()), _e = r(); + _e == r() - 1 && _e > 0 ? jt() : Kt(r()), _e = r(); } } - function Gt(c) { + function Kt(c) { if (xe) { tt.push({ type: "round", round: c }); return; } d(0), Ze(c); } - function Kt() { + function jt() { if (xe) { tt.push({ type: "round", round: r() }); return; @@ -5182,7 +5182,7 @@ function wl(e, t) { })) : (xe = !1, console.warn("displayPhase out of range at ", d())); } function bl(c) { - te = kt(c), me = na(c, S, te, 0, ge(), !0), na(c, I, te, 0, ge(), !1, !0); + 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 = {}; @@ -5210,7 +5210,7 @@ function wl(e, t) { Z = Il + Ll, Ye = Z + R; } else Z = k, Ye = C; - const ne = Jt(k, Z), Ee = Jt(C, Ye), ni = Jt(g, c), Tr = wt(); + 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); }; @@ -5329,7 +5329,7 @@ function wl(e, t) { 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() && hn(k.data.label) ? Ye = Z : Ye = Z + " (" + Zr(k.data.label, c) + ")"; + !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(); @@ -5352,7 +5352,7 @@ function wl(e, t) { 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() && hn(C.data.label) ? R : R + " (" + Zr(C.data.label, c) + ")"; + return !p() && kt(C.data.label) ? R : R + " (" + Zr(C.data.label, c) + ")"; }); }); } @@ -5399,12 +5399,12 @@ function wl(e, t) { 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 = Jt(g, c); + const q = Zt(g, c); return function(N) { return P.innerRadius(q(N)), P(z); }; }).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 = Jt(g, c); + const q = Zt(g, c); return function(N) { return T.outerRadius(q(N)), T(z); }; @@ -5443,7 +5443,7 @@ function wl(e, t) { R--, R <= 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 = Jt(Ye, Z.startAngle), ni = Jt(ne, Z.endAngle); + 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(); @@ -5464,7 +5464,7 @@ function wl(e, t) { var Fl = { pieColors: Oe, exhaustedLabel: St, - countExhaustedVotes: Wt, + countExhaustedVotes: Ut, getEliminatedCandidates: dn, getElectedCandidates: br, runFullAnimationFn: Zn, @@ -5573,7 +5573,7 @@ Ys( ], { mode: "open" } ); -var np = /* @__PURE__ */ Bt("
"), rp = /* @__PURE__ */ Bt('
', 1), ip = /* @__PURE__ */ Bt('
'); +var np = /* @__PURE__ */ Xt("
"), rp = /* @__PURE__ */ Xt('
', 1), ip = /* @__PURE__ */ Xt('
'); const sp = { 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;}" @@ -5622,7 +5622,7 @@ function xl(e, t) { var m = (U) => { var ae = np(); let Q; - Zt(() => Q = si(ae, 1, "connector svelte-1l4eyw0", null, Q, { completed: !i() && d <= r() })), Ue(U, ae); + Qt(() => Q = si(ae, 1, "connector svelte-1l4eyw0", null, Q, { completed: !i() && d <= r() })), Ue(U, ae); }; er(b, (U) => { d > 0 && U(m); @@ -5633,7 +5633,7 @@ function xl(e, t) { var S = nt(D, 2); let I; var L = Xe(S, !0); - Le(S), Le($), Zt(() => { + Le(S), Le($), Qt(() => { M = si(D, 1, "dot svelte-1l4eyw0", null, M, { active: !i() && d === r(), completed: !i() && d < r() @@ -5642,13 +5642,13 @@ function xl(e, t) { completed: !i() && d < r() }), mn(L, x(h)); }), Ue(p, y); - }), Le(u), Zt(() => { + }), 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__ */ Bt(" ", 1), op = /* @__PURE__ */ Bt("About to eliminate: ", 1), lp = /* @__PURE__ */ Bt(" ", 1), up = /* @__PURE__ */ Bt(" ", 1), fp = /* @__PURE__ */ Bt('

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


these ballots have already been eliminated.
', 1); +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 = { 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;} @@ -5703,8 +5703,8 @@ function pp(e, t) { 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, Ut = ee + 20; - Fe + le.width > window.innerWidth - 12 && (Fe = window.innerWidth - le.width - 12), Fe < 12 && (Fe = 12), Ut + le.height > window.innerHeight - 12 && (Ut = ee - le.height - 12), w.style.left = Fe + "px", w.style.top = Ut + "px"; + 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 G() { @@ -5741,10 +5741,10 @@ function pp(e, t) { 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, Ut = ye(le); - for (let kt = 0; kt < Fe.length; kt++) { - const Cn = Fe[kt].transfers, pn = Fe[kt].eliminated, He = Fe[kt].elected; - if (!Ut) { + 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) { 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)) @@ -5875,7 +5875,7 @@ function pp(e, t) { }); } Le(Ze); - var ge = nt(Ze, 4), Nt = Xe(ge), Wt = Xe(Nt), jr = Xe(Wt); + var ge = nt(Ze, 4), Nt = Xe(ge), Ut = Xe(Nt), jr = Xe(Ut); gi( wl(jr, { get jsonData() { @@ -5930,7 +5930,7 @@ function pp(e, t) { }), (w) => F = w, () => F - ), Le(Wt), Le(Nt); + ), Le(Ut), Le(Nt); var Jr = nt(Nt, 2); { var Zr = (w) => { @@ -5942,78 +5942,78 @@ function pp(e, t) { var Qe = op(), Me = nt(_n(Qe)); vi(Me, 17, () => te(i()), pi, (et, xe, tt) => { var Ie = ap(), ct = _n(Ie); - let Mt; + let Pt; var Zn = Xe(ct, !0); Le(ct); var Rn = nt(ct, 2); { - var _e = (Gt) => { - var Kt = ga(", "); - Ue(Gt, Kt); + var _e = (Kt) => { + var jt = ga(", "); + Ue(Kt, jt); }, $r = /* @__PURE__ */ vn(() => tt < te(i()).length - 1); - er(Rn, (Gt) => { - x($r) && Gt(_e); + er(Rn, (Kt) => { + x($r) && Kt(_e); }); } - Zt( - (Gt) => { - Mt = wa(ct, "", Mt, Gt), mn(Zn, x(xe)); + Qt( + (Kt) => { + Pt = wa(ct, "", Pt, Kt), mn(Zn, x(xe)); }, [() => ({ color: ie()[x(xe)] })] ), Ue(et, Ie); }), Ue(He, Qe); - }, Ut = /* @__PURE__ */ vn(() => te(i()).length > 0); + }, Gt = /* @__PURE__ */ vn(() => te(i()).length > 0); er(le, (He) => { - x(Ut) && He(Fe); + x(Gt) && He(Fe); }); } - var kt = nt(le, 2); + var Mt = nt(le, 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(), Mt = _n(ct); + var ct = lp(), Pt = _n(ct); let Zn; - var Rn = Xe(Mt, !0); - Le(Mt); - var _e = nt(Mt, 2); + var Rn = Xe(Pt, !0); + Le(Pt); + var _e = nt(Pt, 2); { - var $r = (Kt) => { + var $r = (jt) => { var ei = ga(", "); - Ue(Kt, ei); - }, Gt = /* @__PURE__ */ vn(() => Ie < ke(i()).length - 1); - er(_e, (Kt) => { - x(Gt) && Kt($r); + Ue(jt, ei); + }, Kt = /* @__PURE__ */ vn(() => Ie < ke(i()).length - 1); + er(_e, (jt) => { + x(Kt) && jt($r); }); } - Zt( - (Kt) => { - Zn = wa(Mt, "", Zn, Kt), mn(Rn, x(tt)); + Qt( + (jt) => { + Zn = wa(Pt, "", Zn, jt), mn(Rn, x(tt)); }, [() => ({ color: ie()[x(tt)] })] ), Ue(xe, ct); - }), Zt(() => mn(Me, `${x(d).caption ?? ""}: `)), Ue(He, Qe); + }), Qt(() => mn(Me, `${x(d).caption ?? ""}: `)), Ue(He, Qe); }, pn = /* @__PURE__ */ vn(() => ke(i()).length > 0); - er(kt, (He) => { + er(Mt, (He) => { x(pn) && He(Cn); }); } - Le(we), Zt((He) => mn(pe, `${x(L).config.contest ?? ""}, ${He ?? ""} ${x(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ue(w, B); + Le(we), Qt((He) => mn(pe, `${x(L).config.contest ?? ""}, ${He ?? ""} ${x(d).infinitive ?? ""}, Round ${i() ?? ""}.`), [O]), Ue(w, B); }; er(Jr, (w) => { p() && w(Zr); }); } Le(ge); - var Jn = nt(ge, 2), hn = Xe(Jn), ji = Xe(hn, !0); - Le(hn); - var Qr = nt(hn, 2); + 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), Zt(() => mn(we, x(B))), Ue(w, ee); + 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)), Zt( + return us(2), Le(dn), gi(dn, (w) => he(b, w), () => x(b)), Qt( (w) => { mn(ji, x(m)), mn(br, `"${w ?? ""}" means all the candidates ranked on `); },