From 216b5062e71cc67fc95a11984b0d315334fd831e Mon Sep 17 00:00:00 2001 From: Armin Samii Date: Tue, 11 Mar 2025 08:46:44 -0400 Subject: [PATCH 01/18] boilerplate code for pie chart --- static/pie/pie.css | 5 ++++ static/pie/pie.js | 1 + static/visualizer/tabicons/pie.png | Bin 0 -> 2319 bytes templates/pie/pie-nonblocking.html | 10 +++++++ templates/pie/pie.html | 5 ++++ templates/visualizer/visualize-embedded.html | 4 +++ templates/visualizer/visualize.html | 29 +++++++++++++------ 7 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 static/pie/pie.css create mode 100644 static/pie/pie.js 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/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/pie/pie.js b/static/pie/pie.js new file mode 100644 index 00000000..d5591bcb --- /dev/null +++ b/static/pie/pie.js @@ -0,0 +1 @@ +/** TODO - SHEL -- Pie JS goes here **/ 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 +{% endcompress %} + +{% compress js file %} + +{% endcompress %} diff --git a/templates/pie/pie.html b/templates/pie/pie.html new file mode 100644 index 00000000..10c3b9ef --- /dev/null +++ b/templates/pie/pie.html @@ -0,0 +1,5 @@ +
+ + + Pie chart goes here +
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 c49958d1..9820c819 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" %}
@@ -153,6 +163,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" %} From 4b5111e7b0f59752e4b365454e8aedd66fb0aeda Mon Sep 17 00:00:00 2001 From: skaphan Date: Tue, 11 Mar 2025 16:40:02 -0700 Subject: [PATCH 02/18] First try at adding pie-chart. --- static/pie/pie.js | 5176 +++++++++++++++++++++++++++- templates/pie/pie-nonblocking.html | 2 +- templates/pie/pie.html | 4 + 3 files changed, 5180 insertions(+), 2 deletions(-) diff --git a/static/pie/pie.js b/static/pie/pie.js index d5591bcb..9c22ad11 100644 --- a/static/pie/pie.js +++ b/static/pie/pie.js @@ -1 +1,5175 @@ -/** TODO - SHEL -- Pie JS goes here **/ +var Ma = Object.defineProperty; +var $i = (t) => { + throw TypeError(t); +}; +var Oa = (t, e, n) => e in t ? Ma(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var Yt = (t, e, n) => Oa(t, typeof e != "symbol" ? e + "" : e, n), Ai = (t, e, n) => e.has(t) || $i("Cannot " + n); +var Ct = (t, e, n) => (Ai(t, e, "read from private field"), n ? n.call(t) : e.get(t)), kr = (t, e, n) => e.has(t) ? $i("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), Er = (t, e, n, r) => (Ai(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); +const Pa = "5"; +typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Pa); +const Jr = 1, Zr = 2, ns = 4, Da = 8, Ia = 16, Fa = 1, La = 4, qa = 8, Va = 16, Ha = 1, za = 2, Ba = 4, Ya = 1, Ua = 2, rs = "[", jr = "[!", Qr = "]", an = {}, Mt = Symbol(), ki = !1, Wt = 2, is = 4, or = 8, lr = 16, _e = 32, We = 64, Fn = 128, zt = 256, Ln = 512, Tt = 1024, me = 2048, Ke = 4096, he = 8192, ur = 16384, ss = 32768, fr = 65536, Xa = 1 << 19, as = 1 << 20, on = Symbol("$state"), os = Symbol("legacy props"), Ga = Symbol(""); +var ti = Array.isArray, Wa = Array.prototype.indexOf, ei = Array.from, qn = Object.keys, Vn = Object.defineProperty, Se = Object.getOwnPropertyDescriptor, Ka = Object.getOwnPropertyDescriptors, Ja = Object.prototype, Za = Array.prototype, ls = Object.getPrototypeOf; +function ja(t) { + return typeof t == "function"; +} +const je = () => { +}; +function us(t) { + for (var e = 0; e < t.length; e++) + t[e](); +} +let un = [], Cr = []; +function fs() { + var t = un; + un = [], us(t); +} +function Qa() { + var t = Cr; + Cr = [], us(t); +} +function gn(t) { + un.length === 0 && queueMicrotask(fs), un.push(t); +} +function Ei() { + un.length > 0 && fs(), Cr.length > 0 && Qa(); +} +function cs(t) { + return t === this.v; +} +function to(t, e) { + return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; +} +function ni(t) { + return !to(t, this.v); +} +function eo(t) { + throw new Error("https://svelte.dev/e/effect_in_teardown"); +} +function no() { + throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); +} +function ro(t) { + throw new Error("https://svelte.dev/e/effect_orphan"); +} +function io() { + throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); +} +function so() { + throw new Error("https://svelte.dev/e/hydration_failed"); +} +function ao(t) { + throw new Error("https://svelte.dev/e/props_invalid_value"); +} +function oo() { + throw new Error("https://svelte.dev/e/state_descriptors_fixed"); +} +function lo() { + throw new Error("https://svelte.dev/e/state_prototype_fixed"); +} +function uo() { + throw new Error("https://svelte.dev/e/state_unsafe_local_read"); +} +function fo() { + throw new Error("https://svelte.dev/e/state_unsafe_mutation"); +} +let co = !1; +function Ht(t, e) { + var n = { + f: 0, + // TODO ideally we could skip this altogether, but it causes type errors + v: t, + reactions: null, + equals: cs, + rv: 0, + wv: 0 + }; + return n; +} +function st(t) { + return /* @__PURE__ */ ho(Ht(t)); +} +// @__NO_SIDE_EFFECTS__ +function ri(t, e = !1) { + const n = Ht(t); + return e || (n.equals = ni), n; +} +// @__NO_SIDE_EFFECTS__ +function ho(t) { + return et !== null && !Ut && et.f & Wt && (te === null ? _o([t]) : te.push(t)), t; +} +function M(t, e) { + return et !== null && !Ut && Ss() && et.f & (Wt | lr) && // If the source was created locally within the current derived, then + // we allow the mutation. + (te === null || !te.includes(t)) && fo(), Mr(t, e); +} +function Mr(t, e) { + return t.equals(e) || (t.v, t.v = e, t.wv = ws(), ds(t, me), Q !== null && Q.f & Tt && !(Q.f & (_e | We)) && (ue === null ? mo([t]) : ue.push(t))), e; +} +function ds(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; + a & me || (ie(s, e), a & (Tt | zt) && (a & Wt ? ds( + /** @type {Derived} */ + s, + Ke + ) : vr( + /** @type {Effect} */ + s + ))); + } +} +// @__NO_SIDE_EFFECTS__ +function cr(t) { + var e = Wt | me, n = et !== null && et.f & Wt ? ( + /** @type {Derived} */ + et + ) : null; + return Q === null || n !== null && n.f & zt ? e |= zt : Q.f |= as, { + ctx: Dt, + deps: null, + effects: null, + equals: cs, + f: e, + fn: t, + reactions: null, + rv: 0, + v: ( + /** @type {V} */ + null + ), + wv: 0, + parent: n ?? Q + }; +} +// @__NO_SIDE_EFFECTS__ +function vo(t) { + const e = /* @__PURE__ */ cr(t); + return e.equals = ni, e; +} +function hs(t) { + var e = t.effects; + if (e !== null) { + t.effects = null; + for (var n = 0; n < e.length; n += 1) + pe( + /** @type {Effect} */ + e[n] + ); + } +} +function po(t) { + for (var e = t.parent; e !== null; ) { + if (!(e.f & Wt)) + return ( + /** @type {Effect} */ + e + ); + e = e.parent; + } + return null; +} +function go(t) { + var e, n = Q; + re(po(t)); + try { + hs(t), e = bs(t); + } finally { + re(n); + } + return e; +} +function vs(t) { + var e = go(t), n = ($e || t.f & zt) && t.deps !== null ? Ke : Tt; + ie(t, n), t.equals(e) || (t.v = e, t.wv = ws()); +} +function ii(t) { + console.warn("https://svelte.dev/e/hydration_mismatch"); +} +let at = !1; +function de(t) { + at = t; +} +let tt; +function Gt(t) { + if (t === null) + throw ii(), an; + return tt = t; +} +function dr() { + return Gt( + /** @type {TemplateNode} */ + /* @__PURE__ */ ye(tt) + ); +} +function nt(t) { + if (at) { + if (/* @__PURE__ */ ye(tt) !== null) + throw ii(), an; + tt = t; + } +} +function xn(t = 1) { + if (at) { + for (var e = t, n = tt; e--; ) + n = /** @type {TemplateNode} */ + /* @__PURE__ */ ye(n); + tt = n; + } +} +function Or() { + for (var t = 0, e = tt; ; ) { + if (e.nodeType === 8) { + var n = ( + /** @type {Comment} */ + e.data + ); + if (n === Qr) { + if (t === 0) return e; + t -= 1; + } else (n === rs || n === jr) && (t += 1); + } + var r = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ ye(e) + ); + e.remove(), e = r; + } +} +function F(t, e = null, n) { + if (typeof t != "object" || t === null || on in t) + return t; + const r = ls(t); + if (r !== Ja && r !== Za) + return t; + var i = /* @__PURE__ */ new Map(), s = ti(t), a = Ht(0); + s && i.set("length", Ht( + /** @type {any[]} */ + t.length + )); + var o; + return new Proxy( + /** @type {any} */ + t, + { + defineProperty(f, u, l) { + (!("value" in l) || l.configurable === !1 || l.enumerable === !1 || l.writable === !1) && oo(); + var h = i.get(u); + return h === void 0 ? (h = Ht(l.value), i.set(u, h)) : M(h, F(l.value, o)), !0; + }, + deleteProperty(f, u) { + var l = i.get(u); + if (l === void 0) + u in f && i.set(u, Ht(Mt)); + else { + if (s && typeof u == "string") { + var h = ( + /** @type {Source} */ + i.get("length") + ), c = Number(u); + Number.isInteger(c) && c < h.v && M(h, c); + } + M(l, Mt), Ri(a); + } + return !0; + }, + get(f, u, l) { + var p; + if (u === on) + return t; + var h = i.get(u), c = u in f; + if (h === void 0 && (!c || (p = Se(f, u)) != null && p.writable) && (h = Ht(F(c ? f[u] : Mt, o)), i.set(u, h)), h !== void 0) { + var d = v(h); + return d === Mt ? void 0 : d; + } + return Reflect.get(f, u, l); + }, + getOwnPropertyDescriptor(f, u) { + var l = Reflect.getOwnPropertyDescriptor(f, u); + if (l && "value" in l) { + var h = i.get(u); + h && (l.value = v(h)); + } else if (l === void 0) { + var c = i.get(u), d = c == null ? void 0 : c.v; + if (c !== void 0 && d !== Mt) + return { + enumerable: !0, + configurable: !0, + value: d, + writable: !0 + }; + } + return l; + }, + has(f, u) { + var d; + if (u === on) + return !0; + var l = i.get(u), h = l !== void 0 && l.v !== Mt || Reflect.has(f, u); + if (l !== void 0 || Q !== null && (!h || (d = Se(f, u)) != null && d.writable)) { + l === void 0 && (l = Ht(h ? F(f[u], o) : Mt), i.set(u, l)); + var c = v(l); + if (c === Mt) + return !1; + } + return h; + }, + set(f, u, l, h) { + var y; + var c = i.get(u), d = u in f; + if (s && u === "length") + for (var p = l; p < /** @type {Source} */ + c.v; p += 1) { + var _ = i.get(p + ""); + _ !== void 0 ? M(_, Mt) : p in f && (_ = Ht(Mt), i.set(p + "", _)); + } + c === void 0 ? (!d || (y = Se(f, u)) != null && y.writable) && (c = Ht(void 0), M(c, F(l, o)), i.set(u, c)) : (d = c.v !== Mt, M(c, F(l, o))); + var m = Reflect.getOwnPropertyDescriptor(f, u); + if (m != null && m.set && m.set.call(h, l), !d) { + if (s && typeof u == "string") { + var w = ( + /** @type {Source} */ + i.get("length") + ), $ = Number(u); + Number.isInteger($) && $ >= w.v && M(w, $ + 1); + } + Ri(a); + } + return !0; + }, + ownKeys(f) { + v(a); + var u = Reflect.ownKeys(f).filter((c) => { + var d = i.get(c); + return d === void 0 || d.v !== Mt; + }); + for (var [l, h] of i) + h.v !== Mt && !(l in f) && u.push(l); + return u; + }, + setPrototypeOf() { + lo(); + } + } + ); +} +function Ri(t, e = 1) { + M(t, t.v + e); +} +var Ni, ps, gs, _s; +function Pr() { + if (Ni === void 0) { + Ni = window, ps = /Firefox/.test(navigator.userAgent); + var t = Element.prototype, e = Node.prototype; + gs = Se(e, "firstChild").get, _s = Se(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; + } +} +function Ue(t = "") { + return document.createTextNode(t); +} +// @__NO_SIDE_EFFECTS__ +function ve(t) { + return gs.call(t); +} +// @__NO_SIDE_EFFECTS__ +function ye(t) { + return _s.call(t); +} +function lt(t, e) { + if (!at) + return /* @__PURE__ */ ve(t); + var n = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ ve(tt) + ); + if (n === null) + n = tt.appendChild(Ue()); + else if (e && n.nodeType !== 3) { + var r = Ue(); + return n == null || n.before(r), Gt(r), r; + } + return Gt(n), n; +} +function He(t, e) { + if (!at) { + var n = ( + /** @type {DocumentFragment} */ + /* @__PURE__ */ ve( + /** @type {Node} */ + t + ) + ); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ye(n) : n; + } + return tt; +} +function kt(t, e = 1, n = !1) { + let r = at ? tt : t; + for (var i; e--; ) + i = r, r = /** @type {TemplateNode} */ + /* @__PURE__ */ ye(r); + if (!at) + return r; + var s = r == null ? void 0 : r.nodeType; + if (n && s !== 3) { + var a = Ue(); + return r === null ? i == null || i.after(a) : r.before(a), Gt(a), a; + } + return Gt(r), /** @type {TemplateNode} */ + r; +} +function ms(t) { + t.textContent = ""; +} +let Tn = !1, Hn = !1, zn = null, Sn = !1, si = !1; +function Ti(t) { + si = t; +} +let ln = []; +let et = null, Ut = !1; +function ne(t) { + et = t; +} +let Q = null; +function re(t) { + Q = t; +} +let te = null; +function _o(t) { + te = t; +} +let Et = null, It = 0, ue = null; +function mo(t) { + ue = t; +} +let ys = 1, Bn = 0, $e = !1; +function ws() { + return ++ys; +} +function _n(t) { + var h; + var e = t.f; + if (e & me) + return !0; + if (e & Ke) { + var n = t.deps, r = (e & zt) !== 0; + if (n !== null) { + var i, s, a = (e & Ln) !== 0, o = r && Q !== null && !$e, f = n.length; + if (a || o) { + var u = ( + /** @type {Derived} */ + t + ), l = u.parent; + for (i = 0; i < f; i++) + s = n[i], (a || !((h = s == null ? void 0 : s.reactions) != null && h.includes(u))) && (s.reactions ?? (s.reactions = [])).push(u); + a && (u.f ^= Ln), o && l !== null && !(l.f & zt) && (u.f ^= zt); + } + for (i = 0; i < f; i++) + if (s = n[i], _n( + /** @type {Derived} */ + s + ) && vs( + /** @type {Derived} */ + s + ), s.wv > t.wv) + return !0; + } + (!r || Q !== null && !$e) && ie(t, Tt); + } + return !1; +} +function yo(t, e) { + for (var n = e; n !== null; ) { + if (n.f & Fn) + try { + n.fn(t); + return; + } catch { + n.f ^= Fn; + } + n = n.parent; + } + throw Tn = !1, t; +} +function wo(t) { + return (t.f & ur) === 0 && (t.parent === null || (t.parent.f & Fn) === 0); +} +function hr(t, e, n, r) { + if (Tn) { + if (n === null && (Tn = !1), wo(e)) + throw t; + return; + } + n !== null && (Tn = !0); + { + yo(t, e); + return; + } +} +function xs(t, e, n = !0) { + var r = t.reactions; + if (r !== null) + for (var i = 0; i < r.length; i++) { + var s = r[i]; + s.f & Wt ? xs( + /** @type {Derived} */ + s, + e, + !1 + ) : e === s && (n ? ie(s, me) : s.f & Tt && ie(s, Ke), vr( + /** @type {Effect} */ + s + )); + } +} +function bs(t) { + var d; + var e = Et, n = It, r = ue, i = et, s = $e, a = te, o = Dt, f = Ut, u = t.f; + Et = /** @type {null | Value[]} */ + null, It = 0, ue = null, $e = (u & zt) !== 0 && (Ut || !Sn || et === null), et = u & (_e | We) ? null : t, te = null, Si(t.ctx), Ut = !1, Bn++; + try { + var l = ( + /** @type {Function} */ + (0, t.fn)() + ), h = t.deps; + if (Et !== null) { + var c; + if (Yn(t, It), h !== null && It > 0) + for (h.length = It + Et.length, c = 0; c < Et.length; c++) + h[It + c] = Et[c]; + else + t.deps = h = Et; + if (!$e) + for (c = It; c < h.length; c++) + ((d = h[c]).reactions ?? (d.reactions = [])).push(t); + } else h !== null && It < h.length && (Yn(t, It), h.length = It); + if (Ss() && ue !== null && !Ut && h !== null && !(t.f & (Wt | Ke | me))) + for (c = 0; c < /** @type {Source[]} */ + ue.length; c++) + xs( + ue[c], + /** @type {Effect} */ + t + ); + return i !== null && Bn++, l; + } finally { + Et = e, It = n, ue = r, et = i, $e = s, te = a, Si(o), Ut = f; + } +} +function xo(t, e) { + let n = e.reactions; + if (n !== null) { + var r = Wa.call(n, t); + if (r !== -1) { + var i = n.length - 1; + i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); + } + } + n === null && e.f & Wt && // 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 + (Et === null || !Et.includes(e)) && (ie(e, Ke), e.f & (zt | Ln) || (e.f ^= Ln), hs( + /** @type {Derived} **/ + e + ), Yn( + /** @type {Derived} **/ + e, + 0 + )); +} +function Yn(t, e) { + var n = t.deps; + if (n !== null) + for (var r = e; r < n.length; r++) + xo(t, n[r]); +} +function ai(t) { + var e = t.f; + if (!(e & ur)) { + ie(t, Tt); + var n = Q, r = Dt, i = Sn; + Q = t, Sn = !0; + try { + e & lr ? Co(t) : Es(t), ks(t); + var s = bs(t); + t.teardown = typeof s == "function" ? s : null, t.wv = ys; + var a = t.deps, o; + ki && co && t.f & me; + } catch (f) { + hr(f, t, n, r || t.ctx); + } finally { + Sn = i, Q = n; + } + } +} +function bo() { + try { + io(); + } catch (t) { + if (zn !== null) + hr(t, zn, null); + else + throw t; + } +} +function $s() { + try { + for (var t = 0; ln.length > 0; ) { + t++ > 1e3 && bo(); + var e = ln, n = e.length; + ln = []; + for (var r = 0; r < n; r++) { + var i = e[r]; + i.f & Tt || (i.f ^= Tt); + var s = Ao(i); + $o(s); + } + } + } finally { + Hn = !1, zn = null; + } +} +function $o(t) { + var e = t.length; + if (e !== 0) + for (var n = 0; n < e; n++) { + var r = t[n]; + if (!(r.f & (ur | he))) + try { + _n(r) && (ai(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? Rs(r) : r.fn = null)); + } catch (i) { + hr(i, r, null, r.ctx); + } + } +} +function vr(t) { + Hn || (Hn = !0, queueMicrotask($s)); + for (var e = zn = t; e.parent !== null; ) { + e = e.parent; + var n = e.f; + if (n & (We | _e)) { + if (!(n & Tt)) return; + e.f ^= Tt; + } + } + ln.push(e); +} +function Ao(t) { + for (var e = [], n = t.first; n !== null; ) { + var r = n.f, i = (r & _e) !== 0, s = i && (r & Tt) !== 0; + if (!s && !(r & he)) { + if (r & is) + e.push(n); + else if (i) + n.f ^= Tt; + else { + var a = et; + try { + et = n, _n(n) && ai(n); + } catch (u) { + hr(u, n, null, n.ctx); + } finally { + et = a; + } + } + var o = n.first; + if (o !== null) { + n = o; + continue; + } + } + var f = n.parent; + for (n = n.next; n === null && f !== null; ) + n = f.next, f = f.parent; + } + return e; +} +function mt(t) { + var e; + for (Ei(); ln.length > 0; ) + Hn = !0, $s(), Ei(); + return ( + /** @type {T} */ + e + ); +} +function v(t) { + var e = t.f, n = (e & Wt) !== 0; + if (et !== null && !Ut) { + te !== null && te.includes(t) && uo(); + var r = et.deps; + t.rv < Bn && (t.rv = Bn, Et === null && r !== null && r[It] === t ? It++ : Et === null ? Et = [t] : (!$e || !Et.includes(t)) && Et.push(t)); + } else if (n && /** @type {Derived} */ + t.deps === null && /** @type {Derived} */ + t.effects === null) { + var i = ( + /** @type {Derived} */ + t + ), s = i.parent; + s !== null && !(s.f & zt) && (i.f ^= zt); + } + return n && (i = /** @type {Derived} */ + t, _n(i) && vs(i)), t.v; +} +function fn(t) { + var e = Ut; + try { + return Ut = !0, t(); + } finally { + Ut = e; + } +} +const ko = -7169; +function ie(t, e) { + t.f = t.f & ko | e; +} +function Eo(t) { + Q === null && et === null && ro(), et !== null && et.f & zt && Q === null && no(), si && eo(); +} +function Ro(t, e) { + var n = e.last; + n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); +} +function Ie(t, e, n, r = !0) { + var i = (t & We) !== 0, s = Q, a = { + ctx: Dt, + deps: null, + nodes_start: null, + nodes_end: null, + f: t | me, + first: null, + fn: e, + last: null, + next: null, + parent: i ? null : s, + prev: null, + teardown: null, + transitions: null, + wv: 0 + }; + if (n) + try { + ai(a), a.f |= ss; + } catch (u) { + throw pe(a), u; + } + else e !== null && vr(a); + var o = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (as | Fn)) === 0; + if (!o && !i && r && (s !== null && Ro(a, s), et !== null && et.f & Wt)) { + var f = ( + /** @type {Derived} */ + et + ); + (f.effects ?? (f.effects = [])).push(a); + } + return a; +} +function No(t) { + const e = Ie(or, null, !1); + return ie(e, Tt), e.teardown = t, e; +} +function Un(t) { + Eo(); + var e = Q !== null && (Q.f & _e) !== 0 && Dt !== null && !Dt.m; + if (e) { + var n = ( + /** @type {ComponentContext} */ + Dt + ); + (n.e ?? (n.e = [])).push({ + fn: t, + effect: Q, + reaction: et + }); + } else { + var r = pr(t); + return r; + } +} +function To(t) { + const e = Ie(We, t, !0); + return () => { + pe(e); + }; +} +function So(t) { + const e = Ie(We, t, !0); + return (n = {}) => new Promise((r) => { + n.outro ? Xn(e, () => { + pe(e), r(void 0); + }) : (pe(e), r(void 0)); + }); +} +function pr(t) { + return Ie(is, t, !1); +} +function As(t) { + return Ie(or, t, !0); +} +function Qt(t, e = [], n = cr) { + const r = e.map(n); + return oi(() => t(...r.map(v))); +} +function oi(t, e = 0) { + return Ie(or | lr | e, t, !0); +} +function cn(t, e = !0) { + return Ie(or | _e, t, !0, e); +} +function ks(t) { + var e = t.teardown; + if (e !== null) { + const n = si, r = et; + Ti(!0), ne(null); + try { + e.call(null); + } finally { + Ti(n), ne(r); + } + } +} +function Es(t, e = !1) { + var n = t.first; + for (t.first = t.last = null; n !== null; ) { + var r = n.next; + pe(n, e), n = r; + } +} +function Co(t) { + for (var e = t.first; e !== null; ) { + var n = e.next; + e.f & _e || pe(e), e = n; + } +} +function pe(t, e = !0) { + var n = !1; + if ((e || t.f & Xa) && t.nodes_start !== null) { + for (var r = t.nodes_start, i = t.nodes_end; r !== null; ) { + var s = r === i ? null : ( + /** @type {TemplateNode} */ + /* @__PURE__ */ ye(r) + ); + r.remove(), r = s; + } + n = !0; + } + Es(t, e && !n), Yn(t, 0), ie(t, ur); + var a = t.transitions; + if (a !== null) + for (const f of a) + f.stop(); + ks(t); + var o = t.parent; + o !== null && o.first !== null && Rs(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = null; +} +function Rs(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 Xn(t, e) { + var n = []; + li(t, n, !0), Ns(n, () => { + pe(t), e && e(); + }); +} +function Ns(t, e) { + var n = t.length; + if (n > 0) { + var r = () => --n || e(); + for (var i of t) + i.out(r); + } else + e(); +} +function li(t, e, n) { + if (!(t.f & he)) { + if (t.f ^= he, t.transitions !== null) + for (const a of t.transitions) + (a.is_global || n) && e.push(a); + for (var r = t.first; r !== null; ) { + var i = r.next, s = (r.f & fr) !== 0 || (r.f & _e) !== 0; + li(r, e, s ? n : !1), r = i; + } + } +} +function Gn(t) { + Ts(t, !0); +} +function Ts(t, e) { + if (t.f & he) { + t.f ^= he, t.f & Tt || (t.f ^= Tt), _n(t) && (ie(t, me), vr(t)); + for (var n = t.first; n !== null; ) { + var r = n.next, i = (n.f & fr) !== 0 || (n.f & _e) !== 0; + Ts(n, i ? e : !1), n = r; + } + if (t.transitions !== null) + for (const s of t.transitions) + (s.is_global || e) && s.in(); + } +} +function Mo(t) { + throw new Error("https://svelte.dev/e/lifecycle_outside_component"); +} +let Dt = null; +function Si(t) { + Dt = t; +} +function mn(t, e = !1, n) { + Dt = { + p: Dt, + c: null, + e: null, + m: !1, + s: t, + x: null, + l: null + }; +} +function yn(t) { + const e = Dt; + if (e !== null) { + t !== void 0 && (e.x = t); + const a = e.e; + if (a !== null) { + var n = Q, r = et; + e.e = null; + try { + for (var i = 0; i < a.length; i++) { + var s = a[i]; + re(s.effect), ne(s.reaction), pr(s.fn); + } + } finally { + re(n), ne(r); + } + } + Dt = e.p, e.m = !0; + } + return t || /** @type {T} */ + {}; +} +function Ss() { + return !0; +} +const Oo = ["touchstart", "touchmove"]; +function Po(t) { + return Oo.includes(t); +} +function Cs(t) { + var e = et, n = Q; + ne(null), re(null); + try { + return t(); + } finally { + ne(e), re(n); + } +} +const Ms = /* @__PURE__ */ new Set(), Dr = /* @__PURE__ */ new Set(); +function Do(t, e, n, r = {}) { + function i(s) { + if (r.capture || tn.call(e, s), !s.cancelBubble) + return Cs(() => n == null ? void 0 : n.call(this, s)); + } + return t.startsWith("pointer") || t.startsWith("touch") || t === "wheel" ? gn(() => { + e.addEventListener(t, i, r); + }) : e.addEventListener(t, i, r), i; +} +function qe(t, e, n, r, i) { + var s = { capture: r, passive: i }, a = Do(t, e, n, s); + (e === document.body || e === window || e === document) && No(() => { + e.removeEventListener(t, a, s); + }); +} +function Os(t) { + for (var e = 0; e < t.length; e++) + Ms.add(t[e]); + for (var n of Dr) + n(t); +} +function tn(t) { + var $; + var e = this, n = ( + /** @type {Node} */ + e.ownerDocument + ), r = t.type, i = (($ = t.composedPath) == null ? void 0 : $.call(t)) || [], s = ( + /** @type {null | Element} */ + i[0] || t.target + ), a = 0, o = t.__root; + if (o) { + var f = i.indexOf(o); + if (f !== -1 && (e === document || e === /** @type {any} */ + window)) { + t.__root = e; + return; + } + var u = i.indexOf(e); + if (u === -1) + return; + f <= u && (a = f); + } + if (s = /** @type {Element} */ + i[a] || t.target, s !== e) { + Vn(t, "currentTarget", { + configurable: !0, + get() { + return s || n; + } + }); + var l = et, h = Q; + ne(null), re(null); + try { + for (var c, d = []; s !== null; ) { + var p = s.assignedSlot || s.parentNode || /** @type {any} */ + s.host || null; + try { + var _ = s["__" + r]; + if (_ !== void 0 && (!/** @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)) + if (ti(_)) { + var [m, ...w] = _; + m.apply(s, [t, ...w]); + } else + _.call(s, t); + } catch (y) { + c ? d.push(y) : c = y; + } + if (t.cancelBubble || p === e || p === null) + break; + s = p; + } + if (c) { + for (let y of d) + queueMicrotask(() => { + throw y; + }); + throw c; + } + } finally { + t.__root = e, delete t.currentTarget, ne(l), re(h); + } + } +} +function Ps(t) { + var e = document.createElement("template"); + return e.innerHTML = t, e.content; +} +function Ae(t, e) { + var n = ( + /** @type {Effect} */ + Q + ); + n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e); +} +// @__NO_SIDE_EFFECTS__ +function Bt(t, e) { + var n = (e & Ya) !== 0, r = (e & Ua) !== 0, i, s = !t.startsWith(""); + return () => { + if (at) + return Ae(tt, null), tt; + i === void 0 && (i = Ps(s ? t : "" + t), n || (i = /** @type {Node} */ + /* @__PURE__ */ ve(i))); + var a = ( + /** @type {TemplateNode} */ + r || ps ? document.importNode(i, !0) : i.cloneNode(!0) + ); + if (n) { + var o = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ ve(a) + ), f = ( + /** @type {TemplateNode} */ + a.lastChild + ); + Ae(o, f); + } else + Ae(a, a); + return a; + }; +} +// @__NO_SIDE_EFFECTS__ +function Io(t, e, n = "svg") { + var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; + return () => { + if (at) + return Ae(tt, null), tt; + if (!s) { + var a = ( + /** @type {DocumentFragment} */ + Ps(i) + ), o = ( + /** @type {Element} */ + /* @__PURE__ */ ve(a) + ); + s = /** @type {Element} */ + /* @__PURE__ */ ve(o); + } + var f = ( + /** @type {TemplateNode} */ + s.cloneNode(!0) + ); + return Ae(f, f), f; + }; +} +function Fo() { + if (at) + return Ae(tt, null), tt; + var t = document.createDocumentFragment(), e = document.createComment(""), n = Ue(); + return t.append(e, n), Ae(e, n), t; +} +function Nt(t, e) { + if (at) { + Q.nodes_end = tt, dr(); + return; + } + t !== null && t.before( + /** @type {Node} */ + e + ); +} +let Ir = !0; +function be(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 Ds(t, e) { + return Is(t, e); +} +function Lo(t, e) { + Pr(), e.intro = e.intro ?? !1; + const n = e.target, r = at, i = tt; + try { + for (var s = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ ve(n) + ); s && (s.nodeType !== 8 || /** @type {Comment} */ + s.data !== rs); ) + s = /** @type {TemplateNode} */ + /* @__PURE__ */ ye(s); + if (!s) + throw an; + de(!0), Gt( + /** @type {Comment} */ + s + ), dr(); + const a = Is(t, { ...e, anchor: s }); + if (tt === null || tt.nodeType !== 8 || /** @type {Comment} */ + tt.data !== Qr) + throw ii(), an; + return de(!1), /** @type {Exports} */ + a; + } catch (a) { + if (a === an) + return e.recover === !1 && so(), Pr(), ms(n), de(!1), Ds(t, e); + throw a; + } finally { + de(r), Gt(i); + } +} +const Ve = /* @__PURE__ */ new Map(); +function Is(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + Pr(); + var o = /* @__PURE__ */ new Set(), f = (h) => { + for (var c = 0; c < h.length; c++) { + var d = h[c]; + if (!o.has(d)) { + o.add(d); + var p = Po(d); + e.addEventListener(d, tn, { passive: p }); + var _ = Ve.get(d); + _ === void 0 ? (document.addEventListener(d, tn, { passive: p }), Ve.set(d, 1)) : Ve.set(d, _ + 1); + } + } + }; + f(ei(Ms)), Dr.add(f); + var u = void 0, l = So(() => { + var h = n ?? e.appendChild(Ue()); + return cn(() => { + if (s) { + mn({}); + var c = ( + /** @type {ComponentContext} */ + Dt + ); + c.c = s; + } + i && (r.$$events = i), at && Ae( + /** @type {TemplateNode} */ + h, + null + ), Ir = a, u = t(h, r) || {}, Ir = !0, at && (Q.nodes_end = tt), s && yn(); + }), () => { + var p; + for (var c of o) { + e.removeEventListener(c, tn); + var d = ( + /** @type {number} */ + Ve.get(c) + ); + --d === 0 ? (document.removeEventListener(c, tn), Ve.delete(c)) : Ve.set(c, d); + } + Dr.delete(f), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); + }; + }); + return Fr.set(u, l), u; +} +let Fr = /* @__PURE__ */ new WeakMap(); +function qo(t, e) { + const n = Fr.get(t); + return n ? (Fr.delete(t), n(e)) : Promise.resolve(); +} +function Lr(t, e, n = !1) { + at && dr(); + var r = t, i = null, s = null, a = Mt, o = n ? fr : 0, f = !1; + const u = (h, c = !0) => { + f = !0, l(c, h); + }, l = (h, c) => { + if (a === (a = h)) return; + let d = !1; + if (at) { + const p = ( + /** @type {Comment} */ + r.data === jr + ); + !!a === p && (r = Or(), Gt(r), de(!1), d = !0); + } + a ? (i ? Gn(i) : c && (i = cn(() => c(r))), s && Xn(s, () => { + s = null; + })) : (s ? Gn(s) : c && (s = cn(() => c(r))), i && Xn(i, () => { + i = null; + })), d && de(!0); + }; + oi(() => { + f = !1, e(u), f || l(null, null); + }, o), at && (r = tt); +} +function Ce(t, e) { + return e; +} +function Vo(t, e, n, r) { + for (var i = [], s = e.length, a = 0; a < s; a++) + li(e[a].e, i, !0); + var o = s > 0 && i.length === 0 && n !== null; + if (o) { + var f = ( + /** @type {Element} */ + /** @type {Element} */ + n.parentNode + ); + ms(f), f.append( + /** @type {Element} */ + n + ), r.clear(), xe(t, e[0].prev, e[s - 1].next); + } + Ns(i, () => { + for (var u = 0; u < s; u++) { + var l = e[u]; + o || (r.delete(l.k), xe(t, l.prev, l.next)), pe(l.e, !o); + } + }); +} +function Me(t, e, n, r, i, s = null) { + var a = t, o = { items: /* @__PURE__ */ new Map(), first: null }, f = (e & ns) !== 0; + if (f) { + var u = ( + /** @type {Element} */ + t + ); + a = at ? Gt( + /** @type {Comment | Text} */ + /* @__PURE__ */ ve(u) + ) : u.appendChild(Ue()); + } + at && dr(); + var l = null, h = !1, c = /* @__PURE__ */ vo(() => { + var d = n(); + return ti(d) ? d : d == null ? [] : ei(d); + }); + oi(() => { + var d = v(c), p = d.length; + if (h && p === 0) + return; + h = p === 0; + let _ = !1; + if (at) { + var m = ( + /** @type {Comment} */ + a.data === jr + ); + m !== (p === 0) && (a = Or(), Gt(a), de(!1), _ = !0); + } + if (at) { + for (var w = null, $, y = 0; y < p; y++) { + if (tt.nodeType === 8 && /** @type {Comment} */ + tt.data === Qr) { + a = /** @type {Comment} */ + tt, _ = !0, de(!1); + break; + } + var x = d[y], E = r(x, y); + $ = Fs( + tt, + o, + w, + null, + x, + E, + y, + i, + e, + n + ), o.items.set(E, $), w = $; + } + p > 0 && Gt(Or()); + } + at || Ho(d, o, a, i, e, r, n), s !== null && (p === 0 ? l ? Gn(l) : l = cn(() => s(a)) : l !== null && Xn(l, () => { + l = null; + })), _ && de(!0), v(c); + }), at && (a = tt); +} +function Ho(t, e, n, r, i, s, a) { + var O, xt, _t, yt; + var o = (i & Da) !== 0, f = (i & (Jr | Zr)) !== 0, u = t.length, l = e.items, h = e.first, c = h, d, p = null, _, m = [], w = [], $, y, x, E; + if (o) + for (E = 0; E < u; E += 1) + $ = t[E], y = s($, E), x = l.get(y), x !== void 0 && ((O = x.a) == null || O.measure(), (_ ?? (_ = /* @__PURE__ */ new Set())).add(x)); + for (E = 0; E < u; E += 1) { + if ($ = t[E], y = s($, E), x = l.get(y), x === void 0) { + var b = c ? ( + /** @type {TemplateNode} */ + c.e.nodes_start + ) : n; + p = Fs( + b, + e, + p, + p === null ? e.first : p.next, + $, + y, + E, + r, + i, + a + ), l.set(y, p), m = [], w = [], c = p.next; + continue; + } + if (f && zo(x, $, E, i), x.e.f & he && (Gn(x.e), o && ((xt = x.a) == null || xt.unfix(), (_ ?? (_ = /* @__PURE__ */ new Set())).delete(x))), x !== c) { + if (d !== void 0 && d.has(x)) { + if (m.length < w.length) { + var T = w[0], P; + p = T.prev; + var K = m[0], rt = m[m.length - 1]; + for (P = 0; P < m.length; P += 1) + Ci(m[P], T, n); + for (P = 0; P < w.length; P += 1) + d.delete(w[P]); + xe(e, K.prev, rt.next), xe(e, p, K), xe(e, rt, T), c = T, p = rt, E -= 1, m = [], w = []; + } else + d.delete(x), Ci(x, c, n), xe(e, x.prev, x.next), xe(e, x, p === null ? e.first : p.next), xe(e, p, x), p = x; + continue; + } + for (m = [], w = []; c !== null && c.k !== y; ) + c.e.f & he || (d ?? (d = /* @__PURE__ */ new Set())).add(c), w.push(c), c = c.next; + if (c === null) + continue; + x = c; + } + m.push(x), p = x, c = x.next; + } + if (c !== null || d !== void 0) { + for (var J = d === void 0 ? [] : ei(d); c !== null; ) + c.e.f & he || J.push(c), c = c.next; + var ot = J.length; + if (ot > 0) { + var C = i & ns && u === 0 ? n : null; + if (o) { + for (E = 0; E < ot; E += 1) + (_t = J[E].a) == null || _t.measure(); + for (E = 0; E < ot; E += 1) + (yt = J[E].a) == null || yt.fix(); + } + Vo(e, J, C, l); + } + } + o && gn(() => { + var pt; + if (_ !== void 0) + for (x of _) + (pt = x.a) == null || pt.apply(); + }), Q.first = e.first && e.first.e, Q.last = p && p.e; +} +function zo(t, e, n, r) { + r & Jr && Mr(t.v, e), r & Zr ? Mr( + /** @type {Value} */ + t.i, + n + ) : t.i = n; +} +function Fs(t, e, n, r, i, s, a, o, f, u) { + var l = (f & Jr) !== 0, h = (f & Ia) === 0, c = l ? h ? /* @__PURE__ */ ri(i) : Ht(i) : i, d = f & Zr ? Ht(a) : a, p = { + i: d, + v: c, + k: s, + a: null, + // @ts-expect-error + e: null, + prev: n, + next: r + }; + try { + return p.e = cn(() => o(t, c, d, u), at), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; + } finally { + } +} +function Ci(t, e, n) { + for (var r = t.next ? ( + /** @type {TemplateNode} */ + t.next.e.nodes_start + ) : n, i = e ? ( + /** @type {TemplateNode} */ + e.e.nodes_start + ) : n, s = ( + /** @type {TemplateNode} */ + t.e.nodes_start + ); s !== r; ) { + var a = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ ye(s) + ); + i.before(s), s = a; + } +} +function xe(t, e, n) { + e === null ? t.first = n : (e.next = n, e.e.next = n && n.e), n !== null && (n.prev = e, n.e.prev = e && e.e); +} +function gr(t, e) { + gn(() => { + 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 = document.createElement("style"); + i.id = e.hash, i.textContent = e.code, r.appendChild(i); + } + }); +} +const Mi = [...` +\r\f \v\uFEFF`]; +function Bo(t, e, n) { + var r = t == null ? "" : "" + t; + 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 o = a + s; + (a === 0 || Mi.includes(r[a - 1])) && (o === r.length || Mi.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; + } + } + return r === "" ? null : r; +} +function en(t, e, n, r, i, s) { + var a = t.__className; + if (at || a !== n) { + var o = Bo(n, r, s); + (!at || o !== t.getAttribute("class")) && (o == null ? t.removeAttribute("class") : t.className = o), t.__className = n; + } else if (s) + for (var f in s) { + var u = !!s[f]; + (i == null || u !== !!i[f]) && t.classList.toggle(f, u); + } + return s; +} +function Wn(t, e, n, r) { + var i = t.__attributes ?? (t.__attributes = {}); + at && (i[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === "LINK") || i[e] !== (i[e] = n) && (e === "style" && "__styles" in t && (t.__styles = {}), e === "loading" && (t[Ga] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && Yo(t).includes(e) ? t[e] = n : t.setAttribute(e, n)); +} +var Oi = /* @__PURE__ */ new Map(); +function Yo(t) { + var e = Oi.get(t.nodeName); + if (e) return e; + Oi.set(t.nodeName, e = []); + for (var n, r = t, i = Element.prototype; i !== r; ) { + n = Ka(r); + for (var s in n) + n[s].set && e.push(s); + r = ls(r); + } + return e; +} +function Pi(t, e, n, r) { + var i = t.__styles ?? (t.__styles = {}); + i[e] !== n && (i[e] = n, n == null ? t.style.removeProperty(e) : t.style.setProperty(e, n, "")); +} +const Uo = () => performance.now(), ce = { + // don't access requestAnimationFrame eagerly outside method + // this allows basic testing of user code without JSDOM + // bunder will eval and remove ternary when the user's app is built + tick: ( + /** @param {any} _ */ + (t) => requestAnimationFrame(t) + ), + now: () => Uo(), + tasks: /* @__PURE__ */ new Set() +}; +function Ls() { + const t = ce.now(); + ce.tasks.forEach((e) => { + e.c(t) || (ce.tasks.delete(e), e.f()); + }), ce.tasks.size !== 0 && ce.tick(Ls); +} +function Xo(t) { + let e; + return ce.tasks.size === 0 && ce.tick(Ls), { + promise: new Promise((n) => { + ce.tasks.add(e = { c: t, f: n }); + }), + abort() { + ce.tasks.delete(e); + } + }; +} +function bn(t, e) { + Cs(() => { + t.dispatchEvent(new CustomEvent(e)); + }); +} +function Go(t) { + if (t === "float") return "cssFloat"; + if (t === "offset") return "cssOffset"; + if (t.startsWith("--")) return t; + const e = t.split("-"); + return e.length === 1 ? e[0] : e[0] + e.slice(1).map( + /** @param {any} word */ + (n) => n[0].toUpperCase() + n.slice(1) + ).join(""); +} +function Di(t) { + const e = {}, n = t.split(";"); + for (const r of n) { + const [i, s] = r.split(":"); + if (!i || s === void 0) break; + const a = Go(i.trim()); + e[a] = s.trim(); + } + return e; +} +const Wo = (t) => t; +function $n(t, e, n, r) { + var i = (t & Ha) !== 0, s = (t & za) !== 0, a = i && s, o = (t & Ba) !== 0, f = a ? "both" : i ? "in" : "out", u, l = e.inert, h = e.style.overflow, c, d; + function p() { + var y = et, x = Q; + ne(null), re(null); + try { + return u ?? (u = n()(e, (r == null ? void 0 : r()) ?? /** @type {P} */ + {}, { + direction: f + })); + } finally { + ne(y), re(x); + } + } + var _ = { + is_global: o, + in() { + var y; + if (e.inert = l, !i) { + d == null || d.abort(), (y = d == null ? void 0 : d.reset) == null || y.call(d); + return; + } + s || c == null || c.abort(), bn(e, "introstart"), c = qr(e, p(), d, 1, () => { + bn(e, "introend"), c == null || c.abort(), c = u = void 0, e.style.overflow = h; + }); + }, + out(y) { + if (!s) { + y == null || y(), u = void 0; + return; + } + e.inert = !0, bn(e, "outrostart"), d = qr(e, p(), c, 0, () => { + bn(e, "outroend"), y == null || y(); + }); + }, + stop: () => { + c == null || c.abort(), d == null || d.abort(); + } + }, m = ( + /** @type {Effect} */ + Q + ); + if ((m.transitions ?? (m.transitions = [])).push(_), i && Ir) { + var w = o; + if (!w) { + for (var $ = ( + /** @type {Effect | null} */ + m.parent + ); $ && $.f & fr; ) + for (; ($ = $.parent) && !($.f & lr); ) + ; + w = !$ || ($.f & ss) !== 0; + } + w && pr(() => { + fn(() => _.in()); + }); + } +} +function qr(t, e, n, r, i) { + var s = r === 1; + if (ja(e)) { + var a, o = !1; + return gn(() => { + if (!o) { + var m = e({ direction: s ? "in" : "out" }); + a = qr(t, m, n, r, i); + } + }), { + abort: () => { + o = !0, a == null || a.abort(); + }, + deactivate: () => a.deactivate(), + reset: () => a.reset(), + t: () => a.t() + }; + } + if (n == null || n.deactivate(), !(e != null && e.duration)) + return i(), { + abort: je, + deactivate: je, + reset: je, + t: () => r + }; + const { delay: f = 0, css: u, tick: l, easing: h = Wo } = e; + var c = []; + if (s && n === void 0 && (l && l(0, 1), u)) { + var d = Di(u(0, 1)); + c.push(d, d); + } + var p = () => 1 - r, _ = t.animate(c, { duration: f }); + return _.onfinish = () => { + var m = (n == null ? void 0 : n.t()) ?? 1 - r; + n == null || n.abort(); + var w = r - m, $ = ( + /** @type {number} */ + e.duration * Math.abs(w) + ), y = []; + if ($ > 0) { + var x = !1; + if (u) + for (var E = Math.ceil($ / 16.666666666666668), b = 0; b <= E; b += 1) { + var T = m + w * h(b / E), P = Di(u(T, 1 - T)); + y.push(P), x || (x = P.overflow === "hidden"); + } + x && (t.style.overflow = "hidden"), p = () => { + var K = ( + /** @type {number} */ + /** @type {globalThis.Animation} */ + _.currentTime + ); + return m + w * h(K / $); + }, l && Xo(() => { + if (_.playState !== "running") return !1; + var K = p(); + return l(K, 1 - K), !0; + }); + } + _ = t.animate(y, { duration: $, fill: "forwards" }), _.onfinish = () => { + p = () => r, l == null || l(r, 1 - r), i(); + }; + }, { + abort: () => { + _ && (_.cancel(), _.effect = null, _.onfinish = je); + }, + deactivate: () => { + i = je; + }, + reset: () => { + r === 0 && (l == null || l(1, 0)); + }, + t: () => p() + }; +} +function Ii(t, e) { + return t === e || (t == null ? void 0 : t[on]) === e; +} +function Kn(t = {}, e, n, r) { + return pr(() => { + var i, s; + return As(() => { + i = s, s = [], fn(() => { + t !== n(...s) && (e(t, ...s), i && Ii(n(...i), t) && e(null, ...i)); + }); + }), () => { + gn(() => { + s && Ii(n(...s), t) && e(null, ...s); + }); + }; + }), t; +} +function ui(t) { + Dt === null && Mo(), Un(() => { + const e = fn(t); + if (typeof e == "function") return ( + /** @type {() => void} */ + e + ); + }); +} +let An = !1; +function Ko(t) { + var e = An; + try { + return An = !1, [t(), An]; + } finally { + An = e; + } +} +function Jo(t, e = 1) { + const n = t(); + return t(n + e), n; +} +function wt(t, e, n, r) { + var E; + var i = (n & Fa) !== 0, s = !0, a = (n & qa) !== 0, o = (n & Va) !== 0, f = !1, u; + a ? [u, f] = Ko(() => ( + /** @type {V} */ + t[e] + )) : u = /** @type {V} */ + t[e]; + var l = on in t || os in t, h = a && (((E = Se(t, e)) == null ? void 0 : E.set) ?? (l && e in t && ((b) => t[e] = b))) || void 0, c = ( + /** @type {V} */ + r + ), d = !0, p = !1, _ = () => (p = !0, d && (d = !1, o ? c = fn( + /** @type {() => V} */ + r + ) : c = /** @type {V} */ + r), c); + u === void 0 && r !== void 0 && (h && s && ao(), u = _(), h && h(u)); + var m; + if (m = () => { + var b = ( + /** @type {V} */ + t[e] + ); + return b === void 0 ? _() : (d = !0, p = !1, b); + }, !(n & La)) + return m; + if (h) { + var w = t.$$legacy; + return function(b, T) { + return arguments.length > 0 ? ((!T || w || f) && h(T ? m() : b), b) : m(); + }; + } + var $ = !1, y = /* @__PURE__ */ ri(u), x = /* @__PURE__ */ cr(() => { + var b = m(), T = v(y); + return $ ? ($ = !1, T) : y.v = b; + }); + return i || (x.equals = ni), function(b, T) { + if (arguments.length > 0) { + const P = T ? v(x) : a ? F(b) : b; + return x.equals(P) || ($ = !0, M(y, P), p && c !== void 0 && (c = P), fn(() => v(x))), b; + } + return v(x); + }; +} +function Zo(t) { + return new jo(t); +} +var fe, Vt; +class jo { + /** + * @param {ComponentConstructorOptions & { + * component: any; + * }} options + */ + constructor(e) { + /** @type {any} */ + kr(this, fe); + /** @type {Record} */ + kr(this, Vt); + var s; + var n = /* @__PURE__ */ new Map(), r = (a, o) => { + var f = /* @__PURE__ */ ri(o); + return n.set(a, f), f; + }; + const i = new Proxy( + { ...e.props || {}, $$events: {} }, + { + get(a, o) { + return v(n.get(o) ?? r(o, Reflect.get(a, o))); + }, + has(a, o) { + return o === os ? !0 : (v(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + }, + set(a, o, f) { + return M(n.get(o) ?? r(o, f), f), Reflect.set(a, o, f); + } + } + ); + Er(this, Vt, (e.hydrate ? Lo : Ds)(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(), Er(this, fe, i.$$events); + for (const a of Object.keys(Ct(this, Vt))) + a === "$set" || a === "$destroy" || a === "$on" || Vn(this, a, { + get() { + return Ct(this, Vt)[a]; + }, + /** @param {any} value */ + set(o) { + Ct(this, Vt)[a] = o; + }, + enumerable: !0 + }); + Ct(this, Vt).$set = /** @param {Record} next */ + (a) => { + Object.assign(i, a); + }, Ct(this, Vt).$destroy = () => { + qo(Ct(this, Vt)); + }; + } + /** @param {Record} props */ + $set(e) { + Ct(this, Vt).$set(e); + } + /** + * @param {string} event + * @param {(...args: any[]) => any} callback + * @returns {any} + */ + $on(e, n) { + Ct(this, fe)[e] = Ct(this, fe)[e] || []; + const r = (...i) => n.call(this, ...i); + return Ct(this, fe)[e].push(r), () => { + Ct(this, fe)[e] = Ct(this, fe)[e].filter( + /** @param {any} fn */ + (i) => i !== r + ); + }; + } + $destroy() { + Ct(this, Vt).$destroy(); + } +} +fe = new WeakMap(), Vt = new WeakMap(); +let qs; +typeof HTMLElement == "function" && (qs = class extends HTMLElement { + /** + * @param {*} $$componentCtor + * @param {*} $$slots + * @param {*} use_shadow_dom + */ + constructor(e, n, r) { + super(); + /** The Svelte component constructor */ + Yt(this, "$$ctor"); + /** Slots */ + Yt(this, "$$s"); + /** @type {any} The Svelte component instance */ + Yt(this, "$$c"); + /** Whether or not the custom element is connected */ + Yt(this, "$$cn", !1); + /** @type {Record} Component props data */ + Yt(this, "$$d", {}); + /** `true` if currently in the process of reflecting component props back to attributes */ + Yt(this, "$$r", !1); + /** @type {Record} Props definition (name, reflected, type etc) */ + Yt(this, "$$p_d", {}); + /** @type {Record} Event listeners */ + Yt(this, "$$l", {}); + /** @type {Map} Event listener unsubscribe functions */ + Yt(this, "$$l_u", /* @__PURE__ */ new Map()); + /** @type {any} The managed render effect for reflecting attributes */ + Yt(this, "$$me"); + this.$$ctor = e, this.$$s = n, r && this.attachShadow({ mode: "open" }); + } + /** + * @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 = document.createElement("slot"); + s !== "default" && (o.name = s), Nt(a, o); + }; + }; + var e = n; + if (await Promise.resolve(), !this.$$cn || this.$$c) + return; + const r = {}, i = Qo(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] = Cn(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 = Zo({ + component: this.$$ctor, + target: this.shadowRoot || this, + props: { + ...this.$$d, + $$slots: r, + $$host: this + } + }), this.$$me = To(() => { + As(() => { + var s; + this.$$r = !0; + for (const a of qn(this.$$c)) { + if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; + this.$$d[a] = this.$$c[a]; + const o = Cn( + 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] = Cn(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 qn(this.$$p_d).find( + (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e + ) || e; + } +}); +function Cn(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 Qo(t) { + const e = {}; + return t.childNodes.forEach((n) => { + e[ + /** @type {Element} node */ + n.slot || "default" + ] = !0; + }), e; +} +function _r(t, e, n, r, i, s) { + let a = class extends qs { + constructor() { + super(t, n, i), this.$$p_d = e; + } + static get observedAttributes() { + return qn(e).map( + (o) => (e[o].attribute || o).toLowerCase() + ); + } + }; + return qn(e).forEach((o) => { + Vn(a.prototype, o, { + get() { + return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; + }, + set(f) { + var h; + f = Cn(o, f, e), this.$$d[o] = f; + var u = this.$$c; + if (u) { + var l = (h = Se(u, o)) == null ? void 0 : h.get; + l ? u[o] = f : u.$set({ [o]: f }); + } + } + }); + }), r.forEach((o) => { + Vn(a.prototype, o, { + get() { + var f; + return (f = this.$$c) == null ? void 0 : f[o]; + } + }); + }), t.element = /** @type {any} */ + a, a; +} +var tl = { value: () => { +} }; +function Vs() { + 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 Mn(n); +} +function Mn(t) { + this._ = t; +} +function el(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 }; + }); +} +Mn.prototype = Vs.prototype = { + constructor: Mn, + on: function(t, e) { + var n = this._, r = el(t + "", n), i, s = -1, a = r.length; + if (arguments.length < 2) { + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = nl(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] = Fi(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = Fi(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 Mn(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 nl(t, e) { + for (var n = 0, r = t.length, i; n < r; ++n) + if ((i = t[n]).name === e) + return i.value; +} +function Fi(t, e, n) { + for (var r = 0, i = t.length; r < i; ++r) + if (t[r].name === e) { + t[r] = tl, t = t.slice(0, r).concat(t.slice(r + 1)); + break; + } + return n != null && t.push({ name: e, value: n }), t; +} +var Vr = "http://www.w3.org/1999/xhtml"; +const Li = { + svg: "http://www.w3.org/2000/svg", + xhtml: Vr, + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" +}; +function mr(t) { + var e = t += "", n = e.indexOf(":"); + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Li.hasOwnProperty(e) ? { space: Li[e], local: t } : t; +} +function rl(t) { + return function() { + var e = this.ownerDocument, n = this.namespaceURI; + return n === Vr && e.documentElement.namespaceURI === Vr ? e.createElement(t) : e.createElementNS(n, t); + }; +} +function il(t) { + return function() { + return this.ownerDocument.createElementNS(t.space, t.local); + }; +} +function Hs(t) { + var e = mr(t); + return (e.local ? il : rl)(e); +} +function sl() { +} +function fi(t) { + return t == null ? sl : function() { + return this.querySelector(t); + }; +} +function al(t) { + typeof t != "function" && (t = fi(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), f, u, l = 0; l < a; ++l) + (f = s[l]) && (u = t.call(f, f.__data__, l, s)) && ("__data__" in f && (u.__data__ = f.__data__), o[l] = u); + return new Ft(r, this._parents); +} +function ol(t) { + return t == null ? [] : Array.isArray(t) ? t : Array.from(t); +} +function ll() { + return []; +} +function zs(t) { + return t == null ? ll : function() { + return this.querySelectorAll(t); + }; +} +function ul(t) { + return function() { + return ol(t.apply(this, arguments)); + }; +} +function fl(t) { + typeof t == "function" ? t = ul(t) : t = zs(t); + for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) + for (var a = e[s], o = a.length, f, u = 0; u < o; ++u) + (f = a[u]) && (r.push(t.call(f, f.__data__, u, a)), i.push(f)); + return new Ft(r, i); +} +function Bs(t) { + return function() { + return this.matches(t); + }; +} +function Ys(t) { + return function(e) { + return e.matches(t); + }; +} +var cl = Array.prototype.find; +function dl(t) { + return function() { + return cl.call(this.children, t); + }; +} +function hl() { + return this.firstElementChild; +} +function vl(t) { + return this.select(t == null ? hl : dl(typeof t == "function" ? t : Ys(t))); +} +var pl = Array.prototype.filter; +function gl() { + return Array.from(this.children); +} +function _l(t) { + return function() { + return pl.call(this.children, t); + }; +} +function ml(t) { + return this.selectAll(t == null ? gl : _l(typeof t == "function" ? t : Ys(t))); +} +function yl(t) { + typeof t != "function" && (t = Bs(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] = [], f, u = 0; u < a; ++u) + (f = s[u]) && t.call(f, f.__data__, u, s) && o.push(f); + return new Ft(r, this._parents); +} +function Us(t) { + return new Array(t.length); +} +function wl() { + return new Ft(this._enter || this._groups.map(Us), this._parents); +} +function Jn(t, e) { + this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; +} +Jn.prototype = { + constructor: Jn, + 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 xl(t) { + return function() { + return t; + }; +} +function bl(t, e, n, r, i, s) { + for (var a = 0, o, f = e.length, u = s.length; a < u; ++a) + (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Jn(t, s[a]); + for (; a < f; ++a) + (o = e[a]) && (i[a] = o); +} +function $l(t, e, n, r, i, s, a) { + var o, f, u = /* @__PURE__ */ new Map(), l = e.length, h = s.length, c = new Array(l), d; + for (o = 0; o < l; ++o) + (f = e[o]) && (c[o] = d = a.call(f, f.__data__, o, e) + "", u.has(d) ? i[o] = f : u.set(d, f)); + for (o = 0; o < h; ++o) + d = a.call(t, s[o], o, s) + "", (f = u.get(d)) ? (r[o] = f, f.__data__ = s[o], u.delete(d)) : n[o] = new Jn(t, s[o]); + for (o = 0; o < l; ++o) + (f = e[o]) && u.get(c[o]) === f && (i[o] = f); +} +function Al(t) { + return t.__data__; +} +function kl(t, e) { + if (!arguments.length) return Array.from(this, Al); + var n = e ? $l : bl, r = this._parents, i = this._groups; + typeof t != "function" && (t = xl(t)); + for (var s = i.length, a = new Array(s), o = new Array(s), f = new Array(s), u = 0; u < s; ++u) { + var l = r[u], h = i[u], c = h.length, d = El(t.call(l, l && l.__data__, u, r)), p = d.length, _ = o[u] = new Array(p), m = a[u] = new Array(p), w = f[u] = new Array(c); + n(l, h, _, m, w, d, e); + for (var $ = 0, y = 0, x, E; $ < p; ++$) + if (x = _[$]) { + for ($ >= y && (y = $ + 1); !(E = m[y]) && ++y < p; ) ; + x._next = E || null; + } + } + return a = new Ft(a, r), a._enter = o, a._exit = f, a; +} +function El(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); +} +function Rl() { + return new Ft(this._exit || this._groups.map(Us), this._parents); +} +function Nl(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 Tl(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), f = 0; f < a; ++f) + for (var u = n[f], l = r[f], h = u.length, c = o[f] = new Array(h), d, p = 0; p < h; ++p) + (d = u[p] || l[p]) && (c[p] = d); + for (; f < i; ++f) + o[f] = n[f]; + return new Ft(o, this._parents); +} +function Sl() { + 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 Cl(t) { + t || (t = Ml); + 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, f = i[s] = new Array(o), u, l = 0; l < o; ++l) + (u = a[l]) && (f[l] = u); + f.sort(e); + } + return new Ft(i, this._parents).order(); +} +function Ml(t, e) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; +} +function Ol() { + var t = arguments[0]; + return arguments[0] = this, t.apply(null, arguments), this; +} +function Pl() { + return Array.from(this); +} +function Dl() { + 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 Il() { + let t = 0; + for (const e of this) ++t; + return t; +} +function Fl() { + return !this.node(); +} +function Ll(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 ql(t) { + return function() { + this.removeAttribute(t); + }; +} +function Vl(t) { + return function() { + this.removeAttributeNS(t.space, t.local); + }; +} +function Hl(t, e) { + return function() { + this.setAttribute(t, e); + }; +} +function zl(t, e) { + return function() { + this.setAttributeNS(t.space, t.local, e); + }; +} +function Bl(t, e) { + return function() { + var n = e.apply(this, arguments); + n == null ? this.removeAttribute(t) : this.setAttribute(t, n); + }; +} +function Yl(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 Ul(t, e) { + var n = mr(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 ? Vl : ql : typeof e == "function" ? n.local ? Yl : Bl : n.local ? zl : Hl)(n, e)); +} +function Xs(t) { + return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; +} +function Xl(t) { + return function() { + this.style.removeProperty(t); + }; +} +function Gl(t, e, n) { + return function() { + this.style.setProperty(t, e, n); + }; +} +function Wl(t, e, n) { + return function() { + var r = e.apply(this, arguments); + r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); + }; +} +function Kl(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? Xl : typeof e == "function" ? Wl : Gl)(t, e, n ?? "")) : Xe(this.node(), t); +} +function Xe(t, e) { + return t.style.getPropertyValue(e) || Xs(t).getComputedStyle(t, null).getPropertyValue(e); +} +function Jl(t) { + return function() { + delete this[t]; + }; +} +function Zl(t, e) { + return function() { + this[t] = e; + }; +} +function jl(t, e) { + return function() { + var n = e.apply(this, arguments); + n == null ? delete this[t] : this[t] = n; + }; +} +function Ql(t, e) { + return arguments.length > 1 ? this.each((e == null ? Jl : typeof e == "function" ? jl : Zl)(t, e)) : this.node()[t]; +} +function Gs(t) { + return t.trim().split(/^|\s+/); +} +function ci(t) { + return t.classList || new Ws(t); +} +function Ws(t) { + this._node = t, this._names = Gs(t.getAttribute("class") || ""); +} +Ws.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 Ks(t, e) { + for (var n = ci(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +} +function Js(t, e) { + for (var n = ci(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +} +function tu(t) { + return function() { + Ks(this, t); + }; +} +function eu(t) { + return function() { + Js(this, t); + }; +} +function nu(t, e) { + return function() { + (e.apply(this, arguments) ? Ks : Js)(this, t); + }; +} +function ru(t, e) { + var n = Gs(t + ""); + if (arguments.length < 2) { + for (var r = ci(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + return !0; + } + return this.each((typeof e == "function" ? nu : e ? tu : eu)(n, e)); +} +function iu() { + this.textContent = ""; +} +function su(t) { + return function() { + this.textContent = t; + }; +} +function au(t) { + return function() { + var e = t.apply(this, arguments); + this.textContent = e ?? ""; + }; +} +function ou(t) { + return arguments.length ? this.each(t == null ? iu : (typeof t == "function" ? au : su)(t)) : this.node().textContent; +} +function lu() { + this.innerHTML = ""; +} +function uu(t) { + return function() { + this.innerHTML = t; + }; +} +function fu(t) { + return function() { + var e = t.apply(this, arguments); + this.innerHTML = e ?? ""; + }; +} +function cu(t) { + return arguments.length ? this.each(t == null ? lu : (typeof t == "function" ? fu : uu)(t)) : this.node().innerHTML; +} +function du() { + this.nextSibling && this.parentNode.appendChild(this); +} +function hu() { + return this.each(du); +} +function vu() { + this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); +} +function pu() { + return this.each(vu); +} +function gu(t) { + var e = typeof t == "function" ? t : Hs(t); + return this.select(function() { + return this.appendChild(e.apply(this, arguments)); + }); +} +function _u() { + return null; +} +function mu(t, e) { + var n = typeof t == "function" ? t : Hs(t), r = e == null ? _u : typeof e == "function" ? e : fi(e); + return this.select(function() { + return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); + }); +} +function yu() { + var t = this.parentNode; + t && t.removeChild(this); +} +function wu() { + return this.each(yu); +} +function xu() { + var t = this.cloneNode(!1), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; +} +function bu() { + var t = this.cloneNode(!0), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; +} +function $u(t) { + return this.select(t ? bu : xu); +} +function Au(t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; +} +function ku(t) { + return function(e) { + t.call(this, e, this.__data__); + }; +} +function Eu(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 Ru(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 Nu(t, e, n) { + return function() { + var r = this.__on, i, s = ku(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 Tu(t, e, n) { + var r = Eu(t + ""), i, s = r.length, a; + if (arguments.length < 2) { + var o = this.node().__on; + if (o) { + for (var f = 0, u = o.length, l; f < u; ++f) + for (i = 0, l = o[f]; i < s; ++i) + if ((a = r[i]).type === l.type && a.name === l.name) + return l.value; + } + return; + } + for (o = e ? Nu : Ru, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + return this; +} +function Zs(t, e, n) { + var r = Xs(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 Su(t, e) { + return function() { + return Zs(this, t, e); + }; +} +function Cu(t, e) { + return function() { + return Zs(this, t, e.apply(this, arguments)); + }; +} +function Mu(t, e) { + return this.each((typeof e == "function" ? Cu : Su)(t, e)); +} +function* Ou() { + 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 js = [null]; +function Ft(t, e) { + this._groups = t, this._parents = e; +} +function Je() { + return new Ft([[document.documentElement]], js); +} +function Pu() { + return this; +} +Ft.prototype = Je.prototype = { + constructor: Ft, + select: al, + selectAll: fl, + selectChild: vl, + selectChildren: ml, + filter: yl, + data: kl, + enter: wl, + exit: Rl, + join: Nl, + merge: Tl, + selection: Pu, + order: Sl, + sort: Cl, + call: Ol, + nodes: Pl, + node: Dl, + size: Il, + empty: Fl, + each: Ll, + attr: Ul, + style: Kl, + property: Ql, + classed: ru, + text: ou, + html: cu, + raise: hu, + lower: pu, + append: gu, + insert: mu, + remove: wu, + clone: $u, + datum: Au, + on: Tu, + dispatch: Mu, + [Symbol.iterator]: Ou +}; +function bt(t) { + return typeof t == "string" ? new Ft([[document.querySelector(t)]], [document.documentElement]) : new Ft([[t]], js); +} +function di(t, e, n) { + t.prototype = e.prototype = n, n.constructor = t; +} +function Qs(t, e) { + var n = Object.create(t.prototype); + for (var r in e) n[r] = e[r]; + return n; +} +function wn() { +} +var dn = 0.7, Zn = 1 / dn, Ye = "\\s*([+-]?\\d+)\\s*", hn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", ee = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Du = /^#([0-9a-f]{3,8})$/, Iu = new RegExp(`^rgb\\(${Ye},${Ye},${Ye}\\)$`), Fu = new RegExp(`^rgb\\(${ee},${ee},${ee}\\)$`), Lu = new RegExp(`^rgba\\(${Ye},${Ye},${Ye},${hn}\\)$`), qu = new RegExp(`^rgba\\(${ee},${ee},${ee},${hn}\\)$`), Vu = new RegExp(`^hsl\\(${hn},${ee},${ee}\\)$`), Hu = new RegExp(`^hsla\\(${hn},${ee},${ee},${hn}\\)$`), qi = { + 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 +}; +di(wn, Pe, { + copy(t) { + return Object.assign(new this.constructor(), this, t); + }, + displayable() { + return this.rgb().displayable(); + }, + hex: Vi, + // Deprecated! Use color.formatHex. + formatHex: Vi, + formatHex8: zu, + formatHsl: Bu, + formatRgb: Hi, + toString: Hi +}); +function Vi() { + return this.rgb().formatHex(); +} +function zu() { + return this.rgb().formatHex8(); +} +function Bu() { + return ta(this).formatHsl(); +} +function Hi() { + return this.rgb().formatRgb(); +} +function Pe(t) { + var e, n; + return t = (t + "").trim().toLowerCase(), (e = Du.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? zi(e) : n === 3 ? new Pt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? kn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? kn(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 = Iu.exec(t)) ? new Pt(e[1], e[2], e[3], 1) : (e = Fu.exec(t)) ? new Pt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Lu.exec(t)) ? kn(e[1], e[2], e[3], e[4]) : (e = qu.exec(t)) ? kn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Vu.exec(t)) ? Ui(e[1], e[2] / 100, e[3] / 100, 1) : (e = Hu.exec(t)) ? Ui(e[1], e[2] / 100, e[3] / 100, e[4]) : qi.hasOwnProperty(t) ? zi(qi[t]) : t === "transparent" ? new Pt(NaN, NaN, NaN, 0) : null; +} +function zi(t) { + return new Pt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +} +function kn(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new Pt(t, e, n, r); +} +function Yu(t) { + return t instanceof wn || (t = Pe(t)), t ? (t = t.rgb(), new Pt(t.r, t.g, t.b, t.opacity)) : new Pt(); +} +function Hr(t, e, n, r) { + return arguments.length === 1 ? Yu(t) : new Pt(t, e, n, r ?? 1); +} +function Pt(t, e, n, r) { + this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; +} +di(Pt, Hr, Qs(wn, { + brighter(t) { + return t = t == null ? Zn : Math.pow(Zn, t), new Pt(this.r * t, this.g * t, this.b * t, this.opacity); + }, + darker(t) { + return t = t == null ? dn : Math.pow(dn, t), new Pt(this.r * t, this.g * t, this.b * t, this.opacity); + }, + rgb() { + return this; + }, + clamp() { + return new Pt(Oe(this.r), Oe(this.g), Oe(this.b), jn(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: Bi, + // Deprecated! Use color.formatHex. + formatHex: Bi, + formatHex8: Uu, + formatRgb: Yi, + toString: Yi +})); +function Bi() { + return `#${Te(this.r)}${Te(this.g)}${Te(this.b)}`; +} +function Uu() { + return `#${Te(this.r)}${Te(this.g)}${Te(this.b)}${Te((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +} +function Yi() { + const t = jn(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${Oe(this.r)}, ${Oe(this.g)}, ${Oe(this.b)}${t === 1 ? ")" : `, ${t})`}`; +} +function jn(t) { + return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); +} +function Oe(t) { + return Math.max(0, Math.min(255, Math.round(t) || 0)); +} +function Te(t) { + return t = Oe(t), (t < 16 ? "0" : "") + t.toString(16); +} +function Ui(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Xt(t, e, n, r); +} +function ta(t) { + if (t instanceof Xt) return new Xt(t.h, t.s, t.l, t.opacity); + if (t instanceof wn || (t = Pe(t)), !t) return new Xt(); + if (t instanceof Xt) 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, f = (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 /= f < 0.5 ? s + i : 2 - s - i, a *= 60) : o = f > 0 && f < 1 ? 0 : a, new Xt(a, o, f, t.opacity); +} +function Xu(t, e, n, r) { + return arguments.length === 1 ? ta(t) : new Xt(t, e, n, r ?? 1); +} +function Xt(t, e, n, r) { + this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; +} +di(Xt, Xu, Qs(wn, { + brighter(t) { + return t = t == null ? Zn : Math.pow(Zn, t), new Xt(this.h, this.s, this.l * t, this.opacity); + }, + darker(t) { + return t = t == null ? dn : Math.pow(dn, t), new Xt(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 Pt( + Rr(t >= 240 ? t - 240 : t + 120, i, r), + Rr(t, i, r), + Rr(t < 120 ? t + 240 : t - 120, i, r), + this.opacity + ); + }, + clamp() { + return new Xt(Xi(this.h), En(this.s), En(this.l), jn(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 = jn(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${Xi(this.h)}, ${En(this.s) * 100}%, ${En(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + } +})); +function Xi(t) { + return t = (t || 0) % 360, t < 0 ? t + 360 : t; +} +function En(t) { + return Math.max(0, Math.min(1, t || 0)); +} +function Rr(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 hi = (t) => () => t; +function Gu(t, e) { + return function(n) { + return t + n * e; + }; +} +function Wu(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 Ku(t) { + return (t = +t) == 1 ? ea : function(e, n) { + return n - e ? Wu(e, n, t) : hi(isNaN(e) ? n : e); + }; +} +function ea(t, e) { + var n = e - t; + return n ? Gu(t, n) : hi(isNaN(t) ? e : t); +} +const Qn = function t(e) { + var n = Ku(e); + function r(i, s) { + var a = n((i = Hr(i)).r, (s = Hr(s)).r), o = n(i.g, s.g), f = n(i.b, s.b), u = ea(i.opacity, s.opacity); + return function(l) { + return i.r = a(l), i.g = o(l), i.b = f(l), i.opacity = u(l), i + ""; + }; + } + return r.gamma = t, r; +}(1); +function Ju(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 Zu(t) { + return ArrayBuffer.isView(t) && !(t instanceof DataView); +} +function ju(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] = ze(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 Qu(t, e) { + var n = /* @__PURE__ */ new Date(); + return t = +t, e = +e, function(r) { + return n.setTime(t * (1 - r) + e * r), n; + }; +} +function jt(t, e) { + return t = +t, e = +e, function(n) { + return t * (1 - n) + e * n; + }; +} +function tf(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] = ze(t[i], e[i]) : r[i] = e[i]; + return function(s) { + for (i in n) r[i] = n[i](s); + return r; + }; +} +var zr = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Nr = new RegExp(zr.source, "g"); +function ef(t) { + return function() { + return t; + }; +} +function nf(t) { + return function(e) { + return t(e) + ""; + }; +} +function na(t, e) { + var n = zr.lastIndex = Nr.lastIndex = 0, r, i, s, a = -1, o = [], f = []; + for (t = t + "", e = e + ""; (r = zr.exec(t)) && (i = Nr.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, f.push({ i: a, x: jt(r, i) })), n = Nr.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? f[0] ? nf(f[0].x) : ef(e) : (e = f.length, function(u) { + for (var l = 0, h; l < e; ++l) o[(h = f[l]).i] = h.x(u); + return o.join(""); + }); +} +function ze(t, e) { + var n = typeof e, r; + return e == null || n === "boolean" ? hi(e) : (n === "number" ? jt : n === "string" ? (r = Pe(e)) ? (e = r, Qn) : na : e instanceof Pe ? Qn : e instanceof Date ? Qu : Zu(e) ? Ju : Array.isArray(e) ? ju : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? tf : jt)(t, e); +} +var Gi = 180 / Math.PI, Br = { + translateX: 0, + translateY: 0, + rotate: 0, + skewX: 0, + scaleX: 1, + scaleY: 1 +}; +function ra(t, e, n, r, i, s) { + var a, o, f; + return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (f = t * n + e * r) && (n -= t * f, r -= e * f), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, f /= o), t * r < e * n && (t = -t, e = -e, f = -f, a = -a), { + translateX: i, + translateY: s, + rotate: Math.atan2(e, t) * Gi, + skewX: Math.atan(f) * Gi, + scaleX: a, + scaleY: o + }; +} +var Rn; +function rf(t) { + const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); + return e.isIdentity ? Br : ra(e.a, e.b, e.c, e.d, e.e, e.f); +} +function sf(t) { + return t == null || (Rn || (Rn = document.createElementNS("http://www.w3.org/2000/svg", "g")), Rn.setAttribute("transform", t), !(t = Rn.transform.baseVal.consolidate())) ? Br : (t = t.matrix, ra(t.a, t.b, t.c, t.d, t.e, t.f)); +} +function ia(t, e, n, r) { + function i(u) { + return u.length ? u.pop() + " " : ""; + } + function s(u, l, h, c, d, p) { + if (u !== h || l !== c) { + var _ = d.push("translate(", null, e, null, n); + p.push({ i: _ - 4, x: jt(u, h) }, { i: _ - 2, x: jt(l, c) }); + } else (h || c) && d.push("translate(" + h + e + c + n); + } + function a(u, l, h, c) { + u !== l ? (u - l > 180 ? l += 360 : l - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: jt(u, l) })) : l && h.push(i(h) + "rotate(" + l + r); + } + function o(u, l, h, c) { + u !== l ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: jt(u, l) }) : l && h.push(i(h) + "skewX(" + l + r); + } + function f(u, l, h, c, d, p) { + if (u !== h || l !== c) { + var _ = d.push(i(d) + "scale(", null, ",", null, ")"); + p.push({ i: _ - 4, x: jt(u, h) }, { i: _ - 2, x: jt(l, c) }); + } else (h !== 1 || c !== 1) && d.push(i(d) + "scale(" + h + "," + c + ")"); + } + return function(u, l) { + var h = [], c = []; + return u = t(u), l = t(l), s(u.translateX, u.translateY, l.translateX, l.translateY, h, c), a(u.rotate, l.rotate, h, c), o(u.skewX, l.skewX, h, c), f(u.scaleX, u.scaleY, l.scaleX, l.scaleY, h, c), u = l = null, function(d) { + for (var p = -1, _ = c.length, m; ++p < _; ) h[(m = c[p]).i] = m.x(d); + return h.join(""); + }; + }; +} +var af = ia(rf, "px, ", "px)", "deg)"), of = ia(sf, ", ", ")", ")"), Ge = 0, nn = 0, Qe = 0, sa = 1e3, tr, rn, er = 0, De = 0, yr = 0, vn = typeof performance == "object" && performance.now ? performance : Date, aa = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { + setTimeout(t, 17); +}; +function vi() { + return De || (aa(lf), De = vn.now() + yr); +} +function lf() { + De = 0; +} +function nr() { + this._call = this._time = this._next = null; +} +nr.prototype = oa.prototype = { + constructor: nr, + restart: function(t, e, n) { + if (typeof t != "function") throw new TypeError("callback is not a function"); + n = (n == null ? vi() : +n) + (e == null ? 0 : +e), !this._next && rn !== this && (rn ? rn._next = this : tr = this, rn = this), this._call = t, this._time = n, Yr(); + }, + stop: function() { + this._call && (this._call = null, this._time = 1 / 0, Yr()); + } +}; +function oa(t, e, n) { + var r = new nr(); + return r.restart(t, e, n), r; +} +function uf() { + vi(), ++Ge; + for (var t = tr, e; t; ) + (e = De - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --Ge; +} +function Wi() { + De = (er = vn.now()) + yr, Ge = nn = 0; + try { + uf(); + } finally { + Ge = 0, cf(), De = 0; + } +} +function ff() { + var t = vn.now(), e = t - er; + e > sa && (yr -= e, er = t); +} +function cf() { + for (var t, e = tr, 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 : tr = n); + rn = t, Yr(r); +} +function Yr(t) { + if (!Ge) { + nn && (nn = clearTimeout(nn)); + var e = t - De; + e > 24 ? (t < 1 / 0 && (nn = setTimeout(Wi, t - vn.now() - yr)), Qe && (Qe = clearInterval(Qe))) : (Qe || (er = vn.now(), Qe = setInterval(ff, sa)), Ge = 1, aa(Wi)); + } +} +function Ki(t, e, n) { + var r = new nr(); + return e = e == null ? 0 : +e, r.restart((i) => { + r.stop(), t(i + e); + }, e, n), r; +} +var df = Vs("start", "end", "cancel", "interrupt"), hf = [], la = 0, Ji = 1, Ur = 2, On = 3, Zi = 4, Xr = 5, Pn = 6; +function wr(t, e, n, r, i, s) { + var a = t.__transition; + if (!a) t.__transition = {}; + else if (n in a) return; + vf(t, n, { + name: e, + index: r, + // For context during callback. + group: i, + // For context during callback. + on: df, + tween: hf, + time: s.time, + delay: s.delay, + duration: s.duration, + ease: s.ease, + timer: null, + state: la + }); +} +function pi(t, e) { + var n = Kt(t, e); + if (n.state > la) throw new Error("too late; already scheduled"); + return n; +} +function se(t, e) { + var n = Kt(t, e); + if (n.state > On) throw new Error("too late; already running"); + return n; +} +function Kt(t, e) { + var n = t.__transition; + if (!n || !(n = n[e])) throw new Error("transition not found"); + return n; +} +function vf(t, e, n) { + var r = t.__transition, i; + r[e] = n, n.timer = oa(s, 0, n.time); + function s(u) { + n.state = Ji, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + } + function a(u) { + var l, h, c, d; + if (n.state !== Ji) return f(); + for (l in r) + if (d = r[l], d.name === n.name) { + if (d.state === On) return Ki(a); + d.state === Zi ? (d.state = Pn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[l]) : +l < e && (d.state = Pn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[l]); + } + if (Ki(function() { + n.state === On && (n.state = Zi, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = Ur, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Ur) { + for (n.state = On, i = new Array(c = n.tween.length), l = 0, h = -1; l < c; ++l) + (d = n.tween[l].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d); + i.length = h + 1; + } + } + function o(u) { + for (var l = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(f), n.state = Xr, 1), h = -1, c = i.length; ++h < c; ) + i[h].call(t, l); + n.state === Xr && (n.on.call("end", t, t.__data__, n.index, n.group), f()); + } + function f() { + n.state = Pn, n.timer.stop(), delete r[e]; + for (var u in r) return; + delete t.__transition; + } +} +function pf(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 > Ur && r.state < Xr, r.state = Pn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + } + s && delete t.__transition; + } +} +function gf(t) { + return this.each(function() { + pf(this, t); + }); +} +function _f(t, e) { + var n, r; + return function() { + var i = se(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 mf(t, e, n) { + var r, i; + if (typeof n != "function") throw new Error(); + return function() { + var s = se(this, t), a = s.tween; + if (a !== r) { + i = (r = a).slice(); + for (var o = { name: e, value: n }, f = 0, u = i.length; f < u; ++f) + if (i[f].name === e) { + i[f] = o; + break; + } + f === u && i.push(o); + } + s.tween = i; + }; +} +function yf(t, e) { + var n = this._id; + if (t += "", arguments.length < 2) { + for (var r = Kt(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 ? _f : mf)(n, t, e)); +} +function gi(t, e, n) { + var r = t._id; + return t.each(function() { + var i = se(this, r); + (i.value || (i.value = {}))[e] = n.apply(this, arguments); + }), function(i) { + return Kt(i, r).value[e]; + }; +} +function ua(t, e) { + var n; + return (typeof e == "number" ? jt : e instanceof Pe ? Qn : (n = Pe(e)) ? (e = n, Qn) : na)(t, e); +} +function wf(t) { + return function() { + this.removeAttribute(t); + }; +} +function xf(t) { + return function() { + this.removeAttributeNS(t.space, t.local); + }; +} +function bf(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 $f(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 Af(t, e, n) { + var r, i, s; + return function() { + var a, o = n(this), f; + return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), f = o + "", a === f ? null : a === r && f === i ? s : (i = f, s = e(r = a, o))); + }; +} +function kf(t, e, n) { + var r, i, s; + return function() { + var a, o = n(this), f; + return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), f = o + "", a === f ? null : a === r && f === i ? s : (i = f, s = e(r = a, o))); + }; +} +function Ef(t, e) { + var n = mr(t), r = n === "transform" ? of : ua; + return this.attrTween(t, typeof e == "function" ? (n.local ? kf : Af)(n, r, gi(this, "attr." + t, e)) : e == null ? (n.local ? xf : wf)(n) : (n.local ? $f : bf)(n, r, e)); +} +function Rf(t, e) { + return function(n) { + this.setAttribute(t, e.call(this, n)); + }; +} +function Nf(t, e) { + return function(n) { + this.setAttributeNS(t.space, t.local, e.call(this, n)); + }; +} +function Tf(t, e) { + var n, r; + function i() { + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && Nf(t, s)), n; + } + return i._value = e, i; +} +function Sf(t, e) { + var n, r; + function i() { + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && Rf(t, s)), n; + } + return i._value = e, i; +} +function Cf(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 = mr(t); + return this.tween(n, (r.local ? Tf : Sf)(r, e)); +} +function Mf(t, e) { + return function() { + pi(this, t).delay = +e.apply(this, arguments); + }; +} +function Of(t, e) { + return e = +e, function() { + pi(this, t).delay = e; + }; +} +function Pf(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? Mf : Of)(e, t)) : Kt(this.node(), e).delay; +} +function Df(t, e) { + return function() { + se(this, t).duration = +e.apply(this, arguments); + }; +} +function If(t, e) { + return e = +e, function() { + se(this, t).duration = e; + }; +} +function Ff(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? Df : If)(e, t)) : Kt(this.node(), e).duration; +} +function Lf(t, e) { + if (typeof e != "function") throw new Error(); + return function() { + se(this, t).ease = e; + }; +} +function qf(t) { + var e = this._id; + return arguments.length ? this.each(Lf(e, t)) : Kt(this.node(), e).ease; +} +function Vf(t, e) { + return function() { + var n = e.apply(this, arguments); + if (typeof n != "function") throw new Error(); + se(this, t).ease = n; + }; +} +function Hf(t) { + if (typeof t != "function") throw new Error(); + return this.each(Vf(this._id, t)); +} +function zf(t) { + typeof t != "function" && (t = Bs(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] = [], f, u = 0; u < a; ++u) + (f = s[u]) && t.call(f, f.__data__, u, s) && o.push(f); + return new ge(r, this._parents, this._name, this._id); +} +function Bf(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 f = e[o], u = n[o], l = f.length, h = a[o] = new Array(l), c, d = 0; d < l; ++d) + (c = f[d] || u[d]) && (h[d] = c); + for (; o < r; ++o) + a[o] = e[o]; + return new ge(a, this._parents, this._name, this._id); +} +function Yf(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 Uf(t, e, n) { + var r, i, s = Yf(e) ? pi : se; + return function() { + var a = s(this, t), o = a.on; + o !== r && (i = (r = o).copy()).on(e, n), a.on = i; + }; +} +function Xf(t, e) { + var n = this._id; + return arguments.length < 2 ? Kt(this.node(), n).on.on(t) : this.each(Uf(n, t, e)); +} +function Gf(t) { + return function() { + var e = this.parentNode; + for (var n in this.__transition) if (+n !== t) return; + e && e.removeChild(this); + }; +} +function Wf() { + return this.on("end.remove", Gf(this._id)); +} +function Kf(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = fi(t)); + for (var r = this._groups, i = r.length, s = new Array(i), a = 0; a < i; ++a) + for (var o = r[a], f = o.length, u = s[a] = new Array(f), l, h, c = 0; c < f; ++c) + (l = o[c]) && (h = t.call(l, l.__data__, c, o)) && ("__data__" in l && (h.__data__ = l.__data__), u[c] = h, wr(u[c], e, n, c, u, Kt(l, n))); + return new ge(s, this._parents, e, n); +} +function Jf(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = zs(t)); + for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) + for (var f = r[o], u = f.length, l, h = 0; h < u; ++h) + if (l = f[h]) { + for (var c = t.call(l, l.__data__, h, f), d, p = Kt(l, n), _ = 0, m = c.length; _ < m; ++_) + (d = c[_]) && wr(d, e, n, _, c, p); + s.push(c), a.push(l); + } + return new ge(s, a, e, n); +} +var Zf = Je.prototype.constructor; +function jf() { + return new Zf(this._groups, this._parents); +} +function Qf(t, e) { + var n, r, i; + return function() { + var s = Xe(this, t), a = (this.style.removeProperty(t), Xe(this, t)); + return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); + }; +} +function fa(t) { + return function() { + this.style.removeProperty(t); + }; +} +function tc(t, e, n) { + var r, i = n + "", s; + return function() { + var a = Xe(this, t); + return a === i ? null : a === r ? s : s = e(r = a, n); + }; +} +function ec(t, e, n) { + var r, i, s; + return function() { + var a = Xe(this, t), o = n(this), f = o + ""; + return o == null && (f = o = (this.style.removeProperty(t), Xe(this, t))), a === f ? null : a === r && f === i ? s : (i = f, s = e(r = a, o)); + }; +} +function nc(t, e) { + var n, r, i, s = "style." + e, a = "end." + s, o; + return function() { + var f = se(this, t), u = f.on, l = f.value[s] == null ? o || (o = fa(e)) : void 0; + (u !== n || i !== l) && (r = (n = u).copy()).on(a, i = l), f.on = r; + }; +} +function rc(t, e, n) { + var r = (t += "") == "transform" ? af : ua; + return e == null ? this.styleTween(t, Qf(t, r)).on("end.style." + t, fa(t)) : typeof e == "function" ? this.styleTween(t, ec(t, r, gi(this, "style." + t, e))).each(nc(this._id, t)) : this.styleTween(t, tc(t, r, e), n).on("end.style." + t, null); +} +function ic(t, e, n) { + return function(r) { + this.style.setProperty(t, e.call(this, r), n); + }; +} +function sc(t, e, n) { + var r, i; + function s() { + var a = e.apply(this, arguments); + return a !== i && (r = (i = a) && ic(t, a, n)), r; + } + return s._value = e, s; +} +function ac(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, sc(t, e, n ?? "")); +} +function oc(t) { + return function() { + this.textContent = t; + }; +} +function lc(t) { + return function() { + var e = t(this); + this.textContent = e ?? ""; + }; +} +function uc(t) { + return this.tween("text", typeof t == "function" ? lc(gi(this, "text", t)) : oc(t == null ? "" : t + "")); +} +function fc(t) { + return function(e) { + this.textContent = t.call(this, e); + }; +} +function cc(t) { + var e, n; + function r() { + var i = t.apply(this, arguments); + return i !== n && (e = (n = i) && fc(i)), e; + } + return r._value = t, r; +} +function dc(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, cc(t)); +} +function hc() { + for (var t = this._name, e = this._id, n = ca(), r = this._groups, i = r.length, s = 0; s < i; ++s) + for (var a = r[s], o = a.length, f, u = 0; u < o; ++u) + if (f = a[u]) { + var l = Kt(f, e); + wr(f, t, n, u, a, { + time: l.time + l.delay + l.duration, + delay: 0, + duration: l.duration, + ease: l.ease + }); + } + return new ge(r, this._parents, t, n); +} +function vc() { + var t, e, n = this, r = n._id, i = n.size(); + return new Promise(function(s, a) { + var o = { value: a }, f = { value: function() { + --i === 0 && s(); + } }; + n.each(function() { + var u = se(this, r), l = u.on; + l !== t && (e = (t = l).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(f)), u.on = e; + }), i === 0 && s(); + }); +} +var pc = 0; +function ge(t, e, n, r) { + this._groups = t, this._parents = e, this._name = n, this._id = r; +} +function Dn(t) { + return Je().transition(t); +} +function ca() { + return ++pc; +} +var oe = Je.prototype; +ge.prototype = Dn.prototype = { + constructor: ge, + select: Kf, + selectAll: Jf, + selectChild: oe.selectChild, + selectChildren: oe.selectChildren, + filter: zf, + merge: Bf, + selection: jf, + transition: hc, + call: oe.call, + nodes: oe.nodes, + node: oe.node, + size: oe.size, + empty: oe.empty, + each: oe.each, + on: Xf, + attr: Ef, + attrTween: Cf, + style: rc, + styleTween: ac, + text: uc, + textTween: dc, + remove: Wf, + tween: yf, + delay: Pf, + duration: Ff, + ease: qf, + easeVarying: Hf, + end: vc, + [Symbol.iterator]: oe[Symbol.iterator] +}; +function gc(t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +} +var _c = { + time: null, + // Set on use. + delay: 0, + duration: 250, + ease: gc +}; +function mc(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 yc(t) { + var e, n; + t instanceof ge ? (e = t._id, t = t._name) : (e = ca(), (n = _c).time = vi(), 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, f, u = 0; u < o; ++u) + (f = a[u]) && wr(f, t, e, u, a, n || mc(f, e)); + return new ge(r, this._parents, t, e); +} +Je.prototype.interrupt = gf; +Je.prototype.transition = yc; +const Gr = Math.PI, Wr = 2 * Gr, Re = 1e-6, wc = Wr - Re; +function da(t) { + this._ += t[0]; + for (let e = 1, n = t.length; e < n; ++e) + this._ += arguments[e] + t[e]; +} +function xc(t) { + let e = Math.floor(t); + if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); + if (e > 15) return da; + 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 bc { + constructor(e) { + this._x0 = this._y0 = // start of current subpath + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? da : xc(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, f = r - e, u = i - n, l = a - e, h = o - n, c = l * l + h * h; + if (this._x1 === null) + this._append`M${this._x1 = e},${this._y1 = n}`; + else if (c > Re) if (!(Math.abs(h * f - u * l) > Re) || !s) + this._append`L${this._x1 = e},${this._y1 = n}`; + else { + let d = r - a, p = i - o, _ = f * f + u * u, m = d * d + p * p, w = Math.sqrt(_), $ = Math.sqrt(c), y = s * Math.tan((Gr - Math.acos((_ + c - m) / (2 * w * $))) / 2), x = y / $, E = y / w; + Math.abs(x - 1) > Re && this._append`L${e + x * l},${n + x * h}`, this._append`A${s},${s},0,0,${+(h * d > l * p)},${this._x1 = e + E * f},${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), f = r * Math.sin(i), u = e + o, l = n + f, h = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${u},${l}` : (Math.abs(this._x1 - u) > Re || Math.abs(this._y1 - l) > Re) && this._append`L${u},${l}`, r && (c < 0 && (c = c % Wr + Wr), c > wc ? this._append`A${r},${r},0,1,${h},${e - o},${n - f}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = l}` : c > Re && this._append`A${r},${r},0,${+(c >= Gr)},${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 $c(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 Ac = $c("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Rt(t) { + return function() { + return t; + }; +} +const ji = Math.abs, At = Math.atan2, Ee = Math.cos, kc = Math.max, Tr = Math.min, Zt = Math.sin, Be = Math.sqrt, Ot = 1e-12, pn = Math.PI, rr = pn / 2, In = 2 * pn; +function Ec(t) { + return t > 1 ? 0 : t < -1 ? pn : Math.acos(t); +} +function Qi(t) { + return t >= 1 ? rr : t <= -1 ? -rr : Math.asin(t); +} +function Rc(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 bc(e); +} +function Nc(t) { + return t.innerRadius; +} +function Tc(t) { + return t.outerRadius; +} +function Sc(t) { + return t.startAngle; +} +function Cc(t) { + return t.endAngle; +} +function Mc(t) { + return t && t.padAngle; +} +function Oc(t, e, n, r, i, s, a, o) { + var f = n - t, u = r - e, l = a - i, h = o - s, c = h * f - l * u; + if (!(c * c < Ot)) + return c = (l * (e - s) - h * (t - i)) / c, [t + c * f, e + c * u]; +} +function Nn(t, e, n, r, i, s, a) { + var o = t - n, f = e - r, u = (a ? s : -s) / Be(o * o + f * f), l = u * f, h = -u * o, c = t + l, d = e + h, p = n + l, _ = r + h, m = (c + p) / 2, w = (d + _) / 2, $ = p - c, y = _ - d, x = $ * $ + y * y, E = i - s, b = c * _ - p * d, T = (y < 0 ? -1 : 1) * Be(kc(0, E * E * x - b * b)), P = (b * y - $ * T) / x, K = (-b * $ - y * T) / x, rt = (b * y + $ * T) / x, J = (-b * $ + y * T) / x, ot = P - m, C = K - w, O = rt - m, xt = J - w; + return ot * ot + C * C > O * O + xt * xt && (P = rt, K = J), { + cx: P, + cy: K, + x01: -l, + y01: -h, + x11: P * (i / E - 1), + y11: K * (i / E - 1) + }; +} +function le() { + var t = Nc, e = Tc, n = Rt(0), r = null, i = Sc, s = Cc, a = Mc, o = null, f = Rc(u); + function u() { + var l, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - rr, _ = s.apply(this, arguments) - rr, m = ji(_ - p), w = _ > p; + if (o || (o = l = f()), d < c && (h = d, d = c, c = h), !(d > Ot)) o.moveTo(0, 0); + else if (m > In - Ot) + o.moveTo(d * Ee(p), d * Zt(p)), o.arc(0, 0, d, p, _, !w), c > Ot && (o.moveTo(c * Ee(_), c * Zt(_)), o.arc(0, 0, c, _, p, w)); + else { + var $ = p, y = _, x = p, E = _, b = m, T = m, P = a.apply(this, arguments) / 2, K = P > Ot && (r ? +r.apply(this, arguments) : Be(c * c + d * d)), rt = Tr(ji(d - c) / 2, +n.apply(this, arguments)), J = rt, ot = rt, C, O; + if (K > Ot) { + var xt = Qi(K / c * Zt(P)), _t = Qi(K / d * Zt(P)); + (b -= xt * 2) > Ot ? (xt *= w ? 1 : -1, x += xt, E -= xt) : (b = 0, x = E = (p + _) / 2), (T -= _t * 2) > Ot ? (_t *= w ? 1 : -1, $ += _t, y -= _t) : (T = 0, $ = y = (p + _) / 2); + } + var yt = d * Ee($), pt = d * Zt($), Lt = c * Ee(E), R = c * Zt(E); + if (rt > Ot) { + var q = d * Ee(y), N = d * Zt(y), ut = c * Ee(x), U = c * Zt(x), j; + if (m < pn) + if (j = Oc(yt, pt, ut, U, q, N, Lt, R)) { + var ct = yt - j[0], W = pt - j[1], ft = q - j[0], St = N - j[1], A = 1 / Zt(Ec((ct * ft + W * St) / (Be(ct * ct + W * W) * Be(ft * ft + St * St))) / 2), z = Be(j[0] * j[0] + j[1] * j[1]); + J = Tr(rt, (c - z) / (A - 1)), ot = Tr(rt, (d - z) / (A + 1)); + } else + J = ot = 0; + } + T > Ot ? ot > Ot ? (C = Nn(ut, U, yt, pt, d, ot, w), O = Nn(q, N, Lt, R, d, ot, w), o.moveTo(C.cx + C.x01, C.cy + C.y01), ot < rt ? o.arc(C.cx, C.cy, ot, At(C.y01, C.x01), At(O.y01, O.x01), !w) : (o.arc(C.cx, C.cy, ot, At(C.y01, C.x01), At(C.y11, C.x11), !w), o.arc(0, 0, d, At(C.cy + C.y11, C.cx + C.x11), At(O.cy + O.y11, O.cx + O.x11), !w), o.arc(O.cx, O.cy, ot, At(O.y11, O.x11), At(O.y01, O.x01), !w))) : (o.moveTo(yt, pt), o.arc(0, 0, d, $, y, !w)) : o.moveTo(yt, pt), !(c > Ot) || !(b > Ot) ? o.lineTo(Lt, R) : J > Ot ? (C = Nn(Lt, R, q, N, c, -J, w), O = Nn(yt, pt, ut, U, c, -J, w), o.lineTo(C.cx + C.x01, C.cy + C.y01), J < rt ? o.arc(C.cx, C.cy, J, At(C.y01, C.x01), At(O.y01, O.x01), !w) : (o.arc(C.cx, C.cy, J, At(C.y01, C.x01), At(C.y11, C.x11), !w), o.arc(0, 0, c, At(C.cy + C.y11, C.cx + C.x11), At(O.cy + O.y11, O.cx + O.x11), w), o.arc(O.cx, O.cy, J, At(O.y11, O.x11), At(O.y01, O.x01), !w))) : o.arc(0, 0, c, E, x, w); + } + if (o.closePath(), l) return o = null, l + "" || null; + } + return u.centroid = function() { + var l = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - pn / 2; + return [Ee(h) * l, Zt(h) * l]; + }, u.innerRadius = function(l) { + return arguments.length ? (t = typeof l == "function" ? l : Rt(+l), u) : t; + }, u.outerRadius = function(l) { + return arguments.length ? (e = typeof l == "function" ? l : Rt(+l), u) : e; + }, u.cornerRadius = function(l) { + return arguments.length ? (n = typeof l == "function" ? l : Rt(+l), u) : n; + }, u.padRadius = function(l) { + return arguments.length ? (r = l == null ? null : typeof l == "function" ? l : Rt(+l), u) : r; + }, u.startAngle = function(l) { + return arguments.length ? (i = typeof l == "function" ? l : Rt(+l), u) : i; + }, u.endAngle = function(l) { + return arguments.length ? (s = typeof l == "function" ? l : Rt(+l), u) : s; + }, u.padAngle = function(l) { + return arguments.length ? (a = typeof l == "function" ? l : Rt(+l), u) : a; + }, u.context = function(l) { + return arguments.length ? (o = l ?? null, u) : o; + }, u; +} +function Pc(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); +} +function Dc(t, e) { + return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; +} +function Ic(t) { + return t; +} +function Sr() { + var t = Ic, e = Dc, n = null, r = Rt(0), i = Rt(In), s = Rt(0); + function a(o) { + var f, u = (o = Pc(o)).length, l, h, c = 0, d = new Array(u), p = new Array(u), _ = +r.apply(this, arguments), m = Math.min(In, Math.max(-In, i.apply(this, arguments) - _)), w, $ = Math.min(Math.abs(m) / u, s.apply(this, arguments)), y = $ * (m < 0 ? -1 : 1), x; + for (f = 0; f < u; ++f) + (x = p[d[f] = f] = +t(o[f], f, o)) > 0 && (c += x); + for (e != null ? d.sort(function(E, b) { + return e(p[E], p[b]); + }) : n != null && d.sort(function(E, b) { + return n(o[E], o[b]); + }), f = 0, h = c ? (m - u * y) / c : 0; f < u; ++f, _ = w) + l = d[f], x = p[l], w = _ + (x > 0 ? x * h : 0) + y, p[l] = { + data: o[l], + index: f, + value: x, + startAngle: _, + endAngle: w, + padAngle: $ + }; + return p; + } + return a.value = function(o) { + return arguments.length ? (t = typeof o == "function" ? o : Rt(+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 : Rt(+o), a) : r; + }, a.endAngle = function(o) { + return arguments.length ? (i = typeof o == "function" ? o : Rt(+o), a) : i; + }, a.padAngle = function(o) { + return arguments.length ? (s = typeof o == "function" ? o : Rt(+o), a) : s; + }, a; +} +function sn(t, e, n) { + this.k = t, this.x = e, this.y = n; +} +sn.prototype = { + constructor: sn, + scale: function(t) { + return t === 1 ? this : new sn(this.k * t, this.x, this.y); + }, + translate: function(t, e) { + return t === 0 & e === 0 ? this : new sn(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 + ")"; + } +}; +sn.prototype; +const Ne = {}, Kr = "No Further Rankings"; +function ir(t, e) { + let n = 0; + for (let r = 1; r < e; r++) { + const i = t.results[r - 1].tallyResults; + for (let s = 0; s < i.length; s++) { + const a = i[s].transfers; + if (a) { + const o = a.exhausted; + o && (n += Number(o)); + } + } + } + return n; +} +function ha(t, e, n) { + if (e < 1) + return []; + const r = t.results[e - 1].tallyResults, i = []; + for (let s = 0; s < r.length; s++) { + const a = r[s][n]; + a != null && i.push(a); + } + return i; +} +function sr(t, e) { + return ha(t, e, "eliminated"); +} +function ar(t, e) { + let n = []; + for (let r = 1; r <= e; r++) + n = n.concat(ha(t, r, "elected")); + return n; +} +var Fc = /* @__PURE__ */ Io(''); +const Lc = { hash: "svelte-3kpd", code: "" }; +function va(t, e) { + mn(e, !0), gr(t, Lc); + let n = wt(e, "jsonData", 7), r = wt(e, "round", 15), i = wt(e, "mouseEventType", 15), s = wt(e, "mouseData", 15), a = wt(e, "mouseY", 15), o = wt(e, "animateOneRound", 15), f = wt(e, "animateOnePhase", 15), u = wt(e, "runFullAnimation", 15), l = wt(e, "setRound", 15); + const h = 800, c = 800, d = Math.min(h, c) * 0.3, p = h / 2, _ = c / 2, m = "Pie", w = "Donut", $ = "TextLayer", y = "#transfer", x = "url(#cross-hatch)", E = 1.15, b = 0.1, T = 750, P = 800; + let K = [], rt = [], J = [], ot = 0, C = st(0), O = st(null); + function xt() { + const g = bt(v(O)); + g.select("#" + m).remove(), g.select("#" + w).remove(), g.select("#" + $).remove(); + } + function _t() { + xt(), J = yt(), K = ba(m, J, p, _, 0, pt()); + } + ui(() => { + console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), o($t), f(ht), u(dt), l(we), ct(), _t(); + }); + function yt() { + const g = j(r()); + return ot = ut(r()), g; + } + function pt() { + return d; + } + function Lt() { + return pt() * 1.41; + } + function R(g, k) { + if (g === "exhausted") return ir(n(), k); + { + const S = n().results[k - 1].tally; + return Number(S[g]); + } + } + function q(g, k) { + return R(g, k).toLocaleString("en-US"); + } + function N(g, k) { + return (R(g, k) / ot).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + } + function ut(g) { + const k = n().results[g - 1].tally; + let S = 0; + for (let [Y, D] of Object.entries(k)) + S += Number(D); + return S; + } + function U(g, k) { + const S = n().results[k - 1].tallyResults; + let Y = 0; + const D = S.findIndex((B) => (B == null ? void 0 : B.elected) && g == B.elected); + if (D >= 0) { + const B = S[D].transfers; + if (B) + for (let [H, L] of Object.entries(B)) Y += Number(L); + } else + return 0; + return Y; + } + function j(g) { + const k = n().results; + let S = k[Math.max(0, g - 2)].tally; + const Y = [], D = []; + for (let [H, L] of Object.entries(S)) + Y.push({ label: H, value: 0 }); + S = k[g - 1].tally; + for (let H of Y) { + const L = Number(S[H.label]), G = U(H.label, g); + G > 0 ? (D.push({ + label: H.label + y, + value: G + }), H.value = L - G, D.push(H)) : (H.value = L, D.push(H)); + } + const B = ir(n(), g); + return D.push({ label: "exhausted", value: B }), D; + } + function ct() { + const g = bt(v(O)).select("defs").select("#cross-hatch"); + let k = 0; + for (let [S, Y] of Object.entries(n().results[0].tally)) { + k < 10 ? Ne[S] = Ac[k] : Ne[S] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), k++; + { + const D = g.clone(!0); + D.attr("id", S.replaceAll(" ", "-")).select("rect").attr("fill", Ne[S]), D.select("path").attr("stroke", "#505050"); + } + } + Ne.exhausted = x; + } + function W() { + bt(v(O)).select("#" + w).remove(); + } + function ft(g) { + console.log("animate phase 1"); + const k = Dn("global").duration(P); + g && k.on("end", g), W(), Le(), $a(), ka(0, pt()), mi(); + } + function St(g) { + console.log("animate phase 2"); + const k = Dn("global").duration(P); + g && k.on("end", g), ae(); + } + function A(g) { + console.log("animate phase 3"); + const k = Dn("global").duration(P); + g && k.on("end", g), Jo(r), qt(r()), Fe(pt()); + } + function z() { + it = !1; + } + let it = !1; + function dt() { + if (it) { + console.log("buttons locked out"); + return; + } + it = !0, X(); + } + function X() { + const g = r() < n().results.length - 1 ? X : z; + ft(() => { + St(() => { + A(g); + }); + }); + } + function $t() { + if (it) { + console.log("buttons locked out"); + return; + } + if (r() >= n().results.length) { + it = !1; + return; + } + it = !0, ft(() => { + St(() => { + A(z); + }); + }); + } + function ht() { + if (r() >= n().results.length) { + mi(), console.log("Finished at round ", r()); + return; + } + M(C, (v(C) + 1) % 3), it = !0, v(C) === 1 ? ft(z) : v(C) === 2 ? St(z) : v(C) === 0 ? A(z) : (it = !1, console.warn("displayPhase out of range at ", v(C))); + } + function qt(g) { + J = j(g), K = Ea(m, J, 0, pt(), !0); + } + function we(g) { + if (it) { + console.log("buttons locked out"); + return; + } + r(g), _t(); + } + function Fe(g, k) { + Sr().sort(null).value((L) => L.value); + const S = bt(v(O)).select("#" + w), Y = le().outerRadius(g).innerRadius(g - 1), D = S.selectAll(".slice"); + let B = D.size(); + function H() { + B--, B === 0 && Aa(); + } + D.select("path").transition("global").duration(T).attr("d", (L) => Y(L)).on("end", (L) => H()); + } + function Le() { + const g = ma(K); + rt = yi(w, g, p, _, pt(), Lt(), !1, !0); + } + function ae() { + const g = wa(rt, K); + rt = wi( + w, + g, + /* previousDonutInfoGlobal, */ + pt(), + Lt(), + !1 + ); + } + function ke(g) { + const k = g.data.label; + return Ne[k.split("#")[0]]; + } + function _a() { + const g = {}, k = n().results[r() - 1].tallyResults; + for (let S = 0; S < k.length; S++) { + let Y = k[S].eliminated; + if (Y === void 0 && (Y = k[S].elected), Y === void 0) { + console.warn("getTransferVotes: Eliminated and Elected undefined..."); + continue; + } + const D = k[S].transfers; + if (D === void 0) { + console.warn("getTransferVotes: transfers undefined..."); + continue; + } + for (let [B, H] of Object.entries(D)) + g[B] === void 0 ? g[B] = Number(H) : g[B] += Number(H); + } + return g; + } + function ma(g) { + const k = [], S = ot, Y = n().results[r() - 1].tallyResults; + for (let D = 0; D < Y.length; D++) { + let B = Y[D].eliminated; + if (B === void 0 && (B = Y[D].elected), B === void 0) { + console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); + continue; + } + const H = Y[D].transfers; + if (H === void 0) { + console.warn("makeDonutInfo: transfers undefined..."); + continue; + } + let L = g.find((V) => V.data.label == B + y); + L === void 0 && (L = g.find((V) => V.data.label == B)); + let G = 0; + if (L) G = L.startAngle; + else { + console.warn("makeDonutInfo: No transfers"); + continue; + } + for (let [V, Z] of Object.entries(H)) { + let vt; + const Jt = g.find((gt) => gt.data.label == V); + if (Jt) + vt = structuredClone(Jt); + else if (V == "exhausted") + vt = { + data: { label: V, value: Number(Z) }, + value: 0, + index: 0, + startAngle: 0, + endAngle: 0, + padAngle: 0 + }; + else if (V == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", Z); + continue; + } else { + console.warn("makeDonutInfo: unrecognized name in transfers ", V); + continue; + } + const I = Number(Z) / S * 2 * Math.PI; + vt.startAngle = G, G = vt.endAngle = G + I, vt.index = D, vt.data.label = `${vt.data.label}#${D}`, k.push(vt); + } + } + return k; + } + function ya(g, k, S) { + const Y = {}; + for (let [D, B] of Object.entries(g)) { + const H = S.find((V) => D == V.data.label); + if (H === void 0) { + console.warn("getTransferStartAngles: mainPieObj not found for ", D); + continue; + } + const L = (H.startAngle + H.endAngle) / 2, G = g[H.data.label] / k * 2 * Math.PI; + Y[H.data.label] = L - G / 2; + } + return Y; + } + function wa(g, k) { + const S = [], Y = ot, D = _a(), B = ya(D, Y, k); + for (let [H, L] of g.entries()) { + const G = structuredClone(L), V = L.endAngle - L.startAngle, Z = k.find((vt) => L.data.label.indexOf(vt.data.label) === 0); + if (Z) { + const vt = Z.data.label; + G.startAngle = B[vt], B[vt] += V, G.endAngle = G.startAngle + V; + } else if (L.data.label.indexOf("exhausted") === 0) + G.startAngle = L.startAngle, G.endAngle = L.endAngle; + else { + console.warn("updateDonutInfo: unrecognized slice name ", L.data.label); + continue; + } + G.index = H, S.push(G); + } + return S; + } + function _i(g, k, S, Y, D) { + const H = bt(v(O)).append("g").attr("id", $).attr("transform", `translate(${k}, ${S})`), L = le().innerRadius(Y * E).outerRadius(Y * E); + H.selectAll("text").data(g).enter().each(function(G) { + G.endAngle - G.startAngle < b || G.data.label.includes(y) || bt(this).append("g").attr("id", (V) => V.data.label).classed("eliminated", (V) => D.includes(V.data.label.split("#")[0]) || V.data.label.includes(y)).each(function(V, Z) { + V.data.label === "exhausted" && bt(this).on("mouseenter", (vt, Jt) => Ra(vt)).on("mouseleave", (vt, Jt) => Na()); + }).append("text").attr("transform", (V) => `translate(${L.centroid(V)})`).attr("text-anchor", (V) => xr(V.startAngle, V.endAngle)).text((V) => V.data.label === "exhausted" ? Kr : V.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((V) => q(V.data.label, r()) + " (" + N(V.data.label, r()) + ")"); + }); + } + function xa(g, k, S) { + const D = bt(v(O)).select("#" + $), B = D.selectAll("tspan"), H = D.selectAll("g").data(g, (Z) => Z.data.label).classed("eliminated", (Z) => S.includes(Z.data.label.split("#")[0]) || Z.data.label.includes(y)), L = le().innerRadius(k * E).outerRadius(k * E + 1); + B.transition("global").duration(T).attr("transform", (Z) => `translate(${L.centroid(Z)})`).attr("text-anchor", (Z) => xr(Z.startAngle, Z.endAngle)), H.select("text").transition("global").duration(T).attr("transform", (Z) => `translate(${L.centroid(Z)})`).attr("text-anchor", (Z) => xr(Z.startAngle, Z.endAngle)).on("end", (Z) => V()); + let G = H.size(); + function V(Z) { + G--, G === 0 && (D.remove(), _i(g, p, _, k, S)); + } + } + function ba(g, k, S, Y, D, B, H = !0, L = !1) { + const V = Sr().sort(null).value((Z) => Z.value)(k); + return yi(g, V, S, Y, D, B, H, L), V; + } + function mi() { + bt(v(O)).select("#" + m).selectAll(".elected").style("stroke", "darkblue").style("stroke-width", "2px"); + } + function yi(g, k, S, Y, D, B, H, L) { + const G = sr(n(), r()), V = ar(n(), r()), Jt = bt(v(O)).attr("width", "100%").attr("height", c).attr("viewBox", `0 0 ${h} ${c}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", g).attr("transform", `translate(${S}, ${Y})`).selectAll(".slice").data(k).enter().append("g").attr("class", "slice").classed("eliminated", (I) => G.includes(I.data.label.split("#")[0]) || I.data.label.includes(y)).classed("elected", (I) => V.includes(I.data.label.split("#")[0]) && !I.data.label.includes(y)).attr("id", (I) => I.data.label).on("mouseenter", (I, gt) => $r(I, gt)).on("mouseleave", (I, gt) => Ar(I, gt)), Ze = le().outerRadius(B).innerRadius(D); + if (L) { + const I = le().outerRadius(D + 1).innerRadius(D); + Jt.append("path").attr("d", I).transition("global").duration(T).attr("d", (gt) => Ze(gt)).attr("fill", (gt) => ke(gt)).on("end", (gt) => br()); + } else + Jt.append("path").attr("d", (I) => Ze(I)).attr("fill", (I) => ke(I)), br(); + return H && _i(k, S, Y, B, G), k; + } + function $a() { + const S = bt(v(O)).select("#" + $).selectAll(".eliminated"); + S.size() > 0 && S.classed("finished", !0); + } + function Aa() { + const S = bt(v(O)).select("#" + $).selectAll(".finished"); + S.size() > 0 && S.remove(); + } + function ka(g, k) { + const D = bt(v(O)).select("#" + m).selectAll(".eliminated"), B = le().innerRadius(g), H = le().outerRadius(k); + D.classed("finished", !0).select("path").transition("global").duration(T).attrTween("d", function(L) { + const G = ze(k, g); + return function(V) { + return H.innerRadius(G(V)), H(L); + }; + }).attr("fill", (L) => `url(#${L.data.label.split("#")[0].replaceAll(" ", "-")})`), D.clone(!0).classed("finished", !0).select("path").transition("global").duration(T).attrTween("d", function(L) { + const G = ze(k, g); + return function(V) { + return B.outerRadius(G(V)), B(L); + }; + }).attr("fill", (L) => ke(L)); + } + function xr(g, k) { + const S = (g + k) / 2; + return S > Math.PI * 11 / 6 || S < Math.PI * 1 / 6 || S > Math.PI * 5 / 6 && S < Math.PI * 7 / 6 ? "middle" : S < Math.PI ? "start" : "end"; + } + function br() { + bt(v(O)).select("#" + $).raise().append("g").remove(); + } + function Ea(g, k, S, Y, D) { + const H = Sr().sort(null).value((L) => L.value)(k); + return wi( + g, + H, + /* previousPieInfo, */ + S, + Y, + D + ), H; + } + function wi(g, k, S, Y, D) { + const B = sr(n(), r()), H = ar(n(), r()), L = le().outerRadius(Y).innerRadius(S).startAngle((I) => I.startAngle).endAngle((I) => I.endAngle), G = le().outerRadius(Y).innerRadius(S), Z = bt(v(O)).select("#" + g); + Z.selectAll(".slice").attr("prevStart", (I) => I.startAngle).attr("prevEnd", (I) => I.endAngle); + const vt = Z.selectAll(".slice").data(k, (I) => I.data.label); + vt.enter().append("g").attr("class", "slice").attr("id", (I) => I.data.label).classed("eliminated", !0).on("mouseenter", (I, gt) => $r(I, gt)).on("mouseleave", (I, gt) => Ar(I, gt)).append("path").attr("d", (I) => G(I)).attr("fill", (I) => ke(I)), vt.classed("eliminated", (I) => B.includes(I.data.label.split("#")[0])).classed("elected", (I) => H.includes(I.data.label.split("#")[0])).on("mouseenter", (I, gt) => $r(I, gt)).on("mouseleave", (I, gt) => Ar(I, gt)); + let Jt = vt.size(); + function Ze() { + Jt--, Jt <= 0 && (br(), Z.selectAll(".finished").remove()); + } + return vt.select("path").transition("global").duration(T).attrTween("d", function(I) { + const gt = Number(bt(this.parentNode).attr("prevStart")), Ta = Number(bt(this.parentNode).attr("prevEnd")), Sa = ze(gt, I.startAngle), Ca = ze(Ta, I.endAngle); + return (bi) => (L.startAngle(Sa(bi)).endAngle(Ca(bi)), L(I)); + }).on("end", Ze), D && xa(k, Y, B), k; + } + function $r(g, k) { + s(k.data.label.split("#")[0]), i("enter"), a(g.clientY); + } + function Ar(g, k) { + s(k.data.label.split("#")[0]), i("leave"); + } + function Ra(g, k) { + i("show-exhausted"), a(g.clientY); + } + function Na(g, k) { + i("hide-exhausted"); + } + var xi = Fc(); + return Kn(xi, (g) => M(O, g), () => v(O)), Nt(t, xi), yn({ + get jsonData() { + return n(); + }, + set jsonData(g) { + n(g), mt(); + }, + get round() { + return r(); + }, + set round(g) { + r(g), mt(); + }, + get mouseEventType() { + return i(); + }, + set mouseEventType(g) { + i(g), mt(); + }, + get mouseData() { + return s(); + }, + set mouseData(g) { + s(g), mt(); + }, + get mouseY() { + return a(); + }, + set mouseY(g) { + a(g), mt(); + }, + get animateOneRound() { + return o(); + }, + set animateOneRound(g) { + o(g), mt(); + }, + get animateOnePhase() { + return f(); + }, + set animateOnePhase(g) { + f(g), mt(); + }, + get runFullAnimation() { + return u(); + }, + set runFullAnimation(g) { + u(g), mt(); + }, + get setRound() { + return l(); + }, + set setRound(g) { + l(g), mt(); + } + }); +} +_r( + va, + { + jsonData: {}, + round: {}, + mouseEventType: {}, + mouseData: {}, + mouseY: {}, + animateOneRound: {}, + animateOnePhase: {}, + runFullAnimation: {}, + setRound: {} + }, + [], + [], + !0 +); +var qc = (t, e) => e(-1), Vc = (t, e, n) => e(v(n)), Hc = (t, e, n) => e(v(n)), zc = (t, e, n) => e(t, v(n)), Bc = /* @__PURE__ */ Bt(''), Yc = (t, e) => e(999), Uc = /* @__PURE__ */ Bt('
'); +const Xc = { + hash: "svelte-1vvdx9e", + code: `.nav-button.svelte-1vvdx9e {display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;margin:0 5px;background-color:#f0f0f0;border:1px solid #ccc;border-radius:50%;cursor:pointer;font-size:1.2rem;font-weight:bolder;line-height:1;}.nav-button.svelte-1vvdx9e:disabled {opacity:0.5;cursor:not-allowed;}.nav-button.svelte-1vvdx9e:hover:not(:disabled) {background-color:#fff2cc; /* Match the hover color */} + +/* doesn't appear to make any difference */.centered-container.svelte-1vvdx9e {display:inline-block;margin:0 auto;text-align:center;max-width:100%;overflow-x:auto;} + +/* doesn't appear to make any difference */.round-labels-container.svelte-1vvdx9e {display:inline-flex;border:1px solid #ccc;border-radius:5px;background-color:#f9f9f9;overflow:hidden;max-width:calc(100% - 100px);overflow-x:auto;padding:2px;}.round-label.svelte-1vvdx9e {font-weight:normal;display:inline-block;padding:5px 8px;border-right:none;cursor:pointer;background-color:#f9f9f9;white-space:nowrap;min-width:30px;border:none;border-radius:5px;margin:0 1px;}.not-last-round.svelte-1vvdx9e {border-right:1px solid #ddd;}.current-round.svelte-1vvdx9e {font-weight:bold;color:white;background-color:#80b3ff; /* Paler blue */}.hovered-round.svelte-1vvdx9e {font-weight:bold;color:#0066cc;background-color:#fff2cc; /* Paler yellow */}.many-rounds.svelte-1vvdx9e {min-width:20px;}.outer-wrapper.svelte-1vvdx9e {width:100%;text-align:center;display:block;margin:0 auto;} + + /* Focus style that doesn't add borders */.round-label.svelte-1vvdx9e:focus {outline:none;}.round-label.svelte-1vvdx9e:focus-visible {outline:2px solid #0066cc;outline-offset:-2px;position:relative;z-index:1;}` +}; +function pa(t, e) { + mn(e, !0), gr(t, Xc); + let n = wt(e, "rounds", 7, 1), r = wt(e, "currentRound", 15, 1), i = wt(e, "labelPrefix", 7, "Round "), s = wt(e, "onRoundChanged", 7, null), a = st(null), o = st(0), f; + function u(b) { + b !== r() && (r(b), s() && s()(r())); + } + function l() { + r() > 1 && u(r() - 1); + } + function h() { + r() < n() && u(r() + 1); + } + function c(b) { + M(a, F(b)); + } + function d() { + M(a, null); + } + function p(b, T) { + if (console.log("Keyboard event:", b.key, "on round:", T), (b.key === "Enter" || b.key === " ") && (b.preventDefault(), T !== void 0 ? (console.log("Activating round:", T), u(T)) : b.currentTarget instanceof HTMLElement && (b.currentTarget.classList.contains("prev-button") && r() > 1 ? (console.log("Activating previous button"), l()) : b.currentTarget.classList.contains("next-button") && r() < n() && (console.log("Activating next button"), h()))), T !== void 0 && (b.key === "ArrowLeft" || b.key === "ArrowRight")) { + b.preventDefault(); + const P = b.key === "ArrowLeft" ? Math.max(1, T - 1) : Math.min(n(), T + 1); + console.log("Arrow key used, moving focus to round:", P); + const rt = Array.from(f.querySelectorAll(".round-label"))[P - 1]; + rt && rt.focus(); + } + } + function _(b) { + return n() <= 10 ? `${i()}${b}` : n() <= 20 ? `R${b}` : `${b}`; + } + function m() { + f && M(o, F(f.offsetWidth)); + } + ui(() => { + m(), window.addEventListener("resize", m); + const b = (T) => { + console.log("Global keydown in component:", T.key); + }; + return f.addEventListener("keydown", b), () => { + window.removeEventListener("resize", m), f && f.removeEventListener("keydown", b); + }; + }); + var w = Uc(), $ = lt(w), y = lt($); + y.__mouseover = [qc, c], y.__mouseout = d, y.__click = l, y.__keydown = p; + var x = kt(y, 2); + Me( + x, + 21, + () => [ + ...Array.from({ length: n() }, (b, T) => T + 1) + ], + Ce, + (b, T) => { + var P = Bc(); + let K; + P.__mouseover = [Vc, c, T], P.__mouseout = d, P.__click = [Hc, u, T], P.__keydown = [zc, p, T]; + var rt = lt(P, !0); + nt(P), Qt( + (J) => { + K = en(P, 1, "round-label svelte-1vvdx9e", null, K, { + "current-round": v(T) === r(), + "hovered-round": v(T) === v(a), + "not-last-round": v(T) < n(), + "not-first-round": v(T) > 1, + "many-rounds": n() > 20 + }), Wn(P, "aria-selected", v(T) === r()), Wn(P, "aria-label", J), be(rt, J); + }, + [() => _(v(T))] + ), qe("focus", P, () => { + console.log("Focus on round:", v(T)), c(v(T)); + }), qe("blur", P, d), Nt(b, P); + } + ), nt(x); + var E = kt(x, 2); + return E.__mouseover = [Yc, c], E.__mouseout = d, E.__click = h, E.__keydown = p, nt($), nt(w), Kn(w, (b) => f = b, () => f), Qt(() => { + y.disabled = r() === 1, E.disabled = r() === n(); + }), qe("focus", y, () => c(-1)), qe("blur", y, d), qe("focus", E, () => c(999)), qe("blur", E, d), Nt(t, w), yn({ + get rounds() { + return n(); + }, + set rounds(b = 1) { + n(b), mt(); + }, + get currentRound() { + return r(); + }, + set currentRound(b = 1) { + r(b), mt(); + }, + get labelPrefix() { + return i(); + }, + set labelPrefix(b = "Round ") { + i(b), mt(); + }, + get onRoundChanged() { + return s(); + }, + set onRoundChanged(b = null) { + s(b), mt(); + } + }); +} +Os(["mouseover", "mouseout", "click", "keydown"]); +_r( + pa, + { + rounds: {}, + currentRound: {}, + labelPrefix: {}, + onRoundChanged: {} + }, + [], + [], + !0 +); +const Gc = (t) => t; +function ga(t) { + const e = t - 1; + return e * e * e + 1; +} +function Wc(t, { delay: e = 0, duration: n = 400, easing: r = Gc } = {}) { + const i = +getComputedStyle(t).opacity; + return { + delay: e, + duration: n, + easing: r, + css: (s) => `opacity: ${s * i}` + }; +} +function Kc(t, { delay: e = 0, duration: n = 400, easing: r = ga, axis: i = "y" } = {}) { + const s = getComputedStyle(t), a = +s.opacity, o = i === "y" ? "height" : "width", f = parseFloat(s[o]), u = i === "y" ? ["top", "bottom"] : ["left", "right"], l = u.map( + (w) => ( + /** @type {'Left' | 'Right' | 'Top' | 'Bottom'} */ + `${w[0].toUpperCase()}${w.slice(1)}` + ) + ), h = parseFloat(s[`padding${l[0]}`]), c = parseFloat(s[`padding${l[1]}`]), d = parseFloat(s[`margin${l[0]}`]), p = parseFloat(s[`margin${l[1]}`]), _ = parseFloat( + s[`border${l[0]}Width`] + ), m = parseFloat( + s[`border${l[1]}Width`] + ); + return { + delay: e, + duration: n, + easing: r, + css: (w) => `overflow: hidden;opacity: ${Math.min(w * 20, 1) * a};${o}: ${w * f}px;padding-${u[0]}: ${w * h}px;padding-${u[1]}: ${w * c}px;margin-${u[0]}: ${w * d}px;margin-${u[1]}: ${w * p}px;border-${u[0]}-width: ${w * _}px;border-${u[1]}-width: ${w * m}px;min-${o}: 0` + }; +} +function ts(t, e) { + for (const n in e) t[n] = e[n]; + return ( + /** @type {T & S} */ + t + ); +} +function Jc({ fallback: t, ...e }) { + const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(); + function i(a, o, f) { + const { + delay: u = 0, + duration: l = ( + /** @param {number} d */ + (b) => Math.sqrt(b) * 30 + ), + easing: h = ga + } = ts(ts({}, e), f), c = a.getBoundingClientRect(), d = o.getBoundingClientRect(), p = c.left - d.left, _ = c.top - d.top, m = c.width / d.width, w = c.height / d.height, $ = Math.sqrt(p * p + _ * _), y = getComputedStyle(o), x = y.transform === "none" ? "" : y.transform, E = +y.opacity; + return { + delay: u, + duration: typeof l == "function" ? l($) : l, + easing: h, + css: (b, T) => ` + opacity: ${b * E}; + transform-origin: top left; + transform: ${x} translate(${T * p}px,${T * _}px) scale(${b + (1 - b) * m}, ${b + (1 - b) * w}); + ` + }; + } + function s(a, o, f) { + return (u, l) => (a.set(l.key, u), () => { + if (o.has(l.key)) { + const h = o.get(l.key); + return o.delete(l.key), i( + /** @type {Element} */ + h, + u, + l + ); + } + return a.delete(l.key), t && t(u, l, f); + }); + } + return [s(r, n, !1), s(n, r, !0)]; +} +function es(t) { + const e = t - 1; + return e * e * e + 1; +} +var Zc = /* @__PURE__ */ Bt('
'), jc = /* @__PURE__ */ Bt('
'), Qc = /* @__PURE__ */ Bt(" "), td = /* @__PURE__ */ Bt('
Candidate
'); +const ed = { + hash: "svelte-d96s0n", + code: `.visualization-container.svelte-d96s0n {display:flex;flex-direction:column;align-items:center;padding:0.5rem;font-size:0.9rem;}.choice-grid.svelte-d96s0n {border-collapse:separate;border-spacing:0;text-align:center;}.candidate-row.svelte-d96s0n {height:30px; /* Reduced row height */transition:background-color 0.3s ease;}.candidate-row.collapsing.svelte-d96s0n {background-color:rgba(255, 182, 193, 0.2); /* Light pink background */}.candidate-name.svelte-d96s0n {text-align:left;padding-right:8px; /* Reduced padding */max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:0.85rem;}.header-cell.svelte-d96s0n {height:65px; /* Reduced header height */position:relative;padding:0;width:26px; /* Narrower column width */}.diagonal-header.svelte-d96s0n {position:absolute;transform-origin:bottom left;transform:rotate(-45deg);bottom:15px;left:8px; /* Adjusted position */font-size:0.75rem;font-weight:bold;white-space:nowrap;color:#444;}.bubble.svelte-d96s0n {width:1rem; /* Smaller bubble size */height:1rem; /* Smaller bubble size */border-radius:50%;border:1px solid #aaa;background-color:#fff;margin:0 auto;transition:background-color 0.5s ease; /* Smooth transition for bubble color change */}.bubble.selected.svelte-d96s0n {background-color:#00b4d8;border-color:#0077b6;}.bubble.previously-ranked.svelte-d96s0n {background-color:#b3d9ff; /* Darker light blue for previously ranked positions */border-color:#6699cc;}.bubble.changed.svelte-d96s0n { + animation: svelte-d96s0n-highlight-change 2s ease-in-out;}.choice-grid.svelte-d96s0n thead:where(.svelte-d96s0n) th:where(.svelte-d96s0n):first-child, + .choice-grid.svelte-d96s0n tbody:where(.svelte-d96s0n) td:where(.svelte-d96s0n):first-child {position:sticky;left:0;background-color:white;z-index:1;}.choice-grid.svelte-d96s0n tbody:where(.svelte-d96s0n) td:first-child.eliminated-bg:where(.svelte-d96s0n) {background-color:rgba(255, 182, 193, 0.2); /* Light pink background */} + + /* Animation styles */.strikethrough.svelte-d96s0n {position:relative;}.strikethrough.svelte-d96s0n::after {content:'';position:absolute;left:0;top:50%;right:0;width:100%;height:1px;background-color:#888; + animation: svelte-d96s0n-strikethrough 0.7s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;transform-origin:left;z-index:2;} + + @keyframes svelte-d96s0n-strikethrough { + 0% { + transform: scaleX(0); + } + 100% { + transform: scaleX(1); + } + } + + @keyframes svelte-d96s0n-highlight-change { + 0%, 100% { + box-shadow: none; + } + 30%, 70% { + box-shadow: 0 0 12px 4px gold; + } + } + + /* Make cells more compact */.rank-cell.svelte-d96s0n {padding:0 2px; /* Reduced cell padding */position:relative;} + + /* Add style for active ranking updates */.updating-ranks.svelte-d96s0n .bubble.changed:where(.svelte-d96s0n) {box-shadow:0 0 12px 4px gold;}` +}; +function nd(t, e) { + mn(e, !0), gr(t, ed); + let n = wt(e, "candidates", 23, () => []), r = wt(e, "eliminatedCandidates", 23, () => []), i = wt(e, "maxRanks", 7, 3), s = wt(e, "currentRound", 7, 1), a = st(F([])), o = st(F([])), f = st(F([])), u = st(F([])), l = st(F([])), h = st(F([])), c = st(F([])), d = st(F({})), p = st(!1), _ = st(!1), m = st(1); + const [w, $] = Jc({ + duration: 1e3, + fallback(R, q) { + return { + duration: 1e3, + easing: es, + css: (N) => `opacity: ${N}` + }; + } + }); + function y(R, q) { + if (q > R) + throw new Error("k must be less than or equal to n"); + const N = new Array(R).fill(0), ut = Math.min(q, 2), U = Math.min(q, Math.floor(Math.random() * (q - ut + 1)) + ut), j = Array.from({ length: U }, (W, ft) => ft + 1), ct = Array.from({ length: R }, (W, ft) => ft).sort(() => Math.random() - 0.5).slice(0, U); + for (let W = 0; W < U; W++) + N[ct[W]] = j[W]; + return N; + } + function x(R, q) { + return JSON.stringify(R) !== JSON.stringify(q) ? q : R; + } + function E() { + M(h, F([...v(a)])), M(d, F({})), M(f, F(new Array(n().length).fill(!1))), M(u, F(new Array(n().length).fill(!1))), M(l, F(new Array(n().length).fill(!1))); + } + function b(R, q = !0) { + if (R.length === 0) return; + M(c, F([...v(h)])); + const N = [...v(h)], ut = R.filter((U) => N[U] > 0).map((U) => ({ index: U, rank: N[U] })); + ut.sort((U, j) => j.rank - U.rank); + for (const { index: U, rank: j } of ut) { + const ct = `candidate-${U}`; + v(d)[ct] || (v(d)[ct] = []), N[U] > 0 && v(d)[ct].push(N[U]), N[U] = 0; + for (let W = 0; W < N.length; W++) + if (N[W] > j) { + const ft = `candidate-${W}`; + v(d)[ft] || (v(d)[ft] = []), N[W] > 0 && v(d)[ft].push(N[W]), N[W] -= 1; + } + } + if (q) { + M(_, !0); + const U = [...v(u)]; + for (const j of R) + U[j] = !0; + M(u, F(x(v(u), U))), setTimeout( + () => { + M(h, F(x(v(h), N))), setTimeout( + () => { + const j = [...v(l)]; + for (const ct of R) + j[ct] = !0; + M(l, F(x(v(l), j))), setTimeout( + () => { + M(_, !1); + const ct = [...v(f)], W = [...v(l)]; + for (const ft of R) + ct[ft] = !0, W[ft] = !1; + M(f, F(x(v(f), ct))), M(l, F(x(v(l), W))); + }, + 600 + ); + }, + 800 + ); + }, + 800 + ); + } else { + M(h, F(x(v(h), N))); + const U = [...v(f)]; + for (const j of R) + U[j] = !0; + M(f, F(x(v(f), U))); + } + } + function T(R) { + return v(c)[R] !== v(h)[R]; + } + function P(R, q) { + const N = `candidate-${R}`; + return v(d)[N] && v(d)[N].includes(q); + } + ui(() => { + if (n().length > 0 && !v(p)) { + const R = y(n().length, i()); + M(a, F([...R])), M(h, F(R)), M(c, F([...R])), M(o, F(new Array(n().length).fill(!1))), M(f, F(new Array(n().length).fill(!1))), M(u, F(new Array(n().length).fill(!1))), M(l, F(new Array(n().length).fill(!1))); + const q = {}; + R.forEach((N, ut) => { + N > 0 && (q[`candidate-${ut}`] = []); + }), M(d, F(q)), M(m, s()), M(p, !0); + } + }), Un(() => { + if (!v(p)) return; + const R = Math.abs(s() - v(m)) > 1, q = s() < v(m); + if (R || q) { + E(); + const N = r().map((ut, U) => ut ? U : -1).filter((ut) => ut !== -1); + b(N, !1); + } + M(m, s()); + }), Un(() => { + if (!v(p) || !r().length || !v(o).length || Math.abs(s() - v(m)) > 1) return; + const R = []; + for (let q = 0; q < r().length; q++) + r()[q] && !v(o)[q] && R.push(q); + R.length > 0 && b(R, !0), M(o, F(x(v(o), [...r()]))); + }); + function K(R) { + if (R === 0) return ""; + const q = R % 10, N = R % 100; + return q === 1 && N !== 11 ? R + "st" : q === 2 && N !== 12 ? R + "nd" : q === 3 && N !== 13 ? R + "rd" : R + "th"; + } + function rt() { + return Array.from({ length: i() }, (R, q) => K(q + 1)); + } + function J(R, q) { + return `bubble-${R}-${q}`; + } + function ot(R, q) { + const N = `candidate-${R}`; + return v(d)[N] && v(d)[N].includes(q) ? `Previously ranked as ${K(q)} choice` : ""; + } + var C = td(); + let O; + var xt = lt(C), _t = lt(xt), yt = lt(_t), pt = kt(lt(yt)); + Me(pt, 17, rt, Ce, (R, q) => { + var N = Zc(), ut = lt(N), U = lt(ut, !0); + nt(ut), nt(N), Qt(() => be(U, v(q))), Nt(R, N); + }), nt(yt), nt(_t); + var Lt = kt(_t); + return Me(Lt, 21, n, Ce, (R, q, N) => { + var ut = Fo(), U = He(ut); + { + var j = (ct) => { + var W = Qc(); + let ft; + var St = lt(W); + let A; + var z = lt(St, !0); + nt(St); + var it = kt(St); + Me(it, 17, () => Array.from({ length: i() }, (dt, X) => X + 1), Ce, (dt, X) => { + var $t = jc(), ht = lt($t); + let qt; + nt($t), Qt( + (we, Fe, Le, ae) => { + qt = en(ht, 1, "bubble svelte-d96s0n", null, qt, { + selected: v(h)[N] === v(X), + "previously-ranked": we, + changed: Fe + }), Wn(ht, "style", `background-color:${Le ?? ""}`), Wn(ht, "title", ae); + }, + [ + () => P(N, v(X)), + () => v(_) && T(N) && (v(c)[N] === v(X) && v(h)[N] !== v(X) || v(c)[N] !== v(X) && v(h)[N] === v(X)), + () => v(h)[N] === v(X) ? "#00b4d8" : P(N, v(X)) ? "#b3d9ff" : "", + () => ot(N, v(X)) + ] + ), $n(1, ht, () => $, () => ({ key: J(N, v(X)) })), $n(2, ht, () => w, () => ({ key: J(N, v(X)) })), Nt(dt, $t); + }), nt(W), Qt(() => { + ft = en(W, 1, "candidate-row svelte-d96s0n", null, ft, { + strikethrough: v(u)[N] && !v(l)[N], + collapsing: v(l)[N] + }), A = en(St, 1, "candidate-name svelte-d96s0n", null, A, { + eliminated: r()[N], + "eliminated-bg": v(l)[N] + }), be(z, v(q)); + }), $n(1, W, () => Wc, () => ({ duration: 300 })), $n(2, W, () => Kc, () => ({ duration: 600, easing: es })), Nt(ct, W); + }; + Lr(U, (ct) => { + v(f)[N] || ct(j); + }); + } + Nt(R, ut); + }), nt(Lt), nt(xt), nt(C), Qt(() => O = en(C, 1, "visualization-container svelte-d96s0n", null, O, { + "updating-ranks": v(_) + })), Nt(t, C), yn({ + get candidates() { + return n(); + }, + set candidates(R = []) { + n(R), mt(); + }, + get eliminatedCandidates() { + return r(); + }, + set eliminatedCandidates(R = []) { + r(R), mt(); + }, + get maxRanks() { + return i(); + }, + set maxRanks(R = 3) { + i(R), mt(); + }, + get currentRound() { + return s(); + }, + set currentRound(R = 1) { + s(R), mt(); + } + }); +} +_r( + nd, + { + candidates: {}, + eliminatedCandidates: {}, + maxRanks: {}, + currentRound: {} + }, + [], + [], + !0 +); +var rd = /* @__PURE__ */ Bt("  ", 1), id = /* @__PURE__ */ Bt("About to eliminate: ", 1), sd = /* @__PURE__ */ Bt("  ", 1), ad = /* @__PURE__ */ Bt("Elected: ", 1), od = /* @__PURE__ */ Bt("
", 1), ld = /* @__PURE__ */ Bt('


these ballots have already been eliminated.
'); +const ud = { + hash: "svelte-9ymq70", + code: `.page-container.svelte-9ymq70 {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-9ymq70 {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-9ymq70 {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:1.3rem;left:50%;transform:translate(-50%);font-weight:bold;opacity:0;}.tooltip.svelte-9ymq70 h3:where(.svelte-9ymq70) {text-align:center;}.round-selector-container.svelte-9ymq70 {width:100%;display:flex;justify-content:center;margin:1rem 0;}.animation-button-container.svelte-9ymq70 {display:flex;justify-content:center;gap:10px;margin-bottom:1rem;} + +/*** Use this one when you only want the pie chart and not the bubble grid visualization ***/ + + + +/*** Use this one when you want to display both the pie chart and the bubble grid visualiation +.visualizations-container { + display: flex; + justify-content: space-between; + width: 100%; + padding: 0 20px; +} +***/.pie-chart-container.svelte-9ymq70 {width:65%;min-width:800px; /* Larger minimum size */flex-grow:0; /* Don't grow beyond specified width */margin-right:40px; /* Add extra space on right */} + + +/* Media query for smaller screens */ +@media (max-width: 1300px) {.visualizations-container.svelte-9ymq70 {flex-direction:column;align-items:center;}.pie-chart-container.svelte-9ymq70 {width:90%;margin:0 auto;} +}` +}; +function fd(t, e) { + mn(e, !0), gr(t, ud); + const n = 0.85; + let r = wt(e, "electionSummary", 7), i = st(null), s = st(null), a = st(1), o = st(""), f = st(F([])), u = st(""), l = st(""), h = st(0), c = st(null), d = st(null), p = st(null), _ = st(null), m = /* @__PURE__ */ cr(() => w(r())); + function w(A) { + if (typeof A == "string") { + console.log("input was a string"); + try { + return JSON.parse(A); + } catch (z) { + return console.error("Failed to parse JSON string:", z), {}; + } + } + return A || {}; + } + function $(A) { + console.log("slider wants to move to round ", A), A === v(a) + 1 && v(c) ? v(c)() : v(_) && v(_)(A); + } + function y() { + switch (console.log("mouse event ", v(u), v(l), v(h)), v(u)) { + case "enter": + ((A) => (M(f, F(A[0])), M(o, F(A[1]))))(E(v(l))), v(i) && (v(i).style.top = String(v(h) || 20) + "px", v(i).style.opacity = String(n)); + break; + case "leave": + v(i) && (v(i).style.opacity = "0"), M(f, F([])), M(o, ""); + break; + case "show-exhausted": + v(s) && (v(s).style.top = String(v(h) || 20) + "px", v(s).style.opacity = String(n)); + break; + case "hide-exhausted": + v(s) && (v(s).style.opacity = "0"); + break; + default: + console.log("Unknown mouse event: ", v(u)); + break; + } + } + Un(() => y()); + function x(A, z) { + return A == 1 ? z ? "vote was" : "vote will be" : z ? "votes were" : "votes will be"; + } + function E(A) { + const z = [], it = A === "exhausted" ? Kr : A; + let dt; + A == "exhausted" ? dt = ir(v(m), 1) : dt = v(m).results[0].tally[A], z.push(`${it} started with ${dt} votes.`); + for (let X = 1; X <= v(a); X++) { + X === v(a) && (A == "exhausted" ? dt = ir(v(m), v(a)) : dt = v(m).results[v(a) - 1].tally[A], z.push(`${it} has ${dt} votes at round ${v(a)}.`)); + const $t = v(m).results[X - 1].tallyResults; + for (let ht = 0; ht < $t.length; ht++) { + const qt = $t[ht].transfers, we = $t[ht].eliminated, Fe = $t[ht].elected; + if (we) + we === A && z.push(`${it} will be eliminated on round ${X}.`); + else if (A === Fe && (z.push(`${it} was elected on round ${X}.`), qt)) + for (let [ae, ke] of Object.entries(qt)) + z.push(`${ke} ${x(Number(ke), X < v(a))} transferred to ${ae} on round ${X}.`); + const Le = we || Fe; + if (Le) { + const ae = Number(qt[A]); + ae && z.push(`${ae} ${x(ae, X < v(a))} transferred from ${Le} on round ${X}.`); + } + } + } + return [z, it]; + } + function b() { + let A = 0; + for (let z = 1; z <= v(m).results.length; z++) { + const it = v(m).results[z - 1].tallyResults; + for (let dt = 0; dt < it.length; dt++) + it[dt].elected && A++; + } + return A; + } + var T = ld(), P = lt(T), K = lt(P), rt = lt(K); + nt(K); + var J = kt(K, 2), ot = lt(J); + { + var C = (A) => { + var z = id(), it = kt(He(z)); + Me(it, 17, () => sr(v(m), v(a)), Ce, (dt, X) => { + var $t = rd(), ht = He($t), qt = lt(ht, !0); + nt(ht), xn(), Qt(() => { + Pi(ht, "color", Ne[v(X)]), be(qt, v(X)); + }), Nt(dt, $t); + }), Nt(A, z); + }; + Lr(ot, (A) => { + sr(v(m), v(a)).length > 0 && A(C); + }); + } + var O = kt(ot, 2); + { + var xt = (A) => { + var z = ad(), it = kt(He(z)); + Me(it, 17, () => ar(v(m), v(a)), Ce, (dt, X) => { + var $t = sd(), ht = He($t), qt = lt(ht, !0); + nt(ht), xn(), Qt(() => { + Pi(ht, "color", Ne[v(X)]), be(qt, v(X)); + }), Nt(dt, $t); + }), Nt(A, z); + }; + Lr(O, (A) => { + ar(v(m), v(a)).length > 0 && A(xt); + }); + } + nt(J), nt(P); + var _t = kt(P, 2), yt = lt(_t), pt = lt(yt, !0); + nt(yt); + var Lt = kt(yt, 2); + Me(Lt, 17, () => v(f), Ce, (A, z) => { + var it = od(), dt = He(it), X = lt(dt, !0); + nt(dt), xn(2), Qt(() => be(X, v(z))), Nt(A, it); + }), nt(_t), Kn(_t, (A) => M(i, A), () => v(i)); + var R = kt(_t, 2), q = lt(R); + q.nodeValue = `"${Kr}" means all the candidates ranked on `, xn(2), nt(R), Kn(R, (A) => M(s, A), () => v(s)); + var N = kt(R, 2), ut = lt(N); + pa(ut, { + get rounds() { + return v(m).results.length; + }, + get currentRound() { + return v(a); + }, + labelPrefix: "Round ", + onRoundChanged: $ + }), nt(N); + var U = kt(N, 2), j = lt(U); + j.__click = function(...A) { + var z; + (z = v(p)) == null || z.apply(this, A); + }; + var ct = kt(j, 2); + ct.__click = function(...A) { + var z; + (z = v(d)) == null || z.apply(this, A); + }, nt(U); + var W = kt(U, 2), ft = lt(W), St = lt(ft); + return va(St, { + get jsonData() { + return v(m); + }, + get round() { + return v(a); + }, + set round(A) { + M(a, F(A)); + }, + get mouseEventType() { + return v(u); + }, + set mouseEventType(A) { + M(u, F(A)); + }, + get mouseData() { + return v(l); + }, + set mouseData(A) { + M(l, F(A)); + }, + get mouseY() { + return v(h); + }, + set mouseY(A) { + M(h, F(A)); + }, + get animateOneRound() { + return v(c); + }, + set animateOneRound(A) { + M(c, F(A)); + }, + get animateOnePhase() { + return v(d); + }, + set animateOnePhase(A) { + M(d, F(A)); + }, + get runFullAnimation() { + return v(p); + }, + set runFullAnimation(A) { + M(p, F(A)); + }, + get setRound() { + return v(_); + }, + set setRound(A) { + M(_, F(A)); + } + }), nt(ft), nt(W), nt(T), Qt( + (A) => { + be(rt, `${v(m).config.contest ?? ""}, ${A ?? ""} to be elected, Round ${v(a) ?? ""}.`), be(pt, v(o)); + }, + [b] + ), Nt(t, T), yn({ + get electionSummary() { + return r(); + }, + set electionSummary(A) { + r(A), mt(); + } + }); +} +Os(["click"]); +customElements.define("pie-chart", _r(fd, { electionSummary: {} }, [], [], !0)); diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 9a87a0f5..a735ad8c 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -6,5 +6,5 @@ {% endcompress %} {% compress js file %} - + {% endcompress %} diff --git a/templates/pie/pie.html b/templates/pie/pie.html index 10c3b9ef..1e78cf4d 100644 --- a/templates/pie/pie.html +++ b/templates/pie/pie.html @@ -1,5 +1,9 @@
+ + + Pie chart goes here
From 9f7d0045f36ea67b1d8b80c3e2fa921c035faf83 Mon Sep 17 00:00:00 2001 From: skaphan Date: Tue, 11 Mar 2025 17:52:30 -0700 Subject: [PATCH 03/18] Just followed the pattern and put the pie chart where it seems to fit... --- common/cloudflare.py | 5 ++++- static/share/share.js | 3 ++- templates/pie/pie-nonblocking.html | 8 +------- visualizer/serializers.py | 2 ++ visualizer/tests/testLiveBrowserHeadless.py | 4 +++- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/common/cloudflare.py b/common/cloudflare.py index 3be5b0c5..fa36614d 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/static/share/share.js b/static/share/share.js index 7357ecc2..3f6adb68 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-chart"] ]; for (const selector of ["exportVistypeSelector", "embedlyVistypeSelector"]) diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index a735ad8c..5fe535b1 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -1,10 +1,4 @@ {% load static %} -{% load compress %} -{% compress css file %} - -{% endcompress %} - -{% compress js file %} -{% endcompress %} + 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 df582bdd..3ff00092 100644 --- a/visualizer/tests/testLiveBrowserHeadless.py +++ b/visualizer/tests/testLiveBrowserHeadless.py @@ -182,7 +182,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-chart" + ] # None of the valid vistypes have errors for vistype in validVistypes: From 4b9e87dfe3711e40a4c27b8c98c6484d18306b67 Mon Sep 17 00:00:00 2001 From: Armin Samii Date: Wed, 12 Mar 2025 08:23:44 -0700 Subject: [PATCH 04/18] pass in actual json data (demo) --- common/viewUtils.py | 3 ++- templates/pie/pie.html | 28 +++++++++++++++++++--------- visualizer/graph/readRCVRCJSON.py | 1 + 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/common/viewUtils.py b/common/viewUtils.py index 06c994fb..fabdad3d 100644 --- a/common/viewUtils.py +++ b/common/viewUtils.py @@ -63,7 +63,8 @@ def get_data_for_graph(graph, config): 'singleTableSummary': singleTableSummary, 'tabularByRound': tabularByRound, 'tabularByRoundInteractive': tabularByRoundInteractive, - 'graph': graph + 'graph': graph, + 'rawData': graph._debug_temporary_raw_JSON } roundDescriberData = get_data_for_round_describer(graph, config) graphData.update(roundDescriberData) diff --git a/templates/pie/pie.html b/templates/pie/pie.html index 1e78cf4d..5ec37e28 100644 --- a/templates/pie/pie.html +++ b/templates/pie/pie.html @@ -1,9 +1,19 @@ -
- - - - - - Pie chart goes here -
+ + +{{ rawData|json_script:"rawDataId" }} + + +
+ + diff --git a/visualizer/graph/readRCVRCJSON.py b/visualizer/graph/readRCVRCJSON.py index 0c83c5e3..a4d541fa 100644 --- a/visualizer/graph/readRCVRCJSON.py +++ b/visualizer/graph/readRCVRCJSON.py @@ -275,6 +275,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.items) + self.graph._debug_temporary_raw_JSON = data def parse_data(self, data): """ Parses the JSON data, or raises an exception on failure """ From c544c8fc631c63db63d3cf2f14ac53873a715ec7 Mon Sep 17 00:00:00 2001 From: Armin Samii Date: Sat, 15 Mar 2025 14:49:28 -0700 Subject: [PATCH 05/18] compression & slider demo --- static/visualizer/visualize-nonblocking.js | 3 ++ templates/pie/pie-nonblocking.html | 44 ++++++++++++++++++++++ templates/pie/pie.html | 18 ++------- 3 files changed, 51 insertions(+), 14 deletions(-) diff --git a/static/visualizer/visualize-nonblocking.js b/static/visualizer/visualize-nonblocking.js index 12bab909..1799ee9e 100644 --- a/static/visualizer/visualize-nonblocking.js +++ b/static/visualizer/visualize-nonblocking.js @@ -26,6 +26,9 @@ function animateNow(newTabName) { } else if (newTabName == 'round-by-round') { trs_animate('tabular-by-round-slider-container'); hasAnimatedSlider = true; + } else if (newTabName == 'pie') { + trs_animate('pie-slider-container'); + hasAnimatedSlider = true; } } diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 5fe535b1..01b2ebd2 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -1,4 +1,48 @@ {% load static %} +{% load compress %} +{% compress js file %} +{% endcompress %} + diff --git a/templates/pie/pie.html b/templates/pie/pie.html index 5ec37e28..0511dd44 100644 --- a/templates/pie/pie.html +++ b/templates/pie/pie.html @@ -3,17 +3,7 @@ {{ rawData|json_script:"rawDataId" }} -
- - +
+
+
+
From a6100400860518334de380c9756d3eb5d80c8cf4 Mon Sep 17 00:00:00 2001 From: skaphan Date: Sat, 15 Mar 2025 18:03:59 -0700 Subject: [PATCH 06/18] committing current version prior to merge --- static/pie/pie-chart.es.js | 5037 ++++++++++++++++++++++++++++ templates/pie/pie-nonblocking.html | 3 +- 2 files changed, 5039 insertions(+), 1 deletion(-) create mode 100644 static/pie/pie-chart.es.js diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js new file mode 100644 index 00000000..f6dea7f4 --- /dev/null +++ b/static/pie/pie-chart.es.js @@ -0,0 +1,5037 @@ +var xa = Object.defineProperty; +var Ti = (t) => { + throw TypeError(t); +}; +var wa = (t, e, n) => e in t ? xa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var Jt = (t, e, n) => wa(t, typeof e != "symbol" ? e + "" : e, n), Ei = (t, e, n) => e.has(t) || Ti("Cannot " + n); +var St = (t, e, n) => (Ei(t, e, "read from private field"), n ? n.call(t) : e.get(t)), kr = (t, e, n) => e.has(t) ? Ti("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), Rr = (t, e, n, r) => (Ei(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); +const ba = "5"; +typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ba); +const Kr = 1, Wr = 2, rs = 4, $a = 8, Aa = 16, Ta = 1, Ea = 4, ka = 8, Ra = 16, Na = 1, Sa = 2, is = "[", Jr = "[!", Zr = "]", Ge = {}, Ct = Symbol(), ki = !1, te = 2, ss = 4, Qr = 8, ti = 16, Te = 32, sn = 64, Xn = 128, Gt = 256, Yn = 512, Pt = 1024, Ee = 2048, an = 4096, be = 8192, dr = 16384, Ca = 32768, ei = 65536, Ma = 1 << 19, as = 1 << 20, _n = Symbol("$state"), os = Symbol("legacy props"), Da = Symbol(""); +var ni = Array.isArray, Oa = Array.prototype.indexOf, ri = Array.from, Un = Object.keys, Gn = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, Pa = Object.getOwnPropertyDescriptors, Ia = Object.prototype, Fa = Array.prototype, ls = Object.getPrototypeOf; +function us(t) { + for (var e = 0; e < t.length; e++) + t[e](); +} +let wn = [], Dr = []; +function fs() { + var t = wn; + wn = [], us(t); +} +function La() { + var t = Dr; + Dr = [], us(t); +} +function ii(t) { + wn.length === 0 && queueMicrotask(fs), wn.push(t); +} +function Ri() { + wn.length > 0 && fs(), Dr.length > 0 && La(); +} +function cs(t) { + return t === this.v; +} +function qa(t, e) { + return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; +} +function si(t) { + return !qa(t, this.v); +} +function Va(t) { + throw new Error("https://svelte.dev/e/effect_in_teardown"); +} +function za() { + throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); +} +function Ba(t) { + throw new Error("https://svelte.dev/e/effect_orphan"); +} +function Ha() { + throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); +} +function Xa() { + throw new Error("https://svelte.dev/e/hydration_failed"); +} +function Ya(t) { + throw new Error("https://svelte.dev/e/props_invalid_value"); +} +function Ua() { + throw new Error("https://svelte.dev/e/state_descriptors_fixed"); +} +function Ga() { + throw new Error("https://svelte.dev/e/state_prototype_fixed"); +} +function ja() { + throw new Error("https://svelte.dev/e/state_unsafe_local_read"); +} +function Ka() { + throw new Error("https://svelte.dev/e/state_unsafe_mutation"); +} +let Wa = !1; +function Ut(t, e) { + var n = { + f: 0, + // TODO ideally we could skip this altogether, but it causes type errors + v: t, + reactions: null, + equals: cs, + rv: 0, + wv: 0 + }; + return n; +} +function ot(t) { + return /* @__PURE__ */ Ja(Ut(t)); +} +// @__NO_SIDE_EFFECTS__ +function ai(t, e = !1) { + const n = Ut(t); + return e || (n.equals = si), n; +} +// @__NO_SIDE_EFFECTS__ +function Ja(t) { + return et !== null && !Zt && et.f & te && (le === null ? eo([t]) : le.push(t)), t; +} +function B(t, e) { + return et !== null && !Zt && Ss() && et.f & (te | ti) && // If the source was created locally within the current derived, then + // we allow the mutation. + (le === null || !le.includes(t)) && Ka(), Or(t, e); +} +function Or(t, e) { + return t.equals(e) || (t.v, t.v = e, t.wv = xs(), ds(t, Ee), nt !== null && nt.f & Pt && !(nt.f & (Te | sn)) && (ye === null ? no([t]) : ye.push(t))), e; +} +function ds(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; + a & Ee || ($e(s, e), a & (Pt | Gt) && (a & te ? ds( + /** @type {Derived} */ + s, + an + ) : mr( + /** @type {Effect} */ + s + ))); + } +} +// @__NO_SIDE_EFFECTS__ +function Pe(t) { + var e = te | Ee, n = et !== null && et.f & te ? ( + /** @type {Derived} */ + et + ) : null; + return nt === null || n !== null && n.f & Gt ? e |= Gt : nt.f |= as, { + ctx: Ot, + deps: null, + effects: null, + equals: cs, + f: e, + fn: t, + reactions: null, + rv: 0, + v: ( + /** @type {V} */ + null + ), + wv: 0, + parent: n ?? nt + }; +} +// @__NO_SIDE_EFFECTS__ +function Za(t) { + const e = /* @__PURE__ */ Pe(t); + return e.equals = si, e; +} +function hs(t) { + var e = t.effects; + if (e !== null) { + t.effects = null; + for (var n = 0; n < e.length; n += 1) + de( + /** @type {Effect} */ + e[n] + ); + } +} +function Qa(t) { + for (var e = t.parent; e !== null; ) { + if (!(e.f & te)) + return ( + /** @type {Effect} */ + e + ); + e = e.parent; + } + return null; +} +function to(t) { + var e, n = nt; + tn(Qa(t)); + try { + hs(t), e = bs(t); + } finally { + tn(n); + } + return e; +} +function vs(t) { + var e = to(t), n = (Se || t.f & Gt) && t.deps !== null ? an : Pt; + $e(t, n), t.equals(e) || (t.v = e, t.wv = xs()); +} +function hr(t) { + console.warn("https://svelte.dev/e/hydration_mismatch"); +} +let W = !1; +function we(t) { + W = t; +} +let j; +function Vt(t) { + if (t === null) + throw hr(), Ge; + return j = t; +} +function Ze() { + return Vt( + /** @type {TemplateNode} */ + /* @__PURE__ */ he(j) + ); +} +function K(t) { + if (W) { + if (/* @__PURE__ */ he(j) !== null) + throw hr(), Ge; + j = t; + } +} +function Rn(t = 1) { + if (W) { + for (var e = t, n = j; e--; ) + n = /** @type {TemplateNode} */ + /* @__PURE__ */ he(n); + j = n; + } +} +function Pr() { + for (var t = 0, e = j; ; ) { + if (e.nodeType === 8) { + var n = ( + /** @type {Comment} */ + e.data + ); + if (n === Zr) { + if (t === 0) return e; + t -= 1; + } else (n === is || n === Jr) && (t += 1); + } + var r = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ he(e) + ); + e.remove(), e = r; + } +} +function lt(t, e = null, n) { + if (typeof t != "object" || t === null || _n in t) + return t; + const r = ls(t); + if (r !== Ia && r !== Fa) + return t; + var i = /* @__PURE__ */ new Map(), s = ni(t), a = Ut(0); + s && i.set("length", Ut( + /** @type {any[]} */ + t.length + )); + var o; + return new Proxy( + /** @type {any} */ + t, + { + defineProperty(l, u, f) { + (!("value" in f) || f.configurable === !1 || f.enumerable === !1 || f.writable === !1) && Ua(); + var d = i.get(u); + return d === void 0 ? (d = Ut(f.value), i.set(u, d)) : B(d, lt(f.value, o)), !0; + }, + deleteProperty(l, u) { + var f = i.get(u); + if (f === void 0) + u in l && i.set(u, Ut(Ct)); + else { + if (s && typeof u == "string") { + var d = ( + /** @type {Source} */ + i.get("length") + ), c = Number(u); + Number.isInteger(c) && c < d.v && B(d, c); + } + B(f, Ct), Ni(a); + } + return !0; + }, + get(l, u, f) { + var m; + if (u === _n) + return t; + var d = i.get(u), c = u in l; + if (d === void 0 && (!c || (m = Fe(l, u)) != null && m.writable) && (d = Ut(lt(c ? l[u] : Ct, o)), i.set(u, d)), d !== void 0) { + var v = h(d); + return v === Ct ? void 0 : v; + } + return Reflect.get(l, u, f); + }, + getOwnPropertyDescriptor(l, u) { + var f = Reflect.getOwnPropertyDescriptor(l, u); + if (f && "value" in f) { + var d = i.get(u); + d && (f.value = h(d)); + } else if (f === void 0) { + var c = i.get(u), v = c == null ? void 0 : c.v; + if (c !== void 0 && v !== Ct) + return { + enumerable: !0, + configurable: !0, + value: v, + writable: !0 + }; + } + return f; + }, + has(l, u) { + var v; + if (u === _n) + return !0; + var f = i.get(u), d = f !== void 0 && f.v !== Ct || Reflect.has(l, u); + if (f !== void 0 || nt !== null && (!d || (v = Fe(l, u)) != null && v.writable)) { + f === void 0 && (f = Ut(d ? lt(l[u], o) : Ct), i.set(u, f)); + var c = h(f); + if (c === Ct) + return !1; + } + return d; + }, + set(l, u, f, d) { + var b; + var c = i.get(u), v = u in l; + if (s && u === "length") + for (var m = f; m < /** @type {Source} */ + c.v; m += 1) { + var y = i.get(m + ""); + y !== void 0 ? B(y, Ct) : m in l && (y = Ut(Ct), i.set(m + "", y)); + } + c === void 0 ? (!v || (b = Fe(l, u)) != null && b.writable) && (c = Ut(void 0), B(c, lt(f, o)), i.set(u, c)) : (v = c.v !== Ct, B(c, lt(f, o))); + var x = Reflect.getOwnPropertyDescriptor(l, u); + if (x != null && x.set && x.set.call(d, f), !v) { + if (s && typeof u == "string") { + var k = ( + /** @type {Source} */ + i.get("length") + ), w = Number(u); + Number.isInteger(w) && w >= k.v && B(k, w + 1); + } + Ni(a); + } + return !0; + }, + ownKeys(l) { + h(a); + var u = Reflect.ownKeys(l).filter((c) => { + var v = i.get(c); + return v === void 0 || v.v !== Ct; + }); + for (var [f, d] of i) + d.v !== Ct && !(f in l) && u.push(f); + return u; + }, + setPrototypeOf() { + Ga(); + } + } + ); +} +function Ni(t, e = 1) { + B(t, t.v + e); +} +var Si, ms, ps, gs; +function Ir() { + if (Si === void 0) { + Si = window, ms = /Firefox/.test(navigator.userAgent); + var t = Element.prototype, e = Node.prototype; + ps = Fe(e, "firstChild").get, gs = Fe(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; + } +} +function qe(t = "") { + return document.createTextNode(t); +} +// @__NO_SIDE_EFFECTS__ +function ce(t) { + return ps.call(t); +} +// @__NO_SIDE_EFFECTS__ +function he(t) { + return gs.call(t); +} +function tt(t, e) { + if (!W) + return /* @__PURE__ */ ce(t); + var n = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ ce(j) + ); + if (n === null) + n = j.appendChild(qe()); + else if (e && n.nodeType !== 3) { + var r = qe(); + return n == null || n.before(r), Vt(r), r; + } + return Vt(n), n; +} +function hn(t, e) { + if (!W) { + var n = ( + /** @type {DocumentFragment} */ + /* @__PURE__ */ ce( + /** @type {Node} */ + t + ) + ); + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ he(n) : n; + } + return j; +} +function mt(t, e = 1, n = !1) { + let r = W ? j : t; + for (var i; e--; ) + i = r, r = /** @type {TemplateNode} */ + /* @__PURE__ */ he(r); + if (!W) + return r; + var s = r == null ? void 0 : r.nodeType; + if (n && s !== 3) { + var a = qe(); + return r === null ? i == null || i.after(a) : r.before(a), Vt(a), a; + } + return Vt(r), /** @type {TemplateNode} */ + r; +} +function _s(t) { + t.textContent = ""; +} +let In = !1, jn = !1, Kn = null, Fn = !1, oi = !1; +function Ci(t) { + oi = t; +} +let yn = []; +let et = null, Zt = !1; +function Qe(t) { + et = t; +} +let nt = null; +function tn(t) { + nt = t; +} +let le = null; +function eo(t) { + le = t; +} +let At = null, qt = 0, ye = null; +function no(t) { + ye = t; +} +let ys = 1, Wn = 0, Se = !1; +function xs() { + return ++ys; +} +function En(t) { + var d; + var e = t.f; + if (e & Ee) + return !0; + if (e & an) { + var n = t.deps, r = (e & Gt) !== 0; + if (n !== null) { + var i, s, a = (e & Yn) !== 0, o = r && nt !== null && !Se, l = n.length; + if (a || o) { + var u = ( + /** @type {Derived} */ + t + ), f = u.parent; + for (i = 0; i < l; i++) + s = n[i], (a || !((d = s == null ? void 0 : s.reactions) != null && d.includes(u))) && (s.reactions ?? (s.reactions = [])).push(u); + a && (u.f ^= Yn), o && f !== null && !(f.f & Gt) && (u.f ^= Gt); + } + for (i = 0; i < l; i++) + if (s = n[i], En( + /** @type {Derived} */ + s + ) && vs( + /** @type {Derived} */ + s + ), s.wv > t.wv) + return !0; + } + (!r || nt !== null && !Se) && $e(t, Pt); + } + return !1; +} +function ro(t, e) { + for (var n = e; n !== null; ) { + if (n.f & Xn) + try { + n.fn(t); + return; + } catch { + n.f ^= Xn; + } + n = n.parent; + } + throw In = !1, t; +} +function io(t) { + return (t.f & dr) === 0 && (t.parent === null || (t.parent.f & Xn) === 0); +} +function vr(t, e, n, r) { + if (In) { + if (n === null && (In = !1), io(e)) + throw t; + return; + } + n !== null && (In = !0); + { + ro(t, e); + return; + } +} +function ws(t, e, n = !0) { + var r = t.reactions; + if (r !== null) + for (var i = 0; i < r.length; i++) { + var s = r[i]; + s.f & te ? ws( + /** @type {Derived} */ + s, + e, + !1 + ) : e === s && (n ? $e(s, Ee) : s.f & Pt && $e(s, an), mr( + /** @type {Effect} */ + s + )); + } +} +function bs(t) { + var v; + var e = At, n = qt, r = ye, i = et, s = Se, a = le, o = Ot, l = Zt, u = t.f; + At = /** @type {null | Value[]} */ + null, qt = 0, ye = null, Se = (u & Gt) !== 0 && (Zt || !Fn || et === null), et = u & (Te | sn) ? null : t, le = null, Mi(t.ctx), Zt = !1, Wn++; + try { + var f = ( + /** @type {Function} */ + (0, t.fn)() + ), d = t.deps; + if (At !== null) { + var c; + if (Jn(t, qt), d !== null && qt > 0) + for (d.length = qt + At.length, c = 0; c < At.length; c++) + d[qt + c] = At[c]; + else + t.deps = d = At; + if (!Se) + for (c = qt; c < d.length; c++) + ((v = d[c]).reactions ?? (v.reactions = [])).push(t); + } else d !== null && qt < d.length && (Jn(t, qt), d.length = qt); + if (Ss() && ye !== null && !Zt && d !== null && !(t.f & (te | an | Ee))) + for (c = 0; c < /** @type {Source[]} */ + ye.length; c++) + ws( + ye[c], + /** @type {Effect} */ + t + ); + return i !== null && Wn++, f; + } finally { + At = e, qt = n, ye = r, et = i, Se = s, le = a, Mi(o), Zt = l; + } +} +function so(t, e) { + let n = e.reactions; + if (n !== null) { + var r = Oa.call(n, t); + if (r !== -1) { + var i = n.length - 1; + i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); + } + } + n === null && e.f & te && // 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 + (At === null || !At.includes(e)) && ($e(e, an), e.f & (Gt | Yn) || (e.f ^= Yn), hs( + /** @type {Derived} **/ + e + ), Jn( + /** @type {Derived} **/ + e, + 0 + )); +} +function Jn(t, e) { + var n = t.deps; + if (n !== null) + for (var r = e; r < n.length; r++) + so(t, n[r]); +} +function li(t) { + var e = t.f; + if (!(e & dr)) { + $e(t, Pt); + var n = nt, r = Ot, i = Fn; + nt = t, Fn = !0; + try { + e & ti ? mo(t) : Es(t), Ts(t); + var s = bs(t); + t.teardown = typeof s == "function" ? s : null, t.wv = ys; + var a = t.deps, o; + ki && Wa && t.f & Ee; + } catch (l) { + vr(l, t, n, r || t.ctx); + } finally { + Fn = i, nt = n; + } + } +} +function ao() { + try { + Ha(); + } catch (t) { + if (Kn !== null) + vr(t, Kn, null); + else + throw t; + } +} +function $s() { + try { + for (var t = 0; yn.length > 0; ) { + t++ > 1e3 && ao(); + var e = yn, n = e.length; + yn = []; + for (var r = 0; r < n; r++) { + var i = e[r]; + i.f & Pt || (i.f ^= Pt); + var s = lo(i); + oo(s); + } + } + } finally { + jn = !1, Kn = null; + } +} +function oo(t) { + var e = t.length; + if (e !== 0) + for (var n = 0; n < e; n++) { + var r = t[n]; + if (!(r.f & (dr | be))) + try { + En(r) && (li(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? ks(r) : r.fn = null)); + } catch (i) { + vr(i, r, null, r.ctx); + } + } +} +function mr(t) { + jn || (jn = !0, queueMicrotask($s)); + for (var e = Kn = t; e.parent !== null; ) { + e = e.parent; + var n = e.f; + if (n & (sn | Te)) { + if (!(n & Pt)) return; + e.f ^= Pt; + } + } + yn.push(e); +} +function lo(t) { + for (var e = [], n = t.first; n !== null; ) { + var r = n.f, i = (r & Te) !== 0, s = i && (r & Pt) !== 0; + if (!s && !(r & be)) { + if (r & ss) + e.push(n); + else if (i) + n.f ^= Pt; + else { + var a = et; + try { + et = n, En(n) && li(n); + } catch (u) { + vr(u, n, null, n.ctx); + } finally { + et = a; + } + } + var o = n.first; + if (o !== null) { + n = o; + continue; + } + } + var l = n.parent; + for (n = n.next; n === null && l !== null; ) + n = l.next, l = l.parent; + } + return e; +} +function Q(t) { + var e; + for (Ri(); yn.length > 0; ) + jn = !0, $s(), Ri(); + return ( + /** @type {T} */ + e + ); +} +function h(t) { + var e = t.f, n = (e & te) !== 0; + if (et !== null && !Zt) { + le !== null && le.includes(t) && ja(); + var r = et.deps; + t.rv < Wn && (t.rv = Wn, At === null && r !== null && r[qt] === t ? qt++ : At === null ? At = [t] : (!Se || !At.includes(t)) && At.push(t)); + } else if (n && /** @type {Derived} */ + t.deps === null && /** @type {Derived} */ + t.effects === null) { + var i = ( + /** @type {Derived} */ + t + ), s = i.parent; + s !== null && !(s.f & Gt) && (i.f ^= Gt); + } + return n && (i = /** @type {Derived} */ + t, En(i) && vs(i)), t.v; +} +function Zn(t) { + var e = Zt; + try { + return Zt = !0, t(); + } finally { + Zt = e; + } +} +const uo = -7169; +function $e(t, e) { + t.f = t.f & uo | e; +} +function fo(t) { + nt === null && et === null && Ba(), et !== null && et.f & Gt && nt === null && za(), oi && Va(); +} +function co(t, e) { + var n = e.last; + n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); +} +function on(t, e, n, r = !0) { + var i = (t & sn) !== 0, s = nt, a = { + ctx: Ot, + deps: null, + nodes_start: null, + nodes_end: null, + f: t | Ee, + first: null, + fn: e, + last: null, + next: null, + parent: i ? null : s, + prev: null, + teardown: null, + transitions: null, + wv: 0 + }; + if (n) + try { + li(a), a.f |= Ca; + } catch (u) { + throw de(a), u; + } + else e !== null && mr(a); + var o = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (as | Xn)) === 0; + if (!o && !i && r && (s !== null && co(a, s), et !== null && et.f & te)) { + var l = ( + /** @type {Derived} */ + et + ); + (l.effects ?? (l.effects = [])).push(a); + } + return a; +} +function ui(t) { + fo(); + var e = nt !== null && (nt.f & Te) !== 0 && Ot !== null && !Ot.m; + if (e) { + var n = ( + /** @type {ComponentContext} */ + Ot + ); + (n.e ?? (n.e = [])).push({ + fn: t, + effect: nt, + reaction: et + }); + } else { + var r = fi(t); + return r; + } +} +function ho(t) { + const e = on(sn, t, !0); + return () => { + de(e); + }; +} +function vo(t) { + const e = on(sn, t, !0); + return (n = {}) => new Promise((r) => { + n.outro ? Qn(e, () => { + de(e), r(void 0); + }) : (de(e), r(void 0)); + }); +} +function fi(t) { + return on(ss, t, !1); +} +function As(t) { + return on(Qr, t, !0); +} +function se(t, e = [], n = Pe) { + const r = e.map(n); + return pr(() => t(...r.map(h))); +} +function pr(t, e = 0) { + return on(Qr | ti | e, t, !0); +} +function en(t, e = !0) { + return on(Qr | Te, t, !0, e); +} +function Ts(t) { + var e = t.teardown; + if (e !== null) { + const n = oi, r = et; + Ci(!0), Qe(null); + try { + e.call(null); + } finally { + Ci(n), Qe(r); + } + } +} +function Es(t, e = !1) { + var n = t.first; + for (t.first = t.last = null; n !== null; ) { + var r = n.next; + de(n, e), n = r; + } +} +function mo(t) { + for (var e = t.first; e !== null; ) { + var n = e.next; + e.f & Te || de(e), e = n; + } +} +function de(t, e = !0) { + var n = !1; + if ((e || t.f & Ma) && t.nodes_start !== null) { + for (var r = t.nodes_start, i = t.nodes_end; r !== null; ) { + var s = r === i ? null : ( + /** @type {TemplateNode} */ + /* @__PURE__ */ he(r) + ); + r.remove(), r = s; + } + n = !0; + } + Es(t, e && !n), Jn(t, 0), $e(t, dr); + var a = t.transitions; + if (a !== null) + for (const l of a) + l.stop(); + Ts(t); + var o = t.parent; + o !== null && o.first !== null && ks(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = null; +} +function ks(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 Qn(t, e) { + var n = []; + ci(t, n, !0), Rs(n, () => { + de(t), e && e(); + }); +} +function Rs(t, e) { + var n = t.length; + if (n > 0) { + var r = () => --n || e(); + for (var i of t) + i.out(r); + } else + e(); +} +function ci(t, e, n) { + if (!(t.f & be)) { + if (t.f ^= be, t.transitions !== null) + for (const a of t.transitions) + (a.is_global || n) && e.push(a); + for (var r = t.first; r !== null; ) { + var i = r.next, s = (r.f & ei) !== 0 || (r.f & Te) !== 0; + ci(r, e, s ? n : !1), r = i; + } + } +} +function tr(t) { + Ns(t, !0); +} +function Ns(t, e) { + if (t.f & be) { + t.f ^= be, t.f & Pt || (t.f ^= Pt), En(t) && ($e(t, Ee), mr(t)); + for (var n = t.first; n !== null; ) { + var r = n.next, i = (n.f & ei) !== 0 || (n.f & Te) !== 0; + Ns(n, i ? e : !1), n = r; + } + if (t.transitions !== null) + for (const s of t.transitions) + (s.is_global || e) && s.in(); + } +} +function po(t) { + throw new Error("https://svelte.dev/e/lifecycle_outside_component"); +} +let Ot = null; +function Mi(t) { + Ot = t; +} +function gr(t, e = !1, n) { + Ot = { + p: Ot, + c: null, + e: null, + m: !1, + s: t, + x: null, + l: null + }; +} +function _r(t) { + const e = Ot; + if (e !== null) { + t !== void 0 && (e.x = t); + const a = e.e; + if (a !== null) { + var n = nt, r = et; + e.e = null; + try { + for (var i = 0; i < a.length; i++) { + var s = a[i]; + tn(s.effect), Qe(s.reaction), fi(s.fn); + } + } finally { + tn(n), Qe(r); + } + } + Ot = e.p, e.m = !0; + } + return t || /** @type {T} */ + {}; +} +function Ss() { + return !0; +} +const go = ["touchstart", "touchmove"]; +function _o(t) { + return go.includes(t); +} +const Cs = /* @__PURE__ */ new Set(), Fr = /* @__PURE__ */ new Set(); +function Ms(t) { + for (var e = 0; e < t.length; e++) + Cs.add(t[e]); + for (var n of Fr) + n(t); +} +function Nn(t) { + var w; + var e = this, n = ( + /** @type {Node} */ + e.ownerDocument + ), r = t.type, i = ((w = t.composedPath) == null ? void 0 : w.call(t)) || [], s = ( + /** @type {null | Element} */ + i[0] || t.target + ), a = 0, o = 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) { + Gn(t, "currentTarget", { + configurable: !0, + get() { + return s || n; + } + }); + var f = et, d = nt; + Qe(null), tn(null); + try { + for (var c, v = []; s !== null; ) { + var m = s.assignedSlot || s.parentNode || /** @type {any} */ + s.host || null; + try { + var y = s["__" + r]; + if (y !== void 0 && (!/** @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)) + if (ni(y)) { + var [x, ...k] = y; + x.apply(s, [t, ...k]); + } else + y.call(s, t); + } catch (b) { + c ? v.push(b) : c = b; + } + if (t.cancelBubble || m === e || m === null) + break; + s = m; + } + if (c) { + for (let b of v) + queueMicrotask(() => { + throw b; + }); + throw c; + } + } finally { + t.__root = e, delete t.currentTarget, Qe(f), tn(d); + } + } +} +function di(t) { + var e = document.createElement("template"); + return e.innerHTML = t, e.content; +} +function ue(t, e) { + var n = ( + /** @type {Effect} */ + nt + ); + n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e); +} +// @__NO_SIDE_EFFECTS__ +function jt(t, e) { + var n = (e & Na) !== 0, r = (e & Sa) !== 0, i, s = !t.startsWith(""); + return () => { + if (W) + return ue(j, null), j; + i === void 0 && (i = di(s ? t : "" + t), n || (i = /** @type {Node} */ + /* @__PURE__ */ ce(i))); + var a = ( + /** @type {TemplateNode} */ + r || ms ? document.importNode(i, !0) : i.cloneNode(!0) + ); + if (n) { + var o = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ ce(a) + ), l = ( + /** @type {TemplateNode} */ + a.lastChild + ); + ue(o, l); + } else + ue(a, a); + return a; + }; +} +// @__NO_SIDE_EFFECTS__ +function yo(t, e, n = "svg") { + var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; + return () => { + if (W) + return ue(j, null), j; + if (!s) { + var a = ( + /** @type {DocumentFragment} */ + di(i) + ), o = ( + /** @type {Element} */ + /* @__PURE__ */ ce(a) + ); + s = /** @type {Element} */ + /* @__PURE__ */ ce(o); + } + var l = ( + /** @type {TemplateNode} */ + s.cloneNode(!0) + ); + return ue(l, l), l; + }; +} +function xo(t = "") { + if (!W) { + var e = qe(t + ""); + return ue(e, e), e; + } + var n = j; + return n.nodeType !== 3 && (n.before(n = qe()), Vt(n)), ue(n, n), n; +} +function Et(t, e) { + if (W) { + nt.nodes_end = j, Ze(); + return; + } + t !== null && t.before( + /** @type {Node} */ + e + ); +} +function oe(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 Ds(t, e) { + return Os(t, e); +} +function wo(t, e) { + Ir(), e.intro = e.intro ?? !1; + const n = e.target, r = W, i = j; + try { + for (var s = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ ce(n) + ); s && (s.nodeType !== 8 || /** @type {Comment} */ + s.data !== is); ) + s = /** @type {TemplateNode} */ + /* @__PURE__ */ he(s); + if (!s) + throw Ge; + we(!0), Vt( + /** @type {Comment} */ + s + ), Ze(); + const a = Os(t, { ...e, anchor: s }); + if (j === null || j.nodeType !== 8 || /** @type {Comment} */ + j.data !== Zr) + throw hr(), Ge; + return we(!1), /** @type {Exports} */ + a; + } catch (a) { + if (a === Ge) + return e.recover === !1 && Xa(), Ir(), _s(n), we(!1), Ds(t, e); + throw a; + } finally { + we(r), Vt(i); + } +} +const He = /* @__PURE__ */ new Map(); +function Os(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + Ir(); + var o = /* @__PURE__ */ new Set(), l = (d) => { + for (var c = 0; c < d.length; c++) { + var v = d[c]; + if (!o.has(v)) { + o.add(v); + var m = _o(v); + e.addEventListener(v, Nn, { passive: m }); + var y = He.get(v); + y === void 0 ? (document.addEventListener(v, Nn, { passive: m }), He.set(v, 1)) : He.set(v, y + 1); + } + } + }; + l(ri(Cs)), Fr.add(l); + var u = void 0, f = vo(() => { + var d = n ?? e.appendChild(qe()); + return en(() => { + if (s) { + gr({}); + var c = ( + /** @type {ComponentContext} */ + Ot + ); + c.c = s; + } + i && (r.$$events = i), W && ue( + /** @type {TemplateNode} */ + d, + null + ), u = t(d, r) || {}, W && (nt.nodes_end = j), s && _r(); + }), () => { + var m; + for (var c of o) { + e.removeEventListener(c, Nn); + var v = ( + /** @type {number} */ + He.get(c) + ); + --v === 0 ? (document.removeEventListener(c, Nn), He.delete(c)) : He.set(c, v); + } + Fr.delete(l), d !== n && ((m = d.parentNode) == null || m.removeChild(d)); + }; + }); + return Lr.set(u, f), u; +} +let Lr = /* @__PURE__ */ new WeakMap(); +function bo(t, e) { + const n = Lr.get(t); + return n ? (Lr.delete(t), n(e)) : Promise.resolve(); +} +function xn(t, e, n = !1) { + W && Ze(); + var r = t, i = null, s = null, a = Ct, o = n ? ei : 0, l = !1; + const u = (d, c = !0) => { + l = !0, f(c, d); + }, f = (d, c) => { + if (a === (a = d)) return; + let v = !1; + if (W) { + const m = ( + /** @type {Comment} */ + r.data === Jr + ); + !!a === m && (r = Pr(), Vt(r), we(!1), v = !0); + } + a ? (i ? tr(i) : c && (i = en(() => c(r))), s && Qn(s, () => { + s = null; + })) : (s ? tr(s) : c && (s = en(() => c(r))), i && Qn(i, () => { + i = null; + })), v && we(!0); + }; + pr(() => { + l = !1, e(u), l || f(null, null); + }, o), W && (r = j); +} +function je(t, e) { + return e; +} +function $o(t, e, n, r) { + for (var i = [], s = e.length, a = 0; a < s; a++) + ci(e[a].e, i, !0); + var o = s > 0 && i.length === 0 && n !== null; + if (o) { + var l = ( + /** @type {Element} */ + /** @type {Element} */ + n.parentNode + ); + _s(l), l.append( + /** @type {Element} */ + n + ), r.clear(), Re(t, e[0].prev, e[s - 1].next); + } + Rs(i, () => { + for (var u = 0; u < s; u++) { + var f = e[u]; + o || (r.delete(f.k), Re(t, f.prev, f.next)), de(f.e, !o); + } + }); +} +function Ke(t, e, n, r, i, s = null) { + var a = t, o = { items: /* @__PURE__ */ new Map(), first: null }, l = (e & rs) !== 0; + if (l) { + var u = ( + /** @type {Element} */ + t + ); + a = W ? Vt( + /** @type {Comment | Text} */ + /* @__PURE__ */ ce(u) + ) : u.appendChild(qe()); + } + W && Ze(); + var f = null, d = !1, c = /* @__PURE__ */ Za(() => { + var v = n(); + return ni(v) ? v : v == null ? [] : ri(v); + }); + pr(() => { + var v = h(c), m = v.length; + if (d && m === 0) + return; + d = m === 0; + let y = !1; + if (W) { + var x = ( + /** @type {Comment} */ + a.data === Jr + ); + x !== (m === 0) && (a = Pr(), Vt(a), we(!1), y = !0); + } + if (W) { + for (var k = null, w, b = 0; b < m; b++) { + if (j.nodeType === 8 && /** @type {Comment} */ + j.data === Zr) { + a = /** @type {Comment} */ + j, y = !0, we(!1); + break; + } + var $ = v[b], N = r($, b); + w = Ps( + j, + o, + k, + null, + $, + N, + b, + i, + e, + n + ), o.items.set(N, w), k = w; + } + m > 0 && Vt(Pr()); + } + W || Ao(v, o, a, i, e, r, n), s !== null && (m === 0 ? f ? tr(f) : f = en(() => s(a)) : f !== null && Qn(f, () => { + f = null; + })), y && we(!0), h(c); + }), W && (a = j); +} +function Ao(t, e, n, r, i, s, a) { + var S, _t, ft, pt; + var o = (i & $a) !== 0, l = (i & (Kr | Wr)) !== 0, u = t.length, f = e.items, d = e.first, c = d, v, m = null, y, x = [], k = [], w, b, $, N; + if (o) + for (N = 0; N < u; N += 1) + w = t[N], b = s(w, N), $ = f.get(b), $ !== void 0 && ((S = $.a) == null || S.measure(), (y ?? (y = /* @__PURE__ */ new Set())).add($)); + for (N = 0; N < u; N += 1) { + if (w = t[N], b = s(w, N), $ = f.get(b), $ === void 0) { + var z = c ? ( + /** @type {TemplateNode} */ + c.e.nodes_start + ) : n; + m = Ps( + z, + e, + m, + m === null ? e.first : m.next, + w, + b, + N, + r, + i, + a + ), f.set(b, m), x = [], k = [], c = m.next; + continue; + } + if (l && To($, w, N, i), $.e.f & be && (tr($.e), o && ((_t = $.a) == null || _t.unfix(), (y ?? (y = /* @__PURE__ */ new Set())).delete($))), $ !== c) { + if (v !== void 0 && v.has($)) { + if (x.length < k.length) { + var X = k[0], Y; + m = X.prev; + var st = x[0], at = x[x.length - 1]; + for (Y = 0; Y < x.length; Y += 1) + Di(x[Y], X, n); + for (Y = 0; Y < k.length; Y += 1) + v.delete(k[Y]); + Re(e, st.prev, at.next), Re(e, m, st), Re(e, at, X), c = X, m = at, N -= 1, x = [], k = []; + } else + v.delete($), Di($, c, n), Re(e, $.prev, $.next), Re(e, $, m === null ? e.first : m.next), Re(e, m, $), m = $; + continue; + } + for (x = [], k = []; c !== null && c.k !== b; ) + c.e.f & be || (v ?? (v = /* @__PURE__ */ new Set())).add(c), k.push(c), c = c.next; + if (c === null) + continue; + $ = c; + } + x.push($), m = $, c = $.next; + } + if (c !== null || v !== void 0) { + for (var J = v === void 0 ? [] : ri(v); c !== null; ) + c.e.f & be || J.push(c), c = c.next; + var Z = J.length; + if (Z > 0) { + var E = i & rs && u === 0 ? n : null; + if (o) { + for (N = 0; N < Z; N += 1) + (ft = J[N].a) == null || ft.measure(); + for (N = 0; N < Z; N += 1) + (pt = J[N].a) == null || pt.fix(); + } + $o(e, J, E, f); + } + } + o && ii(() => { + var ct; + if (y !== void 0) + for ($ of y) + (ct = $.a) == null || ct.apply(); + }), nt.first = e.first && e.first.e, nt.last = m && m.e; +} +function To(t, e, n, r) { + r & Kr && Or(t.v, e), r & Wr ? Or( + /** @type {Value} */ + t.i, + n + ) : t.i = n; +} +function Ps(t, e, n, r, i, s, a, o, l, u) { + var f = (l & Kr) !== 0, d = (l & Aa) === 0, c = f ? d ? /* @__PURE__ */ ai(i) : Ut(i) : i, v = l & Wr ? Ut(a) : a, m = { + i: v, + v: c, + k: s, + a: null, + // @ts-expect-error + e: null, + prev: n, + next: r + }; + try { + return m.e = en(() => o(t, c, v, u), W), m.e.prev = n && n.e, m.e.next = r && r.e, n === null ? e.first = m : (n.next = m, n.e.next = m.e), r !== null && (r.prev = m, r.e.prev = m.e), m; + } finally { + } +} +function Di(t, e, n) { + for (var r = t.next ? ( + /** @type {TemplateNode} */ + t.next.e.nodes_start + ) : n, i = e ? ( + /** @type {TemplateNode} */ + e.e.nodes_start + ) : n, s = ( + /** @type {TemplateNode} */ + t.e.nodes_start + ); s !== r; ) { + var a = ( + /** @type {TemplateNode} */ + /* @__PURE__ */ he(s) + ); + i.before(s), s = a; + } +} +function Re(t, e, n) { + e === null ? t.first = n : (e.next = n, e.e.next = n && n.e), n !== null && (n.prev = e, n.e.prev = e && e.e); +} +function Oi(t, e, n, r, i) { + var s = t, a = "", o; + pr(() => { + if (a === (a = e() ?? "")) { + W && Ze(); + return; + } + o !== void 0 && (de(o), o = void 0), a !== "" && (o = en(() => { + if (W) { + j.data; + for (var l = Ze(), u = l; l !== null && (l.nodeType !== 8 || /** @type {Comment} */ + l.data !== ""); ) + u = l, l = /** @type {TemplateNode} */ + /* @__PURE__ */ he(l); + if (l === null) + throw hr(), Ge; + ue(j, u), s = Vt(l); + return; + } + var f = a + "", d = di(f); + ue( + /** @type {TemplateNode} */ + /* @__PURE__ */ ce(d), + /** @type {TemplateNode} */ + d.lastChild + ), s.before(d); + })); + }); +} +function hi(t, e) { + ii(() => { + 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 = document.createElement("style"); + i.id = e.hash, i.textContent = e.code, r.appendChild(i); + } + }); +} +const Pi = [...` +\r\f \v\uFEFF`]; +function Eo(t, e, n) { + var r = t == null ? "" : "" + t; + 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 o = a + s; + (a === 0 || Pi.includes(r[a - 1])) && (o === r.length || Pi.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; + } + } + return r === "" ? null : r; +} +function Sn(t, e, n, r, i, s) { + var a = t.__className; + if (W || a !== n) { + var o = Eo(n, r, s); + (!W || o !== t.getAttribute("class")) && (o == null ? t.removeAttribute("class") : t.className = o), t.__className = n; + } else if (s) + for (var l in s) { + var u = !!s[l]; + (i == null || u !== !!i[l]) && t.classList.toggle(l, u); + } + return s; +} +function Xe(t, e, n, r) { + var i = t.__attributes ?? (t.__attributes = {}); + W && (i[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === "LINK") || i[e] !== (i[e] = n) && (e === "style" && "__styles" in t && (t.__styles = {}), e === "loading" && (t[Da] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && ko(t).includes(e) ? t[e] = n : t.setAttribute(e, n)); +} +var Ii = /* @__PURE__ */ new Map(); +function ko(t) { + var e = Ii.get(t.nodeName); + if (e) return e; + Ii.set(t.nodeName, e = []); + for (var n, r = t, i = Element.prototype; i !== r; ) { + n = Pa(r); + for (var s in n) + n[s].set && e.push(s); + r = ls(r); + } + return e; +} +function Fi(t, e, n, r) { + var i = t.__styles ?? (t.__styles = {}); + i[e] !== n && (i[e] = n, n == null ? t.style.removeProperty(e) : t.style.setProperty(e, n, "")); +} +function Li(t, e) { + return t === e || (t == null ? void 0 : t[_n]) === e; +} +function We(t = {}, e, n, r) { + return fi(() => { + var i, s; + return As(() => { + i = s, s = (r == null ? void 0 : r()) || [], Zn(() => { + t !== n(...s) && (e(t, ...s), i && Li(n(...i), t) && e(null, ...i)); + }); + }), () => { + ii(() => { + s && Li(n(...s), t) && e(null, ...s); + }); + }; + }), t; +} +function Is(t) { + Ot === null && po(), ui(() => { + const e = Zn(t); + if (typeof e == "function") return ( + /** @type {() => void} */ + e + ); + }); +} +let Cn = !1; +function Ro(t) { + var e = Cn; + try { + return Cn = !1, [t(), Cn]; + } finally { + Cn = e; + } +} +function No(t, e = 1) { + const n = t(); + return t(n + e), n; +} +function it(t, e, n, r) { + var N; + var i = (n & Ta) !== 0, s = !0, a = (n & ka) !== 0, o = (n & Ra) !== 0, l = !1, u; + a ? [u, l] = Ro(() => ( + /** @type {V} */ + t[e] + )) : u = /** @type {V} */ + t[e]; + var f = _n in t || os in t, d = a && (((N = Fe(t, e)) == null ? void 0 : N.set) ?? (f && e in t && ((z) => t[e] = z))) || void 0, c = ( + /** @type {V} */ + r + ), v = !0, m = !1, y = () => (m = !0, v && (v = !1, o ? c = Zn( + /** @type {() => V} */ + r + ) : c = /** @type {V} */ + r), c); + u === void 0 && r !== void 0 && (d && s && Ya(), u = y(), d && d(u)); + var x; + if (x = () => { + var z = ( + /** @type {V} */ + t[e] + ); + return z === void 0 ? y() : (v = !0, m = !1, z); + }, !(n & Ea)) + return x; + if (d) { + var k = t.$$legacy; + return function(z, X) { + return arguments.length > 0 ? ((!X || k || l) && d(X ? x() : z), z) : x(); + }; + } + var w = !1, b = /* @__PURE__ */ ai(u), $ = /* @__PURE__ */ Pe(() => { + var z = x(), X = h(b); + return w ? (w = !1, X) : b.v = z; + }); + return i || ($.equals = si), function(z, X) { + if (arguments.length > 0) { + const Y = X ? h($) : a ? lt(z) : z; + return $.equals(Y) || (w = !0, B(b, Y), m && c !== void 0 && (c = Y), Zn(() => h($))), z; + } + return h($); + }; +} +function So(t) { + return new Co(t); +} +var xe, Yt; +class Co { + /** + * @param {ComponentConstructorOptions & { + * component: any; + * }} options + */ + constructor(e) { + /** @type {any} */ + kr(this, xe); + /** @type {Record} */ + kr(this, Yt); + var s; + var n = /* @__PURE__ */ new Map(), r = (a, o) => { + var l = /* @__PURE__ */ ai(o); + return n.set(a, l), l; + }; + const i = new Proxy( + { ...e.props || {}, $$events: {} }, + { + get(a, o) { + return h(n.get(o) ?? r(o, Reflect.get(a, o))); + }, + has(a, o) { + return o === os ? !0 : (h(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + }, + set(a, o, l) { + return B(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + } + } + ); + Rr(this, Yt, (e.hydrate ? wo : Ds)(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) && Q(), Rr(this, xe, i.$$events); + for (const a of Object.keys(St(this, Yt))) + a === "$set" || a === "$destroy" || a === "$on" || Gn(this, a, { + get() { + return St(this, Yt)[a]; + }, + /** @param {any} value */ + set(o) { + St(this, Yt)[a] = o; + }, + enumerable: !0 + }); + St(this, Yt).$set = /** @param {Record} next */ + (a) => { + Object.assign(i, a); + }, St(this, Yt).$destroy = () => { + bo(St(this, Yt)); + }; + } + /** @param {Record} props */ + $set(e) { + St(this, Yt).$set(e); + } + /** + * @param {string} event + * @param {(...args: any[]) => any} callback + * @returns {any} + */ + $on(e, n) { + St(this, xe)[e] = St(this, xe)[e] || []; + const r = (...i) => n.call(this, ...i); + return St(this, xe)[e].push(r), () => { + St(this, xe)[e] = St(this, xe)[e].filter( + /** @param {any} fn */ + (i) => i !== r + ); + }; + } + $destroy() { + St(this, Yt).$destroy(); + } +} +xe = new WeakMap(), Yt = new WeakMap(); +let Fs; +typeof HTMLElement == "function" && (Fs = class extends HTMLElement { + /** + * @param {*} $$componentCtor + * @param {*} $$slots + * @param {*} use_shadow_dom + */ + constructor(e, n, r) { + super(); + /** The Svelte component constructor */ + Jt(this, "$$ctor"); + /** Slots */ + Jt(this, "$$s"); + /** @type {any} The Svelte component instance */ + Jt(this, "$$c"); + /** Whether or not the custom element is connected */ + Jt(this, "$$cn", !1); + /** @type {Record} Component props data */ + Jt(this, "$$d", {}); + /** `true` if currently in the process of reflecting component props back to attributes */ + Jt(this, "$$r", !1); + /** @type {Record} Props definition (name, reflected, type etc) */ + Jt(this, "$$p_d", {}); + /** @type {Record} Event listeners */ + Jt(this, "$$l", {}); + /** @type {Map} Event listener unsubscribe functions */ + Jt(this, "$$l_u", /* @__PURE__ */ new Map()); + /** @type {any} The managed render effect for reflecting attributes */ + Jt(this, "$$me"); + this.$$ctor = e, this.$$s = n, r && this.attachShadow({ mode: "open" }); + } + /** + * @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 = document.createElement("slot"); + s !== "default" && (o.name = s), Et(a, o); + }; + }; + var e = n; + if (await Promise.resolve(), !this.$$cn || this.$$c) + return; + const r = {}, i = Mo(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] = Ln(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 = So({ + component: this.$$ctor, + target: this.shadowRoot || this, + props: { + ...this.$$d, + $$slots: r, + $$host: this + } + }), this.$$me = ho(() => { + As(() => { + var s; + this.$$r = !0; + for (const a of Un(this.$$c)) { + if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; + this.$$d[a] = this.$$c[a]; + const o = Ln( + 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] = Ln(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 Un(this.$$p_d).find( + (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e + ) || e; + } +}); +function Ln(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 Mo(t) { + const e = {}; + return t.childNodes.forEach((n) => { + e[ + /** @type {Element} node */ + n.slot || "default" + ] = !0; + }), e; +} +function vi(t, e, n, r, i, s) { + let a = class extends Fs { + constructor() { + super(t, n, i), this.$$p_d = e; + } + static get observedAttributes() { + return Un(e).map( + (o) => (e[o].attribute || o).toLowerCase() + ); + } + }; + return Un(e).forEach((o) => { + Gn(a.prototype, o, { + get() { + return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; + }, + set(l) { + var d; + l = Ln(o, l, e), this.$$d[o] = l; + var u = this.$$c; + if (u) { + var f = (d = Fe(u, o)) == null ? void 0 : d.get; + f ? u[o] = l : u.$set({ [o]: l }); + } + } + }); + }), r.forEach((o) => { + Gn(a.prototype, o, { + get() { + var l; + return (l = this.$$c) == null ? void 0 : l[o]; + } + }); + }), t.element = /** @type {any} */ + a, a; +} +var Do = { value: () => { +} }; +function Ls() { + 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 qn(n); +} +function qn(t) { + this._ = t; +} +function Oo(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 }; + }); +} +qn.prototype = Ls.prototype = { + constructor: qn, + on: function(t, e) { + var n = this._, r = Oo(t + "", n), i, s = -1, a = r.length; + if (arguments.length < 2) { + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Po(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] = qi(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = qi(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 qn(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 Po(t, e) { + for (var n = 0, r = t.length, i; n < r; ++n) + if ((i = t[n]).name === e) + return i.value; +} +function qi(t, e, n) { + for (var r = 0, i = t.length; r < i; ++r) + if (t[r].name === e) { + t[r] = Do, t = t.slice(0, r).concat(t.slice(r + 1)); + break; + } + return n != null && t.push({ name: e, value: n }), t; +} +var qr = "http://www.w3.org/1999/xhtml"; +const Vi = { + svg: "http://www.w3.org/2000/svg", + xhtml: qr, + xlink: "http://www.w3.org/1999/xlink", + xml: "http://www.w3.org/XML/1998/namespace", + xmlns: "http://www.w3.org/2000/xmlns/" +}; +function yr(t) { + var e = t += "", n = e.indexOf(":"); + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Vi.hasOwnProperty(e) ? { space: Vi[e], local: t } : t; +} +function Io(t) { + return function() { + var e = this.ownerDocument, n = this.namespaceURI; + return n === qr && e.documentElement.namespaceURI === qr ? e.createElement(t) : e.createElementNS(n, t); + }; +} +function Fo(t) { + return function() { + return this.ownerDocument.createElementNS(t.space, t.local); + }; +} +function qs(t) { + var e = yr(t); + return (e.local ? Fo : Io)(e); +} +function Lo() { +} +function mi(t) { + return t == null ? Lo : function() { + return this.querySelector(t); + }; +} +function qo(t) { + typeof t != "function" && (t = mi(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); +} +function Vo(t) { + return t == null ? [] : Array.isArray(t) ? t : Array.from(t); +} +function zo() { + return []; +} +function Vs(t) { + return t == null ? zo : function() { + return this.querySelectorAll(t); + }; +} +function Bo(t) { + return function() { + return Vo(t.apply(this, arguments)); + }; +} +function Ho(t) { + typeof t == "function" ? t = Bo(t) : t = Vs(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); +} +function zs(t) { + return function() { + return this.matches(t); + }; +} +function Bs(t) { + return function(e) { + return e.matches(t); + }; +} +var Xo = Array.prototype.find; +function Yo(t) { + return function() { + return Xo.call(this.children, t); + }; +} +function Uo() { + return this.firstElementChild; +} +function Go(t) { + return this.select(t == null ? Uo : Yo(typeof t == "function" ? t : Bs(t))); +} +var jo = Array.prototype.filter; +function Ko() { + return Array.from(this.children); +} +function Wo(t) { + return function() { + return jo.call(this.children, t); + }; +} +function Jo(t) { + return this.selectAll(t == null ? Ko : Wo(typeof t == "function" ? t : Bs(t))); +} +function Zo(t) { + typeof t != "function" && (t = zs(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); +} +function Hs(t) { + return new Array(t.length); +} +function Qo() { + return new zt(this._enter || this._groups.map(Hs), this._parents); +} +function er(t, e) { + this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; +} +er.prototype = { + constructor: er, + 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 tl(t) { + return function() { + return t; + }; +} +function el(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 er(t, s[a]); + for (; a < l; ++a) + (o = e[a]) && (i[a] = o); +} +function nl(t, e, n, r, i, s, a) { + var o, l, u = /* @__PURE__ */ new Map(), f = e.length, d = 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 < d; ++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 er(t, s[o]); + for (o = 0; o < f; ++o) + (l = e[o]) && u.get(c[o]) === l && (i[o] = l); +} +function rl(t) { + return t.__data__; +} +function il(t, e) { + if (!arguments.length) return Array.from(this, rl); + var n = e ? nl : el, r = this._parents, i = this._groups; + typeof t != "function" && (t = tl(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, v = sl(t.call(f, f && f.__data__, u, r)), m = v.length, y = o[u] = new Array(m), x = a[u] = new Array(m), k = l[u] = new Array(c); + n(f, d, y, x, k, v, e); + for (var w = 0, b = 0, $, N; w < m; ++w) + if ($ = y[w]) { + for (w >= b && (b = w + 1); !(N = x[b]) && ++b < m; ) ; + $._next = N || null; + } + } + return a = new zt(a, r), a._enter = o, a._exit = l, a; +} +function sl(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); +} +function al() { + return new zt(this._exit || this._groups.map(Hs), this._parents); +} +function ol(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 ll(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), v, m = 0; m < d; ++m) + (v = u[m] || f[m]) && (c[m] = v); + for (; l < i; ++l) + o[l] = n[l]; + return new zt(o, this._parents); +} +function ul() { + 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 fl(t) { + t || (t = cl); + 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 zt(i, this._parents).order(); +} +function cl(t, e) { + return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; +} +function dl() { + var t = arguments[0]; + return arguments[0] = this, t.apply(null, arguments), this; +} +function hl() { + return Array.from(this); +} +function vl() { + 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 ml() { + let t = 0; + for (const e of this) ++t; + return t; +} +function pl() { + return !this.node(); +} +function gl(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 _l(t) { + return function() { + this.removeAttribute(t); + }; +} +function yl(t) { + return function() { + this.removeAttributeNS(t.space, t.local); + }; +} +function xl(t, e) { + return function() { + this.setAttribute(t, e); + }; +} +function wl(t, e) { + return function() { + this.setAttributeNS(t.space, t.local, e); + }; +} +function bl(t, e) { + return function() { + var n = e.apply(this, arguments); + n == null ? this.removeAttribute(t) : this.setAttribute(t, n); + }; +} +function $l(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 Al(t, e) { + var n = yr(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 ? yl : _l : typeof e == "function" ? n.local ? $l : bl : n.local ? wl : xl)(n, e)); +} +function Xs(t) { + return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; +} +function Tl(t) { + return function() { + this.style.removeProperty(t); + }; +} +function El(t, e, n) { + return function() { + this.style.setProperty(t, e, n); + }; +} +function kl(t, e, n) { + return function() { + var r = e.apply(this, arguments); + r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); + }; +} +function Rl(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? Tl : typeof e == "function" ? kl : El)(t, e, n ?? "")) : nn(this.node(), t); +} +function nn(t, e) { + return t.style.getPropertyValue(e) || Xs(t).getComputedStyle(t, null).getPropertyValue(e); +} +function Nl(t) { + return function() { + delete this[t]; + }; +} +function Sl(t, e) { + return function() { + this[t] = e; + }; +} +function Cl(t, e) { + return function() { + var n = e.apply(this, arguments); + n == null ? delete this[t] : this[t] = n; + }; +} +function Ml(t, e) { + return arguments.length > 1 ? this.each((e == null ? Nl : typeof e == "function" ? Cl : Sl)(t, e)) : this.node()[t]; +} +function Ys(t) { + return t.trim().split(/^|\s+/); +} +function pi(t) { + return t.classList || new Us(t); +} +function Us(t) { + this._node = t, this._names = Ys(t.getAttribute("class") || ""); +} +Us.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 Gs(t, e) { + for (var n = pi(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +} +function js(t, e) { + for (var n = pi(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +} +function Dl(t) { + return function() { + Gs(this, t); + }; +} +function Ol(t) { + return function() { + js(this, t); + }; +} +function Pl(t, e) { + return function() { + (e.apply(this, arguments) ? Gs : js)(this, t); + }; +} +function Il(t, e) { + var n = Ys(t + ""); + if (arguments.length < 2) { + for (var r = pi(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + return !0; + } + return this.each((typeof e == "function" ? Pl : e ? Dl : Ol)(n, e)); +} +function Fl() { + this.textContent = ""; +} +function Ll(t) { + return function() { + this.textContent = t; + }; +} +function ql(t) { + return function() { + var e = t.apply(this, arguments); + this.textContent = e ?? ""; + }; +} +function Vl(t) { + return arguments.length ? this.each(t == null ? Fl : (typeof t == "function" ? ql : Ll)(t)) : this.node().textContent; +} +function zl() { + this.innerHTML = ""; +} +function Bl(t) { + return function() { + this.innerHTML = t; + }; +} +function Hl(t) { + return function() { + var e = t.apply(this, arguments); + this.innerHTML = e ?? ""; + }; +} +function Xl(t) { + return arguments.length ? this.each(t == null ? zl : (typeof t == "function" ? Hl : Bl)(t)) : this.node().innerHTML; +} +function Yl() { + this.nextSibling && this.parentNode.appendChild(this); +} +function Ul() { + return this.each(Yl); +} +function Gl() { + this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); +} +function jl() { + return this.each(Gl); +} +function Kl(t) { + var e = typeof t == "function" ? t : qs(t); + return this.select(function() { + return this.appendChild(e.apply(this, arguments)); + }); +} +function Wl() { + return null; +} +function Jl(t, e) { + var n = typeof t == "function" ? t : qs(t), r = e == null ? Wl : typeof e == "function" ? e : mi(e); + return this.select(function() { + return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); + }); +} +function Zl() { + var t = this.parentNode; + t && t.removeChild(this); +} +function Ql() { + return this.each(Zl); +} +function tu() { + var t = this.cloneNode(!1), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; +} +function eu() { + var t = this.cloneNode(!0), e = this.parentNode; + return e ? e.insertBefore(t, this.nextSibling) : t; +} +function nu(t) { + return this.select(t ? eu : tu); +} +function ru(t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; +} +function iu(t) { + return function(e) { + t.call(this, e, this.__data__); + }; +} +function su(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 au(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 ou(t, e, n) { + return function() { + var r = this.__on, i, s = iu(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 lu(t, e, n) { + var r = su(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 ? ou : au, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + return this; +} +function Ks(t, e, n) { + var r = Xs(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 uu(t, e) { + return function() { + return Ks(this, t, e); + }; +} +function fu(t, e) { + return function() { + return Ks(this, t, e.apply(this, arguments)); + }; +} +function cu(t, e) { + return this.each((typeof e == "function" ? fu : uu)(t, e)); +} +function* du() { + 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 Ws = [null]; +function zt(t, e) { + this._groups = t, this._parents = e; +} +function ln() { + return new zt([[document.documentElement]], Ws); +} +function hu() { + return this; +} +zt.prototype = ln.prototype = { + constructor: zt, + select: qo, + selectAll: Ho, + selectChild: Go, + selectChildren: Jo, + filter: Zo, + data: il, + enter: Qo, + exit: al, + join: ol, + merge: ll, + selection: hu, + order: ul, + sort: fl, + call: dl, + nodes: hl, + node: vl, + size: ml, + empty: pl, + each: gl, + attr: Al, + style: Rl, + property: Ml, + classed: Il, + text: Vl, + html: Xl, + raise: Ul, + lower: jl, + append: Kl, + insert: Jl, + remove: Ql, + clone: nu, + datum: ru, + on: lu, + dispatch: cu, + [Symbol.iterator]: du +}; +function gt(t) { + return typeof t == "string" ? new zt([[document.querySelector(t)]], [document.documentElement]) : new zt([[t]], Ws); +} +function gi(t, e, n) { + t.prototype = e.prototype = n, n.constructor = t; +} +function Js(t, e) { + var n = Object.create(t.prototype); + for (var r in e) n[r] = e[r]; + return n; +} +function kn() { +} +var bn = 0.7, nr = 1 / bn, Je = "\\s*([+-]?\\d+)\\s*", $n = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", fe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", vu = /^#([0-9a-f]{3,8})$/, mu = new RegExp(`^rgb\\(${Je},${Je},${Je}\\)$`), pu = new RegExp(`^rgb\\(${fe},${fe},${fe}\\)$`), gu = new RegExp(`^rgba\\(${Je},${Je},${Je},${$n}\\)$`), _u = new RegExp(`^rgba\\(${fe},${fe},${fe},${$n}\\)$`), yu = new RegExp(`^hsl\\(${$n},${fe},${fe}\\)$`), xu = new RegExp(`^hsla\\(${$n},${fe},${fe},${$n}\\)$`), zi = { + 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 +}; +gi(kn, Ve, { + copy(t) { + return Object.assign(new this.constructor(), this, t); + }, + displayable() { + return this.rgb().displayable(); + }, + hex: Bi, + // Deprecated! Use color.formatHex. + formatHex: Bi, + formatHex8: wu, + formatHsl: bu, + formatRgb: Hi, + toString: Hi +}); +function Bi() { + return this.rgb().formatHex(); +} +function wu() { + return this.rgb().formatHex8(); +} +function bu() { + return Zs(this).formatHsl(); +} +function Hi() { + return this.rgb().formatRgb(); +} +function Ve(t) { + var e, n; + return t = (t + "").trim().toLowerCase(), (e = vu.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Xi(e) : n === 3 ? new Dt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Mn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Mn(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 = mu.exec(t)) ? new Dt(e[1], e[2], e[3], 1) : (e = pu.exec(t)) ? new Dt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = gu.exec(t)) ? Mn(e[1], e[2], e[3], e[4]) : (e = _u.exec(t)) ? Mn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = yu.exec(t)) ? Gi(e[1], e[2] / 100, e[3] / 100, 1) : (e = xu.exec(t)) ? Gi(e[1], e[2] / 100, e[3] / 100, e[4]) : zi.hasOwnProperty(t) ? Xi(zi[t]) : t === "transparent" ? new Dt(NaN, NaN, NaN, 0) : null; +} +function Xi(t) { + return new Dt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +} +function Mn(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new Dt(t, e, n, r); +} +function $u(t) { + return t instanceof kn || (t = Ve(t)), t ? (t = t.rgb(), new Dt(t.r, t.g, t.b, t.opacity)) : new Dt(); +} +function Vr(t, e, n, r) { + return arguments.length === 1 ? $u(t) : new Dt(t, e, n, r ?? 1); +} +function Dt(t, e, n, r) { + this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; +} +gi(Dt, Vr, Js(kn, { + brighter(t) { + return t = t == null ? nr : Math.pow(nr, t), new Dt(this.r * t, this.g * t, this.b * t, this.opacity); + }, + darker(t) { + return t = t == null ? bn : Math.pow(bn, t), new Dt(this.r * t, this.g * t, this.b * t, this.opacity); + }, + rgb() { + return this; + }, + clamp() { + return new Dt(Le(this.r), Le(this.g), Le(this.b), rr(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: Yi, + // Deprecated! Use color.formatHex. + formatHex: Yi, + formatHex8: Au, + formatRgb: Ui, + toString: Ui +})); +function Yi() { + return `#${Ie(this.r)}${Ie(this.g)}${Ie(this.b)}`; +} +function Au() { + return `#${Ie(this.r)}${Ie(this.g)}${Ie(this.b)}${Ie((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +} +function Ui() { + const t = rr(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${Le(this.r)}, ${Le(this.g)}, ${Le(this.b)}${t === 1 ? ")" : `, ${t})`}`; +} +function rr(t) { + return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); +} +function Le(t) { + return Math.max(0, Math.min(255, Math.round(t) || 0)); +} +function Ie(t) { + return t = Le(t), (t < 16 ? "0" : "") + t.toString(16); +} +function Gi(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Qt(t, e, n, r); +} +function Zs(t) { + if (t instanceof Qt) return new Qt(t.h, t.s, t.l, t.opacity); + if (t instanceof kn || (t = Ve(t)), !t) return new Qt(); + if (t instanceof Qt) 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 Qt(a, o, l, t.opacity); +} +function Tu(t, e, n, r) { + return arguments.length === 1 ? Zs(t) : new Qt(t, e, n, r ?? 1); +} +function Qt(t, e, n, r) { + this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; +} +gi(Qt, Tu, Js(kn, { + brighter(t) { + return t = t == null ? nr : Math.pow(nr, t), new Qt(this.h, this.s, this.l * t, this.opacity); + }, + darker(t) { + return t = t == null ? bn : Math.pow(bn, t), new Qt(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( + Nr(t >= 240 ? t - 240 : t + 120, i, r), + Nr(t, i, r), + Nr(t < 120 ? t + 240 : t - 120, i, r), + this.opacity + ); + }, + clamp() { + return new Qt(ji(this.h), Dn(this.s), Dn(this.l), rr(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 = rr(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${ji(this.h)}, ${Dn(this.s) * 100}%, ${Dn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + } +})); +function ji(t) { + return t = (t || 0) % 360, t < 0 ? t + 360 : t; +} +function Dn(t) { + return Math.max(0, Math.min(1, t || 0)); +} +function Nr(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 _i = (t) => () => t; +function Eu(t, e) { + return function(n) { + return t + n * e; + }; +} +function ku(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 Ru(t) { + return (t = +t) == 1 ? Qs : function(e, n) { + return n - e ? ku(e, n, t) : _i(isNaN(e) ? n : e); + }; +} +function Qs(t, e) { + var n = e - t; + return n ? Eu(t, n) : _i(isNaN(t) ? e : t); +} +const ir = function t(e) { + var n = Ru(e); + function r(i, s) { + var a = n((i = Vr(i)).r, (s = Vr(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Qs(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 Nu(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 Su(t) { + return ArrayBuffer.isView(t) && !(t instanceof DataView); +} +function Cu(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] = Ye(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 Mu(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) { + return t = +t, e = +e, function(n) { + return t * (1 - n) + e * n; + }; +} +function Du(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] = Ye(t[i], e[i]) : r[i] = e[i]; + return function(s) { + for (i in n) r[i] = n[i](s); + return r; + }; +} +var zr = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Sr = new RegExp(zr.source, "g"); +function Ou(t) { + return function() { + return t; + }; +} +function Pu(t) { + return function(e) { + return t(e) + ""; + }; +} +function ta(t, e) { + var n = zr.lastIndex = Sr.lastIndex = 0, r, i, s, a = -1, o = [], l = []; + for (t = t + "", e = e + ""; (r = zr.exec(t)) && (i = Sr.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 = Sr.lastIndex; + return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Pu(l[0].x) : Ou(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 Ye(t, e) { + var n = typeof e, r; + return e == null || n === "boolean" ? _i(e) : (n === "number" ? ae : n === "string" ? (r = Ve(e)) ? (e = r, ir) : ta : e instanceof Ve ? ir : e instanceof Date ? Mu : Su(e) ? Nu : Array.isArray(e) ? Cu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Du : ae)(t, e); +} +var Ki = 180 / Math.PI, Br = { + translateX: 0, + translateY: 0, + rotate: 0, + skewX: 0, + scaleX: 1, + scaleY: 1 +}; +function ea(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) * Ki, + skewX: Math.atan(l) * Ki, + scaleX: a, + scaleY: o + }; +} +var On; +function Iu(t) { + const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); + return e.isIdentity ? Br : ea(e.a, e.b, e.c, e.d, e.e, e.f); +} +function Fu(t) { + return t == null || (On || (On = document.createElementNS("http://www.w3.org/2000/svg", "g")), On.setAttribute("transform", t), !(t = On.transform.baseVal.consolidate())) ? Br : (t = t.matrix, ea(t.a, t.b, t.c, t.d, t.e, t.f)); +} +function na(t, e, n, r) { + function i(u) { + return u.length ? u.pop() + " " : ""; + } + function s(u, f, d, c, v, m) { + if (u !== d || f !== c) { + var y = v.push("translate(", null, e, null, n); + m.push({ i: y - 4, x: ae(u, d) }, { i: y - 2, x: ae(f, c) }); + } else (d || c) && v.push("translate(" + d + e + 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: ae(u, f) })) : f && d.push(i(d) + "rotate(" + f + r); + } + function o(u, f, d, c) { + u !== f ? c.push({ i: d.push(i(d) + "skewX(", null, r) - 2, x: ae(u, f) }) : f && d.push(i(d) + "skewX(" + f + r); + } + function l(u, f, d, c, v, m) { + if (u !== d || f !== c) { + var y = v.push(i(v) + "scale(", null, ",", null, ")"); + m.push({ i: y - 4, x: ae(u, d) }, { i: y - 2, x: ae(f, c) }); + } else (d !== 1 || c !== 1) && v.push(i(v) + "scale(" + d + "," + 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(v) { + for (var m = -1, y = c.length, x; ++m < y; ) d[(x = c[m]).i] = x.x(v); + return d.join(""); + }; + }; +} +var Lu = na(Iu, "px, ", "px)", "deg)"), qu = na(Fu, ", ", ")", ")"), rn = 0, mn = 0, vn = 0, ra = 1e3, sr, pn, ar = 0, ze = 0, xr = 0, An = typeof performance == "object" && performance.now ? performance : Date, ia = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { + setTimeout(t, 17); +}; +function yi() { + return ze || (ia(Vu), ze = An.now() + xr); +} +function Vu() { + ze = 0; +} +function or() { + this._call = this._time = this._next = null; +} +or.prototype = sa.prototype = { + constructor: or, + restart: function(t, e, n) { + if (typeof t != "function") throw new TypeError("callback is not a function"); + n = (n == null ? yi() : +n) + (e == null ? 0 : +e), !this._next && pn !== this && (pn ? pn._next = this : sr = this, pn = this), this._call = t, this._time = n, Hr(); + }, + stop: function() { + this._call && (this._call = null, this._time = 1 / 0, Hr()); + } +}; +function sa(t, e, n) { + var r = new or(); + return r.restart(t, e, n), r; +} +function zu() { + yi(), ++rn; + for (var t = sr, e; t; ) + (e = ze - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --rn; +} +function Wi() { + ze = (ar = An.now()) + xr, rn = mn = 0; + try { + zu(); + } finally { + rn = 0, Hu(), ze = 0; + } +} +function Bu() { + var t = An.now(), e = t - ar; + e > ra && (xr -= e, ar = t); +} +function Hu() { + for (var t, e = sr, 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 : sr = n); + pn = t, Hr(r); +} +function Hr(t) { + if (!rn) { + mn && (mn = clearTimeout(mn)); + var e = t - ze; + e > 24 ? (t < 1 / 0 && (mn = setTimeout(Wi, t - An.now() - xr)), vn && (vn = clearInterval(vn))) : (vn || (ar = An.now(), vn = setInterval(Bu, ra)), rn = 1, ia(Wi)); + } +} +function Ji(t, e, n) { + var r = new or(); + return e = e == null ? 0 : +e, r.restart((i) => { + r.stop(), t(i + e); + }, e, n), r; +} +var Xu = Ls("start", "end", "cancel", "interrupt"), Yu = [], aa = 0, Zi = 1, Xr = 2, Vn = 3, Qi = 4, Yr = 5, zn = 6; +function wr(t, e, n, r, i, s) { + var a = t.__transition; + if (!a) t.__transition = {}; + else if (n in a) return; + Uu(t, n, { + name: e, + index: r, + // For context during callback. + group: i, + // For context during callback. + on: Xu, + tween: Yu, + time: s.time, + delay: s.delay, + duration: s.duration, + ease: s.ease, + timer: null, + state: aa + }); +} +function xi(t, e) { + var n = ee(t, e); + if (n.state > aa) throw new Error("too late; already scheduled"); + return n; +} +function ve(t, e) { + var n = ee(t, e); + if (n.state > Vn) throw new Error("too late; already running"); + return n; +} +function ee(t, e) { + var n = t.__transition; + if (!n || !(n = n[e])) throw new Error("transition not found"); + return n; +} +function Uu(t, e, n) { + var r = t.__transition, i; + r[e] = n, n.timer = sa(s, 0, n.time); + function s(u) { + n.state = Zi, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); + } + function a(u) { + var f, d, c, v; + if (n.state !== Zi) return l(); + for (f in r) + if (v = r[f], v.name === n.name) { + if (v.state === Vn) return Ji(a); + v.state === Qi ? (v.state = zn, v.timer.stop(), v.on.call("interrupt", t, t.__data__, v.index, v.group), delete r[f]) : +f < e && (v.state = zn, v.timer.stop(), v.on.call("cancel", t, t.__data__, v.index, v.group), delete r[f]); + } + if (Ji(function() { + n.state === Vn && (n.state = Qi, n.timer.restart(o, n.delay, n.time), o(u)); + }), n.state = Xr, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Xr) { + for (n.state = Vn, i = new Array(c = n.tween.length), f = 0, d = -1; f < c; ++f) + (v = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++d] = v); + 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 = Yr, 1), d = -1, c = i.length; ++d < c; ) + i[d].call(t, f); + n.state === Yr && (n.on.call("end", t, t.__data__, n.index, n.group), l()); + } + function l() { + n.state = zn, n.timer.stop(), delete r[e]; + for (var u in r) return; + delete t.__transition; + } +} +function Gu(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 > Xr && r.state < Yr, r.state = zn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + } + s && delete t.__transition; + } +} +function ju(t) { + return this.each(function() { + Gu(this, t); + }); +} +function Ku(t, e) { + var n, r; + return function() { + 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 === e) { + r = r.slice(), r.splice(a, 1); + break; + } + } + i.tween = r; + }; +} +function Wu(t, e, n) { + var r, i; + if (typeof n != "function") throw new Error(); + return function() { + 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) + if (i[l].name === e) { + i[l] = o; + break; + } + l === u && i.push(o); + } + s.tween = i; + }; +} +function Ju(t, e) { + var n = this._id; + if (t += "", arguments.length < 2) { + for (var r = ee(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 ? Ku : Wu)(n, t, e)); +} +function wi(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 ee(i, r).value[e]; + }; +} +function oa(t, e) { + var n; + return (typeof e == "number" ? ae : e instanceof Ve ? ir : (n = Ve(e)) ? (e = n, ir) : ta)(t, e); +} +function Zu(t) { + return function() { + this.removeAttribute(t); + }; +} +function Qu(t) { + return function() { + this.removeAttributeNS(t.space, t.local); + }; +} +function tf(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 ef(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 nf(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 rf(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 sf(t, e) { + var n = yr(t), r = n === "transform" ? qu : oa; + return this.attrTween(t, typeof e == "function" ? (n.local ? rf : nf)(n, r, wi(this, "attr." + t, e)) : e == null ? (n.local ? Qu : Zu)(n) : (n.local ? ef : tf)(n, r, e)); +} +function af(t, e) { + return function(n) { + this.setAttribute(t, e.call(this, n)); + }; +} +function of(t, e) { + return function(n) { + this.setAttributeNS(t.space, t.local, e.call(this, n)); + }; +} +function lf(t, e) { + var n, r; + function i() { + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && of(t, s)), n; + } + return i._value = e, i; +} +function uf(t, e) { + var n, r; + function i() { + var s = e.apply(this, arguments); + return s !== r && (n = (r = s) && af(t, s)), n; + } + return i._value = e, i; +} +function ff(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 = yr(t); + return this.tween(n, (r.local ? lf : uf)(r, e)); +} +function cf(t, e) { + return function() { + xi(this, t).delay = +e.apply(this, arguments); + }; +} +function df(t, e) { + return e = +e, function() { + xi(this, t).delay = e; + }; +} +function hf(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? cf : df)(e, t)) : ee(this.node(), e).delay; +} +function vf(t, e) { + return function() { + ve(this, t).duration = +e.apply(this, arguments); + }; +} +function mf(t, e) { + return e = +e, function() { + ve(this, t).duration = e; + }; +} +function pf(t) { + var e = this._id; + return arguments.length ? this.each((typeof t == "function" ? vf : mf)(e, t)) : ee(this.node(), e).duration; +} +function gf(t, e) { + if (typeof e != "function") throw new Error(); + return function() { + ve(this, t).ease = e; + }; +} +function _f(t) { + var e = this._id; + return arguments.length ? this.each(gf(e, t)) : ee(this.node(), e).ease; +} +function yf(t, e) { + return function() { + var n = e.apply(this, arguments); + if (typeof n != "function") throw new Error(); + ve(this, t).ease = n; + }; +} +function xf(t) { + if (typeof t != "function") throw new Error(); + return this.each(yf(this._id, t)); +} +function wf(t) { + typeof t != "function" && (t = zs(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, this._name, this._id); +} +function bf(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, v = 0; v < f; ++v) + (c = l[v] || u[v]) && (d[v] = c); + for (; o < r; ++o) + a[o] = e[o]; + return new Ae(a, this._parents, this._name, this._id); +} +function $f(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 Af(t, e, n) { + var r, i, s = $f(e) ? xi : ve; + return function() { + var a = s(this, t), o = a.on; + o !== r && (i = (r = o).copy()).on(e, n), a.on = i; + }; +} +function Tf(t, e) { + var n = this._id; + return arguments.length < 2 ? ee(this.node(), n).on.on(t) : this.each(Af(n, t, e)); +} +function Ef(t) { + return function() { + var e = this.parentNode; + for (var n in this.__transition) if (+n !== t) return; + e && e.removeChild(this); + }; +} +function kf() { + return this.on("end.remove", Ef(this._id)); +} +function Rf(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = mi(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, 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, wr(u[c], e, n, c, u, ee(f, n))); + return new Ae(s, this._parents, e, n); +} +function Nf(t) { + var e = this._name, n = this._id; + typeof t != "function" && (t = Vs(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), v, m = ee(f, n), y = 0, x = c.length; y < x; ++y) + (v = c[y]) && wr(v, e, n, y, c, m); + s.push(c), a.push(f); + } + return new Ae(s, a, e, n); +} +var Sf = ln.prototype.constructor; +function Cf() { + return new Sf(this._groups, this._parents); +} +function Mf(t, e) { + var n, r, i; + return function() { + var s = nn(this, t), a = (this.style.removeProperty(t), nn(this, t)); + return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); + }; +} +function la(t) { + return function() { + this.style.removeProperty(t); + }; +} +function Df(t, e, n) { + var r, i = n + "", s; + return function() { + var a = nn(this, t); + return a === i ? null : a === r ? s : s = e(r = a, n); + }; +} +function Of(t, e, n) { + var r, i, s; + return function() { + var a = nn(this, t), o = n(this), l = o + ""; + return o == null && (l = o = (this.style.removeProperty(t), nn(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + }; +} +function Pf(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 = la(e)) : void 0; + (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; + }; +} +function If(t, e, n) { + var r = (t += "") == "transform" ? Lu : oa; + return e == null ? this.styleTween(t, Mf(t, r)).on("end.style." + t, la(t)) : typeof e == "function" ? this.styleTween(t, Of(t, r, wi(this, "style." + t, e))).each(Pf(this._id, t)) : this.styleTween(t, Df(t, r, e), n).on("end.style." + t, null); +} +function Ff(t, e, n) { + return function(r) { + this.style.setProperty(t, e.call(this, r), n); + }; +} +function Lf(t, e, n) { + var r, i; + function s() { + var a = e.apply(this, arguments); + return a !== i && (r = (i = a) && Ff(t, a, n)), r; + } + return s._value = e, s; +} +function qf(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, Lf(t, e, n ?? "")); +} +function Vf(t) { + return function() { + this.textContent = t; + }; +} +function zf(t) { + return function() { + var e = t(this); + this.textContent = e ?? ""; + }; +} +function Bf(t) { + return this.tween("text", typeof t == "function" ? zf(wi(this, "text", t)) : Vf(t == null ? "" : t + "")); +} +function Hf(t) { + return function(e) { + this.textContent = t.call(this, e); + }; +} +function Xf(t) { + var e, n; + function r() { + var i = t.apply(this, arguments); + return i !== n && (e = (n = i) && Hf(i)), e; + } + return r._value = t, r; +} +function Yf(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, Xf(t)); +} +function Uf() { + for (var t = this._name, e = this._id, n = ua(), 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 = ee(l, e); + wr(l, t, n, u, a, { + time: f.time + f.delay + f.duration, + delay: 0, + duration: f.duration, + ease: f.ease + }); + } + return new Ae(r, this._parents, t, n); +} +function Gf() { + 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; + 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 jf = 0; +function Ae(t, e, n, r) { + this._groups = t, this._parents = e, this._name = n, this._id = r; +} +function Bn(t) { + return ln().transition(t); +} +function ua() { + return ++jf; +} +var ge = ln.prototype; +Ae.prototype = Bn.prototype = { + constructor: Ae, + select: Rf, + selectAll: Nf, + selectChild: ge.selectChild, + selectChildren: ge.selectChildren, + filter: wf, + merge: bf, + selection: Cf, + transition: Uf, + call: ge.call, + nodes: ge.nodes, + node: ge.node, + size: ge.size, + empty: ge.empty, + each: ge.each, + on: Tf, + attr: sf, + attrTween: ff, + style: If, + styleTween: qf, + text: Bf, + textTween: Yf, + remove: kf, + tween: Ju, + delay: hf, + duration: pf, + ease: _f, + easeVarying: xf, + end: Gf, + [Symbol.iterator]: ge[Symbol.iterator] +}; +function Kf(t) { + return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; +} +var Wf = { + time: null, + // Set on use. + delay: 0, + duration: 250, + ease: Kf +}; +function Jf(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 Zf(t) { + var e, n; + t instanceof Ae ? (e = t._id, t = t._name) : (e = ua(), (n = Wf).time = yi(), 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]) && wr(l, t, e, u, a, n || Jf(l, e)); + return new Ae(r, this._parents, t, e); +} +ln.prototype.interrupt = ju; +ln.prototype.transition = Zf; +const Ur = Math.PI, Gr = 2 * Ur, Oe = 1e-6, Qf = Gr - Oe; +function fa(t) { + this._ += t[0]; + for (let e = 1, n = t.length; e < n; ++e) + this._ += arguments[e] + t[e]; +} +function tc(t) { + let e = Math.floor(t); + if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); + if (e > 15) return fa; + 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 ec { + constructor(e) { + this._x0 = this._y0 = // start of current subpath + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? fa : tc(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, d = o - n, c = f * f + d * d; + if (this._x1 === null) + this._append`M${this._x1 = e},${this._y1 = n}`; + else if (c > Oe) if (!(Math.abs(d * l - u * f) > Oe) || !s) + this._append`L${this._x1 = e},${this._y1 = n}`; + else { + let v = r - a, m = i - o, y = l * l + u * u, x = v * v + m * m, k = Math.sqrt(y), w = Math.sqrt(c), b = s * Math.tan((Ur - Math.acos((y + c - x) / (2 * k * w))) / 2), $ = b / w, N = b / k; + Math.abs($ - 1) > Oe && this._append`L${e + $ * f},${n + $ * d}`, this._append`A${s},${s},0,0,${+(d * v > f * m)},${this._x1 = e + N * l},${this._y1 = n + N * 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) > Oe || Math.abs(this._y1 - f) > Oe) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Gr + Gr), c > Qf ? 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 > Oe && this._append`A${r},${r},0,${+(c >= Ur)},${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`; + } + toString() { + return this._; + } +} +function nc(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 rc = nc("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function Tt(t) { + return function() { + return t; + }; +} +const ts = Math.abs, wt = Math.atan2, De = Math.cos, ic = Math.max, Cr = Math.min, ie = Math.sin, Ue = Math.sqrt, Mt = 1e-12, Tn = Math.PI, lr = Tn / 2, Hn = 2 * Tn; +function sc(t) { + return t > 1 ? 0 : t < -1 ? Tn : Math.acos(t); +} +function es(t) { + return t >= 1 ? lr : t <= -1 ? -lr : Math.asin(t); +} +function ac(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 ec(e); +} +function oc(t) { + return t.innerRadius; +} +function lc(t) { + return t.outerRadius; +} +function uc(t) { + return t.startAngle; +} +function fc(t) { + return t.endAngle; +} +function cc(t) { + return t && t.padAngle; +} +function dc(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 < Mt)) + return c = (f * (e - s) - d * (t - i)) / c, [t + c * l, e + c * u]; +} +function Pn(t, e, n, r, i, s, a) { + var o = t - n, l = e - r, u = (a ? s : -s) / Ue(o * o + l * l), f = u * l, d = -u * o, c = t + f, v = e + d, m = n + f, y = r + d, x = (c + m) / 2, k = (v + y) / 2, w = m - c, b = y - v, $ = w * w + b * b, N = i - s, z = c * y - m * v, X = (b < 0 ? -1 : 1) * Ue(ic(0, N * N * $ - z * z)), Y = (z * b - w * X) / $, st = (-z * w - b * X) / $, at = (z * b + w * X) / $, J = (-z * w + b * X) / $, Z = Y - x, E = st - k, S = at - x, _t = J - k; + return Z * Z + E * E > S * S + _t * _t && (Y = at, st = J), { + cx: Y, + cy: st, + x01: -f, + y01: -d, + x11: Y * (i / N - 1), + y11: st * (i / N - 1) + }; +} +function _e() { + var t = oc, e = lc, n = Tt(0), r = null, i = uc, s = fc, a = cc, o = null, l = ac(u); + function u() { + var f, d, c = +t.apply(this, arguments), v = +e.apply(this, arguments), m = i.apply(this, arguments) - lr, y = s.apply(this, arguments) - lr, x = ts(y - m), k = y > m; + if (o || (o = f = l()), v < c && (d = v, v = c, c = d), !(v > Mt)) o.moveTo(0, 0); + else if (x > Hn - Mt) + o.moveTo(v * De(m), v * ie(m)), o.arc(0, 0, v, m, y, !k), c > Mt && (o.moveTo(c * De(y), c * ie(y)), o.arc(0, 0, c, y, m, k)); + else { + var w = m, b = y, $ = m, N = y, z = x, X = x, Y = a.apply(this, arguments) / 2, st = Y > Mt && (r ? +r.apply(this, arguments) : Ue(c * c + v * v)), at = Cr(ts(v - c) / 2, +n.apply(this, arguments)), J = at, Z = at, E, S; + if (st > Mt) { + var _t = es(st / c * ie(Y)), ft = es(st / v * ie(Y)); + (z -= _t * 2) > Mt ? (_t *= k ? 1 : -1, $ += _t, N -= _t) : (z = 0, $ = N = (m + y) / 2), (X -= ft * 2) > Mt ? (ft *= k ? 1 : -1, w += ft, b -= ft) : (X = 0, w = b = (m + y) / 2); + } + var pt = v * De(w), ct = v * ie(w), Kt = c * De(N), Bt = c * ie(N); + if (at > Mt) { + var It = v * De(b), Ht = v * ie(b), Ft = c * De($), Lt = c * ie($), dt; + if (x < Tn) + if (dt = dc(pt, ct, Ft, Lt, It, Ht, Kt, Bt)) { + var me = pt - dt[0], bt = ct - dt[1], Xt = It - dt[0], Wt = Ht - dt[1], kt = 1 / ie(sc((me * Xt + bt * Wt) / (Ue(me * me + bt * bt) * Ue(Xt * Xt + Wt * Wt))) / 2), vt = Ue(dt[0] * dt[0] + dt[1] * dt[1]); + J = Cr(at, (c - vt) / (kt - 1)), Z = Cr(at, (v - vt) / (kt + 1)); + } else + J = Z = 0; + } + X > Mt ? Z > Mt ? (E = Pn(Ft, Lt, pt, ct, v, Z, k), S = Pn(It, Ht, Kt, Bt, v, Z, k), o.moveTo(E.cx + E.x01, E.cy + E.y01), Z < at ? o.arc(E.cx, E.cy, Z, wt(E.y01, E.x01), wt(S.y01, S.x01), !k) : (o.arc(E.cx, E.cy, Z, wt(E.y01, E.x01), wt(E.y11, E.x11), !k), o.arc(0, 0, v, wt(E.cy + E.y11, E.cx + E.x11), wt(S.cy + S.y11, S.cx + S.x11), !k), o.arc(S.cx, S.cy, Z, wt(S.y11, S.x11), wt(S.y01, S.x01), !k))) : (o.moveTo(pt, ct), o.arc(0, 0, v, w, b, !k)) : o.moveTo(pt, ct), !(c > Mt) || !(z > Mt) ? o.lineTo(Kt, Bt) : J > Mt ? (E = Pn(Kt, Bt, It, Ht, c, -J, k), S = Pn(pt, ct, Ft, Lt, c, -J, k), o.lineTo(E.cx + E.x01, E.cy + E.y01), J < at ? o.arc(E.cx, E.cy, J, wt(E.y01, E.x01), wt(S.y01, S.x01), !k) : (o.arc(E.cx, E.cy, J, wt(E.y01, E.x01), wt(E.y11, E.x11), !k), o.arc(0, 0, c, wt(E.cy + E.y11, E.cx + E.x11), wt(S.cy + S.y11, S.cx + S.x11), k), o.arc(S.cx, S.cy, J, wt(S.y11, S.x11), wt(S.y01, S.x01), !k))) : o.arc(0, 0, c, N, $, k); + } + if (o.closePath(), f) return o = 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 - Tn / 2; + return [De(d) * f, ie(d) * f]; + }, u.innerRadius = function(f) { + return arguments.length ? (t = typeof f == "function" ? f : Tt(+f), u) : t; + }, u.outerRadius = function(f) { + return arguments.length ? (e = typeof f == "function" ? f : Tt(+f), u) : e; + }, u.cornerRadius = function(f) { + return arguments.length ? (n = typeof f == "function" ? f : Tt(+f), u) : n; + }, u.padRadius = function(f) { + return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Tt(+f), u) : r; + }, u.startAngle = function(f) { + return arguments.length ? (i = typeof f == "function" ? f : Tt(+f), u) : i; + }, u.endAngle = function(f) { + return arguments.length ? (s = typeof f == "function" ? f : Tt(+f), u) : s; + }, u.padAngle = function(f) { + return arguments.length ? (a = typeof f == "function" ? f : Tt(+f), u) : a; + }, u.context = function(f) { + return arguments.length ? (o = f ?? null, u) : o; + }, u; +} +function hc(t) { + return typeof t == "object" && "length" in t ? t : Array.from(t); +} +function vc(t, e) { + return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; +} +function mc(t) { + return t; +} +function Mr() { + var t = mc, e = vc, n = null, r = Tt(0), i = Tt(Hn), s = Tt(0); + function a(o) { + var l, u = (o = hc(o)).length, f, d, c = 0, v = new Array(u), m = new Array(u), y = +r.apply(this, arguments), x = Math.min(Hn, Math.max(-Hn, i.apply(this, arguments) - y)), k, w = Math.min(Math.abs(x) / u, s.apply(this, arguments)), b = w * (x < 0 ? -1 : 1), $; + for (l = 0; l < u; ++l) + ($ = m[v[l] = l] = +t(o[l], l, o)) > 0 && (c += $); + for (e != null ? v.sort(function(N, z) { + return e(m[N], m[z]); + }) : n != null && v.sort(function(N, z) { + return n(o[N], o[z]); + }), l = 0, d = c ? (x - u * b) / c : 0; l < u; ++l, y = k) + f = v[l], $ = m[f], k = y + ($ > 0 ? $ * d : 0) + b, m[f] = { + data: o[f], + index: l, + value: $, + startAngle: y, + endAngle: k, + padAngle: w + }; + return m; + } + return a.value = function(o) { + return arguments.length ? (t = typeof o == "function" ? o : Tt(+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 : Tt(+o), a) : r; + }, a.endAngle = function(o) { + return arguments.length ? (i = typeof o == "function" ? o : Tt(+o), a) : i; + }, a.padAngle = function(o) { + return arguments.length ? (s = typeof o == "function" ? o : Tt(+o), a) : s; + }, a; +} +function gn(t, e, n) { + this.k = t, this.x = e, this.y = n; +} +gn.prototype = { + constructor: gn, + scale: function(t) { + return t === 1 ? this : new gn(this.k * t, this.x, this.y); + }, + translate: function(t, e) { + return t === 0 & e === 0 ? this : new gn(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 + ")"; + } +}; +gn.prototype; +const Ne = {}, jr = "No Further Rankings"; +function ur(t, e) { + let n = 0; + for (let r = 1; r < e; r++) { + const i = t.results[r - 1].tallyResults; + for (let s = 0; s < i.length; s++) { + const a = i[s].transfers; + if (a) { + const o = a.exhausted; + o && (n += Number(o)); + } + } + } + return n; +} +function ca(t, e, n) { + if (e < 1) + return []; + const r = t.results[e - 1].tallyResults, i = []; + for (let s = 0; s < r.length; s++) { + const a = r[s][n]; + a != null && i.push(a); + } + return i; +} +function fr(t, e) { + return ca(t, e, "eliminated"); +} +function cr(t, e) { + let n = []; + for (let r = 1; r <= e; r++) + n = n.concat(ca(t, r, "elected")); + return n; +} +var pc = /* @__PURE__ */ yo(''); +const gc = { hash: "svelte-3kpd", code: "" }; +function da(t, e) { + gr(e, !0), hi(t, gc); + let n = it(e, "jsonData", 7), r = it(e, "round", 15), i = it(e, "mouseEventType", 15), s = it(e, "mouseData", 15), a = it(e, "mouseY", 15), o = it(e, "animateOneRound", 15), l = it(e, "animateOnePhase", 15), u = it(e, "runFullAnimation", 15), f = it(e, "setRound", 15); + const d = 800, c = 800, v = Math.min(d, c) * 0.3, m = d / 2, y = c / 2, x = "Pie", k = "Donut", w = "TextLayer", b = "#transfer", $ = "url(#cross-hatch)", N = 1.15, z = 0.1, X = 750, Y = 800; + let st = [], at = [], J = [], Z = 0, E = ot(0), S = ot(null); + function _t() { + const p = gt(h(S)); + p.select("#" + x).remove(), p.select("#" + k).remove(), p.select("#" + w).remove(); + } + function ft() { + _t(), J = pt(), st = Be(x, J, m, y, 0, ct()); + } + Is(() => { + console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), o(Ce), l(_), u(ne), f(G), me(), ft(); + }); + function pt() { + const p = dt(r()); + return Z = Ft(r()), p; + } + function ct() { + return v; + } + function Kt() { + return ct() * 1.41; + } + function Bt(p, A) { + if (p === "exhausted") return ur(n(), A); + { + const R = n().results[A - 1].tally; + return Number(R[p]); + } + } + function It(p, A) { + return Bt(p, A).toLocaleString("en-US"); + } + function Ht(p, A) { + return (Bt(p, A) / Z).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + } + function Ft(p) { + const A = n().results[p - 1].tally; + let R = 0; + for (let [V, C] of Object.entries(A)) + R += Number(C); + return R; + } + function Lt(p, A) { + const R = n().results[A - 1].tallyResults; + let V = 0; + const C = R.findIndex((q) => (q == null ? void 0 : q.elected) && p == q.elected); + if (C >= 0) { + const q = R[C].transfers; + if (q) + for (let [F, D] of Object.entries(q)) V += Number(D); + } else + return 0; + return V; + } + function dt(p) { + const A = n().results; + let R = A[Math.max(0, p - 2)].tally; + const V = [], C = []; + for (let [F, D] of Object.entries(R)) + V.push({ label: F, value: 0 }); + R = A[p - 1].tally; + for (let F of V) { + const D = Number(R[F.label]), H = Lt(F.label, p); + H > 0 ? (C.push({ + label: F.label + b, + value: H + }), F.value = D - H, C.push(F)) : (F.value = D, C.push(F)); + } + const q = ur(n(), p); + return C.push({ label: "exhausted", value: q }), C; + } + function me() { + const p = gt(h(S)).select("defs").select("#cross-hatch"); + let A = 0; + for (let [R, V] of Object.entries(n().results[0].tally)) { + A < 10 ? Ne[R] = rc[A] : Ne[R] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), A++; + { + const C = p.clone(!0); + C.attr("id", R.replaceAll(" ", "-")).select("rect").attr("fill", Ne[R]), C.select("path").attr("stroke", "#505050"); + } + } + Ne.exhausted = $, Ne["Inactive Ballots"] = $; + } + function bt() { + gt(h(S)).select("#" + k).remove(); + } + function Xt(p) { + console.log("animate phase 1"); + const A = Bn("global").duration(Y); + p && A.on("end", p), bt(), T(), br(), cn(0, ct()), un(); + } + function Wt(p) { + console.log("animate phase 2"); + const A = Bn("global").duration(Y); + p && A.on("end", p), O(); + } + function kt(p) { + console.log("animate phase 3"); + const A = Bn("global").duration(Y); + p && A.on("end", p), No(r), L(r()), g(ct()); + } + function vt() { + Rt = !1; + } + let Rt = !1; + function ne() { + if (Rt) { + console.log("buttons locked out"); + return; + } + Rt = !0, ke(); + } + function ke() { + const p = r() < n().results.length - 1 ? ke : vt; + Xt(() => { + Wt(() => { + kt(p); + }); + }); + } + function Ce() { + if (Rt) { + console.log("buttons locked out"); + return; + } + if (r() >= n().results.length) { + Rt = !1; + return; + } + Rt = !0, Xt(() => { + Wt(() => { + kt(vt); + }); + }); + } + function _() { + if (r() >= n().results.length) { + un(), console.log("Finished at round ", r()); + return; + } + B(E, (h(E) + 1) % 3), Rt = !0, h(E) === 1 ? Xt(vt) : h(E) === 2 ? Wt(vt) : h(E) === 0 ? kt(vt) : (Rt = !1, console.warn("displayPhase out of range at ", h(E))); + } + function L(p) { + J = dt(p), st = va(x, J, 0, ct(), !0); + } + function G(p) { + if (Rt) { + console.log("buttons locked out"); + return; + } + r(p), ft(); + } + function g(p, A) { + Mr().sort(null).value((D) => D.value); + const R = gt(h(S)).select("#" + k), V = _e().outerRadius(p).innerRadius(p - 1), C = R.selectAll(".slice"); + let q = C.size(); + function F() { + q--, q === 0 && $r(); + } + C.select("path").transition("global").duration(X).attr("d", (D) => V(D)).on("end", (D) => F()); + } + function T() { + const p = Nt(st); + at = fn(k, p, m, y, ct(), Kt(), !1, !0); + } + function O() { + const p = pe(at, st); + at = bi( + k, + p, + /* previousDonutInfoGlobal, */ + ct(), + Kt(), + !1 + ); + } + function I(p) { + const A = p.data.label; + return Ne[A.split("#")[0]]; + } + function rt() { + const p = {}, A = n().results[r() - 1].tallyResults; + for (let R = 0; R < A.length; R++) { + let V = A[R].eliminated; + if (V === void 0 && (V = A[R].elected), V === void 0) { + console.warn("getTransferVotes: Eliminated and Elected undefined..."); + continue; + } + const C = A[R].transfers; + if (C === void 0) { + console.warn("getTransferVotes: transfers undefined..."); + continue; + } + for (let [q, F] of Object.entries(C)) + p[q] === void 0 ? p[q] = Number(F) : p[q] += Number(F); + } + return p; + } + function Nt(p) { + const A = [], R = Z, V = n().results[r() - 1].tallyResults; + for (let C = 0; C < V.length; C++) { + let q = V[C].eliminated; + if (q === void 0 && (q = V[C].elected), q === void 0) { + console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); + continue; + } + const F = V[C].transfers; + if (F === void 0) { + console.warn("makeDonutInfo: transfers undefined..."); + continue; + } + let D = p.find((P) => P.data.label == q + b); + D === void 0 && (D = p.find((P) => P.data.label == q)); + let H = 0; + if (D) H = D.startAngle; + else { + console.warn("makeDonutInfo: No transfers"); + continue; + } + for (let [P, U] of Object.entries(F)) { + let ut; + const re = p.find((ht) => ht.data.label == P); + if (re) + ut = structuredClone(re); + else if (P == "exhausted") + ut = { + data: { label: P, value: Number(U) }, + value: 0, + index: 0, + startAngle: 0, + endAngle: 0, + padAngle: 0 + }; + else if (P == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", U); + continue; + } else { + console.warn("makeDonutInfo: unrecognized name in transfers ", P); + continue; + } + const M = Number(U) / R * 2 * Math.PI; + ut.startAngle = H, H = ut.endAngle = H + M, ut.index = C, ut.data.label = `${ut.data.label}#${C}`, A.push(ut); + } + } + return A; + } + function yt(p, A, R) { + const V = {}; + for (let [C, q] of Object.entries(p)) { + const F = R.find((P) => C == P.data.label); + if (F === void 0) { + console.warn("getTransferStartAngles: mainPieObj not found for ", C); + continue; + } + const D = (F.startAngle + F.endAngle) / 2, H = p[F.data.label] / A * 2 * Math.PI; + V[F.data.label] = D - H / 2; + } + return V; + } + function pe(p, A) { + const R = [], V = Z, C = rt(), q = yt(C, V, A); + for (let [F, D] of p.entries()) { + const H = structuredClone(D), P = D.endAngle - D.startAngle, U = A.find((ut) => D.data.label.indexOf(ut.data.label) === 0); + if (U) { + const ut = U.data.label; + H.startAngle = q[ut], q[ut] += P, H.endAngle = H.startAngle + P; + } else if (D.data.label.indexOf("exhausted") === 0) + H.startAngle = D.startAngle, H.endAngle = D.endAngle; + else { + console.warn("updateDonutInfo: unrecognized slice name ", D.data.label); + continue; + } + H.index = F, R.push(H); + } + return R; + } + function xt(p, A, R, V, C) { + const F = gt(h(S)).append("g").attr("id", w).attr("transform", `translate(${A}, ${R})`), D = _e().innerRadius(V * N).outerRadius(V * N); + F.selectAll("text").data(p).enter().each(function(H) { + H.endAngle - H.startAngle < z || H.data.label.includes(b) || gt(this).append("g").attr("id", (P) => P.data.label).classed("eliminated", (P) => C.includes(P.data.label.split("#")[0]) || P.data.label.includes(b)).each(function(P, U) { + P.data.label === "exhausted" && gt(this).on("mouseenter", (ut, re) => ma(ut)).on("mouseleave", (ut, re) => pa()); + }).append("text").attr("transform", (P) => `translate(${D.centroid(P)})`).attr("text-anchor", (P) => Me(P.startAngle, P.endAngle)).text((P) => P.data.label === "exhausted" ? jr : P.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((P) => It(P.data.label, r()) + " (" + Ht(P.data.label, r()) + ")"); + }); + } + function $t(p, A, R) { + const C = gt(h(S)).select("#" + w), q = C.selectAll("tspan"), F = C.selectAll("g").data(p, (U) => U.data.label).classed("eliminated", (U) => R.includes(U.data.label.split("#")[0]) || U.data.label.includes(b)), D = _e().innerRadius(A * N).outerRadius(A * N + 1); + q.transition("global").duration(X).attr("transform", (U) => `translate(${D.centroid(U)})`).attr("text-anchor", (U) => Me(U.startAngle, U.endAngle)), F.select("text").transition("global").duration(X).attr("transform", (U) => `translate(${D.centroid(U)})`).attr("text-anchor", (U) => Me(U.startAngle, U.endAngle)).on("end", (U) => P()); + let H = F.size(); + function P(U) { + H--, H === 0 && (C.remove(), xt(p, m, y, A, R)); + } + } + function Be(p, A, R, V, C, q, F = !0, D = !1) { + const P = Mr().sort(null).value((U) => U.value)(A); + return fn(p, P, R, V, C, q, F, D), P; + } + function un() { + gt(h(S)).select("#" + x).selectAll(".elected").style("stroke", "darkblue").style("stroke-width", "2px"); + } + function fn(p, A, R, V, C, q, F, D) { + const H = fr(n(), r()), P = cr(n(), r()), re = gt(h(S)).attr("width", "100%").attr("height", c).attr("viewBox", `0 0 ${d} ${c}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", p).attr("transform", `translate(${R}, ${V})`).selectAll(".slice").data(A).enter().append("g").attr("class", "slice").classed("eliminated", (M) => H.includes(M.data.label.split("#")[0]) || M.data.label.includes(b)).classed("elected", (M) => P.includes(M.data.label.split("#")[0]) && !M.data.label.includes(b)).attr("id", (M) => M.data.label).on("mouseenter", (M, ht) => Tr(M, ht)).on("mouseleave", (M, ht) => Er(M, ht)), dn = _e().outerRadius(q).innerRadius(C); + if (D) { + const M = _e().outerRadius(C + 1).innerRadius(C); + re.append("path").attr("d", M).transition("global").duration(X).attr("d", (ht) => dn(ht)).attr("fill", (ht) => I(ht)).on("end", (ht) => Ar()); + } else + re.append("path").attr("d", (M) => dn(M)).attr("fill", (M) => I(M)), Ar(); + return F && xt(A, R, V, q, H), A; + } + function br() { + const R = gt(h(S)).select("#" + w).selectAll(".eliminated"); + R.size() > 0 && R.classed("finished", !0); + } + function $r() { + const R = gt(h(S)).select("#" + w).selectAll(".finished"); + R.size() > 0 && R.remove(); + } + function cn(p, A) { + const C = gt(h(S)).select("#" + x).selectAll(".eliminated"), q = _e().innerRadius(p), F = _e().outerRadius(A); + C.classed("finished", !0).select("path").transition("global").duration(X).attrTween("d", function(D) { + const H = Ye(A, p); + return function(P) { + return F.innerRadius(H(P)), F(D); + }; + }).attr("fill", (D) => `url(#${D.data.label.split("#")[0].replaceAll(" ", "-")})`), C.clone(!0).classed("finished", !0).select("path").transition("global").duration(X).attrTween("d", function(D) { + const H = Ye(A, p); + return function(P) { + return q.outerRadius(H(P)), q(D); + }; + }).attr("fill", (D) => I(D)); + } + function Me(p, A) { + const R = (p + A) / 2; + return R > Math.PI * 11 / 6 || R < Math.PI * 1 / 6 || R > Math.PI * 5 / 6 && R < Math.PI * 7 / 6 ? "middle" : R < Math.PI ? "start" : "end"; + } + function Ar() { + gt(h(S)).select("#" + w).raise().append("g").remove(); + } + function va(p, A, R, V, C) { + const F = Mr().sort(null).value((D) => D.value)(A); + return bi( + p, + F, + /* previousPieInfo, */ + R, + V, + C + ), F; + } + function bi(p, A, R, V, C) { + const q = fr(n(), r()), F = cr(n(), r()), D = _e().outerRadius(V).innerRadius(R).startAngle((M) => M.startAngle).endAngle((M) => M.endAngle), H = _e().outerRadius(V).innerRadius(R), U = gt(h(S)).select("#" + p); + U.selectAll(".slice").attr("prevStart", (M) => M.startAngle).attr("prevEnd", (M) => M.endAngle); + const ut = U.selectAll(".slice").data(A, (M) => M.data.label); + ut.enter().append("g").attr("class", "slice").attr("id", (M) => M.data.label).classed("eliminated", !0).on("mouseenter", (M, ht) => Tr(M, ht)).on("mouseleave", (M, ht) => Er(M, ht)).append("path").attr("d", (M) => H(M)).attr("fill", (M) => I(M)), ut.classed("eliminated", (M) => q.includes(M.data.label.split("#")[0])).classed("elected", (M) => F.includes(M.data.label.split("#")[0])).on("mouseenter", (M, ht) => Tr(M, ht)).on("mouseleave", (M, ht) => Er(M, ht)); + let re = ut.size(); + function dn() { + re--, re <= 0 && (Ar(), U.selectAll(".finished").remove()); + } + return ut.select("path").transition("global").duration(X).attrTween("d", function(M) { + const ht = Number(gt(this.parentNode).attr("prevStart")), ga = Number(gt(this.parentNode).attr("prevEnd")), _a = Ye(ht, M.startAngle), ya = Ye(ga, M.endAngle); + return (Ai) => (D.startAngle(_a(Ai)).endAngle(ya(Ai)), D(M)); + }).on("end", dn), C && $t(A, V, q), A; + } + function Tr(p, A) { + s(A.data.label.split("#")[0]), i("enter"), a(p.clientY); + } + function Er(p, A) { + s(A.data.label.split("#")[0]), i("leave"); + } + function ma(p, A) { + i("show-exhausted"), a(p.clientY); + } + function pa(p, A) { + i("hide-exhausted"); + } + var $i = pc(); + return We($i, (p) => B(S, p), () => h(S)), Et(t, $i), _r({ + get jsonData() { + return n(); + }, + set jsonData(p) { + n(p), Q(); + }, + get round() { + return r(); + }, + set round(p) { + r(p), Q(); + }, + get mouseEventType() { + return i(); + }, + set mouseEventType(p) { + i(p), Q(); + }, + get mouseData() { + return s(); + }, + set mouseData(p) { + s(p), Q(); + }, + get mouseY() { + return a(); + }, + set mouseY(p) { + a(p), Q(); + }, + get animateOneRound() { + return o(); + }, + set animateOneRound(p) { + o(p), Q(); + }, + get animateOnePhase() { + return l(); + }, + set animateOnePhase(p) { + l(p), Q(); + }, + get runFullAnimation() { + return u(); + }, + set runFullAnimation(p) { + u(p), Q(); + }, + get setRound() { + return f(); + }, + set setRound(p) { + f(p), Q(); + } + }); +} +vi( + da, + { + jsonData: {}, + round: {}, + mouseEventType: {}, + mouseData: {}, + mouseY: {}, + animateOneRound: {}, + animateOnePhase: {}, + runFullAnimation: {}, + setRound: {} + }, + [], + [], + !0 +); +function ns(t, e, n, r) { + if (h(e)) return; + t.preventDefault(); + const i = t.currentTarget.getBoundingClientRect(), o = (("touches" in t && t.touches.length > 0 ? t.touches[0].clientX : "clientX" in t ? t.clientX : 0) - i.left) / i.width, l = Math.min(Math.max(Math.floor(o * n()), 0), n() - 1); + r(l, !0); + const u = (d) => { + const m = (("touches" in d && d.touches.length > 0 ? d.touches[0].clientX : "clientX" in d ? d.clientX : 0) - i.left) / i.width, y = Math.min(Math.max(Math.floor(m * n()), 0), n() - 1); + r(y, !0); + }, f = () => { + document.removeEventListener("mousemove", u), document.removeEventListener("touchmove", u), document.removeEventListener("mouseup", f), document.removeEventListener("touchend", f), document.removeEventListener("touchcancel", f); + }; + document.addEventListener("mousemove", u), document.addEventListener("touchmove", u), document.addEventListener("mouseup", f), document.addEventListener("touchend", f), document.addEventListener("touchcancel", f); +} +function _c(t, e) { + B(e, !1); +} +var yc = (t, e, n) => e(h(n) - 1, !0), xc = (t, e, n) => e(h(n) + 1, !0), wc = /* @__PURE__ */ jt("
"), bc = (t, e, n) => e(t, h(n).moreInfoText || ""), $c = /* @__PURE__ */ jt(''), Ac = /* @__PURE__ */ jt("
"), Tc = /* @__PURE__ */ jt('
'), Ec = /* @__PURE__ */ jt('
'), kc = /* @__PURE__ */ jt('
'); +const Rc = { + hash: "svelte-1mvbx0y", + code: ` + /* Include all styles from slider.css directly */.trs-wrapper.svelte-1mvbx0y {overflow:hidden;}.center-div.svelte-1mvbx0y {flex:1 1 auto;margin-left:30px;margin-right:30px;}.slider.svelte-1mvbx0y {width:100%;background-image:linear-gradient(10deg, #b1e0e6, #8ddae4);border-color:#333;border-style:solid;border-width:1px 1px 0 1px;border-radius:5px 5px 0 0;padding:5px 0 5px 0;display:flex;align-items:center;justify-content:space-evenly; + /* Don't allow dragging */-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.slider.svelte-1mvbx0y:hover {cursor:grab;}.slider.svelte-1mvbx0y:active {cursor:grabbing;}.slider-when-timeline-hidden.svelte-1mvbx0y {border-width:1px;border-radius:5px;box-shadow:1px 5px 20px 0 #dedede;} + + /* Base styles for slider items */.slider-item.svelte-1mvbx0y, .slider-item-hidden-slider.svelte-1mvbx0y {float:left;text-align:center;pointer-events:none;overflow:hidden;text-overflow:clip;} + + /* Style for hideActiveTickText=true (default) */.slider-item-future.svelte-1mvbx0y {color:#545454 !important;}.slider-item-active.svelte-1mvbx0y {background-image:url('/assets/slider.svg');background-repeat:no-repeat;background-position:center;min-width:28px !important;min-height:16px;background-size:28px 16px;} + + /* Style for hideActiveTickText=false */.slider-item-hidden-slider.svelte-1mvbx0y {font-size:0.7em;}.slider-item-hidden-slider-past.svelte-1mvbx0y {line-height:1rem;}.slider-item-hidden-slider-future.svelte-1mvbx0y {color:#545454 !important;line-height:1rem;}.slider-item-hidden-slider-active.svelte-1mvbx0y {font-weight:bold;font-size:1.2em;background-image:url('/assets/drag-affordance.png');background-repeat:repeat-x;background-position-y:bottom;background-position-x:left;background-size:6px;padding-bottom:2px;}.prev-next-button.svelte-1mvbx0y {border-radius:50%;background-color:black;width:20px;height:20px;min-width:20px;min-height:20px;line-height:1em;margin-top:10px;text-align:center;border:none;}.prev-next-button.svelte-1mvbx0y:disabled {background-color:gray;pointer-events:none;}.prev-next-button.svelte-1mvbx0y:hover {background-image:linear-gradient(135deg, #8f8f8f, #000);cursor:pointer;}.prev-next-button.svelte-1mvbx0y a:where(.svelte-1mvbx0y) {font-size:20px;vertical-align:baseline;color:white;}.prev-next-button.svelte-1mvbx0y a:where(.svelte-1mvbx0y):hover {text-decoration:none;} + + /* Slider Timeline Data */.timeline.svelte-1mvbx0y {border-color:#333;border-style:solid;border-radius:0 0 5px 5px;background-image:linear-gradient(10deg, #b1e0e6, #8ddae4);overflow-y:auto;overflow-x:hidden;width:100%;margin-left:auto;margin-right:auto;transition:max-height 0.6s ease-out, + opacity 0.3s ease-out, + padding 0.3s ease-out, + border-width 0.3s ease-out;}.timeline-header.svelte-1mvbx0y {text-align:center;}.timeline-column-active .timeline-header {font-weight:bold;}.timeline-column-past.svelte-1mvbx0y {opacity:75%;}.timeline-column-future.svelte-1mvbx0y {opacity:20%;}.timeline-column-active.svelte-1mvbx0y {opacity:100%;}.timeline-info-one-step.svelte-1mvbx0y {font-size:0.7em;float:left;}.timeline-info.svelte-1mvbx0y {border-radius:15px;padding:5px;margin:2px;border-width:2px;border-color:#CCCCCC33;border-style:ridge;background-color:lightgray;}.timeline-info-good.svelte-1mvbx0y {background-color:lightgreen;}.timeline-info-bad.svelte-1mvbx0y {background-color:lightcoral;}.question-mark.svelte-1mvbx0y {color:#fff;background-color:#6a6f6f;width:12px;height:12px;line-height:12px;vertical-align:middle;display:inline-block;float:right;border-radius:100%;font-size:10px;text-align:center;text-decoration:none;-webkit-box-shadow:inset -1px -1px 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:inset -1px -1px 1px 0 rgba(0,0,0,0.25);box-shadow:inset -1px -1px 1px 0 rgba(0,0,0,0.25);margin:0 0 0 5px;padding:0;border:0;} + + /* Tooltip */#timeline-info-tooltip.svelte-1mvbx0y {background-color:#333;color:#fff;text-align:center;padding:5px;border-radius:6px;font-size:0.7em;max-width:400px;position:fixed;z-index:100;opacity:1 !important;}.expand-collapse-button.svelte-1mvbx0y {font-size:0.7em;width:max-content;padding:2px 15px;text-align:center;margin-left:auto;margin-right:auto;background-image:linear-gradient(10deg, #e7fafd, #d6ebee);border-width:0 1px 1px 1px;border-style:solid;border-radius:0 0 5px 5px;}.expand-collapse-button.svelte-1mvbx0y:hover {text-decoration:underline;cursor:pointer;}` +}; +function ha(t, e) { + gr(e, !0), hi(t, Rc); + let n = it(e, "id", 7, "timeline-slider"), r = it(e, "numTicks", 7, 5), i = it(e, "width", 7, "600px"), s = it(e, "tickLabelPrefix", 7, "Round "), a = it(e, "hideTimelineInitially", 7, !0), o = it(e, "tickText", 7, "•"), l = it(e, "color", 7, "orangered"), u = it(e, "timelineData", 7, null), f = it(e, "animateOnLoad", 7, !1), d = it(e, "timelinePeeking", 7, !0), c = it(e, "hideActiveTickText", 7, !1), v = it(e, "timeBetweenStepsMs", 7, null), m = it(e, "leftArrowText", 7, "‹"), y = it(e, "rightArrowText", 7, "›"), x = it(e, "value", 7, 0), k = it(e, "onValueChange", 7, (g) => { + }), w = ot(lt(x())), b = ot(!a()), $ = ot(!1), N = ot(!1), z = ot(null), X = ot(""), Y = ot(!1), st = ot(lt({ x: 0, y: 0 })); + const at = 100 / r(), J = Array.from({ length: r() }, (g, T) => T); + let Z = ot(void 0), E = ot(lt([])); + function S(g) { + return Array.isArray(l()) ? g < l().length ? l()[g] : l()[0] : l(); + } + function _t(g) { + return Array.isArray(o()) ? g < o().length ? o()[g] : o()[0] : o(); + } + ui(() => { + h(w) !== x() && h(N) && ft(x()); + }); + function ft(g, T = !1) { + g === h(w) || g < 0 || g >= r() || (B(w, lt(g)), x(g), h(b) && h(E) && h(E)[g] && h(E)[g].scrollIntoView({ + behavior: "smooth", + inline: "center", + block: "nearest" + }), T ? window.requestAnimationFrame(() => k()(g)) : k()(g)); + } + function pt() { + B(b, !h(b)), h(b) && h(E) && h(E)[h(w)] && setTimeout( + () => { + h(E)[h(w)].scrollIntoView({ + behavior: "smooth", + inline: "center", + block: "nearest" + }); + }, + 100 + ); + } + function ct(g, T) { + T && (B(X, lt(T)), B(st, lt({ x: g.clientX + 5, y: g.clientY - 30 })), B(Y, !0), setTimeout( + () => { + if (h(z)) { + const O = h(z).getBoundingClientRect(); + O.right > window.innerWidth && (h(st).x = window.innerWidth - O.width - 10), O.bottom > window.innerHeight && (h(st).y = window.innerHeight - O.height - 10); + } + }, + 0 + )); + } + function Kt(g) { + const T = [ + { + summaryText: "Something good", + className: "timeline-info-good", + moreInfoText: "Like a birth or the end of wars" + }, + { + summaryText: "Something bad", + className: "timeline-info-bad", + moreInfoText: "As if millions of voices suddenly cried out in terror and were suddenly silenced" + }, + { summaryText: "Chance event!" } + ], O = []; + for (let I = 0; I < g; I++) { + const rt = []; + rt.push(T[Math.floor(Math.random() * 3)]), rt.push(T[Math.floor(Math.random() * 3)]), I % 2 === 0 && rt.push(T[Math.floor(Math.random() * 3)]), O.push(rt); + } + return O; + } + function Bt(g) { + if (h($)) return; + B($, !0); + let T = h(b); + d() && !h(b) && B(b, !0), ft(0, !1); + const O = v() || Math.min(1e3 / r(), 100); + let I = 1; + const rt = () => { + if (I >= r()) { + B($, !1), d() && !T && B(b, !1), g && g(!0); + return; + } + ft(I, !1), I++, setTimeout( + () => { + h($) ? window.requestAnimationFrame(rt) : g && g(!1); + }, + O + ); + }; + window.requestAnimationFrame(rt); + } + Is(async () => { + u() || u(Kt(r())), B(N, !0), f() && setTimeout( + () => { + Bt(); + }, + 100 + ); + }); + function It(g) { + Bt(g); + } + function Ht() { + pt(); + } + var Ft = kc(), Lt = tt(Ft); + Lt.__click = [yc, ft, w]; + var dt = tt(Lt), me = tt(dt); + Oi(me, m), K(dt), K(Lt); + var bt = mt(Lt, 2); + bt.__click = [xc, ft, w]; + var Xt = tt(bt), Wt = tt(Xt); + Oi(Wt, y), K(Xt), K(bt); + var kt = mt(bt, 2), vt = tt(kt); + let Rt; + vt.__mousedown = [ + ns, + $, + r, + ft + ], vt.__touchstart = [ + ns, + $, + r, + ft + ], Ke(vt, 21, () => J, je, (g, T) => { + var O = wc(); + let I; + var rt = tt(O); + { + var Nt = (yt) => { + var pe = xo(); + se((xt) => oe(pe, xt), [() => _t(h(T))]), Et(yt, pe); + }; + xn(rt, (yt) => { + c() && h(T) === h(w) || yt(Nt); + }); + } + K(O), se( + (yt) => { + Xe(O, "style", `max-width: ${at ?? ""}%; color: ${yt ?? ""};`), I = Sn(O, 1, "svelte-1mvbx0y", null, I, { + "slider-item": c(), + "slider-item-past": c() && h(T) < h(w), + "slider-item-active": c() && h(T) === h(w), + "slider-item-future": c() && h(T) > h(w), + "slider-item-hidden-slider": !c(), + "slider-item-hidden-slider-past": !c() && h(T) < h(w), + "slider-item-hidden-slider-active": !c() && h(T) === h(w), + "slider-item-hidden-slider-future": !c() && h(T) > h(w) + }); + }, + [() => S(h(T))] + ), Et(g, O); + }), K(vt); + var ne = mt(vt, 2), ke = tt(ne); + Ke(ke, 21, () => u() || [], je, (g, T, O) => { + var I = Tc(); + let rt; + var Nt = tt(I), yt = tt(Nt); + K(Nt); + var pe = mt(Nt, 2); + Ke(pe, 17, () => h(T), je, (xt, $t) => { + var Be = Ac(); + let un; + var fn = tt(Be), br = mt(fn); + { + var $r = (cn) => { + var Me = $c(); + Me.__mouseover = [bc, ct, $t], Me.__mouseout = [_c, Y], Et(cn, Me); + }; + xn(br, (cn) => { + h($t).moreInfoText && cn($r); + }); + } + K(Be), se(() => { + un = Sn(Be, 1, "timeline-info svelte-1mvbx0y", null, un, { + "timeline-info-good": h($t).className === "timeline-info-good", + "timeline-info-bad": h($t).className === "timeline-info-bad" + }), oe(fn, `${h($t).summaryText ?? ""} `); + }), Et(xt, Be); + }), K(I), We(I, (xt, $t) => h(E)[$t] = xt, (xt) => { + var $t; + return ($t = h(E)) == null ? void 0 : $t[xt]; + }, () => [O]), se(() => { + rt = Sn(I, 1, "timeline-info-one-step svelte-1mvbx0y", null, rt, { + "timeline-column-past": O < h(w), + "timeline-column-active": O === h(w), + "timeline-column-future": O > h(w) + }), oe(yt, `${s() ?? ""}${O + 1}`); + }), Et(g, I); + }), K(ke), K(ne), We(ne, (g) => B(Z, g), () => h(Z)); + var Ce = mt(ne, 2); + Ce.__click = pt; + var _ = tt(Ce, !0); + K(Ce), K(kt); + var L = mt(kt, 2); + { + var G = (g) => { + var T = Ec(), O = tt(T, !0); + K(T), We(T, (I) => B(z, I), () => h(z)), se(() => { + Xe(T, "style", `left: ${h(st).x ?? ""}px; top: ${h(st).y ?? ""}px;`), oe(O, h(X)); + }), Et(g, T); + }; + xn(L, (g) => { + h(Y) && g(G); + }); + } + return K(Ft), se(() => { + Xe(Ft, "id", n()), Xe(Ft, "style", `max-width: ${(typeof i() == "number" ? `${i()}px` : i()) ?? ""}`), Lt.disabled = h(w) === 0, bt.disabled = h(w) === r() - 1, Xe(vt, "id", "_sliderDiv_" + n()), Rt = Sn(vt, 1, "slider svelte-1mvbx0y", null, Rt, { + "slider-when-timeline-hidden": !h(b) + }), Xe(ne, "style", `max-height: ${(h(b) ? "999px" : "0") ?? ""}; + opacity: ${(h(b) ? 1 : 0) ?? ""}; + padding: ${(h(b) ? "5px 0 5px 0" : "0") ?? ""}; + border-width: ${(h(b) ? "0 1px 1px 1px" : "0") ?? ""};`), oe(_, h(b) ? "[—] Collapse Details" : "[+] Expand Details"); + }), Et(t, Ft), _r({ + animate: It, + toggleTimeline: Ht, + get id() { + return n(); + }, + set id(g = "timeline-slider") { + n(g), Q(); + }, + get numTicks() { + return r(); + }, + set numTicks(g = 5) { + r(g), Q(); + }, + get width() { + return i(); + }, + set width(g = "600px") { + i(g), Q(); + }, + get tickLabelPrefix() { + return s(); + }, + set tickLabelPrefix(g = "Round ") { + s(g), Q(); + }, + get hideTimelineInitially() { + return a(); + }, + set hideTimelineInitially(g = !0) { + a(g), Q(); + }, + get tickText() { + return o(); + }, + set tickText(g = "•") { + o(g), Q(); + }, + get color() { + return l(); + }, + set color(g = "orangered") { + l(g), Q(); + }, + get timelineData() { + return u(); + }, + set timelineData(g = null) { + u(g), Q(); + }, + get animateOnLoad() { + return f(); + }, + set animateOnLoad(g = !1) { + f(g), Q(); + }, + get timelinePeeking() { + return d(); + }, + set timelinePeeking(g = !0) { + d(g), Q(); + }, + get hideActiveTickText() { + return c(); + }, + set hideActiveTickText(g = !1) { + c(g), Q(); + }, + get timeBetweenStepsMs() { + return v(); + }, + set timeBetweenStepsMs(g = null) { + v(g), Q(); + }, + get leftArrowText() { + return m(); + }, + set leftArrowText(g = "‹") { + m(g), Q(); + }, + get rightArrowText() { + return y(); + }, + set rightArrowText(g = "›") { + y(g), Q(); + }, + get value() { + return x(); + }, + set value(g = 0) { + x(g), Q(); + }, + get onValueChange() { + return k(); + }, + set onValueChange(g = (T) => { + }) { + k(g), Q(); + } + }); +} +Ms([ + "click", + "mousedown", + "touchstart", + "mouseover", + "mouseout" +]); +vi( + ha, + { + id: {}, + numTicks: {}, + width: {}, + tickLabelPrefix: {}, + hideTimelineInitially: {}, + tickText: {}, + color: {}, + timelineData: {}, + animateOnLoad: {}, + timelinePeeking: {}, + hideActiveTickText: {}, + timeBetweenStepsMs: {}, + leftArrowText: {}, + rightArrowText: {}, + value: {}, + onValueChange: {} + }, + [], + ["animate", "toggleTimeline"], + !0 +); +function Nc(t) { + const e = []; + if (!t || typeof t != "object") + return { valid: !1, errors: ["Input is not a valid object"] }; + if (t.config ? t.config.contest || e.push("Config is missing contest name") : e.push("Config is missing"), !t.results || !Array.isArray(t.results)) + return e.push("Results must be an array"), { valid: e.length === 0, errors: e }; + if (t.results.length === 0) + return e.push("Results array is empty"), { valid: e.length === 0, errors: e }; + let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = 0; + for (let s = 0; s < t.results.length; s++) { + const a = t.results[s]; + if (typeof a.round != "number" ? e.push(`Round ${s} is missing a round number`) : s === 0 && a.round !== 1 ? e.push(`First round number should be 1, found ${a.round}`) : s > 0 && a.round !== i + 1 && e.push(`Round numbers should be sequential. Expected ${i + 1}, found ${a.round}`), i = a.round, !a.tally || typeof a.tally != "object") { + e.push(`Round ${a.round} is missing a valid tally`); + continue; + } + if (s === 0) + n = new Set(Object.keys(a.tally)), r = new Set(n); + else { + const o = new Set(Object.keys(a.tally)), l = [...o].filter((u) => !n.has(u)); + l.length > 0 && e.push(`Round ${a.round} contains new candidates not present in earlier rounds: ${l.join(", ")}`), r = o; + } + if (!a.tallyResults || !Array.isArray(a.tallyResults)) { + e.push(`Round ${a.round} is missing tallyResults array`); + continue; + } + for (const o of a.tallyResults) { + o.elected !== void 0 && o.eliminated !== void 0 ? e.push(`Round ${a.round} has a result with both elected and eliminated set`) : o.elected === void 0 && o.eliminated === void 0 && e.push(`Round ${a.round} has a result with neither elected nor eliminated set`); + const l = o.elected || o.eliminated; + if (l && !r.has(l) && e.push(`Round ${a.round} references candidate "${l}" who is not in the current candidate list`), !o.transfers || typeof o.transfers != "object") { + e.push(`Round ${a.round} has a result missing transfers`); + continue; + } + const u = Object.keys(o.transfers); + for (const f of u) + f !== "exhausted" && !r.has(f) && e.push(`Round ${a.round} transfers votes to "${f}" who is not in the current candidate list`); + if (o.eliminated && l) { + const f = parseFloat(a.tally[l] || "0"); + let d = 0; + for (const c of Object.values(o.transfers)) { + const v = parseFloat(c || "0"); + isNaN(v) || (d += v); + } + Math.abs(f - d) > 1e-4 && e.push(`Round ${a.round}: Eliminated candidate "${l}" had ${f} votes but transferred ${d}`); + } + l && r.delete(l); + } + } + return { + valid: e.length === 0, + errors: e + }; +} +var Sc = /* @__PURE__ */ jt("  ", 1), Cc = /* @__PURE__ */ jt("About to eliminate: ", 1), Mc = /* @__PURE__ */ jt("  ", 1), Dc = /* @__PURE__ */ jt("Elected: ", 1), Oc = /* @__PURE__ */ jt("
", 1), Pc = /* @__PURE__ */ jt('


these ballots have already been eliminated.
'); +const Ic = { + hash: "svelte-1qs32ie", + code: `.page-container.svelte-1qs32ie {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-1qs32ie {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-1qs32ie {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:1.3rem;left:50%;transform:translate(-50%);font-weight:bold;opacity:0;}.tooltip.svelte-1qs32ie h3:where(.svelte-1qs32ie) {text-align:center;}.round-selector-container.svelte-1qs32ie {width:100%;display:flex;justify-content:center;margin:1rem 0;}.animation-button-container.svelte-1qs32ie {display:flex;justify-content:center;gap:10px;margin-bottom:1rem;}.pie-chart-container.svelte-1qs32ie { + /* width: 65%; */width:90%;min-width:800px; /* Larger minimum size */flex-grow:0; /* Don't grow beyond specified width */margin:0 auto;margin-right:40px; /* Add extra space on right */} + + + + +/*** Some parts of this will be overridden if we are also displaying the bubble-grid visualization ***/ + + + +/*** 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-1qs32ie {flex-direction:column;align-items:center;} +}` +}; +function Fc(t, e) { + gr(e, !0), hi(t, Ic); + const n = 0.85; + let r = it(e, "electionSummary", 7), i = ot(null), s = ot(null), a = ot(1), o = ot(""), l = ot(lt([])), u = ot(""), f = ot(""), d = ot(0), c = ot(null), v = ot(null), m = ot(null), y = ot(null), x = /* @__PURE__ */ Pe(() => k(r())); + function k(_) { + if (typeof _ == "string") { + console.log("input was a string"); + try { + _ = JSON.parse(_); + } catch (L) { + return console.error("Failed to parse JSON string:", L), {}; + } + } + return console.log("RCtabSummary object status: ", Nc(_)), _ || {}; + } + function w(_) { + console.log("slider wants to move to round ", _), _ === h(a) + 1 && h(c) ? h(c)() : h(y) && h(y)(_); + } + function b() { + switch (console.log("mouse event ", h(u), h(f), h(d)), h(u)) { + case "enter": + ((_) => (B(l, lt(_[0])), B(o, lt(_[1]))))(N(h(f))), h(i) && (h(i).style.top = String(h(d) || 20) + "px", h(i).style.opacity = String(n)); + break; + case "leave": + h(i) && (h(i).style.opacity = "0"), B(l, lt([])), B(o, ""); + break; + case "show-exhausted": + h(s) && (h(s).style.top = String(h(d) || 20) + "px", h(s).style.opacity = String(n)); + break; + case "hide-exhausted": + h(s) && (h(s).style.opacity = "0"); + break; + default: + console.log("Unknown mouse event: ", h(u)); + break; + } + } + ui(() => b()); + function $(_, L) { + return _ == 1 ? L ? "vote was" : "vote will be" : L ? "votes were" : "votes will be"; + } + function N(_) { + const L = [], G = _ === "exhausted" ? jr : _; + let g; + _ == "exhausted" ? g = ur(h(x), 1) : g = h(x).results[0].tally[_], L.push(`${G} started with ${g} votes.`); + for (let T = 1; T <= h(a); T++) { + T === h(a) && (_ == "exhausted" ? g = ur(h(x), h(a)) : g = h(x).results[h(a) - 1].tally[_], L.push(`${G} has ${g} votes at round ${h(a)}.`)); + const O = h(x).results[T - 1].tallyResults; + for (let I = 0; I < O.length; I++) { + const rt = O[I].transfers, Nt = O[I].eliminated, yt = O[I].elected; + if (Nt) + Nt === _ && L.push(`${G} will be eliminated on round ${T}.`); + else if (_ === yt && (L.push(`${G} was elected on round ${T}.`), rt)) + for (let [xt, $t] of Object.entries(rt)) + L.push(`${$t} ${$(Number($t), T < h(a))} transferred to ${xt} on round ${T}.`); + const pe = Nt || yt; + if (pe) { + const xt = Number(rt[_]); + xt && L.push(`${xt} ${$(xt, T < h(a))} transferred from ${pe} on round ${T}.`); + } + } + } + return [L, G]; + } + function z() { + let _ = 0; + for (let L = 1; L <= h(x).results.length; L++) { + const G = h(x).results[L - 1].tallyResults; + for (let g = 0; g < G.length; g++) + G[g].elected && _++; + } + return _; + } + let X = /* @__PURE__ */ Pe(() => Y(h(x).results.length)); + function Y(_) { + const L = []; + for (let G = 0; G < _; G++) + L.push(_ < 10 ? `Round ${G + 1}` : _ < 20 ? `R ${G + 1}` : _ < 30 ? `${G + 1}` : "•"); + return L; + } + let st = /* @__PURE__ */ Pe(() => J(h(x))); + function at(_) { + return (typeof _ == "string" ? parseFloat(_) : _).toLocaleString(void 0, { maximumFractionDigits: 2 }); + } + function J(_) { + if (!_.results || !Array.isArray(_.results) || _.results.length === 0) + throw new Error("Invalid RCtabSummary: missing or empty results array"); + const L = []; + return _.results.forEach((G) => { + const g = []; + G.round, Object.entries(G.tally).map(([T, O]) => ({ candidate: T, votes: parseFloat(O) })).sort((T, O) => O.votes - T.votes), G.tallyResults.forEach((T) => { + if (T.elected) { + g.push({ + summaryText: `${T.elected} won`, + className: "timeline-info-good", + moreInfoText: `${T.elected} exceeded the threshold of ${at(G.threshold)} votes and was elected.` + }); + const O = Object.entries(T.transfers); + if (O.length > 0) { + const I = O.reduce((rt, [Nt, yt]) => rt + parseFloat(yt), 0); + I > 0 && g.push({ + summaryText: `${T.elected} transferred ${at(I)} surplus votes`, + className: "timeline-info", + moreInfoText: "Surplus votes were distributed to remaining candidates." + }); + } + } else if (T.eliminated) { + g.push({ + summaryText: `${T.eliminated} eliminated`, + className: "timeline-info-bad", + moreInfoText: `${T.eliminated} had the fewest votes and was eliminated.` + }); + const O = Object.entries(T.transfers); + if (O.length > 0) { + const I = O.reduce((rt, [Nt, yt]) => rt + parseFloat(yt), 0); + g.push({ + summaryText: `${T.eliminated} transferred ${at(I)} votes`, + className: "timeline-info", + moreInfoText: "Votes were redistributed based on next preferences." + }); + } + } + }), L.push(g); + }), L; + } + var Z = Pc(), E = tt(Z), S = tt(E), _t = tt(S); + K(S); + var ft = mt(S, 2), pt = tt(ft); + { + var ct = (_) => { + var L = Cc(), G = mt(hn(L)); + Ke(G, 17, () => fr(h(x), h(a)), je, (g, T) => { + var O = Sc(), I = hn(O), rt = tt(I, !0); + K(I), Rn(), se(() => { + Fi(I, "color", Ne[h(T)]), oe(rt, h(T)); + }), Et(g, O); + }), Et(_, L); + }; + xn(pt, (_) => { + fr(h(x), h(a)).length > 0 && _(ct); + }); + } + var Kt = mt(pt, 2); + { + var Bt = (_) => { + var L = Dc(), G = mt(hn(L)); + Ke(G, 17, () => cr(h(x), h(a)), je, (g, T) => { + var O = Mc(), I = hn(O), rt = tt(I, !0); + K(I), Rn(), se(() => { + Fi(I, "color", Ne[h(T)]), oe(rt, h(T)); + }), Et(g, O); + }), Et(_, L); + }; + xn(Kt, (_) => { + cr(h(x), h(a)).length > 0 && _(Bt); + }); + } + K(ft), K(E); + var It = mt(E, 2), Ht = tt(It), Ft = tt(Ht, !0); + K(Ht); + var Lt = mt(Ht, 2); + Ke(Lt, 17, () => h(l), je, (_, L) => { + var G = Oc(), g = hn(G), T = tt(g, !0); + K(g), Rn(2), se(() => oe(T, h(L))), Et(_, G); + }), K(It), We(It, (_) => B(i, _), () => h(i)); + var dt = mt(It, 2), me = tt(dt); + me.nodeValue = `"${jr}" means all the candidates ranked on `, Rn(2), K(dt), We(dt, (_) => B(s, _), () => h(s)); + var bt = mt(dt, 2), Xt = tt(bt); + const Wt = /* @__PURE__ */ Pe(() => h(a) - 1); + ha(Xt, { + get numTicks() { + return h(x).results.length; + }, + get timelineData() { + return h(st); + }, + get tickText() { + return h(X); + }, + tickLabelPrefix: "Round ", + get value() { + return h(Wt); + }, + onValueChange: (_) => w(_ + 1) + }), K(bt); + var kt = mt(bt, 2), vt = tt(kt); + vt.__click = function(..._) { + var L; + (L = h(m)) == null || L.apply(this, _); + }; + var Rt = mt(vt, 2); + Rt.__click = function(..._) { + var L; + (L = h(v)) == null || L.apply(this, _); + }, K(kt); + var ne = mt(kt, 2), ke = tt(ne), Ce = tt(ke); + return da(Ce, { + get jsonData() { + return h(x); + }, + get round() { + return h(a); + }, + set round(_) { + B(a, lt(_)); + }, + get mouseEventType() { + return h(u); + }, + set mouseEventType(_) { + B(u, lt(_)); + }, + get mouseData() { + return h(f); + }, + set mouseData(_) { + B(f, lt(_)); + }, + get mouseY() { + return h(d); + }, + set mouseY(_) { + B(d, lt(_)); + }, + get animateOneRound() { + return h(c); + }, + set animateOneRound(_) { + B(c, lt(_)); + }, + get animateOnePhase() { + return h(v); + }, + set animateOnePhase(_) { + B(v, lt(_)); + }, + get runFullAnimation() { + return h(m); + }, + set runFullAnimation(_) { + B(m, lt(_)); + }, + get setRound() { + return h(y); + }, + set setRound(_) { + B(y, lt(_)); + } + }), K(ke), K(ne), K(Z), se( + (_) => { + oe(_t, `${h(x).config.contest ?? ""}, ${_ ?? ""} to be elected, Round ${h(a) ?? ""}.`), oe(Ft, h(o)); + }, + [z] + ), Et(t, Z), _r({ + generateTimelineData: J, + get electionSummary() { + return r(); + }, + set electionSummary(_) { + r(_), Q(); + } + }); +} +Ms(["click"]); +customElements.define("pie-chart", vi(Fc, { electionSummary: {} }, [], ["generateTimelineData"], !0)); diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 5fe535b1..0dbe4eee 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -1,4 +1,5 @@ {% load static %} - + + From 676a79d526c83c85d0208b85fd72e348cf048e1c Mon Sep 17 00:00:00 2001 From: skaphan Date: Sat, 15 Mar 2025 18:44:58 -0700 Subject: [PATCH 07/18] delete old version of pie.js --- static/pie/pie.js | 5175 --------------------------------------------- 1 file changed, 5175 deletions(-) delete mode 100644 static/pie/pie.js diff --git a/static/pie/pie.js b/static/pie/pie.js deleted file mode 100644 index 9c22ad11..00000000 --- a/static/pie/pie.js +++ /dev/null @@ -1,5175 +0,0 @@ -var Ma = Object.defineProperty; -var $i = (t) => { - throw TypeError(t); -}; -var Oa = (t, e, n) => e in t ? Ma(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var Yt = (t, e, n) => Oa(t, typeof e != "symbol" ? e + "" : e, n), Ai = (t, e, n) => e.has(t) || $i("Cannot " + n); -var Ct = (t, e, n) => (Ai(t, e, "read from private field"), n ? n.call(t) : e.get(t)), kr = (t, e, n) => e.has(t) ? $i("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), Er = (t, e, n, r) => (Ai(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); -const Pa = "5"; -typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Pa); -const Jr = 1, Zr = 2, ns = 4, Da = 8, Ia = 16, Fa = 1, La = 4, qa = 8, Va = 16, Ha = 1, za = 2, Ba = 4, Ya = 1, Ua = 2, rs = "[", jr = "[!", Qr = "]", an = {}, Mt = Symbol(), ki = !1, Wt = 2, is = 4, or = 8, lr = 16, _e = 32, We = 64, Fn = 128, zt = 256, Ln = 512, Tt = 1024, me = 2048, Ke = 4096, he = 8192, ur = 16384, ss = 32768, fr = 65536, Xa = 1 << 19, as = 1 << 20, on = Symbol("$state"), os = Symbol("legacy props"), Ga = Symbol(""); -var ti = Array.isArray, Wa = Array.prototype.indexOf, ei = Array.from, qn = Object.keys, Vn = Object.defineProperty, Se = Object.getOwnPropertyDescriptor, Ka = Object.getOwnPropertyDescriptors, Ja = Object.prototype, Za = Array.prototype, ls = Object.getPrototypeOf; -function ja(t) { - return typeof t == "function"; -} -const je = () => { -}; -function us(t) { - for (var e = 0; e < t.length; e++) - t[e](); -} -let un = [], Cr = []; -function fs() { - var t = un; - un = [], us(t); -} -function Qa() { - var t = Cr; - Cr = [], us(t); -} -function gn(t) { - un.length === 0 && queueMicrotask(fs), un.push(t); -} -function Ei() { - un.length > 0 && fs(), Cr.length > 0 && Qa(); -} -function cs(t) { - return t === this.v; -} -function to(t, e) { - return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; -} -function ni(t) { - return !to(t, this.v); -} -function eo(t) { - throw new Error("https://svelte.dev/e/effect_in_teardown"); -} -function no() { - throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); -} -function ro(t) { - throw new Error("https://svelte.dev/e/effect_orphan"); -} -function io() { - throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); -} -function so() { - throw new Error("https://svelte.dev/e/hydration_failed"); -} -function ao(t) { - throw new Error("https://svelte.dev/e/props_invalid_value"); -} -function oo() { - throw new Error("https://svelte.dev/e/state_descriptors_fixed"); -} -function lo() { - throw new Error("https://svelte.dev/e/state_prototype_fixed"); -} -function uo() { - throw new Error("https://svelte.dev/e/state_unsafe_local_read"); -} -function fo() { - throw new Error("https://svelte.dev/e/state_unsafe_mutation"); -} -let co = !1; -function Ht(t, e) { - var n = { - f: 0, - // TODO ideally we could skip this altogether, but it causes type errors - v: t, - reactions: null, - equals: cs, - rv: 0, - wv: 0 - }; - return n; -} -function st(t) { - return /* @__PURE__ */ ho(Ht(t)); -} -// @__NO_SIDE_EFFECTS__ -function ri(t, e = !1) { - const n = Ht(t); - return e || (n.equals = ni), n; -} -// @__NO_SIDE_EFFECTS__ -function ho(t) { - return et !== null && !Ut && et.f & Wt && (te === null ? _o([t]) : te.push(t)), t; -} -function M(t, e) { - return et !== null && !Ut && Ss() && et.f & (Wt | lr) && // If the source was created locally within the current derived, then - // we allow the mutation. - (te === null || !te.includes(t)) && fo(), Mr(t, e); -} -function Mr(t, e) { - return t.equals(e) || (t.v, t.v = e, t.wv = ws(), ds(t, me), Q !== null && Q.f & Tt && !(Q.f & (_e | We)) && (ue === null ? mo([t]) : ue.push(t))), e; -} -function ds(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; - a & me || (ie(s, e), a & (Tt | zt) && (a & Wt ? ds( - /** @type {Derived} */ - s, - Ke - ) : vr( - /** @type {Effect} */ - s - ))); - } -} -// @__NO_SIDE_EFFECTS__ -function cr(t) { - var e = Wt | me, n = et !== null && et.f & Wt ? ( - /** @type {Derived} */ - et - ) : null; - return Q === null || n !== null && n.f & zt ? e |= zt : Q.f |= as, { - ctx: Dt, - deps: null, - effects: null, - equals: cs, - f: e, - fn: t, - reactions: null, - rv: 0, - v: ( - /** @type {V} */ - null - ), - wv: 0, - parent: n ?? Q - }; -} -// @__NO_SIDE_EFFECTS__ -function vo(t) { - const e = /* @__PURE__ */ cr(t); - return e.equals = ni, e; -} -function hs(t) { - var e = t.effects; - if (e !== null) { - t.effects = null; - for (var n = 0; n < e.length; n += 1) - pe( - /** @type {Effect} */ - e[n] - ); - } -} -function po(t) { - for (var e = t.parent; e !== null; ) { - if (!(e.f & Wt)) - return ( - /** @type {Effect} */ - e - ); - e = e.parent; - } - return null; -} -function go(t) { - var e, n = Q; - re(po(t)); - try { - hs(t), e = bs(t); - } finally { - re(n); - } - return e; -} -function vs(t) { - var e = go(t), n = ($e || t.f & zt) && t.deps !== null ? Ke : Tt; - ie(t, n), t.equals(e) || (t.v = e, t.wv = ws()); -} -function ii(t) { - console.warn("https://svelte.dev/e/hydration_mismatch"); -} -let at = !1; -function de(t) { - at = t; -} -let tt; -function Gt(t) { - if (t === null) - throw ii(), an; - return tt = t; -} -function dr() { - return Gt( - /** @type {TemplateNode} */ - /* @__PURE__ */ ye(tt) - ); -} -function nt(t) { - if (at) { - if (/* @__PURE__ */ ye(tt) !== null) - throw ii(), an; - tt = t; - } -} -function xn(t = 1) { - if (at) { - for (var e = t, n = tt; e--; ) - n = /** @type {TemplateNode} */ - /* @__PURE__ */ ye(n); - tt = n; - } -} -function Or() { - for (var t = 0, e = tt; ; ) { - if (e.nodeType === 8) { - var n = ( - /** @type {Comment} */ - e.data - ); - if (n === Qr) { - if (t === 0) return e; - t -= 1; - } else (n === rs || n === jr) && (t += 1); - } - var r = ( - /** @type {TemplateNode} */ - /* @__PURE__ */ ye(e) - ); - e.remove(), e = r; - } -} -function F(t, e = null, n) { - if (typeof t != "object" || t === null || on in t) - return t; - const r = ls(t); - if (r !== Ja && r !== Za) - return t; - var i = /* @__PURE__ */ new Map(), s = ti(t), a = Ht(0); - s && i.set("length", Ht( - /** @type {any[]} */ - t.length - )); - var o; - return new Proxy( - /** @type {any} */ - t, - { - defineProperty(f, u, l) { - (!("value" in l) || l.configurable === !1 || l.enumerable === !1 || l.writable === !1) && oo(); - var h = i.get(u); - return h === void 0 ? (h = Ht(l.value), i.set(u, h)) : M(h, F(l.value, o)), !0; - }, - deleteProperty(f, u) { - var l = i.get(u); - if (l === void 0) - u in f && i.set(u, Ht(Mt)); - else { - if (s && typeof u == "string") { - var h = ( - /** @type {Source} */ - i.get("length") - ), c = Number(u); - Number.isInteger(c) && c < h.v && M(h, c); - } - M(l, Mt), Ri(a); - } - return !0; - }, - get(f, u, l) { - var p; - if (u === on) - return t; - var h = i.get(u), c = u in f; - if (h === void 0 && (!c || (p = Se(f, u)) != null && p.writable) && (h = Ht(F(c ? f[u] : Mt, o)), i.set(u, h)), h !== void 0) { - var d = v(h); - return d === Mt ? void 0 : d; - } - return Reflect.get(f, u, l); - }, - getOwnPropertyDescriptor(f, u) { - var l = Reflect.getOwnPropertyDescriptor(f, u); - if (l && "value" in l) { - var h = i.get(u); - h && (l.value = v(h)); - } else if (l === void 0) { - var c = i.get(u), d = c == null ? void 0 : c.v; - if (c !== void 0 && d !== Mt) - return { - enumerable: !0, - configurable: !0, - value: d, - writable: !0 - }; - } - return l; - }, - has(f, u) { - var d; - if (u === on) - return !0; - var l = i.get(u), h = l !== void 0 && l.v !== Mt || Reflect.has(f, u); - if (l !== void 0 || Q !== null && (!h || (d = Se(f, u)) != null && d.writable)) { - l === void 0 && (l = Ht(h ? F(f[u], o) : Mt), i.set(u, l)); - var c = v(l); - if (c === Mt) - return !1; - } - return h; - }, - set(f, u, l, h) { - var y; - var c = i.get(u), d = u in f; - if (s && u === "length") - for (var p = l; p < /** @type {Source} */ - c.v; p += 1) { - var _ = i.get(p + ""); - _ !== void 0 ? M(_, Mt) : p in f && (_ = Ht(Mt), i.set(p + "", _)); - } - c === void 0 ? (!d || (y = Se(f, u)) != null && y.writable) && (c = Ht(void 0), M(c, F(l, o)), i.set(u, c)) : (d = c.v !== Mt, M(c, F(l, o))); - var m = Reflect.getOwnPropertyDescriptor(f, u); - if (m != null && m.set && m.set.call(h, l), !d) { - if (s && typeof u == "string") { - var w = ( - /** @type {Source} */ - i.get("length") - ), $ = Number(u); - Number.isInteger($) && $ >= w.v && M(w, $ + 1); - } - Ri(a); - } - return !0; - }, - ownKeys(f) { - v(a); - var u = Reflect.ownKeys(f).filter((c) => { - var d = i.get(c); - return d === void 0 || d.v !== Mt; - }); - for (var [l, h] of i) - h.v !== Mt && !(l in f) && u.push(l); - return u; - }, - setPrototypeOf() { - lo(); - } - } - ); -} -function Ri(t, e = 1) { - M(t, t.v + e); -} -var Ni, ps, gs, _s; -function Pr() { - if (Ni === void 0) { - Ni = window, ps = /Firefox/.test(navigator.userAgent); - var t = Element.prototype, e = Node.prototype; - gs = Se(e, "firstChild").get, _s = Se(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; - } -} -function Ue(t = "") { - return document.createTextNode(t); -} -// @__NO_SIDE_EFFECTS__ -function ve(t) { - return gs.call(t); -} -// @__NO_SIDE_EFFECTS__ -function ye(t) { - return _s.call(t); -} -function lt(t, e) { - if (!at) - return /* @__PURE__ */ ve(t); - var n = ( - /** @type {TemplateNode} */ - /* @__PURE__ */ ve(tt) - ); - if (n === null) - n = tt.appendChild(Ue()); - else if (e && n.nodeType !== 3) { - var r = Ue(); - return n == null || n.before(r), Gt(r), r; - } - return Gt(n), n; -} -function He(t, e) { - if (!at) { - var n = ( - /** @type {DocumentFragment} */ - /* @__PURE__ */ ve( - /** @type {Node} */ - t - ) - ); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ye(n) : n; - } - return tt; -} -function kt(t, e = 1, n = !1) { - let r = at ? tt : t; - for (var i; e--; ) - i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ ye(r); - if (!at) - return r; - var s = r == null ? void 0 : r.nodeType; - if (n && s !== 3) { - var a = Ue(); - return r === null ? i == null || i.after(a) : r.before(a), Gt(a), a; - } - return Gt(r), /** @type {TemplateNode} */ - r; -} -function ms(t) { - t.textContent = ""; -} -let Tn = !1, Hn = !1, zn = null, Sn = !1, si = !1; -function Ti(t) { - si = t; -} -let ln = []; -let et = null, Ut = !1; -function ne(t) { - et = t; -} -let Q = null; -function re(t) { - Q = t; -} -let te = null; -function _o(t) { - te = t; -} -let Et = null, It = 0, ue = null; -function mo(t) { - ue = t; -} -let ys = 1, Bn = 0, $e = !1; -function ws() { - return ++ys; -} -function _n(t) { - var h; - var e = t.f; - if (e & me) - return !0; - if (e & Ke) { - var n = t.deps, r = (e & zt) !== 0; - if (n !== null) { - var i, s, a = (e & Ln) !== 0, o = r && Q !== null && !$e, f = n.length; - if (a || o) { - var u = ( - /** @type {Derived} */ - t - ), l = u.parent; - for (i = 0; i < f; i++) - s = n[i], (a || !((h = s == null ? void 0 : s.reactions) != null && h.includes(u))) && (s.reactions ?? (s.reactions = [])).push(u); - a && (u.f ^= Ln), o && l !== null && !(l.f & zt) && (u.f ^= zt); - } - for (i = 0; i < f; i++) - if (s = n[i], _n( - /** @type {Derived} */ - s - ) && vs( - /** @type {Derived} */ - s - ), s.wv > t.wv) - return !0; - } - (!r || Q !== null && !$e) && ie(t, Tt); - } - return !1; -} -function yo(t, e) { - for (var n = e; n !== null; ) { - if (n.f & Fn) - try { - n.fn(t); - return; - } catch { - n.f ^= Fn; - } - n = n.parent; - } - throw Tn = !1, t; -} -function wo(t) { - return (t.f & ur) === 0 && (t.parent === null || (t.parent.f & Fn) === 0); -} -function hr(t, e, n, r) { - if (Tn) { - if (n === null && (Tn = !1), wo(e)) - throw t; - return; - } - n !== null && (Tn = !0); - { - yo(t, e); - return; - } -} -function xs(t, e, n = !0) { - var r = t.reactions; - if (r !== null) - for (var i = 0; i < r.length; i++) { - var s = r[i]; - s.f & Wt ? xs( - /** @type {Derived} */ - s, - e, - !1 - ) : e === s && (n ? ie(s, me) : s.f & Tt && ie(s, Ke), vr( - /** @type {Effect} */ - s - )); - } -} -function bs(t) { - var d; - var e = Et, n = It, r = ue, i = et, s = $e, a = te, o = Dt, f = Ut, u = t.f; - Et = /** @type {null | Value[]} */ - null, It = 0, ue = null, $e = (u & zt) !== 0 && (Ut || !Sn || et === null), et = u & (_e | We) ? null : t, te = null, Si(t.ctx), Ut = !1, Bn++; - try { - var l = ( - /** @type {Function} */ - (0, t.fn)() - ), h = t.deps; - if (Et !== null) { - var c; - if (Yn(t, It), h !== null && It > 0) - for (h.length = It + Et.length, c = 0; c < Et.length; c++) - h[It + c] = Et[c]; - else - t.deps = h = Et; - if (!$e) - for (c = It; c < h.length; c++) - ((d = h[c]).reactions ?? (d.reactions = [])).push(t); - } else h !== null && It < h.length && (Yn(t, It), h.length = It); - if (Ss() && ue !== null && !Ut && h !== null && !(t.f & (Wt | Ke | me))) - for (c = 0; c < /** @type {Source[]} */ - ue.length; c++) - xs( - ue[c], - /** @type {Effect} */ - t - ); - return i !== null && Bn++, l; - } finally { - Et = e, It = n, ue = r, et = i, $e = s, te = a, Si(o), Ut = f; - } -} -function xo(t, e) { - let n = e.reactions; - if (n !== null) { - var r = Wa.call(n, t); - if (r !== -1) { - var i = n.length - 1; - i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); - } - } - n === null && e.f & Wt && // 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 - (Et === null || !Et.includes(e)) && (ie(e, Ke), e.f & (zt | Ln) || (e.f ^= Ln), hs( - /** @type {Derived} **/ - e - ), Yn( - /** @type {Derived} **/ - e, - 0 - )); -} -function Yn(t, e) { - var n = t.deps; - if (n !== null) - for (var r = e; r < n.length; r++) - xo(t, n[r]); -} -function ai(t) { - var e = t.f; - if (!(e & ur)) { - ie(t, Tt); - var n = Q, r = Dt, i = Sn; - Q = t, Sn = !0; - try { - e & lr ? Co(t) : Es(t), ks(t); - var s = bs(t); - t.teardown = typeof s == "function" ? s : null, t.wv = ys; - var a = t.deps, o; - ki && co && t.f & me; - } catch (f) { - hr(f, t, n, r || t.ctx); - } finally { - Sn = i, Q = n; - } - } -} -function bo() { - try { - io(); - } catch (t) { - if (zn !== null) - hr(t, zn, null); - else - throw t; - } -} -function $s() { - try { - for (var t = 0; ln.length > 0; ) { - t++ > 1e3 && bo(); - var e = ln, n = e.length; - ln = []; - for (var r = 0; r < n; r++) { - var i = e[r]; - i.f & Tt || (i.f ^= Tt); - var s = Ao(i); - $o(s); - } - } - } finally { - Hn = !1, zn = null; - } -} -function $o(t) { - var e = t.length; - if (e !== 0) - for (var n = 0; n < e; n++) { - var r = t[n]; - if (!(r.f & (ur | he))) - try { - _n(r) && (ai(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? Rs(r) : r.fn = null)); - } catch (i) { - hr(i, r, null, r.ctx); - } - } -} -function vr(t) { - Hn || (Hn = !0, queueMicrotask($s)); - for (var e = zn = t; e.parent !== null; ) { - e = e.parent; - var n = e.f; - if (n & (We | _e)) { - if (!(n & Tt)) return; - e.f ^= Tt; - } - } - ln.push(e); -} -function Ao(t) { - for (var e = [], n = t.first; n !== null; ) { - var r = n.f, i = (r & _e) !== 0, s = i && (r & Tt) !== 0; - if (!s && !(r & he)) { - if (r & is) - e.push(n); - else if (i) - n.f ^= Tt; - else { - var a = et; - try { - et = n, _n(n) && ai(n); - } catch (u) { - hr(u, n, null, n.ctx); - } finally { - et = a; - } - } - var o = n.first; - if (o !== null) { - n = o; - continue; - } - } - var f = n.parent; - for (n = n.next; n === null && f !== null; ) - n = f.next, f = f.parent; - } - return e; -} -function mt(t) { - var e; - for (Ei(); ln.length > 0; ) - Hn = !0, $s(), Ei(); - return ( - /** @type {T} */ - e - ); -} -function v(t) { - var e = t.f, n = (e & Wt) !== 0; - if (et !== null && !Ut) { - te !== null && te.includes(t) && uo(); - var r = et.deps; - t.rv < Bn && (t.rv = Bn, Et === null && r !== null && r[It] === t ? It++ : Et === null ? Et = [t] : (!$e || !Et.includes(t)) && Et.push(t)); - } else if (n && /** @type {Derived} */ - t.deps === null && /** @type {Derived} */ - t.effects === null) { - var i = ( - /** @type {Derived} */ - t - ), s = i.parent; - s !== null && !(s.f & zt) && (i.f ^= zt); - } - return n && (i = /** @type {Derived} */ - t, _n(i) && vs(i)), t.v; -} -function fn(t) { - var e = Ut; - try { - return Ut = !0, t(); - } finally { - Ut = e; - } -} -const ko = -7169; -function ie(t, e) { - t.f = t.f & ko | e; -} -function Eo(t) { - Q === null && et === null && ro(), et !== null && et.f & zt && Q === null && no(), si && eo(); -} -function Ro(t, e) { - var n = e.last; - n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); -} -function Ie(t, e, n, r = !0) { - var i = (t & We) !== 0, s = Q, a = { - ctx: Dt, - deps: null, - nodes_start: null, - nodes_end: null, - f: t | me, - first: null, - fn: e, - last: null, - next: null, - parent: i ? null : s, - prev: null, - teardown: null, - transitions: null, - wv: 0 - }; - if (n) - try { - ai(a), a.f |= ss; - } catch (u) { - throw pe(a), u; - } - else e !== null && vr(a); - var o = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (as | Fn)) === 0; - if (!o && !i && r && (s !== null && Ro(a, s), et !== null && et.f & Wt)) { - var f = ( - /** @type {Derived} */ - et - ); - (f.effects ?? (f.effects = [])).push(a); - } - return a; -} -function No(t) { - const e = Ie(or, null, !1); - return ie(e, Tt), e.teardown = t, e; -} -function Un(t) { - Eo(); - var e = Q !== null && (Q.f & _e) !== 0 && Dt !== null && !Dt.m; - if (e) { - var n = ( - /** @type {ComponentContext} */ - Dt - ); - (n.e ?? (n.e = [])).push({ - fn: t, - effect: Q, - reaction: et - }); - } else { - var r = pr(t); - return r; - } -} -function To(t) { - const e = Ie(We, t, !0); - return () => { - pe(e); - }; -} -function So(t) { - const e = Ie(We, t, !0); - return (n = {}) => new Promise((r) => { - n.outro ? Xn(e, () => { - pe(e), r(void 0); - }) : (pe(e), r(void 0)); - }); -} -function pr(t) { - return Ie(is, t, !1); -} -function As(t) { - return Ie(or, t, !0); -} -function Qt(t, e = [], n = cr) { - const r = e.map(n); - return oi(() => t(...r.map(v))); -} -function oi(t, e = 0) { - return Ie(or | lr | e, t, !0); -} -function cn(t, e = !0) { - return Ie(or | _e, t, !0, e); -} -function ks(t) { - var e = t.teardown; - if (e !== null) { - const n = si, r = et; - Ti(!0), ne(null); - try { - e.call(null); - } finally { - Ti(n), ne(r); - } - } -} -function Es(t, e = !1) { - var n = t.first; - for (t.first = t.last = null; n !== null; ) { - var r = n.next; - pe(n, e), n = r; - } -} -function Co(t) { - for (var e = t.first; e !== null; ) { - var n = e.next; - e.f & _e || pe(e), e = n; - } -} -function pe(t, e = !0) { - var n = !1; - if ((e || t.f & Xa) && t.nodes_start !== null) { - for (var r = t.nodes_start, i = t.nodes_end; r !== null; ) { - var s = r === i ? null : ( - /** @type {TemplateNode} */ - /* @__PURE__ */ ye(r) - ); - r.remove(), r = s; - } - n = !0; - } - Es(t, e && !n), Yn(t, 0), ie(t, ur); - var a = t.transitions; - if (a !== null) - for (const f of a) - f.stop(); - ks(t); - var o = t.parent; - o !== null && o.first !== null && Rs(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = null; -} -function Rs(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 Xn(t, e) { - var n = []; - li(t, n, !0), Ns(n, () => { - pe(t), e && e(); - }); -} -function Ns(t, e) { - var n = t.length; - if (n > 0) { - var r = () => --n || e(); - for (var i of t) - i.out(r); - } else - e(); -} -function li(t, e, n) { - if (!(t.f & he)) { - if (t.f ^= he, t.transitions !== null) - for (const a of t.transitions) - (a.is_global || n) && e.push(a); - for (var r = t.first; r !== null; ) { - var i = r.next, s = (r.f & fr) !== 0 || (r.f & _e) !== 0; - li(r, e, s ? n : !1), r = i; - } - } -} -function Gn(t) { - Ts(t, !0); -} -function Ts(t, e) { - if (t.f & he) { - t.f ^= he, t.f & Tt || (t.f ^= Tt), _n(t) && (ie(t, me), vr(t)); - for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & fr) !== 0 || (n.f & _e) !== 0; - Ts(n, i ? e : !1), n = r; - } - if (t.transitions !== null) - for (const s of t.transitions) - (s.is_global || e) && s.in(); - } -} -function Mo(t) { - throw new Error("https://svelte.dev/e/lifecycle_outside_component"); -} -let Dt = null; -function Si(t) { - Dt = t; -} -function mn(t, e = !1, n) { - Dt = { - p: Dt, - c: null, - e: null, - m: !1, - s: t, - x: null, - l: null - }; -} -function yn(t) { - const e = Dt; - if (e !== null) { - t !== void 0 && (e.x = t); - const a = e.e; - if (a !== null) { - var n = Q, r = et; - e.e = null; - try { - for (var i = 0; i < a.length; i++) { - var s = a[i]; - re(s.effect), ne(s.reaction), pr(s.fn); - } - } finally { - re(n), ne(r); - } - } - Dt = e.p, e.m = !0; - } - return t || /** @type {T} */ - {}; -} -function Ss() { - return !0; -} -const Oo = ["touchstart", "touchmove"]; -function Po(t) { - return Oo.includes(t); -} -function Cs(t) { - var e = et, n = Q; - ne(null), re(null); - try { - return t(); - } finally { - ne(e), re(n); - } -} -const Ms = /* @__PURE__ */ new Set(), Dr = /* @__PURE__ */ new Set(); -function Do(t, e, n, r = {}) { - function i(s) { - if (r.capture || tn.call(e, s), !s.cancelBubble) - return Cs(() => n == null ? void 0 : n.call(this, s)); - } - return t.startsWith("pointer") || t.startsWith("touch") || t === "wheel" ? gn(() => { - e.addEventListener(t, i, r); - }) : e.addEventListener(t, i, r), i; -} -function qe(t, e, n, r, i) { - var s = { capture: r, passive: i }, a = Do(t, e, n, s); - (e === document.body || e === window || e === document) && No(() => { - e.removeEventListener(t, a, s); - }); -} -function Os(t) { - for (var e = 0; e < t.length; e++) - Ms.add(t[e]); - for (var n of Dr) - n(t); -} -function tn(t) { - var $; - var e = this, n = ( - /** @type {Node} */ - e.ownerDocument - ), r = t.type, i = (($ = t.composedPath) == null ? void 0 : $.call(t)) || [], s = ( - /** @type {null | Element} */ - i[0] || t.target - ), a = 0, o = t.__root; - if (o) { - var f = i.indexOf(o); - if (f !== -1 && (e === document || e === /** @type {any} */ - window)) { - t.__root = e; - return; - } - var u = i.indexOf(e); - if (u === -1) - return; - f <= u && (a = f); - } - if (s = /** @type {Element} */ - i[a] || t.target, s !== e) { - Vn(t, "currentTarget", { - configurable: !0, - get() { - return s || n; - } - }); - var l = et, h = Q; - ne(null), re(null); - try { - for (var c, d = []; s !== null; ) { - var p = s.assignedSlot || s.parentNode || /** @type {any} */ - s.host || null; - try { - var _ = s["__" + r]; - if (_ !== void 0 && (!/** @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)) - if (ti(_)) { - var [m, ...w] = _; - m.apply(s, [t, ...w]); - } else - _.call(s, t); - } catch (y) { - c ? d.push(y) : c = y; - } - if (t.cancelBubble || p === e || p === null) - break; - s = p; - } - if (c) { - for (let y of d) - queueMicrotask(() => { - throw y; - }); - throw c; - } - } finally { - t.__root = e, delete t.currentTarget, ne(l), re(h); - } - } -} -function Ps(t) { - var e = document.createElement("template"); - return e.innerHTML = t, e.content; -} -function Ae(t, e) { - var n = ( - /** @type {Effect} */ - Q - ); - n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e); -} -// @__NO_SIDE_EFFECTS__ -function Bt(t, e) { - var n = (e & Ya) !== 0, r = (e & Ua) !== 0, i, s = !t.startsWith(""); - return () => { - if (at) - return Ae(tt, null), tt; - i === void 0 && (i = Ps(s ? t : "" + t), n || (i = /** @type {Node} */ - /* @__PURE__ */ ve(i))); - var a = ( - /** @type {TemplateNode} */ - r || ps ? document.importNode(i, !0) : i.cloneNode(!0) - ); - if (n) { - var o = ( - /** @type {TemplateNode} */ - /* @__PURE__ */ ve(a) - ), f = ( - /** @type {TemplateNode} */ - a.lastChild - ); - Ae(o, f); - } else - Ae(a, a); - return a; - }; -} -// @__NO_SIDE_EFFECTS__ -function Io(t, e, n = "svg") { - var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; - return () => { - if (at) - return Ae(tt, null), tt; - if (!s) { - var a = ( - /** @type {DocumentFragment} */ - Ps(i) - ), o = ( - /** @type {Element} */ - /* @__PURE__ */ ve(a) - ); - s = /** @type {Element} */ - /* @__PURE__ */ ve(o); - } - var f = ( - /** @type {TemplateNode} */ - s.cloneNode(!0) - ); - return Ae(f, f), f; - }; -} -function Fo() { - if (at) - return Ae(tt, null), tt; - var t = document.createDocumentFragment(), e = document.createComment(""), n = Ue(); - return t.append(e, n), Ae(e, n), t; -} -function Nt(t, e) { - if (at) { - Q.nodes_end = tt, dr(); - return; - } - t !== null && t.before( - /** @type {Node} */ - e - ); -} -let Ir = !0; -function be(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 Ds(t, e) { - return Is(t, e); -} -function Lo(t, e) { - Pr(), e.intro = e.intro ?? !1; - const n = e.target, r = at, i = tt; - try { - for (var s = ( - /** @type {TemplateNode} */ - /* @__PURE__ */ ve(n) - ); s && (s.nodeType !== 8 || /** @type {Comment} */ - s.data !== rs); ) - s = /** @type {TemplateNode} */ - /* @__PURE__ */ ye(s); - if (!s) - throw an; - de(!0), Gt( - /** @type {Comment} */ - s - ), dr(); - const a = Is(t, { ...e, anchor: s }); - if (tt === null || tt.nodeType !== 8 || /** @type {Comment} */ - tt.data !== Qr) - throw ii(), an; - return de(!1), /** @type {Exports} */ - a; - } catch (a) { - if (a === an) - return e.recover === !1 && so(), Pr(), ms(n), de(!1), Ds(t, e); - throw a; - } finally { - de(r), Gt(i); - } -} -const Ve = /* @__PURE__ */ new Map(); -function Is(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - Pr(); - var o = /* @__PURE__ */ new Set(), f = (h) => { - for (var c = 0; c < h.length; c++) { - var d = h[c]; - if (!o.has(d)) { - o.add(d); - var p = Po(d); - e.addEventListener(d, tn, { passive: p }); - var _ = Ve.get(d); - _ === void 0 ? (document.addEventListener(d, tn, { passive: p }), Ve.set(d, 1)) : Ve.set(d, _ + 1); - } - } - }; - f(ei(Ms)), Dr.add(f); - var u = void 0, l = So(() => { - var h = n ?? e.appendChild(Ue()); - return cn(() => { - if (s) { - mn({}); - var c = ( - /** @type {ComponentContext} */ - Dt - ); - c.c = s; - } - i && (r.$$events = i), at && Ae( - /** @type {TemplateNode} */ - h, - null - ), Ir = a, u = t(h, r) || {}, Ir = !0, at && (Q.nodes_end = tt), s && yn(); - }), () => { - var p; - for (var c of o) { - e.removeEventListener(c, tn); - var d = ( - /** @type {number} */ - Ve.get(c) - ); - --d === 0 ? (document.removeEventListener(c, tn), Ve.delete(c)) : Ve.set(c, d); - } - Dr.delete(f), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); - }; - }); - return Fr.set(u, l), u; -} -let Fr = /* @__PURE__ */ new WeakMap(); -function qo(t, e) { - const n = Fr.get(t); - return n ? (Fr.delete(t), n(e)) : Promise.resolve(); -} -function Lr(t, e, n = !1) { - at && dr(); - var r = t, i = null, s = null, a = Mt, o = n ? fr : 0, f = !1; - const u = (h, c = !0) => { - f = !0, l(c, h); - }, l = (h, c) => { - if (a === (a = h)) return; - let d = !1; - if (at) { - const p = ( - /** @type {Comment} */ - r.data === jr - ); - !!a === p && (r = Or(), Gt(r), de(!1), d = !0); - } - a ? (i ? Gn(i) : c && (i = cn(() => c(r))), s && Xn(s, () => { - s = null; - })) : (s ? Gn(s) : c && (s = cn(() => c(r))), i && Xn(i, () => { - i = null; - })), d && de(!0); - }; - oi(() => { - f = !1, e(u), f || l(null, null); - }, o), at && (r = tt); -} -function Ce(t, e) { - return e; -} -function Vo(t, e, n, r) { - for (var i = [], s = e.length, a = 0; a < s; a++) - li(e[a].e, i, !0); - var o = s > 0 && i.length === 0 && n !== null; - if (o) { - var f = ( - /** @type {Element} */ - /** @type {Element} */ - n.parentNode - ); - ms(f), f.append( - /** @type {Element} */ - n - ), r.clear(), xe(t, e[0].prev, e[s - 1].next); - } - Ns(i, () => { - for (var u = 0; u < s; u++) { - var l = e[u]; - o || (r.delete(l.k), xe(t, l.prev, l.next)), pe(l.e, !o); - } - }); -} -function Me(t, e, n, r, i, s = null) { - var a = t, o = { items: /* @__PURE__ */ new Map(), first: null }, f = (e & ns) !== 0; - if (f) { - var u = ( - /** @type {Element} */ - t - ); - a = at ? Gt( - /** @type {Comment | Text} */ - /* @__PURE__ */ ve(u) - ) : u.appendChild(Ue()); - } - at && dr(); - var l = null, h = !1, c = /* @__PURE__ */ vo(() => { - var d = n(); - return ti(d) ? d : d == null ? [] : ei(d); - }); - oi(() => { - var d = v(c), p = d.length; - if (h && p === 0) - return; - h = p === 0; - let _ = !1; - if (at) { - var m = ( - /** @type {Comment} */ - a.data === jr - ); - m !== (p === 0) && (a = Or(), Gt(a), de(!1), _ = !0); - } - if (at) { - for (var w = null, $, y = 0; y < p; y++) { - if (tt.nodeType === 8 && /** @type {Comment} */ - tt.data === Qr) { - a = /** @type {Comment} */ - tt, _ = !0, de(!1); - break; - } - var x = d[y], E = r(x, y); - $ = Fs( - tt, - o, - w, - null, - x, - E, - y, - i, - e, - n - ), o.items.set(E, $), w = $; - } - p > 0 && Gt(Or()); - } - at || Ho(d, o, a, i, e, r, n), s !== null && (p === 0 ? l ? Gn(l) : l = cn(() => s(a)) : l !== null && Xn(l, () => { - l = null; - })), _ && de(!0), v(c); - }), at && (a = tt); -} -function Ho(t, e, n, r, i, s, a) { - var O, xt, _t, yt; - var o = (i & Da) !== 0, f = (i & (Jr | Zr)) !== 0, u = t.length, l = e.items, h = e.first, c = h, d, p = null, _, m = [], w = [], $, y, x, E; - if (o) - for (E = 0; E < u; E += 1) - $ = t[E], y = s($, E), x = l.get(y), x !== void 0 && ((O = x.a) == null || O.measure(), (_ ?? (_ = /* @__PURE__ */ new Set())).add(x)); - for (E = 0; E < u; E += 1) { - if ($ = t[E], y = s($, E), x = l.get(y), x === void 0) { - var b = c ? ( - /** @type {TemplateNode} */ - c.e.nodes_start - ) : n; - p = Fs( - b, - e, - p, - p === null ? e.first : p.next, - $, - y, - E, - r, - i, - a - ), l.set(y, p), m = [], w = [], c = p.next; - continue; - } - if (f && zo(x, $, E, i), x.e.f & he && (Gn(x.e), o && ((xt = x.a) == null || xt.unfix(), (_ ?? (_ = /* @__PURE__ */ new Set())).delete(x))), x !== c) { - if (d !== void 0 && d.has(x)) { - if (m.length < w.length) { - var T = w[0], P; - p = T.prev; - var K = m[0], rt = m[m.length - 1]; - for (P = 0; P < m.length; P += 1) - Ci(m[P], T, n); - for (P = 0; P < w.length; P += 1) - d.delete(w[P]); - xe(e, K.prev, rt.next), xe(e, p, K), xe(e, rt, T), c = T, p = rt, E -= 1, m = [], w = []; - } else - d.delete(x), Ci(x, c, n), xe(e, x.prev, x.next), xe(e, x, p === null ? e.first : p.next), xe(e, p, x), p = x; - continue; - } - for (m = [], w = []; c !== null && c.k !== y; ) - c.e.f & he || (d ?? (d = /* @__PURE__ */ new Set())).add(c), w.push(c), c = c.next; - if (c === null) - continue; - x = c; - } - m.push(x), p = x, c = x.next; - } - if (c !== null || d !== void 0) { - for (var J = d === void 0 ? [] : ei(d); c !== null; ) - c.e.f & he || J.push(c), c = c.next; - var ot = J.length; - if (ot > 0) { - var C = i & ns && u === 0 ? n : null; - if (o) { - for (E = 0; E < ot; E += 1) - (_t = J[E].a) == null || _t.measure(); - for (E = 0; E < ot; E += 1) - (yt = J[E].a) == null || yt.fix(); - } - Vo(e, J, C, l); - } - } - o && gn(() => { - var pt; - if (_ !== void 0) - for (x of _) - (pt = x.a) == null || pt.apply(); - }), Q.first = e.first && e.first.e, Q.last = p && p.e; -} -function zo(t, e, n, r) { - r & Jr && Mr(t.v, e), r & Zr ? Mr( - /** @type {Value} */ - t.i, - n - ) : t.i = n; -} -function Fs(t, e, n, r, i, s, a, o, f, u) { - var l = (f & Jr) !== 0, h = (f & Ia) === 0, c = l ? h ? /* @__PURE__ */ ri(i) : Ht(i) : i, d = f & Zr ? Ht(a) : a, p = { - i: d, - v: c, - k: s, - a: null, - // @ts-expect-error - e: null, - prev: n, - next: r - }; - try { - return p.e = cn(() => o(t, c, d, u), at), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; - } finally { - } -} -function Ci(t, e, n) { - for (var r = t.next ? ( - /** @type {TemplateNode} */ - t.next.e.nodes_start - ) : n, i = e ? ( - /** @type {TemplateNode} */ - e.e.nodes_start - ) : n, s = ( - /** @type {TemplateNode} */ - t.e.nodes_start - ); s !== r; ) { - var a = ( - /** @type {TemplateNode} */ - /* @__PURE__ */ ye(s) - ); - i.before(s), s = a; - } -} -function xe(t, e, n) { - e === null ? t.first = n : (e.next = n, e.e.next = n && n.e), n !== null && (n.prev = e, n.e.prev = e && e.e); -} -function gr(t, e) { - gn(() => { - 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 = document.createElement("style"); - i.id = e.hash, i.textContent = e.code, r.appendChild(i); - } - }); -} -const Mi = [...` -\r\f \v\uFEFF`]; -function Bo(t, e, n) { - var r = t == null ? "" : "" + t; - 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 o = a + s; - (a === 0 || Mi.includes(r[a - 1])) && (o === r.length || Mi.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; - } - } - return r === "" ? null : r; -} -function en(t, e, n, r, i, s) { - var a = t.__className; - if (at || a !== n) { - var o = Bo(n, r, s); - (!at || o !== t.getAttribute("class")) && (o == null ? t.removeAttribute("class") : t.className = o), t.__className = n; - } else if (s) - for (var f in s) { - var u = !!s[f]; - (i == null || u !== !!i[f]) && t.classList.toggle(f, u); - } - return s; -} -function Wn(t, e, n, r) { - var i = t.__attributes ?? (t.__attributes = {}); - at && (i[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === "LINK") || i[e] !== (i[e] = n) && (e === "style" && "__styles" in t && (t.__styles = {}), e === "loading" && (t[Ga] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && Yo(t).includes(e) ? t[e] = n : t.setAttribute(e, n)); -} -var Oi = /* @__PURE__ */ new Map(); -function Yo(t) { - var e = Oi.get(t.nodeName); - if (e) return e; - Oi.set(t.nodeName, e = []); - for (var n, r = t, i = Element.prototype; i !== r; ) { - n = Ka(r); - for (var s in n) - n[s].set && e.push(s); - r = ls(r); - } - return e; -} -function Pi(t, e, n, r) { - var i = t.__styles ?? (t.__styles = {}); - i[e] !== n && (i[e] = n, n == null ? t.style.removeProperty(e) : t.style.setProperty(e, n, "")); -} -const Uo = () => performance.now(), ce = { - // don't access requestAnimationFrame eagerly outside method - // this allows basic testing of user code without JSDOM - // bunder will eval and remove ternary when the user's app is built - tick: ( - /** @param {any} _ */ - (t) => requestAnimationFrame(t) - ), - now: () => Uo(), - tasks: /* @__PURE__ */ new Set() -}; -function Ls() { - const t = ce.now(); - ce.tasks.forEach((e) => { - e.c(t) || (ce.tasks.delete(e), e.f()); - }), ce.tasks.size !== 0 && ce.tick(Ls); -} -function Xo(t) { - let e; - return ce.tasks.size === 0 && ce.tick(Ls), { - promise: new Promise((n) => { - ce.tasks.add(e = { c: t, f: n }); - }), - abort() { - ce.tasks.delete(e); - } - }; -} -function bn(t, e) { - Cs(() => { - t.dispatchEvent(new CustomEvent(e)); - }); -} -function Go(t) { - if (t === "float") return "cssFloat"; - if (t === "offset") return "cssOffset"; - if (t.startsWith("--")) return t; - const e = t.split("-"); - return e.length === 1 ? e[0] : e[0] + e.slice(1).map( - /** @param {any} word */ - (n) => n[0].toUpperCase() + n.slice(1) - ).join(""); -} -function Di(t) { - const e = {}, n = t.split(";"); - for (const r of n) { - const [i, s] = r.split(":"); - if (!i || s === void 0) break; - const a = Go(i.trim()); - e[a] = s.trim(); - } - return e; -} -const Wo = (t) => t; -function $n(t, e, n, r) { - var i = (t & Ha) !== 0, s = (t & za) !== 0, a = i && s, o = (t & Ba) !== 0, f = a ? "both" : i ? "in" : "out", u, l = e.inert, h = e.style.overflow, c, d; - function p() { - var y = et, x = Q; - ne(null), re(null); - try { - return u ?? (u = n()(e, (r == null ? void 0 : r()) ?? /** @type {P} */ - {}, { - direction: f - })); - } finally { - ne(y), re(x); - } - } - var _ = { - is_global: o, - in() { - var y; - if (e.inert = l, !i) { - d == null || d.abort(), (y = d == null ? void 0 : d.reset) == null || y.call(d); - return; - } - s || c == null || c.abort(), bn(e, "introstart"), c = qr(e, p(), d, 1, () => { - bn(e, "introend"), c == null || c.abort(), c = u = void 0, e.style.overflow = h; - }); - }, - out(y) { - if (!s) { - y == null || y(), u = void 0; - return; - } - e.inert = !0, bn(e, "outrostart"), d = qr(e, p(), c, 0, () => { - bn(e, "outroend"), y == null || y(); - }); - }, - stop: () => { - c == null || c.abort(), d == null || d.abort(); - } - }, m = ( - /** @type {Effect} */ - Q - ); - if ((m.transitions ?? (m.transitions = [])).push(_), i && Ir) { - var w = o; - if (!w) { - for (var $ = ( - /** @type {Effect | null} */ - m.parent - ); $ && $.f & fr; ) - for (; ($ = $.parent) && !($.f & lr); ) - ; - w = !$ || ($.f & ss) !== 0; - } - w && pr(() => { - fn(() => _.in()); - }); - } -} -function qr(t, e, n, r, i) { - var s = r === 1; - if (ja(e)) { - var a, o = !1; - return gn(() => { - if (!o) { - var m = e({ direction: s ? "in" : "out" }); - a = qr(t, m, n, r, i); - } - }), { - abort: () => { - o = !0, a == null || a.abort(); - }, - deactivate: () => a.deactivate(), - reset: () => a.reset(), - t: () => a.t() - }; - } - if (n == null || n.deactivate(), !(e != null && e.duration)) - return i(), { - abort: je, - deactivate: je, - reset: je, - t: () => r - }; - const { delay: f = 0, css: u, tick: l, easing: h = Wo } = e; - var c = []; - if (s && n === void 0 && (l && l(0, 1), u)) { - var d = Di(u(0, 1)); - c.push(d, d); - } - var p = () => 1 - r, _ = t.animate(c, { duration: f }); - return _.onfinish = () => { - var m = (n == null ? void 0 : n.t()) ?? 1 - r; - n == null || n.abort(); - var w = r - m, $ = ( - /** @type {number} */ - e.duration * Math.abs(w) - ), y = []; - if ($ > 0) { - var x = !1; - if (u) - for (var E = Math.ceil($ / 16.666666666666668), b = 0; b <= E; b += 1) { - var T = m + w * h(b / E), P = Di(u(T, 1 - T)); - y.push(P), x || (x = P.overflow === "hidden"); - } - x && (t.style.overflow = "hidden"), p = () => { - var K = ( - /** @type {number} */ - /** @type {globalThis.Animation} */ - _.currentTime - ); - return m + w * h(K / $); - }, l && Xo(() => { - if (_.playState !== "running") return !1; - var K = p(); - return l(K, 1 - K), !0; - }); - } - _ = t.animate(y, { duration: $, fill: "forwards" }), _.onfinish = () => { - p = () => r, l == null || l(r, 1 - r), i(); - }; - }, { - abort: () => { - _ && (_.cancel(), _.effect = null, _.onfinish = je); - }, - deactivate: () => { - i = je; - }, - reset: () => { - r === 0 && (l == null || l(1, 0)); - }, - t: () => p() - }; -} -function Ii(t, e) { - return t === e || (t == null ? void 0 : t[on]) === e; -} -function Kn(t = {}, e, n, r) { - return pr(() => { - var i, s; - return As(() => { - i = s, s = [], fn(() => { - t !== n(...s) && (e(t, ...s), i && Ii(n(...i), t) && e(null, ...i)); - }); - }), () => { - gn(() => { - s && Ii(n(...s), t) && e(null, ...s); - }); - }; - }), t; -} -function ui(t) { - Dt === null && Mo(), Un(() => { - const e = fn(t); - if (typeof e == "function") return ( - /** @type {() => void} */ - e - ); - }); -} -let An = !1; -function Ko(t) { - var e = An; - try { - return An = !1, [t(), An]; - } finally { - An = e; - } -} -function Jo(t, e = 1) { - const n = t(); - return t(n + e), n; -} -function wt(t, e, n, r) { - var E; - var i = (n & Fa) !== 0, s = !0, a = (n & qa) !== 0, o = (n & Va) !== 0, f = !1, u; - a ? [u, f] = Ko(() => ( - /** @type {V} */ - t[e] - )) : u = /** @type {V} */ - t[e]; - var l = on in t || os in t, h = a && (((E = Se(t, e)) == null ? void 0 : E.set) ?? (l && e in t && ((b) => t[e] = b))) || void 0, c = ( - /** @type {V} */ - r - ), d = !0, p = !1, _ = () => (p = !0, d && (d = !1, o ? c = fn( - /** @type {() => V} */ - r - ) : c = /** @type {V} */ - r), c); - u === void 0 && r !== void 0 && (h && s && ao(), u = _(), h && h(u)); - var m; - if (m = () => { - var b = ( - /** @type {V} */ - t[e] - ); - return b === void 0 ? _() : (d = !0, p = !1, b); - }, !(n & La)) - return m; - if (h) { - var w = t.$$legacy; - return function(b, T) { - return arguments.length > 0 ? ((!T || w || f) && h(T ? m() : b), b) : m(); - }; - } - var $ = !1, y = /* @__PURE__ */ ri(u), x = /* @__PURE__ */ cr(() => { - var b = m(), T = v(y); - return $ ? ($ = !1, T) : y.v = b; - }); - return i || (x.equals = ni), function(b, T) { - if (arguments.length > 0) { - const P = T ? v(x) : a ? F(b) : b; - return x.equals(P) || ($ = !0, M(y, P), p && c !== void 0 && (c = P), fn(() => v(x))), b; - } - return v(x); - }; -} -function Zo(t) { - return new jo(t); -} -var fe, Vt; -class jo { - /** - * @param {ComponentConstructorOptions & { - * component: any; - * }} options - */ - constructor(e) { - /** @type {any} */ - kr(this, fe); - /** @type {Record} */ - kr(this, Vt); - var s; - var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var f = /* @__PURE__ */ ri(o); - return n.set(a, f), f; - }; - const i = new Proxy( - { ...e.props || {}, $$events: {} }, - { - get(a, o) { - return v(n.get(o) ?? r(o, Reflect.get(a, o))); - }, - has(a, o) { - return o === os ? !0 : (v(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); - }, - set(a, o, f) { - return M(n.get(o) ?? r(o, f), f), Reflect.set(a, o, f); - } - } - ); - Er(this, Vt, (e.hydrate ? Lo : Ds)(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(), Er(this, fe, i.$$events); - for (const a of Object.keys(Ct(this, Vt))) - a === "$set" || a === "$destroy" || a === "$on" || Vn(this, a, { - get() { - return Ct(this, Vt)[a]; - }, - /** @param {any} value */ - set(o) { - Ct(this, Vt)[a] = o; - }, - enumerable: !0 - }); - Ct(this, Vt).$set = /** @param {Record} next */ - (a) => { - Object.assign(i, a); - }, Ct(this, Vt).$destroy = () => { - qo(Ct(this, Vt)); - }; - } - /** @param {Record} props */ - $set(e) { - Ct(this, Vt).$set(e); - } - /** - * @param {string} event - * @param {(...args: any[]) => any} callback - * @returns {any} - */ - $on(e, n) { - Ct(this, fe)[e] = Ct(this, fe)[e] || []; - const r = (...i) => n.call(this, ...i); - return Ct(this, fe)[e].push(r), () => { - Ct(this, fe)[e] = Ct(this, fe)[e].filter( - /** @param {any} fn */ - (i) => i !== r - ); - }; - } - $destroy() { - Ct(this, Vt).$destroy(); - } -} -fe = new WeakMap(), Vt = new WeakMap(); -let qs; -typeof HTMLElement == "function" && (qs = class extends HTMLElement { - /** - * @param {*} $$componentCtor - * @param {*} $$slots - * @param {*} use_shadow_dom - */ - constructor(e, n, r) { - super(); - /** The Svelte component constructor */ - Yt(this, "$$ctor"); - /** Slots */ - Yt(this, "$$s"); - /** @type {any} The Svelte component instance */ - Yt(this, "$$c"); - /** Whether or not the custom element is connected */ - Yt(this, "$$cn", !1); - /** @type {Record} Component props data */ - Yt(this, "$$d", {}); - /** `true` if currently in the process of reflecting component props back to attributes */ - Yt(this, "$$r", !1); - /** @type {Record} Props definition (name, reflected, type etc) */ - Yt(this, "$$p_d", {}); - /** @type {Record} Event listeners */ - Yt(this, "$$l", {}); - /** @type {Map} Event listener unsubscribe functions */ - Yt(this, "$$l_u", /* @__PURE__ */ new Map()); - /** @type {any} The managed render effect for reflecting attributes */ - Yt(this, "$$me"); - this.$$ctor = e, this.$$s = n, r && this.attachShadow({ mode: "open" }); - } - /** - * @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 = document.createElement("slot"); - s !== "default" && (o.name = s), Nt(a, o); - }; - }; - var e = n; - if (await Promise.resolve(), !this.$$cn || this.$$c) - return; - const r = {}, i = Qo(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] = Cn(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 = Zo({ - component: this.$$ctor, - target: this.shadowRoot || this, - props: { - ...this.$$d, - $$slots: r, - $$host: this - } - }), this.$$me = To(() => { - As(() => { - var s; - this.$$r = !0; - for (const a of qn(this.$$c)) { - if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; - this.$$d[a] = this.$$c[a]; - const o = Cn( - 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] = Cn(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 qn(this.$$p_d).find( - (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e - ) || e; - } -}); -function Cn(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 Qo(t) { - const e = {}; - return t.childNodes.forEach((n) => { - e[ - /** @type {Element} node */ - n.slot || "default" - ] = !0; - }), e; -} -function _r(t, e, n, r, i, s) { - let a = class extends qs { - constructor() { - super(t, n, i), this.$$p_d = e; - } - static get observedAttributes() { - return qn(e).map( - (o) => (e[o].attribute || o).toLowerCase() - ); - } - }; - return qn(e).forEach((o) => { - Vn(a.prototype, o, { - get() { - return this.$$c && o in this.$$c ? this.$$c[o] : this.$$d[o]; - }, - set(f) { - var h; - f = Cn(o, f, e), this.$$d[o] = f; - var u = this.$$c; - if (u) { - var l = (h = Se(u, o)) == null ? void 0 : h.get; - l ? u[o] = f : u.$set({ [o]: f }); - } - } - }); - }), r.forEach((o) => { - Vn(a.prototype, o, { - get() { - var f; - return (f = this.$$c) == null ? void 0 : f[o]; - } - }); - }), t.element = /** @type {any} */ - a, a; -} -var tl = { value: () => { -} }; -function Vs() { - 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 Mn(n); -} -function Mn(t) { - this._ = t; -} -function el(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 }; - }); -} -Mn.prototype = Vs.prototype = { - constructor: Mn, - on: function(t, e) { - var n = this._, r = el(t + "", n), i, s = -1, a = r.length; - if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = nl(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] = Fi(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = Fi(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 Mn(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 nl(t, e) { - for (var n = 0, r = t.length, i; n < r; ++n) - if ((i = t[n]).name === e) - return i.value; -} -function Fi(t, e, n) { - for (var r = 0, i = t.length; r < i; ++r) - if (t[r].name === e) { - t[r] = tl, t = t.slice(0, r).concat(t.slice(r + 1)); - break; - } - return n != null && t.push({ name: e, value: n }), t; -} -var Vr = "http://www.w3.org/1999/xhtml"; -const Li = { - svg: "http://www.w3.org/2000/svg", - xhtml: Vr, - xlink: "http://www.w3.org/1999/xlink", - xml: "http://www.w3.org/XML/1998/namespace", - xmlns: "http://www.w3.org/2000/xmlns/" -}; -function mr(t) { - var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Li.hasOwnProperty(e) ? { space: Li[e], local: t } : t; -} -function rl(t) { - return function() { - var e = this.ownerDocument, n = this.namespaceURI; - return n === Vr && e.documentElement.namespaceURI === Vr ? e.createElement(t) : e.createElementNS(n, t); - }; -} -function il(t) { - return function() { - return this.ownerDocument.createElementNS(t.space, t.local); - }; -} -function Hs(t) { - var e = mr(t); - return (e.local ? il : rl)(e); -} -function sl() { -} -function fi(t) { - return t == null ? sl : function() { - return this.querySelector(t); - }; -} -function al(t) { - typeof t != "function" && (t = fi(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), f, u, l = 0; l < a; ++l) - (f = s[l]) && (u = t.call(f, f.__data__, l, s)) && ("__data__" in f && (u.__data__ = f.__data__), o[l] = u); - return new Ft(r, this._parents); -} -function ol(t) { - return t == null ? [] : Array.isArray(t) ? t : Array.from(t); -} -function ll() { - return []; -} -function zs(t) { - return t == null ? ll : function() { - return this.querySelectorAll(t); - }; -} -function ul(t) { - return function() { - return ol(t.apply(this, arguments)); - }; -} -function fl(t) { - typeof t == "function" ? t = ul(t) : t = zs(t); - for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) - for (var a = e[s], o = a.length, f, u = 0; u < o; ++u) - (f = a[u]) && (r.push(t.call(f, f.__data__, u, a)), i.push(f)); - return new Ft(r, i); -} -function Bs(t) { - return function() { - return this.matches(t); - }; -} -function Ys(t) { - return function(e) { - return e.matches(t); - }; -} -var cl = Array.prototype.find; -function dl(t) { - return function() { - return cl.call(this.children, t); - }; -} -function hl() { - return this.firstElementChild; -} -function vl(t) { - return this.select(t == null ? hl : dl(typeof t == "function" ? t : Ys(t))); -} -var pl = Array.prototype.filter; -function gl() { - return Array.from(this.children); -} -function _l(t) { - return function() { - return pl.call(this.children, t); - }; -} -function ml(t) { - return this.selectAll(t == null ? gl : _l(typeof t == "function" ? t : Ys(t))); -} -function yl(t) { - typeof t != "function" && (t = Bs(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] = [], f, u = 0; u < a; ++u) - (f = s[u]) && t.call(f, f.__data__, u, s) && o.push(f); - return new Ft(r, this._parents); -} -function Us(t) { - return new Array(t.length); -} -function wl() { - return new Ft(this._enter || this._groups.map(Us), this._parents); -} -function Jn(t, e) { - this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; -} -Jn.prototype = { - constructor: Jn, - 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 xl(t) { - return function() { - return t; - }; -} -function bl(t, e, n, r, i, s) { - for (var a = 0, o, f = e.length, u = s.length; a < u; ++a) - (o = e[a]) ? (o.__data__ = s[a], r[a] = o) : n[a] = new Jn(t, s[a]); - for (; a < f; ++a) - (o = e[a]) && (i[a] = o); -} -function $l(t, e, n, r, i, s, a) { - var o, f, u = /* @__PURE__ */ new Map(), l = e.length, h = s.length, c = new Array(l), d; - for (o = 0; o < l; ++o) - (f = e[o]) && (c[o] = d = a.call(f, f.__data__, o, e) + "", u.has(d) ? i[o] = f : u.set(d, f)); - for (o = 0; o < h; ++o) - d = a.call(t, s[o], o, s) + "", (f = u.get(d)) ? (r[o] = f, f.__data__ = s[o], u.delete(d)) : n[o] = new Jn(t, s[o]); - for (o = 0; o < l; ++o) - (f = e[o]) && u.get(c[o]) === f && (i[o] = f); -} -function Al(t) { - return t.__data__; -} -function kl(t, e) { - if (!arguments.length) return Array.from(this, Al); - var n = e ? $l : bl, r = this._parents, i = this._groups; - typeof t != "function" && (t = xl(t)); - for (var s = i.length, a = new Array(s), o = new Array(s), f = new Array(s), u = 0; u < s; ++u) { - var l = r[u], h = i[u], c = h.length, d = El(t.call(l, l && l.__data__, u, r)), p = d.length, _ = o[u] = new Array(p), m = a[u] = new Array(p), w = f[u] = new Array(c); - n(l, h, _, m, w, d, e); - for (var $ = 0, y = 0, x, E; $ < p; ++$) - if (x = _[$]) { - for ($ >= y && (y = $ + 1); !(E = m[y]) && ++y < p; ) ; - x._next = E || null; - } - } - return a = new Ft(a, r), a._enter = o, a._exit = f, a; -} -function El(t) { - return typeof t == "object" && "length" in t ? t : Array.from(t); -} -function Rl() { - return new Ft(this._exit || this._groups.map(Us), this._parents); -} -function Nl(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 Tl(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), f = 0; f < a; ++f) - for (var u = n[f], l = r[f], h = u.length, c = o[f] = new Array(h), d, p = 0; p < h; ++p) - (d = u[p] || l[p]) && (c[p] = d); - for (; f < i; ++f) - o[f] = n[f]; - return new Ft(o, this._parents); -} -function Sl() { - 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 Cl(t) { - t || (t = Ml); - 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, f = i[s] = new Array(o), u, l = 0; l < o; ++l) - (u = a[l]) && (f[l] = u); - f.sort(e); - } - return new Ft(i, this._parents).order(); -} -function Ml(t, e) { - return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; -} -function Ol() { - var t = arguments[0]; - return arguments[0] = this, t.apply(null, arguments), this; -} -function Pl() { - return Array.from(this); -} -function Dl() { - 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 Il() { - let t = 0; - for (const e of this) ++t; - return t; -} -function Fl() { - return !this.node(); -} -function Ll(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 ql(t) { - return function() { - this.removeAttribute(t); - }; -} -function Vl(t) { - return function() { - this.removeAttributeNS(t.space, t.local); - }; -} -function Hl(t, e) { - return function() { - this.setAttribute(t, e); - }; -} -function zl(t, e) { - return function() { - this.setAttributeNS(t.space, t.local, e); - }; -} -function Bl(t, e) { - return function() { - var n = e.apply(this, arguments); - n == null ? this.removeAttribute(t) : this.setAttribute(t, n); - }; -} -function Yl(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 Ul(t, e) { - var n = mr(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 ? Vl : ql : typeof e == "function" ? n.local ? Yl : Bl : n.local ? zl : Hl)(n, e)); -} -function Xs(t) { - return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; -} -function Xl(t) { - return function() { - this.style.removeProperty(t); - }; -} -function Gl(t, e, n) { - return function() { - this.style.setProperty(t, e, n); - }; -} -function Wl(t, e, n) { - return function() { - var r = e.apply(this, arguments); - r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); - }; -} -function Kl(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? Xl : typeof e == "function" ? Wl : Gl)(t, e, n ?? "")) : Xe(this.node(), t); -} -function Xe(t, e) { - return t.style.getPropertyValue(e) || Xs(t).getComputedStyle(t, null).getPropertyValue(e); -} -function Jl(t) { - return function() { - delete this[t]; - }; -} -function Zl(t, e) { - return function() { - this[t] = e; - }; -} -function jl(t, e) { - return function() { - var n = e.apply(this, arguments); - n == null ? delete this[t] : this[t] = n; - }; -} -function Ql(t, e) { - return arguments.length > 1 ? this.each((e == null ? Jl : typeof e == "function" ? jl : Zl)(t, e)) : this.node()[t]; -} -function Gs(t) { - return t.trim().split(/^|\s+/); -} -function ci(t) { - return t.classList || new Ws(t); -} -function Ws(t) { - this._node = t, this._names = Gs(t.getAttribute("class") || ""); -} -Ws.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 Ks(t, e) { - for (var n = ci(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); -} -function Js(t, e) { - for (var n = ci(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); -} -function tu(t) { - return function() { - Ks(this, t); - }; -} -function eu(t) { - return function() { - Js(this, t); - }; -} -function nu(t, e) { - return function() { - (e.apply(this, arguments) ? Ks : Js)(this, t); - }; -} -function ru(t, e) { - var n = Gs(t + ""); - if (arguments.length < 2) { - for (var r = ci(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; - return !0; - } - return this.each((typeof e == "function" ? nu : e ? tu : eu)(n, e)); -} -function iu() { - this.textContent = ""; -} -function su(t) { - return function() { - this.textContent = t; - }; -} -function au(t) { - return function() { - var e = t.apply(this, arguments); - this.textContent = e ?? ""; - }; -} -function ou(t) { - return arguments.length ? this.each(t == null ? iu : (typeof t == "function" ? au : su)(t)) : this.node().textContent; -} -function lu() { - this.innerHTML = ""; -} -function uu(t) { - return function() { - this.innerHTML = t; - }; -} -function fu(t) { - return function() { - var e = t.apply(this, arguments); - this.innerHTML = e ?? ""; - }; -} -function cu(t) { - return arguments.length ? this.each(t == null ? lu : (typeof t == "function" ? fu : uu)(t)) : this.node().innerHTML; -} -function du() { - this.nextSibling && this.parentNode.appendChild(this); -} -function hu() { - return this.each(du); -} -function vu() { - this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); -} -function pu() { - return this.each(vu); -} -function gu(t) { - var e = typeof t == "function" ? t : Hs(t); - return this.select(function() { - return this.appendChild(e.apply(this, arguments)); - }); -} -function _u() { - return null; -} -function mu(t, e) { - var n = typeof t == "function" ? t : Hs(t), r = e == null ? _u : typeof e == "function" ? e : fi(e); - return this.select(function() { - return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); - }); -} -function yu() { - var t = this.parentNode; - t && t.removeChild(this); -} -function wu() { - return this.each(yu); -} -function xu() { - var t = this.cloneNode(!1), e = this.parentNode; - return e ? e.insertBefore(t, this.nextSibling) : t; -} -function bu() { - var t = this.cloneNode(!0), e = this.parentNode; - return e ? e.insertBefore(t, this.nextSibling) : t; -} -function $u(t) { - return this.select(t ? bu : xu); -} -function Au(t) { - return arguments.length ? this.property("__data__", t) : this.node().__data__; -} -function ku(t) { - return function(e) { - t.call(this, e, this.__data__); - }; -} -function Eu(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 Ru(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 Nu(t, e, n) { - return function() { - var r = this.__on, i, s = ku(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 Tu(t, e, n) { - var r = Eu(t + ""), i, s = r.length, a; - if (arguments.length < 2) { - var o = this.node().__on; - if (o) { - for (var f = 0, u = o.length, l; f < u; ++f) - for (i = 0, l = o[f]; i < s; ++i) - if ((a = r[i]).type === l.type && a.name === l.name) - return l.value; - } - return; - } - for (o = e ? Nu : Ru, i = 0; i < s; ++i) this.each(o(r[i], e, n)); - return this; -} -function Zs(t, e, n) { - var r = Xs(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 Su(t, e) { - return function() { - return Zs(this, t, e); - }; -} -function Cu(t, e) { - return function() { - return Zs(this, t, e.apply(this, arguments)); - }; -} -function Mu(t, e) { - return this.each((typeof e == "function" ? Cu : Su)(t, e)); -} -function* Ou() { - 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 js = [null]; -function Ft(t, e) { - this._groups = t, this._parents = e; -} -function Je() { - return new Ft([[document.documentElement]], js); -} -function Pu() { - return this; -} -Ft.prototype = Je.prototype = { - constructor: Ft, - select: al, - selectAll: fl, - selectChild: vl, - selectChildren: ml, - filter: yl, - data: kl, - enter: wl, - exit: Rl, - join: Nl, - merge: Tl, - selection: Pu, - order: Sl, - sort: Cl, - call: Ol, - nodes: Pl, - node: Dl, - size: Il, - empty: Fl, - each: Ll, - attr: Ul, - style: Kl, - property: Ql, - classed: ru, - text: ou, - html: cu, - raise: hu, - lower: pu, - append: gu, - insert: mu, - remove: wu, - clone: $u, - datum: Au, - on: Tu, - dispatch: Mu, - [Symbol.iterator]: Ou -}; -function bt(t) { - return typeof t == "string" ? new Ft([[document.querySelector(t)]], [document.documentElement]) : new Ft([[t]], js); -} -function di(t, e, n) { - t.prototype = e.prototype = n, n.constructor = t; -} -function Qs(t, e) { - var n = Object.create(t.prototype); - for (var r in e) n[r] = e[r]; - return n; -} -function wn() { -} -var dn = 0.7, Zn = 1 / dn, Ye = "\\s*([+-]?\\d+)\\s*", hn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", ee = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Du = /^#([0-9a-f]{3,8})$/, Iu = new RegExp(`^rgb\\(${Ye},${Ye},${Ye}\\)$`), Fu = new RegExp(`^rgb\\(${ee},${ee},${ee}\\)$`), Lu = new RegExp(`^rgba\\(${Ye},${Ye},${Ye},${hn}\\)$`), qu = new RegExp(`^rgba\\(${ee},${ee},${ee},${hn}\\)$`), Vu = new RegExp(`^hsl\\(${hn},${ee},${ee}\\)$`), Hu = new RegExp(`^hsla\\(${hn},${ee},${ee},${hn}\\)$`), qi = { - 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 -}; -di(wn, Pe, { - copy(t) { - return Object.assign(new this.constructor(), this, t); - }, - displayable() { - return this.rgb().displayable(); - }, - hex: Vi, - // Deprecated! Use color.formatHex. - formatHex: Vi, - formatHex8: zu, - formatHsl: Bu, - formatRgb: Hi, - toString: Hi -}); -function Vi() { - return this.rgb().formatHex(); -} -function zu() { - return this.rgb().formatHex8(); -} -function Bu() { - return ta(this).formatHsl(); -} -function Hi() { - return this.rgb().formatRgb(); -} -function Pe(t) { - var e, n; - return t = (t + "").trim().toLowerCase(), (e = Du.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? zi(e) : n === 3 ? new Pt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? kn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? kn(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 = Iu.exec(t)) ? new Pt(e[1], e[2], e[3], 1) : (e = Fu.exec(t)) ? new Pt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Lu.exec(t)) ? kn(e[1], e[2], e[3], e[4]) : (e = qu.exec(t)) ? kn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Vu.exec(t)) ? Ui(e[1], e[2] / 100, e[3] / 100, 1) : (e = Hu.exec(t)) ? Ui(e[1], e[2] / 100, e[3] / 100, e[4]) : qi.hasOwnProperty(t) ? zi(qi[t]) : t === "transparent" ? new Pt(NaN, NaN, NaN, 0) : null; -} -function zi(t) { - return new Pt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); -} -function kn(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new Pt(t, e, n, r); -} -function Yu(t) { - return t instanceof wn || (t = Pe(t)), t ? (t = t.rgb(), new Pt(t.r, t.g, t.b, t.opacity)) : new Pt(); -} -function Hr(t, e, n, r) { - return arguments.length === 1 ? Yu(t) : new Pt(t, e, n, r ?? 1); -} -function Pt(t, e, n, r) { - this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; -} -di(Pt, Hr, Qs(wn, { - brighter(t) { - return t = t == null ? Zn : Math.pow(Zn, t), new Pt(this.r * t, this.g * t, this.b * t, this.opacity); - }, - darker(t) { - return t = t == null ? dn : Math.pow(dn, t), new Pt(this.r * t, this.g * t, this.b * t, this.opacity); - }, - rgb() { - return this; - }, - clamp() { - return new Pt(Oe(this.r), Oe(this.g), Oe(this.b), jn(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: Bi, - // Deprecated! Use color.formatHex. - formatHex: Bi, - formatHex8: Uu, - formatRgb: Yi, - toString: Yi -})); -function Bi() { - return `#${Te(this.r)}${Te(this.g)}${Te(this.b)}`; -} -function Uu() { - return `#${Te(this.r)}${Te(this.g)}${Te(this.b)}${Te((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; -} -function Yi() { - const t = jn(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${Oe(this.r)}, ${Oe(this.g)}, ${Oe(this.b)}${t === 1 ? ")" : `, ${t})`}`; -} -function jn(t) { - return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); -} -function Oe(t) { - return Math.max(0, Math.min(255, Math.round(t) || 0)); -} -function Te(t) { - return t = Oe(t), (t < 16 ? "0" : "") + t.toString(16); -} -function Ui(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Xt(t, e, n, r); -} -function ta(t) { - if (t instanceof Xt) return new Xt(t.h, t.s, t.l, t.opacity); - if (t instanceof wn || (t = Pe(t)), !t) return new Xt(); - if (t instanceof Xt) 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, f = (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 /= f < 0.5 ? s + i : 2 - s - i, a *= 60) : o = f > 0 && f < 1 ? 0 : a, new Xt(a, o, f, t.opacity); -} -function Xu(t, e, n, r) { - return arguments.length === 1 ? ta(t) : new Xt(t, e, n, r ?? 1); -} -function Xt(t, e, n, r) { - this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; -} -di(Xt, Xu, Qs(wn, { - brighter(t) { - return t = t == null ? Zn : Math.pow(Zn, t), new Xt(this.h, this.s, this.l * t, this.opacity); - }, - darker(t) { - return t = t == null ? dn : Math.pow(dn, t), new Xt(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 Pt( - Rr(t >= 240 ? t - 240 : t + 120, i, r), - Rr(t, i, r), - Rr(t < 120 ? t + 240 : t - 120, i, r), - this.opacity - ); - }, - clamp() { - return new Xt(Xi(this.h), En(this.s), En(this.l), jn(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 = jn(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${Xi(this.h)}, ${En(this.s) * 100}%, ${En(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; - } -})); -function Xi(t) { - return t = (t || 0) % 360, t < 0 ? t + 360 : t; -} -function En(t) { - return Math.max(0, Math.min(1, t || 0)); -} -function Rr(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 hi = (t) => () => t; -function Gu(t, e) { - return function(n) { - return t + n * e; - }; -} -function Wu(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 Ku(t) { - return (t = +t) == 1 ? ea : function(e, n) { - return n - e ? Wu(e, n, t) : hi(isNaN(e) ? n : e); - }; -} -function ea(t, e) { - var n = e - t; - return n ? Gu(t, n) : hi(isNaN(t) ? e : t); -} -const Qn = function t(e) { - var n = Ku(e); - function r(i, s) { - var a = n((i = Hr(i)).r, (s = Hr(s)).r), o = n(i.g, s.g), f = n(i.b, s.b), u = ea(i.opacity, s.opacity); - return function(l) { - return i.r = a(l), i.g = o(l), i.b = f(l), i.opacity = u(l), i + ""; - }; - } - return r.gamma = t, r; -}(1); -function Ju(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 Zu(t) { - return ArrayBuffer.isView(t) && !(t instanceof DataView); -} -function ju(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] = ze(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 Qu(t, e) { - var n = /* @__PURE__ */ new Date(); - return t = +t, e = +e, function(r) { - return n.setTime(t * (1 - r) + e * r), n; - }; -} -function jt(t, e) { - return t = +t, e = +e, function(n) { - return t * (1 - n) + e * n; - }; -} -function tf(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] = ze(t[i], e[i]) : r[i] = e[i]; - return function(s) { - for (i in n) r[i] = n[i](s); - return r; - }; -} -var zr = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Nr = new RegExp(zr.source, "g"); -function ef(t) { - return function() { - return t; - }; -} -function nf(t) { - return function(e) { - return t(e) + ""; - }; -} -function na(t, e) { - var n = zr.lastIndex = Nr.lastIndex = 0, r, i, s, a = -1, o = [], f = []; - for (t = t + "", e = e + ""; (r = zr.exec(t)) && (i = Nr.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, f.push({ i: a, x: jt(r, i) })), n = Nr.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? f[0] ? nf(f[0].x) : ef(e) : (e = f.length, function(u) { - for (var l = 0, h; l < e; ++l) o[(h = f[l]).i] = h.x(u); - return o.join(""); - }); -} -function ze(t, e) { - var n = typeof e, r; - return e == null || n === "boolean" ? hi(e) : (n === "number" ? jt : n === "string" ? (r = Pe(e)) ? (e = r, Qn) : na : e instanceof Pe ? Qn : e instanceof Date ? Qu : Zu(e) ? Ju : Array.isArray(e) ? ju : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? tf : jt)(t, e); -} -var Gi = 180 / Math.PI, Br = { - translateX: 0, - translateY: 0, - rotate: 0, - skewX: 0, - scaleX: 1, - scaleY: 1 -}; -function ra(t, e, n, r, i, s) { - var a, o, f; - return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (f = t * n + e * r) && (n -= t * f, r -= e * f), (o = Math.sqrt(n * n + r * r)) && (n /= o, r /= o, f /= o), t * r < e * n && (t = -t, e = -e, f = -f, a = -a), { - translateX: i, - translateY: s, - rotate: Math.atan2(e, t) * Gi, - skewX: Math.atan(f) * Gi, - scaleX: a, - scaleY: o - }; -} -var Rn; -function rf(t) { - const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? Br : ra(e.a, e.b, e.c, e.d, e.e, e.f); -} -function sf(t) { - return t == null || (Rn || (Rn = document.createElementNS("http://www.w3.org/2000/svg", "g")), Rn.setAttribute("transform", t), !(t = Rn.transform.baseVal.consolidate())) ? Br : (t = t.matrix, ra(t.a, t.b, t.c, t.d, t.e, t.f)); -} -function ia(t, e, n, r) { - function i(u) { - return u.length ? u.pop() + " " : ""; - } - function s(u, l, h, c, d, p) { - if (u !== h || l !== c) { - var _ = d.push("translate(", null, e, null, n); - p.push({ i: _ - 4, x: jt(u, h) }, { i: _ - 2, x: jt(l, c) }); - } else (h || c) && d.push("translate(" + h + e + c + n); - } - function a(u, l, h, c) { - u !== l ? (u - l > 180 ? l += 360 : l - u > 180 && (u += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: jt(u, l) })) : l && h.push(i(h) + "rotate(" + l + r); - } - function o(u, l, h, c) { - u !== l ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: jt(u, l) }) : l && h.push(i(h) + "skewX(" + l + r); - } - function f(u, l, h, c, d, p) { - if (u !== h || l !== c) { - var _ = d.push(i(d) + "scale(", null, ",", null, ")"); - p.push({ i: _ - 4, x: jt(u, h) }, { i: _ - 2, x: jt(l, c) }); - } else (h !== 1 || c !== 1) && d.push(i(d) + "scale(" + h + "," + c + ")"); - } - return function(u, l) { - var h = [], c = []; - return u = t(u), l = t(l), s(u.translateX, u.translateY, l.translateX, l.translateY, h, c), a(u.rotate, l.rotate, h, c), o(u.skewX, l.skewX, h, c), f(u.scaleX, u.scaleY, l.scaleX, l.scaleY, h, c), u = l = null, function(d) { - for (var p = -1, _ = c.length, m; ++p < _; ) h[(m = c[p]).i] = m.x(d); - return h.join(""); - }; - }; -} -var af = ia(rf, "px, ", "px)", "deg)"), of = ia(sf, ", ", ")", ")"), Ge = 0, nn = 0, Qe = 0, sa = 1e3, tr, rn, er = 0, De = 0, yr = 0, vn = typeof performance == "object" && performance.now ? performance : Date, aa = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { - setTimeout(t, 17); -}; -function vi() { - return De || (aa(lf), De = vn.now() + yr); -} -function lf() { - De = 0; -} -function nr() { - this._call = this._time = this._next = null; -} -nr.prototype = oa.prototype = { - constructor: nr, - restart: function(t, e, n) { - if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? vi() : +n) + (e == null ? 0 : +e), !this._next && rn !== this && (rn ? rn._next = this : tr = this, rn = this), this._call = t, this._time = n, Yr(); - }, - stop: function() { - this._call && (this._call = null, this._time = 1 / 0, Yr()); - } -}; -function oa(t, e, n) { - var r = new nr(); - return r.restart(t, e, n), r; -} -function uf() { - vi(), ++Ge; - for (var t = tr, e; t; ) - (e = De - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --Ge; -} -function Wi() { - De = (er = vn.now()) + yr, Ge = nn = 0; - try { - uf(); - } finally { - Ge = 0, cf(), De = 0; - } -} -function ff() { - var t = vn.now(), e = t - er; - e > sa && (yr -= e, er = t); -} -function cf() { - for (var t, e = tr, 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 : tr = n); - rn = t, Yr(r); -} -function Yr(t) { - if (!Ge) { - nn && (nn = clearTimeout(nn)); - var e = t - De; - e > 24 ? (t < 1 / 0 && (nn = setTimeout(Wi, t - vn.now() - yr)), Qe && (Qe = clearInterval(Qe))) : (Qe || (er = vn.now(), Qe = setInterval(ff, sa)), Ge = 1, aa(Wi)); - } -} -function Ki(t, e, n) { - var r = new nr(); - return e = e == null ? 0 : +e, r.restart((i) => { - r.stop(), t(i + e); - }, e, n), r; -} -var df = Vs("start", "end", "cancel", "interrupt"), hf = [], la = 0, Ji = 1, Ur = 2, On = 3, Zi = 4, Xr = 5, Pn = 6; -function wr(t, e, n, r, i, s) { - var a = t.__transition; - if (!a) t.__transition = {}; - else if (n in a) return; - vf(t, n, { - name: e, - index: r, - // For context during callback. - group: i, - // For context during callback. - on: df, - tween: hf, - time: s.time, - delay: s.delay, - duration: s.duration, - ease: s.ease, - timer: null, - state: la - }); -} -function pi(t, e) { - var n = Kt(t, e); - if (n.state > la) throw new Error("too late; already scheduled"); - return n; -} -function se(t, e) { - var n = Kt(t, e); - if (n.state > On) throw new Error("too late; already running"); - return n; -} -function Kt(t, e) { - var n = t.__transition; - if (!n || !(n = n[e])) throw new Error("transition not found"); - return n; -} -function vf(t, e, n) { - var r = t.__transition, i; - r[e] = n, n.timer = oa(s, 0, n.time); - function s(u) { - n.state = Ji, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); - } - function a(u) { - var l, h, c, d; - if (n.state !== Ji) return f(); - for (l in r) - if (d = r[l], d.name === n.name) { - if (d.state === On) return Ki(a); - d.state === Zi ? (d.state = Pn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[l]) : +l < e && (d.state = Pn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[l]); - } - if (Ki(function() { - n.state === On && (n.state = Zi, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = Ur, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Ur) { - for (n.state = On, i = new Array(c = n.tween.length), l = 0, h = -1; l < c; ++l) - (d = n.tween[l].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d); - i.length = h + 1; - } - } - function o(u) { - for (var l = u < n.duration ? n.ease.call(null, u / n.duration) : (n.timer.restart(f), n.state = Xr, 1), h = -1, c = i.length; ++h < c; ) - i[h].call(t, l); - n.state === Xr && (n.on.call("end", t, t.__data__, n.index, n.group), f()); - } - function f() { - n.state = Pn, n.timer.stop(), delete r[e]; - for (var u in r) return; - delete t.__transition; - } -} -function pf(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 > Ur && r.state < Xr, r.state = Pn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; - } - s && delete t.__transition; - } -} -function gf(t) { - return this.each(function() { - pf(this, t); - }); -} -function _f(t, e) { - var n, r; - return function() { - var i = se(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 mf(t, e, n) { - var r, i; - if (typeof n != "function") throw new Error(); - return function() { - var s = se(this, t), a = s.tween; - if (a !== r) { - i = (r = a).slice(); - for (var o = { name: e, value: n }, f = 0, u = i.length; f < u; ++f) - if (i[f].name === e) { - i[f] = o; - break; - } - f === u && i.push(o); - } - s.tween = i; - }; -} -function yf(t, e) { - var n = this._id; - if (t += "", arguments.length < 2) { - for (var r = Kt(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 ? _f : mf)(n, t, e)); -} -function gi(t, e, n) { - var r = t._id; - return t.each(function() { - var i = se(this, r); - (i.value || (i.value = {}))[e] = n.apply(this, arguments); - }), function(i) { - return Kt(i, r).value[e]; - }; -} -function ua(t, e) { - var n; - return (typeof e == "number" ? jt : e instanceof Pe ? Qn : (n = Pe(e)) ? (e = n, Qn) : na)(t, e); -} -function wf(t) { - return function() { - this.removeAttribute(t); - }; -} -function xf(t) { - return function() { - this.removeAttributeNS(t.space, t.local); - }; -} -function bf(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 $f(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 Af(t, e, n) { - var r, i, s; - return function() { - var a, o = n(this), f; - return o == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), f = o + "", a === f ? null : a === r && f === i ? s : (i = f, s = e(r = a, o))); - }; -} -function kf(t, e, n) { - var r, i, s; - return function() { - var a, o = n(this), f; - return o == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), f = o + "", a === f ? null : a === r && f === i ? s : (i = f, s = e(r = a, o))); - }; -} -function Ef(t, e) { - var n = mr(t), r = n === "transform" ? of : ua; - return this.attrTween(t, typeof e == "function" ? (n.local ? kf : Af)(n, r, gi(this, "attr." + t, e)) : e == null ? (n.local ? xf : wf)(n) : (n.local ? $f : bf)(n, r, e)); -} -function Rf(t, e) { - return function(n) { - this.setAttribute(t, e.call(this, n)); - }; -} -function Nf(t, e) { - return function(n) { - this.setAttributeNS(t.space, t.local, e.call(this, n)); - }; -} -function Tf(t, e) { - var n, r; - function i() { - var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Nf(t, s)), n; - } - return i._value = e, i; -} -function Sf(t, e) { - var n, r; - function i() { - var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Rf(t, s)), n; - } - return i._value = e, i; -} -function Cf(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 = mr(t); - return this.tween(n, (r.local ? Tf : Sf)(r, e)); -} -function Mf(t, e) { - return function() { - pi(this, t).delay = +e.apply(this, arguments); - }; -} -function Of(t, e) { - return e = +e, function() { - pi(this, t).delay = e; - }; -} -function Pf(t) { - var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Mf : Of)(e, t)) : Kt(this.node(), e).delay; -} -function Df(t, e) { - return function() { - se(this, t).duration = +e.apply(this, arguments); - }; -} -function If(t, e) { - return e = +e, function() { - se(this, t).duration = e; - }; -} -function Ff(t) { - var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Df : If)(e, t)) : Kt(this.node(), e).duration; -} -function Lf(t, e) { - if (typeof e != "function") throw new Error(); - return function() { - se(this, t).ease = e; - }; -} -function qf(t) { - var e = this._id; - return arguments.length ? this.each(Lf(e, t)) : Kt(this.node(), e).ease; -} -function Vf(t, e) { - return function() { - var n = e.apply(this, arguments); - if (typeof n != "function") throw new Error(); - se(this, t).ease = n; - }; -} -function Hf(t) { - if (typeof t != "function") throw new Error(); - return this.each(Vf(this._id, t)); -} -function zf(t) { - typeof t != "function" && (t = Bs(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] = [], f, u = 0; u < a; ++u) - (f = s[u]) && t.call(f, f.__data__, u, s) && o.push(f); - return new ge(r, this._parents, this._name, this._id); -} -function Bf(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 f = e[o], u = n[o], l = f.length, h = a[o] = new Array(l), c, d = 0; d < l; ++d) - (c = f[d] || u[d]) && (h[d] = c); - for (; o < r; ++o) - a[o] = e[o]; - return new ge(a, this._parents, this._name, this._id); -} -function Yf(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 Uf(t, e, n) { - var r, i, s = Yf(e) ? pi : se; - return function() { - var a = s(this, t), o = a.on; - o !== r && (i = (r = o).copy()).on(e, n), a.on = i; - }; -} -function Xf(t, e) { - var n = this._id; - return arguments.length < 2 ? Kt(this.node(), n).on.on(t) : this.each(Uf(n, t, e)); -} -function Gf(t) { - return function() { - var e = this.parentNode; - for (var n in this.__transition) if (+n !== t) return; - e && e.removeChild(this); - }; -} -function Wf() { - return this.on("end.remove", Gf(this._id)); -} -function Kf(t) { - var e = this._name, n = this._id; - typeof t != "function" && (t = fi(t)); - for (var r = this._groups, i = r.length, s = new Array(i), a = 0; a < i; ++a) - for (var o = r[a], f = o.length, u = s[a] = new Array(f), l, h, c = 0; c < f; ++c) - (l = o[c]) && (h = t.call(l, l.__data__, c, o)) && ("__data__" in l && (h.__data__ = l.__data__), u[c] = h, wr(u[c], e, n, c, u, Kt(l, n))); - return new ge(s, this._parents, e, n); -} -function Jf(t) { - var e = this._name, n = this._id; - typeof t != "function" && (t = zs(t)); - for (var r = this._groups, i = r.length, s = [], a = [], o = 0; o < i; ++o) - for (var f = r[o], u = f.length, l, h = 0; h < u; ++h) - if (l = f[h]) { - for (var c = t.call(l, l.__data__, h, f), d, p = Kt(l, n), _ = 0, m = c.length; _ < m; ++_) - (d = c[_]) && wr(d, e, n, _, c, p); - s.push(c), a.push(l); - } - return new ge(s, a, e, n); -} -var Zf = Je.prototype.constructor; -function jf() { - return new Zf(this._groups, this._parents); -} -function Qf(t, e) { - var n, r, i; - return function() { - var s = Xe(this, t), a = (this.style.removeProperty(t), Xe(this, t)); - return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); - }; -} -function fa(t) { - return function() { - this.style.removeProperty(t); - }; -} -function tc(t, e, n) { - var r, i = n + "", s; - return function() { - var a = Xe(this, t); - return a === i ? null : a === r ? s : s = e(r = a, n); - }; -} -function ec(t, e, n) { - var r, i, s; - return function() { - var a = Xe(this, t), o = n(this), f = o + ""; - return o == null && (f = o = (this.style.removeProperty(t), Xe(this, t))), a === f ? null : a === r && f === i ? s : (i = f, s = e(r = a, o)); - }; -} -function nc(t, e) { - var n, r, i, s = "style." + e, a = "end." + s, o; - return function() { - var f = se(this, t), u = f.on, l = f.value[s] == null ? o || (o = fa(e)) : void 0; - (u !== n || i !== l) && (r = (n = u).copy()).on(a, i = l), f.on = r; - }; -} -function rc(t, e, n) { - var r = (t += "") == "transform" ? af : ua; - return e == null ? this.styleTween(t, Qf(t, r)).on("end.style." + t, fa(t)) : typeof e == "function" ? this.styleTween(t, ec(t, r, gi(this, "style." + t, e))).each(nc(this._id, t)) : this.styleTween(t, tc(t, r, e), n).on("end.style." + t, null); -} -function ic(t, e, n) { - return function(r) { - this.style.setProperty(t, e.call(this, r), n); - }; -} -function sc(t, e, n) { - var r, i; - function s() { - var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && ic(t, a, n)), r; - } - return s._value = e, s; -} -function ac(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, sc(t, e, n ?? "")); -} -function oc(t) { - return function() { - this.textContent = t; - }; -} -function lc(t) { - return function() { - var e = t(this); - this.textContent = e ?? ""; - }; -} -function uc(t) { - return this.tween("text", typeof t == "function" ? lc(gi(this, "text", t)) : oc(t == null ? "" : t + "")); -} -function fc(t) { - return function(e) { - this.textContent = t.call(this, e); - }; -} -function cc(t) { - var e, n; - function r() { - var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && fc(i)), e; - } - return r._value = t, r; -} -function dc(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, cc(t)); -} -function hc() { - for (var t = this._name, e = this._id, n = ca(), r = this._groups, i = r.length, s = 0; s < i; ++s) - for (var a = r[s], o = a.length, f, u = 0; u < o; ++u) - if (f = a[u]) { - var l = Kt(f, e); - wr(f, t, n, u, a, { - time: l.time + l.delay + l.duration, - delay: 0, - duration: l.duration, - ease: l.ease - }); - } - return new ge(r, this._parents, t, n); -} -function vc() { - var t, e, n = this, r = n._id, i = n.size(); - return new Promise(function(s, a) { - var o = { value: a }, f = { value: function() { - --i === 0 && s(); - } }; - n.each(function() { - var u = se(this, r), l = u.on; - l !== t && (e = (t = l).copy(), e._.cancel.push(o), e._.interrupt.push(o), e._.end.push(f)), u.on = e; - }), i === 0 && s(); - }); -} -var pc = 0; -function ge(t, e, n, r) { - this._groups = t, this._parents = e, this._name = n, this._id = r; -} -function Dn(t) { - return Je().transition(t); -} -function ca() { - return ++pc; -} -var oe = Je.prototype; -ge.prototype = Dn.prototype = { - constructor: ge, - select: Kf, - selectAll: Jf, - selectChild: oe.selectChild, - selectChildren: oe.selectChildren, - filter: zf, - merge: Bf, - selection: jf, - transition: hc, - call: oe.call, - nodes: oe.nodes, - node: oe.node, - size: oe.size, - empty: oe.empty, - each: oe.each, - on: Xf, - attr: Ef, - attrTween: Cf, - style: rc, - styleTween: ac, - text: uc, - textTween: dc, - remove: Wf, - tween: yf, - delay: Pf, - duration: Ff, - ease: qf, - easeVarying: Hf, - end: vc, - [Symbol.iterator]: oe[Symbol.iterator] -}; -function gc(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; -} -var _c = { - time: null, - // Set on use. - delay: 0, - duration: 250, - ease: gc -}; -function mc(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 yc(t) { - var e, n; - t instanceof ge ? (e = t._id, t = t._name) : (e = ca(), (n = _c).time = vi(), 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, f, u = 0; u < o; ++u) - (f = a[u]) && wr(f, t, e, u, a, n || mc(f, e)); - return new ge(r, this._parents, t, e); -} -Je.prototype.interrupt = gf; -Je.prototype.transition = yc; -const Gr = Math.PI, Wr = 2 * Gr, Re = 1e-6, wc = Wr - Re; -function da(t) { - this._ += t[0]; - for (let e = 1, n = t.length; e < n; ++e) - this._ += arguments[e] + t[e]; -} -function xc(t) { - let e = Math.floor(t); - if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return da; - 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 bc { - constructor(e) { - this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? da : xc(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, f = r - e, u = i - n, l = a - e, h = o - n, c = l * l + h * h; - if (this._x1 === null) - this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > Re) if (!(Math.abs(h * f - u * l) > Re) || !s) - this._append`L${this._x1 = e},${this._y1 = n}`; - else { - let d = r - a, p = i - o, _ = f * f + u * u, m = d * d + p * p, w = Math.sqrt(_), $ = Math.sqrt(c), y = s * Math.tan((Gr - Math.acos((_ + c - m) / (2 * w * $))) / 2), x = y / $, E = y / w; - Math.abs(x - 1) > Re && this._append`L${e + x * l},${n + x * h}`, this._append`A${s},${s},0,0,${+(h * d > l * p)},${this._x1 = e + E * f},${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), f = r * Math.sin(i), u = e + o, l = n + f, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${u},${l}` : (Math.abs(this._x1 - u) > Re || Math.abs(this._y1 - l) > Re) && this._append`L${u},${l}`, r && (c < 0 && (c = c % Wr + Wr), c > wc ? this._append`A${r},${r},0,1,${h},${e - o},${n - f}A${r},${r},0,1,${h},${this._x1 = u},${this._y1 = l}` : c > Re && this._append`A${r},${r},0,${+(c >= Gr)},${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 $c(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 Ac = $c("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Rt(t) { - return function() { - return t; - }; -} -const ji = Math.abs, At = Math.atan2, Ee = Math.cos, kc = Math.max, Tr = Math.min, Zt = Math.sin, Be = Math.sqrt, Ot = 1e-12, pn = Math.PI, rr = pn / 2, In = 2 * pn; -function Ec(t) { - return t > 1 ? 0 : t < -1 ? pn : Math.acos(t); -} -function Qi(t) { - return t >= 1 ? rr : t <= -1 ? -rr : Math.asin(t); -} -function Rc(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 bc(e); -} -function Nc(t) { - return t.innerRadius; -} -function Tc(t) { - return t.outerRadius; -} -function Sc(t) { - return t.startAngle; -} -function Cc(t) { - return t.endAngle; -} -function Mc(t) { - return t && t.padAngle; -} -function Oc(t, e, n, r, i, s, a, o) { - var f = n - t, u = r - e, l = a - i, h = o - s, c = h * f - l * u; - if (!(c * c < Ot)) - return c = (l * (e - s) - h * (t - i)) / c, [t + c * f, e + c * u]; -} -function Nn(t, e, n, r, i, s, a) { - var o = t - n, f = e - r, u = (a ? s : -s) / Be(o * o + f * f), l = u * f, h = -u * o, c = t + l, d = e + h, p = n + l, _ = r + h, m = (c + p) / 2, w = (d + _) / 2, $ = p - c, y = _ - d, x = $ * $ + y * y, E = i - s, b = c * _ - p * d, T = (y < 0 ? -1 : 1) * Be(kc(0, E * E * x - b * b)), P = (b * y - $ * T) / x, K = (-b * $ - y * T) / x, rt = (b * y + $ * T) / x, J = (-b * $ + y * T) / x, ot = P - m, C = K - w, O = rt - m, xt = J - w; - return ot * ot + C * C > O * O + xt * xt && (P = rt, K = J), { - cx: P, - cy: K, - x01: -l, - y01: -h, - x11: P * (i / E - 1), - y11: K * (i / E - 1) - }; -} -function le() { - var t = Nc, e = Tc, n = Rt(0), r = null, i = Sc, s = Cc, a = Mc, o = null, f = Rc(u); - function u() { - var l, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - rr, _ = s.apply(this, arguments) - rr, m = ji(_ - p), w = _ > p; - if (o || (o = l = f()), d < c && (h = d, d = c, c = h), !(d > Ot)) o.moveTo(0, 0); - else if (m > In - Ot) - o.moveTo(d * Ee(p), d * Zt(p)), o.arc(0, 0, d, p, _, !w), c > Ot && (o.moveTo(c * Ee(_), c * Zt(_)), o.arc(0, 0, c, _, p, w)); - else { - var $ = p, y = _, x = p, E = _, b = m, T = m, P = a.apply(this, arguments) / 2, K = P > Ot && (r ? +r.apply(this, arguments) : Be(c * c + d * d)), rt = Tr(ji(d - c) / 2, +n.apply(this, arguments)), J = rt, ot = rt, C, O; - if (K > Ot) { - var xt = Qi(K / c * Zt(P)), _t = Qi(K / d * Zt(P)); - (b -= xt * 2) > Ot ? (xt *= w ? 1 : -1, x += xt, E -= xt) : (b = 0, x = E = (p + _) / 2), (T -= _t * 2) > Ot ? (_t *= w ? 1 : -1, $ += _t, y -= _t) : (T = 0, $ = y = (p + _) / 2); - } - var yt = d * Ee($), pt = d * Zt($), Lt = c * Ee(E), R = c * Zt(E); - if (rt > Ot) { - var q = d * Ee(y), N = d * Zt(y), ut = c * Ee(x), U = c * Zt(x), j; - if (m < pn) - if (j = Oc(yt, pt, ut, U, q, N, Lt, R)) { - var ct = yt - j[0], W = pt - j[1], ft = q - j[0], St = N - j[1], A = 1 / Zt(Ec((ct * ft + W * St) / (Be(ct * ct + W * W) * Be(ft * ft + St * St))) / 2), z = Be(j[0] * j[0] + j[1] * j[1]); - J = Tr(rt, (c - z) / (A - 1)), ot = Tr(rt, (d - z) / (A + 1)); - } else - J = ot = 0; - } - T > Ot ? ot > Ot ? (C = Nn(ut, U, yt, pt, d, ot, w), O = Nn(q, N, Lt, R, d, ot, w), o.moveTo(C.cx + C.x01, C.cy + C.y01), ot < rt ? o.arc(C.cx, C.cy, ot, At(C.y01, C.x01), At(O.y01, O.x01), !w) : (o.arc(C.cx, C.cy, ot, At(C.y01, C.x01), At(C.y11, C.x11), !w), o.arc(0, 0, d, At(C.cy + C.y11, C.cx + C.x11), At(O.cy + O.y11, O.cx + O.x11), !w), o.arc(O.cx, O.cy, ot, At(O.y11, O.x11), At(O.y01, O.x01), !w))) : (o.moveTo(yt, pt), o.arc(0, 0, d, $, y, !w)) : o.moveTo(yt, pt), !(c > Ot) || !(b > Ot) ? o.lineTo(Lt, R) : J > Ot ? (C = Nn(Lt, R, q, N, c, -J, w), O = Nn(yt, pt, ut, U, c, -J, w), o.lineTo(C.cx + C.x01, C.cy + C.y01), J < rt ? o.arc(C.cx, C.cy, J, At(C.y01, C.x01), At(O.y01, O.x01), !w) : (o.arc(C.cx, C.cy, J, At(C.y01, C.x01), At(C.y11, C.x11), !w), o.arc(0, 0, c, At(C.cy + C.y11, C.cx + C.x11), At(O.cy + O.y11, O.cx + O.x11), w), o.arc(O.cx, O.cy, J, At(O.y11, O.x11), At(O.y01, O.x01), !w))) : o.arc(0, 0, c, E, x, w); - } - if (o.closePath(), l) return o = null, l + "" || null; - } - return u.centroid = function() { - var l = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - pn / 2; - return [Ee(h) * l, Zt(h) * l]; - }, u.innerRadius = function(l) { - return arguments.length ? (t = typeof l == "function" ? l : Rt(+l), u) : t; - }, u.outerRadius = function(l) { - return arguments.length ? (e = typeof l == "function" ? l : Rt(+l), u) : e; - }, u.cornerRadius = function(l) { - return arguments.length ? (n = typeof l == "function" ? l : Rt(+l), u) : n; - }, u.padRadius = function(l) { - return arguments.length ? (r = l == null ? null : typeof l == "function" ? l : Rt(+l), u) : r; - }, u.startAngle = function(l) { - return arguments.length ? (i = typeof l == "function" ? l : Rt(+l), u) : i; - }, u.endAngle = function(l) { - return arguments.length ? (s = typeof l == "function" ? l : Rt(+l), u) : s; - }, u.padAngle = function(l) { - return arguments.length ? (a = typeof l == "function" ? l : Rt(+l), u) : a; - }, u.context = function(l) { - return arguments.length ? (o = l ?? null, u) : o; - }, u; -} -function Pc(t) { - return typeof t == "object" && "length" in t ? t : Array.from(t); -} -function Dc(t, e) { - return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; -} -function Ic(t) { - return t; -} -function Sr() { - var t = Ic, e = Dc, n = null, r = Rt(0), i = Rt(In), s = Rt(0); - function a(o) { - var f, u = (o = Pc(o)).length, l, h, c = 0, d = new Array(u), p = new Array(u), _ = +r.apply(this, arguments), m = Math.min(In, Math.max(-In, i.apply(this, arguments) - _)), w, $ = Math.min(Math.abs(m) / u, s.apply(this, arguments)), y = $ * (m < 0 ? -1 : 1), x; - for (f = 0; f < u; ++f) - (x = p[d[f] = f] = +t(o[f], f, o)) > 0 && (c += x); - for (e != null ? d.sort(function(E, b) { - return e(p[E], p[b]); - }) : n != null && d.sort(function(E, b) { - return n(o[E], o[b]); - }), f = 0, h = c ? (m - u * y) / c : 0; f < u; ++f, _ = w) - l = d[f], x = p[l], w = _ + (x > 0 ? x * h : 0) + y, p[l] = { - data: o[l], - index: f, - value: x, - startAngle: _, - endAngle: w, - padAngle: $ - }; - return p; - } - return a.value = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : Rt(+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 : Rt(+o), a) : r; - }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Rt(+o), a) : i; - }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Rt(+o), a) : s; - }, a; -} -function sn(t, e, n) { - this.k = t, this.x = e, this.y = n; -} -sn.prototype = { - constructor: sn, - scale: function(t) { - return t === 1 ? this : new sn(this.k * t, this.x, this.y); - }, - translate: function(t, e) { - return t === 0 & e === 0 ? this : new sn(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 + ")"; - } -}; -sn.prototype; -const Ne = {}, Kr = "No Further Rankings"; -function ir(t, e) { - let n = 0; - for (let r = 1; r < e; r++) { - const i = t.results[r - 1].tallyResults; - for (let s = 0; s < i.length; s++) { - const a = i[s].transfers; - if (a) { - const o = a.exhausted; - o && (n += Number(o)); - } - } - } - return n; -} -function ha(t, e, n) { - if (e < 1) - return []; - const r = t.results[e - 1].tallyResults, i = []; - for (let s = 0; s < r.length; s++) { - const a = r[s][n]; - a != null && i.push(a); - } - return i; -} -function sr(t, e) { - return ha(t, e, "eliminated"); -} -function ar(t, e) { - let n = []; - for (let r = 1; r <= e; r++) - n = n.concat(ha(t, r, "elected")); - return n; -} -var Fc = /* @__PURE__ */ Io(''); -const Lc = { hash: "svelte-3kpd", code: "" }; -function va(t, e) { - mn(e, !0), gr(t, Lc); - let n = wt(e, "jsonData", 7), r = wt(e, "round", 15), i = wt(e, "mouseEventType", 15), s = wt(e, "mouseData", 15), a = wt(e, "mouseY", 15), o = wt(e, "animateOneRound", 15), f = wt(e, "animateOnePhase", 15), u = wt(e, "runFullAnimation", 15), l = wt(e, "setRound", 15); - const h = 800, c = 800, d = Math.min(h, c) * 0.3, p = h / 2, _ = c / 2, m = "Pie", w = "Donut", $ = "TextLayer", y = "#transfer", x = "url(#cross-hatch)", E = 1.15, b = 0.1, T = 750, P = 800; - let K = [], rt = [], J = [], ot = 0, C = st(0), O = st(null); - function xt() { - const g = bt(v(O)); - g.select("#" + m).remove(), g.select("#" + w).remove(), g.select("#" + $).remove(); - } - function _t() { - xt(), J = yt(), K = ba(m, J, p, _, 0, pt()); - } - ui(() => { - console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), o($t), f(ht), u(dt), l(we), ct(), _t(); - }); - function yt() { - const g = j(r()); - return ot = ut(r()), g; - } - function pt() { - return d; - } - function Lt() { - return pt() * 1.41; - } - function R(g, k) { - if (g === "exhausted") return ir(n(), k); - { - const S = n().results[k - 1].tally; - return Number(S[g]); - } - } - function q(g, k) { - return R(g, k).toLocaleString("en-US"); - } - function N(g, k) { - return (R(g, k) / ot).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); - } - function ut(g) { - const k = n().results[g - 1].tally; - let S = 0; - for (let [Y, D] of Object.entries(k)) - S += Number(D); - return S; - } - function U(g, k) { - const S = n().results[k - 1].tallyResults; - let Y = 0; - const D = S.findIndex((B) => (B == null ? void 0 : B.elected) && g == B.elected); - if (D >= 0) { - const B = S[D].transfers; - if (B) - for (let [H, L] of Object.entries(B)) Y += Number(L); - } else - return 0; - return Y; - } - function j(g) { - const k = n().results; - let S = k[Math.max(0, g - 2)].tally; - const Y = [], D = []; - for (let [H, L] of Object.entries(S)) - Y.push({ label: H, value: 0 }); - S = k[g - 1].tally; - for (let H of Y) { - const L = Number(S[H.label]), G = U(H.label, g); - G > 0 ? (D.push({ - label: H.label + y, - value: G - }), H.value = L - G, D.push(H)) : (H.value = L, D.push(H)); - } - const B = ir(n(), g); - return D.push({ label: "exhausted", value: B }), D; - } - function ct() { - const g = bt(v(O)).select("defs").select("#cross-hatch"); - let k = 0; - for (let [S, Y] of Object.entries(n().results[0].tally)) { - k < 10 ? Ne[S] = Ac[k] : Ne[S] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), k++; - { - const D = g.clone(!0); - D.attr("id", S.replaceAll(" ", "-")).select("rect").attr("fill", Ne[S]), D.select("path").attr("stroke", "#505050"); - } - } - Ne.exhausted = x; - } - function W() { - bt(v(O)).select("#" + w).remove(); - } - function ft(g) { - console.log("animate phase 1"); - const k = Dn("global").duration(P); - g && k.on("end", g), W(), Le(), $a(), ka(0, pt()), mi(); - } - function St(g) { - console.log("animate phase 2"); - const k = Dn("global").duration(P); - g && k.on("end", g), ae(); - } - function A(g) { - console.log("animate phase 3"); - const k = Dn("global").duration(P); - g && k.on("end", g), Jo(r), qt(r()), Fe(pt()); - } - function z() { - it = !1; - } - let it = !1; - function dt() { - if (it) { - console.log("buttons locked out"); - return; - } - it = !0, X(); - } - function X() { - const g = r() < n().results.length - 1 ? X : z; - ft(() => { - St(() => { - A(g); - }); - }); - } - function $t() { - if (it) { - console.log("buttons locked out"); - return; - } - if (r() >= n().results.length) { - it = !1; - return; - } - it = !0, ft(() => { - St(() => { - A(z); - }); - }); - } - function ht() { - if (r() >= n().results.length) { - mi(), console.log("Finished at round ", r()); - return; - } - M(C, (v(C) + 1) % 3), it = !0, v(C) === 1 ? ft(z) : v(C) === 2 ? St(z) : v(C) === 0 ? A(z) : (it = !1, console.warn("displayPhase out of range at ", v(C))); - } - function qt(g) { - J = j(g), K = Ea(m, J, 0, pt(), !0); - } - function we(g) { - if (it) { - console.log("buttons locked out"); - return; - } - r(g), _t(); - } - function Fe(g, k) { - Sr().sort(null).value((L) => L.value); - const S = bt(v(O)).select("#" + w), Y = le().outerRadius(g).innerRadius(g - 1), D = S.selectAll(".slice"); - let B = D.size(); - function H() { - B--, B === 0 && Aa(); - } - D.select("path").transition("global").duration(T).attr("d", (L) => Y(L)).on("end", (L) => H()); - } - function Le() { - const g = ma(K); - rt = yi(w, g, p, _, pt(), Lt(), !1, !0); - } - function ae() { - const g = wa(rt, K); - rt = wi( - w, - g, - /* previousDonutInfoGlobal, */ - pt(), - Lt(), - !1 - ); - } - function ke(g) { - const k = g.data.label; - return Ne[k.split("#")[0]]; - } - function _a() { - const g = {}, k = n().results[r() - 1].tallyResults; - for (let S = 0; S < k.length; S++) { - let Y = k[S].eliminated; - if (Y === void 0 && (Y = k[S].elected), Y === void 0) { - console.warn("getTransferVotes: Eliminated and Elected undefined..."); - continue; - } - const D = k[S].transfers; - if (D === void 0) { - console.warn("getTransferVotes: transfers undefined..."); - continue; - } - for (let [B, H] of Object.entries(D)) - g[B] === void 0 ? g[B] = Number(H) : g[B] += Number(H); - } - return g; - } - function ma(g) { - const k = [], S = ot, Y = n().results[r() - 1].tallyResults; - for (let D = 0; D < Y.length; D++) { - let B = Y[D].eliminated; - if (B === void 0 && (B = Y[D].elected), B === void 0) { - console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); - continue; - } - const H = Y[D].transfers; - if (H === void 0) { - console.warn("makeDonutInfo: transfers undefined..."); - continue; - } - let L = g.find((V) => V.data.label == B + y); - L === void 0 && (L = g.find((V) => V.data.label == B)); - let G = 0; - if (L) G = L.startAngle; - else { - console.warn("makeDonutInfo: No transfers"); - continue; - } - for (let [V, Z] of Object.entries(H)) { - let vt; - const Jt = g.find((gt) => gt.data.label == V); - if (Jt) - vt = structuredClone(Jt); - else if (V == "exhausted") - vt = { - data: { label: V, value: Number(Z) }, - value: 0, - index: 0, - startAngle: 0, - endAngle: 0, - padAngle: 0 - }; - else if (V == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", Z); - continue; - } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", V); - continue; - } - const I = Number(Z) / S * 2 * Math.PI; - vt.startAngle = G, G = vt.endAngle = G + I, vt.index = D, vt.data.label = `${vt.data.label}#${D}`, k.push(vt); - } - } - return k; - } - function ya(g, k, S) { - const Y = {}; - for (let [D, B] of Object.entries(g)) { - const H = S.find((V) => D == V.data.label); - if (H === void 0) { - console.warn("getTransferStartAngles: mainPieObj not found for ", D); - continue; - } - const L = (H.startAngle + H.endAngle) / 2, G = g[H.data.label] / k * 2 * Math.PI; - Y[H.data.label] = L - G / 2; - } - return Y; - } - function wa(g, k) { - const S = [], Y = ot, D = _a(), B = ya(D, Y, k); - for (let [H, L] of g.entries()) { - const G = structuredClone(L), V = L.endAngle - L.startAngle, Z = k.find((vt) => L.data.label.indexOf(vt.data.label) === 0); - if (Z) { - const vt = Z.data.label; - G.startAngle = B[vt], B[vt] += V, G.endAngle = G.startAngle + V; - } else if (L.data.label.indexOf("exhausted") === 0) - G.startAngle = L.startAngle, G.endAngle = L.endAngle; - else { - console.warn("updateDonutInfo: unrecognized slice name ", L.data.label); - continue; - } - G.index = H, S.push(G); - } - return S; - } - function _i(g, k, S, Y, D) { - const H = bt(v(O)).append("g").attr("id", $).attr("transform", `translate(${k}, ${S})`), L = le().innerRadius(Y * E).outerRadius(Y * E); - H.selectAll("text").data(g).enter().each(function(G) { - G.endAngle - G.startAngle < b || G.data.label.includes(y) || bt(this).append("g").attr("id", (V) => V.data.label).classed("eliminated", (V) => D.includes(V.data.label.split("#")[0]) || V.data.label.includes(y)).each(function(V, Z) { - V.data.label === "exhausted" && bt(this).on("mouseenter", (vt, Jt) => Ra(vt)).on("mouseleave", (vt, Jt) => Na()); - }).append("text").attr("transform", (V) => `translate(${L.centroid(V)})`).attr("text-anchor", (V) => xr(V.startAngle, V.endAngle)).text((V) => V.data.label === "exhausted" ? Kr : V.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((V) => q(V.data.label, r()) + " (" + N(V.data.label, r()) + ")"); - }); - } - function xa(g, k, S) { - const D = bt(v(O)).select("#" + $), B = D.selectAll("tspan"), H = D.selectAll("g").data(g, (Z) => Z.data.label).classed("eliminated", (Z) => S.includes(Z.data.label.split("#")[0]) || Z.data.label.includes(y)), L = le().innerRadius(k * E).outerRadius(k * E + 1); - B.transition("global").duration(T).attr("transform", (Z) => `translate(${L.centroid(Z)})`).attr("text-anchor", (Z) => xr(Z.startAngle, Z.endAngle)), H.select("text").transition("global").duration(T).attr("transform", (Z) => `translate(${L.centroid(Z)})`).attr("text-anchor", (Z) => xr(Z.startAngle, Z.endAngle)).on("end", (Z) => V()); - let G = H.size(); - function V(Z) { - G--, G === 0 && (D.remove(), _i(g, p, _, k, S)); - } - } - function ba(g, k, S, Y, D, B, H = !0, L = !1) { - const V = Sr().sort(null).value((Z) => Z.value)(k); - return yi(g, V, S, Y, D, B, H, L), V; - } - function mi() { - bt(v(O)).select("#" + m).selectAll(".elected").style("stroke", "darkblue").style("stroke-width", "2px"); - } - function yi(g, k, S, Y, D, B, H, L) { - const G = sr(n(), r()), V = ar(n(), r()), Jt = bt(v(O)).attr("width", "100%").attr("height", c).attr("viewBox", `0 0 ${h} ${c}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", g).attr("transform", `translate(${S}, ${Y})`).selectAll(".slice").data(k).enter().append("g").attr("class", "slice").classed("eliminated", (I) => G.includes(I.data.label.split("#")[0]) || I.data.label.includes(y)).classed("elected", (I) => V.includes(I.data.label.split("#")[0]) && !I.data.label.includes(y)).attr("id", (I) => I.data.label).on("mouseenter", (I, gt) => $r(I, gt)).on("mouseleave", (I, gt) => Ar(I, gt)), Ze = le().outerRadius(B).innerRadius(D); - if (L) { - const I = le().outerRadius(D + 1).innerRadius(D); - Jt.append("path").attr("d", I).transition("global").duration(T).attr("d", (gt) => Ze(gt)).attr("fill", (gt) => ke(gt)).on("end", (gt) => br()); - } else - Jt.append("path").attr("d", (I) => Ze(I)).attr("fill", (I) => ke(I)), br(); - return H && _i(k, S, Y, B, G), k; - } - function $a() { - const S = bt(v(O)).select("#" + $).selectAll(".eliminated"); - S.size() > 0 && S.classed("finished", !0); - } - function Aa() { - const S = bt(v(O)).select("#" + $).selectAll(".finished"); - S.size() > 0 && S.remove(); - } - function ka(g, k) { - const D = bt(v(O)).select("#" + m).selectAll(".eliminated"), B = le().innerRadius(g), H = le().outerRadius(k); - D.classed("finished", !0).select("path").transition("global").duration(T).attrTween("d", function(L) { - const G = ze(k, g); - return function(V) { - return H.innerRadius(G(V)), H(L); - }; - }).attr("fill", (L) => `url(#${L.data.label.split("#")[0].replaceAll(" ", "-")})`), D.clone(!0).classed("finished", !0).select("path").transition("global").duration(T).attrTween("d", function(L) { - const G = ze(k, g); - return function(V) { - return B.outerRadius(G(V)), B(L); - }; - }).attr("fill", (L) => ke(L)); - } - function xr(g, k) { - const S = (g + k) / 2; - return S > Math.PI * 11 / 6 || S < Math.PI * 1 / 6 || S > Math.PI * 5 / 6 && S < Math.PI * 7 / 6 ? "middle" : S < Math.PI ? "start" : "end"; - } - function br() { - bt(v(O)).select("#" + $).raise().append("g").remove(); - } - function Ea(g, k, S, Y, D) { - const H = Sr().sort(null).value((L) => L.value)(k); - return wi( - g, - H, - /* previousPieInfo, */ - S, - Y, - D - ), H; - } - function wi(g, k, S, Y, D) { - const B = sr(n(), r()), H = ar(n(), r()), L = le().outerRadius(Y).innerRadius(S).startAngle((I) => I.startAngle).endAngle((I) => I.endAngle), G = le().outerRadius(Y).innerRadius(S), Z = bt(v(O)).select("#" + g); - Z.selectAll(".slice").attr("prevStart", (I) => I.startAngle).attr("prevEnd", (I) => I.endAngle); - const vt = Z.selectAll(".slice").data(k, (I) => I.data.label); - vt.enter().append("g").attr("class", "slice").attr("id", (I) => I.data.label).classed("eliminated", !0).on("mouseenter", (I, gt) => $r(I, gt)).on("mouseleave", (I, gt) => Ar(I, gt)).append("path").attr("d", (I) => G(I)).attr("fill", (I) => ke(I)), vt.classed("eliminated", (I) => B.includes(I.data.label.split("#")[0])).classed("elected", (I) => H.includes(I.data.label.split("#")[0])).on("mouseenter", (I, gt) => $r(I, gt)).on("mouseleave", (I, gt) => Ar(I, gt)); - let Jt = vt.size(); - function Ze() { - Jt--, Jt <= 0 && (br(), Z.selectAll(".finished").remove()); - } - return vt.select("path").transition("global").duration(T).attrTween("d", function(I) { - const gt = Number(bt(this.parentNode).attr("prevStart")), Ta = Number(bt(this.parentNode).attr("prevEnd")), Sa = ze(gt, I.startAngle), Ca = ze(Ta, I.endAngle); - return (bi) => (L.startAngle(Sa(bi)).endAngle(Ca(bi)), L(I)); - }).on("end", Ze), D && xa(k, Y, B), k; - } - function $r(g, k) { - s(k.data.label.split("#")[0]), i("enter"), a(g.clientY); - } - function Ar(g, k) { - s(k.data.label.split("#")[0]), i("leave"); - } - function Ra(g, k) { - i("show-exhausted"), a(g.clientY); - } - function Na(g, k) { - i("hide-exhausted"); - } - var xi = Fc(); - return Kn(xi, (g) => M(O, g), () => v(O)), Nt(t, xi), yn({ - get jsonData() { - return n(); - }, - set jsonData(g) { - n(g), mt(); - }, - get round() { - return r(); - }, - set round(g) { - r(g), mt(); - }, - get mouseEventType() { - return i(); - }, - set mouseEventType(g) { - i(g), mt(); - }, - get mouseData() { - return s(); - }, - set mouseData(g) { - s(g), mt(); - }, - get mouseY() { - return a(); - }, - set mouseY(g) { - a(g), mt(); - }, - get animateOneRound() { - return o(); - }, - set animateOneRound(g) { - o(g), mt(); - }, - get animateOnePhase() { - return f(); - }, - set animateOnePhase(g) { - f(g), mt(); - }, - get runFullAnimation() { - return u(); - }, - set runFullAnimation(g) { - u(g), mt(); - }, - get setRound() { - return l(); - }, - set setRound(g) { - l(g), mt(); - } - }); -} -_r( - va, - { - jsonData: {}, - round: {}, - mouseEventType: {}, - mouseData: {}, - mouseY: {}, - animateOneRound: {}, - animateOnePhase: {}, - runFullAnimation: {}, - setRound: {} - }, - [], - [], - !0 -); -var qc = (t, e) => e(-1), Vc = (t, e, n) => e(v(n)), Hc = (t, e, n) => e(v(n)), zc = (t, e, n) => e(t, v(n)), Bc = /* @__PURE__ */ Bt(''), Yc = (t, e) => e(999), Uc = /* @__PURE__ */ Bt('
'); -const Xc = { - hash: "svelte-1vvdx9e", - code: `.nav-button.svelte-1vvdx9e {display:inline-flex;align-items:center;justify-content:center;padding:8px 12px;margin:0 5px;background-color:#f0f0f0;border:1px solid #ccc;border-radius:50%;cursor:pointer;font-size:1.2rem;font-weight:bolder;line-height:1;}.nav-button.svelte-1vvdx9e:disabled {opacity:0.5;cursor:not-allowed;}.nav-button.svelte-1vvdx9e:hover:not(:disabled) {background-color:#fff2cc; /* Match the hover color */} - -/* doesn't appear to make any difference */.centered-container.svelte-1vvdx9e {display:inline-block;margin:0 auto;text-align:center;max-width:100%;overflow-x:auto;} - -/* doesn't appear to make any difference */.round-labels-container.svelte-1vvdx9e {display:inline-flex;border:1px solid #ccc;border-radius:5px;background-color:#f9f9f9;overflow:hidden;max-width:calc(100% - 100px);overflow-x:auto;padding:2px;}.round-label.svelte-1vvdx9e {font-weight:normal;display:inline-block;padding:5px 8px;border-right:none;cursor:pointer;background-color:#f9f9f9;white-space:nowrap;min-width:30px;border:none;border-radius:5px;margin:0 1px;}.not-last-round.svelte-1vvdx9e {border-right:1px solid #ddd;}.current-round.svelte-1vvdx9e {font-weight:bold;color:white;background-color:#80b3ff; /* Paler blue */}.hovered-round.svelte-1vvdx9e {font-weight:bold;color:#0066cc;background-color:#fff2cc; /* Paler yellow */}.many-rounds.svelte-1vvdx9e {min-width:20px;}.outer-wrapper.svelte-1vvdx9e {width:100%;text-align:center;display:block;margin:0 auto;} - - /* Focus style that doesn't add borders */.round-label.svelte-1vvdx9e:focus {outline:none;}.round-label.svelte-1vvdx9e:focus-visible {outline:2px solid #0066cc;outline-offset:-2px;position:relative;z-index:1;}` -}; -function pa(t, e) { - mn(e, !0), gr(t, Xc); - let n = wt(e, "rounds", 7, 1), r = wt(e, "currentRound", 15, 1), i = wt(e, "labelPrefix", 7, "Round "), s = wt(e, "onRoundChanged", 7, null), a = st(null), o = st(0), f; - function u(b) { - b !== r() && (r(b), s() && s()(r())); - } - function l() { - r() > 1 && u(r() - 1); - } - function h() { - r() < n() && u(r() + 1); - } - function c(b) { - M(a, F(b)); - } - function d() { - M(a, null); - } - function p(b, T) { - if (console.log("Keyboard event:", b.key, "on round:", T), (b.key === "Enter" || b.key === " ") && (b.preventDefault(), T !== void 0 ? (console.log("Activating round:", T), u(T)) : b.currentTarget instanceof HTMLElement && (b.currentTarget.classList.contains("prev-button") && r() > 1 ? (console.log("Activating previous button"), l()) : b.currentTarget.classList.contains("next-button") && r() < n() && (console.log("Activating next button"), h()))), T !== void 0 && (b.key === "ArrowLeft" || b.key === "ArrowRight")) { - b.preventDefault(); - const P = b.key === "ArrowLeft" ? Math.max(1, T - 1) : Math.min(n(), T + 1); - console.log("Arrow key used, moving focus to round:", P); - const rt = Array.from(f.querySelectorAll(".round-label"))[P - 1]; - rt && rt.focus(); - } - } - function _(b) { - return n() <= 10 ? `${i()}${b}` : n() <= 20 ? `R${b}` : `${b}`; - } - function m() { - f && M(o, F(f.offsetWidth)); - } - ui(() => { - m(), window.addEventListener("resize", m); - const b = (T) => { - console.log("Global keydown in component:", T.key); - }; - return f.addEventListener("keydown", b), () => { - window.removeEventListener("resize", m), f && f.removeEventListener("keydown", b); - }; - }); - var w = Uc(), $ = lt(w), y = lt($); - y.__mouseover = [qc, c], y.__mouseout = d, y.__click = l, y.__keydown = p; - var x = kt(y, 2); - Me( - x, - 21, - () => [ - ...Array.from({ length: n() }, (b, T) => T + 1) - ], - Ce, - (b, T) => { - var P = Bc(); - let K; - P.__mouseover = [Vc, c, T], P.__mouseout = d, P.__click = [Hc, u, T], P.__keydown = [zc, p, T]; - var rt = lt(P, !0); - nt(P), Qt( - (J) => { - K = en(P, 1, "round-label svelte-1vvdx9e", null, K, { - "current-round": v(T) === r(), - "hovered-round": v(T) === v(a), - "not-last-round": v(T) < n(), - "not-first-round": v(T) > 1, - "many-rounds": n() > 20 - }), Wn(P, "aria-selected", v(T) === r()), Wn(P, "aria-label", J), be(rt, J); - }, - [() => _(v(T))] - ), qe("focus", P, () => { - console.log("Focus on round:", v(T)), c(v(T)); - }), qe("blur", P, d), Nt(b, P); - } - ), nt(x); - var E = kt(x, 2); - return E.__mouseover = [Yc, c], E.__mouseout = d, E.__click = h, E.__keydown = p, nt($), nt(w), Kn(w, (b) => f = b, () => f), Qt(() => { - y.disabled = r() === 1, E.disabled = r() === n(); - }), qe("focus", y, () => c(-1)), qe("blur", y, d), qe("focus", E, () => c(999)), qe("blur", E, d), Nt(t, w), yn({ - get rounds() { - return n(); - }, - set rounds(b = 1) { - n(b), mt(); - }, - get currentRound() { - return r(); - }, - set currentRound(b = 1) { - r(b), mt(); - }, - get labelPrefix() { - return i(); - }, - set labelPrefix(b = "Round ") { - i(b), mt(); - }, - get onRoundChanged() { - return s(); - }, - set onRoundChanged(b = null) { - s(b), mt(); - } - }); -} -Os(["mouseover", "mouseout", "click", "keydown"]); -_r( - pa, - { - rounds: {}, - currentRound: {}, - labelPrefix: {}, - onRoundChanged: {} - }, - [], - [], - !0 -); -const Gc = (t) => t; -function ga(t) { - const e = t - 1; - return e * e * e + 1; -} -function Wc(t, { delay: e = 0, duration: n = 400, easing: r = Gc } = {}) { - const i = +getComputedStyle(t).opacity; - return { - delay: e, - duration: n, - easing: r, - css: (s) => `opacity: ${s * i}` - }; -} -function Kc(t, { delay: e = 0, duration: n = 400, easing: r = ga, axis: i = "y" } = {}) { - const s = getComputedStyle(t), a = +s.opacity, o = i === "y" ? "height" : "width", f = parseFloat(s[o]), u = i === "y" ? ["top", "bottom"] : ["left", "right"], l = u.map( - (w) => ( - /** @type {'Left' | 'Right' | 'Top' | 'Bottom'} */ - `${w[0].toUpperCase()}${w.slice(1)}` - ) - ), h = parseFloat(s[`padding${l[0]}`]), c = parseFloat(s[`padding${l[1]}`]), d = parseFloat(s[`margin${l[0]}`]), p = parseFloat(s[`margin${l[1]}`]), _ = parseFloat( - s[`border${l[0]}Width`] - ), m = parseFloat( - s[`border${l[1]}Width`] - ); - return { - delay: e, - duration: n, - easing: r, - css: (w) => `overflow: hidden;opacity: ${Math.min(w * 20, 1) * a};${o}: ${w * f}px;padding-${u[0]}: ${w * h}px;padding-${u[1]}: ${w * c}px;margin-${u[0]}: ${w * d}px;margin-${u[1]}: ${w * p}px;border-${u[0]}-width: ${w * _}px;border-${u[1]}-width: ${w * m}px;min-${o}: 0` - }; -} -function ts(t, e) { - for (const n in e) t[n] = e[n]; - return ( - /** @type {T & S} */ - t - ); -} -function Jc({ fallback: t, ...e }) { - const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(); - function i(a, o, f) { - const { - delay: u = 0, - duration: l = ( - /** @param {number} d */ - (b) => Math.sqrt(b) * 30 - ), - easing: h = ga - } = ts(ts({}, e), f), c = a.getBoundingClientRect(), d = o.getBoundingClientRect(), p = c.left - d.left, _ = c.top - d.top, m = c.width / d.width, w = c.height / d.height, $ = Math.sqrt(p * p + _ * _), y = getComputedStyle(o), x = y.transform === "none" ? "" : y.transform, E = +y.opacity; - return { - delay: u, - duration: typeof l == "function" ? l($) : l, - easing: h, - css: (b, T) => ` - opacity: ${b * E}; - transform-origin: top left; - transform: ${x} translate(${T * p}px,${T * _}px) scale(${b + (1 - b) * m}, ${b + (1 - b) * w}); - ` - }; - } - function s(a, o, f) { - return (u, l) => (a.set(l.key, u), () => { - if (o.has(l.key)) { - const h = o.get(l.key); - return o.delete(l.key), i( - /** @type {Element} */ - h, - u, - l - ); - } - return a.delete(l.key), t && t(u, l, f); - }); - } - return [s(r, n, !1), s(n, r, !0)]; -} -function es(t) { - const e = t - 1; - return e * e * e + 1; -} -var Zc = /* @__PURE__ */ Bt('
'), jc = /* @__PURE__ */ Bt('
'), Qc = /* @__PURE__ */ Bt(" "), td = /* @__PURE__ */ Bt('
Candidate
'); -const ed = { - hash: "svelte-d96s0n", - code: `.visualization-container.svelte-d96s0n {display:flex;flex-direction:column;align-items:center;padding:0.5rem;font-size:0.9rem;}.choice-grid.svelte-d96s0n {border-collapse:separate;border-spacing:0;text-align:center;}.candidate-row.svelte-d96s0n {height:30px; /* Reduced row height */transition:background-color 0.3s ease;}.candidate-row.collapsing.svelte-d96s0n {background-color:rgba(255, 182, 193, 0.2); /* Light pink background */}.candidate-name.svelte-d96s0n {text-align:left;padding-right:8px; /* Reduced padding */max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:0.85rem;}.header-cell.svelte-d96s0n {height:65px; /* Reduced header height */position:relative;padding:0;width:26px; /* Narrower column width */}.diagonal-header.svelte-d96s0n {position:absolute;transform-origin:bottom left;transform:rotate(-45deg);bottom:15px;left:8px; /* Adjusted position */font-size:0.75rem;font-weight:bold;white-space:nowrap;color:#444;}.bubble.svelte-d96s0n {width:1rem; /* Smaller bubble size */height:1rem; /* Smaller bubble size */border-radius:50%;border:1px solid #aaa;background-color:#fff;margin:0 auto;transition:background-color 0.5s ease; /* Smooth transition for bubble color change */}.bubble.selected.svelte-d96s0n {background-color:#00b4d8;border-color:#0077b6;}.bubble.previously-ranked.svelte-d96s0n {background-color:#b3d9ff; /* Darker light blue for previously ranked positions */border-color:#6699cc;}.bubble.changed.svelte-d96s0n { - animation: svelte-d96s0n-highlight-change 2s ease-in-out;}.choice-grid.svelte-d96s0n thead:where(.svelte-d96s0n) th:where(.svelte-d96s0n):first-child, - .choice-grid.svelte-d96s0n tbody:where(.svelte-d96s0n) td:where(.svelte-d96s0n):first-child {position:sticky;left:0;background-color:white;z-index:1;}.choice-grid.svelte-d96s0n tbody:where(.svelte-d96s0n) td:first-child.eliminated-bg:where(.svelte-d96s0n) {background-color:rgba(255, 182, 193, 0.2); /* Light pink background */} - - /* Animation styles */.strikethrough.svelte-d96s0n {position:relative;}.strikethrough.svelte-d96s0n::after {content:'';position:absolute;left:0;top:50%;right:0;width:100%;height:1px;background-color:#888; - animation: svelte-d96s0n-strikethrough 0.7s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;transform-origin:left;z-index:2;} - - @keyframes svelte-d96s0n-strikethrough { - 0% { - transform: scaleX(0); - } - 100% { - transform: scaleX(1); - } - } - - @keyframes svelte-d96s0n-highlight-change { - 0%, 100% { - box-shadow: none; - } - 30%, 70% { - box-shadow: 0 0 12px 4px gold; - } - } - - /* Make cells more compact */.rank-cell.svelte-d96s0n {padding:0 2px; /* Reduced cell padding */position:relative;} - - /* Add style for active ranking updates */.updating-ranks.svelte-d96s0n .bubble.changed:where(.svelte-d96s0n) {box-shadow:0 0 12px 4px gold;}` -}; -function nd(t, e) { - mn(e, !0), gr(t, ed); - let n = wt(e, "candidates", 23, () => []), r = wt(e, "eliminatedCandidates", 23, () => []), i = wt(e, "maxRanks", 7, 3), s = wt(e, "currentRound", 7, 1), a = st(F([])), o = st(F([])), f = st(F([])), u = st(F([])), l = st(F([])), h = st(F([])), c = st(F([])), d = st(F({})), p = st(!1), _ = st(!1), m = st(1); - const [w, $] = Jc({ - duration: 1e3, - fallback(R, q) { - return { - duration: 1e3, - easing: es, - css: (N) => `opacity: ${N}` - }; - } - }); - function y(R, q) { - if (q > R) - throw new Error("k must be less than or equal to n"); - const N = new Array(R).fill(0), ut = Math.min(q, 2), U = Math.min(q, Math.floor(Math.random() * (q - ut + 1)) + ut), j = Array.from({ length: U }, (W, ft) => ft + 1), ct = Array.from({ length: R }, (W, ft) => ft).sort(() => Math.random() - 0.5).slice(0, U); - for (let W = 0; W < U; W++) - N[ct[W]] = j[W]; - return N; - } - function x(R, q) { - return JSON.stringify(R) !== JSON.stringify(q) ? q : R; - } - function E() { - M(h, F([...v(a)])), M(d, F({})), M(f, F(new Array(n().length).fill(!1))), M(u, F(new Array(n().length).fill(!1))), M(l, F(new Array(n().length).fill(!1))); - } - function b(R, q = !0) { - if (R.length === 0) return; - M(c, F([...v(h)])); - const N = [...v(h)], ut = R.filter((U) => N[U] > 0).map((U) => ({ index: U, rank: N[U] })); - ut.sort((U, j) => j.rank - U.rank); - for (const { index: U, rank: j } of ut) { - const ct = `candidate-${U}`; - v(d)[ct] || (v(d)[ct] = []), N[U] > 0 && v(d)[ct].push(N[U]), N[U] = 0; - for (let W = 0; W < N.length; W++) - if (N[W] > j) { - const ft = `candidate-${W}`; - v(d)[ft] || (v(d)[ft] = []), N[W] > 0 && v(d)[ft].push(N[W]), N[W] -= 1; - } - } - if (q) { - M(_, !0); - const U = [...v(u)]; - for (const j of R) - U[j] = !0; - M(u, F(x(v(u), U))), setTimeout( - () => { - M(h, F(x(v(h), N))), setTimeout( - () => { - const j = [...v(l)]; - for (const ct of R) - j[ct] = !0; - M(l, F(x(v(l), j))), setTimeout( - () => { - M(_, !1); - const ct = [...v(f)], W = [...v(l)]; - for (const ft of R) - ct[ft] = !0, W[ft] = !1; - M(f, F(x(v(f), ct))), M(l, F(x(v(l), W))); - }, - 600 - ); - }, - 800 - ); - }, - 800 - ); - } else { - M(h, F(x(v(h), N))); - const U = [...v(f)]; - for (const j of R) - U[j] = !0; - M(f, F(x(v(f), U))); - } - } - function T(R) { - return v(c)[R] !== v(h)[R]; - } - function P(R, q) { - const N = `candidate-${R}`; - return v(d)[N] && v(d)[N].includes(q); - } - ui(() => { - if (n().length > 0 && !v(p)) { - const R = y(n().length, i()); - M(a, F([...R])), M(h, F(R)), M(c, F([...R])), M(o, F(new Array(n().length).fill(!1))), M(f, F(new Array(n().length).fill(!1))), M(u, F(new Array(n().length).fill(!1))), M(l, F(new Array(n().length).fill(!1))); - const q = {}; - R.forEach((N, ut) => { - N > 0 && (q[`candidate-${ut}`] = []); - }), M(d, F(q)), M(m, s()), M(p, !0); - } - }), Un(() => { - if (!v(p)) return; - const R = Math.abs(s() - v(m)) > 1, q = s() < v(m); - if (R || q) { - E(); - const N = r().map((ut, U) => ut ? U : -1).filter((ut) => ut !== -1); - b(N, !1); - } - M(m, s()); - }), Un(() => { - if (!v(p) || !r().length || !v(o).length || Math.abs(s() - v(m)) > 1) return; - const R = []; - for (let q = 0; q < r().length; q++) - r()[q] && !v(o)[q] && R.push(q); - R.length > 0 && b(R, !0), M(o, F(x(v(o), [...r()]))); - }); - function K(R) { - if (R === 0) return ""; - const q = R % 10, N = R % 100; - return q === 1 && N !== 11 ? R + "st" : q === 2 && N !== 12 ? R + "nd" : q === 3 && N !== 13 ? R + "rd" : R + "th"; - } - function rt() { - return Array.from({ length: i() }, (R, q) => K(q + 1)); - } - function J(R, q) { - return `bubble-${R}-${q}`; - } - function ot(R, q) { - const N = `candidate-${R}`; - return v(d)[N] && v(d)[N].includes(q) ? `Previously ranked as ${K(q)} choice` : ""; - } - var C = td(); - let O; - var xt = lt(C), _t = lt(xt), yt = lt(_t), pt = kt(lt(yt)); - Me(pt, 17, rt, Ce, (R, q) => { - var N = Zc(), ut = lt(N), U = lt(ut, !0); - nt(ut), nt(N), Qt(() => be(U, v(q))), Nt(R, N); - }), nt(yt), nt(_t); - var Lt = kt(_t); - return Me(Lt, 21, n, Ce, (R, q, N) => { - var ut = Fo(), U = He(ut); - { - var j = (ct) => { - var W = Qc(); - let ft; - var St = lt(W); - let A; - var z = lt(St, !0); - nt(St); - var it = kt(St); - Me(it, 17, () => Array.from({ length: i() }, (dt, X) => X + 1), Ce, (dt, X) => { - var $t = jc(), ht = lt($t); - let qt; - nt($t), Qt( - (we, Fe, Le, ae) => { - qt = en(ht, 1, "bubble svelte-d96s0n", null, qt, { - selected: v(h)[N] === v(X), - "previously-ranked": we, - changed: Fe - }), Wn(ht, "style", `background-color:${Le ?? ""}`), Wn(ht, "title", ae); - }, - [ - () => P(N, v(X)), - () => v(_) && T(N) && (v(c)[N] === v(X) && v(h)[N] !== v(X) || v(c)[N] !== v(X) && v(h)[N] === v(X)), - () => v(h)[N] === v(X) ? "#00b4d8" : P(N, v(X)) ? "#b3d9ff" : "", - () => ot(N, v(X)) - ] - ), $n(1, ht, () => $, () => ({ key: J(N, v(X)) })), $n(2, ht, () => w, () => ({ key: J(N, v(X)) })), Nt(dt, $t); - }), nt(W), Qt(() => { - ft = en(W, 1, "candidate-row svelte-d96s0n", null, ft, { - strikethrough: v(u)[N] && !v(l)[N], - collapsing: v(l)[N] - }), A = en(St, 1, "candidate-name svelte-d96s0n", null, A, { - eliminated: r()[N], - "eliminated-bg": v(l)[N] - }), be(z, v(q)); - }), $n(1, W, () => Wc, () => ({ duration: 300 })), $n(2, W, () => Kc, () => ({ duration: 600, easing: es })), Nt(ct, W); - }; - Lr(U, (ct) => { - v(f)[N] || ct(j); - }); - } - Nt(R, ut); - }), nt(Lt), nt(xt), nt(C), Qt(() => O = en(C, 1, "visualization-container svelte-d96s0n", null, O, { - "updating-ranks": v(_) - })), Nt(t, C), yn({ - get candidates() { - return n(); - }, - set candidates(R = []) { - n(R), mt(); - }, - get eliminatedCandidates() { - return r(); - }, - set eliminatedCandidates(R = []) { - r(R), mt(); - }, - get maxRanks() { - return i(); - }, - set maxRanks(R = 3) { - i(R), mt(); - }, - get currentRound() { - return s(); - }, - set currentRound(R = 1) { - s(R), mt(); - } - }); -} -_r( - nd, - { - candidates: {}, - eliminatedCandidates: {}, - maxRanks: {}, - currentRound: {} - }, - [], - [], - !0 -); -var rd = /* @__PURE__ */ Bt("  ", 1), id = /* @__PURE__ */ Bt("About to eliminate: ", 1), sd = /* @__PURE__ */ Bt("  ", 1), ad = /* @__PURE__ */ Bt("Elected: ", 1), od = /* @__PURE__ */ Bt("
", 1), ld = /* @__PURE__ */ Bt('


these ballots have already been eliminated.
'); -const ud = { - hash: "svelte-9ymq70", - code: `.page-container.svelte-9ymq70 {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-9ymq70 {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-9ymq70 {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:1.3rem;left:50%;transform:translate(-50%);font-weight:bold;opacity:0;}.tooltip.svelte-9ymq70 h3:where(.svelte-9ymq70) {text-align:center;}.round-selector-container.svelte-9ymq70 {width:100%;display:flex;justify-content:center;margin:1rem 0;}.animation-button-container.svelte-9ymq70 {display:flex;justify-content:center;gap:10px;margin-bottom:1rem;} - -/*** Use this one when you only want the pie chart and not the bubble grid visualization ***/ - - - -/*** Use this one when you want to display both the pie chart and the bubble grid visualiation -.visualizations-container { - display: flex; - justify-content: space-between; - width: 100%; - padding: 0 20px; -} -***/.pie-chart-container.svelte-9ymq70 {width:65%;min-width:800px; /* Larger minimum size */flex-grow:0; /* Don't grow beyond specified width */margin-right:40px; /* Add extra space on right */} - - -/* Media query for smaller screens */ -@media (max-width: 1300px) {.visualizations-container.svelte-9ymq70 {flex-direction:column;align-items:center;}.pie-chart-container.svelte-9ymq70 {width:90%;margin:0 auto;} -}` -}; -function fd(t, e) { - mn(e, !0), gr(t, ud); - const n = 0.85; - let r = wt(e, "electionSummary", 7), i = st(null), s = st(null), a = st(1), o = st(""), f = st(F([])), u = st(""), l = st(""), h = st(0), c = st(null), d = st(null), p = st(null), _ = st(null), m = /* @__PURE__ */ cr(() => w(r())); - function w(A) { - if (typeof A == "string") { - console.log("input was a string"); - try { - return JSON.parse(A); - } catch (z) { - return console.error("Failed to parse JSON string:", z), {}; - } - } - return A || {}; - } - function $(A) { - console.log("slider wants to move to round ", A), A === v(a) + 1 && v(c) ? v(c)() : v(_) && v(_)(A); - } - function y() { - switch (console.log("mouse event ", v(u), v(l), v(h)), v(u)) { - case "enter": - ((A) => (M(f, F(A[0])), M(o, F(A[1]))))(E(v(l))), v(i) && (v(i).style.top = String(v(h) || 20) + "px", v(i).style.opacity = String(n)); - break; - case "leave": - v(i) && (v(i).style.opacity = "0"), M(f, F([])), M(o, ""); - break; - case "show-exhausted": - v(s) && (v(s).style.top = String(v(h) || 20) + "px", v(s).style.opacity = String(n)); - break; - case "hide-exhausted": - v(s) && (v(s).style.opacity = "0"); - break; - default: - console.log("Unknown mouse event: ", v(u)); - break; - } - } - Un(() => y()); - function x(A, z) { - return A == 1 ? z ? "vote was" : "vote will be" : z ? "votes were" : "votes will be"; - } - function E(A) { - const z = [], it = A === "exhausted" ? Kr : A; - let dt; - A == "exhausted" ? dt = ir(v(m), 1) : dt = v(m).results[0].tally[A], z.push(`${it} started with ${dt} votes.`); - for (let X = 1; X <= v(a); X++) { - X === v(a) && (A == "exhausted" ? dt = ir(v(m), v(a)) : dt = v(m).results[v(a) - 1].tally[A], z.push(`${it} has ${dt} votes at round ${v(a)}.`)); - const $t = v(m).results[X - 1].tallyResults; - for (let ht = 0; ht < $t.length; ht++) { - const qt = $t[ht].transfers, we = $t[ht].eliminated, Fe = $t[ht].elected; - if (we) - we === A && z.push(`${it} will be eliminated on round ${X}.`); - else if (A === Fe && (z.push(`${it} was elected on round ${X}.`), qt)) - for (let [ae, ke] of Object.entries(qt)) - z.push(`${ke} ${x(Number(ke), X < v(a))} transferred to ${ae} on round ${X}.`); - const Le = we || Fe; - if (Le) { - const ae = Number(qt[A]); - ae && z.push(`${ae} ${x(ae, X < v(a))} transferred from ${Le} on round ${X}.`); - } - } - } - return [z, it]; - } - function b() { - let A = 0; - for (let z = 1; z <= v(m).results.length; z++) { - const it = v(m).results[z - 1].tallyResults; - for (let dt = 0; dt < it.length; dt++) - it[dt].elected && A++; - } - return A; - } - var T = ld(), P = lt(T), K = lt(P), rt = lt(K); - nt(K); - var J = kt(K, 2), ot = lt(J); - { - var C = (A) => { - var z = id(), it = kt(He(z)); - Me(it, 17, () => sr(v(m), v(a)), Ce, (dt, X) => { - var $t = rd(), ht = He($t), qt = lt(ht, !0); - nt(ht), xn(), Qt(() => { - Pi(ht, "color", Ne[v(X)]), be(qt, v(X)); - }), Nt(dt, $t); - }), Nt(A, z); - }; - Lr(ot, (A) => { - sr(v(m), v(a)).length > 0 && A(C); - }); - } - var O = kt(ot, 2); - { - var xt = (A) => { - var z = ad(), it = kt(He(z)); - Me(it, 17, () => ar(v(m), v(a)), Ce, (dt, X) => { - var $t = sd(), ht = He($t), qt = lt(ht, !0); - nt(ht), xn(), Qt(() => { - Pi(ht, "color", Ne[v(X)]), be(qt, v(X)); - }), Nt(dt, $t); - }), Nt(A, z); - }; - Lr(O, (A) => { - ar(v(m), v(a)).length > 0 && A(xt); - }); - } - nt(J), nt(P); - var _t = kt(P, 2), yt = lt(_t), pt = lt(yt, !0); - nt(yt); - var Lt = kt(yt, 2); - Me(Lt, 17, () => v(f), Ce, (A, z) => { - var it = od(), dt = He(it), X = lt(dt, !0); - nt(dt), xn(2), Qt(() => be(X, v(z))), Nt(A, it); - }), nt(_t), Kn(_t, (A) => M(i, A), () => v(i)); - var R = kt(_t, 2), q = lt(R); - q.nodeValue = `"${Kr}" means all the candidates ranked on `, xn(2), nt(R), Kn(R, (A) => M(s, A), () => v(s)); - var N = kt(R, 2), ut = lt(N); - pa(ut, { - get rounds() { - return v(m).results.length; - }, - get currentRound() { - return v(a); - }, - labelPrefix: "Round ", - onRoundChanged: $ - }), nt(N); - var U = kt(N, 2), j = lt(U); - j.__click = function(...A) { - var z; - (z = v(p)) == null || z.apply(this, A); - }; - var ct = kt(j, 2); - ct.__click = function(...A) { - var z; - (z = v(d)) == null || z.apply(this, A); - }, nt(U); - var W = kt(U, 2), ft = lt(W), St = lt(ft); - return va(St, { - get jsonData() { - return v(m); - }, - get round() { - return v(a); - }, - set round(A) { - M(a, F(A)); - }, - get mouseEventType() { - return v(u); - }, - set mouseEventType(A) { - M(u, F(A)); - }, - get mouseData() { - return v(l); - }, - set mouseData(A) { - M(l, F(A)); - }, - get mouseY() { - return v(h); - }, - set mouseY(A) { - M(h, F(A)); - }, - get animateOneRound() { - return v(c); - }, - set animateOneRound(A) { - M(c, F(A)); - }, - get animateOnePhase() { - return v(d); - }, - set animateOnePhase(A) { - M(d, F(A)); - }, - get runFullAnimation() { - return v(p); - }, - set runFullAnimation(A) { - M(p, F(A)); - }, - get setRound() { - return v(_); - }, - set setRound(A) { - M(_, F(A)); - } - }), nt(ft), nt(W), nt(T), Qt( - (A) => { - be(rt, `${v(m).config.contest ?? ""}, ${A ?? ""} to be elected, Round ${v(a) ?? ""}.`), be(pt, v(o)); - }, - [b] - ), Nt(t, T), yn({ - get electionSummary() { - return r(); - }, - set electionSummary(A) { - r(A), mt(); - } - }); -} -Os(["click"]); -customElements.define("pie-chart", _r(fd, { electionSummary: {} }, [], [], !0)); From 20e1192714c78b74894975ea533ebbfa63ca5f5a Mon Sep 17 00:00:00 2001 From: skaphan Date: Sun, 16 Mar 2025 07:35:40 -0700 Subject: [PATCH 08/18] Timeline Slider no longer included! --- static/pie/pie-chart.es.js | 4768 ++++++++++++++++-------------------- 1 file changed, 2102 insertions(+), 2666 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index f6dea7f4..96d971d6 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,131 +1,131 @@ -var xa = Object.defineProperty; -var Ti = (t) => { +var ua = Object.defineProperty; +var ai = (t) => { throw TypeError(t); }; -var wa = (t, e, n) => e in t ? xa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var Jt = (t, e, n) => wa(t, typeof e != "symbol" ? e + "" : e, n), Ei = (t, e, n) => e.has(t) || Ti("Cannot " + n); -var St = (t, e, n) => (Ei(t, e, "read from private field"), n ? n.call(t) : e.get(t)), kr = (t, e, n) => e.has(t) ? Ti("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), Rr = (t, e, n, r) => (Ei(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); -const ba = "5"; -typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ba); -const Kr = 1, Wr = 2, rs = 4, $a = 8, Aa = 16, Ta = 1, Ea = 4, ka = 8, Ra = 16, Na = 1, Sa = 2, is = "[", Jr = "[!", Zr = "]", Ge = {}, Ct = Symbol(), ki = !1, te = 2, ss = 4, Qr = 8, ti = 16, Te = 32, sn = 64, Xn = 128, Gt = 256, Yn = 512, Pt = 1024, Ee = 2048, an = 4096, be = 8192, dr = 16384, Ca = 32768, ei = 65536, Ma = 1 << 19, as = 1 << 20, _n = Symbol("$state"), os = Symbol("legacy props"), Da = Symbol(""); -var ni = Array.isArray, Oa = Array.prototype.indexOf, ri = Array.from, Un = Object.keys, Gn = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, Pa = Object.getOwnPropertyDescriptors, Ia = Object.prototype, Fa = Array.prototype, ls = Object.getPrototypeOf; -function us(t) { +var fa = (t, e, n) => e in t ? ua(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var St = (t, e, n) => fa(t, typeof e != "symbol" ? e + "" : e, n), li = (t, e, n) => e.has(t) || ai("Cannot " + n); +var dt = (t, e, n) => (li(t, e, "read from private field"), n ? n.call(t) : e.get(t)), ar = (t, e, n) => e.has(t) ? ai("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), lr = (t, e, n, r) => (li(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); +const ca = "5"; +typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ca); +const ha = 1, da = 2, va = 16, pa = 1, _a = 4, ga = 8, ma = 16, ya = 2, Ii = "[", Sr = "[!", Cr = "]", Xe = {}, vt = Symbol(), oi = !1, Dt = 2, Fi = 4, Mr = 8, Or = 16, re = 32, Oe = 64, An = 128, Rt = 256, En = 512, mt = 1024, ie = 2048, Pe = 4096, Qt = 8192, Kn = 16384, wa = 32768, Pr = 65536, xa = 1 << 19, qi = 1 << 20, Ue = Symbol("$state"), Li = Symbol("legacy props"); +var Dr = Array.isArray, ba = Array.prototype.indexOf, Ir = Array.from, Rn = Object.keys, Nn = Object.defineProperty, me = Object.getOwnPropertyDescriptor, $a = Object.prototype, Aa = Array.prototype, Ea = Object.getPrototypeOf; +function Vi(t) { for (var e = 0; e < t.length; e++) t[e](); } -let wn = [], Dr = []; -function fs() { - var t = wn; - wn = [], us(t); +let Ke = [], vr = []; +function Hi() { + var t = Ke; + Ke = [], Vi(t); } -function La() { - var t = Dr; - Dr = [], us(t); +function Ra() { + var t = vr; + vr = [], Vi(t); } -function ii(t) { - wn.length === 0 && queueMicrotask(fs), wn.push(t); +function Yi(t) { + Ke.length === 0 && queueMicrotask(Hi), Ke.push(t); } -function Ri() { - wn.length > 0 && fs(), Dr.length > 0 && La(); +function ui() { + Ke.length > 0 && Hi(), vr.length > 0 && Ra(); } -function cs(t) { +function Bi(t) { return t === this.v; } -function qa(t, e) { +function Na(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function si(t) { - return !qa(t, this.v); +function Fr(t) { + return !Na(t, this.v); } -function Va(t) { +function Ta(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function za() { +function ka() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function Ba(t) { +function Sa(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function Ha() { +function Ca() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Xa() { +function Ma() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function Ya(t) { +function Oa(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function Ua() { +function Pa() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Ga() { +function Da() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function ja() { +function Ia() { throw new Error("https://svelte.dev/e/state_unsafe_local_read"); } -function Ka() { +function Fa() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -let Wa = !1; -function Ut(t, e) { +let qa = !1; +function Et(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: t, reactions: null, - equals: cs, + equals: Bi, rv: 0, wv: 0 }; return n; } -function ot(t) { - return /* @__PURE__ */ Ja(Ut(t)); +function Ct(t) { + return /* @__PURE__ */ La(Et(t)); } // @__NO_SIDE_EFFECTS__ -function ai(t, e = !1) { - const n = Ut(t); - return e || (n.equals = si), n; +function qr(t, e = !1) { + const n = Et(t); + return e || (n.equals = Fr), n; } // @__NO_SIDE_EFFECTS__ -function Ja(t) { - return et !== null && !Zt && et.f & te && (le === null ? eo([t]) : le.push(t)), t; +function La(t) { + return U !== null && !Ot && U.f & Dt && (Bt === null ? Ba([t]) : Bt.push(t)), t; } -function B(t, e) { - return et !== null && !Zt && Ss() && et.f & (te | ti) && // If the source was created locally within the current derived, then +function j(t, e) { + return U !== null && !Ot && us() && U.f & (Dt | Or) && // If the source was created locally within the current derived, then // we allow the mutation. - (le === null || !le.includes(t)) && Ka(), Or(t, e); + (Bt === null || !Bt.includes(t)) && Fa(), zi(t, e); } -function Or(t, e) { - return t.equals(e) || (t.v, t.v = e, t.wv = xs(), ds(t, Ee), nt !== null && nt.f & Pt && !(nt.f & (Te | sn)) && (ye === null ? no([t]) : ye.push(t))), e; +function zi(t, e) { + return t.equals(e) || (t.v, t.v = e, t.wv = Qi(), Xi(t, ie), G !== null && G.f & mt && !(G.f & (re | Oe)) && (Wt === null ? za([t]) : Wt.push(t))), e; } -function ds(t, e) { +function Xi(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; - a & Ee || ($e(s, e), a & (Pt | Gt) && (a & te ? ds( + a & ie || (te(s, e), a & (mt | Rt) && (a & Dt ? Xi( /** @type {Derived} */ s, - an - ) : mr( + Pe + ) : Zn( /** @type {Effect} */ s ))); } } // @__NO_SIDE_EFFECTS__ -function Pe(t) { - var e = te | Ee, n = et !== null && et.f & te ? ( +function jn(t) { + var e = Dt | ie, n = U !== null && U.f & Dt ? ( /** @type {Derived} */ - et + U ) : null; - return nt === null || n !== null && n.f & Gt ? e |= Gt : nt.f |= as, { - ctx: Ot, + return G === null || n !== null && n.f & Rt ? e |= Rt : G.f |= qi, { + ctx: gt, deps: null, effects: null, - equals: cs, + equals: Bi, f: e, fn: t, reactions: null, @@ -135,28 +135,28 @@ function Pe(t) { null ), wv: 0, - parent: n ?? nt + parent: n ?? G }; } // @__NO_SIDE_EFFECTS__ -function Za(t) { - const e = /* @__PURE__ */ Pe(t); - return e.equals = si, e; +function Va(t) { + const e = /* @__PURE__ */ jn(t); + return e.equals = Fr, e; } -function hs(t) { +function Ui(t) { var e = t.effects; if (e !== null) { t.effects = null; for (var n = 0; n < e.length; n += 1) - de( + ee( /** @type {Effect} */ e[n] ); } } -function Qa(t) { +function Ha(t) { for (var e = t.parent; e !== null; ) { - if (!(e.f & te)) + if (!(e.f & Dt)) return ( /** @type {Effect} */ e @@ -165,536 +165,536 @@ function Qa(t) { } return null; } -function to(t) { - var e, n = nt; - tn(Qa(t)); +function Ya(t) { + var e, n = G; + Se(Ha(t)); try { - hs(t), e = bs(t); + Ui(t), e = es(t); } finally { - tn(n); + Se(n); } return e; } -function vs(t) { - var e = to(t), n = (Se || t.f & Gt) && t.deps !== null ? an : Pt; - $e(t, n), t.equals(e) || (t.v = e, t.wv = xs()); +function Gi(t) { + var e = Ya(t), n = (de || t.f & Rt) && t.deps !== null ? Pe : mt; + te(t, n), t.equals(e) || (t.v = e, t.wv = Qi()); } -function hr(t) { +function Lr(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -let W = !1; -function we(t) { - W = t; +let Z = !1; +function Zt(t) { + Z = t; } -let j; -function Vt(t) { +let X; +function Xt(t) { if (t === null) - throw hr(), Ge; - return j = t; + throw Lr(), Xe; + return X = t; } -function Ze() { - return Vt( +function Wn() { + return Xt( /** @type {TemplateNode} */ - /* @__PURE__ */ he(j) + /* @__PURE__ */ se(X) ); } -function K(t) { - if (W) { - if (/* @__PURE__ */ he(j) !== null) - throw hr(), Ge; - j = t; +function yt(t) { + if (Z) { + if (/* @__PURE__ */ se(X) !== null) + throw Lr(), Xe; + X = t; } } -function Rn(t = 1) { - if (W) { - for (var e = t, n = j; e--; ) +function on(t = 1) { + if (Z) { + for (var e = t, n = X; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ he(n); - j = n; + /* @__PURE__ */ se(n); + X = n; } } -function Pr() { - for (var t = 0, e = j; ; ) { +function pr() { + for (var t = 0, e = X; ; ) { if (e.nodeType === 8) { var n = ( /** @type {Comment} */ e.data ); - if (n === Zr) { + if (n === Cr) { if (t === 0) return e; t -= 1; - } else (n === is || n === Jr) && (t += 1); + } else (n === Ii || n === Sr) && (t += 1); } var r = ( /** @type {TemplateNode} */ - /* @__PURE__ */ he(e) + /* @__PURE__ */ se(e) ); e.remove(), e = r; } } function lt(t, e = null, n) { - if (typeof t != "object" || t === null || _n in t) + if (typeof t != "object" || t === null || Ue in t) return t; - const r = ls(t); - if (r !== Ia && r !== Fa) + const r = Ea(t); + if (r !== $a && r !== Aa) return t; - var i = /* @__PURE__ */ new Map(), s = ni(t), a = Ut(0); - s && i.set("length", Ut( + var i = /* @__PURE__ */ new Map(), s = Dr(t), a = Et(0); + s && i.set("length", Et( /** @type {any[]} */ t.length )); - var o; + var l; return new Proxy( /** @type {any} */ t, { - defineProperty(l, u, f) { - (!("value" in f) || f.configurable === !1 || f.enumerable === !1 || f.writable === !1) && Ua(); - var d = i.get(u); - return d === void 0 ? (d = Ut(f.value), i.set(u, d)) : B(d, lt(f.value, o)), !0; + defineProperty(o, f, u) { + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Pa(); + var h = i.get(f); + return h === void 0 ? (h = Et(u.value), i.set(f, h)) : j(h, lt(u.value, l)), !0; }, - deleteProperty(l, u) { - var f = i.get(u); - if (f === void 0) - u in l && i.set(u, Ut(Ct)); + deleteProperty(o, f) { + var u = i.get(f); + if (u === void 0) + f in o && i.set(f, Et(vt)); else { - if (s && typeof u == "string") { - var d = ( + if (s && typeof f == "string") { + var h = ( /** @type {Source} */ i.get("length") - ), c = Number(u); - Number.isInteger(c) && c < d.v && B(d, c); + ), c = Number(f); + Number.isInteger(c) && c < h.v && j(h, c); } - B(f, Ct), Ni(a); + j(u, vt), fi(a); } return !0; }, - get(l, u, f) { - var m; - if (u === _n) + get(o, f, u) { + var p; + if (f === Ue) return t; - var d = i.get(u), c = u in l; - if (d === void 0 && (!c || (m = Fe(l, u)) != null && m.writable) && (d = Ut(lt(c ? l[u] : Ct, o)), i.set(u, d)), d !== void 0) { - var v = h(d); - return v === Ct ? void 0 : v; + var h = i.get(f), c = f in o; + if (h === void 0 && (!c || (p = me(o, f)) != null && p.writable) && (h = Et(lt(c ? o[f] : vt, l)), i.set(f, h)), h !== void 0) { + var d = g(h); + return d === vt ? void 0 : d; } - return Reflect.get(l, u, f); + return Reflect.get(o, f, u); }, - getOwnPropertyDescriptor(l, u) { - var f = Reflect.getOwnPropertyDescriptor(l, u); - if (f && "value" in f) { - var d = i.get(u); - d && (f.value = h(d)); - } else if (f === void 0) { - var c = i.get(u), v = c == null ? void 0 : c.v; - if (c !== void 0 && v !== Ct) + getOwnPropertyDescriptor(o, f) { + var u = Reflect.getOwnPropertyDescriptor(o, f); + if (u && "value" in u) { + var h = i.get(f); + h && (u.value = g(h)); + } else if (u === void 0) { + var c = i.get(f), d = c == null ? void 0 : c.v; + if (c !== void 0 && d !== vt) return { enumerable: !0, configurable: !0, - value: v, + value: d, writable: !0 }; } - return f; + return u; }, - has(l, u) { - var v; - if (u === _n) + has(o, f) { + var d; + if (f === Ue) return !0; - var f = i.get(u), d = f !== void 0 && f.v !== Ct || Reflect.has(l, u); - if (f !== void 0 || nt !== null && (!d || (v = Fe(l, u)) != null && v.writable)) { - f === void 0 && (f = Ut(d ? lt(l[u], o) : Ct), i.set(u, f)); - var c = h(f); - if (c === Ct) + var u = i.get(f), h = u !== void 0 && u.v !== vt || Reflect.has(o, f); + if (u !== void 0 || G !== null && (!h || (d = me(o, f)) != null && d.writable)) { + u === void 0 && (u = Et(h ? lt(o[f], l) : vt), i.set(f, u)); + var c = g(u); + if (c === vt) return !1; } - return d; + return h; }, - set(l, u, f, d) { - var b; - var c = i.get(u), v = u in l; - if (s && u === "length") - for (var m = f; m < /** @type {Source} */ - c.v; m += 1) { - var y = i.get(m + ""); - y !== void 0 ? B(y, Ct) : m in l && (y = Ut(Ct), i.set(m + "", y)); + set(o, f, u, h) { + var E; + var c = i.get(f), d = f in o; + if (s && f === "length") + for (var p = u; p < /** @type {Source} */ + c.v; p += 1) { + var _ = i.get(p + ""); + _ !== void 0 ? j(_, vt) : p in o && (_ = Et(vt), i.set(p + "", _)); } - c === void 0 ? (!v || (b = Fe(l, u)) != null && b.writable) && (c = Ut(void 0), B(c, lt(f, o)), i.set(u, c)) : (v = c.v !== Ct, B(c, lt(f, o))); - var x = Reflect.getOwnPropertyDescriptor(l, u); - if (x != null && x.set && x.set.call(d, f), !v) { - if (s && typeof u == "string") { - var k = ( + c === void 0 ? (!d || (E = me(o, f)) != null && E.writable) && (c = Et(void 0), j(c, lt(u, l)), i.set(f, c)) : (d = c.v !== vt, j(c, lt(u, l))); + var b = Reflect.getOwnPropertyDescriptor(o, f); + if (b != null && b.set && b.set.call(h, u), !d) { + if (s && typeof f == "string") { + var y = ( /** @type {Source} */ i.get("length") - ), w = Number(u); - Number.isInteger(w) && w >= k.v && B(k, w + 1); + ), $ = Number(f); + Number.isInteger($) && $ >= y.v && j(y, $ + 1); } - Ni(a); + fi(a); } return !0; }, - ownKeys(l) { - h(a); - var u = Reflect.ownKeys(l).filter((c) => { - var v = i.get(c); - return v === void 0 || v.v !== Ct; + ownKeys(o) { + g(a); + var f = Reflect.ownKeys(o).filter((c) => { + var d = i.get(c); + return d === void 0 || d.v !== vt; }); - for (var [f, d] of i) - d.v !== Ct && !(f in l) && u.push(f); - return u; + for (var [u, h] of i) + h.v !== vt && !(u in o) && f.push(u); + return f; }, setPrototypeOf() { - Ga(); + Da(); } } ); } -function Ni(t, e = 1) { - B(t, t.v + e); +function fi(t, e = 1) { + j(t, t.v + e); } -var Si, ms, ps, gs; -function Ir() { - if (Si === void 0) { - Si = window, ms = /Firefox/.test(navigator.userAgent); +var ci, Ki, ji, Wi; +function _r() { + if (ci === void 0) { + ci = window, Ki = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype; - ps = Fe(e, "firstChild").get, gs = Fe(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; + ji = me(e, "firstChild").get, Wi = me(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; } } -function qe(t = "") { +function Tn(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function ce(t) { - return ps.call(t); +function we(t) { + return ji.call(t); } // @__NO_SIDE_EFFECTS__ -function he(t) { - return gs.call(t); +function se(t) { + return Wi.call(t); } -function tt(t, e) { - if (!W) - return /* @__PURE__ */ ce(t); +function wt(t, e) { + if (!Z) + return /* @__PURE__ */ we(t); var n = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ce(j) + /* @__PURE__ */ we(X) ); if (n === null) - n = j.appendChild(qe()); + n = X.appendChild(Tn()); else if (e && n.nodeType !== 3) { - var r = qe(); - return n == null || n.before(r), Vt(r), r; + var r = Tn(); + return n == null || n.before(r), Xt(r), r; } - return Vt(n), n; + return Xt(n), n; } -function hn(t, e) { - if (!W) { +function Ae(t, e) { + if (!Z) { var n = ( /** @type {DocumentFragment} */ - /* @__PURE__ */ ce( + /* @__PURE__ */ we( /** @type {Node} */ t ) ); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ he(n) : n; + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ se(n) : n; } - return j; + return X; } -function mt(t, e = 1, n = !1) { - let r = W ? j : t; +function Lt(t, e = 1, n = !1) { + let r = Z ? X : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ he(r); - if (!W) + /* @__PURE__ */ se(r); + if (!Z) return r; var s = r == null ? void 0 : r.nodeType; if (n && s !== 3) { - var a = qe(); - return r === null ? i == null || i.after(a) : r.before(a), Vt(a), a; + var a = Tn(); + return r === null ? i == null || i.after(a) : r.before(a), Xt(a), a; } - return Vt(r), /** @type {TemplateNode} */ + return Xt(r), /** @type {TemplateNode} */ r; } -function _s(t) { +function Ji(t) { t.textContent = ""; } -let In = !1, jn = !1, Kn = null, Fn = !1, oi = !1; -function Ci(t) { - oi = t; +let _n = !1, kn = !1, Sn = null, gn = !1, Vr = !1; +function hi(t) { + Vr = t; } -let yn = []; -let et = null, Zt = !1; -function Qe(t) { - et = t; +let Ge = []; +let U = null, Ot = !1; +function ke(t) { + U = t; } -let nt = null; -function tn(t) { - nt = t; +let G = null; +function Se(t) { + G = t; } -let le = null; -function eo(t) { - le = t; +let Bt = null; +function Ba(t) { + Bt = t; } -let At = null, qt = 0, ye = null; -function no(t) { - ye = t; +let ot = null, xt = 0, Wt = null; +function za(t) { + Wt = t; } -let ys = 1, Wn = 0, Se = !1; -function xs() { - return ++ys; +let Zi = 1, Cn = 0, de = !1; +function Qi() { + return ++Zi; } -function En(t) { - var d; +function en(t) { + var h; var e = t.f; - if (e & Ee) + if (e & ie) return !0; - if (e & an) { - var n = t.deps, r = (e & Gt) !== 0; + if (e & Pe) { + var n = t.deps, r = (e & Rt) !== 0; if (n !== null) { - var i, s, a = (e & Yn) !== 0, o = r && nt !== null && !Se, l = n.length; - if (a || o) { - var u = ( + var i, s, a = (e & En) !== 0, l = r && G !== null && !de, o = n.length; + if (a || l) { + var f = ( /** @type {Derived} */ t - ), f = u.parent; - for (i = 0; i < l; i++) - s = n[i], (a || !((d = s == null ? void 0 : s.reactions) != null && d.includes(u))) && (s.reactions ?? (s.reactions = [])).push(u); - a && (u.f ^= Yn), o && f !== null && !(f.f & Gt) && (u.f ^= Gt); + ), u = f.parent; + for (i = 0; i < o; i++) + s = n[i], (a || !((h = s == null ? void 0 : s.reactions) != null && h.includes(f))) && (s.reactions ?? (s.reactions = [])).push(f); + a && (f.f ^= En), l && u !== null && !(u.f & Rt) && (f.f ^= Rt); } - for (i = 0; i < l; i++) - if (s = n[i], En( + for (i = 0; i < o; i++) + if (s = n[i], en( /** @type {Derived} */ s - ) && vs( + ) && Gi( /** @type {Derived} */ s ), s.wv > t.wv) return !0; } - (!r || nt !== null && !Se) && $e(t, Pt); + (!r || G !== null && !de) && te(t, mt); } return !1; } -function ro(t, e) { +function Xa(t, e) { for (var n = e; n !== null; ) { - if (n.f & Xn) + if (n.f & An) try { n.fn(t); return; } catch { - n.f ^= Xn; + n.f ^= An; } n = n.parent; } - throw In = !1, t; + throw _n = !1, t; } -function io(t) { - return (t.f & dr) === 0 && (t.parent === null || (t.parent.f & Xn) === 0); +function Ua(t) { + return (t.f & Kn) === 0 && (t.parent === null || (t.parent.f & An) === 0); } -function vr(t, e, n, r) { - if (In) { - if (n === null && (In = !1), io(e)) +function Jn(t, e, n, r) { + if (_n) { + if (n === null && (_n = !1), Ua(e)) throw t; return; } - n !== null && (In = !0); + n !== null && (_n = !0); { - ro(t, e); + Xa(t, e); return; } } -function ws(t, e, n = !0) { +function ts(t, e, n = !0) { var r = t.reactions; if (r !== null) for (var i = 0; i < r.length; i++) { var s = r[i]; - s.f & te ? ws( + s.f & Dt ? ts( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? $e(s, Ee) : s.f & Pt && $e(s, an), mr( + ) : e === s && (n ? te(s, ie) : s.f & mt && te(s, Pe), Zn( /** @type {Effect} */ s )); } } -function bs(t) { - var v; - var e = At, n = qt, r = ye, i = et, s = Se, a = le, o = Ot, l = Zt, u = t.f; - At = /** @type {null | Value[]} */ - null, qt = 0, ye = null, Se = (u & Gt) !== 0 && (Zt || !Fn || et === null), et = u & (Te | sn) ? null : t, le = null, Mi(t.ctx), Zt = !1, Wn++; +function es(t) { + var d; + var e = ot, n = xt, r = Wt, i = U, s = de, a = Bt, l = gt, o = Ot, f = t.f; + ot = /** @type {null | Value[]} */ + null, xt = 0, Wt = null, de = (f & Rt) !== 0 && (Ot || !gn || U === null), U = f & (re | Oe) ? null : t, Bt = null, di(t.ctx), Ot = !1, Cn++; try { - var f = ( + var u = ( /** @type {Function} */ (0, t.fn)() - ), d = t.deps; - if (At !== null) { + ), h = t.deps; + if (ot !== null) { var c; - if (Jn(t, qt), d !== null && qt > 0) - for (d.length = qt + At.length, c = 0; c < At.length; c++) - d[qt + c] = At[c]; + if (Mn(t, xt), h !== null && xt > 0) + for (h.length = xt + ot.length, c = 0; c < ot.length; c++) + h[xt + c] = ot[c]; else - t.deps = d = At; - if (!Se) - for (c = qt; c < d.length; c++) - ((v = d[c]).reactions ?? (v.reactions = [])).push(t); - } else d !== null && qt < d.length && (Jn(t, qt), d.length = qt); - if (Ss() && ye !== null && !Zt && d !== null && !(t.f & (te | an | Ee))) + t.deps = h = ot; + if (!de) + for (c = xt; c < h.length; c++) + ((d = h[c]).reactions ?? (d.reactions = [])).push(t); + } else h !== null && xt < h.length && (Mn(t, xt), h.length = xt); + if (us() && Wt !== null && !Ot && h !== null && !(t.f & (Dt | Pe | ie))) for (c = 0; c < /** @type {Source[]} */ - ye.length; c++) - ws( - ye[c], + Wt.length; c++) + ts( + Wt[c], /** @type {Effect} */ t ); - return i !== null && Wn++, f; + return i !== null && Cn++, u; } finally { - At = e, qt = n, ye = r, et = i, Se = s, le = a, Mi(o), Zt = l; + ot = e, xt = n, Wt = r, U = i, de = s, Bt = a, di(l), Ot = o; } } -function so(t, e) { +function Ga(t, e) { let n = e.reactions; if (n !== null) { - var r = Oa.call(n, t); + var r = ba.call(n, t); if (r !== -1) { var i = n.length - 1; i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - n === null && e.f & te && // Destroying a child effect while updating a parent effect can cause a dependency to appear + n === null && e.f & Dt && // 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 - (At === null || !At.includes(e)) && ($e(e, an), e.f & (Gt | Yn) || (e.f ^= Yn), hs( + (ot === null || !ot.includes(e)) && (te(e, Pe), e.f & (Rt | En) || (e.f ^= En), Ui( /** @type {Derived} **/ e - ), Jn( + ), Mn( /** @type {Derived} **/ e, 0 )); } -function Jn(t, e) { +function Mn(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - so(t, n[r]); + Ga(t, n[r]); } -function li(t) { +function Hr(t) { var e = t.f; - if (!(e & dr)) { - $e(t, Pt); - var n = nt, r = Ot, i = Fn; - nt = t, Fn = !0; + if (!(e & Kn)) { + te(t, mt); + var n = G, r = gt, i = gn; + G = t, gn = !0; try { - e & ti ? mo(t) : Es(t), Ts(t); - var s = bs(t); - t.teardown = typeof s == "function" ? s : null, t.wv = ys; - var a = t.deps, o; - ki && Wa && t.f & Ee; - } catch (l) { - vr(l, t, n, r || t.ctx); + e & Or ? nl(t) : ss(t), is(t); + var s = es(t); + t.teardown = typeof s == "function" ? s : null, t.wv = Zi; + var a = t.deps, l; + oi && qa && t.f & ie; + } catch (o) { + Jn(o, t, n, r || t.ctx); } finally { - Fn = i, nt = n; + gn = i, G = n; } } } -function ao() { +function Ka() { try { - Ha(); + Ca(); } catch (t) { - if (Kn !== null) - vr(t, Kn, null); + if (Sn !== null) + Jn(t, Sn, null); else throw t; } } -function $s() { +function ns() { try { - for (var t = 0; yn.length > 0; ) { - t++ > 1e3 && ao(); - var e = yn, n = e.length; - yn = []; + for (var t = 0; Ge.length > 0; ) { + t++ > 1e3 && Ka(); + var e = Ge, n = e.length; + Ge = []; for (var r = 0; r < n; r++) { var i = e[r]; - i.f & Pt || (i.f ^= Pt); - var s = lo(i); - oo(s); + i.f & mt || (i.f ^= mt); + var s = Wa(i); + ja(s); } } } finally { - jn = !1, Kn = null; + kn = !1, Sn = null; } } -function oo(t) { +function ja(t) { var e = t.length; if (e !== 0) for (var n = 0; n < e; n++) { var r = t[n]; - if (!(r.f & (dr | be))) + if (!(r.f & (Kn | Qt))) try { - En(r) && (li(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? ks(r) : r.fn = null)); + en(r) && (Hr(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? as(r) : r.fn = null)); } catch (i) { - vr(i, r, null, r.ctx); + Jn(i, r, null, r.ctx); } } } -function mr(t) { - jn || (jn = !0, queueMicrotask($s)); - for (var e = Kn = t; e.parent !== null; ) { +function Zn(t) { + kn || (kn = !0, queueMicrotask(ns)); + for (var e = Sn = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (n & (sn | Te)) { - if (!(n & Pt)) return; - e.f ^= Pt; + if (n & (Oe | re)) { + if (!(n & mt)) return; + e.f ^= mt; } } - yn.push(e); + Ge.push(e); } -function lo(t) { +function Wa(t) { for (var e = [], n = t.first; n !== null; ) { - var r = n.f, i = (r & Te) !== 0, s = i && (r & Pt) !== 0; - if (!s && !(r & be)) { - if (r & ss) + var r = n.f, i = (r & re) !== 0, s = i && (r & mt) !== 0; + if (!s && !(r & Qt)) { + if (r & Fi) e.push(n); else if (i) - n.f ^= Pt; + n.f ^= mt; else { - var a = et; + var a = U; try { - et = n, En(n) && li(n); - } catch (u) { - vr(u, n, null, n.ctx); + U = n, en(n) && Hr(n); + } catch (f) { + Jn(f, n, null, n.ctx); } finally { - et = a; + U = a; } } - var o = n.first; - if (o !== null) { - n = o; + var l = n.first; + if (l !== null) { + n = l; continue; } } - var l = n.parent; - for (n = n.next; n === null && l !== null; ) - n = l.next, l = l.parent; + var o = n.parent; + for (n = n.next; n === null && o !== null; ) + n = o.next, o = o.parent; } return e; } -function Q(t) { +function Mt(t) { var e; - for (Ri(); yn.length > 0; ) - jn = !0, $s(), Ri(); + for (ui(); Ge.length > 0; ) + kn = !0, ns(), ui(); return ( /** @type {T} */ e ); } -function h(t) { - var e = t.f, n = (e & te) !== 0; - if (et !== null && !Zt) { - le !== null && le.includes(t) && ja(); - var r = et.deps; - t.rv < Wn && (t.rv = Wn, At === null && r !== null && r[qt] === t ? qt++ : At === null ? At = [t] : (!Se || !At.includes(t)) && At.push(t)); +function g(t) { + var e = t.f, n = (e & Dt) !== 0; + if (U !== null && !Ot) { + Bt !== null && Bt.includes(t) && Ia(); + var r = U.deps; + t.rv < Cn && (t.rv = Cn, ot === null && r !== null && r[xt] === t ? xt++ : ot === null ? ot = [t] : (!de || !ot.includes(t)) && ot.push(t)); } else if (n && /** @type {Derived} */ t.deps === null && /** @type {Derived} */ t.effects === null) { @@ -702,37 +702,37 @@ function h(t) { /** @type {Derived} */ t ), s = i.parent; - s !== null && !(s.f & Gt) && (i.f ^= Gt); + s !== null && !(s.f & Rt) && (i.f ^= Rt); } return n && (i = /** @type {Derived} */ - t, En(i) && vs(i)), t.v; + t, en(i) && Gi(i)), t.v; } -function Zn(t) { - var e = Zt; +function On(t) { + var e = Ot; try { - return Zt = !0, t(); + return Ot = !0, t(); } finally { - Zt = e; + Ot = e; } } -const uo = -7169; -function $e(t, e) { - t.f = t.f & uo | e; +const Ja = -7169; +function te(t, e) { + t.f = t.f & Ja | e; } -function fo(t) { - nt === null && et === null && Ba(), et !== null && et.f & Gt && nt === null && za(), oi && Va(); +function Za(t) { + G === null && U === null && Sa(), U !== null && U.f & Rt && G === null && ka(), Vr && Ta(); } -function co(t, e) { +function Qa(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function on(t, e, n, r = !0) { - var i = (t & sn) !== 0, s = nt, a = { - ctx: Ot, +function De(t, e, n, r = !0) { + var i = (t & Oe) !== 0, s = G, a = { + ctx: gt, deps: null, nodes_start: null, nodes_end: null, - f: t | Ee, + f: t | ie, first: null, fn: e, last: null, @@ -745,126 +745,126 @@ function on(t, e, n, r = !0) { }; if (n) try { - li(a), a.f |= Ca; - } catch (u) { - throw de(a), u; + Hr(a), a.f |= wa; + } catch (f) { + throw ee(a), f; } - else e !== null && mr(a); - var o = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (as | Xn)) === 0; - if (!o && !i && r && (s !== null && co(a, s), et !== null && et.f & te)) { - var l = ( + else e !== null && Zn(a); + var l = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (qi | An)) === 0; + if (!l && !i && r && (s !== null && Qa(a, s), U !== null && U.f & Dt)) { + var o = ( /** @type {Derived} */ - et + U ); - (l.effects ?? (l.effects = [])).push(a); + (o.effects ?? (o.effects = [])).push(a); } return a; } -function ui(t) { - fo(); - var e = nt !== null && (nt.f & Te) !== 0 && Ot !== null && !Ot.m; +function Pn(t) { + Za(); + var e = G !== null && (G.f & re) !== 0 && gt !== null && !gt.m; if (e) { var n = ( /** @type {ComponentContext} */ - Ot + gt ); (n.e ?? (n.e = [])).push({ fn: t, - effect: nt, - reaction: et + effect: G, + reaction: U }); } else { - var r = fi(t); + var r = Yr(t); return r; } } -function ho(t) { - const e = on(sn, t, !0); +function tl(t) { + const e = De(Oe, t, !0); return () => { - de(e); + ee(e); }; } -function vo(t) { - const e = on(sn, t, !0); +function el(t) { + const e = De(Oe, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Qn(e, () => { - de(e), r(void 0); - }) : (de(e), r(void 0)); + n.outro ? Dn(e, () => { + ee(e), r(void 0); + }) : (ee(e), r(void 0)); }); } -function fi(t) { - return on(ss, t, !1); +function Yr(t) { + return De(Fi, t, !1); } -function As(t) { - return on(Qr, t, !0); +function rs(t) { + return De(Mr, t, !0); } -function se(t, e = [], n = Pe) { +function un(t, e = [], n = jn) { const r = e.map(n); - return pr(() => t(...r.map(h))); + return Br(() => t(...r.map(g))); } -function pr(t, e = 0) { - return on(Qr | ti | e, t, !0); +function Br(t, e = 0) { + return De(Mr | Or | e, t, !0); } -function en(t, e = !0) { - return on(Qr | Te, t, !0, e); +function je(t, e = !0) { + return De(Mr | re, t, !0, e); } -function Ts(t) { +function is(t) { var e = t.teardown; if (e !== null) { - const n = oi, r = et; - Ci(!0), Qe(null); + const n = Vr, r = U; + hi(!0), ke(null); try { e.call(null); } finally { - Ci(n), Qe(r); + hi(n), ke(r); } } } -function Es(t, e = !1) { +function ss(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { var r = n.next; - de(n, e), n = r; + ee(n, e), n = r; } } -function mo(t) { +function nl(t) { for (var e = t.first; e !== null; ) { var n = e.next; - e.f & Te || de(e), e = n; + e.f & re || ee(e), e = n; } } -function de(t, e = !0) { +function ee(t, e = !0) { var n = !1; - if ((e || t.f & Ma) && t.nodes_start !== null) { + if ((e || t.f & xa) && t.nodes_start !== null) { for (var r = t.nodes_start, i = t.nodes_end; r !== null; ) { var s = r === i ? null : ( /** @type {TemplateNode} */ - /* @__PURE__ */ he(r) + /* @__PURE__ */ se(r) ); r.remove(), r = s; } n = !0; } - Es(t, e && !n), Jn(t, 0), $e(t, dr); + ss(t, e && !n), Mn(t, 0), te(t, Kn); var a = t.transitions; if (a !== null) - for (const l of a) - l.stop(); - Ts(t); - var o = t.parent; - o !== null && o.first !== null && ks(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = null; + for (const o of a) + o.stop(); + is(t); + var l = t.parent; + l !== null && l.first !== null && as(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = null; } -function ks(t) { +function as(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 Qn(t, e) { +function Dn(t, e) { var n = []; - ci(t, n, !0), Rs(n, () => { - de(t), e && e(); + zr(t, n, !0), ls(n, () => { + ee(t), e && e(); }); } -function Rs(t, e) { +function ls(t, e) { var n = t.length; if (n > 0) { var r = () => --n || e(); @@ -873,42 +873,42 @@ function Rs(t, e) { } else e(); } -function ci(t, e, n) { - if (!(t.f & be)) { - if (t.f ^= be, t.transitions !== null) +function zr(t, e, n) { + if (!(t.f & Qt)) { + if (t.f ^= Qt, t.transitions !== null) for (const a of t.transitions) (a.is_global || n) && e.push(a); for (var r = t.first; r !== null; ) { - var i = r.next, s = (r.f & ei) !== 0 || (r.f & Te) !== 0; - ci(r, e, s ? n : !1), r = i; + var i = r.next, s = (r.f & Pr) !== 0 || (r.f & re) !== 0; + zr(r, e, s ? n : !1), r = i; } } } -function tr(t) { - Ns(t, !0); +function In(t) { + os(t, !0); } -function Ns(t, e) { - if (t.f & be) { - t.f ^= be, t.f & Pt || (t.f ^= Pt), En(t) && ($e(t, Ee), mr(t)); +function os(t, e) { + if (t.f & Qt) { + t.f ^= Qt, t.f & mt || (t.f ^= mt), en(t) && (te(t, ie), Zn(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & ei) !== 0 || (n.f & Te) !== 0; - Ns(n, i ? e : !1), n = r; + var r = n.next, i = (n.f & Pr) !== 0 || (n.f & re) !== 0; + os(n, i ? e : !1), n = r; } if (t.transitions !== null) for (const s of t.transitions) (s.is_global || e) && s.in(); } } -function po(t) { +function rl(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -let Ot = null; -function Mi(t) { - Ot = t; +let gt = null; +function di(t) { + gt = t; } -function gr(t, e = !1, n) { - Ot = { - p: Ot, +function Xr(t, e = !1, n) { + gt = { + p: gt, c: null, e: null, m: !1, @@ -917,179 +917,169 @@ function gr(t, e = !1, n) { l: null }; } -function _r(t) { - const e = Ot; +function Ur(t) { + const e = gt; if (e !== null) { t !== void 0 && (e.x = t); const a = e.e; if (a !== null) { - var n = nt, r = et; + var n = G, r = U; e.e = null; try { for (var i = 0; i < a.length; i++) { var s = a[i]; - tn(s.effect), Qe(s.reaction), fi(s.fn); + Se(s.effect), ke(s.reaction), Yr(s.fn); } } finally { - tn(n), Qe(r); + Se(n), ke(r); } } - Ot = e.p, e.m = !0; + gt = e.p, e.m = !0; } return t || /** @type {T} */ {}; } -function Ss() { +function us() { return !0; } -const go = ["touchstart", "touchmove"]; -function _o(t) { - return go.includes(t); +const il = ["touchstart", "touchmove"]; +function sl(t) { + return il.includes(t); } -const Cs = /* @__PURE__ */ new Set(), Fr = /* @__PURE__ */ new Set(); -function Ms(t) { +const fs = /* @__PURE__ */ new Set(), gr = /* @__PURE__ */ new Set(); +function al(t) { for (var e = 0; e < t.length; e++) - Cs.add(t[e]); - for (var n of Fr) + fs.add(t[e]); + for (var n of gr) n(t); } -function Nn(t) { - var w; +function fn(t) { + var $; var e = this, n = ( /** @type {Node} */ e.ownerDocument - ), r = t.type, i = ((w = t.composedPath) == null ? void 0 : w.call(t)) || [], s = ( + ), r = t.type, i = (($ = t.composedPath) == null ? void 0 : $.call(t)) || [], s = ( /** @type {null | Element} */ i[0] || t.target - ), a = 0, o = t.__root; - if (o) { - var l = i.indexOf(o); - if (l !== -1 && (e === document || e === /** @type {any} */ + ), a = 0, l = t.__root; + if (l) { + var o = i.indexOf(l); + if (o !== -1 && (e === document || e === /** @type {any} */ window)) { t.__root = e; return; } - var u = i.indexOf(e); - if (u === -1) + var f = i.indexOf(e); + if (f === -1) return; - l <= u && (a = l); + o <= f && (a = o); } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - Gn(t, "currentTarget", { + Nn(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var f = et, d = nt; - Qe(null), tn(null); + var u = U, h = G; + ke(null), Se(null); try { - for (var c, v = []; s !== null; ) { - var m = s.assignedSlot || s.parentNode || /** @type {any} */ + for (var c, d = []; s !== null; ) { + var p = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { - var y = s["__" + r]; - if (y !== void 0 && (!/** @type {any} */ + var _ = s["__" + r]; + if (_ !== void 0 && (!/** @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)) - if (ni(y)) { - var [x, ...k] = y; - x.apply(s, [t, ...k]); + if (Dr(_)) { + var [b, ...y] = _; + b.apply(s, [t, ...y]); } else - y.call(s, t); - } catch (b) { - c ? v.push(b) : c = b; + _.call(s, t); + } catch (E) { + c ? d.push(E) : c = E; } - if (t.cancelBubble || m === e || m === null) + if (t.cancelBubble || p === e || p === null) break; - s = m; + s = p; } if (c) { - for (let b of v) + for (let E of d) queueMicrotask(() => { - throw b; + throw E; }); throw c; } } finally { - t.__root = e, delete t.currentTarget, Qe(f), tn(d); + t.__root = e, delete t.currentTarget, ke(u), Se(h); } } } -function di(t) { +function cs(t) { var e = document.createElement("template"); return e.innerHTML = t, e.content; } -function ue(t, e) { +function We(t, e) { var n = ( /** @type {Effect} */ - nt + G ); n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e); } // @__NO_SIDE_EFFECTS__ -function jt(t, e) { - var n = (e & Na) !== 0, r = (e & Sa) !== 0, i, s = !t.startsWith(""); +function Ie(t, e) { + var n = (e & ya) !== 0, r, i = !t.startsWith(""); return () => { - if (W) - return ue(j, null), j; - i === void 0 && (i = di(s ? t : "" + t), n || (i = /** @type {Node} */ - /* @__PURE__ */ ce(i))); - var a = ( + if (Z) + return We(X, null), X; + r === void 0 && (r = cs(i ? t : "" + t)); + var s = ( /** @type {TemplateNode} */ - r || ms ? document.importNode(i, !0) : i.cloneNode(!0) + n || Ki ? document.importNode(r, !0) : r.cloneNode(!0) ); - if (n) { - var o = ( + { + var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ce(a) + /* @__PURE__ */ we(s) ), l = ( /** @type {TemplateNode} */ - a.lastChild + s.lastChild ); - ue(o, l); - } else - ue(a, a); - return a; + We(a, l); + } + return s; }; } // @__NO_SIDE_EFFECTS__ -function yo(t, e, n = "svg") { +function ll(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { - if (W) - return ue(j, null), j; + if (Z) + return We(X, null), X; if (!s) { var a = ( /** @type {DocumentFragment} */ - di(i) - ), o = ( + cs(i) + ), l = ( /** @type {Element} */ - /* @__PURE__ */ ce(a) + /* @__PURE__ */ we(a) ); s = /** @type {Element} */ - /* @__PURE__ */ ce(o); + /* @__PURE__ */ we(l); } - var l = ( + var o = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return ue(l, l), l; + return We(o, o), o; }; } -function xo(t = "") { - if (!W) { - var e = qe(t + ""); - return ue(e, e), e; - } - var n = j; - return n.nodeType !== 3 && (n.before(n = qe()), Vt(n)), ue(n, n), n; -} -function Et(t, e) { - if (W) { - nt.nodes_end = j, Ze(); +function fe(t, e) { + if (Z) { + G.nodes_end = X, Wn(); return; } t !== null && t.before( @@ -1097,286 +1087,257 @@ function Et(t, e) { e ); } -function oe(t, e) { +function Ve(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 Ds(t, e) { - return Os(t, e); +function hs(t, e) { + return ds(t, e); } -function wo(t, e) { - Ir(), e.intro = e.intro ?? !1; - const n = e.target, r = W, i = j; +function ol(t, e) { + _r(), e.intro = e.intro ?? !1; + const n = e.target, r = Z, i = X; try { for (var s = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ce(n) + /* @__PURE__ */ we(n) ); s && (s.nodeType !== 8 || /** @type {Comment} */ - s.data !== is); ) + s.data !== Ii); ) s = /** @type {TemplateNode} */ - /* @__PURE__ */ he(s); + /* @__PURE__ */ se(s); if (!s) - throw Ge; - we(!0), Vt( + throw Xe; + Zt(!0), Xt( /** @type {Comment} */ s - ), Ze(); - const a = Os(t, { ...e, anchor: s }); - if (j === null || j.nodeType !== 8 || /** @type {Comment} */ - j.data !== Zr) - throw hr(), Ge; - return we(!1), /** @type {Exports} */ + ), Wn(); + const a = ds(t, { ...e, anchor: s }); + if (X === null || X.nodeType !== 8 || /** @type {Comment} */ + X.data !== Cr) + throw Lr(), Xe; + return Zt(!1), /** @type {Exports} */ a; } catch (a) { - if (a === Ge) - return e.recover === !1 && Xa(), Ir(), _s(n), we(!1), Ds(t, e); + if (a === Xe) + return e.recover === !1 && Ma(), _r(), Ji(n), Zt(!1), hs(t, e); throw a; } finally { - we(r), Vt(i); - } -} -const He = /* @__PURE__ */ new Map(); -function Os(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - Ir(); - var o = /* @__PURE__ */ new Set(), l = (d) => { - for (var c = 0; c < d.length; c++) { - var v = d[c]; - if (!o.has(v)) { - o.add(v); - var m = _o(v); - e.addEventListener(v, Nn, { passive: m }); - var y = He.get(v); - y === void 0 ? (document.addEventListener(v, Nn, { passive: m }), He.set(v, 1)) : He.set(v, y + 1); + Zt(r), Xt(i); + } +} +const Ee = /* @__PURE__ */ new Map(); +function ds(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + _r(); + var l = /* @__PURE__ */ new Set(), o = (h) => { + for (var c = 0; c < h.length; c++) { + var d = h[c]; + if (!l.has(d)) { + l.add(d); + var p = sl(d); + e.addEventListener(d, fn, { passive: p }); + var _ = Ee.get(d); + _ === void 0 ? (document.addEventListener(d, fn, { passive: p }), Ee.set(d, 1)) : Ee.set(d, _ + 1); } } }; - l(ri(Cs)), Fr.add(l); - var u = void 0, f = vo(() => { - var d = n ?? e.appendChild(qe()); - return en(() => { + o(Ir(fs)), gr.add(o); + var f = void 0, u = el(() => { + var h = n ?? e.appendChild(Tn()); + return je(() => { if (s) { - gr({}); + Xr({}); var c = ( /** @type {ComponentContext} */ - Ot + gt ); c.c = s; } - i && (r.$$events = i), W && ue( + i && (r.$$events = i), Z && We( /** @type {TemplateNode} */ - d, + h, null - ), u = t(d, r) || {}, W && (nt.nodes_end = j), s && _r(); + ), f = t(h, r) || {}, Z && (G.nodes_end = X), s && Ur(); }), () => { - var m; - for (var c of o) { - e.removeEventListener(c, Nn); - var v = ( + var p; + for (var c of l) { + e.removeEventListener(c, fn); + var d = ( /** @type {number} */ - He.get(c) + Ee.get(c) ); - --v === 0 ? (document.removeEventListener(c, Nn), He.delete(c)) : He.set(c, v); + --d === 0 ? (document.removeEventListener(c, fn), Ee.delete(c)) : Ee.set(c, d); } - Fr.delete(l), d !== n && ((m = d.parentNode) == null || m.removeChild(d)); + gr.delete(o), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); }; }); - return Lr.set(u, f), u; -} -let Lr = /* @__PURE__ */ new WeakMap(); -function bo(t, e) { - const n = Lr.get(t); - return n ? (Lr.delete(t), n(e)) : Promise.resolve(); -} -function xn(t, e, n = !1) { - W && Ze(); - var r = t, i = null, s = null, a = Ct, o = n ? ei : 0, l = !1; - const u = (d, c = !0) => { - l = !0, f(c, d); - }, f = (d, c) => { - if (a === (a = d)) return; - let v = !1; - if (W) { - const m = ( + return mr.set(f, u), f; +} +let mr = /* @__PURE__ */ new WeakMap(); +function ul(t, e) { + const n = mr.get(t); + return n ? (mr.delete(t), n(e)) : Promise.resolve(); +} +function vi(t, e, n = !1) { + Z && Wn(); + var r = t, i = null, s = null, a = vt, l = n ? Pr : 0, o = !1; + const f = (h, c = !0) => { + o = !0, u(c, h); + }, u = (h, c) => { + if (a === (a = h)) return; + let d = !1; + if (Z) { + const p = ( /** @type {Comment} */ - r.data === Jr + r.data === Sr ); - !!a === m && (r = Pr(), Vt(r), we(!1), v = !0); + !!a === p && (r = pr(), Xt(r), Zt(!1), d = !0); } - a ? (i ? tr(i) : c && (i = en(() => c(r))), s && Qn(s, () => { + a ? (i ? In(i) : c && (i = je(() => c(r))), s && Dn(s, () => { s = null; - })) : (s ? tr(s) : c && (s = en(() => c(r))), i && Qn(i, () => { + })) : (s ? In(s) : c && (s = je(() => c(r))), i && Dn(i, () => { i = null; - })), v && we(!0); + })), d && Zt(!0); }; - pr(() => { - l = !1, e(u), l || f(null, null); - }, o), W && (r = j); + Br(() => { + o = !1, e(f), o || u(null, null); + }, l), Z && (r = X); } -function je(t, e) { +function or(t, e) { return e; } -function $o(t, e, n, r) { +function fl(t, e, n, r) { for (var i = [], s = e.length, a = 0; a < s; a++) - ci(e[a].e, i, !0); - var o = s > 0 && i.length === 0 && n !== null; - if (o) { - var l = ( + zr(e[a].e, i, !0); + var l = s > 0 && i.length === 0 && n !== null; + if (l) { + var o = ( /** @type {Element} */ /** @type {Element} */ n.parentNode ); - _s(l), l.append( + Ji(o), o.append( /** @type {Element} */ n - ), r.clear(), Re(t, e[0].prev, e[s - 1].next); + ), r.clear(), ce(t, e[0].prev, e[s - 1].next); } - Rs(i, () => { - for (var u = 0; u < s; u++) { - var f = e[u]; - o || (r.delete(f.k), Re(t, f.prev, f.next)), de(f.e, !o); + ls(i, () => { + for (var f = 0; f < s; f++) { + var u = e[f]; + l || (r.delete(u.k), ce(t, u.prev, u.next)), ee(u.e, !l); } }); } -function Ke(t, e, n, r, i, s = null) { - var a = t, o = { items: /* @__PURE__ */ new Map(), first: null }, l = (e & rs) !== 0; - if (l) { - var u = ( - /** @type {Element} */ - t - ); - a = W ? Vt( - /** @type {Comment | Text} */ - /* @__PURE__ */ ce(u) - ) : u.appendChild(qe()); - } - W && Ze(); - var f = null, d = !1, c = /* @__PURE__ */ Za(() => { - var v = n(); - return ni(v) ? v : v == null ? [] : ri(v); +function ur(t, e, n, r, i, s = null) { + var a = t, l = { items: /* @__PURE__ */ new Map(), first: null }; + Z && Wn(); + var o = null, f = !1, u = /* @__PURE__ */ Va(() => { + var h = n(); + return Dr(h) ? h : h == null ? [] : Ir(h); }); - pr(() => { - var v = h(c), m = v.length; - if (d && m === 0) + Br(() => { + var h = g(u), c = h.length; + if (f && c === 0) return; - d = m === 0; - let y = !1; - if (W) { - var x = ( + f = c === 0; + let d = !1; + if (Z) { + var p = ( /** @type {Comment} */ - a.data === Jr + a.data === Sr ); - x !== (m === 0) && (a = Pr(), Vt(a), we(!1), y = !0); + p !== (c === 0) && (a = pr(), Xt(a), Zt(!1), d = !0); } - if (W) { - for (var k = null, w, b = 0; b < m; b++) { - if (j.nodeType === 8 && /** @type {Comment} */ - j.data === Zr) { + if (Z) { + for (var _ = null, b, y = 0; y < c; y++) { + if (X.nodeType === 8 && /** @type {Comment} */ + X.data === Cr) { a = /** @type {Comment} */ - j, y = !0, we(!1); + X, d = !0, Zt(!1); break; } - var $ = v[b], N = r($, b); - w = Ps( - j, - o, - k, + var $ = h[y], E = r($, y); + b = vs( + X, + l, + _, null, $, - N, - b, + E, + y, i, e, n - ), o.items.set(N, w), k = w; + ), l.items.set(E, b), _ = b; } - m > 0 && Vt(Pr()); + c > 0 && Xt(pr()); } - W || Ao(v, o, a, i, e, r, n), s !== null && (m === 0 ? f ? tr(f) : f = en(() => s(a)) : f !== null && Qn(f, () => { - f = null; - })), y && we(!0), h(c); - }), W && (a = j); -} -function Ao(t, e, n, r, i, s, a) { - var S, _t, ft, pt; - var o = (i & $a) !== 0, l = (i & (Kr | Wr)) !== 0, u = t.length, f = e.items, d = e.first, c = d, v, m = null, y, x = [], k = [], w, b, $, N; - if (o) - for (N = 0; N < u; N += 1) - w = t[N], b = s(w, N), $ = f.get(b), $ !== void 0 && ((S = $.a) == null || S.measure(), (y ?? (y = /* @__PURE__ */ new Set())).add($)); - for (N = 0; N < u; N += 1) { - if (w = t[N], b = s(w, N), $ = f.get(b), $ === void 0) { - var z = c ? ( + Z || cl(h, l, a, i, e, r, n), s !== null && (c === 0 ? o ? In(o) : o = je(() => s(a)) : o !== null && Dn(o, () => { + o = null; + })), d && Zt(!0), g(u); + }), Z && (a = X); +} +function cl(t, e, n, r, i, s, a) { + var l = t.length, o = e.items, f = e.first, u = f, h, c = null, d = [], p = [], _, b, y, $; + for ($ = 0; $ < l; $ += 1) { + if (_ = t[$], b = s(_, $), y = o.get(b), y === void 0) { + var E = u ? ( /** @type {TemplateNode} */ - c.e.nodes_start + u.e.nodes_start ) : n; - m = Ps( - z, + c = vs( + E, e, - m, - m === null ? e.first : m.next, - w, + c, + c === null ? e.first : c.next, + _, b, - N, + $, r, i, a - ), f.set(b, m), x = [], k = [], c = m.next; + ), o.set(b, c), d = [], p = [], u = c.next; continue; } - if (l && To($, w, N, i), $.e.f & be && (tr($.e), o && ((_t = $.a) == null || _t.unfix(), (y ?? (y = /* @__PURE__ */ new Set())).delete($))), $ !== c) { - if (v !== void 0 && v.has($)) { - if (x.length < k.length) { - var X = k[0], Y; - m = X.prev; - var st = x[0], at = x[x.length - 1]; - for (Y = 0; Y < x.length; Y += 1) - Di(x[Y], X, n); - for (Y = 0; Y < k.length; Y += 1) - v.delete(k[Y]); - Re(e, st.prev, at.next), Re(e, m, st), Re(e, at, X), c = X, m = at, N -= 1, x = [], k = []; + if (hl(y, _, $), y.e.f & Qt && In(y.e), y !== u) { + if (h !== void 0 && h.has(y)) { + if (d.length < p.length) { + var M = p[0], S; + c = M.prev; + var P = d[0], B = d[d.length - 1]; + for (S = 0; S < d.length; S += 1) + pi(d[S], M, n); + for (S = 0; S < p.length; S += 1) + h.delete(p[S]); + ce(e, P.prev, B.next), ce(e, c, P), ce(e, B, M), u = M, c = B, $ -= 1, d = [], p = []; } else - v.delete($), Di($, c, n), Re(e, $.prev, $.next), Re(e, $, m === null ? e.first : m.next), Re(e, m, $), m = $; + h.delete(y), pi(y, u, n), ce(e, y.prev, y.next), ce(e, y, c === null ? e.first : c.next), ce(e, c, y), c = y; continue; } - for (x = [], k = []; c !== null && c.k !== b; ) - c.e.f & be || (v ?? (v = /* @__PURE__ */ new Set())).add(c), k.push(c), c = c.next; - if (c === null) + for (d = [], p = []; u !== null && u.k !== b; ) + u.e.f & Qt || (h ?? (h = /* @__PURE__ */ new Set())).add(u), p.push(u), u = u.next; + if (u === null) continue; - $ = c; + y = u; } - x.push($), m = $, c = $.next; - } - if (c !== null || v !== void 0) { - for (var J = v === void 0 ? [] : ri(v); c !== null; ) - c.e.f & be || J.push(c), c = c.next; - var Z = J.length; - if (Z > 0) { - var E = i & rs && u === 0 ? n : null; - if (o) { - for (N = 0; N < Z; N += 1) - (ft = J[N].a) == null || ft.measure(); - for (N = 0; N < Z; N += 1) - (pt = J[N].a) == null || pt.fix(); - } - $o(e, J, E, f); + d.push(y), c = y, u = y.next; + } + if (u !== null || h !== void 0) { + for (var W = h === void 0 ? [] : Ir(h); u !== null; ) + u.e.f & Qt || W.push(u), u = u.next; + var rt = W.length; + if (rt > 0) { + var Q = null; + fl(e, W, Q, o); } } - o && ii(() => { - var ct; - if (y !== void 0) - for ($ of y) - (ct = $.a) == null || ct.apply(); - }), nt.first = e.first && e.first.e, nt.last = m && m.e; -} -function To(t, e, n, r) { - r & Kr && Or(t.v, e), r & Wr ? Or( - /** @type {Value} */ - t.i, - n - ) : t.i = n; -} -function Ps(t, e, n, r, i, s, a, o, l, u) { - var f = (l & Kr) !== 0, d = (l & Aa) === 0, c = f ? d ? /* @__PURE__ */ ai(i) : Ut(i) : i, v = l & Wr ? Ut(a) : a, m = { - i: v, + G.first = e.first && e.first.e, G.last = c && c.e; +} +function hl(t, e, n, r) { + zi(t.v, e), t.i = n; +} +function vs(t, e, n, r, i, s, a, l, o, f) { + var u = (o & ha) !== 0, h = (o & va) === 0, c = u ? h ? /* @__PURE__ */ qr(i) : Et(i) : i, d = o & da ? Et(a) : a, p = { + i: d, v: c, k: s, a: null, @@ -1386,11 +1347,11 @@ function Ps(t, e, n, r, i, s, a, o, l, u) { next: r }; try { - return m.e = en(() => o(t, c, v, u), W), m.e.prev = n && n.e, m.e.next = r && r.e, n === null ? e.first = m : (n.next = m, n.e.next = m.e), r !== null && (r.prev = m, r.e.prev = m.e), m; + return p.e = je(() => l(t, c, d, f), Z), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; } finally { } } -function Di(t, e, n) { +function pi(t, e, n) { for (var r = t.next ? ( /** @type {TemplateNode} */ t.next.e.nodes_start @@ -1403,45 +1364,16 @@ function Di(t, e, n) { ); s !== r; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ he(s) + /* @__PURE__ */ se(s) ); i.before(s), s = a; } } -function Re(t, e, n) { +function ce(t, e, n) { e === null ? t.first = n : (e.next = n, e.e.next = n && n.e), n !== null && (n.prev = e, n.e.prev = e && e.e); } -function Oi(t, e, n, r, i) { - var s = t, a = "", o; - pr(() => { - if (a === (a = e() ?? "")) { - W && Ze(); - return; - } - o !== void 0 && (de(o), o = void 0), a !== "" && (o = en(() => { - if (W) { - j.data; - for (var l = Ze(), u = l; l !== null && (l.nodeType !== 8 || /** @type {Comment} */ - l.data !== ""); ) - u = l, l = /** @type {TemplateNode} */ - /* @__PURE__ */ he(l); - if (l === null) - throw hr(), Ge; - ue(j, u), s = Vt(l); - return; - } - var f = a + "", d = di(f); - ue( - /** @type {TemplateNode} */ - /* @__PURE__ */ ce(d), - /** @type {TemplateNode} */ - d.lastChild - ), s.before(d); - })); - }); -} -function hi(t, e) { - ii(() => { +function ps(t, e) { + Yi(() => { var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -1459,143 +1391,98 @@ function hi(t, e) { } }); } -const Pi = [...` -\r\f \v\uFEFF`]; -function Eo(t, e, n) { - var r = t == null ? "" : "" + t; - 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 o = a + s; - (a === 0 || Pi.includes(r[a - 1])) && (o === r.length || Pi.includes(r[o])) ? r = (a === 0 ? "" : r.substring(0, a)) + r.substring(o + 1) : a = o; - } - } - return r === "" ? null : r; -} -function Sn(t, e, n, r, i, s) { - var a = t.__className; - if (W || a !== n) { - var o = Eo(n, r, s); - (!W || o !== t.getAttribute("class")) && (o == null ? t.removeAttribute("class") : t.className = o), t.__className = n; - } else if (s) - for (var l in s) { - var u = !!s[l]; - (i == null || u !== !!i[l]) && t.classList.toggle(l, u); - } - return s; -} -function Xe(t, e, n, r) { - var i = t.__attributes ?? (t.__attributes = {}); - W && (i[e] = t.getAttribute(e), e === "src" || e === "srcset" || e === "href" && t.nodeName === "LINK") || i[e] !== (i[e] = n) && (e === "style" && "__styles" in t && (t.__styles = {}), e === "loading" && (t[Da] = n), n == null ? t.removeAttribute(e) : typeof n != "string" && ko(t).includes(e) ? t[e] = n : t.setAttribute(e, n)); -} -var Ii = /* @__PURE__ */ new Map(); -function ko(t) { - var e = Ii.get(t.nodeName); - if (e) return e; - Ii.set(t.nodeName, e = []); - for (var n, r = t, i = Element.prototype; i !== r; ) { - n = Pa(r); - for (var s in n) - n[s].set && e.push(s); - r = ls(r); - } - return e; -} -function Fi(t, e, n, r) { +function _i(t, e, n, r) { var i = t.__styles ?? (t.__styles = {}); i[e] !== n && (i[e] = n, n == null ? t.style.removeProperty(e) : t.style.setProperty(e, n, "")); } -function Li(t, e) { - return t === e || (t == null ? void 0 : t[_n]) === e; +function gi(t, e) { + return t === e || (t == null ? void 0 : t[Ue]) === e; } -function We(t = {}, e, n, r) { - return fi(() => { +function yr(t = {}, e, n, r) { + return Yr(() => { var i, s; - return As(() => { - i = s, s = (r == null ? void 0 : r()) || [], Zn(() => { - t !== n(...s) && (e(t, ...s), i && Li(n(...i), t) && e(null, ...i)); + return rs(() => { + i = s, s = [], On(() => { + t !== n(...s) && (e(t, ...s), i && gi(n(...i), t) && e(null, ...i)); }); }), () => { - ii(() => { - s && Li(n(...s), t) && e(null, ...s); + Yi(() => { + s && gi(n(...s), t) && e(null, ...s); }); }; }), t; } -function Is(t) { - Ot === null && po(), ui(() => { - const e = Zn(t); +function dl(t) { + gt === null && rl(), Pn(() => { + const e = On(t); if (typeof e == "function") return ( /** @type {() => void} */ e ); }); } -let Cn = !1; -function Ro(t) { - var e = Cn; +let cn = !1; +function vl(t) { + var e = cn; try { - return Cn = !1, [t(), Cn]; + return cn = !1, [t(), cn]; } finally { - Cn = e; + cn = e; } } -function No(t, e = 1) { +function mi(t, e = 1) { const n = t(); return t(n + e), n; } -function it(t, e, n, r) { - var N; - var i = (n & Ta) !== 0, s = !0, a = (n & ka) !== 0, o = (n & Ra) !== 0, l = !1, u; - a ? [u, l] = Ro(() => ( +function Ht(t, e, n, r) { + var S; + var i = (n & pa) !== 0, s = !0, a = (n & ga) !== 0, l = (n & ma) !== 0, o = !1, f; + a ? [f, o] = vl(() => ( /** @type {V} */ t[e] - )) : u = /** @type {V} */ + )) : f = /** @type {V} */ t[e]; - var f = _n in t || os in t, d = a && (((N = Fe(t, e)) == null ? void 0 : N.set) ?? (f && e in t && ((z) => t[e] = z))) || void 0, c = ( + var u = Ue in t || Li in t, h = a && (((S = me(t, e)) == null ? void 0 : S.set) ?? (u && e in t && ((P) => t[e] = P))) || void 0, c = ( /** @type {V} */ r - ), v = !0, m = !1, y = () => (m = !0, v && (v = !1, o ? c = Zn( + ), d = !0, p = !1, _ = () => (p = !0, d && (d = !1, l ? c = On( /** @type {() => V} */ r ) : c = /** @type {V} */ r), c); - u === void 0 && r !== void 0 && (d && s && Ya(), u = y(), d && d(u)); - var x; - if (x = () => { - var z = ( + f === void 0 && r !== void 0 && (h && s && Oa(), f = _(), h && h(f)); + var b; + if (b = () => { + var P = ( /** @type {V} */ t[e] ); - return z === void 0 ? y() : (v = !0, m = !1, z); - }, !(n & Ea)) - return x; - if (d) { - var k = t.$$legacy; - return function(z, X) { - return arguments.length > 0 ? ((!X || k || l) && d(X ? x() : z), z) : x(); + return P === void 0 ? _() : (d = !0, p = !1, P); + }, !(n & _a)) + return b; + if (h) { + var y = t.$$legacy; + return function(P, B) { + return arguments.length > 0 ? ((!B || y || o) && h(B ? b() : P), P) : b(); }; } - var w = !1, b = /* @__PURE__ */ ai(u), $ = /* @__PURE__ */ Pe(() => { - var z = x(), X = h(b); - return w ? (w = !1, X) : b.v = z; + var $ = !1, E = /* @__PURE__ */ qr(f), M = /* @__PURE__ */ jn(() => { + var P = b(), B = g(E); + return $ ? ($ = !1, B) : E.v = P; }); - return i || ($.equals = si), function(z, X) { + return i || (M.equals = Fr), function(P, B) { if (arguments.length > 0) { - const Y = X ? h($) : a ? lt(z) : z; - return $.equals(Y) || (w = !0, B(b, Y), m && c !== void 0 && (c = Y), Zn(() => h($))), z; + const W = B ? g(M) : a ? lt(P) : P; + return M.equals(W) || ($ = !0, j(E, W), p && c !== void 0 && (c = W), On(() => g(M))), P; } - return h($); + return g(M); }; } -function So(t) { - return new Co(t); +function pl(t) { + return new _l(t); } -var xe, Yt; -class Co { +var Jt, At; +class _l { /** * @param {ComponentConstructorOptions & { * component: any; @@ -1603,57 +1490,57 @@ class Co { */ constructor(e) { /** @type {any} */ - kr(this, xe); + ar(this, Jt); /** @type {Record} */ - kr(this, Yt); + ar(this, At); var s; - var n = /* @__PURE__ */ new Map(), r = (a, o) => { - var l = /* @__PURE__ */ ai(o); - return n.set(a, l), l; + var n = /* @__PURE__ */ new Map(), r = (a, l) => { + var o = /* @__PURE__ */ qr(l); + return n.set(a, o), o; }; const i = new Proxy( { ...e.props || {}, $$events: {} }, { - get(a, o) { - return h(n.get(o) ?? r(o, Reflect.get(a, o))); + get(a, l) { + return g(n.get(l) ?? r(l, Reflect.get(a, l))); }, - has(a, o) { - return o === os ? !0 : (h(n.get(o) ?? r(o, Reflect.get(a, o))), Reflect.has(a, o)); + has(a, l) { + return l === Li ? !0 : (g(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); }, - set(a, o, l) { - return B(n.get(o) ?? r(o, l), l), Reflect.set(a, o, l); + set(a, l, o) { + return j(n.get(l) ?? r(l, o), o), Reflect.set(a, l, o); } } ); - Rr(this, Yt, (e.hydrate ? wo : Ds)(e.component, { + lr(this, At, (e.hydrate ? ol : hs)(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) && Q(), Rr(this, xe, i.$$events); - for (const a of Object.keys(St(this, Yt))) - a === "$set" || a === "$destroy" || a === "$on" || Gn(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && Mt(), lr(this, Jt, i.$$events); + for (const a of Object.keys(dt(this, At))) + a === "$set" || a === "$destroy" || a === "$on" || Nn(this, a, { get() { - return St(this, Yt)[a]; + return dt(this, At)[a]; }, /** @param {any} value */ - set(o) { - St(this, Yt)[a] = o; + set(l) { + dt(this, At)[a] = l; }, enumerable: !0 }); - St(this, Yt).$set = /** @param {Record} next */ + dt(this, At).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, St(this, Yt).$destroy = () => { - bo(St(this, Yt)); + }, dt(this, At).$destroy = () => { + ul(dt(this, At)); }; } /** @param {Record} props */ $set(e) { - St(this, Yt).$set(e); + dt(this, At).$set(e); } /** * @param {string} event @@ -1661,22 +1548,22 @@ class Co { * @returns {any} */ $on(e, n) { - St(this, xe)[e] = St(this, xe)[e] || []; + dt(this, Jt)[e] = dt(this, Jt)[e] || []; const r = (...i) => n.call(this, ...i); - return St(this, xe)[e].push(r), () => { - St(this, xe)[e] = St(this, xe)[e].filter( + return dt(this, Jt)[e].push(r), () => { + dt(this, Jt)[e] = dt(this, Jt)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - St(this, Yt).$destroy(); + dt(this, At).$destroy(); } } -xe = new WeakMap(), Yt = new WeakMap(); -let Fs; -typeof HTMLElement == "function" && (Fs = class extends HTMLElement { +Jt = new WeakMap(), At = new WeakMap(); +let _s; +typeof HTMLElement == "function" && (_s = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -1685,25 +1572,25 @@ typeof HTMLElement == "function" && (Fs = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - Jt(this, "$$ctor"); + St(this, "$$ctor"); /** Slots */ - Jt(this, "$$s"); + St(this, "$$s"); /** @type {any} The Svelte component instance */ - Jt(this, "$$c"); + St(this, "$$c"); /** Whether or not the custom element is connected */ - Jt(this, "$$cn", !1); + St(this, "$$cn", !1); /** @type {Record} Component props data */ - Jt(this, "$$d", {}); + St(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - Jt(this, "$$r", !1); + St(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - Jt(this, "$$p_d", {}); + St(this, "$$p_d", {}); /** @type {Record} Event listeners */ - Jt(this, "$$l", {}); + St(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - Jt(this, "$$l_u", /* @__PURE__ */ new Map()); + St(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - Jt(this, "$$me"); + St(this, "$$me"); this.$$ctor = e, this.$$s = n, r && this.attachShadow({ mode: "open" }); } /** @@ -1733,23 +1620,23 @@ typeof HTMLElement == "function" && (Fs = class extends HTMLElement { if (this.$$cn = !0, !this.$$c) { let n = function(s) { return (a) => { - const o = document.createElement("slot"); - s !== "default" && (o.name = s), Et(a, o); + const l = document.createElement("slot"); + s !== "default" && (l.name = s), fe(a, l); }; }; var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = Mo(this); + const r = {}, i = gl(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] = Ln(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = mn(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 = So({ + this.$$c = pl({ component: this.$$ctor, target: this.shadowRoot || this, props: { @@ -1757,28 +1644,28 @@ typeof HTMLElement == "function" && (Fs = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = ho(() => { - As(() => { + }), this.$$me = tl(() => { + rs(() => { var s; this.$$r = !0; - for (const a of Un(this.$$c)) { + for (const a of Rn(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const o = Ln( + const l = mn( 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 = {}; } @@ -1792,7 +1679,7 @@ typeof HTMLElement == "function" && (Fs = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = Ln(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] = mn(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -1803,12 +1690,12 @@ typeof HTMLElement == "function" && (Fs = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return Un(this.$$p_d).find( + return Rn(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function Ln(t, e, n, r) { +function mn(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]) @@ -1839,7 +1726,7 @@ function Ln(t, e, n, r) { return e; } } -function Mo(t) { +function gl(t) { const e = {}; return t.childNodes.forEach((n) => { e[ @@ -1848,79 +1735,79 @@ function Mo(t) { ] = !0; }), e; } -function vi(t, e, n, r, i, s) { - let a = class extends Fs { +function gs(t, e, n, r, i, s) { + let a = class extends _s { constructor() { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return Un(e).map( - (o) => (e[o].attribute || o).toLowerCase() + return Rn(e).map( + (l) => (e[l].attribute || l).toLowerCase() ); } }; - return Un(e).forEach((o) => { - Gn(a.prototype, o, { + return Rn(e).forEach((l) => { + Nn(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 = Ln(o, l, e), this.$$d[o] = l; - var u = this.$$c; - if (u) { - var f = (d = Fe(u, o)) == null ? void 0 : d.get; - f ? u[o] = l : u.$set({ [o]: l }); + set(o) { + var h; + o = mn(l, o, e), this.$$d[l] = o; + var f = this.$$c; + if (f) { + var u = (h = me(f, l)) == null ? void 0 : h.get; + u ? f[l] = o : f.$set({ [l]: o }); } } }); - }), r.forEach((o) => { - Gn(a.prototype, o, { + }), r.forEach((l) => { + Nn(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} */ a, a; } -var Do = { value: () => { +var ml = { value: () => { } }; -function Ls() { +function ms() { 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 qn(n); + return new yn(n); } -function qn(t) { +function yn(t) { this._ = t; } -function Oo(t, e) { +function yl(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 }; }); } -qn.prototype = Ls.prototype = { - constructor: qn, +yn.prototype = ms.prototype = { + constructor: yn, on: function(t, e) { - var n = this._, r = Oo(t + "", n), i, s = -1, a = r.length; + var n = this._, r = yl(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = Po(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = wl(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] = qi(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = qi(n[i], t.name, null); + if (i = (t = r[s]).type) n[i] = yi(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = yi(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 qn(t); + return new yn(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]; @@ -1932,135 +1819,135 @@ qn.prototype = Ls.prototype = { for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function Po(t, e) { +function wl(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } -function qi(t, e, n) { +function yi(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { - t[r] = Do, t = t.slice(0, r).concat(t.slice(r + 1)); + t[r] = ml, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } -var qr = "http://www.w3.org/1999/xhtml"; -const Vi = { +var wr = "http://www.w3.org/1999/xhtml"; +const wi = { svg: "http://www.w3.org/2000/svg", - xhtml: qr, + xhtml: wr, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function yr(t) { +function Qn(t) { var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Vi.hasOwnProperty(e) ? { space: Vi[e], local: t } : t; + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), wi.hasOwnProperty(e) ? { space: wi[e], local: t } : t; } -function Io(t) { +function xl(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; - return n === qr && e.documentElement.namespaceURI === qr ? e.createElement(t) : e.createElementNS(n, t); + return n === wr && e.documentElement.namespaceURI === wr ? e.createElement(t) : e.createElementNS(n, t); }; } -function Fo(t) { +function bl(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } -function qs(t) { - var e = yr(t); - return (e.local ? Fo : Io)(e); +function ys(t) { + var e = Qn(t); + return (e.local ? bl : xl)(e); } -function Lo() { +function $l() { } -function mi(t) { - return t == null ? Lo : function() { +function Gr(t) { + return t == null ? $l : function() { return this.querySelector(t); }; } -function qo(t) { - typeof t != "function" && (t = mi(t)); +function Al(t) { + typeof t != "function" && (t = Gr(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); + for (var s = e[i], a = s.length, l = r[i] = new Array(a), o, f, u = 0; u < a; ++u) + (o = s[u]) && (f = t.call(o, o.__data__, u, s)) && ("__data__" in o && (f.__data__ = o.__data__), l[u] = f); + return new bt(r, this._parents); } -function Vo(t) { +function El(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function zo() { +function Rl() { return []; } -function Vs(t) { - return t == null ? zo : function() { +function ws(t) { + return t == null ? Rl : function() { return this.querySelectorAll(t); }; } -function Bo(t) { +function Nl(t) { return function() { - return Vo(t.apply(this, arguments)); + return El(t.apply(this, arguments)); }; } -function Ho(t) { - typeof t == "function" ? t = Bo(t) : t = Vs(t); +function Tl(t) { + typeof t == "function" ? t = Nl(t) : t = ws(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); + for (var a = e[s], l = a.length, o, f = 0; f < l; ++f) + (o = a[f]) && (r.push(t.call(o, o.__data__, f, a)), i.push(o)); + return new bt(r, i); } -function zs(t) { +function xs(t) { return function() { return this.matches(t); }; } -function Bs(t) { +function bs(t) { return function(e) { return e.matches(t); }; } -var Xo = Array.prototype.find; -function Yo(t) { +var kl = Array.prototype.find; +function Sl(t) { return function() { - return Xo.call(this.children, t); + return kl.call(this.children, t); }; } -function Uo() { +function Cl() { return this.firstElementChild; } -function Go(t) { - return this.select(t == null ? Uo : Yo(typeof t == "function" ? t : Bs(t))); +function Ml(t) { + return this.select(t == null ? Cl : Sl(typeof t == "function" ? t : bs(t))); } -var jo = Array.prototype.filter; -function Ko() { +var Ol = Array.prototype.filter; +function Pl() { return Array.from(this.children); } -function Wo(t) { +function Dl(t) { return function() { - return jo.call(this.children, t); + return Ol.call(this.children, t); }; } -function Jo(t) { - return this.selectAll(t == null ? Ko : Wo(typeof t == "function" ? t : Bs(t))); +function Il(t) { + return this.selectAll(t == null ? Pl : Dl(typeof t == "function" ? t : bs(t))); } -function Zo(t) { - typeof t != "function" && (t = zs(t)); +function Fl(t) { + typeof t != "function" && (t = xs(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); + for (var s = e[i], a = s.length, l = r[i] = [], o, f = 0; f < a; ++f) + (o = s[f]) && t.call(o, o.__data__, f, s) && l.push(o); + return new bt(r, this._parents); } -function Hs(t) { +function $s(t) { return new Array(t.length); } -function Qo() { - return new zt(this._enter || this._groups.map(Hs), this._parents); +function ql() { + return new bt(this._enter || this._groups.map($s), this._parents); } -function er(t, e) { +function Fn(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -er.prototype = { - constructor: er, +Fn.prototype = { + constructor: Fn, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -2074,91 +1961,91 @@ er.prototype = { return this._parent.querySelectorAll(t); } }; -function tl(t) { +function Ll(t) { return function() { return t; }; } -function el(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 er(t, s[a]); - for (; a < l; ++a) - (o = e[a]) && (i[a] = o); -} -function nl(t, e, n, r, i, s, a) { - var o, l, u = /* @__PURE__ */ new Map(), f = e.length, d = 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 < d; ++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 er(t, s[o]); - for (o = 0; o < f; ++o) - (l = e[o]) && u.get(c[o]) === l && (i[o] = l); -} -function rl(t) { +function Vl(t, e, n, r, i, s) { + for (var a = 0, l, o = e.length, f = s.length; a < f; ++a) + (l = e[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new Fn(t, s[a]); + for (; a < o; ++a) + (l = e[a]) && (i[a] = l); +} +function Hl(t, e, n, r, i, s, a) { + var l, o, f = /* @__PURE__ */ new Map(), u = e.length, h = s.length, c = new Array(u), d; + for (l = 0; l < u; ++l) + (o = e[l]) && (c[l] = d = a.call(o, o.__data__, l, e) + "", f.has(d) ? i[l] = o : f.set(d, o)); + for (l = 0; l < h; ++l) + d = a.call(t, s[l], l, s) + "", (o = f.get(d)) ? (r[l] = o, o.__data__ = s[l], f.delete(d)) : n[l] = new Fn(t, s[l]); + for (l = 0; l < u; ++l) + (o = e[l]) && f.get(c[l]) === o && (i[l] = o); +} +function Yl(t) { return t.__data__; } -function il(t, e) { - if (!arguments.length) return Array.from(this, rl); - var n = e ? nl : el, r = this._parents, i = this._groups; - typeof t != "function" && (t = tl(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, v = sl(t.call(f, f && f.__data__, u, r)), m = v.length, y = o[u] = new Array(m), x = a[u] = new Array(m), k = l[u] = new Array(c); - n(f, d, y, x, k, v, e); - for (var w = 0, b = 0, $, N; w < m; ++w) - if ($ = y[w]) { - for (w >= b && (b = w + 1); !(N = x[b]) && ++b < m; ) ; - $._next = N || null; +function Bl(t, e) { + if (!arguments.length) return Array.from(this, Yl); + var n = e ? Hl : Vl, r = this._parents, i = this._groups; + typeof t != "function" && (t = Ll(t)); + for (var s = i.length, a = new Array(s), l = new Array(s), o = new Array(s), f = 0; f < s; ++f) { + var u = r[f], h = i[f], c = h.length, d = zl(t.call(u, u && u.__data__, f, r)), p = d.length, _ = l[f] = new Array(p), b = a[f] = new Array(p), y = o[f] = new Array(c); + n(u, h, _, b, y, d, e); + for (var $ = 0, E = 0, M, S; $ < p; ++$) + if (M = _[$]) { + for ($ >= E && (E = $ + 1); !(S = b[E]) && ++E < p; ) ; + M._next = S || null; } } - return a = new zt(a, r), a._enter = o, a._exit = l, a; + return a = new bt(a, r), a._enter = l, a._exit = o, a; } -function sl(t) { +function zl(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function al() { - return new zt(this._exit || this._groups.map(Hs), this._parents); +function Xl() { + return new bt(this._exit || this._groups.map($s), this._parents); } -function ol(t, e, n) { +function Ul(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 ll(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), v, m = 0; m < d; ++m) - (v = u[m] || f[m]) && (c[m] = v); - for (; l < i; ++l) - o[l] = n[l]; - return new zt(o, this._parents); +function Gl(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), l = new Array(i), o = 0; o < a; ++o) + for (var f = n[o], u = r[o], h = f.length, c = l[o] = new Array(h), d, p = 0; p < h; ++p) + (d = f[p] || u[p]) && (c[p] = d); + for (; o < i; ++o) + l[o] = n[o]; + return new bt(l, this._parents); } -function ul() { +function Kl() { 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 fl(t) { - t || (t = cl); - function e(d, c) { - return d && c ? t(d.__data__, c.__data__) : !d - !c; +function jl(t) { + t || (t = Wl); + 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); + for (var a = n[s], l = a.length, o = i[s] = new Array(l), f, u = 0; u < l; ++u) + (f = a[u]) && (o[u] = f); + o.sort(e); } - return new zt(i, this._parents).order(); + return new bt(i, this._parents).order(); } -function cl(t, e) { +function Wl(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function dl() { +function Jl() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } -function hl() { +function Zl() { return Array.from(this); } -function vl() { +function Ql() { 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]; @@ -2166,114 +2053,114 @@ function vl() { } return null; } -function ml() { +function to() { let t = 0; for (const e of this) ++t; return t; } -function pl() { +function eo() { return !this.node(); } -function gl(t) { +function no(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); + for (var i = e[n], s = 0, a = i.length, l; s < a; ++s) + (l = i[s]) && t.call(l, l.__data__, s, i); return this; } -function _l(t) { +function ro(t) { return function() { this.removeAttribute(t); }; } -function yl(t) { +function io(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function xl(t, e) { +function so(t, e) { return function() { this.setAttribute(t, e); }; } -function wl(t, e) { +function ao(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } -function bl(t, e) { +function lo(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function $l(t, e) { +function oo(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 Al(t, e) { - var n = yr(t); +function uo(t, e) { + var n = Qn(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 ? yl : _l : typeof e == "function" ? n.local ? $l : bl : n.local ? wl : xl)(n, e)); + return this.each((e == null ? n.local ? io : ro : typeof e == "function" ? n.local ? oo : lo : n.local ? ao : so)(n, e)); } -function Xs(t) { +function As(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function Tl(t) { +function fo(t) { return function() { this.style.removeProperty(t); }; } -function El(t, e, n) { +function co(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } -function kl(t, e, n) { +function ho(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function Rl(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? Tl : typeof e == "function" ? kl : El)(t, e, n ?? "")) : nn(this.node(), t); +function vo(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? fo : typeof e == "function" ? ho : co)(t, e, n ?? "")) : Ce(this.node(), t); } -function nn(t, e) { - return t.style.getPropertyValue(e) || Xs(t).getComputedStyle(t, null).getPropertyValue(e); +function Ce(t, e) { + return t.style.getPropertyValue(e) || As(t).getComputedStyle(t, null).getPropertyValue(e); } -function Nl(t) { +function po(t) { return function() { delete this[t]; }; } -function Sl(t, e) { +function _o(t, e) { return function() { this[t] = e; }; } -function Cl(t, e) { +function go(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } -function Ml(t, e) { - return arguments.length > 1 ? this.each((e == null ? Nl : typeof e == "function" ? Cl : Sl)(t, e)) : this.node()[t]; +function mo(t, e) { + return arguments.length > 1 ? this.each((e == null ? po : typeof e == "function" ? go : _o)(t, e)) : this.node()[t]; } -function Ys(t) { +function Es(t) { return t.trim().split(/^|\s+/); } -function pi(t) { - return t.classList || new Us(t); +function Kr(t) { + return t.classList || new Rs(t); } -function Us(t) { - this._node = t, this._names = Ys(t.getAttribute("class") || ""); +function Rs(t) { + this._node = t, this._names = Es(t.getAttribute("class") || ""); } -Us.prototype = { +Rs.prototype = { add: function(t) { var e = this._names.indexOf(t); e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); @@ -2286,129 +2173,129 @@ Us.prototype = { return this._names.indexOf(t) >= 0; } }; -function Gs(t, e) { - for (var n = pi(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); +function Ns(t, e) { + for (var n = Kr(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function js(t, e) { - for (var n = pi(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +function Ts(t, e) { + for (var n = Kr(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function Dl(t) { +function yo(t) { return function() { - Gs(this, t); + Ns(this, t); }; } -function Ol(t) { +function wo(t) { return function() { - js(this, t); + Ts(this, t); }; } -function Pl(t, e) { +function xo(t, e) { return function() { - (e.apply(this, arguments) ? Gs : js)(this, t); + (e.apply(this, arguments) ? Ns : Ts)(this, t); }; } -function Il(t, e) { - var n = Ys(t + ""); +function bo(t, e) { + var n = Es(t + ""); if (arguments.length < 2) { - for (var r = pi(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Kr(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? Pl : e ? Dl : Ol)(n, e)); + return this.each((typeof e == "function" ? xo : e ? yo : wo)(n, e)); } -function Fl() { +function $o() { this.textContent = ""; } -function Ll(t) { +function Ao(t) { return function() { this.textContent = t; }; } -function ql(t) { +function Eo(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } -function Vl(t) { - return arguments.length ? this.each(t == null ? Fl : (typeof t == "function" ? ql : Ll)(t)) : this.node().textContent; +function Ro(t) { + return arguments.length ? this.each(t == null ? $o : (typeof t == "function" ? Eo : Ao)(t)) : this.node().textContent; } -function zl() { +function No() { this.innerHTML = ""; } -function Bl(t) { +function To(t) { return function() { this.innerHTML = t; }; } -function Hl(t) { +function ko(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } -function Xl(t) { - return arguments.length ? this.each(t == null ? zl : (typeof t == "function" ? Hl : Bl)(t)) : this.node().innerHTML; +function So(t) { + return arguments.length ? this.each(t == null ? No : (typeof t == "function" ? ko : To)(t)) : this.node().innerHTML; } -function Yl() { +function Co() { this.nextSibling && this.parentNode.appendChild(this); } -function Ul() { - return this.each(Yl); +function Mo() { + return this.each(Co); } -function Gl() { +function Oo() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function jl() { - return this.each(Gl); +function Po() { + return this.each(Oo); } -function Kl(t) { - var e = typeof t == "function" ? t : qs(t); +function Do(t) { + var e = typeof t == "function" ? t : ys(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function Wl() { +function Io() { return null; } -function Jl(t, e) { - var n = typeof t == "function" ? t : qs(t), r = e == null ? Wl : typeof e == "function" ? e : mi(e); +function Fo(t, e) { + var n = typeof t == "function" ? t : ys(t), r = e == null ? Io : typeof e == "function" ? e : Gr(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function Zl() { +function qo() { var t = this.parentNode; t && t.removeChild(this); } -function Ql() { - return this.each(Zl); +function Lo() { + return this.each(qo); } -function tu() { +function Vo() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function eu() { +function Ho() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function nu(t) { - return this.select(t ? eu : tu); +function Yo(t) { + return this.select(t ? Ho : Vo); } -function ru(t) { +function Bo(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } -function iu(t) { +function zo(t) { return function(e) { t.call(this, e, this.__data__); }; } -function su(t) { +function Xo(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 au(t) { +function Uo(t) { return function() { var e = this.__on; if (e) { @@ -2418,11 +2305,11 @@ function au(t) { } }; } -function ou(t, e, n) { +function Go(t, e, n) { return function() { - var r = this.__on, i, s = iu(e); + var r = this.__on, i, s = zo(e); if (r) { - for (var a = 0, o = r.length; a < o; ++a) + for (var a = 0, l = r.length; a < l; ++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; @@ -2431,105 +2318,105 @@ function ou(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 lu(t, e, n) { - var r = su(t + ""), i, s = r.length, a; +function Ko(t, e, n) { + var r = Xo(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; + var l = this.node().__on; + if (l) { + for (var o = 0, f = l.length, u; o < f; ++o) + for (i = 0, u = l[o]; i < s; ++i) + if ((a = r[i]).type === u.type && a.name === u.name) + return u.value; } return; } - for (o = e ? ou : au, i = 0; i < s; ++i) this.each(o(r[i], e, n)); + for (l = e ? Go : Uo, i = 0; i < s; ++i) this.each(l(r[i], e, n)); return this; } -function Ks(t, e, n) { - var r = Xs(t), i = r.CustomEvent; +function ks(t, e, n) { + var r = As(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 uu(t, e) { +function jo(t, e) { return function() { - return Ks(this, t, e); + return ks(this, t, e); }; } -function fu(t, e) { +function Wo(t, e) { return function() { - return Ks(this, t, e.apply(this, arguments)); + return ks(this, t, e.apply(this, arguments)); }; } -function cu(t, e) { - return this.each((typeof e == "function" ? fu : uu)(t, e)); +function Jo(t, e) { + return this.each((typeof e == "function" ? Wo : jo)(t, e)); } -function* du() { +function* Zo() { 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 Ws = [null]; -function zt(t, e) { +var Ss = [null]; +function bt(t, e) { this._groups = t, this._parents = e; } -function ln() { - return new zt([[document.documentElement]], Ws); +function Fe() { + return new bt([[document.documentElement]], Ss); } -function hu() { +function Qo() { return this; } -zt.prototype = ln.prototype = { - constructor: zt, - select: qo, - selectAll: Ho, - selectChild: Go, - selectChildren: Jo, - filter: Zo, - data: il, - enter: Qo, - exit: al, - join: ol, - merge: ll, - selection: hu, - order: ul, - sort: fl, - call: dl, - nodes: hl, - node: vl, - size: ml, - empty: pl, - each: gl, - attr: Al, - style: Rl, - property: Ml, - classed: Il, - text: Vl, - html: Xl, - raise: Ul, - lower: jl, - append: Kl, - insert: Jl, - remove: Ql, - clone: nu, - datum: ru, - on: lu, - dispatch: cu, - [Symbol.iterator]: du +bt.prototype = Fe.prototype = { + constructor: bt, + select: Al, + selectAll: Tl, + selectChild: Ml, + selectChildren: Il, + filter: Fl, + data: Bl, + enter: ql, + exit: Xl, + join: Ul, + merge: Gl, + selection: Qo, + order: Kl, + sort: jl, + call: Jl, + nodes: Zl, + node: Ql, + size: to, + empty: eo, + each: no, + attr: uo, + style: vo, + property: mo, + classed: bo, + text: Ro, + html: So, + raise: Mo, + lower: Po, + append: Do, + insert: Fo, + remove: Lo, + clone: Yo, + datum: Bo, + on: Ko, + dispatch: Jo, + [Symbol.iterator]: Zo }; -function gt(t) { - return typeof t == "string" ? new zt([[document.querySelector(t)]], [document.documentElement]) : new zt([[t]], Ws); +function st(t) { + return typeof t == "string" ? new bt([[document.querySelector(t)]], [document.documentElement]) : new bt([[t]], Ss); } -function gi(t, e, n) { +function jr(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } -function Js(t, e) { +function Cs(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } -function kn() { +function nn() { } -var bn = 0.7, nr = 1 / bn, Je = "\\s*([+-]?\\d+)\\s*", $n = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", fe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", vu = /^#([0-9a-f]{3,8})$/, mu = new RegExp(`^rgb\\(${Je},${Je},${Je}\\)$`), pu = new RegExp(`^rgb\\(${fe},${fe},${fe}\\)$`), gu = new RegExp(`^rgba\\(${Je},${Je},${Je},${$n}\\)$`), _u = new RegExp(`^rgba\\(${fe},${fe},${fe},${$n}\\)$`), yu = new RegExp(`^hsl\\(${$n},${fe},${fe}\\)$`), xu = new RegExp(`^hsla\\(${$n},${fe},${fe},${$n}\\)$`), zi = { +var Je = 0.7, qn = 1 / Je, Te = "\\s*([+-]?\\d+)\\s*", Ze = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", zt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", tu = /^#([0-9a-f]{3,8})$/, eu = new RegExp(`^rgb\\(${Te},${Te},${Te}\\)$`), nu = new RegExp(`^rgb\\(${zt},${zt},${zt}\\)$`), ru = new RegExp(`^rgba\\(${Te},${Te},${Te},${Ze}\\)$`), iu = new RegExp(`^rgba\\(${zt},${zt},${zt},${Ze}\\)$`), su = new RegExp(`^hsl\\(${Ze},${zt},${zt}\\)$`), au = new RegExp(`^hsla\\(${Ze},${zt},${zt},${Ze}\\)$`), xi = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -2679,178 +2566,178 @@ var bn = 0.7, nr = 1 / bn, Je = "\\s*([+-]?\\d+)\\s*", $n = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -gi(kn, Ve, { +jr(nn, xe, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, - hex: Bi, + hex: bi, // Deprecated! Use color.formatHex. - formatHex: Bi, - formatHex8: wu, - formatHsl: bu, - formatRgb: Hi, - toString: Hi + formatHex: bi, + formatHex8: lu, + formatHsl: ou, + formatRgb: $i, + toString: $i }); -function Bi() { +function bi() { return this.rgb().formatHex(); } -function wu() { +function lu() { return this.rgb().formatHex8(); } -function bu() { - return Zs(this).formatHsl(); +function ou() { + return Ms(this).formatHsl(); } -function Hi() { +function $i() { return this.rgb().formatRgb(); } -function Ve(t) { +function xe(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = vu.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Xi(e) : n === 3 ? new Dt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? Mn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? Mn(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 = mu.exec(t)) ? new Dt(e[1], e[2], e[3], 1) : (e = pu.exec(t)) ? new Dt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = gu.exec(t)) ? Mn(e[1], e[2], e[3], e[4]) : (e = _u.exec(t)) ? Mn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = yu.exec(t)) ? Gi(e[1], e[2] / 100, e[3] / 100, 1) : (e = xu.exec(t)) ? Gi(e[1], e[2] / 100, e[3] / 100, e[4]) : zi.hasOwnProperty(t) ? Xi(zi[t]) : t === "transparent" ? new Dt(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = tu.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ai(e) : n === 3 ? new _t(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? hn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? hn(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 = eu.exec(t)) ? new _t(e[1], e[2], e[3], 1) : (e = nu.exec(t)) ? new _t(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = ru.exec(t)) ? hn(e[1], e[2], e[3], e[4]) : (e = iu.exec(t)) ? hn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = su.exec(t)) ? Ni(e[1], e[2] / 100, e[3] / 100, 1) : (e = au.exec(t)) ? Ni(e[1], e[2] / 100, e[3] / 100, e[4]) : xi.hasOwnProperty(t) ? Ai(xi[t]) : t === "transparent" ? new _t(NaN, NaN, NaN, 0) : null; } -function Xi(t) { - return new Dt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +function Ai(t) { + return new _t(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function Mn(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new Dt(t, e, n, r); +function hn(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new _t(t, e, n, r); } -function $u(t) { - return t instanceof kn || (t = Ve(t)), t ? (t = t.rgb(), new Dt(t.r, t.g, t.b, t.opacity)) : new Dt(); +function uu(t) { + return t instanceof nn || (t = xe(t)), t ? (t = t.rgb(), new _t(t.r, t.g, t.b, t.opacity)) : new _t(); } -function Vr(t, e, n, r) { - return arguments.length === 1 ? $u(t) : new Dt(t, e, n, r ?? 1); +function xr(t, e, n, r) { + return arguments.length === 1 ? uu(t) : new _t(t, e, n, r ?? 1); } -function Dt(t, e, n, r) { +function _t(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -gi(Dt, Vr, Js(kn, { +jr(_t, xr, Cs(nn, { brighter(t) { - return t = t == null ? nr : Math.pow(nr, t), new Dt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? qn : Math.pow(qn, t), new _t(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? bn : Math.pow(bn, t), new Dt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Je : Math.pow(Je, t), new _t(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new Dt(Le(this.r), Le(this.g), Le(this.b), rr(this.opacity)); + return new _t(ye(this.r), ye(this.g), ye(this.b), Ln(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: Yi, + hex: Ei, // Deprecated! Use color.formatHex. - formatHex: Yi, - formatHex8: Au, - formatRgb: Ui, - toString: Ui + formatHex: Ei, + formatHex8: fu, + formatRgb: Ri, + toString: Ri })); -function Yi() { - return `#${Ie(this.r)}${Ie(this.g)}${Ie(this.b)}`; +function Ei() { + return `#${ge(this.r)}${ge(this.g)}${ge(this.b)}`; } -function Au() { - return `#${Ie(this.r)}${Ie(this.g)}${Ie(this.b)}${Ie((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function fu() { + return `#${ge(this.r)}${ge(this.g)}${ge(this.b)}${ge((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function Ui() { - const t = rr(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${Le(this.r)}, ${Le(this.g)}, ${Le(this.b)}${t === 1 ? ")" : `, ${t})`}`; +function Ri() { + const t = Ln(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${ye(this.r)}, ${ye(this.g)}, ${ye(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function rr(t) { +function Ln(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function Le(t) { +function ye(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function Ie(t) { - return t = Le(t), (t < 16 ? "0" : "") + t.toString(16); +function ge(t) { + return t = ye(t), (t < 16 ? "0" : "") + t.toString(16); } -function Gi(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Qt(t, e, n, r); +function Ni(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Pt(t, e, n, r); } -function Zs(t) { - if (t instanceof Qt) return new Qt(t.h, t.s, t.l, t.opacity); - if (t instanceof kn || (t = Ve(t)), !t) return new Qt(); - if (t instanceof Qt) return t; +function Ms(t) { + if (t instanceof Pt) return new Pt(t.h, t.s, t.l, t.opacity); + if (t instanceof nn || (t = xe(t)), !t) return new Pt(); + if (t instanceof Pt) 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 Qt(a, o, l, t.opacity); + 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, l = s - i, o = (s + i) / 2; + return l ? (e === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - e) / l + 2 : a = (e - n) / l + 4, l /= o < 0.5 ? s + i : 2 - s - i, a *= 60) : l = o > 0 && o < 1 ? 0 : a, new Pt(a, l, o, t.opacity); } -function Tu(t, e, n, r) { - return arguments.length === 1 ? Zs(t) : new Qt(t, e, n, r ?? 1); +function cu(t, e, n, r) { + return arguments.length === 1 ? Ms(t) : new Pt(t, e, n, r ?? 1); } -function Qt(t, e, n, r) { +function Pt(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -gi(Qt, Tu, Js(kn, { +jr(Pt, cu, Cs(nn, { brighter(t) { - return t = t == null ? nr : Math.pow(nr, t), new Qt(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? qn : Math.pow(qn, t), new Pt(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? bn : Math.pow(bn, t), new Qt(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Je : Math.pow(Je, t), new Pt(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( - Nr(t >= 240 ? t - 240 : t + 120, i, r), - Nr(t, i, r), - Nr(t < 120 ? t + 240 : t - 120, i, r), + return new _t( + fr(t >= 240 ? t - 240 : t + 120, i, r), + fr(t, i, r), + fr(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new Qt(ji(this.h), Dn(this.s), Dn(this.l), rr(this.opacity)); + return new Pt(Ti(this.h), dn(this.s), dn(this.l), Ln(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 = rr(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${ji(this.h)}, ${Dn(this.s) * 100}%, ${Dn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = Ln(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${Ti(this.h)}, ${dn(this.s) * 100}%, ${dn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function ji(t) { +function Ti(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function Dn(t) { +function dn(t) { return Math.max(0, Math.min(1, t || 0)); } -function Nr(t, e, n) { +function fr(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 _i = (t) => () => t; -function Eu(t, e) { +const Wr = (t) => () => t; +function hu(t, e) { return function(n) { return t + n * e; }; } -function ku(t, e, n) { +function du(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 Ru(t) { - return (t = +t) == 1 ? Qs : function(e, n) { - return n - e ? ku(e, n, t) : _i(isNaN(e) ? n : e); +function vu(t) { + return (t = +t) == 1 ? Os : function(e, n) { + return n - e ? du(e, n, t) : Wr(isNaN(e) ? n : e); }; } -function Qs(t, e) { +function Os(t, e) { var n = e - t; - return n ? Eu(t, n) : _i(isNaN(t) ? e : t); + return n ? hu(t, n) : Wr(isNaN(t) ? e : t); } -const ir = function t(e) { - var n = Ru(e); +const Vn = function t(e) { + var n = vu(e); function r(i, s) { - var a = n((i = Vr(i)).r, (s = Vr(s)).r), o = n(i.g, s.g), l = n(i.b, s.b), u = Qs(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 + ""; + var a = n((i = xr(i)).r, (s = xr(s)).r), l = n(i.g, s.g), o = n(i.b, s.b), f = Os(i.opacity, s.opacity); + return function(u) { + return i.r = a(u), i.g = l(u), i.b = o(u), i.opacity = f(u), i + ""; }; } return r.gamma = t, r; }(1); -function Nu(t, e) { +function pu(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { @@ -2858,64 +2745,64 @@ function Nu(t, e) { return r; }; } -function Su(t) { +function _u(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function Cu(t, e) { +function gu(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] = Ye(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = Re(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 function(l) { + for (a = 0; a < r; ++a) s[a] = i[a](l); return s; }; } -function Mu(t, e) { +function mu(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 Yt(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } -function Du(t, e) { +function yu(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] = Ye(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = Re(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var zr = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Sr = new RegExp(zr.source, "g"); -function Ou(t) { +var br = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, cr = new RegExp(br.source, "g"); +function wu(t) { return function() { return t; }; } -function Pu(t) { +function xu(t) { return function(e) { return t(e) + ""; }; } -function ta(t, e) { - var n = zr.lastIndex = Sr.lastIndex = 0, r, i, s, a = -1, o = [], l = []; - for (t = t + "", e = e + ""; (r = zr.exec(t)) && (i = Sr.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 = Sr.lastIndex; - return n < e.length && (s = e.slice(n), o[a] ? o[a] += s : o[++a] = s), o.length < 2 ? l[0] ? Pu(l[0].x) : Ou(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 Ps(t, e) { + var n = br.lastIndex = cr.lastIndex = 0, r, i, s, a = -1, l = [], o = []; + for (t = t + "", e = e + ""; (r = br.exec(t)) && (i = cr.exec(e)); ) + (s = i.index) > n && (s = e.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: Yt(r, i) })), n = cr.lastIndex; + return n < e.length && (s = e.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? o[0] ? xu(o[0].x) : wu(e) : (e = o.length, function(f) { + for (var u = 0, h; u < e; ++u) l[(h = o[u]).i] = h.x(f); + return l.join(""); }); } -function Ye(t, e) { +function Re(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? _i(e) : (n === "number" ? ae : n === "string" ? (r = Ve(e)) ? (e = r, ir) : ta : e instanceof Ve ? ir : e instanceof Date ? Mu : Su(e) ? Nu : Array.isArray(e) ? Cu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Du : ae)(t, e); + return e == null || n === "boolean" ? Wr(e) : (n === "number" ? Yt : n === "string" ? (r = xe(e)) ? (e = r, Vn) : Ps : e instanceof xe ? Vn : e instanceof Date ? mu : _u(e) ? pu : Array.isArray(e) ? gu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? yu : Yt)(t, e); } -var Ki = 180 / Math.PI, Br = { +var ki = 180 / Math.PI, $r = { translateX: 0, translateY: 0, rotate: 0, @@ -2923,187 +2810,187 @@ var Ki = 180 / Math.PI, Br = { scaleX: 1, scaleY: 1 }; -function ea(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 Ds(t, e, n, r, i, s) { + var a, l, o; + return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (o = t * n + e * r) && (n -= t * o, r -= e * o), (l = Math.sqrt(n * n + r * r)) && (n /= l, r /= l, o /= l), t * r < e * n && (t = -t, e = -e, o = -o, a = -a), { translateX: i, translateY: s, - rotate: Math.atan2(e, t) * Ki, - skewX: Math.atan(l) * Ki, + rotate: Math.atan2(e, t) * ki, + skewX: Math.atan(o) * ki, scaleX: a, - scaleY: o + scaleY: l }; } -var On; -function Iu(t) { +var vn; +function bu(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? Br : ea(e.a, e.b, e.c, e.d, e.e, e.f); -} -function Fu(t) { - return t == null || (On || (On = document.createElementNS("http://www.w3.org/2000/svg", "g")), On.setAttribute("transform", t), !(t = On.transform.baseVal.consolidate())) ? Br : (t = t.matrix, ea(t.a, t.b, t.c, t.d, t.e, t.f)); -} -function na(t, e, n, r) { - function i(u) { - return u.length ? u.pop() + " " : ""; - } - function s(u, f, d, c, v, m) { - if (u !== d || f !== c) { - var y = v.push("translate(", null, e, null, n); - m.push({ i: y - 4, x: ae(u, d) }, { i: y - 2, x: ae(f, c) }); - } else (d || c) && v.push("translate(" + d + e + 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: ae(u, f) })) : f && d.push(i(d) + "rotate(" + f + r); - } - function o(u, f, d, c) { - u !== f ? c.push({ i: d.push(i(d) + "skewX(", null, r) - 2, x: ae(u, f) }) : f && d.push(i(d) + "skewX(" + f + r); - } - function l(u, f, d, c, v, m) { - if (u !== d || f !== c) { - var y = v.push(i(v) + "scale(", null, ",", null, ")"); - m.push({ i: y - 4, x: ae(u, d) }, { i: y - 2, x: ae(f, c) }); - } else (d !== 1 || c !== 1) && v.push(i(v) + "scale(" + d + "," + 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(v) { - for (var m = -1, y = c.length, x; ++m < y; ) d[(x = c[m]).i] = x.x(v); - return d.join(""); + return e.isIdentity ? $r : Ds(e.a, e.b, e.c, e.d, e.e, e.f); +} +function $u(t) { + return t == null || (vn || (vn = document.createElementNS("http://www.w3.org/2000/svg", "g")), vn.setAttribute("transform", t), !(t = vn.transform.baseVal.consolidate())) ? $r : (t = t.matrix, Ds(t.a, t.b, t.c, t.d, t.e, t.f)); +} +function Is(t, e, n, r) { + function i(f) { + return f.length ? f.pop() + " " : ""; + } + function s(f, u, h, c, d, p) { + if (f !== h || u !== c) { + var _ = d.push("translate(", null, e, null, n); + p.push({ i: _ - 4, x: Yt(f, h) }, { i: _ - 2, x: Yt(u, c) }); + } else (h || c) && d.push("translate(" + h + e + c + n); + } + function a(f, u, h, c) { + f !== u ? (f - u > 180 ? u += 360 : u - f > 180 && (f += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Yt(f, u) })) : u && h.push(i(h) + "rotate(" + u + r); + } + function l(f, u, h, c) { + f !== u ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Yt(f, u) }) : u && h.push(i(h) + "skewX(" + u + r); + } + function o(f, u, h, c, d, p) { + if (f !== h || u !== c) { + var _ = d.push(i(d) + "scale(", null, ",", null, ")"); + p.push({ i: _ - 4, x: Yt(f, h) }, { i: _ - 2, x: Yt(u, c) }); + } else (h !== 1 || c !== 1) && d.push(i(d) + "scale(" + h + "," + c + ")"); + } + return function(f, u) { + var h = [], c = []; + return f = t(f), u = t(u), s(f.translateX, f.translateY, u.translateX, u.translateY, h, c), a(f.rotate, u.rotate, h, c), l(f.skewX, u.skewX, h, c), o(f.scaleX, f.scaleY, u.scaleX, u.scaleY, h, c), f = u = null, function(d) { + for (var p = -1, _ = c.length, b; ++p < _; ) h[(b = c[p]).i] = b.x(d); + return h.join(""); }; }; } -var Lu = na(Iu, "px, ", "px)", "deg)"), qu = na(Fu, ", ", ")", ")"), rn = 0, mn = 0, vn = 0, ra = 1e3, sr, pn, ar = 0, ze = 0, xr = 0, An = typeof performance == "object" && performance.now ? performance : Date, ia = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Au = Is(bu, "px, ", "px)", "deg)"), Eu = Is($u, ", ", ")", ")"), Me = 0, Ye = 0, He = 0, Fs = 1e3, Hn, Be, Yn = 0, be = 0, tr = 0, Qe = typeof performance == "object" && performance.now ? performance : Date, qs = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; -function yi() { - return ze || (ia(Vu), ze = An.now() + xr); +function Jr() { + return be || (qs(Ru), be = Qe.now() + tr); } -function Vu() { - ze = 0; +function Ru() { + be = 0; } -function or() { +function Bn() { this._call = this._time = this._next = null; } -or.prototype = sa.prototype = { - constructor: or, +Bn.prototype = Ls.prototype = { + constructor: Bn, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? yi() : +n) + (e == null ? 0 : +e), !this._next && pn !== this && (pn ? pn._next = this : sr = this, pn = this), this._call = t, this._time = n, Hr(); + n = (n == null ? Jr() : +n) + (e == null ? 0 : +e), !this._next && Be !== this && (Be ? Be._next = this : Hn = this, Be = this), this._call = t, this._time = n, Ar(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, Hr()); + this._call && (this._call = null, this._time = 1 / 0, Ar()); } }; -function sa(t, e, n) { - var r = new or(); +function Ls(t, e, n) { + var r = new Bn(); return r.restart(t, e, n), r; } -function zu() { - yi(), ++rn; - for (var t = sr, e; t; ) - (e = ze - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --rn; +function Nu() { + Jr(), ++Me; + for (var t = Hn, e; t; ) + (e = be - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --Me; } -function Wi() { - ze = (ar = An.now()) + xr, rn = mn = 0; +function Si() { + be = (Yn = Qe.now()) + tr, Me = Ye = 0; try { - zu(); + Nu(); } finally { - rn = 0, Hu(), ze = 0; + Me = 0, ku(), be = 0; } } -function Bu() { - var t = An.now(), e = t - ar; - e > ra && (xr -= e, ar = t); +function Tu() { + var t = Qe.now(), e = t - Yn; + e > Fs && (tr -= e, Yn = t); } -function Hu() { - for (var t, e = sr, 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 : sr = n); - pn = t, Hr(r); +function ku() { + for (var t, e = Hn, 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 : Hn = n); + Be = t, Ar(r); } -function Hr(t) { - if (!rn) { - mn && (mn = clearTimeout(mn)); - var e = t - ze; - e > 24 ? (t < 1 / 0 && (mn = setTimeout(Wi, t - An.now() - xr)), vn && (vn = clearInterval(vn))) : (vn || (ar = An.now(), vn = setInterval(Bu, ra)), rn = 1, ia(Wi)); +function Ar(t) { + if (!Me) { + Ye && (Ye = clearTimeout(Ye)); + var e = t - be; + e > 24 ? (t < 1 / 0 && (Ye = setTimeout(Si, t - Qe.now() - tr)), He && (He = clearInterval(He))) : (He || (Yn = Qe.now(), He = setInterval(Tu, Fs)), Me = 1, qs(Si)); } } -function Ji(t, e, n) { - var r = new or(); +function Ci(t, e, n) { + var r = new Bn(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var Xu = Ls("start", "end", "cancel", "interrupt"), Yu = [], aa = 0, Zi = 1, Xr = 2, Vn = 3, Qi = 4, Yr = 5, zn = 6; -function wr(t, e, n, r, i, s) { +var Su = ms("start", "end", "cancel", "interrupt"), Cu = [], Vs = 0, Mi = 1, Er = 2, wn = 3, Oi = 4, Rr = 5, xn = 6; +function er(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - Uu(t, n, { + Mu(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. - on: Xu, - tween: Yu, + on: Su, + tween: Cu, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: aa + state: Vs }); } -function xi(t, e) { - var n = ee(t, e); - if (n.state > aa) throw new Error("too late; already scheduled"); +function Zr(t, e) { + var n = It(t, e); + if (n.state > Vs) throw new Error("too late; already scheduled"); return n; } -function ve(t, e) { - var n = ee(t, e); - if (n.state > Vn) throw new Error("too late; already running"); +function Ut(t, e) { + var n = It(t, e); + if (n.state > wn) throw new Error("too late; already running"); return n; } -function ee(t, e) { +function It(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Uu(t, e, n) { +function Mu(t, e, n) { var r = t.__transition, i; - r[e] = n, n.timer = sa(s, 0, n.time); - function s(u) { - n.state = Zi, n.timer.restart(a, n.delay, n.time), n.delay <= u && a(u - n.delay); - } - function a(u) { - var f, d, c, v; - if (n.state !== Zi) return l(); - for (f in r) - if (v = r[f], v.name === n.name) { - if (v.state === Vn) return Ji(a); - v.state === Qi ? (v.state = zn, v.timer.stop(), v.on.call("interrupt", t, t.__data__, v.index, v.group), delete r[f]) : +f < e && (v.state = zn, v.timer.stop(), v.on.call("cancel", t, t.__data__, v.index, v.group), delete r[f]); + r[e] = n, n.timer = Ls(s, 0, n.time); + function s(f) { + n.state = Mi, n.timer.restart(a, n.delay, n.time), n.delay <= f && a(f - n.delay); + } + function a(f) { + var u, h, c, d; + if (n.state !== Mi) return o(); + for (u in r) + if (d = r[u], d.name === n.name) { + if (d.state === wn) return Ci(a); + d.state === Oi ? (d.state = xn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[u]) : +u < e && (d.state = xn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[u]); } - if (Ji(function() { - n.state === Vn && (n.state = Qi, n.timer.restart(o, n.delay, n.time), o(u)); - }), n.state = Xr, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Xr) { - for (n.state = Vn, i = new Array(c = n.tween.length), f = 0, d = -1; f < c; ++f) - (v = n.tween[f].value.call(t, t.__data__, n.index, n.group)) && (i[++d] = v); - i.length = d + 1; + if (Ci(function() { + n.state === wn && (n.state = Oi, n.timer.restart(l, n.delay, n.time), l(f)); + }), n.state = Er, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Er) { + for (n.state = wn, i = new Array(c = n.tween.length), u = 0, h = -1; u < c; ++u) + (d = n.tween[u].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d); + 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 = Yr, 1), d = -1, c = i.length; ++d < c; ) - i[d].call(t, f); - n.state === Yr && (n.on.call("end", t, t.__data__, n.index, n.group), l()); + function l(f) { + for (var u = f < n.duration ? n.ease.call(null, f / n.duration) : (n.timer.restart(o), n.state = Rr, 1), h = -1, c = i.length; ++h < c; ) + i[h].call(t, u); + n.state === Rr && (n.on.call("end", t, t.__data__, n.index, n.group), o()); } - function l() { - n.state = zn, n.timer.stop(), delete r[e]; - for (var u in r) return; + function o() { + n.state = xn, n.timer.stop(), delete r[e]; + for (var f in r) return; delete t.__transition; } } -function Gu(t, e) { +function Ou(t, e) { var n = t.__transition, r, i, s = !0, a; if (n) { e = e == null ? null : e + ""; @@ -3112,23 +2999,23 @@ function Gu(t, e) { s = !1; continue; } - i = r.state > Xr && r.state < Yr, r.state = zn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > Er && r.state < Rr, r.state = xn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } -function ju(t) { +function Pu(t) { return this.each(function() { - Gu(this, t); + Ou(this, t); }); } -function Ku(t, e) { +function Du(t, e) { var n, r; return function() { - var i = ve(this, t), s = i.tween; + var i = Ut(this, t), s = i.tween; if (s !== n) { r = n = s; - for (var a = 0, o = r.length; a < o; ++a) + for (var a = 0, l = r.length; a < l; ++a) if (r[a].name === e) { r = r.slice(), r.splice(a, 1); break; @@ -3137,434 +3024,434 @@ function Ku(t, e) { i.tween = r; }; } -function Wu(t, e, n) { +function Iu(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 = Ut(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; + for (var l = { name: e, value: n }, o = 0, f = i.length; o < f; ++o) + if (i[o].name === e) { + i[o] = l; break; } - l === u && i.push(o); + o === f && i.push(l); } s.tween = i; }; } -function Ju(t, e) { +function Fu(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = ee(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = It(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 ? Ku : Wu)(n, t, e)); + return this.each((e == null ? Du : Iu)(n, t, e)); } -function wi(t, e, n) { +function Qr(t, e, n) { var r = t._id; return t.each(function() { - var i = ve(this, r); + var i = Ut(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return ee(i, r).value[e]; + return It(i, r).value[e]; }; } -function oa(t, e) { +function Hs(t, e) { var n; - return (typeof e == "number" ? ae : e instanceof Ve ? ir : (n = Ve(e)) ? (e = n, ir) : ta)(t, e); + return (typeof e == "number" ? Yt : e instanceof xe ? Vn : (n = xe(e)) ? (e = n, Vn) : Ps)(t, e); } -function Zu(t) { +function qu(t) { return function() { this.removeAttribute(t); }; } -function Qu(t) { +function Lu(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function tf(t, e, n) { +function Vu(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 ef(t, e, n) { +function Hu(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 nf(t, e, n) { +function Yu(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))); + var a, l = n(this), o; + return l == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l))); }; } -function rf(t, e, n) { +function Bu(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))); + var a, l = n(this), o; + return l == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l))); }; } -function sf(t, e) { - var n = yr(t), r = n === "transform" ? qu : oa; - return this.attrTween(t, typeof e == "function" ? (n.local ? rf : nf)(n, r, wi(this, "attr." + t, e)) : e == null ? (n.local ? Qu : Zu)(n) : (n.local ? ef : tf)(n, r, e)); +function zu(t, e) { + var n = Qn(t), r = n === "transform" ? Eu : Hs; + return this.attrTween(t, typeof e == "function" ? (n.local ? Bu : Yu)(n, r, Qr(this, "attr." + t, e)) : e == null ? (n.local ? Lu : qu)(n) : (n.local ? Hu : Vu)(n, r, e)); } -function af(t, e) { +function Xu(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function of(t, e) { +function Uu(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function lf(t, e) { +function Gu(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && of(t, s)), n; + return s !== r && (n = (r = s) && Uu(t, s)), n; } return i._value = e, i; } -function uf(t, e) { +function Ku(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && af(t, s)), n; + return s !== r && (n = (r = s) && Xu(t, s)), n; } return i._value = e, i; } -function ff(t, e) { +function ju(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 = yr(t); - return this.tween(n, (r.local ? lf : uf)(r, e)); + var r = Qn(t); + return this.tween(n, (r.local ? Gu : Ku)(r, e)); } -function cf(t, e) { +function Wu(t, e) { return function() { - xi(this, t).delay = +e.apply(this, arguments); + Zr(this, t).delay = +e.apply(this, arguments); }; } -function df(t, e) { +function Ju(t, e) { return e = +e, function() { - xi(this, t).delay = e; + Zr(this, t).delay = e; }; } -function hf(t) { +function Zu(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? cf : df)(e, t)) : ee(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? Wu : Ju)(e, t)) : It(this.node(), e).delay; } -function vf(t, e) { +function Qu(t, e) { return function() { - ve(this, t).duration = +e.apply(this, arguments); + Ut(this, t).duration = +e.apply(this, arguments); }; } -function mf(t, e) { +function tf(t, e) { return e = +e, function() { - ve(this, t).duration = e; + Ut(this, t).duration = e; }; } -function pf(t) { +function ef(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? vf : mf)(e, t)) : ee(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? Qu : tf)(e, t)) : It(this.node(), e).duration; } -function gf(t, e) { +function nf(t, e) { if (typeof e != "function") throw new Error(); return function() { - ve(this, t).ease = e; + Ut(this, t).ease = e; }; } -function _f(t) { +function rf(t) { var e = this._id; - return arguments.length ? this.each(gf(e, t)) : ee(this.node(), e).ease; + return arguments.length ? this.each(nf(e, t)) : It(this.node(), e).ease; } -function yf(t, e) { +function sf(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - ve(this, t).ease = n; + Ut(this, t).ease = n; }; } -function xf(t) { +function af(t) { if (typeof t != "function") throw new Error(); - return this.each(yf(this._id, t)); + return this.each(sf(this._id, t)); } -function wf(t) { - typeof t != "function" && (t = zs(t)); +function lf(t) { + typeof t != "function" && (t = xs(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, this._name, this._id); + for (var s = e[i], a = s.length, l = r[i] = [], o, f = 0; f < a; ++f) + (o = s[f]) && t.call(o, o.__data__, f, s) && l.push(o); + return new ne(r, this._parents, this._name, this._id); } -function bf(t) { +function of(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, v = 0; v < f; ++v) - (c = l[v] || u[v]) && (d[v] = c); - for (; o < r; ++o) - a[o] = e[o]; - return new Ae(a, this._parents, this._name, this._id); -} -function $f(t) { + for (var e = this._groups, n = t._groups, r = e.length, i = n.length, s = Math.min(r, i), a = new Array(r), l = 0; l < s; ++l) + for (var o = e[l], f = n[l], u = o.length, h = a[l] = new Array(u), c, d = 0; d < u; ++d) + (c = o[d] || f[d]) && (h[d] = c); + for (; l < r; ++l) + a[l] = e[l]; + return new ne(a, this._parents, this._name, this._id); +} +function uf(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 Af(t, e, n) { - var r, i, s = $f(e) ? xi : ve; +function ff(t, e, n) { + var r, i, s = uf(e) ? Zr : Ut; 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, t), l = a.on; + l !== r && (i = (r = l).copy()).on(e, n), a.on = i; }; } -function Tf(t, e) { +function cf(t, e) { var n = this._id; - return arguments.length < 2 ? ee(this.node(), n).on.on(t) : this.each(Af(n, t, e)); + return arguments.length < 2 ? It(this.node(), n).on.on(t) : this.each(ff(n, t, e)); } -function Ef(t) { +function hf(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } -function kf() { - return this.on("end.remove", Ef(this._id)); +function df() { + return this.on("end.remove", hf(this._id)); } -function Rf(t) { +function vf(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = mi(t)); + typeof t != "function" && (t = Gr(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, 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, wr(u[c], e, n, c, u, ee(f, n))); - return new Ae(s, this._parents, e, n); + for (var l = r[a], o = l.length, f = s[a] = new Array(o), u, h, c = 0; c < o; ++c) + (u = l[c]) && (h = t.call(u, u.__data__, c, l)) && ("__data__" in u && (h.__data__ = u.__data__), f[c] = h, er(f[c], e, n, c, f, It(u, n))); + return new ne(s, this._parents, e, n); } -function Nf(t) { +function pf(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = Vs(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), v, m = ee(f, n), y = 0, x = c.length; y < x; ++y) - (v = c[y]) && wr(v, e, n, y, c, m); - s.push(c), a.push(f); + typeof t != "function" && (t = ws(t)); + for (var r = this._groups, i = r.length, s = [], a = [], l = 0; l < i; ++l) + for (var o = r[l], f = o.length, u, h = 0; h < f; ++h) + if (u = o[h]) { + for (var c = t.call(u, u.__data__, h, o), d, p = It(u, n), _ = 0, b = c.length; _ < b; ++_) + (d = c[_]) && er(d, e, n, _, c, p); + s.push(c), a.push(u); } - return new Ae(s, a, e, n); + return new ne(s, a, e, n); } -var Sf = ln.prototype.constructor; -function Cf() { - return new Sf(this._groups, this._parents); +var _f = Fe.prototype.constructor; +function gf() { + return new _f(this._groups, this._parents); } -function Mf(t, e) { +function mf(t, e) { var n, r, i; return function() { - var s = nn(this, t), a = (this.style.removeProperty(t), nn(this, t)); + var s = Ce(this, t), a = (this.style.removeProperty(t), Ce(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function la(t) { +function Ys(t) { return function() { this.style.removeProperty(t); }; } -function Df(t, e, n) { +function yf(t, e, n) { var r, i = n + "", s; return function() { - var a = nn(this, t); + var a = Ce(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function Of(t, e, n) { +function wf(t, e, n) { var r, i, s; return function() { - var a = nn(this, t), o = n(this), l = o + ""; - return o == null && (l = o = (this.style.removeProperty(t), nn(this, t))), a === l ? null : a === r && l === i ? s : (i = l, s = e(r = a, o)); + var a = Ce(this, t), l = n(this), o = l + ""; + return l == null && (o = l = (this.style.removeProperty(t), Ce(this, t))), a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l)); }; } -function Pf(t, e) { - var n, r, i, s = "style." + e, a = "end." + s, o; +function xf(t, e) { + var n, r, i, s = "style." + e, a = "end." + s, l; return function() { - var l = ve(this, t), u = l.on, f = l.value[s] == null ? o || (o = la(e)) : void 0; - (u !== n || i !== f) && (r = (n = u).copy()).on(a, i = f), l.on = r; + var o = Ut(this, t), f = o.on, u = o.value[s] == null ? l || (l = Ys(e)) : void 0; + (f !== n || i !== u) && (r = (n = f).copy()).on(a, i = u), o.on = r; }; } -function If(t, e, n) { - var r = (t += "") == "transform" ? Lu : oa; - return e == null ? this.styleTween(t, Mf(t, r)).on("end.style." + t, la(t)) : typeof e == "function" ? this.styleTween(t, Of(t, r, wi(this, "style." + t, e))).each(Pf(this._id, t)) : this.styleTween(t, Df(t, r, e), n).on("end.style." + t, null); +function bf(t, e, n) { + var r = (t += "") == "transform" ? Au : Hs; + return e == null ? this.styleTween(t, mf(t, r)).on("end.style." + t, Ys(t)) : typeof e == "function" ? this.styleTween(t, wf(t, r, Qr(this, "style." + t, e))).each(xf(this._id, t)) : this.styleTween(t, yf(t, r, e), n).on("end.style." + t, null); } -function Ff(t, e, n) { +function $f(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } -function Lf(t, e, n) { +function Af(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && Ff(t, a, n)), r; + return a !== i && (r = (i = a) && $f(t, a, n)), r; } return s._value = e, s; } -function qf(t, e, n) { +function Ef(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, Lf(t, e, n ?? "")); + return this.tween(r, Af(t, e, n ?? "")); } -function Vf(t) { +function Rf(t) { return function() { this.textContent = t; }; } -function zf(t) { +function Nf(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function Bf(t) { - return this.tween("text", typeof t == "function" ? zf(wi(this, "text", t)) : Vf(t == null ? "" : t + "")); +function Tf(t) { + return this.tween("text", typeof t == "function" ? Nf(Qr(this, "text", t)) : Rf(t == null ? "" : t + "")); } -function Hf(t) { +function kf(t) { return function(e) { this.textContent = t.call(this, e); }; } -function Xf(t) { +function Sf(t) { var e, n; function r() { var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && Hf(i)), e; + return i !== n && (e = (n = i) && kf(i)), e; } return r._value = t, r; } -function Yf(t) { +function Cf(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, Xf(t)); -} -function Uf() { - for (var t = this._name, e = this._id, n = ua(), 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 = ee(l, e); - wr(l, t, n, u, a, { - time: f.time + f.delay + f.duration, + return this.tween(e, Sf(t)); +} +function Mf() { + for (var t = this._name, e = this._id, n = Bs(), r = this._groups, i = r.length, s = 0; s < i; ++s) + for (var a = r[s], l = a.length, o, f = 0; f < l; ++f) + if (o = a[f]) { + var u = It(o, e); + er(o, t, n, f, a, { + time: u.time + u.delay + u.duration, delay: 0, - duration: f.duration, - ease: f.ease + duration: u.duration, + ease: u.ease }); } - return new Ae(r, this._parents, t, n); + return new ne(r, this._parents, t, n); } -function Gf() { +function Of() { var t, e, 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 = 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 f = Ut(this, r), u = f.on; + u !== t && (e = (t = u).copy(), e._.cancel.push(l), e._.interrupt.push(l), e._.end.push(o)), f.on = e; }), i === 0 && s(); }); } -var jf = 0; -function Ae(t, e, n, r) { +var Pf = 0; +function ne(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function Bn(t) { - return ln().transition(t); -} -function ua() { - return ++jf; -} -var ge = ln.prototype; -Ae.prototype = Bn.prototype = { - constructor: Ae, - select: Rf, - selectAll: Nf, - selectChild: ge.selectChild, - selectChildren: ge.selectChildren, - filter: wf, - merge: bf, - selection: Cf, - transition: Uf, - call: ge.call, - nodes: ge.nodes, - node: ge.node, - size: ge.size, - empty: ge.empty, - each: ge.each, - on: Tf, - attr: sf, - attrTween: ff, - style: If, - styleTween: qf, - text: Bf, - textTween: Yf, - remove: kf, - tween: Ju, - delay: hf, - duration: pf, - ease: _f, - easeVarying: xf, - end: Gf, - [Symbol.iterator]: ge[Symbol.iterator] +function bn(t) { + return Fe().transition(t); +} +function Bs() { + return ++Pf; +} +var Kt = Fe.prototype; +ne.prototype = bn.prototype = { + constructor: ne, + select: vf, + selectAll: pf, + selectChild: Kt.selectChild, + selectChildren: Kt.selectChildren, + filter: lf, + merge: of, + selection: gf, + transition: Mf, + call: Kt.call, + nodes: Kt.nodes, + node: Kt.node, + size: Kt.size, + empty: Kt.empty, + each: Kt.each, + on: cf, + attr: zu, + attrTween: ju, + style: bf, + styleTween: Ef, + text: Tf, + textTween: Cf, + remove: df, + tween: Fu, + delay: Zu, + duration: ef, + ease: rf, + easeVarying: af, + end: Of, + [Symbol.iterator]: Kt[Symbol.iterator] }; -function Kf(t) { +function Df(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var Wf = { +var If = { time: null, // Set on use. delay: 0, duration: 250, - ease: Kf + ease: Df }; -function Jf(t, e) { +function Ff(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 Zf(t) { +function qf(t) { var e, n; - t instanceof Ae ? (e = t._id, t = t._name) : (e = ua(), (n = Wf).time = yi(), t = t == null ? null : t + ""); + t instanceof ne ? (e = t._id, t = t._name) : (e = Bs(), (n = If).time = Jr(), 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]) && wr(l, t, e, u, a, n || Jf(l, e)); - return new Ae(r, this._parents, t, e); -} -ln.prototype.interrupt = ju; -ln.prototype.transition = Zf; -const Ur = Math.PI, Gr = 2 * Ur, Oe = 1e-6, Qf = Gr - Oe; -function fa(t) { + for (var a = r[s], l = a.length, o, f = 0; f < l; ++f) + (o = a[f]) && er(o, t, e, f, a, n || Ff(o, e)); + return new ne(r, this._parents, t, e); +} +Fe.prototype.interrupt = Pu; +Fe.prototype.transition = qf; +const Nr = Math.PI, Tr = 2 * Nr, _e = 1e-6, Lf = Tr - _e; +function zs(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function tc(t) { +function Vf(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return fa; + if (e > 15) return zs; const n = 10 ** e; return function(r) { this._ += r[0]; @@ -3572,10 +3459,10 @@ function tc(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class ec { +class Hf { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? fa : tc(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? zs : Vf(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -3594,20 +3481,20 @@ class ec { } 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; + let a = this._x1, l = this._y1, o = r - e, f = i - n, u = a - e, h = l - n, c = u * u + h * h; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > Oe) if (!(Math.abs(d * l - u * f) > Oe) || !s) + else if (c > _e) if (!(Math.abs(h * o - f * u) > _e) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let v = r - a, m = i - o, y = l * l + u * u, x = v * v + m * m, k = Math.sqrt(y), w = Math.sqrt(c), b = s * Math.tan((Ur - Math.acos((y + c - x) / (2 * k * w))) / 2), $ = b / w, N = b / k; - Math.abs($ - 1) > Oe && this._append`L${e + $ * f},${n + $ * d}`, this._append`A${s},${s},0,0,${+(d * v > f * m)},${this._x1 = e + N * l},${this._y1 = n + N * u}`; + let d = r - a, p = i - l, _ = o * o + f * f, b = d * d + p * p, y = Math.sqrt(_), $ = Math.sqrt(c), E = s * Math.tan((Nr - Math.acos((_ + c - b) / (2 * y * $))) / 2), M = E / $, S = E / y; + Math.abs(M - 1) > _e && this._append`L${e + M * u},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * d > u * p)},${this._x1 = e + S * o},${this._y1 = n + S * f}`; } } 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) > Oe || Math.abs(this._y1 - f) > Oe) && this._append`L${u},${f}`, r && (c < 0 && (c = c % Gr + Gr), c > Qf ? 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 > Oe && this._append`A${r},${r},0,${+(c >= Ur)},${d},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + let l = r * Math.cos(i), o = r * Math.sin(i), f = e + l, u = n + o, h = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${f},${u}` : (Math.abs(this._x1 - f) > _e || Math.abs(this._y1 - u) > _e) && this._append`L${f},${u}`, r && (c < 0 && (c = c % Tr + Tr), c > Lf ? this._append`A${r},${r},0,1,${h},${e - l},${n - o}A${r},${r},0,1,${h},${this._x1 = f},${this._y1 = u}` : c > _e && this._append`A${r},${r},0,${+(c >= Nr)},${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`; @@ -3616,24 +3503,24 @@ class ec { return this._; } } -function nc(t) { +function Yf(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 rc = nc("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function Tt(t) { +const Bf = Yf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function ut(t) { return function() { return t; }; } -const ts = Math.abs, wt = Math.atan2, De = Math.cos, ic = Math.max, Cr = Math.min, ie = Math.sin, Ue = Math.sqrt, Mt = 1e-12, Tn = Math.PI, lr = Tn / 2, Hn = 2 * Tn; -function sc(t) { - return t > 1 ? 0 : t < -1 ? Tn : Math.acos(t); +const Pi = Math.abs, at = Math.atan2, pe = Math.cos, zf = Math.max, hr = Math.min, Vt = Math.sin, Ne = Math.sqrt, pt = 1e-12, tn = Math.PI, zn = tn / 2, $n = 2 * tn; +function Xf(t) { + return t > 1 ? 0 : t < -1 ? tn : Math.acos(t); } -function es(t) { - return t >= 1 ? lr : t <= -1 ? -lr : Math.asin(t); +function Di(t) { + return t >= 1 ? zn : t <= -1 ? -zn : Math.asin(t); } -function ac(t) { +function Uf(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -3645,141 +3532,141 @@ function ac(t) { e = r; } return t; - }, () => new ec(e); + }, () => new Hf(e); } -function oc(t) { +function Gf(t) { return t.innerRadius; } -function lc(t) { +function Kf(t) { return t.outerRadius; } -function uc(t) { +function jf(t) { return t.startAngle; } -function fc(t) { +function Wf(t) { return t.endAngle; } -function cc(t) { +function Jf(t) { return t && t.padAngle; } -function dc(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 < Mt)) - return c = (f * (e - s) - d * (t - i)) / c, [t + c * l, e + c * u]; -} -function Pn(t, e, n, r, i, s, a) { - var o = t - n, l = e - r, u = (a ? s : -s) / Ue(o * o + l * l), f = u * l, d = -u * o, c = t + f, v = e + d, m = n + f, y = r + d, x = (c + m) / 2, k = (v + y) / 2, w = m - c, b = y - v, $ = w * w + b * b, N = i - s, z = c * y - m * v, X = (b < 0 ? -1 : 1) * Ue(ic(0, N * N * $ - z * z)), Y = (z * b - w * X) / $, st = (-z * w - b * X) / $, at = (z * b + w * X) / $, J = (-z * w + b * X) / $, Z = Y - x, E = st - k, S = at - x, _t = J - k; - return Z * Z + E * E > S * S + _t * _t && (Y = at, st = J), { - cx: Y, - cy: st, - x01: -f, - y01: -d, - x11: Y * (i / N - 1), - y11: st * (i / N - 1) +function Zf(t, e, n, r, i, s, a, l) { + var o = n - t, f = r - e, u = a - i, h = l - s, c = h * o - u * f; + if (!(c * c < pt)) + return c = (u * (e - s) - h * (t - i)) / c, [t + c * o, e + c * f]; +} +function pn(t, e, n, r, i, s, a) { + var l = t - n, o = e - r, f = (a ? s : -s) / Ne(l * l + o * o), u = f * o, h = -f * l, c = t + u, d = e + h, p = n + u, _ = r + h, b = (c + p) / 2, y = (d + _) / 2, $ = p - c, E = _ - d, M = $ * $ + E * E, S = i - s, P = c * _ - p * d, B = (E < 0 ? -1 : 1) * Ne(zf(0, S * S * M - P * P)), W = (P * E - $ * B) / M, rt = (-P * $ - E * B) / M, Q = (P * E + $ * B) / M, K = (-P * $ + E * B) / M, H = W - b, N = rt - y, q = Q - b, Nt = K - y; + return H * H + N * N > q * q + Nt * Nt && (W = Q, rt = K), { + cx: W, + cy: rt, + x01: -u, + y01: -h, + x11: W * (i / S - 1), + y11: rt * (i / S - 1) }; } -function _e() { - var t = oc, e = lc, n = Tt(0), r = null, i = uc, s = fc, a = cc, o = null, l = ac(u); - function u() { - var f, d, c = +t.apply(this, arguments), v = +e.apply(this, arguments), m = i.apply(this, arguments) - lr, y = s.apply(this, arguments) - lr, x = ts(y - m), k = y > m; - if (o || (o = f = l()), v < c && (d = v, v = c, c = d), !(v > Mt)) o.moveTo(0, 0); - else if (x > Hn - Mt) - o.moveTo(v * De(m), v * ie(m)), o.arc(0, 0, v, m, y, !k), c > Mt && (o.moveTo(c * De(y), c * ie(y)), o.arc(0, 0, c, y, m, k)); +function jt() { + var t = Gf, e = Kf, n = ut(0), r = null, i = jf, s = Wf, a = Jf, l = null, o = Uf(f); + function f() { + var u, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - zn, _ = s.apply(this, arguments) - zn, b = Pi(_ - p), y = _ > p; + if (l || (l = u = o()), d < c && (h = d, d = c, c = h), !(d > pt)) l.moveTo(0, 0); + else if (b > $n - pt) + l.moveTo(d * pe(p), d * Vt(p)), l.arc(0, 0, d, p, _, !y), c > pt && (l.moveTo(c * pe(_), c * Vt(_)), l.arc(0, 0, c, _, p, y)); else { - var w = m, b = y, $ = m, N = y, z = x, X = x, Y = a.apply(this, arguments) / 2, st = Y > Mt && (r ? +r.apply(this, arguments) : Ue(c * c + v * v)), at = Cr(ts(v - c) / 2, +n.apply(this, arguments)), J = at, Z = at, E, S; - if (st > Mt) { - var _t = es(st / c * ie(Y)), ft = es(st / v * ie(Y)); - (z -= _t * 2) > Mt ? (_t *= k ? 1 : -1, $ += _t, N -= _t) : (z = 0, $ = N = (m + y) / 2), (X -= ft * 2) > Mt ? (ft *= k ? 1 : -1, w += ft, b -= ft) : (X = 0, w = b = (m + y) / 2); + var $ = p, E = _, M = p, S = _, P = b, B = b, W = a.apply(this, arguments) / 2, rt = W > pt && (r ? +r.apply(this, arguments) : Ne(c * c + d * d)), Q = hr(Pi(d - c) / 2, +n.apply(this, arguments)), K = Q, H = Q, N, q; + if (rt > pt) { + var Nt = Di(rt / c * Vt(W)), ft = Di(rt / d * Vt(W)); + (P -= Nt * 2) > pt ? (Nt *= y ? 1 : -1, M += Nt, S -= Nt) : (P = 0, M = S = (p + _) / 2), (B -= ft * 2) > pt ? (ft *= y ? 1 : -1, $ += ft, E -= ft) : (B = 0, $ = E = (p + _) / 2); } - var pt = v * De(w), ct = v * ie(w), Kt = c * De(N), Bt = c * ie(N); - if (at > Mt) { - var It = v * De(b), Ht = v * ie(b), Ft = c * De($), Lt = c * ie($), dt; - if (x < Tn) - if (dt = dc(pt, ct, Ft, Lt, It, Ht, Kt, Bt)) { - var me = pt - dt[0], bt = ct - dt[1], Xt = It - dt[0], Wt = Ht - dt[1], kt = 1 / ie(sc((me * Xt + bt * Wt) / (Ue(me * me + bt * bt) * Ue(Xt * Xt + Wt * Wt))) / 2), vt = Ue(dt[0] * dt[0] + dt[1] * dt[1]); - J = Cr(at, (c - vt) / (kt - 1)), Z = Cr(at, (v - vt) / (kt + 1)); + var Tt = d * pe($), ct = d * Vt($), Ft = c * pe(S), ae = c * Vt(S); + if (Q > pt) { + var le = d * pe(E), kt = d * Vt(E), oe = c * pe(M), ue = c * Vt(M), ht; + if (b < tn) + if (ht = Zf(Tt, ct, oe, ue, le, kt, Ft, ae)) { + var Gt = Tt - ht[0], w = ct - ht[1], D = le - ht[0], z = kt - ht[1], Y = 1 / Vt(Xf((Gt * D + w * z) / (Ne(Gt * Gt + w * w) * Ne(D * D + z * z))) / 2), tt = Ne(ht[0] * ht[0] + ht[1] * ht[1]); + K = hr(Q, (c - tt) / (Y - 1)), H = hr(Q, (d - tt) / (Y + 1)); } else - J = Z = 0; + K = H = 0; } - X > Mt ? Z > Mt ? (E = Pn(Ft, Lt, pt, ct, v, Z, k), S = Pn(It, Ht, Kt, Bt, v, Z, k), o.moveTo(E.cx + E.x01, E.cy + E.y01), Z < at ? o.arc(E.cx, E.cy, Z, wt(E.y01, E.x01), wt(S.y01, S.x01), !k) : (o.arc(E.cx, E.cy, Z, wt(E.y01, E.x01), wt(E.y11, E.x11), !k), o.arc(0, 0, v, wt(E.cy + E.y11, E.cx + E.x11), wt(S.cy + S.y11, S.cx + S.x11), !k), o.arc(S.cx, S.cy, Z, wt(S.y11, S.x11), wt(S.y01, S.x01), !k))) : (o.moveTo(pt, ct), o.arc(0, 0, v, w, b, !k)) : o.moveTo(pt, ct), !(c > Mt) || !(z > Mt) ? o.lineTo(Kt, Bt) : J > Mt ? (E = Pn(Kt, Bt, It, Ht, c, -J, k), S = Pn(pt, ct, Ft, Lt, c, -J, k), o.lineTo(E.cx + E.x01, E.cy + E.y01), J < at ? o.arc(E.cx, E.cy, J, wt(E.y01, E.x01), wt(S.y01, S.x01), !k) : (o.arc(E.cx, E.cy, J, wt(E.y01, E.x01), wt(E.y11, E.x11), !k), o.arc(0, 0, c, wt(E.cy + E.y11, E.cx + E.x11), wt(S.cy + S.y11, S.cx + S.x11), k), o.arc(S.cx, S.cy, J, wt(S.y11, S.x11), wt(S.y01, S.x01), !k))) : o.arc(0, 0, c, N, $, k); + B > pt ? H > pt ? (N = pn(oe, ue, Tt, ct, d, H, y), q = pn(le, kt, Ft, ae, d, H, y), l.moveTo(N.cx + N.x01, N.cy + N.y01), H < Q ? l.arc(N.cx, N.cy, H, at(N.y01, N.x01), at(q.y01, q.x01), !y) : (l.arc(N.cx, N.cy, H, at(N.y01, N.x01), at(N.y11, N.x11), !y), l.arc(0, 0, d, at(N.cy + N.y11, N.cx + N.x11), at(q.cy + q.y11, q.cx + q.x11), !y), l.arc(q.cx, q.cy, H, at(q.y11, q.x11), at(q.y01, q.x01), !y))) : (l.moveTo(Tt, ct), l.arc(0, 0, d, $, E, !y)) : l.moveTo(Tt, ct), !(c > pt) || !(P > pt) ? l.lineTo(Ft, ae) : K > pt ? (N = pn(Ft, ae, le, kt, c, -K, y), q = pn(Tt, ct, oe, ue, c, -K, y), l.lineTo(N.cx + N.x01, N.cy + N.y01), K < Q ? l.arc(N.cx, N.cy, K, at(N.y01, N.x01), at(q.y01, q.x01), !y) : (l.arc(N.cx, N.cy, K, at(N.y01, N.x01), at(N.y11, N.x11), !y), l.arc(0, 0, c, at(N.cy + N.y11, N.cx + N.x11), at(q.cy + q.y11, q.cx + q.x11), y), l.arc(q.cx, q.cy, K, at(q.y11, q.x11), at(q.y01, q.x01), !y))) : l.arc(0, 0, c, S, M, y); } - if (o.closePath(), f) return o = 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 - Tn / 2; - return [De(d) * f, ie(d) * f]; - }, u.innerRadius = function(f) { - return arguments.length ? (t = typeof f == "function" ? f : Tt(+f), u) : t; - }, u.outerRadius = function(f) { - return arguments.length ? (e = typeof f == "function" ? f : Tt(+f), u) : e; - }, u.cornerRadius = function(f) { - return arguments.length ? (n = typeof f == "function" ? f : Tt(+f), u) : n; - }, u.padRadius = function(f) { - return arguments.length ? (r = f == null ? null : typeof f == "function" ? f : Tt(+f), u) : r; - }, u.startAngle = function(f) { - return arguments.length ? (i = typeof f == "function" ? f : Tt(+f), u) : i; - }, u.endAngle = function(f) { - return arguments.length ? (s = typeof f == "function" ? f : Tt(+f), u) : s; - }, u.padAngle = function(f) { - return arguments.length ? (a = typeof f == "function" ? f : Tt(+f), u) : a; - }, u.context = function(f) { - return arguments.length ? (o = f ?? null, u) : o; - }, u; -} -function hc(t) { + if (l.closePath(), u) return l = null, u + "" || null; + } + return f.centroid = function() { + var u = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - tn / 2; + return [pe(h) * u, Vt(h) * u]; + }, f.innerRadius = function(u) { + return arguments.length ? (t = typeof u == "function" ? u : ut(+u), f) : t; + }, f.outerRadius = function(u) { + return arguments.length ? (e = typeof u == "function" ? u : ut(+u), f) : e; + }, f.cornerRadius = function(u) { + return arguments.length ? (n = typeof u == "function" ? u : ut(+u), f) : n; + }, f.padRadius = function(u) { + return arguments.length ? (r = u == null ? null : typeof u == "function" ? u : ut(+u), f) : r; + }, f.startAngle = function(u) { + return arguments.length ? (i = typeof u == "function" ? u : ut(+u), f) : i; + }, f.endAngle = function(u) { + return arguments.length ? (s = typeof u == "function" ? u : ut(+u), f) : s; + }, f.padAngle = function(u) { + return arguments.length ? (a = typeof u == "function" ? u : ut(+u), f) : a; + }, f.context = function(u) { + return arguments.length ? (l = u ?? null, f) : l; + }, f; +} +function Qf(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function vc(t, e) { +function tc(t, e) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function mc(t) { +function ec(t) { return t; } -function Mr() { - var t = mc, e = vc, n = null, r = Tt(0), i = Tt(Hn), s = Tt(0); - function a(o) { - var l, u = (o = hc(o)).length, f, d, c = 0, v = new Array(u), m = new Array(u), y = +r.apply(this, arguments), x = Math.min(Hn, Math.max(-Hn, i.apply(this, arguments) - y)), k, w = Math.min(Math.abs(x) / u, s.apply(this, arguments)), b = w * (x < 0 ? -1 : 1), $; - for (l = 0; l < u; ++l) - ($ = m[v[l] = l] = +t(o[l], l, o)) > 0 && (c += $); - for (e != null ? v.sort(function(N, z) { - return e(m[N], m[z]); - }) : n != null && v.sort(function(N, z) { - return n(o[N], o[z]); - }), l = 0, d = c ? (x - u * b) / c : 0; l < u; ++l, y = k) - f = v[l], $ = m[f], k = y + ($ > 0 ? $ * d : 0) + b, m[f] = { - data: o[f], - index: l, - value: $, - startAngle: y, - endAngle: k, - padAngle: w +function dr() { + var t = ec, e = tc, n = null, r = ut(0), i = ut($n), s = ut(0); + function a(l) { + var o, f = (l = Qf(l)).length, u, h, c = 0, d = new Array(f), p = new Array(f), _ = +r.apply(this, arguments), b = Math.min($n, Math.max(-$n, i.apply(this, arguments) - _)), y, $ = Math.min(Math.abs(b) / f, s.apply(this, arguments)), E = $ * (b < 0 ? -1 : 1), M; + for (o = 0; o < f; ++o) + (M = p[d[o] = o] = +t(l[o], o, l)) > 0 && (c += M); + for (e != null ? d.sort(function(S, P) { + return e(p[S], p[P]); + }) : n != null && d.sort(function(S, P) { + return n(l[S], l[P]); + }), o = 0, h = c ? (b - f * E) / c : 0; o < f; ++o, _ = y) + u = d[o], M = p[u], y = _ + (M > 0 ? M * h : 0) + E, p[u] = { + data: l[u], + index: o, + value: M, + startAngle: _, + endAngle: y, + padAngle: $ }; - return m; + return p; } - return a.value = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : Tt(+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 : Tt(+o), a) : r; - }, a.endAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : Tt(+o), a) : i; - }, a.padAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : Tt(+o), a) : s; + return a.value = function(l) { + return arguments.length ? (t = typeof l == "function" ? l : ut(+l), a) : t; + }, a.sortValues = function(l) { + return arguments.length ? (e = l, n = null, a) : e; + }, a.sort = function(l) { + return arguments.length ? (n = l, e = null, a) : n; + }, a.startAngle = function(l) { + return arguments.length ? (r = typeof l == "function" ? l : ut(+l), a) : r; + }, a.endAngle = function(l) { + return arguments.length ? (i = typeof l == "function" ? l : ut(+l), a) : i; + }, a.padAngle = function(l) { + return arguments.length ? (s = typeof l == "function" ? l : ut(+l), a) : s; }, a; } -function gn(t, e, n) { +function ze(t, e, n) { this.k = t, this.x = e, this.y = n; } -gn.prototype = { - constructor: gn, +ze.prototype = { + constructor: ze, scale: function(t) { - return t === 1 ? this : new gn(this.k * t, this.x, this.y); + return t === 1 ? this : new ze(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new gn(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new ze(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]; @@ -3809,23 +3696,23 @@ gn.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -gn.prototype; -const Ne = {}, jr = "No Further Rankings"; -function ur(t, e) { +ze.prototype; +const he = {}, kr = "No Further Rankings"; +function Xn(t, e) { let n = 0; for (let r = 1; r < e; r++) { const i = t.results[r - 1].tallyResults; for (let s = 0; s < i.length; s++) { const a = i[s].transfers; if (a) { - const o = a.exhausted; - o && (n += Number(o)); + const l = a.exhausted; + l && (n += Number(l)); } } } return n; } -function ca(t, e, n) { +function Xs(t, e, n) { if (e < 1) return []; const r = t.results[e - 1].tallyResults, i = []; @@ -3835,848 +3722,463 @@ function ca(t, e, n) { } return i; } -function fr(t, e) { - return ca(t, e, "eliminated"); +function Un(t, e) { + return Xs(t, e, "eliminated"); } -function cr(t, e) { +function Gn(t, e) { let n = []; for (let r = 1; r <= e; r++) - n = n.concat(ca(t, r, "elected")); + n = n.concat(Xs(t, r, "elected")); return n; } -var pc = /* @__PURE__ */ yo(''); -const gc = { hash: "svelte-3kpd", code: "" }; -function da(t, e) { - gr(e, !0), hi(t, gc); - let n = it(e, "jsonData", 7), r = it(e, "round", 15), i = it(e, "mouseEventType", 15), s = it(e, "mouseData", 15), a = it(e, "mouseY", 15), o = it(e, "animateOneRound", 15), l = it(e, "animateOnePhase", 15), u = it(e, "runFullAnimation", 15), f = it(e, "setRound", 15); - const d = 800, c = 800, v = Math.min(d, c) * 0.3, m = d / 2, y = c / 2, x = "Pie", k = "Donut", w = "TextLayer", b = "#transfer", $ = "url(#cross-hatch)", N = 1.15, z = 0.1, X = 750, Y = 800; - let st = [], at = [], J = [], Z = 0, E = ot(0), S = ot(null); - function _t() { - const p = gt(h(S)); - p.select("#" + x).remove(), p.select("#" + k).remove(), p.select("#" + w).remove(); - } - function ft() { - _t(), J = pt(), st = Be(x, J, m, y, 0, ct()); - } - Is(() => { - console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), o(Ce), l(_), u(ne), f(G), me(), ft(); +var nc = /* @__PURE__ */ ll(''); +const rc = { hash: "svelte-3kpd", code: "" }; +function Us(t, e) { + Xr(e, !0), ps(t, rc); + let n = Ht(e, "jsonData", 7), r = Ht(e, "currentRound", 15), i = Ht(e, "mouseEventType", 15), s = Ht(e, "mouseData", 15), a = Ht(e, "mouseY", 15), l = Ht(e, "animateOnePhase", 15), o = Ht(e, "runFullAnimation", 15); + const f = 800, u = 800, h = Math.min(f, u) * 0.3, c = f / 2, d = u / 2, p = "Pie", _ = "Donut", b = "TextLayer", y = "#transfer", $ = "url(#cross-hatch)", E = 1.15, M = 0.1, S = 750, P = 800; + let B = [], W = [], rt = [], Q = 0, K = Ct(0), H = Ct(null); + function N() { + const v = st(g(H)); + v.select("#" + p).remove(), v.select("#" + _).remove(), v.select("#" + b).remove(); + } + function q(v) { + N(), rt = Nt(v), B = Qs(v, p, rt, c, d, 0, ft()); + } + dl(() => { + console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), l(rn), o(tt), ue(), q(r()); }); - function pt() { - const p = dt(r()); - return Z = Ft(r()), p; + function Nt(v) { + const m = oe(v); + return Q = le(v), m; } - function ct() { - return v; + function ft() { + return h; } - function Kt() { - return ct() * 1.41; + function Tt() { + return ft() * 1.41; } - function Bt(p, A) { - if (p === "exhausted") return ur(n(), A); + function ct(v, m) { + if (v === "exhausted") return Xn(n(), m); { - const R = n().results[A - 1].tally; - return Number(R[p]); + const x = n().results[m - 1].tally; + return Number(x[v]); } } - function It(p, A) { - return Bt(p, A).toLocaleString("en-US"); - } - function Ht(p, A) { - return (Bt(p, A) / Z).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); - } - function Ft(p) { - const A = n().results[p - 1].tally; - let R = 0; - for (let [V, C] of Object.entries(A)) - R += Number(C); - return R; - } - function Lt(p, A) { - const R = n().results[A - 1].tallyResults; - let V = 0; - const C = R.findIndex((q) => (q == null ? void 0 : q.elected) && p == q.elected); - if (C >= 0) { - const q = R[C].transfers; - if (q) - for (let [F, D] of Object.entries(q)) V += Number(D); + function Ft(v, m) { + return ct(v, m).toLocaleString("en-US"); + } + function ae(v, m) { + return (ct(v, m) / Q).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + } + function le(v) { + const m = n().results[v - 1].tally; + let x = 0; + for (let [O, R] of Object.entries(m)) + x += Number(R); + return x; + } + function kt(v, m) { + const x = n().results[m - 1].tallyResults; + let O = 0; + const R = x.findIndex((k) => (k == null ? void 0 : k.elected) && v == k.elected); + if (R >= 0) { + const k = x[R].transfers; + if (k) + for (let [T, C] of Object.entries(k)) O += Number(C); } else return 0; - return V; - } - function dt(p) { - const A = n().results; - let R = A[Math.max(0, p - 2)].tally; - const V = [], C = []; - for (let [F, D] of Object.entries(R)) - V.push({ label: F, value: 0 }); - R = A[p - 1].tally; - for (let F of V) { - const D = Number(R[F.label]), H = Lt(F.label, p); - H > 0 ? (C.push({ - label: F.label + b, - value: H - }), F.value = D - H, C.push(F)) : (F.value = D, C.push(F)); + return O; + } + function oe(v) { + const m = n().results; + let x = m[Math.max(0, v - 2)].tally; + const O = [], R = []; + for (let [T, C] of Object.entries(x)) + O.push({ label: T, value: 0 }); + x = m[v - 1].tally; + for (let T of O) { + const C = Number(x[T.label]), F = kt(T.label, v); + F > 0 ? (R.push({ + label: T.label + y, + value: F + }), T.value = C - F, R.push(T)) : (T.value = C, R.push(T)); } - const q = ur(n(), p); - return C.push({ label: "exhausted", value: q }), C; - } - function me() { - const p = gt(h(S)).select("defs").select("#cross-hatch"); - let A = 0; - for (let [R, V] of Object.entries(n().results[0].tally)) { - A < 10 ? Ne[R] = rc[A] : Ne[R] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), A++; + const k = Xn(n(), v); + return R.push({ label: "exhausted", value: k }), R; + } + function ue() { + const v = st(g(H)).select("defs").select("#cross-hatch"); + let m = 0; + for (let [x, O] of Object.entries(n().results[0].tally)) { + m < 10 ? he[x] = Bf[m] : he[x] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), m++; { - const C = p.clone(!0); - C.attr("id", R.replaceAll(" ", "-")).select("rect").attr("fill", Ne[R]), C.select("path").attr("stroke", "#505050"); + const R = v.clone(!0); + R.attr("id", x.replaceAll(" ", "-")).select("rect").attr("fill", he[x]), R.select("path").attr("stroke", "#505050"); } } - Ne.exhausted = $, Ne["Inactive Ballots"] = $; + he.exhausted = $, he["Inactive Ballots"] = $; } - function bt() { - gt(h(S)).select("#" + k).remove(); + function ht() { + st(g(H)).select("#" + _).remove(); } - function Xt(p) { - console.log("animate phase 1"); - const A = Bn("global").duration(Y); - p && A.on("end", p), bt(), T(), br(), cn(0, ct()), un(); + function Gt(v) { + const m = bn("global").duration(P); + v && m.on("end", v), ht(), an(r() - 1), ta(), na(0, ft()), ei(); } - function Wt(p) { - console.log("animate phase 2"); - const A = Bn("global").duration(Y); - p && A.on("end", p), O(); + function w(v) { + const m = bn("global").duration(P); + v && m.on("end", v), Gs(r() - 1); } - function kt(p) { - console.log("animate phase 3"); - const A = Bn("global").duration(Y); - p && A.on("end", p), No(r), L(r()), g(ct()); + function D(v) { + const m = bn("global").duration(P); + v && m.on("end", v), sn(r()), ve(ft()); } - function vt() { - Rt = !1; + function z() { + Y = !1; } - let Rt = !1; - function ne() { - if (Rt) { - console.log("buttons locked out"); + let Y = !1; + function tt() { + if (Y) { + console.warn("buttons locked out"); return; } - Rt = !0, ke(); - } - function ke() { - const p = r() < n().results.length - 1 ? ke : vt; - Xt(() => { - Wt(() => { - kt(p); + Y = !0, et(); + } + function et() { + mi(r); + const v = r() < n().results.length - 1 ? et : z; + Gt(() => { + w(() => { + D(v); }); }); } - function Ce() { - if (Rt) { - console.log("buttons locked out"); + Pn(() => { + $t(); + }); + let it = 0; + function $t() { + it !== r() && (it === r() - 1 && it > 0 ? $e() : qe(r()), it = r()); + } + function qe(v) { + if (Y) { + console.warn("buttons locked out"); + return; + } + r(v), q(r()); + } + function $e() { + if (Y) { + console.warn("buttons locked out"); return; } if (r() >= n().results.length) { - Rt = !1; + Y = !1; return; } - Rt = !0, Xt(() => { - Wt(() => { - kt(vt); + Y = !0, Gt(() => { + w(() => { + D(z); }); }); } - function _() { + function rn() { if (r() >= n().results.length) { - un(), console.log("Finished at round ", r()); + ei(); return; } - B(E, (h(E) + 1) % 3), Rt = !0, h(E) === 1 ? Xt(vt) : h(E) === 2 ? Wt(vt) : h(E) === 0 ? kt(vt) : (Rt = !1, console.warn("displayPhase out of range at ", h(E))); + j(K, (g(K) + 1) % 3), Y = !0, g(K) === 1 ? (mi(r), Gt(z)) : g(K) === 2 ? w(z) : g(K) === 0 ? D(z) : (Y = !1, console.warn("displayPhase out of range at ", g(K))); } - function L(p) { - J = dt(p), st = va(x, J, 0, ct(), !0); + function sn(v) { + rt = oe(v), B = ra(v, p, rt, 0, ft(), !0); } - function G(p) { - if (Rt) { - console.log("buttons locked out"); - return; - } - r(p), ft(); - } - function g(p, A) { - Mr().sort(null).value((D) => D.value); - const R = gt(h(S)).select("#" + k), V = _e().outerRadius(p).innerRadius(p - 1), C = R.selectAll(".slice"); - let q = C.size(); - function F() { - q--, q === 0 && $r(); + function ve(v, m) { + dr().sort(null).value((C) => C.value); + const x = st(g(H)).select("#" + _), O = jt().outerRadius(v).innerRadius(v - 1), R = x.selectAll(".slice"); + let k = R.size(); + function T() { + k--, k === 0 && ea(); } - C.select("path").transition("global").duration(X).attr("d", (D) => V(D)).on("end", (D) => F()); - } - function T() { - const p = Nt(st); - at = fn(k, p, m, y, ct(), Kt(), !1, !0); - } - function O() { - const p = pe(at, st); - at = bi( - k, - p, + R.select("path").transition("global").duration(S).attr("d", (C) => O(C)).on("end", (C) => T()); + } + function an(v) { + const m = js(v, B); + W = ni(v, _, m, c, d, ft(), Tt(), !1, !0); + } + function Gs(v) { + const m = Js(v, W, B); + W = ri( + v, + _, + m, /* previousDonutInfoGlobal, */ - ct(), - Kt(), + ft(), + Tt(), !1 ); } - function I(p) { - const A = p.data.label; - return Ne[A.split("#")[0]]; + function ln(v) { + const m = v.data.label; + return he[m.split("#")[0]]; } - function rt() { - const p = {}, A = n().results[r() - 1].tallyResults; - for (let R = 0; R < A.length; R++) { - let V = A[R].eliminated; - if (V === void 0 && (V = A[R].elected), V === void 0) { + function Ks(v) { + const m = {}, x = n().results[v - 1].tallyResults; + for (let O = 0; O < x.length; O++) { + let R = x[O].eliminated; + if (R === void 0 && (R = x[O].elected), R === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const C = A[R].transfers; - if (C === void 0) { + const k = x[O].transfers; + if (k === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [q, F] of Object.entries(C)) - p[q] === void 0 ? p[q] = Number(F) : p[q] += Number(F); + for (let [T, C] of Object.entries(k)) + m[T] === void 0 ? m[T] = Number(C) : m[T] += Number(C); } - return p; + return m; } - function Nt(p) { - const A = [], R = Z, V = n().results[r() - 1].tallyResults; - for (let C = 0; C < V.length; C++) { - let q = V[C].eliminated; - if (q === void 0 && (q = V[C].elected), q === void 0) { + function js(v, m) { + const x = [], O = Q, R = n().results[v - 1].tallyResults; + for (let k = 0; k < R.length; k++) { + let T = R[k].eliminated; + if (T === void 0 && (T = R[k].elected), T === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const F = V[C].transfers; - if (F === void 0) { + const C = R[k].transfers; + if (C === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let D = p.find((P) => P.data.label == q + b); - D === void 0 && (D = p.find((P) => P.data.label == q)); - let H = 0; - if (D) H = D.startAngle; + let F = m.find((I) => I.data.label == T + y); + F === void 0 && (F = m.find((I) => I.data.label == T)); + let L = 0; + if (F) L = F.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [P, U] of Object.entries(F)) { - let ut; - const re = p.find((ht) => ht.data.label == P); - if (re) - ut = structuredClone(re); - else if (P == "exhausted") - ut = { - data: { label: P, value: Number(U) }, + for (let [I, V] of Object.entries(C)) { + let J; + const qt = m.find((nt) => nt.data.label == I); + if (qt) + J = structuredClone(qt); + else if (I == "exhausted") + J = { + data: { label: I, value: Number(V) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (P == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", U); + else if (I == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", V); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", P); + console.warn("makeDonutInfo: unrecognized name in transfers ", I); continue; } - const M = Number(U) / R * 2 * Math.PI; - ut.startAngle = H, H = ut.endAngle = H + M, ut.index = C, ut.data.label = `${ut.data.label}#${C}`, A.push(ut); + const A = Number(V) / O * 2 * Math.PI; + J.startAngle = L, L = J.endAngle = L + A, J.index = k, J.data.label = `${J.data.label}#${k}`, x.push(J); } } - return A; - } - function yt(p, A, R) { - const V = {}; - for (let [C, q] of Object.entries(p)) { - const F = R.find((P) => C == P.data.label); - if (F === void 0) { - console.warn("getTransferStartAngles: mainPieObj not found for ", C); + return x; + } + function Ws(v, m, x) { + const O = {}; + for (let [R, k] of Object.entries(v)) { + const T = x.find((L) => R == L.data.label); + if (T === void 0) { + console.warn("getTransferStartAngles: mainPieObj not found for ", R); continue; } - const D = (F.startAngle + F.endAngle) / 2, H = p[F.data.label] / A * 2 * Math.PI; - V[F.data.label] = D - H / 2; + const C = (T.startAngle + T.endAngle) / 2, F = v[T.data.label] / m * 2 * Math.PI; + O[T.data.label] = C - F / 2; } - return V; - } - function pe(p, A) { - const R = [], V = Z, C = rt(), q = yt(C, V, A); - for (let [F, D] of p.entries()) { - const H = structuredClone(D), P = D.endAngle - D.startAngle, U = A.find((ut) => D.data.label.indexOf(ut.data.label) === 0); - if (U) { - const ut = U.data.label; - H.startAngle = q[ut], q[ut] += P, H.endAngle = H.startAngle + P; - } else if (D.data.label.indexOf("exhausted") === 0) - H.startAngle = D.startAngle, H.endAngle = D.endAngle; + return O; + } + function Js(v, m, x) { + const O = [], R = Q, k = Ks(v), T = Ws(k, R, x); + for (let [C, F] of m.entries()) { + const L = structuredClone(F), I = F.endAngle - F.startAngle, V = x.find((J) => F.data.label.indexOf(J.data.label) === 0); + if (V) { + const J = V.data.label; + L.startAngle = T[J], T[J] += I, L.endAngle = L.startAngle + I; + } else if (F.data.label.indexOf("exhausted") === 0) + L.startAngle = F.startAngle, L.endAngle = F.endAngle; else { - console.warn("updateDonutInfo: unrecognized slice name ", D.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", F.data.label); continue; } - H.index = F, R.push(H); + L.index = C, O.push(L); } - return R; - } - function xt(p, A, R, V, C) { - const F = gt(h(S)).append("g").attr("id", w).attr("transform", `translate(${A}, ${R})`), D = _e().innerRadius(V * N).outerRadius(V * N); - F.selectAll("text").data(p).enter().each(function(H) { - H.endAngle - H.startAngle < z || H.data.label.includes(b) || gt(this).append("g").attr("id", (P) => P.data.label).classed("eliminated", (P) => C.includes(P.data.label.split("#")[0]) || P.data.label.includes(b)).each(function(P, U) { - P.data.label === "exhausted" && gt(this).on("mouseenter", (ut, re) => ma(ut)).on("mouseleave", (ut, re) => pa()); - }).append("text").attr("transform", (P) => `translate(${D.centroid(P)})`).attr("text-anchor", (P) => Me(P.startAngle, P.endAngle)).text((P) => P.data.label === "exhausted" ? jr : P.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((P) => It(P.data.label, r()) + " (" + Ht(P.data.label, r()) + ")"); + return O; + } + function ti(v, m, x, O, R, k) { + const C = st(g(H)).append("g").attr("id", b).attr("transform", `translate(${x}, ${O})`), F = jt().innerRadius(R * E).outerRadius(R * E); + C.selectAll("text").data(m).enter().each(function(L) { + L.endAngle - L.startAngle < M || L.data.label.includes(y) || st(this).append("g").attr("id", (I) => I.data.label).classed("eliminated", (I) => k.includes(I.data.label.split("#")[0]) || I.data.label.includes(y)).each(function(I, V) { + I.data.label === "exhausted" && st(this).on("mouseenter", (J, qt) => ia(J)).on("mouseleave", (J, qt) => sa()); + }).append("text").attr("transform", (I) => `translate(${F.centroid(I)})`).attr("text-anchor", (I) => nr(I.startAngle, I.endAngle)).text((I) => I.data.label === "exhausted" ? kr : I.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((I) => Ft(I.data.label, v) + " (" + ae(I.data.label, v) + ")"); }); } - function $t(p, A, R) { - const C = gt(h(S)).select("#" + w), q = C.selectAll("tspan"), F = C.selectAll("g").data(p, (U) => U.data.label).classed("eliminated", (U) => R.includes(U.data.label.split("#")[0]) || U.data.label.includes(b)), D = _e().innerRadius(A * N).outerRadius(A * N + 1); - q.transition("global").duration(X).attr("transform", (U) => `translate(${D.centroid(U)})`).attr("text-anchor", (U) => Me(U.startAngle, U.endAngle)), F.select("text").transition("global").duration(X).attr("transform", (U) => `translate(${D.centroid(U)})`).attr("text-anchor", (U) => Me(U.startAngle, U.endAngle)).on("end", (U) => P()); - let H = F.size(); - function P(U) { - H--, H === 0 && (C.remove(), xt(p, m, y, A, R)); + function Zs(v, m, x, O) { + const k = st(g(H)).select("#" + b), T = k.selectAll("tspan"), C = k.selectAll("g").data(m, (V) => V.data.label).classed("eliminated", (V) => O.includes(V.data.label.split("#")[0]) || V.data.label.includes(y)), F = jt().innerRadius(x * E).outerRadius(x * E + 1); + T.transition("global").duration(S).attr("transform", (V) => `translate(${F.centroid(V)})`).attr("text-anchor", (V) => nr(V.startAngle, V.endAngle)), C.select("text").transition("global").duration(S).attr("transform", (V) => `translate(${F.centroid(V)})`).attr("text-anchor", (V) => nr(V.startAngle, V.endAngle)).on("end", (V) => I()); + let L = C.size(); + function I(V) { + L--, L === 0 && (k.remove(), ti(v, m, c, d, x, O)); } } - function Be(p, A, R, V, C, q, F = !0, D = !1) { - const P = Mr().sort(null).value((U) => U.value)(A); - return fn(p, P, R, V, C, q, F, D), P; + function Qs(v, m, x, O, R, k, T, C = !0, F = !1) { + const I = dr().sort(null).value((V) => V.value)(x); + return ni(v, m, I, O, R, k, T, C, F), I; } - function un() { - gt(h(S)).select("#" + x).selectAll(".elected").style("stroke", "darkblue").style("stroke-width", "2px"); + function ei() { + st(g(H)).select("#" + p).selectAll(".elected").style("stroke", "darkblue").style("stroke-width", "2px"); } - function fn(p, A, R, V, C, q, F, D) { - const H = fr(n(), r()), P = cr(n(), r()), re = gt(h(S)).attr("width", "100%").attr("height", c).attr("viewBox", `0 0 ${d} ${c}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", p).attr("transform", `translate(${R}, ${V})`).selectAll(".slice").data(A).enter().append("g").attr("class", "slice").classed("eliminated", (M) => H.includes(M.data.label.split("#")[0]) || M.data.label.includes(b)).classed("elected", (M) => P.includes(M.data.label.split("#")[0]) && !M.data.label.includes(b)).attr("id", (M) => M.data.label).on("mouseenter", (M, ht) => Tr(M, ht)).on("mouseleave", (M, ht) => Er(M, ht)), dn = _e().outerRadius(q).innerRadius(C); - if (D) { - const M = _e().outerRadius(C + 1).innerRadius(C); - re.append("path").attr("d", M).transition("global").duration(X).attr("d", (ht) => dn(ht)).attr("fill", (ht) => I(ht)).on("end", (ht) => Ar()); + function ni(v, m, x, O, R, k, T, C, F) { + const L = Un(n(), v), I = Gn(n(), v), qt = st(g(H)).attr("width", "100%").attr("height", u).attr("viewBox", `0 0 ${f} ${u}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", m).attr("transform", `translate(${O}, ${R})`).selectAll(".slice").data(x).enter().append("g").attr("class", "slice").classed("eliminated", (A) => L.includes(A.data.label.split("#")[0]) || A.data.label.includes(y)).classed("elected", (A) => I.includes(A.data.label.split("#")[0]) && !A.data.label.includes(y)).attr("id", (A) => A.data.label).on("mouseenter", (A, nt) => ir(A, nt)).on("mouseleave", (A, nt) => sr(A, nt)), Le = jt().outerRadius(T).innerRadius(k); + if (F) { + const A = jt().outerRadius(k + 1).innerRadius(k); + qt.append("path").attr("d", A).transition("global").duration(S).attr("d", (nt) => Le(nt)).attr("fill", (nt) => ln(nt)).on("end", (nt) => rr()); } else - re.append("path").attr("d", (M) => dn(M)).attr("fill", (M) => I(M)), Ar(); - return F && xt(A, R, V, q, H), A; - } - function br() { - const R = gt(h(S)).select("#" + w).selectAll(".eliminated"); - R.size() > 0 && R.classed("finished", !0); - } - function $r() { - const R = gt(h(S)).select("#" + w).selectAll(".finished"); - R.size() > 0 && R.remove(); - } - function cn(p, A) { - const C = gt(h(S)).select("#" + x).selectAll(".eliminated"), q = _e().innerRadius(p), F = _e().outerRadius(A); - C.classed("finished", !0).select("path").transition("global").duration(X).attrTween("d", function(D) { - const H = Ye(A, p); - return function(P) { - return F.innerRadius(H(P)), F(D); + qt.append("path").attr("d", (A) => Le(A)).attr("fill", (A) => ln(A)), rr(); + return C && ti(v, x, O, R, T, L), x; + } + function ta() { + const x = st(g(H)).select("#" + b).selectAll(".eliminated"); + x.size() > 0 && x.classed("finished", !0); + } + function ea() { + const x = st(g(H)).select("#" + b).selectAll(".finished"); + x.size() > 0 && x.remove(); + } + function na(v, m) { + const R = st(g(H)).select("#" + p).selectAll(".eliminated"), k = jt().innerRadius(v), T = jt().outerRadius(m); + R.classed("finished", !0).select("path").transition("global").duration(S).attrTween("d", function(C) { + const F = Re(m, v); + return function(L) { + return T.innerRadius(F(L)), T(C); }; - }).attr("fill", (D) => `url(#${D.data.label.split("#")[0].replaceAll(" ", "-")})`), C.clone(!0).classed("finished", !0).select("path").transition("global").duration(X).attrTween("d", function(D) { - const H = Ye(A, p); - return function(P) { - return q.outerRadius(H(P)), q(D); + }).attr("fill", (C) => `url(#${C.data.label.split("#")[0].replaceAll(" ", "-")})`), R.clone(!0).classed("finished", !0).select("path").transition("global").duration(S).attrTween("d", function(C) { + const F = Re(m, v); + return function(L) { + return k.outerRadius(F(L)), k(C); }; - }).attr("fill", (D) => I(D)); + }).attr("fill", (C) => ln(C)); } - function Me(p, A) { - const R = (p + A) / 2; - return R > Math.PI * 11 / 6 || R < Math.PI * 1 / 6 || R > Math.PI * 5 / 6 && R < Math.PI * 7 / 6 ? "middle" : R < Math.PI ? "start" : "end"; + function nr(v, m) { + const x = (v + m) / 2; + return x > Math.PI * 11 / 6 || x < Math.PI * 1 / 6 || x > Math.PI * 5 / 6 && x < Math.PI * 7 / 6 ? "middle" : x < Math.PI ? "start" : "end"; } - function Ar() { - gt(h(S)).select("#" + w).raise().append("g").remove(); + function rr() { + st(g(H)).select("#" + b).raise().append("g").remove(); } - function va(p, A, R, V, C) { - const F = Mr().sort(null).value((D) => D.value)(A); - return bi( - p, - F, + function ra(v, m, x, O, R, k) { + const C = dr().sort(null).value((F) => F.value)(x); + return ri( + v, + m, + C, /* previousPieInfo, */ + O, R, - V, - C - ), F; - } - function bi(p, A, R, V, C) { - const q = fr(n(), r()), F = cr(n(), r()), D = _e().outerRadius(V).innerRadius(R).startAngle((M) => M.startAngle).endAngle((M) => M.endAngle), H = _e().outerRadius(V).innerRadius(R), U = gt(h(S)).select("#" + p); - U.selectAll(".slice").attr("prevStart", (M) => M.startAngle).attr("prevEnd", (M) => M.endAngle); - const ut = U.selectAll(".slice").data(A, (M) => M.data.label); - ut.enter().append("g").attr("class", "slice").attr("id", (M) => M.data.label).classed("eliminated", !0).on("mouseenter", (M, ht) => Tr(M, ht)).on("mouseleave", (M, ht) => Er(M, ht)).append("path").attr("d", (M) => H(M)).attr("fill", (M) => I(M)), ut.classed("eliminated", (M) => q.includes(M.data.label.split("#")[0])).classed("elected", (M) => F.includes(M.data.label.split("#")[0])).on("mouseenter", (M, ht) => Tr(M, ht)).on("mouseleave", (M, ht) => Er(M, ht)); - let re = ut.size(); - function dn() { - re--, re <= 0 && (Ar(), U.selectAll(".finished").remove()); + k + ), C; + } + function ri(v, m, x, O, R, k) { + const T = Un(n(), v), C = Gn(n(), v), F = jt().outerRadius(R).innerRadius(O).startAngle((A) => A.startAngle).endAngle((A) => A.endAngle), L = jt().outerRadius(R).innerRadius(O), V = st(g(H)).select("#" + m); + V.selectAll(".slice").attr("prevStart", (A) => A.startAngle).attr("prevEnd", (A) => A.endAngle); + const J = V.selectAll(".slice").data(x, (A) => A.data.label); + J.enter().append("g").attr("class", "slice").attr("id", (A) => A.data.label).classed("eliminated", !0).on("mouseenter", (A, nt) => ir(A, nt)).on("mouseleave", (A, nt) => sr(A, nt)).append("path").attr("d", (A) => L(A)).attr("fill", (A) => ln(A)), J.classed("eliminated", (A) => T.includes(A.data.label.split("#")[0])).classed("elected", (A) => C.includes(A.data.label.split("#")[0])).on("mouseenter", (A, nt) => ir(A, nt)).on("mouseleave", (A, nt) => sr(A, nt)); + let qt = J.size(); + function Le() { + qt--, qt <= 0 && (rr(), V.selectAll(".finished").remove()); } - return ut.select("path").transition("global").duration(X).attrTween("d", function(M) { - const ht = Number(gt(this.parentNode).attr("prevStart")), ga = Number(gt(this.parentNode).attr("prevEnd")), _a = Ye(ht, M.startAngle), ya = Ye(ga, M.endAngle); - return (Ai) => (D.startAngle(_a(Ai)).endAngle(ya(Ai)), D(M)); - }).on("end", dn), C && $t(A, V, q), A; + return J.select("path").transition("global").duration(S).attrTween("d", function(A) { + const nt = Number(st(this.parentNode).attr("prevStart")), aa = Number(st(this.parentNode).attr("prevEnd")), la = Re(nt, A.startAngle), oa = Re(aa, A.endAngle); + return (si) => (F.startAngle(la(si)).endAngle(oa(si)), F(A)); + }).on("end", Le), k && Zs(v, x, R, T), x; } - function Tr(p, A) { - s(A.data.label.split("#")[0]), i("enter"), a(p.clientY); + function ir(v, m) { + s(m.data.label.split("#")[0]), i("enter"), a(v.clientY); } - function Er(p, A) { - s(A.data.label.split("#")[0]), i("leave"); + function sr(v, m) { + s(m.data.label.split("#")[0]), i("leave"); } - function ma(p, A) { - i("show-exhausted"), a(p.clientY); + function ia(v, m) { + i("show-exhausted"), a(v.clientY); } - function pa(p, A) { + function sa(v, m) { i("hide-exhausted"); } - var $i = pc(); - return We($i, (p) => B(S, p), () => h(S)), Et(t, $i), _r({ + var ii = nc(); + return yr(ii, (v) => j(H, v), () => g(H)), fe(t, ii), Ur({ get jsonData() { return n(); }, - set jsonData(p) { - n(p), Q(); + set jsonData(v) { + n(v), Mt(); }, - get round() { + get currentRound() { return r(); }, - set round(p) { - r(p), Q(); + set currentRound(v) { + r(v), Mt(); }, get mouseEventType() { return i(); }, - set mouseEventType(p) { - i(p), Q(); + set mouseEventType(v) { + i(v), Mt(); }, get mouseData() { return s(); }, - set mouseData(p) { - s(p), Q(); + set mouseData(v) { + s(v), Mt(); }, get mouseY() { return a(); }, - set mouseY(p) { - a(p), Q(); - }, - get animateOneRound() { - return o(); - }, - set animateOneRound(p) { - o(p), Q(); + set mouseY(v) { + a(v), Mt(); }, get animateOnePhase() { return l(); }, - set animateOnePhase(p) { - l(p), Q(); + set animateOnePhase(v) { + l(v), Mt(); }, get runFullAnimation() { - return u(); - }, - set runFullAnimation(p) { - u(p), Q(); - }, - get setRound() { - return f(); + return o(); }, - set setRound(p) { - f(p), Q(); + set runFullAnimation(v) { + o(v), Mt(); } }); } -vi( - da, +gs( + Us, { jsonData: {}, - round: {}, + currentRound: {}, mouseEventType: {}, mouseData: {}, mouseY: {}, - animateOneRound: {}, animateOnePhase: {}, - runFullAnimation: {}, - setRound: {} + runFullAnimation: {} }, [], [], !0 ); -function ns(t, e, n, r) { - if (h(e)) return; - t.preventDefault(); - const i = t.currentTarget.getBoundingClientRect(), o = (("touches" in t && t.touches.length > 0 ? t.touches[0].clientX : "clientX" in t ? t.clientX : 0) - i.left) / i.width, l = Math.min(Math.max(Math.floor(o * n()), 0), n() - 1); - r(l, !0); - const u = (d) => { - const m = (("touches" in d && d.touches.length > 0 ? d.touches[0].clientX : "clientX" in d ? d.clientX : 0) - i.left) / i.width, y = Math.min(Math.max(Math.floor(m * n()), 0), n() - 1); - r(y, !0); - }, f = () => { - document.removeEventListener("mousemove", u), document.removeEventListener("touchmove", u), document.removeEventListener("mouseup", f), document.removeEventListener("touchend", f), document.removeEventListener("touchcancel", f); - }; - document.addEventListener("mousemove", u), document.addEventListener("touchmove", u), document.addEventListener("mouseup", f), document.addEventListener("touchend", f), document.addEventListener("touchcancel", f); -} -function _c(t, e) { - B(e, !1); -} -var yc = (t, e, n) => e(h(n) - 1, !0), xc = (t, e, n) => e(h(n) + 1, !0), wc = /* @__PURE__ */ jt("
"), bc = (t, e, n) => e(t, h(n).moreInfoText || ""), $c = /* @__PURE__ */ jt(''), Ac = /* @__PURE__ */ jt("
"), Tc = /* @__PURE__ */ jt('
'), Ec = /* @__PURE__ */ jt('
'), kc = /* @__PURE__ */ jt('
'); -const Rc = { - hash: "svelte-1mvbx0y", - code: ` - /* Include all styles from slider.css directly */.trs-wrapper.svelte-1mvbx0y {overflow:hidden;}.center-div.svelte-1mvbx0y {flex:1 1 auto;margin-left:30px;margin-right:30px;}.slider.svelte-1mvbx0y {width:100%;background-image:linear-gradient(10deg, #b1e0e6, #8ddae4);border-color:#333;border-style:solid;border-width:1px 1px 0 1px;border-radius:5px 5px 0 0;padding:5px 0 5px 0;display:flex;align-items:center;justify-content:space-evenly; - /* Don't allow dragging */-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.slider.svelte-1mvbx0y:hover {cursor:grab;}.slider.svelte-1mvbx0y:active {cursor:grabbing;}.slider-when-timeline-hidden.svelte-1mvbx0y {border-width:1px;border-radius:5px;box-shadow:1px 5px 20px 0 #dedede;} - - /* Base styles for slider items */.slider-item.svelte-1mvbx0y, .slider-item-hidden-slider.svelte-1mvbx0y {float:left;text-align:center;pointer-events:none;overflow:hidden;text-overflow:clip;} - - /* Style for hideActiveTickText=true (default) */.slider-item-future.svelte-1mvbx0y {color:#545454 !important;}.slider-item-active.svelte-1mvbx0y {background-image:url('/assets/slider.svg');background-repeat:no-repeat;background-position:center;min-width:28px !important;min-height:16px;background-size:28px 16px;} - - /* Style for hideActiveTickText=false */.slider-item-hidden-slider.svelte-1mvbx0y {font-size:0.7em;}.slider-item-hidden-slider-past.svelte-1mvbx0y {line-height:1rem;}.slider-item-hidden-slider-future.svelte-1mvbx0y {color:#545454 !important;line-height:1rem;}.slider-item-hidden-slider-active.svelte-1mvbx0y {font-weight:bold;font-size:1.2em;background-image:url('/assets/drag-affordance.png');background-repeat:repeat-x;background-position-y:bottom;background-position-x:left;background-size:6px;padding-bottom:2px;}.prev-next-button.svelte-1mvbx0y {border-radius:50%;background-color:black;width:20px;height:20px;min-width:20px;min-height:20px;line-height:1em;margin-top:10px;text-align:center;border:none;}.prev-next-button.svelte-1mvbx0y:disabled {background-color:gray;pointer-events:none;}.prev-next-button.svelte-1mvbx0y:hover {background-image:linear-gradient(135deg, #8f8f8f, #000);cursor:pointer;}.prev-next-button.svelte-1mvbx0y a:where(.svelte-1mvbx0y) {font-size:20px;vertical-align:baseline;color:white;}.prev-next-button.svelte-1mvbx0y a:where(.svelte-1mvbx0y):hover {text-decoration:none;} - - /* Slider Timeline Data */.timeline.svelte-1mvbx0y {border-color:#333;border-style:solid;border-radius:0 0 5px 5px;background-image:linear-gradient(10deg, #b1e0e6, #8ddae4);overflow-y:auto;overflow-x:hidden;width:100%;margin-left:auto;margin-right:auto;transition:max-height 0.6s ease-out, - opacity 0.3s ease-out, - padding 0.3s ease-out, - border-width 0.3s ease-out;}.timeline-header.svelte-1mvbx0y {text-align:center;}.timeline-column-active .timeline-header {font-weight:bold;}.timeline-column-past.svelte-1mvbx0y {opacity:75%;}.timeline-column-future.svelte-1mvbx0y {opacity:20%;}.timeline-column-active.svelte-1mvbx0y {opacity:100%;}.timeline-info-one-step.svelte-1mvbx0y {font-size:0.7em;float:left;}.timeline-info.svelte-1mvbx0y {border-radius:15px;padding:5px;margin:2px;border-width:2px;border-color:#CCCCCC33;border-style:ridge;background-color:lightgray;}.timeline-info-good.svelte-1mvbx0y {background-color:lightgreen;}.timeline-info-bad.svelte-1mvbx0y {background-color:lightcoral;}.question-mark.svelte-1mvbx0y {color:#fff;background-color:#6a6f6f;width:12px;height:12px;line-height:12px;vertical-align:middle;display:inline-block;float:right;border-radius:100%;font-size:10px;text-align:center;text-decoration:none;-webkit-box-shadow:inset -1px -1px 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:inset -1px -1px 1px 0 rgba(0,0,0,0.25);box-shadow:inset -1px -1px 1px 0 rgba(0,0,0,0.25);margin:0 0 0 5px;padding:0;border:0;} - - /* Tooltip */#timeline-info-tooltip.svelte-1mvbx0y {background-color:#333;color:#fff;text-align:center;padding:5px;border-radius:6px;font-size:0.7em;max-width:400px;position:fixed;z-index:100;opacity:1 !important;}.expand-collapse-button.svelte-1mvbx0y {font-size:0.7em;width:max-content;padding:2px 15px;text-align:center;margin-left:auto;margin-right:auto;background-image:linear-gradient(10deg, #e7fafd, #d6ebee);border-width:0 1px 1px 1px;border-style:solid;border-radius:0 0 5px 5px;}.expand-collapse-button.svelte-1mvbx0y:hover {text-decoration:underline;cursor:pointer;}` -}; -function ha(t, e) { - gr(e, !0), hi(t, Rc); - let n = it(e, "id", 7, "timeline-slider"), r = it(e, "numTicks", 7, 5), i = it(e, "width", 7, "600px"), s = it(e, "tickLabelPrefix", 7, "Round "), a = it(e, "hideTimelineInitially", 7, !0), o = it(e, "tickText", 7, "•"), l = it(e, "color", 7, "orangered"), u = it(e, "timelineData", 7, null), f = it(e, "animateOnLoad", 7, !1), d = it(e, "timelinePeeking", 7, !0), c = it(e, "hideActiveTickText", 7, !1), v = it(e, "timeBetweenStepsMs", 7, null), m = it(e, "leftArrowText", 7, "‹"), y = it(e, "rightArrowText", 7, "›"), x = it(e, "value", 7, 0), k = it(e, "onValueChange", 7, (g) => { - }), w = ot(lt(x())), b = ot(!a()), $ = ot(!1), N = ot(!1), z = ot(null), X = ot(""), Y = ot(!1), st = ot(lt({ x: 0, y: 0 })); - const at = 100 / r(), J = Array.from({ length: r() }, (g, T) => T); - let Z = ot(void 0), E = ot(lt([])); - function S(g) { - return Array.isArray(l()) ? g < l().length ? l()[g] : l()[0] : l(); - } - function _t(g) { - return Array.isArray(o()) ? g < o().length ? o()[g] : o()[0] : o(); - } - ui(() => { - h(w) !== x() && h(N) && ft(x()); - }); - function ft(g, T = !1) { - g === h(w) || g < 0 || g >= r() || (B(w, lt(g)), x(g), h(b) && h(E) && h(E)[g] && h(E)[g].scrollIntoView({ - behavior: "smooth", - inline: "center", - block: "nearest" - }), T ? window.requestAnimationFrame(() => k()(g)) : k()(g)); - } - function pt() { - B(b, !h(b)), h(b) && h(E) && h(E)[h(w)] && setTimeout( - () => { - h(E)[h(w)].scrollIntoView({ - behavior: "smooth", - inline: "center", - block: "nearest" - }); - }, - 100 - ); - } - function ct(g, T) { - T && (B(X, lt(T)), B(st, lt({ x: g.clientX + 5, y: g.clientY - 30 })), B(Y, !0), setTimeout( - () => { - if (h(z)) { - const O = h(z).getBoundingClientRect(); - O.right > window.innerWidth && (h(st).x = window.innerWidth - O.width - 10), O.bottom > window.innerHeight && (h(st).y = window.innerHeight - O.height - 10); - } - }, - 0 - )); - } - function Kt(g) { - const T = [ - { - summaryText: "Something good", - className: "timeline-info-good", - moreInfoText: "Like a birth or the end of wars" - }, - { - summaryText: "Something bad", - className: "timeline-info-bad", - moreInfoText: "As if millions of voices suddenly cried out in terror and were suddenly silenced" - }, - { summaryText: "Chance event!" } - ], O = []; - for (let I = 0; I < g; I++) { - const rt = []; - rt.push(T[Math.floor(Math.random() * 3)]), rt.push(T[Math.floor(Math.random() * 3)]), I % 2 === 0 && rt.push(T[Math.floor(Math.random() * 3)]), O.push(rt); - } - return O; - } - function Bt(g) { - if (h($)) return; - B($, !0); - let T = h(b); - d() && !h(b) && B(b, !0), ft(0, !1); - const O = v() || Math.min(1e3 / r(), 100); - let I = 1; - const rt = () => { - if (I >= r()) { - B($, !1), d() && !T && B(b, !1), g && g(!0); - return; - } - ft(I, !1), I++, setTimeout( - () => { - h($) ? window.requestAnimationFrame(rt) : g && g(!1); - }, - O - ); - }; - window.requestAnimationFrame(rt); - } - Is(async () => { - u() || u(Kt(r())), B(N, !0), f() && setTimeout( - () => { - Bt(); - }, - 100 - ); - }); - function It(g) { - Bt(g); - } - function Ht() { - pt(); - } - var Ft = kc(), Lt = tt(Ft); - Lt.__click = [yc, ft, w]; - var dt = tt(Lt), me = tt(dt); - Oi(me, m), K(dt), K(Lt); - var bt = mt(Lt, 2); - bt.__click = [xc, ft, w]; - var Xt = tt(bt), Wt = tt(Xt); - Oi(Wt, y), K(Xt), K(bt); - var kt = mt(bt, 2), vt = tt(kt); - let Rt; - vt.__mousedown = [ - ns, - $, - r, - ft - ], vt.__touchstart = [ - ns, - $, - r, - ft - ], Ke(vt, 21, () => J, je, (g, T) => { - var O = wc(); - let I; - var rt = tt(O); - { - var Nt = (yt) => { - var pe = xo(); - se((xt) => oe(pe, xt), [() => _t(h(T))]), Et(yt, pe); - }; - xn(rt, (yt) => { - c() && h(T) === h(w) || yt(Nt); - }); - } - K(O), se( - (yt) => { - Xe(O, "style", `max-width: ${at ?? ""}%; color: ${yt ?? ""};`), I = Sn(O, 1, "svelte-1mvbx0y", null, I, { - "slider-item": c(), - "slider-item-past": c() && h(T) < h(w), - "slider-item-active": c() && h(T) === h(w), - "slider-item-future": c() && h(T) > h(w), - "slider-item-hidden-slider": !c(), - "slider-item-hidden-slider-past": !c() && h(T) < h(w), - "slider-item-hidden-slider-active": !c() && h(T) === h(w), - "slider-item-hidden-slider-future": !c() && h(T) > h(w) - }); - }, - [() => S(h(T))] - ), Et(g, O); - }), K(vt); - var ne = mt(vt, 2), ke = tt(ne); - Ke(ke, 21, () => u() || [], je, (g, T, O) => { - var I = Tc(); - let rt; - var Nt = tt(I), yt = tt(Nt); - K(Nt); - var pe = mt(Nt, 2); - Ke(pe, 17, () => h(T), je, (xt, $t) => { - var Be = Ac(); - let un; - var fn = tt(Be), br = mt(fn); - { - var $r = (cn) => { - var Me = $c(); - Me.__mouseover = [bc, ct, $t], Me.__mouseout = [_c, Y], Et(cn, Me); - }; - xn(br, (cn) => { - h($t).moreInfoText && cn($r); - }); - } - K(Be), se(() => { - un = Sn(Be, 1, "timeline-info svelte-1mvbx0y", null, un, { - "timeline-info-good": h($t).className === "timeline-info-good", - "timeline-info-bad": h($t).className === "timeline-info-bad" - }), oe(fn, `${h($t).summaryText ?? ""} `); - }), Et(xt, Be); - }), K(I), We(I, (xt, $t) => h(E)[$t] = xt, (xt) => { - var $t; - return ($t = h(E)) == null ? void 0 : $t[xt]; - }, () => [O]), se(() => { - rt = Sn(I, 1, "timeline-info-one-step svelte-1mvbx0y", null, rt, { - "timeline-column-past": O < h(w), - "timeline-column-active": O === h(w), - "timeline-column-future": O > h(w) - }), oe(yt, `${s() ?? ""}${O + 1}`); - }), Et(g, I); - }), K(ke), K(ne), We(ne, (g) => B(Z, g), () => h(Z)); - var Ce = mt(ne, 2); - Ce.__click = pt; - var _ = tt(Ce, !0); - K(Ce), K(kt); - var L = mt(kt, 2); - { - var G = (g) => { - var T = Ec(), O = tt(T, !0); - K(T), We(T, (I) => B(z, I), () => h(z)), se(() => { - Xe(T, "style", `left: ${h(st).x ?? ""}px; top: ${h(st).y ?? ""}px;`), oe(O, h(X)); - }), Et(g, T); - }; - xn(L, (g) => { - h(Y) && g(G); - }); - } - return K(Ft), se(() => { - Xe(Ft, "id", n()), Xe(Ft, "style", `max-width: ${(typeof i() == "number" ? `${i()}px` : i()) ?? ""}`), Lt.disabled = h(w) === 0, bt.disabled = h(w) === r() - 1, Xe(vt, "id", "_sliderDiv_" + n()), Rt = Sn(vt, 1, "slider svelte-1mvbx0y", null, Rt, { - "slider-when-timeline-hidden": !h(b) - }), Xe(ne, "style", `max-height: ${(h(b) ? "999px" : "0") ?? ""}; - opacity: ${(h(b) ? 1 : 0) ?? ""}; - padding: ${(h(b) ? "5px 0 5px 0" : "0") ?? ""}; - border-width: ${(h(b) ? "0 1px 1px 1px" : "0") ?? ""};`), oe(_, h(b) ? "[—] Collapse Details" : "[+] Expand Details"); - }), Et(t, Ft), _r({ - animate: It, - toggleTimeline: Ht, - get id() { - return n(); - }, - set id(g = "timeline-slider") { - n(g), Q(); - }, - get numTicks() { - return r(); - }, - set numTicks(g = 5) { - r(g), Q(); - }, - get width() { - return i(); - }, - set width(g = "600px") { - i(g), Q(); - }, - get tickLabelPrefix() { - return s(); - }, - set tickLabelPrefix(g = "Round ") { - s(g), Q(); - }, - get hideTimelineInitially() { - return a(); - }, - set hideTimelineInitially(g = !0) { - a(g), Q(); - }, - get tickText() { - return o(); - }, - set tickText(g = "•") { - o(g), Q(); - }, - get color() { - return l(); - }, - set color(g = "orangered") { - l(g), Q(); - }, - get timelineData() { - return u(); - }, - set timelineData(g = null) { - u(g), Q(); - }, - get animateOnLoad() { - return f(); - }, - set animateOnLoad(g = !1) { - f(g), Q(); - }, - get timelinePeeking() { - return d(); - }, - set timelinePeeking(g = !0) { - d(g), Q(); - }, - get hideActiveTickText() { - return c(); - }, - set hideActiveTickText(g = !1) { - c(g), Q(); - }, - get timeBetweenStepsMs() { - return v(); - }, - set timeBetweenStepsMs(g = null) { - v(g), Q(); - }, - get leftArrowText() { - return m(); - }, - set leftArrowText(g = "‹") { - m(g), Q(); - }, - get rightArrowText() { - return y(); - }, - set rightArrowText(g = "›") { - y(g), Q(); - }, - get value() { - return x(); - }, - set value(g = 0) { - x(g), Q(); - }, - get onValueChange() { - return k(); - }, - set onValueChange(g = (T) => { - }) { - k(g), Q(); - } - }); -} -Ms([ - "click", - "mousedown", - "touchstart", - "mouseover", - "mouseout" -]); -vi( - ha, - { - id: {}, - numTicks: {}, - width: {}, - tickLabelPrefix: {}, - hideTimelineInitially: {}, - tickText: {}, - color: {}, - timelineData: {}, - animateOnLoad: {}, - timelinePeeking: {}, - hideActiveTickText: {}, - timeBetweenStepsMs: {}, - leftArrowText: {}, - rightArrowText: {}, - value: {}, - onValueChange: {} - }, - [], - ["animate", "toggleTimeline"], - !0 -); -function Nc(t) { +function ic(t) { const e = []; if (!t || typeof t != "object") return { valid: !1, errors: ["Input is not a valid object"] }; @@ -4694,33 +4196,33 @@ function Nc(t) { if (s === 0) n = new Set(Object.keys(a.tally)), r = new Set(n); else { - const o = new Set(Object.keys(a.tally)), l = [...o].filter((u) => !n.has(u)); - l.length > 0 && e.push(`Round ${a.round} contains new candidates not present in earlier rounds: ${l.join(", ")}`), r = o; + const l = new Set(Object.keys(a.tally)), o = [...l].filter((f) => !n.has(f)); + o.length > 0 && e.push(`Round ${a.round} contains new candidates not present in earlier rounds: ${o.join(", ")}`), r = l; } if (!a.tallyResults || !Array.isArray(a.tallyResults)) { e.push(`Round ${a.round} is missing tallyResults array`); continue; } - for (const o of a.tallyResults) { - o.elected !== void 0 && o.eliminated !== void 0 ? e.push(`Round ${a.round} has a result with both elected and eliminated set`) : o.elected === void 0 && o.eliminated === void 0 && e.push(`Round ${a.round} has a result with neither elected nor eliminated set`); - const l = o.elected || o.eliminated; - if (l && !r.has(l) && e.push(`Round ${a.round} references candidate "${l}" who is not in the current candidate list`), !o.transfers || typeof o.transfers != "object") { + for (const l of a.tallyResults) { + l.elected !== void 0 && l.eliminated !== void 0 ? e.push(`Round ${a.round} has a result with both elected and eliminated set`) : l.elected === void 0 && l.eliminated === void 0 && e.push(`Round ${a.round} has a result with neither elected nor eliminated set`); + const o = l.elected || l.eliminated; + if (o && !r.has(o) && e.push(`Round ${a.round} references candidate "${o}" who is not in the current candidate list`), !l.transfers || typeof l.transfers != "object") { e.push(`Round ${a.round} has a result missing transfers`); continue; } - const u = Object.keys(o.transfers); - for (const f of u) - f !== "exhausted" && !r.has(f) && e.push(`Round ${a.round} transfers votes to "${f}" who is not in the current candidate list`); - if (o.eliminated && l) { - const f = parseFloat(a.tally[l] || "0"); - let d = 0; - for (const c of Object.values(o.transfers)) { - const v = parseFloat(c || "0"); - isNaN(v) || (d += v); + const f = Object.keys(l.transfers); + for (const u of f) + u !== "exhausted" && !r.has(u) && e.push(`Round ${a.round} transfers votes to "${u}" who is not in the current candidate list`); + if (l.eliminated && o) { + const u = parseFloat(a.tally[o] || "0"); + let h = 0; + for (const c of Object.values(l.transfers)) { + const d = parseFloat(c || "0"); + isNaN(d) || (h += d); } - Math.abs(f - d) > 1e-4 && e.push(`Round ${a.round}: Eliminated candidate "${l}" had ${f} votes but transferred ${d}`); + Math.abs(u - h) > 1e-4 && e.push(`Round ${a.round}: Eliminated candidate "${o}" had ${u} votes but transferred ${h}`); } - l && r.delete(l); + o && r.delete(o); } } return { @@ -4728,17 +4230,11 @@ function Nc(t) { errors: e }; } -var Sc = /* @__PURE__ */ jt("  ", 1), Cc = /* @__PURE__ */ jt("About to eliminate: ", 1), Mc = /* @__PURE__ */ jt("  ", 1), Dc = /* @__PURE__ */ jt("Elected: ", 1), Oc = /* @__PURE__ */ jt("
", 1), Pc = /* @__PURE__ */ jt('


these ballots have already been eliminated.
'); -const Ic = { - hash: "svelte-1qs32ie", - code: `.page-container.svelte-1qs32ie {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-1qs32ie {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-1qs32ie {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:1.3rem;left:50%;transform:translate(-50%);font-weight:bold;opacity:0;}.tooltip.svelte-1qs32ie h3:where(.svelte-1qs32ie) {text-align:center;}.round-selector-container.svelte-1qs32ie {width:100%;display:flex;justify-content:center;margin:1rem 0;}.animation-button-container.svelte-1qs32ie {display:flex;justify-content:center;gap:10px;margin-bottom:1rem;}.pie-chart-container.svelte-1qs32ie { - /* width: 65%; */width:90%;min-width:800px; /* Larger minimum size */flex-grow:0; /* Don't grow beyond specified width */margin:0 auto;margin-right:40px; /* Add extra space on right */} - - - - -/*** Some parts of this will be overridden if we are also displaying the bubble-grid visualization ***/ - +var sc = /* @__PURE__ */ Ie("  ", 1), ac = /* @__PURE__ */ Ie("About to eliminate: ", 1), lc = /* @__PURE__ */ Ie("  ", 1), oc = /* @__PURE__ */ Ie("Elected: ", 1), uc = /* @__PURE__ */ Ie("
", 1), fc = /* @__PURE__ */ Ie('


these ballots have already been eliminated.
', 1); +const cc = { + hash: "svelte-hac7qn", + code: `.page-container.svelte-hac7qn {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-hac7qn {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-hac7qn {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:1.3rem;left:50%;transform:translate(-50%);font-weight:bold;opacity:0;}.tooltip.svelte-hac7qn h3:where(.svelte-hac7qn) {text-align:center;}.animation-button-container.svelte-hac7qn {display:flex;justify-content:center;gap:10px;margin-bottom:1rem;}.pie-chart-container.svelte-hac7qn { + /* width: 65%; */width:90%;min-width:800px; /* Larger minimum size */flex-grow:0; /* Don't grow beyond specified width */margin:0 auto;margin-right:40px; /* Add extra space on right */}.visualizations-container.svelte-hac7qn {display:flex;justify-content:space-between;width:100%;padding:0 20px;gap:80px;} /*** It looks like it is always OK to use justify-content: space-between even with no bubble viz display @@ -4767,271 +4263,211 @@ const Ic = { /* Media query for smaller screens */ -@media (max-width: 1300px) {.visualizations-container.svelte-1qs32ie {flex-direction:column;align-items:center;} +@media (max-width: 1300px) {.visualizations-container.svelte-hac7qn {flex-direction:column;align-items:center;} }` }; -function Fc(t, e) { - gr(e, !0), hi(t, Ic); +function hc(t, e) { + Xr(e, !0), ps(t, cc); const n = 0.85; - let r = it(e, "electionSummary", 7), i = ot(null), s = ot(null), a = ot(1), o = ot(""), l = ot(lt([])), u = ot(""), f = ot(""), d = ot(0), c = ot(null), v = ot(null), m = ot(null), y = ot(null), x = /* @__PURE__ */ Pe(() => k(r())); - function k(_) { - if (typeof _ == "string") { - console.log("input was a string"); + let r = Ht(e, "electionSummary", 7), i = Ht(e, "currentRound", 7), s = Ht(e, "onRoundChanged", 7, (w) => { + }); + Pn(() => { + s()(i()); + }); + let a = Ct(null), l = Ct(null), o = Ct(""), f = Ct(lt([])), u = Ct(""), h = Ct(""), c = Ct(0), d = Ct(null), p = Ct(null), _ = /* @__PURE__ */ jn(() => b(r())); + function b(w) { + if (typeof w == "string") try { - _ = JSON.parse(_); - } catch (L) { - return console.error("Failed to parse JSON string:", L), {}; + w = JSON.parse(w); + } catch (D) { + return console.error("Failed to parse JSON string:", D), {}; } - } - return console.log("RCtabSummary object status: ", Nc(_)), _ || {}; - } - function w(_) { - console.log("slider wants to move to round ", _), _ === h(a) + 1 && h(c) ? h(c)() : h(y) && h(y)(_); + return console.log("RCtabSummary object status: ", ic(w)), w || {}; } - function b() { - switch (console.log("mouse event ", h(u), h(f), h(d)), h(u)) { + function y() { + switch (g(u)) { case "enter": - ((_) => (B(l, lt(_[0])), B(o, lt(_[1]))))(N(h(f))), h(i) && (h(i).style.top = String(h(d) || 20) + "px", h(i).style.opacity = String(n)); + ((w) => (j(f, lt(w[0])), j(o, lt(w[1]))))(E(g(h), i())), g(a) && (g(a).style.top = String(g(c) || 20) + "px", g(a).style.opacity = String(n)); break; case "leave": - h(i) && (h(i).style.opacity = "0"), B(l, lt([])), B(o, ""); + g(a) && (g(a).style.opacity = "0"), j(f, lt([])), j(o, ""); break; case "show-exhausted": - h(s) && (h(s).style.top = String(h(d) || 20) + "px", h(s).style.opacity = String(n)); + g(l) && (g(l).style.top = String(g(c) || 20) + "px", g(l).style.opacity = String(n)); break; case "hide-exhausted": - h(s) && (h(s).style.opacity = "0"); + g(l) && (g(l).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", h(u)); + console.log("Unknown mouse event: ", g(u)); break; } } - ui(() => b()); - function $(_, L) { - return _ == 1 ? L ? "vote was" : "vote will be" : L ? "votes were" : "votes will be"; - } - function N(_) { - const L = [], G = _ === "exhausted" ? jr : _; - let g; - _ == "exhausted" ? g = ur(h(x), 1) : g = h(x).results[0].tally[_], L.push(`${G} started with ${g} votes.`); - for (let T = 1; T <= h(a); T++) { - T === h(a) && (_ == "exhausted" ? g = ur(h(x), h(a)) : g = h(x).results[h(a) - 1].tally[_], L.push(`${G} has ${g} votes at round ${h(a)}.`)); - const O = h(x).results[T - 1].tallyResults; - for (let I = 0; I < O.length; I++) { - const rt = O[I].transfers, Nt = O[I].eliminated, yt = O[I].elected; - if (Nt) - Nt === _ && L.push(`${G} will be eliminated on round ${T}.`); - else if (_ === yt && (L.push(`${G} was elected on round ${T}.`), rt)) - for (let [xt, $t] of Object.entries(rt)) - L.push(`${$t} ${$(Number($t), T < h(a))} transferred to ${xt} on round ${T}.`); - const pe = Nt || yt; - if (pe) { - const xt = Number(rt[_]); - xt && L.push(`${xt} ${$(xt, T < h(a))} transferred from ${pe} on round ${T}.`); + Pn(() => y()); + function $(w, D) { + return w == 1 ? D ? "vote was" : "vote will be" : D ? "votes were" : "votes will be"; + } + function E(w, D) { + const z = [], Y = w === "exhausted" ? kr : w; + let tt; + w == "exhausted" ? tt = Xn(g(_), 1) : tt = g(_).results[0].tally[w], z.push(`${Y} started with ${tt} votes.`); + for (let et = 1; et <= D; et++) { + et === D && (w == "exhausted" ? tt = Xn(g(_), D) : tt = g(_).results[D - 1].tally[w], z.push(`${Y} has ${tt} votes at round ${D}.`)); + const it = g(_).results[et - 1].tallyResults; + for (let $t = 0; $t < it.length; $t++) { + const qe = it[$t].transfers, $e = it[$t].eliminated, rn = it[$t].elected; + if ($e) + $e === w && z.push(`${Y} will be eliminated on round ${et}.`); + else if (w === rn && (z.push(`${Y} was elected on round ${et}.`), qe)) + for (let [ve, an] of Object.entries(qe)) + z.push(`${an} ${$(Number(an), et < D)} transferred to ${ve} on round ${et}.`); + const sn = $e || rn; + if (sn) { + const ve = Number(qe[w]); + ve && z.push(`${ve} ${$(ve, et < D)} transferred from ${sn} on round ${et}.`); } } } - return [L, G]; - } - function z() { - let _ = 0; - for (let L = 1; L <= h(x).results.length; L++) { - const G = h(x).results[L - 1].tallyResults; - for (let g = 0; g < G.length; g++) - G[g].elected && _++; + return [z, Y]; + } + function M() { + let w = 0; + for (let D = 1; D <= g(_).results.length; D++) { + const z = g(_).results[D - 1].tallyResults; + for (let Y = 0; Y < z.length; Y++) + z[Y].elected && w++; } - return _; - } - let X = /* @__PURE__ */ Pe(() => Y(h(x).results.length)); - function Y(_) { - const L = []; - for (let G = 0; G < _; G++) - L.push(_ < 10 ? `Round ${G + 1}` : _ < 20 ? `R ${G + 1}` : _ < 30 ? `${G + 1}` : "•"); - return L; - } - let st = /* @__PURE__ */ Pe(() => J(h(x))); - function at(_) { - return (typeof _ == "string" ? parseFloat(_) : _).toLocaleString(void 0, { maximumFractionDigits: 2 }); - } - function J(_) { - if (!_.results || !Array.isArray(_.results) || _.results.length === 0) - throw new Error("Invalid RCtabSummary: missing or empty results array"); - const L = []; - return _.results.forEach((G) => { - const g = []; - G.round, Object.entries(G.tally).map(([T, O]) => ({ candidate: T, votes: parseFloat(O) })).sort((T, O) => O.votes - T.votes), G.tallyResults.forEach((T) => { - if (T.elected) { - g.push({ - summaryText: `${T.elected} won`, - className: "timeline-info-good", - moreInfoText: `${T.elected} exceeded the threshold of ${at(G.threshold)} votes and was elected.` - }); - const O = Object.entries(T.transfers); - if (O.length > 0) { - const I = O.reduce((rt, [Nt, yt]) => rt + parseFloat(yt), 0); - I > 0 && g.push({ - summaryText: `${T.elected} transferred ${at(I)} surplus votes`, - className: "timeline-info", - moreInfoText: "Surplus votes were distributed to remaining candidates." - }); - } - } else if (T.eliminated) { - g.push({ - summaryText: `${T.eliminated} eliminated`, - className: "timeline-info-bad", - moreInfoText: `${T.eliminated} had the fewest votes and was eliminated.` - }); - const O = Object.entries(T.transfers); - if (O.length > 0) { - const I = O.reduce((rt, [Nt, yt]) => rt + parseFloat(yt), 0); - g.push({ - summaryText: `${T.eliminated} transferred ${at(I)} votes`, - className: "timeline-info", - moreInfoText: "Votes were redistributed based on next preferences." - }); - } - } - }), L.push(g); - }), L; + return w; } - var Z = Pc(), E = tt(Z), S = tt(E), _t = tt(S); - K(S); - var ft = mt(S, 2), pt = tt(ft); + var S = fc(), P = Ae(S), B = wt(P); + B.__click = function(...w) { + var D; + (D = g(p)) == null || D.apply(this, w); + }; + var W = Lt(B, 2); + W.__click = function(...w) { + var D; + (D = g(d)) == null || D.apply(this, w); + }, yt(P); + var rt = Lt(P, 2), Q = wt(rt), K = wt(Q), H = wt(K); + yt(K); + var N = Lt(K, 2), q = wt(N); { - var ct = (_) => { - var L = Cc(), G = mt(hn(L)); - Ke(G, 17, () => fr(h(x), h(a)), je, (g, T) => { - var O = Sc(), I = hn(O), rt = tt(I, !0); - K(I), Rn(), se(() => { - Fi(I, "color", Ne[h(T)]), oe(rt, h(T)); - }), Et(g, O); - }), Et(_, L); + var Nt = (w) => { + var D = ac(), z = Lt(Ae(D)); + ur(z, 17, () => Un(g(_), i()), or, (Y, tt) => { + var et = sc(), it = Ae(et), $t = wt(it, !0); + yt(it), on(), un(() => { + _i(it, "color", he[g(tt)]), Ve($t, g(tt)); + }), fe(Y, et); + }), fe(w, D); }; - xn(pt, (_) => { - fr(h(x), h(a)).length > 0 && _(ct); + vi(q, (w) => { + Un(g(_), i()).length > 0 && w(Nt); }); } - var Kt = mt(pt, 2); + var ft = Lt(q, 2); { - var Bt = (_) => { - var L = Dc(), G = mt(hn(L)); - Ke(G, 17, () => cr(h(x), h(a)), je, (g, T) => { - var O = Mc(), I = hn(O), rt = tt(I, !0); - K(I), Rn(), se(() => { - Fi(I, "color", Ne[h(T)]), oe(rt, h(T)); - }), Et(g, O); - }), Et(_, L); + var Tt = (w) => { + var D = oc(), z = Lt(Ae(D)); + ur(z, 17, () => Gn(g(_), i()), or, (Y, tt) => { + var et = lc(), it = Ae(et), $t = wt(it, !0); + yt(it), on(), un(() => { + _i(it, "color", he[g(tt)]), Ve($t, g(tt)); + }), fe(Y, et); + }), fe(w, D); }; - xn(Kt, (_) => { - cr(h(x), h(a)).length > 0 && _(Bt); + vi(ft, (w) => { + Gn(g(_), i()).length > 0 && w(Tt); }); } - K(ft), K(E); - var It = mt(E, 2), Ht = tt(It), Ft = tt(Ht, !0); - K(Ht); - var Lt = mt(Ht, 2); - Ke(Lt, 17, () => h(l), je, (_, L) => { - var G = Oc(), g = hn(G), T = tt(g, !0); - K(g), Rn(2), se(() => oe(T, h(L))), Et(_, G); - }), K(It), We(It, (_) => B(i, _), () => h(i)); - var dt = mt(It, 2), me = tt(dt); - me.nodeValue = `"${jr}" means all the candidates ranked on `, Rn(2), K(dt), We(dt, (_) => B(s, _), () => h(s)); - var bt = mt(dt, 2), Xt = tt(bt); - const Wt = /* @__PURE__ */ Pe(() => h(a) - 1); - ha(Xt, { - get numTicks() { - return h(x).results.length; - }, - get timelineData() { - return h(st); - }, - get tickText() { - return h(X); - }, - tickLabelPrefix: "Round ", - get value() { - return h(Wt); - }, - onValueChange: (_) => w(_ + 1) - }), K(bt); - var kt = mt(bt, 2), vt = tt(kt); - vt.__click = function(..._) { - var L; - (L = h(m)) == null || L.apply(this, _); - }; - var Rt = mt(vt, 2); - Rt.__click = function(..._) { - var L; - (L = h(v)) == null || L.apply(this, _); - }, K(kt); - var ne = mt(kt, 2), ke = tt(ne), Ce = tt(ke); - return da(Ce, { + yt(N), yt(Q); + var ct = Lt(Q, 2), Ft = wt(ct), ae = wt(Ft, !0); + yt(Ft); + var le = Lt(Ft, 2); + ur(le, 17, () => g(f), or, (w, D) => { + var z = uc(), Y = Ae(z), tt = wt(Y, !0); + yt(Y), on(2), un(() => Ve(tt, g(D))), fe(w, z); + }), yt(ct), yr(ct, (w) => j(a, w), () => g(a)); + var kt = Lt(ct, 2), oe = wt(kt); + oe.nodeValue = `"${kr}" means all the candidates ranked on `, on(2), yt(kt), yr(kt, (w) => j(l, w), () => g(l)); + var ue = Lt(kt, 2), ht = wt(ue), Gt = wt(ht); + return Us(Gt, { get jsonData() { - return h(x); + return g(_); }, - get round() { - return h(a); + get currentRound() { + return i(); }, - set round(_) { - B(a, lt(_)); + set currentRound(w) { + i(w); }, get mouseEventType() { - return h(u); + return g(u); }, - set mouseEventType(_) { - B(u, lt(_)); + set mouseEventType(w) { + j(u, lt(w)); }, get mouseData() { - return h(f); + return g(h); }, - set mouseData(_) { - B(f, lt(_)); + set mouseData(w) { + j(h, lt(w)); }, get mouseY() { - return h(d); - }, - set mouseY(_) { - B(d, lt(_)); + return g(c); }, - get animateOneRound() { - return h(c); - }, - set animateOneRound(_) { - B(c, lt(_)); + set mouseY(w) { + j(c, lt(w)); }, get animateOnePhase() { - return h(v); + return g(d); }, - set animateOnePhase(_) { - B(v, lt(_)); + set animateOnePhase(w) { + j(d, lt(w)); }, get runFullAnimation() { - return h(m); - }, - set runFullAnimation(_) { - B(m, lt(_)); - }, - get setRound() { - return h(y); + return g(p); }, - set setRound(_) { - B(y, lt(_)); + set runFullAnimation(w) { + j(p, lt(w)); } - }), K(ke), K(ne), K(Z), se( - (_) => { - oe(_t, `${h(x).config.contest ?? ""}, ${_ ?? ""} to be elected, Round ${h(a) ?? ""}.`), oe(Ft, h(o)); + }), yt(ht), yt(ue), yt(rt), un( + (w) => { + Ve(H, `${g(_).config.contest ?? ""}, ${w ?? ""} to be elected, Round ${i() ?? ""}.`), Ve(ae, g(o)); }, - [z] - ), Et(t, Z), _r({ - generateTimelineData: J, + [M] + ), fe(t, S), Ur({ get electionSummary() { return r(); }, - set electionSummary(_) { - r(_), Q(); + set electionSummary(w) { + r(w), Mt(); + }, + get currentRound() { + return i(); + }, + set currentRound(w) { + i(w), Mt(); + }, + get onRoundChanged() { + return s(); + }, + set onRoundChanged(w = (D) => { + }) { + s(w), Mt(); } }); } -Ms(["click"]); -customElements.define("pie-chart", vi(Fc, { electionSummary: {} }, [], ["generateTimelineData"], !0)); +al(["click"]); +customElements.define("pie-chart", gs( + hc, + { + electionSummary: {}, + currentRound: {}, + onRoundChanged: {} + }, + [], + [], + !0 +)); From 67855bac7c0cb6ba0ad8ac11743ff2f850188941 Mon Sep 17 00:00:00 2001 From: skaphan Date: Sun, 16 Mar 2025 21:29:18 -0700 Subject: [PATCH 09/18] It's mostly working except for animate and small step buttons --- static/pie/pie-chart.es.js | 2871 ++++++++++++++-------------- templates/pie/pie-nonblocking.html | 32 +- 2 files changed, 1442 insertions(+), 1461 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 96d971d6..3da1c870 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,74 +1,74 @@ -var ua = Object.defineProperty; +var la = Object.defineProperty; var ai = (t) => { throw TypeError(t); }; -var fa = (t, e, n) => e in t ? ua(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var St = (t, e, n) => fa(t, typeof e != "symbol" ? e + "" : e, n), li = (t, e, n) => e.has(t) || ai("Cannot " + n); -var dt = (t, e, n) => (li(t, e, "read from private field"), n ? n.call(t) : e.get(t)), ar = (t, e, n) => e.has(t) ? ai("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), lr = (t, e, n, r) => (li(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); -const ca = "5"; -typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ca); -const ha = 1, da = 2, va = 16, pa = 1, _a = 4, ga = 8, ma = 16, ya = 2, Ii = "[", Sr = "[!", Cr = "]", Xe = {}, vt = Symbol(), oi = !1, Dt = 2, Fi = 4, Mr = 8, Or = 16, re = 32, Oe = 64, An = 128, Rt = 256, En = 512, mt = 1024, ie = 2048, Pe = 4096, Qt = 8192, Kn = 16384, wa = 32768, Pr = 65536, xa = 1 << 19, qi = 1 << 20, Ue = Symbol("$state"), Li = Symbol("legacy props"); -var Dr = Array.isArray, ba = Array.prototype.indexOf, Ir = Array.from, Rn = Object.keys, Nn = Object.defineProperty, me = Object.getOwnPropertyDescriptor, $a = Object.prototype, Aa = Array.prototype, Ea = Object.getPrototypeOf; +var oa = (t, e, n) => e in t ? la(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var kt = (t, e, n) => oa(t, typeof e != "symbol" ? e + "" : e, n), li = (t, e, n) => e.has(t) || ai("Cannot " + n); +var ft = (t, e, n) => (li(t, e, "read from private field"), n ? n.call(t) : e.get(t)), lr = (t, e, n) => e.has(t) ? ai("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), or = (t, e, n, r) => (li(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); +const ua = "5"; +typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ua); +const fa = 1, ca = 2, ha = 16, da = 1, va = 4, pa = 8, _a = 16, ga = 2, Ii = "[", Sr = "[!", Cr = "]", Ue = {}, ct = Symbol(), oi = !1, Mt = 2, Fi = 4, Mr = 8, Or = 16, le = 32, Pe = 64, En = 128, Nt = 256, Rn = 512, pt = 1024, oe = 2048, De = 4096, re = 8192, jn = 16384, ma = 32768, Pr = 65536, ya = 1 << 19, qi = 1 << 20, Ge = Symbol("$state"), Li = Symbol("legacy props"); +var Dr = Array.isArray, wa = Array.prototype.indexOf, Ir = Array.from, Nn = Object.keys, Tn = Object.defineProperty, ye = Object.getOwnPropertyDescriptor, xa = Object.prototype, ba = Array.prototype, $a = Object.getPrototypeOf; function Vi(t) { for (var e = 0; e < t.length; e++) t[e](); } -let Ke = [], vr = []; +let je = [], pr = []; function Hi() { - var t = Ke; - Ke = [], Vi(t); + var t = je; + je = [], Vi(t); } -function Ra() { - var t = vr; - vr = [], Vi(t); +function Aa() { + var t = pr; + pr = [], Vi(t); } function Yi(t) { - Ke.length === 0 && queueMicrotask(Hi), Ke.push(t); + je.length === 0 && queueMicrotask(Hi), je.push(t); } function ui() { - Ke.length > 0 && Hi(), vr.length > 0 && Ra(); + je.length > 0 && Hi(), pr.length > 0 && Aa(); } function Bi(t) { return t === this.v; } -function Na(t, e) { +function Ea(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } function Fr(t) { - return !Na(t, this.v); + return !Ea(t, this.v); } -function Ta(t) { +function Ra(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function ka() { +function Na() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function Sa(t) { +function Ta(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function Ca() { +function ka() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Ma() { +function Sa() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function Oa(t) { +function Ca(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function Pa() { +function Ma() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Da() { +function Oa() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function Ia() { +function Pa() { throw new Error("https://svelte.dev/e/state_unsafe_local_read"); } -function Fa() { +function Da() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -let qa = !1; -function Et(t, e) { +let Ia = !1; +function Rt(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors @@ -80,49 +80,49 @@ function Et(t, e) { }; return n; } -function Ct(t) { - return /* @__PURE__ */ La(Et(t)); +function Zt(t) { + return /* @__PURE__ */ Fa(Rt(t)); } // @__NO_SIDE_EFFECTS__ function qr(t, e = !1) { - const n = Et(t); + const n = Rt(t); return e || (n.equals = Fr), n; } // @__NO_SIDE_EFFECTS__ -function La(t) { - return U !== null && !Ot && U.f & Dt && (Bt === null ? Ba([t]) : Bt.push(t)), t; +function Fa(t) { + return X !== null && !St && X.f & Mt && (Bt === null ? Ha([t]) : Bt.push(t)), t; } -function j(t, e) { - return U !== null && !Ot && us() && U.f & (Dt | Or) && // If the source was created locally within the current derived, then +function J(t, e) { + return X !== null && !St && us() && X.f & (Mt | Or) && // If the source was created locally within the current derived, then // we allow the mutation. - (Bt === null || !Bt.includes(t)) && Fa(), zi(t, e); + (Bt === null || !Bt.includes(t)) && Da(), zi(t, e); } function zi(t, e) { - return t.equals(e) || (t.v, t.v = e, t.wv = Qi(), Xi(t, ie), G !== null && G.f & mt && !(G.f & (re | Oe)) && (Wt === null ? za([t]) : Wt.push(t))), e; + return t.equals(e) || (t.v, t.v = e, t.wv = Qi(), Xi(t, oe), U !== null && U.f & pt && !(U.f & (le | Pe)) && (Qt === null ? Ya([t]) : Qt.push(t))), e; } function Xi(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; - a & ie || (te(s, e), a & (mt | Rt) && (a & Dt ? Xi( + a & oe || (ie(s, e), a & (pt | Nt) && (a & Mt ? Xi( /** @type {Derived} */ s, - Pe - ) : Zn( + De + ) : Qn( /** @type {Effect} */ s ))); } } // @__NO_SIDE_EFFECTS__ -function jn(t) { - var e = Dt | ie, n = U !== null && U.f & Dt ? ( +function Wn(t) { + var e = Mt | oe, n = X !== null && X.f & Mt ? ( /** @type {Derived} */ - U + X ) : null; - return G === null || n !== null && n.f & Rt ? e |= Rt : G.f |= qi, { - ctx: gt, + return U === null || n !== null && n.f & Nt ? e |= Nt : U.f |= qi, { + ctx: vt, deps: null, effects: null, equals: Bi, @@ -135,12 +135,12 @@ function jn(t) { null ), wv: 0, - parent: n ?? G + parent: n ?? U }; } // @__NO_SIDE_EFFECTS__ -function Va(t) { - const e = /* @__PURE__ */ jn(t); +function qa(t) { + const e = /* @__PURE__ */ Wn(t); return e.equals = Fr, e; } function Ui(t) { @@ -148,15 +148,15 @@ function Ui(t) { if (e !== null) { t.effects = null; for (var n = 0; n < e.length; n += 1) - ee( + se( /** @type {Effect} */ e[n] ); } } -function Ha(t) { +function La(t) { for (var e = t.parent; e !== null; ) { - if (!(e.f & Dt)) + if (!(e.f & Mt)) return ( /** @type {Effect} */ e @@ -165,56 +165,56 @@ function Ha(t) { } return null; } -function Ya(t) { - var e, n = G; - Se(Ha(t)); +function Va(t) { + var e, n = U; + Ce(La(t)); try { Ui(t), e = es(t); } finally { - Se(n); + Ce(n); } return e; } function Gi(t) { - var e = Ya(t), n = (de || t.f & Rt) && t.deps !== null ? Pe : mt; - te(t, n), t.equals(e) || (t.v = e, t.wv = Qi()); + var e = Va(t), n = (pe || t.f & Nt) && t.deps !== null ? De : pt; + ie(t, n), t.equals(e) || (t.v = e, t.wv = Qi()); } function Lr(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } let Z = !1; -function Zt(t) { +function ne(t) { Z = t; } -let X; +let z; function Xt(t) { if (t === null) - throw Lr(), Xe; - return X = t; + throw Lr(), Ue; + return z = t; } -function Wn() { +function Jn() { return Xt( /** @type {TemplateNode} */ - /* @__PURE__ */ se(X) + /* @__PURE__ */ ue(z) ); } -function yt(t) { +function mt(t) { if (Z) { - if (/* @__PURE__ */ se(X) !== null) - throw Lr(), Xe; - X = t; + if (/* @__PURE__ */ ue(z) !== null) + throw Lr(), Ue; + z = t; } } function on(t = 1) { if (Z) { - for (var e = t, n = X; e--; ) + for (var e = t, n = z; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ se(n); - X = n; + /* @__PURE__ */ ue(n); + z = n; } } -function pr() { - for (var t = 0, e = X; ; ) { +function _r() { + for (var t = 0, e = z; ; ) { if (e.nodeType === 8) { var n = ( /** @type {Comment} */ @@ -227,19 +227,19 @@ function pr() { } var r = ( /** @type {TemplateNode} */ - /* @__PURE__ */ se(e) + /* @__PURE__ */ ue(e) ); e.remove(), e = r; } } -function lt(t, e = null, n) { - if (typeof t != "object" || t === null || Ue in t) +function xt(t, e = null, n) { + if (typeof t != "object" || t === null || Ge in t) return t; - const r = Ea(t); - if (r !== $a && r !== Aa) + const r = $a(t); + if (r !== xa && r !== ba) return t; - var i = /* @__PURE__ */ new Map(), s = Dr(t), a = Et(0); - s && i.set("length", Et( + var i = /* @__PURE__ */ new Map(), s = Dr(t), a = Rt(0); + s && i.set("length", Rt( /** @type {any[]} */ t.length )); @@ -249,34 +249,34 @@ function lt(t, e = null, n) { t, { defineProperty(o, f, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Pa(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ma(); var h = i.get(f); - return h === void 0 ? (h = Et(u.value), i.set(f, h)) : j(h, lt(u.value, l)), !0; + return h === void 0 ? (h = Rt(u.value), i.set(f, h)) : J(h, xt(u.value, l)), !0; }, deleteProperty(o, f) { var u = i.get(f); if (u === void 0) - f in o && i.set(f, Et(vt)); + f in o && i.set(f, Rt(ct)); else { if (s && typeof f == "string") { var h = ( /** @type {Source} */ i.get("length") ), c = Number(f); - Number.isInteger(c) && c < h.v && j(h, c); + Number.isInteger(c) && c < h.v && J(h, c); } - j(u, vt), fi(a); + J(u, ct), fi(a); } return !0; }, get(o, f, u) { var p; - if (f === Ue) + if (f === Ge) return t; var h = i.get(f), c = f in o; - if (h === void 0 && (!c || (p = me(o, f)) != null && p.writable) && (h = Et(lt(c ? o[f] : vt, l)), i.set(f, h)), h !== void 0) { - var d = g(h); - return d === vt ? void 0 : d; + if (h === void 0 && (!c || (p = ye(o, f)) != null && p.writable) && (h = Rt(xt(c ? o[f] : ct, l)), i.set(f, h)), h !== void 0) { + var d = _(h); + return d === ct ? void 0 : d; } return Reflect.get(o, f, u); }, @@ -284,10 +284,10 @@ function lt(t, e = null, n) { var u = Reflect.getOwnPropertyDescriptor(o, f); if (u && "value" in u) { var h = i.get(f); - h && (u.value = g(h)); + h && (u.value = _(h)); } else if (u === void 0) { var c = i.get(f), d = c == null ? void 0 : c.v; - if (c !== void 0 && d !== vt) + if (c !== void 0 && d !== ct) return { enumerable: !0, configurable: !0, @@ -299,116 +299,116 @@ function lt(t, e = null, n) { }, has(o, f) { var d; - if (f === Ue) + if (f === Ge) return !0; - var u = i.get(f), h = u !== void 0 && u.v !== vt || Reflect.has(o, f); - if (u !== void 0 || G !== null && (!h || (d = me(o, f)) != null && d.writable)) { - u === void 0 && (u = Et(h ? lt(o[f], l) : vt), i.set(f, u)); - var c = g(u); - if (c === vt) + var u = i.get(f), h = u !== void 0 && u.v !== ct || Reflect.has(o, f); + if (u !== void 0 || U !== null && (!h || (d = ye(o, f)) != null && d.writable)) { + u === void 0 && (u = Rt(h ? xt(o[f], l) : ct), i.set(f, u)); + var c = _(u); + if (c === ct) return !1; } return h; }, set(o, f, u, h) { - var E; + var b; var c = i.get(f), d = f in o; if (s && f === "length") for (var p = u; p < /** @type {Source} */ c.v; p += 1) { - var _ = i.get(p + ""); - _ !== void 0 ? j(_, vt) : p in o && (_ = Et(vt), i.set(p + "", _)); + var m = i.get(p + ""); + m !== void 0 ? J(m, ct) : p in o && (m = Rt(ct), i.set(p + "", m)); } - c === void 0 ? (!d || (E = me(o, f)) != null && E.writable) && (c = Et(void 0), j(c, lt(u, l)), i.set(f, c)) : (d = c.v !== vt, j(c, lt(u, l))); - var b = Reflect.getOwnPropertyDescriptor(o, f); - if (b != null && b.set && b.set.call(h, u), !d) { + c === void 0 ? (!d || (b = ye(o, f)) != null && b.writable) && (c = Rt(void 0), J(c, xt(u, l)), i.set(f, c)) : (d = c.v !== ct, J(c, xt(u, l))); + var E = Reflect.getOwnPropertyDescriptor(o, f); + if (E != null && E.set && E.set.call(h, u), !d) { if (s && typeof f == "string") { - var y = ( + var w = ( /** @type {Source} */ i.get("length") ), $ = Number(f); - Number.isInteger($) && $ >= y.v && j(y, $ + 1); + Number.isInteger($) && $ >= w.v && J(w, $ + 1); } fi(a); } return !0; }, ownKeys(o) { - g(a); + _(a); var f = Reflect.ownKeys(o).filter((c) => { var d = i.get(c); - return d === void 0 || d.v !== vt; + return d === void 0 || d.v !== ct; }); for (var [u, h] of i) - h.v !== vt && !(u in o) && f.push(u); + h.v !== ct && !(u in o) && f.push(u); return f; }, setPrototypeOf() { - Da(); + Oa(); } } ); } function fi(t, e = 1) { - j(t, t.v + e); + J(t, t.v + e); } var ci, Ki, ji, Wi; -function _r() { +function gr() { if (ci === void 0) { ci = window, Ki = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype; - ji = me(e, "firstChild").get, Wi = me(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; + ji = ye(e, "firstChild").get, Wi = ye(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; } } -function Tn(t = "") { +function kn(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function we(t) { +function xe(t) { return ji.call(t); } // @__NO_SIDE_EFFECTS__ -function se(t) { +function ue(t) { return Wi.call(t); } -function wt(t, e) { +function yt(t, e) { if (!Z) - return /* @__PURE__ */ we(t); + return /* @__PURE__ */ xe(t); var n = ( /** @type {TemplateNode} */ - /* @__PURE__ */ we(X) + /* @__PURE__ */ xe(z) ); if (n === null) - n = X.appendChild(Tn()); + n = z.appendChild(kn()); else if (e && n.nodeType !== 3) { - var r = Tn(); + var r = kn(); return n == null || n.before(r), Xt(r), r; } return Xt(n), n; } -function Ae(t, e) { +function Ee(t, e) { if (!Z) { var n = ( /** @type {DocumentFragment} */ - /* @__PURE__ */ we( + /* @__PURE__ */ xe( /** @type {Node} */ t ) ); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ se(n) : n; + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ue(n) : n; } - return X; + return z; } -function Lt(t, e = 1, n = !1) { - let r = Z ? X : t; +function Vt(t, e = 1, n = !1) { + let r = Z ? z : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ se(r); + /* @__PURE__ */ ue(r); if (!Z) return r; var s = r == null ? void 0 : r.nodeType; if (n && s !== 3) { - var a = Tn(); + var a = kn(); return r === null ? i == null || i.after(a) : r.before(a), Xt(a), a; } return Xt(r), /** @type {TemplateNode} */ @@ -417,40 +417,40 @@ function Lt(t, e = 1, n = !1) { function Ji(t) { t.textContent = ""; } -let _n = !1, kn = !1, Sn = null, gn = !1, Vr = !1; +let _n = !1, Sn = !1, Cn = null, gn = !1, Vr = !1; function hi(t) { Vr = t; } -let Ge = []; -let U = null, Ot = !1; -function ke(t) { - U = t; -} -let G = null; +let Ke = []; +let X = null, St = !1; function Se(t) { - G = t; + X = t; +} +let U = null; +function Ce(t) { + U = t; } let Bt = null; -function Ba(t) { +function Ha(t) { Bt = t; } -let ot = null, xt = 0, Wt = null; -function za(t) { - Wt = t; +let lt = null, wt = 0, Qt = null; +function Ya(t) { + Qt = t; } -let Zi = 1, Cn = 0, de = !1; +let Zi = 1, Mn = 0, pe = !1; function Qi() { return ++Zi; } -function en(t) { +function nn(t) { var h; var e = t.f; - if (e & ie) + if (e & oe) return !0; - if (e & Pe) { - var n = t.deps, r = (e & Rt) !== 0; + if (e & De) { + var n = t.deps, r = (e & Nt) !== 0; if (n !== null) { - var i, s, a = (e & En) !== 0, l = r && G !== null && !de, o = n.length; + var i, s, a = (e & Rn) !== 0, l = r && U !== null && !pe, o = n.length; if (a || l) { var f = ( /** @type {Derived} */ @@ -458,10 +458,10 @@ function en(t) { ), u = f.parent; for (i = 0; i < o; i++) s = n[i], (a || !((h = s == null ? void 0 : s.reactions) != null && h.includes(f))) && (s.reactions ?? (s.reactions = [])).push(f); - a && (f.f ^= En), l && u !== null && !(u.f & Rt) && (f.f ^= Rt); + a && (f.f ^= Rn), l && u !== null && !(u.f & Nt) && (f.f ^= Nt); } for (i = 0; i < o; i++) - if (s = n[i], en( + if (s = n[i], nn( /** @type {Derived} */ s ) && Gi( @@ -470,35 +470,35 @@ function en(t) { ), s.wv > t.wv) return !0; } - (!r || G !== null && !de) && te(t, mt); + (!r || U !== null && !pe) && ie(t, pt); } return !1; } -function Xa(t, e) { +function Ba(t, e) { for (var n = e; n !== null; ) { - if (n.f & An) + if (n.f & En) try { n.fn(t); return; } catch { - n.f ^= An; + n.f ^= En; } n = n.parent; } throw _n = !1, t; } -function Ua(t) { - return (t.f & Kn) === 0 && (t.parent === null || (t.parent.f & An) === 0); +function za(t) { + return (t.f & jn) === 0 && (t.parent === null || (t.parent.f & En) === 0); } -function Jn(t, e, n, r) { +function Zn(t, e, n, r) { if (_n) { - if (n === null && (_n = !1), Ua(e)) + if (n === null && (_n = !1), za(e)) throw t; return; } n !== null && (_n = !0); { - Xa(t, e); + Ba(t, e); return; } } @@ -507,12 +507,12 @@ function ts(t, e, n = !0) { if (r !== null) for (var i = 0; i < r.length; i++) { var s = r[i]; - s.f & Dt ? ts( + s.f & Mt ? ts( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? te(s, ie) : s.f & mt && te(s, Pe), Zn( + ) : e === s && (n ? ie(s, oe) : s.f & pt && ie(s, De), Qn( /** @type {Effect} */ s )); @@ -520,152 +520,152 @@ function ts(t, e, n = !0) { } function es(t) { var d; - var e = ot, n = xt, r = Wt, i = U, s = de, a = Bt, l = gt, o = Ot, f = t.f; - ot = /** @type {null | Value[]} */ - null, xt = 0, Wt = null, de = (f & Rt) !== 0 && (Ot || !gn || U === null), U = f & (re | Oe) ? null : t, Bt = null, di(t.ctx), Ot = !1, Cn++; + var e = lt, n = wt, r = Qt, i = X, s = pe, a = Bt, l = vt, o = St, f = t.f; + lt = /** @type {null | Value[]} */ + null, wt = 0, Qt = null, pe = (f & Nt) !== 0 && (St || !gn || X === null), X = f & (le | Pe) ? null : t, Bt = null, di(t.ctx), St = !1, Mn++; try { var u = ( /** @type {Function} */ (0, t.fn)() ), h = t.deps; - if (ot !== null) { + if (lt !== null) { var c; - if (Mn(t, xt), h !== null && xt > 0) - for (h.length = xt + ot.length, c = 0; c < ot.length; c++) - h[xt + c] = ot[c]; + if (On(t, wt), h !== null && wt > 0) + for (h.length = wt + lt.length, c = 0; c < lt.length; c++) + h[wt + c] = lt[c]; else - t.deps = h = ot; - if (!de) - for (c = xt; c < h.length; c++) + t.deps = h = lt; + if (!pe) + for (c = wt; c < h.length; c++) ((d = h[c]).reactions ?? (d.reactions = [])).push(t); - } else h !== null && xt < h.length && (Mn(t, xt), h.length = xt); - if (us() && Wt !== null && !Ot && h !== null && !(t.f & (Dt | Pe | ie))) + } else h !== null && wt < h.length && (On(t, wt), h.length = wt); + if (us() && Qt !== null && !St && h !== null && !(t.f & (Mt | De | oe))) for (c = 0; c < /** @type {Source[]} */ - Wt.length; c++) + Qt.length; c++) ts( - Wt[c], + Qt[c], /** @type {Effect} */ t ); - return i !== null && Cn++, u; + return i !== null && Mn++, u; } finally { - ot = e, xt = n, Wt = r, U = i, de = s, Bt = a, di(l), Ot = o; + lt = e, wt = n, Qt = r, X = i, pe = s, Bt = a, di(l), St = o; } } -function Ga(t, e) { +function Xa(t, e) { let n = e.reactions; if (n !== null) { - var r = ba.call(n, t); + var r = wa.call(n, t); if (r !== -1) { var i = n.length - 1; i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - n === null && e.f & Dt && // Destroying a child effect while updating a parent effect can cause a dependency to appear + n === null && e.f & Mt && // 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 || !ot.includes(e)) && (te(e, Pe), e.f & (Rt | En) || (e.f ^= En), Ui( + (lt === null || !lt.includes(e)) && (ie(e, De), e.f & (Nt | Rn) || (e.f ^= Rn), Ui( /** @type {Derived} **/ e - ), Mn( + ), On( /** @type {Derived} **/ e, 0 )); } -function Mn(t, e) { +function On(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - Ga(t, n[r]); + Xa(t, n[r]); } function Hr(t) { var e = t.f; - if (!(e & Kn)) { - te(t, mt); - var n = G, r = gt, i = gn; - G = t, gn = !0; + if (!(e & jn)) { + ie(t, pt); + var n = U, r = vt, i = gn; + U = t, gn = !0; try { - e & Or ? nl(t) : ss(t), is(t); + e & Or ? tl(t) : ss(t), is(t); var s = es(t); t.teardown = typeof s == "function" ? s : null, t.wv = Zi; var a = t.deps, l; - oi && qa && t.f & ie; + oi && Ia && t.f & oe; } catch (o) { - Jn(o, t, n, r || t.ctx); + Zn(o, t, n, r || t.ctx); } finally { - gn = i, G = n; + gn = i, U = n; } } } -function Ka() { +function Ua() { try { - Ca(); + ka(); } catch (t) { - if (Sn !== null) - Jn(t, Sn, null); + if (Cn !== null) + Zn(t, Cn, null); else throw t; } } function ns() { try { - for (var t = 0; Ge.length > 0; ) { - t++ > 1e3 && Ka(); - var e = Ge, n = e.length; - Ge = []; + for (var t = 0; Ke.length > 0; ) { + t++ > 1e3 && Ua(); + var e = Ke, n = e.length; + Ke = []; for (var r = 0; r < n; r++) { var i = e[r]; - i.f & mt || (i.f ^= mt); - var s = Wa(i); - ja(s); + i.f & pt || (i.f ^= pt); + var s = Ka(i); + Ga(s); } } } finally { - kn = !1, Sn = null; + Sn = !1, Cn = null; } } -function ja(t) { +function Ga(t) { var e = t.length; if (e !== 0) for (var n = 0; n < e; n++) { var r = t[n]; - if (!(r.f & (Kn | Qt))) + if (!(r.f & (jn | re))) try { - en(r) && (Hr(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? as(r) : r.fn = null)); + nn(r) && (Hr(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? as(r) : r.fn = null)); } catch (i) { - Jn(i, r, null, r.ctx); + Zn(i, r, null, r.ctx); } } } -function Zn(t) { - kn || (kn = !0, queueMicrotask(ns)); - for (var e = Sn = t; e.parent !== null; ) { +function Qn(t) { + Sn || (Sn = !0, queueMicrotask(ns)); + for (var e = Cn = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (n & (Oe | re)) { - if (!(n & mt)) return; - e.f ^= mt; + if (n & (Pe | le)) { + if (!(n & pt)) return; + e.f ^= pt; } } - Ge.push(e); + Ke.push(e); } -function Wa(t) { +function Ka(t) { for (var e = [], n = t.first; n !== null; ) { - var r = n.f, i = (r & re) !== 0, s = i && (r & mt) !== 0; - if (!s && !(r & Qt)) { + var r = n.f, i = (r & le) !== 0, s = i && (r & pt) !== 0; + if (!s && !(r & re)) { if (r & Fi) e.push(n); else if (i) - n.f ^= mt; + n.f ^= pt; else { - var a = U; + var a = X; try { - U = n, en(n) && Hr(n); + X = n, nn(n) && Hr(n); } catch (f) { - Jn(f, n, null, n.ctx); + Zn(f, n, null, n.ctx); } finally { - U = a; + X = a; } } var l = n.first; @@ -680,21 +680,21 @@ function Wa(t) { } return e; } -function Mt(t) { +function ee(t) { var e; - for (ui(); Ge.length > 0; ) - kn = !0, ns(), ui(); + for (ui(); Ke.length > 0; ) + Sn = !0, ns(), ui(); return ( /** @type {T} */ e ); } -function g(t) { - var e = t.f, n = (e & Dt) !== 0; - if (U !== null && !Ot) { - Bt !== null && Bt.includes(t) && Ia(); - var r = U.deps; - t.rv < Cn && (t.rv = Cn, ot === null && r !== null && r[xt] === t ? xt++ : ot === null ? ot = [t] : (!de || !ot.includes(t)) && ot.push(t)); +function _(t) { + var e = t.f, n = (e & Mt) !== 0; + if (X !== null && !St) { + Bt !== null && Bt.includes(t) && Pa(); + var r = X.deps; + t.rv < Mn && (t.rv = Mn, lt === null && r !== null && r[wt] === t ? wt++ : lt === null ? lt = [t] : (!pe || !lt.includes(t)) && lt.push(t)); } else if (n && /** @type {Derived} */ t.deps === null && /** @type {Derived} */ t.effects === null) { @@ -702,37 +702,37 @@ function g(t) { /** @type {Derived} */ t ), s = i.parent; - s !== null && !(s.f & Rt) && (i.f ^= Rt); + s !== null && !(s.f & Nt) && (i.f ^= Nt); } return n && (i = /** @type {Derived} */ - t, en(i) && Gi(i)), t.v; + t, nn(i) && Gi(i)), t.v; } -function On(t) { - var e = Ot; +function Pn(t) { + var e = St; try { - return Ot = !0, t(); + return St = !0, t(); } finally { - Ot = e; + St = e; } } -const Ja = -7169; -function te(t, e) { - t.f = t.f & Ja | e; +const ja = -7169; +function ie(t, e) { + t.f = t.f & ja | e; } -function Za(t) { - G === null && U === null && Sa(), U !== null && U.f & Rt && G === null && ka(), Vr && Ta(); +function Wa(t) { + U === null && X === null && Ta(), X !== null && X.f & Nt && U === null && Na(), Vr && Ra(); } -function Qa(t, e) { +function Ja(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function De(t, e, n, r = !0) { - var i = (t & Oe) !== 0, s = G, a = { - ctx: gt, +function Ie(t, e, n, r = !0) { + var i = (t & Pe) !== 0, s = U, a = { + ctx: vt, deps: null, nodes_start: null, nodes_end: null, - f: t | ie, + f: t | oe, first: null, fn: e, last: null, @@ -745,78 +745,78 @@ function De(t, e, n, r = !0) { }; if (n) try { - Hr(a), a.f |= wa; + Hr(a), a.f |= ma; } catch (f) { - throw ee(a), f; + throw se(a), f; } - else e !== null && Zn(a); - var l = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (qi | An)) === 0; - if (!l && !i && r && (s !== null && Qa(a, s), U !== null && U.f & Dt)) { + else e !== null && Qn(a); + var l = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (qi | En)) === 0; + if (!l && !i && r && (s !== null && Ja(a, s), X !== null && X.f & Mt)) { var o = ( /** @type {Derived} */ - U + X ); (o.effects ?? (o.effects = [])).push(a); } return a; } -function Pn(t) { - Za(); - var e = G !== null && (G.f & re) !== 0 && gt !== null && !gt.m; +function Dn(t) { + Wa(); + var e = U !== null && (U.f & le) !== 0 && vt !== null && !vt.m; if (e) { var n = ( /** @type {ComponentContext} */ - gt + vt ); (n.e ?? (n.e = [])).push({ fn: t, - effect: G, - reaction: U + effect: U, + reaction: X }); } else { var r = Yr(t); return r; } } -function tl(t) { - const e = De(Oe, t, !0); +function Za(t) { + const e = Ie(Pe, t, !0); return () => { - ee(e); + se(e); }; } -function el(t) { - const e = De(Oe, t, !0); +function Qa(t) { + const e = Ie(Pe, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Dn(e, () => { - ee(e), r(void 0); - }) : (ee(e), r(void 0)); + n.outro ? In(e, () => { + se(e), r(void 0); + }) : (se(e), r(void 0)); }); } function Yr(t) { - return De(Fi, t, !1); + return Ie(Fi, t, !1); } function rs(t) { - return De(Mr, t, !0); + return Ie(Mr, t, !0); } -function un(t, e = [], n = jn) { +function un(t, e = [], n = Wn) { const r = e.map(n); - return Br(() => t(...r.map(g))); + return Br(() => t(...r.map(_))); } function Br(t, e = 0) { - return De(Mr | Or | e, t, !0); + return Ie(Mr | Or | e, t, !0); } -function je(t, e = !0) { - return De(Mr | re, t, !0, e); +function We(t, e = !0) { + return Ie(Mr | le, t, !0, e); } function is(t) { var e = t.teardown; if (e !== null) { - const n = Vr, r = U; - hi(!0), ke(null); + const n = Vr, r = X; + hi(!0), Se(null); try { e.call(null); } finally { - hi(n), ke(r); + hi(n), Se(r); } } } @@ -824,28 +824,28 @@ function ss(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { var r = n.next; - ee(n, e), n = r; + se(n, e), n = r; } } -function nl(t) { +function tl(t) { for (var e = t.first; e !== null; ) { var n = e.next; - e.f & re || ee(e), e = n; + e.f & le || se(e), e = n; } } -function ee(t, e = !0) { +function se(t, e = !0) { var n = !1; - if ((e || t.f & xa) && t.nodes_start !== null) { + if ((e || t.f & ya) && t.nodes_start !== null) { for (var r = t.nodes_start, i = t.nodes_end; r !== null; ) { var s = r === i ? null : ( /** @type {TemplateNode} */ - /* @__PURE__ */ se(r) + /* @__PURE__ */ ue(r) ); r.remove(), r = s; } n = !0; } - ss(t, e && !n), Mn(t, 0), te(t, Kn); + ss(t, e && !n), On(t, 0), ie(t, jn); var a = t.transitions; if (a !== null) for (const o of a) @@ -858,10 +858,10 @@ function as(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) { +function In(t, e) { var n = []; zr(t, n, !0), ls(n, () => { - ee(t), e && e(); + se(t), e && e(); }); } function ls(t, e) { @@ -874,24 +874,24 @@ function ls(t, e) { e(); } function zr(t, e, n) { - if (!(t.f & Qt)) { - if (t.f ^= Qt, t.transitions !== null) + if (!(t.f & re)) { + if (t.f ^= re, t.transitions !== null) for (const a of t.transitions) (a.is_global || n) && e.push(a); for (var r = t.first; r !== null; ) { - var i = r.next, s = (r.f & Pr) !== 0 || (r.f & re) !== 0; + var i = r.next, s = (r.f & Pr) !== 0 || (r.f & le) !== 0; zr(r, e, s ? n : !1), r = i; } } } -function In(t) { +function Fn(t) { os(t, !0); } function os(t, e) { - if (t.f & Qt) { - t.f ^= Qt, t.f & mt || (t.f ^= mt), en(t) && (te(t, ie), Zn(t)); + if (t.f & re) { + t.f ^= re, t.f & pt || (t.f ^= pt), nn(t) && (ie(t, oe), Qn(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & Pr) !== 0 || (n.f & re) !== 0; + var r = n.next, i = (n.f & Pr) !== 0 || (n.f & le) !== 0; os(n, i ? e : !1), n = r; } if (t.transitions !== null) @@ -899,16 +899,16 @@ function os(t, e) { (s.is_global || e) && s.in(); } } -function rl(t) { +function el(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -let gt = null; +let vt = null; function di(t) { - gt = t; + vt = t; } function Xr(t, e = !1, n) { - gt = { - p: gt, + vt = { + p: vt, c: null, e: null, m: !1, @@ -918,23 +918,23 @@ function Xr(t, e = !1, n) { }; } function Ur(t) { - const e = gt; + const e = vt; if (e !== null) { t !== void 0 && (e.x = t); const a = e.e; if (a !== null) { - var n = G, r = U; + var n = U, r = X; e.e = null; try { for (var i = 0; i < a.length; i++) { var s = a[i]; - Se(s.effect), ke(s.reaction), Yr(s.fn); + Ce(s.effect), Se(s.reaction), Yr(s.fn); } } finally { - Se(n), ke(r); + Ce(n), Se(r); } } - gt = e.p, e.m = !0; + vt = e.p, e.m = !0; } return t || /** @type {T} */ {}; @@ -942,15 +942,15 @@ function Ur(t) { function us() { return !0; } -const il = ["touchstart", "touchmove"]; -function sl(t) { - return il.includes(t); +const nl = ["touchstart", "touchmove"]; +function rl(t) { + return nl.includes(t); } -const fs = /* @__PURE__ */ new Set(), gr = /* @__PURE__ */ new Set(); -function al(t) { +const fs = /* @__PURE__ */ new Set(), mr = /* @__PURE__ */ new Set(); +function il(t) { for (var e = 0; e < t.length; e++) fs.add(t[e]); - for (var n of gr) + for (var n of mr) n(t); } function fn(t) { @@ -976,45 +976,45 @@ function fn(t) { } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - Nn(t, "currentTarget", { + Tn(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var u = U, h = G; - ke(null), Se(null); + var u = X, h = U; + Se(null), Ce(null); try { for (var c, d = []; s !== null; ) { var p = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { - var _ = s["__" + r]; - if (_ !== void 0 && (!/** @type {any} */ + var m = s["__" + r]; + if (m !== void 0 && (!/** @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)) - if (Dr(_)) { - var [b, ...y] = _; - b.apply(s, [t, ...y]); + if (Dr(m)) { + var [E, ...w] = m; + E.apply(s, [t, ...w]); } else - _.call(s, t); - } catch (E) { - c ? d.push(E) : c = E; + m.call(s, t); + } catch (b) { + c ? d.push(b) : c = b; } if (t.cancelBubble || p === e || p === null) break; s = p; } if (c) { - for (let E of d) + for (let b of d) queueMicrotask(() => { - throw E; + throw b; }); throw c; } } finally { - t.__root = e, delete t.currentTarget, ke(u), Se(h); + t.__root = e, delete t.currentTarget, Se(u), Ce(h); } } } @@ -1022,19 +1022,19 @@ function cs(t) { var e = document.createElement("template"); return e.innerHTML = t, e.content; } -function We(t, e) { +function Je(t, e) { var n = ( /** @type {Effect} */ - G + U ); n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e); } // @__NO_SIDE_EFFECTS__ -function Ie(t, e) { - var n = (e & ya) !== 0, r, i = !t.startsWith(""); +function Fe(t, e) { + var n = (e & ga) !== 0, r, i = !t.startsWith(""); return () => { if (Z) - return We(X, null), X; + return Je(z, null), z; r === void 0 && (r = cs(i ? t : "" + t)); var s = ( /** @type {TemplateNode} */ @@ -1043,43 +1043,43 @@ function Ie(t, e) { { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ we(s) + /* @__PURE__ */ xe(s) ), l = ( /** @type {TemplateNode} */ s.lastChild ); - We(a, l); + Je(a, l); } return s; }; } // @__NO_SIDE_EFFECTS__ -function ll(t, e, n = "svg") { +function sl(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { if (Z) - return We(X, null), X; + return Je(z, null), z; if (!s) { var a = ( /** @type {DocumentFragment} */ cs(i) ), l = ( /** @type {Element} */ - /* @__PURE__ */ we(a) + /* @__PURE__ */ xe(a) ); s = /** @type {Element} */ - /* @__PURE__ */ we(l); + /* @__PURE__ */ xe(l); } var o = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return We(o, o), o; + return Je(o, o), o; }; } -function fe(t, e) { +function ce(t, e) { if (Z) { - G.nodes_end = X, Wn(); + U.nodes_end = z, Jn(); return; } t !== null && t.before( @@ -1087,99 +1087,99 @@ function fe(t, e) { e ); } -function Ve(t, e) { +function He(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 hs(t, e) { return ds(t, e); } -function ol(t, e) { - _r(), e.intro = e.intro ?? !1; - const n = e.target, r = Z, i = X; +function al(t, e) { + gr(), e.intro = e.intro ?? !1; + const n = e.target, r = Z, i = z; try { for (var s = ( /** @type {TemplateNode} */ - /* @__PURE__ */ we(n) + /* @__PURE__ */ xe(n) ); s && (s.nodeType !== 8 || /** @type {Comment} */ s.data !== Ii); ) s = /** @type {TemplateNode} */ - /* @__PURE__ */ se(s); + /* @__PURE__ */ ue(s); if (!s) - throw Xe; - Zt(!0), Xt( + throw Ue; + ne(!0), Xt( /** @type {Comment} */ s - ), Wn(); + ), Jn(); const a = ds(t, { ...e, anchor: s }); - if (X === null || X.nodeType !== 8 || /** @type {Comment} */ - X.data !== Cr) - throw Lr(), Xe; - return Zt(!1), /** @type {Exports} */ + if (z === null || z.nodeType !== 8 || /** @type {Comment} */ + z.data !== Cr) + throw Lr(), Ue; + return ne(!1), /** @type {Exports} */ a; } catch (a) { - if (a === Xe) - return e.recover === !1 && Ma(), _r(), Ji(n), Zt(!1), hs(t, e); + if (a === Ue) + return e.recover === !1 && Sa(), gr(), Ji(n), ne(!1), hs(t, e); throw a; } finally { - Zt(r), Xt(i); + ne(r), Xt(i); } } -const Ee = /* @__PURE__ */ new Map(); +const Re = /* @__PURE__ */ new Map(); function ds(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - _r(); + gr(); var l = /* @__PURE__ */ new Set(), o = (h) => { for (var c = 0; c < h.length; c++) { var d = h[c]; if (!l.has(d)) { l.add(d); - var p = sl(d); + var p = rl(d); e.addEventListener(d, fn, { passive: p }); - var _ = Ee.get(d); - _ === void 0 ? (document.addEventListener(d, fn, { passive: p }), Ee.set(d, 1)) : Ee.set(d, _ + 1); + var m = Re.get(d); + m === void 0 ? (document.addEventListener(d, fn, { passive: p }), Re.set(d, 1)) : Re.set(d, m + 1); } } }; - o(Ir(fs)), gr.add(o); - var f = void 0, u = el(() => { - var h = n ?? e.appendChild(Tn()); - return je(() => { + o(Ir(fs)), mr.add(o); + var f = void 0, u = Qa(() => { + var h = n ?? e.appendChild(kn()); + return We(() => { if (s) { Xr({}); var c = ( /** @type {ComponentContext} */ - gt + vt ); c.c = s; } - i && (r.$$events = i), Z && We( + i && (r.$$events = i), Z && Je( /** @type {TemplateNode} */ h, null - ), f = t(h, r) || {}, Z && (G.nodes_end = X), s && Ur(); + ), f = t(h, r) || {}, Z && (U.nodes_end = z), s && Ur(); }), () => { var p; for (var c of l) { e.removeEventListener(c, fn); var d = ( /** @type {number} */ - Ee.get(c) + Re.get(c) ); - --d === 0 ? (document.removeEventListener(c, fn), Ee.delete(c)) : Ee.set(c, d); + --d === 0 ? (document.removeEventListener(c, fn), Re.delete(c)) : Re.set(c, d); } - gr.delete(o), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); + mr.delete(o), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); }; }); - return mr.set(f, u), f; + return yr.set(f, u), f; } -let mr = /* @__PURE__ */ new WeakMap(); -function ul(t, e) { - const n = mr.get(t); - return n ? (mr.delete(t), n(e)) : Promise.resolve(); +let yr = /* @__PURE__ */ new WeakMap(); +function ll(t, e) { + const n = yr.get(t); + return n ? (yr.delete(t), n(e)) : Promise.resolve(); } function vi(t, e, n = !1) { - Z && Wn(); - var r = t, i = null, s = null, a = vt, l = n ? Pr : 0, o = !1; + Z && Jn(); + var r = t, i = null, s = null, a = ct, l = n ? Pr : 0, o = !1; const f = (h, c = !0) => { o = !0, u(c, h); }, u = (h, c) => { @@ -1190,22 +1190,22 @@ function vi(t, e, n = !1) { /** @type {Comment} */ r.data === Sr ); - !!a === p && (r = pr(), Xt(r), Zt(!1), d = !0); + !!a === p && (r = _r(), Xt(r), ne(!1), d = !0); } - a ? (i ? In(i) : c && (i = je(() => c(r))), s && Dn(s, () => { + a ? (i ? Fn(i) : c && (i = We(() => c(r))), s && In(s, () => { s = null; - })) : (s ? In(s) : c && (s = je(() => c(r))), i && Dn(i, () => { + })) : (s ? Fn(s) : c && (s = We(() => c(r))), i && In(i, () => { i = null; - })), d && Zt(!0); + })), d && ne(!0); }; Br(() => { o = !1, e(f), o || u(null, null); - }, l), Z && (r = X); + }, l), Z && (r = z); } -function or(t, e) { +function ur(t, e) { return e; } -function fl(t, e, n, r) { +function ol(t, e, n, r) { for (var i = [], s = e.length, a = 0; a < s; a++) zr(e[a].e, i, !0); var l = s > 0 && i.length === 0 && n !== null; @@ -1218,24 +1218,24 @@ function fl(t, e, n, r) { Ji(o), o.append( /** @type {Element} */ n - ), r.clear(), ce(t, e[0].prev, e[s - 1].next); + ), r.clear(), he(t, e[0].prev, e[s - 1].next); } ls(i, () => { for (var f = 0; f < s; f++) { var u = e[f]; - l || (r.delete(u.k), ce(t, u.prev, u.next)), ee(u.e, !l); + l || (r.delete(u.k), he(t, u.prev, u.next)), se(u.e, !l); } }); } -function ur(t, e, n, r, i, s = null) { +function fr(t, e, n, r, i, s = null) { var a = t, l = { items: /* @__PURE__ */ new Map(), first: null }; - Z && Wn(); - var o = null, f = !1, u = /* @__PURE__ */ Va(() => { + Z && Jn(); + var o = null, f = !1, u = /* @__PURE__ */ qa(() => { var h = n(); return Dr(h) ? h : h == null ? [] : Ir(h); }); Br(() => { - var h = g(u), c = h.length; + var h = _(u), c = h.length; if (f && c === 0) return; f = c === 0; @@ -1245,98 +1245,98 @@ function ur(t, e, n, r, i, s = null) { /** @type {Comment} */ a.data === Sr ); - p !== (c === 0) && (a = pr(), Xt(a), Zt(!1), d = !0); + p !== (c === 0) && (a = _r(), Xt(a), ne(!1), d = !0); } if (Z) { - for (var _ = null, b, y = 0; y < c; y++) { - if (X.nodeType === 8 && /** @type {Comment} */ - X.data === Cr) { + for (var m = null, E, w = 0; w < c; w++) { + if (z.nodeType === 8 && /** @type {Comment} */ + z.data === Cr) { a = /** @type {Comment} */ - X, d = !0, Zt(!1); + z, d = !0, ne(!1); break; } - var $ = h[y], E = r($, y); - b = vs( - X, + var $ = h[w], b = r($, w); + E = vs( + z, l, - _, + m, null, $, - E, - y, + b, + w, i, e, n - ), l.items.set(E, b), _ = b; + ), l.items.set(b, E), m = E; } - c > 0 && Xt(pr()); + c > 0 && Xt(_r()); } - Z || cl(h, l, a, i, e, r, n), s !== null && (c === 0 ? o ? In(o) : o = je(() => s(a)) : o !== null && Dn(o, () => { + Z || ul(h, l, a, i, e, r, n), s !== null && (c === 0 ? o ? Fn(o) : o = We(() => s(a)) : o !== null && In(o, () => { o = null; - })), d && Zt(!0), g(u); - }), Z && (a = X); + })), d && ne(!0), _(u); + }), Z && (a = z); } -function cl(t, e, n, r, i, s, a) { - var l = t.length, o = e.items, f = e.first, u = f, h, c = null, d = [], p = [], _, b, y, $; +function ul(t, e, n, r, i, s, a) { + var l = t.length, o = e.items, f = e.first, u = f, h, c = null, d = [], p = [], m, E, w, $; for ($ = 0; $ < l; $ += 1) { - if (_ = t[$], b = s(_, $), y = o.get(b), y === void 0) { - var E = u ? ( + if (m = t[$], E = s(m, $), w = o.get(E), w === void 0) { + var b = u ? ( /** @type {TemplateNode} */ u.e.nodes_start ) : n; c = vs( - E, + b, e, c, c === null ? e.first : c.next, - _, - b, + m, + E, $, r, i, a - ), o.set(b, c), d = [], p = [], u = c.next; + ), o.set(E, c), d = [], p = [], u = c.next; continue; } - if (hl(y, _, $), y.e.f & Qt && In(y.e), y !== u) { - if (h !== void 0 && h.has(y)) { + if (fl(w, m, $), w.e.f & re && Fn(w.e), w !== u) { + if (h !== void 0 && h.has(w)) { if (d.length < p.length) { - var M = p[0], S; - c = M.prev; - var P = d[0], B = d[d.length - 1]; - for (S = 0; S < d.length; S += 1) - pi(d[S], M, n); - for (S = 0; S < p.length; S += 1) - h.delete(p[S]); - ce(e, P.prev, B.next), ce(e, c, P), ce(e, B, M), u = M, c = B, $ -= 1, d = [], p = []; + var S = p[0], P; + c = S.prev; + var D = d[0], Y = d[d.length - 1]; + for (P = 0; P < d.length; P += 1) + pi(d[P], S, n); + for (P = 0; P < p.length; P += 1) + h.delete(p[P]); + he(e, D.prev, Y.next), he(e, c, D), he(e, Y, S), u = S, c = Y, $ -= 1, d = [], p = []; } else - h.delete(y), pi(y, u, n), ce(e, y.prev, y.next), ce(e, y, c === null ? e.first : c.next), ce(e, c, y), c = y; + h.delete(w), pi(w, u, n), he(e, w.prev, w.next), he(e, w, c === null ? e.first : c.next), he(e, c, w), c = w; continue; } - for (d = [], p = []; u !== null && u.k !== b; ) - u.e.f & Qt || (h ?? (h = /* @__PURE__ */ new Set())).add(u), p.push(u), u = u.next; + for (d = [], p = []; u !== null && u.k !== E; ) + u.e.f & re || (h ?? (h = /* @__PURE__ */ new Set())).add(u), p.push(u), u = u.next; if (u === null) continue; - y = u; + w = u; } - d.push(y), c = y, u = y.next; + d.push(w), c = w, u = w.next; } if (u !== null || h !== void 0) { - for (var W = h === void 0 ? [] : Ir(h); u !== null; ) - u.e.f & Qt || W.push(u), u = u.next; - var rt = W.length; - if (rt > 0) { - var Q = null; - fl(e, W, Q, o); + for (var G = h === void 0 ? [] : Ir(h); u !== null; ) + u.e.f & re || G.push(u), u = u.next; + var K = G.length; + if (K > 0) { + var q = null; + ol(e, G, q, o); } } - G.first = e.first && e.first.e, G.last = c && c.e; + U.first = e.first && e.first.e, U.last = c && c.e; } -function hl(t, e, n, r) { +function fl(t, e, n, r) { zi(t.v, e), t.i = n; } function vs(t, e, n, r, i, s, a, l, o, f) { - var u = (o & ha) !== 0, h = (o & va) === 0, c = u ? h ? /* @__PURE__ */ qr(i) : Et(i) : i, d = o & da ? Et(a) : a, p = { + var u = (o & fa) !== 0, h = (o & ha) === 0, c = u ? h ? /* @__PURE__ */ qr(i) : Rt(i) : i, d = o & ca ? Rt(a) : a, p = { i: d, v: c, k: s, @@ -1347,7 +1347,7 @@ function vs(t, e, n, r, i, s, a, l, o, f) { next: r }; try { - return p.e = je(() => l(t, c, d, f), Z), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; + return p.e = We(() => l(t, c, d, f), Z), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; } finally { } } @@ -1364,12 +1364,12 @@ function pi(t, e, n) { ); s !== r; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ se(s) + /* @__PURE__ */ ue(s) ); i.before(s), s = a; } } -function ce(t, e, n) { +function he(t, e, n) { e === null ? t.first = n : (e.next = n, e.e.next = n && n.e), n !== null && (n.prev = e, n.e.prev = e && e.e); } function ps(t, e) { @@ -1396,13 +1396,13 @@ function _i(t, e, n, r) { i[e] !== n && (i[e] = n, n == null ? t.style.removeProperty(e) : t.style.setProperty(e, n, "")); } function gi(t, e) { - return t === e || (t == null ? void 0 : t[Ue]) === e; + return t === e || (t == null ? void 0 : t[Ge]) === e; } -function yr(t = {}, e, n, r) { +function mn(t = {}, e, n, r) { return Yr(() => { var i, s; return rs(() => { - i = s, s = [], On(() => { + i = s, s = [], Pn(() => { t !== n(...s) && (e(t, ...s), i && gi(n(...i), t) && e(null, ...i)); }); }), () => { @@ -1412,9 +1412,9 @@ function yr(t = {}, e, n, r) { }; }), t; } -function dl(t) { - gt === null && rl(), Pn(() => { - const e = On(t); +function cl(t) { + vt === null && el(), Dn(() => { + const e = Pn(t); if (typeof e == "function") return ( /** @type {() => void} */ e @@ -1422,7 +1422,7 @@ function dl(t) { }); } let cn = !1; -function vl(t) { +function hl(t) { var e = cn; try { return cn = !1, [t(), cn]; @@ -1431,58 +1431,58 @@ function vl(t) { } } function mi(t, e = 1) { - const n = t(); - return t(n + e), n; + const n = t() + e; + return t(n), n; } -function Ht(t, e, n, r) { - var S; - var i = (n & pa) !== 0, s = !0, a = (n & ga) !== 0, l = (n & ma) !== 0, o = !1, f; - a ? [f, o] = vl(() => ( +function ve(t, e, n, r) { + var P; + var i = (n & da) !== 0, s = !0, a = (n & pa) !== 0, l = (n & _a) !== 0, o = !1, f; + a ? [f, o] = hl(() => ( /** @type {V} */ t[e] )) : f = /** @type {V} */ t[e]; - var u = Ue in t || Li in t, h = a && (((S = me(t, e)) == null ? void 0 : S.set) ?? (u && e in t && ((P) => t[e] = P))) || void 0, c = ( + var u = Ge in t || Li in t, h = a && (((P = ye(t, e)) == null ? void 0 : P.set) ?? (u && e in t && ((D) => t[e] = D))) || void 0, c = ( /** @type {V} */ r - ), d = !0, p = !1, _ = () => (p = !0, d && (d = !1, l ? c = On( + ), d = !0, p = !1, m = () => (p = !0, d && (d = !1, l ? c = Pn( /** @type {() => V} */ r ) : c = /** @type {V} */ r), c); - f === void 0 && r !== void 0 && (h && s && Oa(), f = _(), h && h(f)); - var b; - if (b = () => { - var P = ( + f === void 0 && r !== void 0 && (h && s && Ca(), f = m(), h && h(f)); + var E; + if (E = () => { + var D = ( /** @type {V} */ t[e] ); - return P === void 0 ? _() : (d = !0, p = !1, P); - }, !(n & _a)) - return b; + return D === void 0 ? m() : (d = !0, p = !1, D); + }, !(n & va)) + return E; if (h) { - var y = t.$$legacy; - return function(P, B) { - return arguments.length > 0 ? ((!B || y || o) && h(B ? b() : P), P) : b(); + var w = t.$$legacy; + return function(D, Y) { + return arguments.length > 0 ? ((!Y || w || o) && h(Y ? E() : D), D) : E(); }; } - var $ = !1, E = /* @__PURE__ */ qr(f), M = /* @__PURE__ */ jn(() => { - var P = b(), B = g(E); - return $ ? ($ = !1, B) : E.v = P; + var $ = !1, b = /* @__PURE__ */ qr(f), S = /* @__PURE__ */ Wn(() => { + var D = E(), Y = _(b); + return $ ? ($ = !1, Y) : b.v = D; }); - return i || (M.equals = Fr), function(P, B) { + return i || (S.equals = Fr), function(D, Y) { if (arguments.length > 0) { - const W = B ? g(M) : a ? lt(P) : P; - return M.equals(W) || ($ = !0, j(E, W), p && c !== void 0 && (c = W), On(() => g(M))), P; + const G = Y ? _(S) : a ? xt(D) : D; + return S.equals(G) || ($ = !0, J(b, G), p && c !== void 0 && (c = G), Pn(() => _(S))), D; } - return g(M); + return _(S); }; } -function pl(t) { - return new _l(t); +function dl(t) { + return new vl(t); } -var Jt, At; -class _l { +var te, Et; +class vl { /** * @param {ComponentConstructorOptions & { * component: any; @@ -1490,9 +1490,9 @@ class _l { */ constructor(e) { /** @type {any} */ - ar(this, Jt); + lr(this, te); /** @type {Record} */ - ar(this, At); + lr(this, Et); var s; var n = /* @__PURE__ */ new Map(), r = (a, l) => { var o = /* @__PURE__ */ qr(l); @@ -1502,45 +1502,45 @@ class _l { { ...e.props || {}, $$events: {} }, { get(a, l) { - return g(n.get(l) ?? r(l, Reflect.get(a, l))); + return _(n.get(l) ?? r(l, Reflect.get(a, l))); }, has(a, l) { - return l === Li ? !0 : (g(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); + return l === Li ? !0 : (_(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); }, set(a, l, o) { - return j(n.get(l) ?? r(l, o), o), Reflect.set(a, l, o); + return J(n.get(l) ?? r(l, o), o), Reflect.set(a, l, o); } } ); - lr(this, At, (e.hydrate ? ol : hs)(e.component, { + or(this, Et, (e.hydrate ? al : hs)(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(), lr(this, Jt, i.$$events); - for (const a of Object.keys(dt(this, At))) - a === "$set" || a === "$destroy" || a === "$on" || Nn(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && ee(), or(this, te, i.$$events); + for (const a of Object.keys(ft(this, Et))) + a === "$set" || a === "$destroy" || a === "$on" || Tn(this, a, { get() { - return dt(this, At)[a]; + return ft(this, Et)[a]; }, /** @param {any} value */ set(l) { - dt(this, At)[a] = l; + ft(this, Et)[a] = l; }, enumerable: !0 }); - dt(this, At).$set = /** @param {Record} next */ + ft(this, Et).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, dt(this, At).$destroy = () => { - ul(dt(this, At)); + }, ft(this, Et).$destroy = () => { + ll(ft(this, Et)); }; } /** @param {Record} props */ $set(e) { - dt(this, At).$set(e); + ft(this, Et).$set(e); } /** * @param {string} event @@ -1548,20 +1548,20 @@ class _l { * @returns {any} */ $on(e, n) { - dt(this, Jt)[e] = dt(this, Jt)[e] || []; + ft(this, te)[e] = ft(this, te)[e] || []; const r = (...i) => n.call(this, ...i); - return dt(this, Jt)[e].push(r), () => { - dt(this, Jt)[e] = dt(this, Jt)[e].filter( + return ft(this, te)[e].push(r), () => { + ft(this, te)[e] = ft(this, te)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - dt(this, At).$destroy(); + ft(this, Et).$destroy(); } } -Jt = new WeakMap(), At = new WeakMap(); +te = new WeakMap(), Et = new WeakMap(); let _s; typeof HTMLElement == "function" && (_s = class extends HTMLElement { /** @@ -1572,25 +1572,25 @@ typeof HTMLElement == "function" && (_s = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - St(this, "$$ctor"); + kt(this, "$$ctor"); /** Slots */ - St(this, "$$s"); + kt(this, "$$s"); /** @type {any} The Svelte component instance */ - St(this, "$$c"); + kt(this, "$$c"); /** Whether or not the custom element is connected */ - St(this, "$$cn", !1); + kt(this, "$$cn", !1); /** @type {Record} Component props data */ - St(this, "$$d", {}); + kt(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - St(this, "$$r", !1); + kt(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - St(this, "$$p_d", {}); + kt(this, "$$p_d", {}); /** @type {Record} Event listeners */ - St(this, "$$l", {}); + kt(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - St(this, "$$l_u", /* @__PURE__ */ new Map()); + kt(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - St(this, "$$me"); + kt(this, "$$me"); this.$$ctor = e, this.$$s = n, r && this.attachShadow({ mode: "open" }); } /** @@ -1621,22 +1621,22 @@ typeof HTMLElement == "function" && (_s = class extends HTMLElement { let n = function(s) { return (a) => { const l = document.createElement("slot"); - s !== "default" && (l.name = s), fe(a, l); + s !== "default" && (l.name = s), ce(a, l); }; }; var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = gl(this); + const r = {}, i = pl(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] = mn(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = yn(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 = pl({ + this.$$c = dl({ component: this.$$ctor, target: this.shadowRoot || this, props: { @@ -1644,14 +1644,14 @@ typeof HTMLElement == "function" && (_s = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = tl(() => { + }), this.$$me = Za(() => { rs(() => { var s; this.$$r = !0; - for (const a of Rn(this.$$c)) { + for (const a of Nn(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const l = mn( + const l = yn( a, this.$$d[a], this.$$p_d, @@ -1679,7 +1679,7 @@ typeof HTMLElement == "function" && (_s = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = mn(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] = yn(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -1690,12 +1690,12 @@ typeof HTMLElement == "function" && (_s = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return Rn(this.$$p_d).find( + return Nn(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function mn(t, e, n, r) { +function yn(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]) @@ -1726,7 +1726,7 @@ function mn(t, e, n, r) { return e; } } -function gl(t) { +function pl(t) { const e = {}; return t.childNodes.forEach((n) => { e[ @@ -1741,28 +1741,28 @@ function gs(t, e, n, r, i, s) { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return Rn(e).map( + return Nn(e).map( (l) => (e[l].attribute || l).toLowerCase() ); } }; - return Rn(e).forEach((l) => { - Nn(a.prototype, l, { + return Nn(e).forEach((l) => { + Tn(a.prototype, l, { get() { return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l]; }, set(o) { var h; - o = mn(l, o, e), this.$$d[l] = o; + o = yn(l, o, e), this.$$d[l] = o; var f = this.$$c; if (f) { - var u = (h = me(f, l)) == null ? void 0 : h.get; + var u = (h = ye(f, l)) == null ? void 0 : h.get; u ? f[l] = o : f.$set({ [l]: o }); } } }); }), r.forEach((l) => { - Nn(a.prototype, l, { + Tn(a.prototype, l, { get() { var o; return (o = this.$$c) == null ? void 0 : o[l]; @@ -1771,31 +1771,31 @@ function gs(t, e, n, r, i, s) { }), t.element = /** @type {any} */ a, a; } -var ml = { value: () => { +var _l = { value: () => { } }; function ms() { 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 yn(n); + return new wn(n); } -function yn(t) { +function wn(t) { this._ = t; } -function yl(t, e) { +function gl(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 }; }); } -yn.prototype = ms.prototype = { - constructor: yn, +wn.prototype = ms.prototype = { + constructor: wn, on: function(t, e) { - var n = this._, r = yl(t + "", n), i, s = -1, a = r.length; + var n = this._, r = gl(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = wl(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = ml(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); @@ -1807,7 +1807,7 @@ yn.prototype = ms.prototype = { copy: function() { var t = {}, e = this._; for (var n in e) t[n] = e[n].slice(); - return new yn(t); + return new wn(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]; @@ -1819,7 +1819,7 @@ yn.prototype = ms.prototype = { for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function wl(t, e) { +function ml(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; @@ -1827,7 +1827,7 @@ function wl(t, e) { function yi(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { - t[r] = ml, t = t.slice(0, r).concat(t.slice(r + 1)); + t[r] = _l, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; @@ -1840,57 +1840,57 @@ const wi = { xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function Qn(t) { +function tr(t) { var e = t += "", n = e.indexOf(":"); return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), wi.hasOwnProperty(e) ? { space: wi[e], local: t } : t; } -function xl(t) { +function yl(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; return n === wr && e.documentElement.namespaceURI === wr ? e.createElement(t) : e.createElementNS(n, t); }; } -function bl(t) { +function wl(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function ys(t) { - var e = Qn(t); - return (e.local ? bl : xl)(e); + var e = tr(t); + return (e.local ? wl : yl)(e); } -function $l() { +function xl() { } function Gr(t) { - return t == null ? $l : function() { + return t == null ? xl : function() { return this.querySelector(t); }; } -function Al(t) { +function bl(t) { typeof t != "function" && (t = Gr(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, l = r[i] = new Array(a), o, f, u = 0; u < a; ++u) (o = s[u]) && (f = t.call(o, o.__data__, u, s)) && ("__data__" in o && (f.__data__ = o.__data__), l[u] = f); return new bt(r, this._parents); } -function El(t) { +function $l(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function Rl() { +function Al() { return []; } function ws(t) { - return t == null ? Rl : function() { + return t == null ? Al : function() { return this.querySelectorAll(t); }; } -function Nl(t) { +function El(t) { return function() { - return El(t.apply(this, arguments)); + return $l(t.apply(this, arguments)); }; } -function Tl(t) { - typeof t == "function" ? t = Nl(t) : t = ws(t); +function Rl(t) { + typeof t == "function" ? t = El(t) : t = ws(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) for (var a = e[s], l = a.length, o, f = 0; f < l; ++f) (o = a[f]) && (r.push(t.call(o, o.__data__, f, a)), i.push(o)); @@ -1906,31 +1906,31 @@ function bs(t) { return e.matches(t); }; } -var kl = Array.prototype.find; -function Sl(t) { +var Nl = Array.prototype.find; +function Tl(t) { return function() { - return kl.call(this.children, t); + return Nl.call(this.children, t); }; } -function Cl() { +function kl() { return this.firstElementChild; } -function Ml(t) { - return this.select(t == null ? Cl : Sl(typeof t == "function" ? t : bs(t))); +function Sl(t) { + return this.select(t == null ? kl : Tl(typeof t == "function" ? t : bs(t))); } -var Ol = Array.prototype.filter; -function Pl() { +var Cl = Array.prototype.filter; +function Ml() { return Array.from(this.children); } -function Dl(t) { +function Ol(t) { return function() { - return Ol.call(this.children, t); + return Cl.call(this.children, t); }; } -function Il(t) { - return this.selectAll(t == null ? Pl : Dl(typeof t == "function" ? t : bs(t))); +function Pl(t) { + return this.selectAll(t == null ? Ml : Ol(typeof t == "function" ? t : bs(t))); } -function Fl(t) { +function Dl(t) { typeof t != "function" && (t = xs(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, l = r[i] = [], o, f = 0; f < a; ++f) @@ -1940,14 +1940,14 @@ function Fl(t) { function $s(t) { return new Array(t.length); } -function ql() { +function Il() { return new bt(this._enter || this._groups.map($s), this._parents); } -function Fn(t, e) { +function qn(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -Fn.prototype = { - constructor: Fn, +qn.prototype = { + constructor: qn, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -1961,55 +1961,55 @@ Fn.prototype = { return this._parent.querySelectorAll(t); } }; -function Ll(t) { +function Fl(t) { return function() { return t; }; } -function Vl(t, e, n, r, i, s) { +function ql(t, e, n, r, i, s) { for (var a = 0, l, o = e.length, f = s.length; a < f; ++a) - (l = e[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new Fn(t, s[a]); + (l = e[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new qn(t, s[a]); for (; a < o; ++a) (l = e[a]) && (i[a] = l); } -function Hl(t, e, n, r, i, s, a) { +function Ll(t, e, n, r, i, s, a) { var l, o, f = /* @__PURE__ */ new Map(), u = e.length, h = s.length, c = new Array(u), d; for (l = 0; l < u; ++l) (o = e[l]) && (c[l] = d = a.call(o, o.__data__, l, e) + "", f.has(d) ? i[l] = o : f.set(d, o)); for (l = 0; l < h; ++l) - d = a.call(t, s[l], l, s) + "", (o = f.get(d)) ? (r[l] = o, o.__data__ = s[l], f.delete(d)) : n[l] = new Fn(t, s[l]); + d = a.call(t, s[l], l, s) + "", (o = f.get(d)) ? (r[l] = o, o.__data__ = s[l], f.delete(d)) : n[l] = new qn(t, s[l]); for (l = 0; l < u; ++l) (o = e[l]) && f.get(c[l]) === o && (i[l] = o); } -function Yl(t) { +function Vl(t) { return t.__data__; } -function Bl(t, e) { - if (!arguments.length) return Array.from(this, Yl); - var n = e ? Hl : Vl, r = this._parents, i = this._groups; - typeof t != "function" && (t = Ll(t)); +function Hl(t, e) { + if (!arguments.length) return Array.from(this, Vl); + var n = e ? Ll : ql, r = this._parents, i = this._groups; + typeof t != "function" && (t = Fl(t)); for (var s = i.length, a = new Array(s), l = new Array(s), o = new Array(s), f = 0; f < s; ++f) { - var u = r[f], h = i[f], c = h.length, d = zl(t.call(u, u && u.__data__, f, r)), p = d.length, _ = l[f] = new Array(p), b = a[f] = new Array(p), y = o[f] = new Array(c); - n(u, h, _, b, y, d, e); - for (var $ = 0, E = 0, M, S; $ < p; ++$) - if (M = _[$]) { - for ($ >= E && (E = $ + 1); !(S = b[E]) && ++E < p; ) ; - M._next = S || null; + var u = r[f], h = i[f], c = h.length, d = Yl(t.call(u, u && u.__data__, f, r)), p = d.length, m = l[f] = new Array(p), E = a[f] = new Array(p), w = o[f] = new Array(c); + n(u, h, m, E, w, d, e); + for (var $ = 0, b = 0, S, P; $ < p; ++$) + if (S = m[$]) { + for ($ >= b && (b = $ + 1); !(P = E[b]) && ++b < p; ) ; + S._next = P || null; } } return a = new bt(a, r), a._enter = l, a._exit = o, a; } -function zl(t) { +function Yl(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function Xl() { +function Bl() { return new bt(this._exit || this._groups.map($s), this._parents); } -function Ul(t, e, n) { +function zl(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 Gl(t) { +function Xl(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), l = new Array(i), o = 0; o < a; ++o) for (var f = n[o], u = r[o], h = f.length, c = l[o] = new Array(h), d, p = 0; p < h; ++p) (d = f[p] || u[p]) && (c[p] = d); @@ -2017,14 +2017,14 @@ function Gl(t) { l[o] = n[o]; return new bt(l, this._parents); } -function Kl() { +function Ul() { 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 jl(t) { - t || (t = Wl); +function Gl(t) { + t || (t = Kl); function e(h, c) { return h && c ? t(h.__data__, c.__data__) : !h - !c; } @@ -2035,17 +2035,17 @@ function jl(t) { } return new bt(i, this._parents).order(); } -function Wl(t, e) { +function Kl(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function Jl() { +function jl() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } -function Zl() { +function Wl() { return Array.from(this); } -function Ql() { +function Jl() { 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]; @@ -2053,103 +2053,103 @@ function Ql() { } return null; } -function to() { +function Zl() { let t = 0; for (const e of this) ++t; return t; } -function eo() { +function Ql() { return !this.node(); } -function no(t) { +function to(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], s = 0, a = i.length, l; s < a; ++s) (l = i[s]) && t.call(l, l.__data__, s, i); return this; } -function ro(t) { +function eo(t) { return function() { this.removeAttribute(t); }; } -function io(t) { +function no(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function so(t, e) { +function ro(t, e) { return function() { this.setAttribute(t, e); }; } -function ao(t, e) { +function io(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } -function lo(t, e) { +function so(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function oo(t, e) { +function ao(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 uo(t, e) { - var n = Qn(t); +function lo(t, e) { + var n = tr(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 ? io : ro : typeof e == "function" ? n.local ? oo : lo : n.local ? ao : so)(n, e)); + return this.each((e == null ? n.local ? no : eo : typeof e == "function" ? n.local ? ao : so : n.local ? io : ro)(n, e)); } function As(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function fo(t) { +function oo(t) { return function() { this.style.removeProperty(t); }; } -function co(t, e, n) { +function uo(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } -function ho(t, e, n) { +function fo(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function vo(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? fo : typeof e == "function" ? ho : co)(t, e, n ?? "")) : Ce(this.node(), t); +function co(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? oo : typeof e == "function" ? fo : uo)(t, e, n ?? "")) : Me(this.node(), t); } -function Ce(t, e) { +function Me(t, e) { return t.style.getPropertyValue(e) || As(t).getComputedStyle(t, null).getPropertyValue(e); } -function po(t) { +function ho(t) { return function() { delete this[t]; }; } -function _o(t, e) { +function vo(t, e) { return function() { this[t] = e; }; } -function go(t, e) { +function po(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } -function mo(t, e) { - return arguments.length > 1 ? this.each((e == null ? po : typeof e == "function" ? go : _o)(t, e)) : this.node()[t]; +function _o(t, e) { + return arguments.length > 1 ? this.each((e == null ? ho : typeof e == "function" ? po : vo)(t, e)) : this.node()[t]; } function Es(t) { return t.trim().split(/^|\s+/); @@ -2179,123 +2179,123 @@ function Ns(t, e) { function Ts(t, e) { for (var n = Kr(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function yo(t) { +function go(t) { return function() { Ns(this, t); }; } -function wo(t) { +function mo(t) { return function() { Ts(this, t); }; } -function xo(t, e) { +function yo(t, e) { return function() { (e.apply(this, arguments) ? Ns : Ts)(this, t); }; } -function bo(t, e) { +function wo(t, e) { var n = Es(t + ""); if (arguments.length < 2) { for (var r = Kr(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? xo : e ? yo : wo)(n, e)); + return this.each((typeof e == "function" ? yo : e ? go : mo)(n, e)); } -function $o() { +function xo() { this.textContent = ""; } -function Ao(t) { +function bo(t) { return function() { this.textContent = t; }; } -function Eo(t) { +function $o(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } -function Ro(t) { - return arguments.length ? this.each(t == null ? $o : (typeof t == "function" ? Eo : Ao)(t)) : this.node().textContent; +function Ao(t) { + return arguments.length ? this.each(t == null ? xo : (typeof t == "function" ? $o : bo)(t)) : this.node().textContent; } -function No() { +function Eo() { this.innerHTML = ""; } -function To(t) { +function Ro(t) { return function() { this.innerHTML = t; }; } -function ko(t) { +function No(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } -function So(t) { - return arguments.length ? this.each(t == null ? No : (typeof t == "function" ? ko : To)(t)) : this.node().innerHTML; +function To(t) { + return arguments.length ? this.each(t == null ? Eo : (typeof t == "function" ? No : Ro)(t)) : this.node().innerHTML; } -function Co() { +function ko() { this.nextSibling && this.parentNode.appendChild(this); } -function Mo() { - return this.each(Co); +function So() { + return this.each(ko); } -function Oo() { +function Co() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function Po() { - return this.each(Oo); +function Mo() { + return this.each(Co); } -function Do(t) { +function Oo(t) { var e = typeof t == "function" ? t : ys(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function Io() { +function Po() { return null; } -function Fo(t, e) { - var n = typeof t == "function" ? t : ys(t), r = e == null ? Io : typeof e == "function" ? e : Gr(e); +function Do(t, e) { + var n = typeof t == "function" ? t : ys(t), r = e == null ? Po : typeof e == "function" ? e : Gr(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function qo() { +function Io() { var t = this.parentNode; t && t.removeChild(this); } -function Lo() { - return this.each(qo); +function Fo() { + return this.each(Io); } -function Vo() { +function qo() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function Ho() { +function Lo() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function Yo(t) { - return this.select(t ? Ho : Vo); +function Vo(t) { + return this.select(t ? Lo : qo); } -function Bo(t) { +function Ho(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } -function zo(t) { +function Yo(t) { return function(e) { t.call(this, e, this.__data__); }; } -function Xo(t) { +function Bo(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 Uo(t) { +function zo(t) { return function() { var e = this.__on; if (e) { @@ -2305,9 +2305,9 @@ function Uo(t) { } }; } -function Go(t, e, n) { +function Xo(t, e, n) { return function() { - var r = this.__on, i, s = zo(e); + var r = this.__on, i, s = Yo(e); if (r) { for (var a = 0, l = r.length; a < l; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { @@ -2318,8 +2318,8 @@ function Go(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 Ko(t, e, n) { - var r = Xo(t + ""), i, s = r.length, a; +function Uo(t, e, n) { + var r = Bo(t + ""), i, s = r.length, a; if (arguments.length < 2) { var l = this.node().__on; if (l) { @@ -2330,27 +2330,27 @@ function Ko(t, e, n) { } return; } - for (l = e ? Go : Uo, i = 0; i < s; ++i) this.each(l(r[i], e, n)); + for (l = e ? Xo : zo, i = 0; i < s; ++i) this.each(l(r[i], e, n)); return this; } function ks(t, e, n) { var r = As(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 jo(t, e) { +function Go(t, e) { return function() { return ks(this, t, e); }; } -function Wo(t, e) { +function Ko(t, e) { return function() { return ks(this, t, e.apply(this, arguments)); }; } -function Jo(t, e) { - return this.each((typeof e == "function" ? Wo : jo)(t, e)); +function jo(t, e) { + return this.each((typeof e == "function" ? Ko : Go)(t, e)); } -function* Zo() { +function* Wo() { 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); @@ -2359,49 +2359,49 @@ var Ss = [null]; function bt(t, e) { this._groups = t, this._parents = e; } -function Fe() { +function qe() { return new bt([[document.documentElement]], Ss); } -function Qo() { +function Jo() { return this; } -bt.prototype = Fe.prototype = { +bt.prototype = qe.prototype = { constructor: bt, - select: Al, - selectAll: Tl, - selectChild: Ml, - selectChildren: Il, - filter: Fl, - data: Bl, - enter: ql, - exit: Xl, - join: Ul, - merge: Gl, - selection: Qo, - order: Kl, - sort: jl, - call: Jl, - nodes: Zl, - node: Ql, - size: to, - empty: eo, - each: no, - attr: uo, - style: vo, - property: mo, - classed: bo, - text: Ro, - html: So, - raise: Mo, - lower: Po, - append: Do, - insert: Fo, - remove: Lo, - clone: Yo, - datum: Bo, - on: Ko, - dispatch: Jo, - [Symbol.iterator]: Zo + select: bl, + selectAll: Rl, + selectChild: Sl, + selectChildren: Pl, + filter: Dl, + data: Hl, + enter: Il, + exit: Bl, + join: zl, + merge: Xl, + selection: Jo, + order: Ul, + sort: Gl, + call: jl, + nodes: Wl, + node: Jl, + size: Zl, + empty: Ql, + each: to, + attr: lo, + style: co, + property: _o, + classed: wo, + text: Ao, + html: To, + raise: So, + lower: Mo, + append: Oo, + insert: Do, + remove: Fo, + clone: Vo, + datum: Ho, + on: Uo, + dispatch: jo, + [Symbol.iterator]: Wo }; function st(t) { return typeof t == "string" ? new bt([[document.querySelector(t)]], [document.documentElement]) : new bt([[t]], Ss); @@ -2414,9 +2414,9 @@ function Cs(t, e) { for (var r in e) n[r] = e[r]; return n; } -function nn() { +function rn() { } -var Je = 0.7, qn = 1 / Je, Te = "\\s*([+-]?\\d+)\\s*", Ze = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", zt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", tu = /^#([0-9a-f]{3,8})$/, eu = new RegExp(`^rgb\\(${Te},${Te},${Te}\\)$`), nu = new RegExp(`^rgb\\(${zt},${zt},${zt}\\)$`), ru = new RegExp(`^rgba\\(${Te},${Te},${Te},${Ze}\\)$`), iu = new RegExp(`^rgba\\(${zt},${zt},${zt},${Ze}\\)$`), su = new RegExp(`^hsl\\(${Ze},${zt},${zt}\\)$`), au = new RegExp(`^hsla\\(${Ze},${zt},${zt},${Ze}\\)$`), xi = { +var Ze = 0.7, Ln = 1 / Ze, ke = "\\s*([+-]?\\d+)\\s*", Qe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", zt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Zo = /^#([0-9a-f]{3,8})$/, Qo = new RegExp(`^rgb\\(${ke},${ke},${ke}\\)$`), tu = new RegExp(`^rgb\\(${zt},${zt},${zt}\\)$`), eu = new RegExp(`^rgba\\(${ke},${ke},${ke},${Qe}\\)$`), nu = new RegExp(`^rgba\\(${zt},${zt},${zt},${Qe}\\)$`), ru = new RegExp(`^hsl\\(${Qe},${zt},${zt}\\)$`), iu = new RegExp(`^hsla\\(${Qe},${zt},${zt},${Qe}\\)$`), xi = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -2566,7 +2566,7 @@ var Je = 0.7, qn = 1 / Je, Te = "\\s*([+-]?\\d+)\\s*", Ze = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -jr(nn, xe, { +jr(rn, be, { copy(t) { return Object.assign(new this.constructor(), this, t); }, @@ -2576,54 +2576,54 @@ jr(nn, xe, { hex: bi, // Deprecated! Use color.formatHex. formatHex: bi, - formatHex8: lu, - formatHsl: ou, + formatHex8: su, + formatHsl: au, formatRgb: $i, toString: $i }); function bi() { return this.rgb().formatHex(); } -function lu() { +function su() { return this.rgb().formatHex8(); } -function ou() { +function au() { return Ms(this).formatHsl(); } function $i() { return this.rgb().formatRgb(); } -function xe(t) { +function be(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = tu.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ai(e) : n === 3 ? new _t(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? hn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? hn(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 = eu.exec(t)) ? new _t(e[1], e[2], e[3], 1) : (e = nu.exec(t)) ? new _t(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = ru.exec(t)) ? hn(e[1], e[2], e[3], e[4]) : (e = iu.exec(t)) ? hn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = su.exec(t)) ? Ni(e[1], e[2] / 100, e[3] / 100, 1) : (e = au.exec(t)) ? Ni(e[1], e[2] / 100, e[3] / 100, e[4]) : xi.hasOwnProperty(t) ? Ai(xi[t]) : t === "transparent" ? new _t(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = Zo.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ai(e) : n === 3 ? new dt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? hn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? hn(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 = Qo.exec(t)) ? new dt(e[1], e[2], e[3], 1) : (e = tu.exec(t)) ? new dt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = eu.exec(t)) ? hn(e[1], e[2], e[3], e[4]) : (e = nu.exec(t)) ? hn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = ru.exec(t)) ? Ni(e[1], e[2] / 100, e[3] / 100, 1) : (e = iu.exec(t)) ? Ni(e[1], e[2] / 100, e[3] / 100, e[4]) : xi.hasOwnProperty(t) ? Ai(xi[t]) : t === "transparent" ? new dt(NaN, NaN, NaN, 0) : null; } function Ai(t) { - return new _t(t >> 16 & 255, t >> 8 & 255, t & 255, 1); + return new dt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } function hn(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new _t(t, e, n, r); + return r <= 0 && (t = e = n = NaN), new dt(t, e, n, r); } -function uu(t) { - return t instanceof nn || (t = xe(t)), t ? (t = t.rgb(), new _t(t.r, t.g, t.b, t.opacity)) : new _t(); +function lu(t) { + return t instanceof rn || (t = be(t)), t ? (t = t.rgb(), new dt(t.r, t.g, t.b, t.opacity)) : new dt(); } function xr(t, e, n, r) { - return arguments.length === 1 ? uu(t) : new _t(t, e, n, r ?? 1); + return arguments.length === 1 ? lu(t) : new dt(t, e, n, r ?? 1); } -function _t(t, e, n, r) { +function dt(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -jr(_t, xr, Cs(nn, { +jr(dt, xr, Cs(rn, { brighter(t) { - return t = t == null ? qn : Math.pow(qn, t), new _t(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Ln : Math.pow(Ln, t), new dt(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? Je : Math.pow(Je, t), new _t(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Ze : Math.pow(Ze, t), new dt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new _t(ye(this.r), ye(this.g), ye(this.b), Ln(this.opacity)); + return new dt(we(this.r), we(this.g), we(this.b), Vn(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; @@ -2631,70 +2631,70 @@ jr(_t, xr, Cs(nn, { hex: Ei, // Deprecated! Use color.formatHex. formatHex: Ei, - formatHex8: fu, + formatHex8: ou, formatRgb: Ri, toString: Ri })); function Ei() { - return `#${ge(this.r)}${ge(this.g)}${ge(this.b)}`; + return `#${me(this.r)}${me(this.g)}${me(this.b)}`; } -function fu() { - return `#${ge(this.r)}${ge(this.g)}${ge(this.b)}${ge((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function ou() { + return `#${me(this.r)}${me(this.g)}${me(this.b)}${me((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Ri() { - const t = Ln(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${ye(this.r)}, ${ye(this.g)}, ${ye(this.b)}${t === 1 ? ")" : `, ${t})`}`; + const t = Vn(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${we(this.r)}, ${we(this.g)}, ${we(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function Ln(t) { +function Vn(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function ye(t) { +function we(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function ge(t) { - return t = ye(t), (t < 16 ? "0" : "") + t.toString(16); +function me(t) { + return t = we(t), (t < 16 ? "0" : "") + t.toString(16); } function Ni(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Pt(t, e, n, r); + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Ct(t, e, n, r); } function Ms(t) { - if (t instanceof Pt) return new Pt(t.h, t.s, t.l, t.opacity); - if (t instanceof nn || (t = xe(t)), !t) return new Pt(); - if (t instanceof Pt) return t; + if (t instanceof Ct) return new Ct(t.h, t.s, t.l, t.opacity); + if (t instanceof rn || (t = be(t)), !t) return new Ct(); + if (t instanceof Ct) 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, l = s - i, o = (s + i) / 2; - return l ? (e === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - e) / l + 2 : a = (e - n) / l + 4, l /= o < 0.5 ? s + i : 2 - s - i, a *= 60) : l = o > 0 && o < 1 ? 0 : a, new Pt(a, l, o, t.opacity); + return l ? (e === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - e) / l + 2 : a = (e - n) / l + 4, l /= o < 0.5 ? s + i : 2 - s - i, a *= 60) : l = o > 0 && o < 1 ? 0 : a, new Ct(a, l, o, t.opacity); } -function cu(t, e, n, r) { - return arguments.length === 1 ? Ms(t) : new Pt(t, e, n, r ?? 1); +function uu(t, e, n, r) { + return arguments.length === 1 ? Ms(t) : new Ct(t, e, n, r ?? 1); } -function Pt(t, e, n, r) { +function Ct(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -jr(Pt, cu, Cs(nn, { +jr(Ct, uu, Cs(rn, { brighter(t) { - return t = t == null ? qn : Math.pow(qn, t), new Pt(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Ln : Math.pow(Ln, t), new Ct(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? Je : Math.pow(Je, t), new Pt(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Ze : Math.pow(Ze, t), new Ct(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 _t( - fr(t >= 240 ? t - 240 : t + 120, i, r), - fr(t, i, r), - fr(t < 120 ? t + 240 : t - 120, i, r), + return new dt( + cr(t >= 240 ? t - 240 : t + 120, i, r), + cr(t, i, r), + cr(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new Pt(Ti(this.h), dn(this.s), dn(this.l), Ln(this.opacity)); + return new Ct(Ti(this.h), dn(this.s), dn(this.l), Vn(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 = Ln(this.opacity); + const t = Vn(this.opacity); return `${t === 1 ? "hsl(" : "hsla("}${Ti(this.h)}, ${dn(this.s) * 100}%, ${dn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); @@ -2704,31 +2704,31 @@ function Ti(t) { function dn(t) { return Math.max(0, Math.min(1, t || 0)); } -function fr(t, e, n) { +function cr(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 Wr = (t) => () => t; -function hu(t, e) { +function fu(t, e) { return function(n) { return t + n * e; }; } -function du(t, e, n) { +function cu(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 vu(t) { +function hu(t) { return (t = +t) == 1 ? Os : function(e, n) { - return n - e ? du(e, n, t) : Wr(isNaN(e) ? n : e); + return n - e ? cu(e, n, t) : Wr(isNaN(e) ? n : e); }; } function Os(t, e) { var n = e - t; - return n ? hu(t, n) : Wr(isNaN(t) ? e : t); + return n ? fu(t, n) : Wr(isNaN(t) ? e : t); } -const Vn = function t(e) { - var n = vu(e); +const Hn = function t(e) { + var n = hu(e); function r(i, s) { var a = n((i = xr(i)).r, (s = xr(s)).r), l = n(i.g, s.g), o = n(i.b, s.b), f = Os(i.opacity, s.opacity); return function(u) { @@ -2737,7 +2737,7 @@ const Vn = function t(e) { } return r.gamma = t, r; }(1); -function pu(t, e) { +function du(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { @@ -2745,19 +2745,19 @@ function pu(t, e) { return r; }; } -function _u(t) { +function vu(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function gu(t, e) { +function pu(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] = Re(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = Ne(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; return function(l) { for (a = 0; a < r; ++a) s[a] = i[a](l); return s; }; } -function mu(t, e) { +function _u(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; @@ -2768,39 +2768,39 @@ function Yt(t, e) { return t * (1 - n) + e * n; }; } -function yu(t, e) { +function gu(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] = Re(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = Ne(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var br = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, cr = new RegExp(br.source, "g"); -function wu(t) { +var br = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, hr = new RegExp(br.source, "g"); +function mu(t) { return function() { return t; }; } -function xu(t) { +function yu(t) { return function(e) { return t(e) + ""; }; } function Ps(t, e) { - var n = br.lastIndex = cr.lastIndex = 0, r, i, s, a = -1, l = [], o = []; - for (t = t + "", e = e + ""; (r = br.exec(t)) && (i = cr.exec(e)); ) - (s = i.index) > n && (s = e.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: Yt(r, i) })), n = cr.lastIndex; - return n < e.length && (s = e.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? o[0] ? xu(o[0].x) : wu(e) : (e = o.length, function(f) { + var n = br.lastIndex = hr.lastIndex = 0, r, i, s, a = -1, l = [], o = []; + for (t = t + "", e = e + ""; (r = br.exec(t)) && (i = hr.exec(e)); ) + (s = i.index) > n && (s = e.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: Yt(r, i) })), n = hr.lastIndex; + return n < e.length && (s = e.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? o[0] ? yu(o[0].x) : mu(e) : (e = o.length, function(f) { for (var u = 0, h; u < e; ++u) l[(h = o[u]).i] = h.x(f); return l.join(""); }); } -function Re(t, e) { +function Ne(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? Wr(e) : (n === "number" ? Yt : n === "string" ? (r = xe(e)) ? (e = r, Vn) : Ps : e instanceof xe ? Vn : e instanceof Date ? mu : _u(e) ? pu : Array.isArray(e) ? gu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? yu : Yt)(t, e); + return e == null || n === "boolean" ? Wr(e) : (n === "number" ? Yt : n === "string" ? (r = be(e)) ? (e = r, Hn) : Ps : e instanceof be ? Hn : e instanceof Date ? _u : vu(e) ? du : Array.isArray(e) ? pu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? gu : Yt)(t, e); } var ki = 180 / Math.PI, $r = { translateX: 0, @@ -2822,11 +2822,11 @@ function Ds(t, e, n, r, i, s) { }; } var vn; -function bu(t) { +function wu(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); return e.isIdentity ? $r : Ds(e.a, e.b, e.c, e.d, e.e, e.f); } -function $u(t) { +function xu(t) { return t == null || (vn || (vn = document.createElementNS("http://www.w3.org/2000/svg", "g")), vn.setAttribute("transform", t), !(t = vn.transform.baseVal.consolidate())) ? $r : (t = t.matrix, Ds(t.a, t.b, t.c, t.d, t.e, t.f)); } function Is(t, e, n, r) { @@ -2835,8 +2835,8 @@ function Is(t, e, n, r) { } function s(f, u, h, c, d, p) { if (f !== h || u !== c) { - var _ = d.push("translate(", null, e, null, n); - p.push({ i: _ - 4, x: Yt(f, h) }, { i: _ - 2, x: Yt(u, c) }); + var m = d.push("translate(", null, e, null, n); + p.push({ i: m - 4, x: Yt(f, h) }, { i: m - 2, x: Yt(u, c) }); } else (h || c) && d.push("translate(" + h + e + c + n); } function a(f, u, h, c) { @@ -2847,93 +2847,93 @@ function Is(t, e, n, r) { } function o(f, u, h, c, d, p) { if (f !== h || u !== c) { - var _ = d.push(i(d) + "scale(", null, ",", null, ")"); - p.push({ i: _ - 4, x: Yt(f, h) }, { i: _ - 2, x: Yt(u, c) }); + var m = d.push(i(d) + "scale(", null, ",", null, ")"); + p.push({ i: m - 4, x: Yt(f, h) }, { i: m - 2, x: Yt(u, c) }); } else (h !== 1 || c !== 1) && d.push(i(d) + "scale(" + h + "," + c + ")"); } return function(f, u) { var h = [], c = []; return f = t(f), u = t(u), s(f.translateX, f.translateY, u.translateX, u.translateY, h, c), a(f.rotate, u.rotate, h, c), l(f.skewX, u.skewX, h, c), o(f.scaleX, f.scaleY, u.scaleX, u.scaleY, h, c), f = u = null, function(d) { - for (var p = -1, _ = c.length, b; ++p < _; ) h[(b = c[p]).i] = b.x(d); + for (var p = -1, m = c.length, E; ++p < m; ) h[(E = c[p]).i] = E.x(d); return h.join(""); }; }; } -var Au = Is(bu, "px, ", "px)", "deg)"), Eu = Is($u, ", ", ")", ")"), Me = 0, Ye = 0, He = 0, Fs = 1e3, Hn, Be, Yn = 0, be = 0, tr = 0, Qe = typeof performance == "object" && performance.now ? performance : Date, qs = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var bu = Is(wu, "px, ", "px)", "deg)"), $u = Is(xu, ", ", ")", ")"), Oe = 0, Be = 0, Ye = 0, Fs = 1e3, Yn, ze, Bn = 0, $e = 0, er = 0, tn = typeof performance == "object" && performance.now ? performance : Date, qs = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function Jr() { - return be || (qs(Ru), be = Qe.now() + tr); + return $e || (qs(Au), $e = tn.now() + er); } -function Ru() { - be = 0; +function Au() { + $e = 0; } -function Bn() { +function zn() { this._call = this._time = this._next = null; } -Bn.prototype = Ls.prototype = { - constructor: Bn, +zn.prototype = Ls.prototype = { + constructor: zn, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Jr() : +n) + (e == null ? 0 : +e), !this._next && Be !== this && (Be ? Be._next = this : Hn = this, Be = this), this._call = t, this._time = n, Ar(); + n = (n == null ? Jr() : +n) + (e == null ? 0 : +e), !this._next && ze !== this && (ze ? ze._next = this : Yn = this, ze = this), this._call = t, this._time = n, Ar(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, Ar()); } }; function Ls(t, e, n) { - var r = new Bn(); + var r = new zn(); return r.restart(t, e, n), r; } -function Nu() { - Jr(), ++Me; - for (var t = Hn, e; t; ) - (e = be - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --Me; +function Eu() { + Jr(), ++Oe; + for (var t = Yn, e; t; ) + (e = $e - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --Oe; } function Si() { - be = (Yn = Qe.now()) + tr, Me = Ye = 0; + $e = (Bn = tn.now()) + er, Oe = Be = 0; try { - Nu(); + Eu(); } finally { - Me = 0, ku(), be = 0; + Oe = 0, Nu(), $e = 0; } } -function Tu() { - var t = Qe.now(), e = t - Yn; - e > Fs && (tr -= e, Yn = t); +function Ru() { + var t = tn.now(), e = t - Bn; + e > Fs && (er -= e, Bn = t); } -function ku() { - for (var t, e = Hn, 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 : Hn = n); - Be = t, Ar(r); +function Nu() { + for (var t, e = Yn, 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 : Yn = n); + ze = t, Ar(r); } function Ar(t) { - if (!Me) { - Ye && (Ye = clearTimeout(Ye)); - var e = t - be; - e > 24 ? (t < 1 / 0 && (Ye = setTimeout(Si, t - Qe.now() - tr)), He && (He = clearInterval(He))) : (He || (Yn = Qe.now(), He = setInterval(Tu, Fs)), Me = 1, qs(Si)); + if (!Oe) { + Be && (Be = clearTimeout(Be)); + var e = t - $e; + e > 24 ? (t < 1 / 0 && (Be = setTimeout(Si, t - tn.now() - er)), Ye && (Ye = clearInterval(Ye))) : (Ye || (Bn = tn.now(), Ye = setInterval(Ru, Fs)), Oe = 1, qs(Si)); } } function Ci(t, e, n) { - var r = new Bn(); + var r = new zn(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var Su = ms("start", "end", "cancel", "interrupt"), Cu = [], Vs = 0, Mi = 1, Er = 2, wn = 3, Oi = 4, Rr = 5, xn = 6; -function er(t, e, n, r, i, s) { +var Tu = ms("start", "end", "cancel", "interrupt"), ku = [], Vs = 0, Mi = 1, Er = 2, xn = 3, Oi = 4, Rr = 5, bn = 6; +function nr(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - Mu(t, n, { + Su(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. - on: Su, - tween: Cu, + on: Tu, + tween: ku, time: s.time, delay: s.delay, duration: s.duration, @@ -2943,21 +2943,21 @@ function er(t, e, n, r, i, s) { }); } function Zr(t, e) { - var n = It(t, e); + var n = Ot(t, e); if (n.state > Vs) throw new Error("too late; already scheduled"); return n; } function Ut(t, e) { - var n = It(t, e); - if (n.state > wn) throw new Error("too late; already running"); + var n = Ot(t, e); + if (n.state > xn) throw new Error("too late; already running"); return n; } -function It(t, e) { +function Ot(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Mu(t, e, n) { +function Su(t, e, n) { var r = t.__transition, i; r[e] = n, n.timer = Ls(s, 0, n.time); function s(f) { @@ -2968,13 +2968,13 @@ function Mu(t, e, n) { if (n.state !== Mi) return o(); for (u in r) if (d = r[u], d.name === n.name) { - if (d.state === wn) return Ci(a); - d.state === Oi ? (d.state = xn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[u]) : +u < e && (d.state = xn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[u]); + if (d.state === xn) return Ci(a); + d.state === Oi ? (d.state = bn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[u]) : +u < e && (d.state = bn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[u]); } if (Ci(function() { - n.state === wn && (n.state = Oi, n.timer.restart(l, n.delay, n.time), l(f)); + n.state === xn && (n.state = Oi, n.timer.restart(l, n.delay, n.time), l(f)); }), n.state = Er, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Er) { - for (n.state = wn, i = new Array(c = n.tween.length), u = 0, h = -1; u < c; ++u) + for (n.state = xn, i = new Array(c = n.tween.length), u = 0, h = -1; u < c; ++u) (d = n.tween[u].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d); i.length = h + 1; } @@ -2985,12 +2985,12 @@ function Mu(t, e, n) { n.state === Rr && (n.on.call("end", t, t.__data__, n.index, n.group), o()); } function o() { - n.state = xn, n.timer.stop(), delete r[e]; + n.state = bn, n.timer.stop(), delete r[e]; for (var f in r) return; delete t.__transition; } } -function Ou(t, e) { +function Cu(t, e) { var n = t.__transition, r, i, s = !0, a; if (n) { e = e == null ? null : e + ""; @@ -2999,17 +2999,17 @@ function Ou(t, e) { s = !1; continue; } - i = r.state > Er && r.state < Rr, r.state = xn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > Er && r.state < Rr, r.state = bn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } -function Pu(t) { +function Mu(t) { return this.each(function() { - Ou(this, t); + Cu(this, t); }); } -function Du(t, e) { +function Ou(t, e) { var n, r; return function() { var i = Ut(this, t), s = i.tween; @@ -3024,7 +3024,7 @@ function Du(t, e) { i.tween = r; }; } -function Iu(t, e, n) { +function Pu(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { @@ -3041,15 +3041,15 @@ function Iu(t, e, n) { s.tween = i; }; } -function Fu(t, e) { +function Du(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = It(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = Ot(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 ? Du : Iu)(n, t, e)); + return this.each((e == null ? Ou : Pu)(n, t, e)); } function Qr(t, e, n) { var r = t._id; @@ -3057,209 +3057,209 @@ function Qr(t, e, n) { var i = Ut(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return It(i, r).value[e]; + return Ot(i, r).value[e]; }; } function Hs(t, e) { var n; - return (typeof e == "number" ? Yt : e instanceof xe ? Vn : (n = xe(e)) ? (e = n, Vn) : Ps)(t, e); + return (typeof e == "number" ? Yt : e instanceof be ? Hn : (n = be(e)) ? (e = n, Hn) : Ps)(t, e); } -function qu(t) { +function Iu(t) { return function() { this.removeAttribute(t); }; } -function Lu(t) { +function Fu(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function Vu(t, e, n) { +function qu(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 Hu(t, e, n) { +function Lu(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 Yu(t, e, n) { +function Vu(t, e, n) { var r, i, s; return function() { var a, l = n(this), o; return l == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l))); }; } -function Bu(t, e, n) { +function Hu(t, e, n) { var r, i, s; return function() { var a, l = n(this), o; return l == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l))); }; } -function zu(t, e) { - var n = Qn(t), r = n === "transform" ? Eu : Hs; - return this.attrTween(t, typeof e == "function" ? (n.local ? Bu : Yu)(n, r, Qr(this, "attr." + t, e)) : e == null ? (n.local ? Lu : qu)(n) : (n.local ? Hu : Vu)(n, r, e)); +function Yu(t, e) { + var n = tr(t), r = n === "transform" ? $u : Hs; + return this.attrTween(t, typeof e == "function" ? (n.local ? Hu : Vu)(n, r, Qr(this, "attr." + t, e)) : e == null ? (n.local ? Fu : Iu)(n) : (n.local ? Lu : qu)(n, r, e)); } -function Xu(t, e) { +function Bu(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function Uu(t, e) { +function zu(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function Gu(t, e) { +function Xu(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Uu(t, s)), n; + return s !== r && (n = (r = s) && zu(t, s)), n; } return i._value = e, i; } -function Ku(t, e) { +function Uu(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Xu(t, s)), n; + return s !== r && (n = (r = s) && Bu(t, s)), n; } return i._value = e, i; } -function ju(t, e) { +function Gu(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 = Qn(t); - return this.tween(n, (r.local ? Gu : Ku)(r, e)); + var r = tr(t); + return this.tween(n, (r.local ? Xu : Uu)(r, e)); } -function Wu(t, e) { +function Ku(t, e) { return function() { Zr(this, t).delay = +e.apply(this, arguments); }; } -function Ju(t, e) { +function ju(t, e) { return e = +e, function() { Zr(this, t).delay = e; }; } -function Zu(t) { +function Wu(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Wu : Ju)(e, t)) : It(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? Ku : ju)(e, t)) : Ot(this.node(), e).delay; } -function Qu(t, e) { +function Ju(t, e) { return function() { Ut(this, t).duration = +e.apply(this, arguments); }; } -function tf(t, e) { +function Zu(t, e) { return e = +e, function() { Ut(this, t).duration = e; }; } -function ef(t) { +function Qu(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Qu : tf)(e, t)) : It(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? Ju : Zu)(e, t)) : Ot(this.node(), e).duration; } -function nf(t, e) { +function tf(t, e) { if (typeof e != "function") throw new Error(); return function() { Ut(this, t).ease = e; }; } -function rf(t) { +function ef(t) { var e = this._id; - return arguments.length ? this.each(nf(e, t)) : It(this.node(), e).ease; + return arguments.length ? this.each(tf(e, t)) : Ot(this.node(), e).ease; } -function sf(t, e) { +function nf(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); Ut(this, t).ease = n; }; } -function af(t) { +function rf(t) { if (typeof t != "function") throw new Error(); - return this.each(sf(this._id, t)); + return this.each(nf(this._id, t)); } -function lf(t) { +function sf(t) { typeof t != "function" && (t = xs(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, l = r[i] = [], o, f = 0; f < a; ++f) (o = s[f]) && t.call(o, o.__data__, f, s) && l.push(o); - return new ne(r, this._parents, this._name, this._id); + return new ae(r, this._parents, this._name, this._id); } -function of(t) { +function af(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), l = 0; l < s; ++l) for (var o = e[l], f = n[l], u = o.length, h = a[l] = new Array(u), c, d = 0; d < u; ++d) (c = o[d] || f[d]) && (h[d] = c); for (; l < r; ++l) a[l] = e[l]; - return new ne(a, this._parents, this._name, this._id); + return new ae(a, this._parents, this._name, this._id); } -function uf(t) { +function lf(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 ff(t, e, n) { - var r, i, s = uf(e) ? Zr : Ut; +function of(t, e, n) { + var r, i, s = lf(e) ? Zr : Ut; return function() { var a = s(this, t), l = a.on; l !== r && (i = (r = l).copy()).on(e, n), a.on = i; }; } -function cf(t, e) { +function uf(t, e) { var n = this._id; - return arguments.length < 2 ? It(this.node(), n).on.on(t) : this.each(ff(n, t, e)); + return arguments.length < 2 ? Ot(this.node(), n).on.on(t) : this.each(of(n, t, e)); } -function hf(t) { +function ff(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } -function df() { - return this.on("end.remove", hf(this._id)); +function cf() { + return this.on("end.remove", ff(this._id)); } -function vf(t) { +function hf(t) { var e = this._name, n = this._id; typeof t != "function" && (t = Gr(t)); 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, f = s[a] = new Array(o), u, h, c = 0; c < o; ++c) - (u = l[c]) && (h = t.call(u, u.__data__, c, l)) && ("__data__" in u && (h.__data__ = u.__data__), f[c] = h, er(f[c], e, n, c, f, It(u, n))); - return new ne(s, this._parents, e, n); + (u = l[c]) && (h = t.call(u, u.__data__, c, l)) && ("__data__" in u && (h.__data__ = u.__data__), f[c] = h, nr(f[c], e, n, c, f, Ot(u, n))); + return new ae(s, this._parents, e, n); } -function pf(t) { +function df(t) { var e = this._name, n = this._id; typeof t != "function" && (t = ws(t)); for (var r = this._groups, i = r.length, s = [], a = [], l = 0; l < i; ++l) for (var o = r[l], f = o.length, u, h = 0; h < f; ++h) if (u = o[h]) { - for (var c = t.call(u, u.__data__, h, o), d, p = It(u, n), _ = 0, b = c.length; _ < b; ++_) - (d = c[_]) && er(d, e, n, _, c, p); + for (var c = t.call(u, u.__data__, h, o), d, p = Ot(u, n), m = 0, E = c.length; m < E; ++m) + (d = c[m]) && nr(d, e, n, m, c, p); s.push(c), a.push(u); } - return new ne(s, a, e, n); + return new ae(s, a, e, n); } -var _f = Fe.prototype.constructor; -function gf() { - return new _f(this._groups, this._parents); +var vf = qe.prototype.constructor; +function pf() { + return new vf(this._groups, this._parents); } -function mf(t, e) { +function _f(t, e) { var n, r, i; return function() { - var s = Ce(this, t), a = (this.style.removeProperty(t), Ce(this, t)); + var s = Me(this, t), a = (this.style.removeProperty(t), Me(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } @@ -3268,100 +3268,100 @@ function Ys(t) { this.style.removeProperty(t); }; } -function yf(t, e, n) { +function gf(t, e, n) { var r, i = n + "", s; return function() { - var a = Ce(this, t); + var a = Me(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function wf(t, e, n) { +function mf(t, e, n) { var r, i, s; return function() { - var a = Ce(this, t), l = n(this), o = l + ""; - return l == null && (o = l = (this.style.removeProperty(t), Ce(this, t))), a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l)); + var a = Me(this, t), l = n(this), o = l + ""; + return l == null && (o = l = (this.style.removeProperty(t), Me(this, t))), a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l)); }; } -function xf(t, e) { +function yf(t, e) { var n, r, i, s = "style." + e, a = "end." + s, l; return function() { var o = Ut(this, t), f = o.on, u = o.value[s] == null ? l || (l = Ys(e)) : void 0; (f !== n || i !== u) && (r = (n = f).copy()).on(a, i = u), o.on = r; }; } -function bf(t, e, n) { - var r = (t += "") == "transform" ? Au : Hs; - return e == null ? this.styleTween(t, mf(t, r)).on("end.style." + t, Ys(t)) : typeof e == "function" ? this.styleTween(t, wf(t, r, Qr(this, "style." + t, e))).each(xf(this._id, t)) : this.styleTween(t, yf(t, r, e), n).on("end.style." + t, null); +function wf(t, e, n) { + var r = (t += "") == "transform" ? bu : Hs; + return e == null ? this.styleTween(t, _f(t, r)).on("end.style." + t, Ys(t)) : typeof e == "function" ? this.styleTween(t, mf(t, r, Qr(this, "style." + t, e))).each(yf(this._id, t)) : this.styleTween(t, gf(t, r, e), n).on("end.style." + t, null); } -function $f(t, e, n) { +function xf(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } -function Af(t, e, n) { +function bf(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && $f(t, a, n)), r; + return a !== i && (r = (i = a) && xf(t, a, n)), r; } return s._value = e, s; } -function Ef(t, e, n) { +function $f(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, Af(t, e, n ?? "")); + return this.tween(r, bf(t, e, n ?? "")); } -function Rf(t) { +function Af(t) { return function() { this.textContent = t; }; } -function Nf(t) { +function Ef(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function Tf(t) { - return this.tween("text", typeof t == "function" ? Nf(Qr(this, "text", t)) : Rf(t == null ? "" : t + "")); +function Rf(t) { + return this.tween("text", typeof t == "function" ? Ef(Qr(this, "text", t)) : Af(t == null ? "" : t + "")); } -function kf(t) { +function Nf(t) { return function(e) { this.textContent = t.call(this, e); }; } -function Sf(t) { +function Tf(t) { var e, n; function r() { var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && kf(i)), e; + return i !== n && (e = (n = i) && Nf(i)), e; } return r._value = t, r; } -function Cf(t) { +function kf(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, Sf(t)); + return this.tween(e, Tf(t)); } -function Mf() { +function Sf() { for (var t = this._name, e = this._id, n = Bs(), r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], l = a.length, o, f = 0; f < l; ++f) if (o = a[f]) { - var u = It(o, e); - er(o, t, n, f, a, { + var u = Ot(o, e); + nr(o, t, n, f, a, { time: u.time + u.delay + u.duration, delay: 0, duration: u.duration, ease: u.ease }); } - return new ne(r, this._parents, t, n); + return new ae(r, this._parents, t, n); } -function Of() { +function Cf() { var t, e, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { var l = { value: a }, o = { value: function() { @@ -3373,82 +3373,82 @@ function Of() { }), i === 0 && s(); }); } -var Pf = 0; -function ne(t, e, n, r) { +var Mf = 0; +function ae(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function bn(t) { - return Fe().transition(t); +function $n(t) { + return qe().transition(t); } function Bs() { - return ++Pf; -} -var Kt = Fe.prototype; -ne.prototype = bn.prototype = { - constructor: ne, - select: vf, - selectAll: pf, - selectChild: Kt.selectChild, - selectChildren: Kt.selectChildren, - filter: lf, - merge: of, - selection: gf, - transition: Mf, - call: Kt.call, - nodes: Kt.nodes, - node: Kt.node, - size: Kt.size, - empty: Kt.empty, - each: Kt.each, - on: cf, - attr: zu, - attrTween: ju, - style: bf, - styleTween: Ef, - text: Tf, - textTween: Cf, - remove: df, - tween: Fu, - delay: Zu, - duration: ef, - ease: rf, - easeVarying: af, - end: Of, - [Symbol.iterator]: Kt[Symbol.iterator] + return ++Mf; +} +var Wt = qe.prototype; +ae.prototype = $n.prototype = { + constructor: ae, + select: hf, + selectAll: df, + selectChild: Wt.selectChild, + selectChildren: Wt.selectChildren, + filter: sf, + merge: af, + selection: pf, + transition: Sf, + call: Wt.call, + nodes: Wt.nodes, + node: Wt.node, + size: Wt.size, + empty: Wt.empty, + each: Wt.each, + on: uf, + attr: Yu, + attrTween: Gu, + style: wf, + styleTween: $f, + text: Rf, + textTween: kf, + remove: cf, + tween: Du, + delay: Wu, + duration: Qu, + ease: ef, + easeVarying: rf, + end: Cf, + [Symbol.iterator]: Wt[Symbol.iterator] }; -function Df(t) { +function Of(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var If = { +var Pf = { time: null, // Set on use. delay: 0, duration: 250, - ease: Df + ease: Of }; -function Ff(t, e) { +function Df(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 qf(t) { +function If(t) { var e, n; - t instanceof ne ? (e = t._id, t = t._name) : (e = Bs(), (n = If).time = Jr(), t = t == null ? null : t + ""); + t instanceof ae ? (e = t._id, t = t._name) : (e = Bs(), (n = Pf).time = Jr(), t = t == null ? null : t + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], l = a.length, o, f = 0; f < l; ++f) - (o = a[f]) && er(o, t, e, f, a, n || Ff(o, e)); - return new ne(r, this._parents, t, e); + (o = a[f]) && nr(o, t, e, f, a, n || Df(o, e)); + return new ae(r, this._parents, t, e); } -Fe.prototype.interrupt = Pu; -Fe.prototype.transition = qf; -const Nr = Math.PI, Tr = 2 * Nr, _e = 1e-6, Lf = Tr - _e; +qe.prototype.interrupt = Mu; +qe.prototype.transition = If; +const Nr = Math.PI, Tr = 2 * Nr, ge = 1e-6, Ff = Tr - ge; function zs(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function Vf(t) { +function qf(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); if (e > 15) return zs; @@ -3459,10 +3459,10 @@ function Vf(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Hf { +class Lf { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? zs : Vf(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? zs : qf(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -3484,17 +3484,17 @@ class Hf { let a = this._x1, l = this._y1, o = r - e, f = i - n, u = a - e, h = l - n, c = u * u + h * h; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > _e) if (!(Math.abs(h * o - f * u) > _e) || !s) + else if (c > ge) if (!(Math.abs(h * o - f * u) > ge) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let d = r - a, p = i - l, _ = o * o + f * f, b = d * d + p * p, y = Math.sqrt(_), $ = Math.sqrt(c), E = s * Math.tan((Nr - Math.acos((_ + c - b) / (2 * y * $))) / 2), M = E / $, S = E / y; - Math.abs(M - 1) > _e && this._append`L${e + M * u},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * d > u * p)},${this._x1 = e + S * o},${this._y1 = n + S * f}`; + let d = r - a, p = i - l, m = o * o + f * f, E = d * d + p * p, w = Math.sqrt(m), $ = Math.sqrt(c), b = s * Math.tan((Nr - Math.acos((m + c - E) / (2 * w * $))) / 2), S = b / $, P = b / w; + Math.abs(S - 1) > ge && this._append`L${e + S * u},${n + S * h}`, this._append`A${s},${s},0,0,${+(h * d > u * p)},${this._x1 = e + P * o},${this._y1 = n + P * f}`; } } 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 l = r * Math.cos(i), o = r * Math.sin(i), f = e + l, u = n + o, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${f},${u}` : (Math.abs(this._x1 - f) > _e || Math.abs(this._y1 - u) > _e) && this._append`L${f},${u}`, r && (c < 0 && (c = c % Tr + Tr), c > Lf ? this._append`A${r},${r},0,1,${h},${e - l},${n - o}A${r},${r},0,1,${h},${this._x1 = f},${this._y1 = u}` : c > _e && this._append`A${r},${r},0,${+(c >= Nr)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + this._x1 === null ? this._append`M${f},${u}` : (Math.abs(this._x1 - f) > ge || Math.abs(this._y1 - u) > ge) && this._append`L${f},${u}`, r && (c < 0 && (c = c % Tr + Tr), c > Ff ? this._append`A${r},${r},0,1,${h},${e - l},${n - o}A${r},${r},0,1,${h},${this._x1 = f},${this._y1 = u}` : c > ge && this._append`A${r},${r},0,${+(c >= Nr)},${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`; @@ -3503,24 +3503,24 @@ class Hf { return this._; } } -function Yf(t) { +function Vf(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 Bf = Yf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function ut(t) { +const Hf = Vf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function ot(t) { return function() { return t; }; } -const Pi = Math.abs, at = Math.atan2, pe = Math.cos, zf = Math.max, hr = Math.min, Vt = Math.sin, Ne = Math.sqrt, pt = 1e-12, tn = Math.PI, zn = tn / 2, $n = 2 * tn; -function Xf(t) { - return t > 1 ? 0 : t < -1 ? tn : Math.acos(t); +const Pi = Math.abs, at = Math.atan2, _e = Math.cos, Yf = Math.max, dr = Math.min, Ht = Math.sin, Te = Math.sqrt, ht = 1e-12, en = Math.PI, Xn = en / 2, An = 2 * en; +function Bf(t) { + return t > 1 ? 0 : t < -1 ? en : Math.acos(t); } function Di(t) { - return t >= 1 ? zn : t <= -1 ? -zn : Math.asin(t); + return t >= 1 ? Xn : t <= -1 ? -Xn : Math.asin(t); } -function Uf(t) { +function zf(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -3532,141 +3532,141 @@ function Uf(t) { e = r; } return t; - }, () => new Hf(e); + }, () => new Lf(e); } -function Gf(t) { +function Xf(t) { return t.innerRadius; } -function Kf(t) { +function Uf(t) { return t.outerRadius; } -function jf(t) { +function Gf(t) { return t.startAngle; } -function Wf(t) { +function Kf(t) { return t.endAngle; } -function Jf(t) { +function jf(t) { return t && t.padAngle; } -function Zf(t, e, n, r, i, s, a, l) { +function Wf(t, e, n, r, i, s, a, l) { var o = n - t, f = r - e, u = a - i, h = l - s, c = h * o - u * f; - if (!(c * c < pt)) + if (!(c * c < ht)) return c = (u * (e - s) - h * (t - i)) / c, [t + c * o, e + c * f]; } function pn(t, e, n, r, i, s, a) { - var l = t - n, o = e - r, f = (a ? s : -s) / Ne(l * l + o * o), u = f * o, h = -f * l, c = t + u, d = e + h, p = n + u, _ = r + h, b = (c + p) / 2, y = (d + _) / 2, $ = p - c, E = _ - d, M = $ * $ + E * E, S = i - s, P = c * _ - p * d, B = (E < 0 ? -1 : 1) * Ne(zf(0, S * S * M - P * P)), W = (P * E - $ * B) / M, rt = (-P * $ - E * B) / M, Q = (P * E + $ * B) / M, K = (-P * $ + E * B) / M, H = W - b, N = rt - y, q = Q - b, Nt = K - y; - return H * H + N * N > q * q + Nt * Nt && (W = Q, rt = K), { - cx: W, - cy: rt, + var l = t - n, o = e - r, f = (a ? s : -s) / Te(l * l + o * o), u = f * o, h = -f * l, c = t + u, d = e + h, p = n + u, m = r + h, E = (c + p) / 2, w = (d + m) / 2, $ = p - c, b = m - d, S = $ * $ + b * b, P = i - s, D = c * m - p * d, Y = (b < 0 ? -1 : 1) * Te(Yf(0, P * P * S - D * D)), G = (D * b - $ * Y) / S, K = (-D * $ - b * Y) / S, q = (D * b + $ * Y) / S, nt = (-D * $ + b * Y) / S, tt = G - E, T = K - w, M = q - E, _t = nt - w; + return tt * tt + T * T > M * M + _t * _t && (G = q, K = nt), { + cx: G, + cy: K, x01: -u, y01: -h, - x11: W * (i / S - 1), - y11: rt * (i / S - 1) + x11: G * (i / P - 1), + y11: K * (i / P - 1) }; } -function jt() { - var t = Gf, e = Kf, n = ut(0), r = null, i = jf, s = Wf, a = Jf, l = null, o = Uf(f); +function Jt() { + var t = Xf, e = Uf, n = ot(0), r = null, i = Gf, s = Kf, a = jf, l = null, o = zf(f); function f() { - var u, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - zn, _ = s.apply(this, arguments) - zn, b = Pi(_ - p), y = _ > p; - if (l || (l = u = o()), d < c && (h = d, d = c, c = h), !(d > pt)) l.moveTo(0, 0); - else if (b > $n - pt) - l.moveTo(d * pe(p), d * Vt(p)), l.arc(0, 0, d, p, _, !y), c > pt && (l.moveTo(c * pe(_), c * Vt(_)), l.arc(0, 0, c, _, p, y)); + var u, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - Xn, m = s.apply(this, arguments) - Xn, E = Pi(m - p), w = m > p; + if (l || (l = u = o()), d < c && (h = d, d = c, c = h), !(d > ht)) l.moveTo(0, 0); + else if (E > An - ht) + l.moveTo(d * _e(p), d * Ht(p)), l.arc(0, 0, d, p, m, !w), c > ht && (l.moveTo(c * _e(m), c * Ht(m)), l.arc(0, 0, c, m, p, w)); else { - var $ = p, E = _, M = p, S = _, P = b, B = b, W = a.apply(this, arguments) / 2, rt = W > pt && (r ? +r.apply(this, arguments) : Ne(c * c + d * d)), Q = hr(Pi(d - c) / 2, +n.apply(this, arguments)), K = Q, H = Q, N, q; - if (rt > pt) { - var Nt = Di(rt / c * Vt(W)), ft = Di(rt / d * Vt(W)); - (P -= Nt * 2) > pt ? (Nt *= y ? 1 : -1, M += Nt, S -= Nt) : (P = 0, M = S = (p + _) / 2), (B -= ft * 2) > pt ? (ft *= y ? 1 : -1, $ += ft, E -= ft) : (B = 0, $ = E = (p + _) / 2); + var $ = p, b = m, S = p, P = m, D = E, Y = E, G = a.apply(this, arguments) / 2, K = G > ht && (r ? +r.apply(this, arguments) : Te(c * c + d * d)), q = dr(Pi(d - c) / 2, +n.apply(this, arguments)), nt = q, tt = q, T, M; + if (K > ht) { + var _t = Di(K / c * Ht(G)), Gt = Di(K / d * Ht(G)); + (D -= _t * 2) > ht ? (_t *= w ? 1 : -1, S += _t, P -= _t) : (D = 0, S = P = (p + m) / 2), (Y -= Gt * 2) > ht ? (Gt *= w ? 1 : -1, $ += Gt, b -= Gt) : (Y = 0, $ = b = (p + m) / 2); } - var Tt = d * pe($), ct = d * Vt($), Ft = c * pe(S), ae = c * Vt(S); - if (Q > pt) { - var le = d * pe(E), kt = d * Vt(E), oe = c * pe(M), ue = c * Vt(M), ht; - if (b < tn) - if (ht = Zf(Tt, ct, oe, ue, le, kt, Ft, ae)) { - var Gt = Tt - ht[0], w = ct - ht[1], D = le - ht[0], z = kt - ht[1], Y = 1 / Vt(Xf((Gt * D + w * z) / (Ne(Gt * Gt + w * w) * Ne(D * D + z * z))) / 2), tt = Ne(ht[0] * ht[0] + ht[1] * ht[1]); - K = hr(Q, (c - tt) / (Y - 1)), H = hr(Q, (d - tt) / (Y + 1)); + var Pt = d * _e($), Dt = d * Ht($), Tt = c * _e(P), It = c * Ht(P); + if (q > ht) { + var Kt = d * _e(b), fe = d * Ht(b), Ft = c * _e(S), jt = c * Ht(S), rt; + if (E < en) + if (rt = Wf(Pt, Dt, Ft, jt, Kt, fe, Tt, It)) { + var $t = Pt - rt[0], gt = Dt - rt[1], y = Kt - rt[0], L = fe - rt[1], j = 1 / Ht(Bf(($t * y + gt * L) / (Te($t * $t + gt * gt) * Te(y * y + L * L))) / 2), B = Te(rt[0] * rt[0] + rt[1] * rt[1]); + nt = dr(q, (c - B) / (j - 1)), tt = dr(q, (d - B) / (j + 1)); } else - K = H = 0; + nt = tt = 0; } - B > pt ? H > pt ? (N = pn(oe, ue, Tt, ct, d, H, y), q = pn(le, kt, Ft, ae, d, H, y), l.moveTo(N.cx + N.x01, N.cy + N.y01), H < Q ? l.arc(N.cx, N.cy, H, at(N.y01, N.x01), at(q.y01, q.x01), !y) : (l.arc(N.cx, N.cy, H, at(N.y01, N.x01), at(N.y11, N.x11), !y), l.arc(0, 0, d, at(N.cy + N.y11, N.cx + N.x11), at(q.cy + q.y11, q.cx + q.x11), !y), l.arc(q.cx, q.cy, H, at(q.y11, q.x11), at(q.y01, q.x01), !y))) : (l.moveTo(Tt, ct), l.arc(0, 0, d, $, E, !y)) : l.moveTo(Tt, ct), !(c > pt) || !(P > pt) ? l.lineTo(Ft, ae) : K > pt ? (N = pn(Ft, ae, le, kt, c, -K, y), q = pn(Tt, ct, oe, ue, c, -K, y), l.lineTo(N.cx + N.x01, N.cy + N.y01), K < Q ? l.arc(N.cx, N.cy, K, at(N.y01, N.x01), at(q.y01, q.x01), !y) : (l.arc(N.cx, N.cy, K, at(N.y01, N.x01), at(N.y11, N.x11), !y), l.arc(0, 0, c, at(N.cy + N.y11, N.cx + N.x11), at(q.cy + q.y11, q.cx + q.x11), y), l.arc(q.cx, q.cy, K, at(q.y11, q.x11), at(q.y01, q.x01), !y))) : l.arc(0, 0, c, S, M, y); + Y > ht ? tt > ht ? (T = pn(Ft, jt, Pt, Dt, d, tt, w), M = pn(Kt, fe, Tt, It, d, tt, w), l.moveTo(T.cx + T.x01, T.cy + T.y01), tt < q ? l.arc(T.cx, T.cy, tt, at(T.y01, T.x01), at(M.y01, M.x01), !w) : (l.arc(T.cx, T.cy, tt, at(T.y01, T.x01), at(T.y11, T.x11), !w), l.arc(0, 0, d, at(T.cy + T.y11, T.cx + T.x11), at(M.cy + M.y11, M.cx + M.x11), !w), l.arc(M.cx, M.cy, tt, at(M.y11, M.x11), at(M.y01, M.x01), !w))) : (l.moveTo(Pt, Dt), l.arc(0, 0, d, $, b, !w)) : l.moveTo(Pt, Dt), !(c > ht) || !(D > ht) ? l.lineTo(Tt, It) : nt > ht ? (T = pn(Tt, It, Kt, fe, c, -nt, w), M = pn(Pt, Dt, Ft, jt, c, -nt, w), l.lineTo(T.cx + T.x01, T.cy + T.y01), nt < q ? l.arc(T.cx, T.cy, nt, at(T.y01, T.x01), at(M.y01, M.x01), !w) : (l.arc(T.cx, T.cy, nt, at(T.y01, T.x01), at(T.y11, T.x11), !w), l.arc(0, 0, c, at(T.cy + T.y11, T.cx + T.x11), at(M.cy + M.y11, M.cx + M.x11), w), l.arc(M.cx, M.cy, nt, at(M.y11, M.x11), at(M.y01, M.x01), !w))) : l.arc(0, 0, c, P, S, w); } if (l.closePath(), u) return l = null, u + "" || null; } return f.centroid = function() { - var u = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - tn / 2; - return [pe(h) * u, Vt(h) * u]; + var u = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - en / 2; + return [_e(h) * u, Ht(h) * u]; }, f.innerRadius = function(u) { - return arguments.length ? (t = typeof u == "function" ? u : ut(+u), f) : t; + return arguments.length ? (t = typeof u == "function" ? u : ot(+u), f) : t; }, f.outerRadius = function(u) { - return arguments.length ? (e = typeof u == "function" ? u : ut(+u), f) : e; + return arguments.length ? (e = typeof u == "function" ? u : ot(+u), f) : e; }, f.cornerRadius = function(u) { - return arguments.length ? (n = typeof u == "function" ? u : ut(+u), f) : n; + return arguments.length ? (n = typeof u == "function" ? u : ot(+u), f) : n; }, f.padRadius = function(u) { - return arguments.length ? (r = u == null ? null : typeof u == "function" ? u : ut(+u), f) : r; + return arguments.length ? (r = u == null ? null : typeof u == "function" ? u : ot(+u), f) : r; }, f.startAngle = function(u) { - return arguments.length ? (i = typeof u == "function" ? u : ut(+u), f) : i; + return arguments.length ? (i = typeof u == "function" ? u : ot(+u), f) : i; }, f.endAngle = function(u) { - return arguments.length ? (s = typeof u == "function" ? u : ut(+u), f) : s; + return arguments.length ? (s = typeof u == "function" ? u : ot(+u), f) : s; }, f.padAngle = function(u) { - return arguments.length ? (a = typeof u == "function" ? u : ut(+u), f) : a; + return arguments.length ? (a = typeof u == "function" ? u : ot(+u), f) : a; }, f.context = function(u) { return arguments.length ? (l = u ?? null, f) : l; }, f; } -function Qf(t) { +function Jf(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function tc(t, e) { +function Zf(t, e) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function ec(t) { +function Qf(t) { return t; } -function dr() { - var t = ec, e = tc, n = null, r = ut(0), i = ut($n), s = ut(0); +function vr() { + var t = Qf, e = Zf, n = null, r = ot(0), i = ot(An), s = ot(0); function a(l) { - var o, f = (l = Qf(l)).length, u, h, c = 0, d = new Array(f), p = new Array(f), _ = +r.apply(this, arguments), b = Math.min($n, Math.max(-$n, i.apply(this, arguments) - _)), y, $ = Math.min(Math.abs(b) / f, s.apply(this, arguments)), E = $ * (b < 0 ? -1 : 1), M; + var o, f = (l = Jf(l)).length, u, h, c = 0, d = new Array(f), p = new Array(f), m = +r.apply(this, arguments), E = Math.min(An, Math.max(-An, i.apply(this, arguments) - m)), w, $ = Math.min(Math.abs(E) / f, s.apply(this, arguments)), b = $ * (E < 0 ? -1 : 1), S; for (o = 0; o < f; ++o) - (M = p[d[o] = o] = +t(l[o], o, l)) > 0 && (c += M); - for (e != null ? d.sort(function(S, P) { - return e(p[S], p[P]); - }) : n != null && d.sort(function(S, P) { - return n(l[S], l[P]); - }), o = 0, h = c ? (b - f * E) / c : 0; o < f; ++o, _ = y) - u = d[o], M = p[u], y = _ + (M > 0 ? M * h : 0) + E, p[u] = { + (S = p[d[o] = o] = +t(l[o], o, l)) > 0 && (c += S); + for (e != null ? d.sort(function(P, D) { + return e(p[P], p[D]); + }) : n != null && d.sort(function(P, D) { + return n(l[P], l[D]); + }), o = 0, h = c ? (E - f * b) / c : 0; o < f; ++o, m = w) + u = d[o], S = p[u], w = m + (S > 0 ? S * h : 0) + b, p[u] = { data: l[u], index: o, - value: M, - startAngle: _, - endAngle: y, + value: S, + startAngle: m, + endAngle: w, padAngle: $ }; return p; } return a.value = function(l) { - return arguments.length ? (t = typeof l == "function" ? l : ut(+l), a) : t; + return arguments.length ? (t = typeof l == "function" ? l : ot(+l), a) : t; }, a.sortValues = function(l) { return arguments.length ? (e = l, n = null, a) : e; }, a.sort = function(l) { return arguments.length ? (n = l, e = null, a) : n; }, a.startAngle = function(l) { - return arguments.length ? (r = typeof l == "function" ? l : ut(+l), a) : r; + return arguments.length ? (r = typeof l == "function" ? l : ot(+l), a) : r; }, a.endAngle = function(l) { - return arguments.length ? (i = typeof l == "function" ? l : ut(+l), a) : i; + return arguments.length ? (i = typeof l == "function" ? l : ot(+l), a) : i; }, a.padAngle = function(l) { - return arguments.length ? (s = typeof l == "function" ? l : ut(+l), a) : s; + return arguments.length ? (s = typeof l == "function" ? l : ot(+l), a) : s; }, a; } -function ze(t, e, n) { +function Xe(t, e, n) { this.k = t, this.x = e, this.y = n; } -ze.prototype = { - constructor: ze, +Xe.prototype = { + constructor: Xe, scale: function(t) { - return t === 1 ? this : new ze(this.k * t, this.x, this.y); + return t === 1 ? this : new Xe(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new ze(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new Xe(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]; @@ -3696,9 +3696,9 @@ ze.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -ze.prototype; -const he = {}, kr = "No Further Rankings"; -function Xn(t, e) { +Xe.prototype; +const de = {}, kr = "No Further Rankings"; +function Un(t, e) { let n = 0; for (let r = 1; r < e; r++) { const i = t.results[r - 1].tallyResults; @@ -3722,208 +3722,215 @@ function Xs(t, e, n) { } return i; } -function Un(t, e) { +function Gn(t, e) { return Xs(t, e, "eliminated"); } -function Gn(t, e) { +function Kn(t, e) { let n = []; for (let r = 1; r <= e; r++) n = n.concat(Xs(t, r, "elected")); return n; } -var nc = /* @__PURE__ */ ll(''); -const rc = { hash: "svelte-3kpd", code: "" }; +var tc = /* @__PURE__ */ sl(''); +const ec = { hash: "svelte-3kpd", code: "" }; function Us(t, e) { - Xr(e, !0), ps(t, rc); - let n = Ht(e, "jsonData", 7), r = Ht(e, "currentRound", 15), i = Ht(e, "mouseEventType", 15), s = Ht(e, "mouseData", 15), a = Ht(e, "mouseY", 15), l = Ht(e, "animateOnePhase", 15), o = Ht(e, "runFullAnimation", 15); - const f = 800, u = 800, h = Math.min(f, u) * 0.3, c = f / 2, d = u / 2, p = "Pie", _ = "Donut", b = "TextLayer", y = "#transfer", $ = "url(#cross-hatch)", E = 1.15, M = 0.1, S = 750, P = 800; - let B = [], W = [], rt = [], Q = 0, K = Ct(0), H = Ct(null); - function N() { - const v = st(g(H)); - v.select("#" + p).remove(), v.select("#" + _).remove(), v.select("#" + b).remove(); - } - function q(v) { - N(), rt = Nt(v), B = Qs(v, p, rt, c, d, 0, ft()); - } - dl(() => { - console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), l(rn), o(tt), ue(), q(r()); + Xr(e, !0), ps(t, ec); + let n = ve(e, "jsonData", 7), r = ve(e, "currentRound", 15), i = ve(e, "mouseEventType", 15), s = ve(e, "mouseData", 15), a = ve(e, "mouseY", 15); + const l = 800, o = 800, f = Math.min(l, o) * 0.3, u = l / 2, h = o / 2, c = "Pie", d = "Donut", p = "TextLayer", m = "#transfer", E = "url(#cross-hatch)", w = 1.15, $ = 0.1, b = 750, S = 800; + let P = [], D = [], Y = [], G = 0, K = Zt(0), q = Zt(null); + function nt() { + const v = st(_(q)); + v.select("#" + c).remove(), v.select("#" + d).remove(), v.select("#" + p).remove(); + } + function tt(v) { + nt(), Y = T(v), P = Js(v, c, Y, u, h, 0, M()); + } + cl(() => { + console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), fe(), setTimeout( + () => { + tt(r()); + }, + 0 + ); }); - function Nt(v) { - const m = oe(v); - return Q = le(v), m; + function T(v) { + const g = Kt(v); + return G = Tt(v), g; } - function ft() { - return h; + function M() { + return f; } - function Tt() { - return ft() * 1.41; + function _t() { + return M() * 1.41; } - function ct(v, m) { - if (v === "exhausted") return Xn(n(), m); + function Gt(v, g) { + if (v === "exhausted") return Un(n(), g); { - const x = n().results[m - 1].tally; + const x = n().results[g - 1].tally; return Number(x[v]); } } - function Ft(v, m) { - return ct(v, m).toLocaleString("en-US"); + function Pt(v, g) { + return Gt(v, g).toLocaleString("en-US"); } - function ae(v, m) { - return (ct(v, m) / Q).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Dt(v, g) { + return (Gt(v, g) / G).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function le(v) { - const m = n().results[v - 1].tally; + function Tt(v) { + const g = n().results[v - 1].tally; let x = 0; - for (let [O, R] of Object.entries(m)) + for (let [O, R] of Object.entries(g)) x += Number(R); return x; } - function kt(v, m) { - const x = n().results[m - 1].tallyResults; + function It(v, g) { + const x = n().results[g - 1].tallyResults; let O = 0; const R = x.findIndex((k) => (k == null ? void 0 : k.elected) && v == k.elected); if (R >= 0) { const k = x[R].transfers; if (k) - for (let [T, C] of Object.entries(k)) O += Number(C); + for (let [N, C] of Object.entries(k)) O += Number(C); } else return 0; return O; } - function oe(v) { - const m = n().results; - let x = m[Math.max(0, v - 2)].tally; + function Kt(v) { + const g = n().results; + let x = g[Math.max(0, v - 2)].tally; const O = [], R = []; - for (let [T, C] of Object.entries(x)) - O.push({ label: T, value: 0 }); - x = m[v - 1].tally; - for (let T of O) { - const C = Number(x[T.label]), F = kt(T.label, v); + for (let [N, C] of Object.entries(x)) + O.push({ label: N, value: 0 }); + x = g[v - 1].tally; + for (let N of O) { + const C = Number(x[N.label]), F = It(N.label, v); F > 0 ? (R.push({ - label: T.label + y, + label: N.label + m, value: F - }), T.value = C - F, R.push(T)) : (T.value = C, R.push(T)); + }), N.value = C - F, R.push(N)) : (N.value = C, R.push(N)); } - const k = Xn(n(), v); + const k = Un(n(), v); return R.push({ label: "exhausted", value: k }), R; } - function ue() { - const v = st(g(H)).select("defs").select("#cross-hatch"); - let m = 0; + function fe() { + const v = st(_(q)).select("defs").select("#cross-hatch"); + let g = 0; for (let [x, O] of Object.entries(n().results[0].tally)) { - m < 10 ? he[x] = Bf[m] : he[x] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), m++; + g < 10 ? de[x] = Hf[g] : de[x] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), g++; { const R = v.clone(!0); - R.attr("id", x.replaceAll(" ", "-")).select("rect").attr("fill", he[x]), R.select("path").attr("stroke", "#505050"); + R.attr("id", x.replaceAll(" ", "-")).select("rect").attr("fill", de[x]), R.select("path").attr("stroke", "#505050"); } } - he.exhausted = $, he["Inactive Ballots"] = $; + de.exhausted = E, de["Inactive Ballots"] = E; } - function ht() { - st(g(H)).select("#" + _).remove(); + function Ft() { + st(_(q)).select("#" + d).remove(); } - function Gt(v) { - const m = bn("global").duration(P); - v && m.on("end", v), ht(), an(r() - 1), ta(), na(0, ft()), ei(); + function jt(v) { + const g = $n("global").duration(S); + v && g.on("end", v), Ft(), sn(r() - 1), Zs(), ta(0, M()), ei(); } - function w(v) { - const m = bn("global").duration(P); - v && m.on("end", v), Gs(r() - 1); + function rt(v) { + const g = $n("global").duration(S); + v && g.on("end", v), an(r() - 1); } - function D(v) { - const m = bn("global").duration(P); - v && m.on("end", v), sn(r()), ve(ft()); + function $t(v) { + const g = $n("global").duration(S); + v && g.on("end", v), Le(r()), Ae(M()); } - function z() { - Y = !1; + function gt() { + y = !1; } - let Y = !1; - function tt() { - if (Y) { + let y = !1; + function L() { + if (y) { console.warn("buttons locked out"); return; } - Y = !0, et(); - } - function et() { - mi(r); - const v = r() < n().results.length - 1 ? et : z; - Gt(() => { - w(() => { - D(v); + y = !0, j(); + } + function j() { + J(K, 0), B = mi(r); + const v = r() < n().results.length - 1 ? j : gt; + jt(() => { + rt(() => { + $t(v); }); }); } - Pn(() => { - $t(); + Dn(() => { + it(); }); - let it = 0; - function $t() { - it !== r() && (it === r() - 1 && it > 0 ? $e() : qe(r()), it = r()); + let B = 0; + function it() { + console.log(`previous round was ${B}, currentRound is ${r()}`), B != r() && (B == r() - 1 && B > 0 ? ut() : et(r()), B = r()); } - function qe(v) { - if (Y) { + function et(v) { + if (console.log("setRoundFn called"), y) { console.warn("buttons locked out"); return; } - r(v), q(r()); + console.log("past button lockout"), r(v), tt(r()); } - function $e() { - if (Y) { + function ut() { + if (console.log("animateOneRoundFn called"), y) { console.warn("buttons locked out"); return; } - if (r() >= n().results.length) { - Y = !1; + if (console.log("past button lockout"), r() >= n().results.length) { + y = !1; return; } - Y = !0, Gt(() => { - w(() => { - D(z); + y = !0, _(K) === 0 ? jt(() => { + rt(() => { + $t(gt); }); - }); + }) : _(K) === 1 ? rt(() => { + $t(gt); + }) : _(K) === 2 && $t(gt); } - function rn() { - if (r() >= n().results.length) { + function At() { + if (console.log(`animateOnePhaseFn called, currentRound = ${r()}, displayPhase = ${_(K)}`), r() >= n().results.length) { ei(); return; } - j(K, (g(K) + 1) % 3), Y = !0, g(K) === 1 ? (mi(r), Gt(z)) : g(K) === 2 ? w(z) : g(K) === 0 ? D(z) : (Y = !1, console.warn("displayPhase out of range at ", g(K))); + J(K, (_(K) + 1) % 3), y = !0, _(K) === 1 ? (B = mi(r), jt(gt)) : _(K) === 2 ? rt(gt) : _(K) === 0 ? $t(gt) : (y = !1, console.warn("displayPhase out of range at ", _(K))); } - function sn(v) { - rt = oe(v), B = ra(v, p, rt, 0, ft(), !0); + function Le(v) { + Y = Kt(v), P = ea(v, c, Y, 0, M(), !0); } - function ve(v, m) { - dr().sort(null).value((C) => C.value); - const x = st(g(H)).select("#" + _), O = jt().outerRadius(v).innerRadius(v - 1), R = x.selectAll(".slice"); + function Ae(v, g) { + vr().sort(null).value((C) => C.value); + const x = st(_(q)).select("#" + d), O = Jt().outerRadius(v).innerRadius(v - 1), R = x.selectAll(".slice"); let k = R.size(); - function T() { - k--, k === 0 && ea(); + function N() { + k--, k === 0 && Qs(); } - R.select("path").transition("global").duration(S).attr("d", (C) => O(C)).on("end", (C) => T()); + R.select("path").transition("global").duration(b).attr("d", (C) => O(C)).on("end", (C) => N()); } - function an(v) { - const m = js(v, B); - W = ni(v, _, m, c, d, ft(), Tt(), !1, !0); + function sn(v) { + const g = Gs(v, P); + D = ni(v, d, g, u, h, M(), _t(), !1, !0); } - function Gs(v) { - const m = Js(v, W, B); - W = ri( + function an(v) { + const g = js(v, D, P); + D = ri( v, - _, - m, + d, + g, /* previousDonutInfoGlobal, */ - ft(), - Tt(), + M(), + _t(), !1 ); } - function ln(v) { - const m = v.data.label; - return he[m.split("#")[0]]; + function qt(v) { + const g = v.data.label; + return de[g.split("#")[0]]; } - function Ks(v) { - const m = {}, x = n().results[v - 1].tallyResults; + function ln(v) { + const g = {}, x = n().results[v - 1].tallyResults; for (let O = 0; O < x.length; O++) { let R = x[O].eliminated; if (R === void 0 && (R = x[O].elected), R === void 0) { @@ -3935,16 +3942,17 @@ function Us(t, e) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [T, C] of Object.entries(k)) - m[T] === void 0 ? m[T] = Number(C) : m[T] += Number(C); + for (let [N, C] of Object.entries(k)) + g[N] === void 0 ? g[N] = Number(C) : g[N] += Number(C); } - return m; + return g; } - function js(v, m) { - const x = [], O = Q, R = n().results[v - 1].tallyResults; + function Gs(v, g) { + console.log(`makeDonutInfo: round = ${v}`); + const x = [], O = G, R = n().results[v - 1].tallyResults; for (let k = 0; k < R.length; k++) { - let T = R[k].eliminated; - if (T === void 0 && (T = R[k].elected), T === void 0) { + let N = R[k].eliminated; + if (N === void 0 && (N = R[k].elected), N === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } @@ -3953,22 +3961,22 @@ function Us(t, e) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let F = m.find((I) => I.data.label == T + y); - F === void 0 && (F = m.find((I) => I.data.label == T)); - let L = 0; - if (F) L = F.startAngle; + let F = g.find((I) => I.data.label == N + m); + F === void 0 && (F = g.find((I) => I.data.label == N)); + let V = 0; + if (F) V = F.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [I, V] of Object.entries(C)) { - let J; - const qt = m.find((nt) => nt.data.label == I); - if (qt) - J = structuredClone(qt); + for (let [I, H] of Object.entries(C)) { + let W; + const Lt = g.find((Q) => Q.data.label == I); + if (Lt) + W = structuredClone(Lt); else if (I == "exhausted") - J = { - data: { label: I, value: Number(V) }, + W = { + data: { label: I, value: Number(H) }, value: 0, index: 0, startAngle: 0, @@ -3976,114 +3984,114 @@ function Us(t, e) { padAngle: 0 }; else if (I == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", V); + console.warn("makeDonutInfo: residual surplus = ", H); continue; } else { console.warn("makeDonutInfo: unrecognized name in transfers ", I); continue; } - const A = Number(V) / O * 2 * Math.PI; - J.startAngle = L, L = J.endAngle = L + A, J.index = k, J.data.label = `${J.data.label}#${k}`, x.push(J); + const A = Number(H) / O * 2 * Math.PI; + W.startAngle = V, V = W.endAngle = V + A, W.index = k, W.data.label = `${W.data.label}#${k}`, x.push(W); } } return x; } - function Ws(v, m, x) { + function Ks(v, g, x) { const O = {}; for (let [R, k] of Object.entries(v)) { - const T = x.find((L) => R == L.data.label); - if (T === void 0) { + const N = x.find((V) => R == V.data.label); + if (N === void 0) { console.warn("getTransferStartAngles: mainPieObj not found for ", R); continue; } - const C = (T.startAngle + T.endAngle) / 2, F = v[T.data.label] / m * 2 * Math.PI; - O[T.data.label] = C - F / 2; + const C = (N.startAngle + N.endAngle) / 2, F = v[N.data.label] / g * 2 * Math.PI; + O[N.data.label] = C - F / 2; } return O; } - function Js(v, m, x) { - const O = [], R = Q, k = Ks(v), T = Ws(k, R, x); - for (let [C, F] of m.entries()) { - const L = structuredClone(F), I = F.endAngle - F.startAngle, V = x.find((J) => F.data.label.indexOf(J.data.label) === 0); - if (V) { - const J = V.data.label; - L.startAngle = T[J], T[J] += I, L.endAngle = L.startAngle + I; + function js(v, g, x) { + const O = [], R = G, k = ln(v), N = Ks(k, R, x); + for (let [C, F] of g.entries()) { + const V = structuredClone(F), I = F.endAngle - F.startAngle, H = x.find((W) => F.data.label.indexOf(W.data.label) === 0); + if (H) { + const W = H.data.label; + V.startAngle = N[W], N[W] += I, V.endAngle = V.startAngle + I; } else if (F.data.label.indexOf("exhausted") === 0) - L.startAngle = F.startAngle, L.endAngle = F.endAngle; + V.startAngle = F.startAngle, V.endAngle = F.endAngle; else { console.warn("updateDonutInfo: unrecognized slice name ", F.data.label); continue; } - L.index = C, O.push(L); + V.index = C, O.push(V); } return O; } - function ti(v, m, x, O, R, k) { - const C = st(g(H)).append("g").attr("id", b).attr("transform", `translate(${x}, ${O})`), F = jt().innerRadius(R * E).outerRadius(R * E); - C.selectAll("text").data(m).enter().each(function(L) { - L.endAngle - L.startAngle < M || L.data.label.includes(y) || st(this).append("g").attr("id", (I) => I.data.label).classed("eliminated", (I) => k.includes(I.data.label.split("#")[0]) || I.data.label.includes(y)).each(function(I, V) { - I.data.label === "exhausted" && st(this).on("mouseenter", (J, qt) => ia(J)).on("mouseleave", (J, qt) => sa()); - }).append("text").attr("transform", (I) => `translate(${F.centroid(I)})`).attr("text-anchor", (I) => nr(I.startAngle, I.endAngle)).text((I) => I.data.label === "exhausted" ? kr : I.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((I) => Ft(I.data.label, v) + " (" + ae(I.data.label, v) + ")"); + function ti(v, g, x, O, R, k) { + const C = st(_(q)).append("g").attr("id", p).attr("transform", `translate(${x}, ${O})`), F = Jt().innerRadius(R * w).outerRadius(R * w); + C.selectAll("text").data(g).enter().each(function(V) { + V.endAngle - V.startAngle < $ || V.data.label.includes(m) || st(this).append("g").attr("id", (I) => I.data.label).classed("eliminated", (I) => k.includes(I.data.label.split("#")[0]) || I.data.label.includes(m)).each(function(I, H) { + I.data.label === "exhausted" && st(this).on("mouseenter", (W, Lt) => na(W)).on("mouseleave", (W, Lt) => ra()); + }).append("text").attr("transform", (I) => `translate(${F.centroid(I)})`).attr("text-anchor", (I) => rr(I.startAngle, I.endAngle)).text((I) => I.data.label === "exhausted" ? kr : I.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((I) => Pt(I.data.label, v) + " (" + Dt(I.data.label, v) + ")"); }); } - function Zs(v, m, x, O) { - const k = st(g(H)).select("#" + b), T = k.selectAll("tspan"), C = k.selectAll("g").data(m, (V) => V.data.label).classed("eliminated", (V) => O.includes(V.data.label.split("#")[0]) || V.data.label.includes(y)), F = jt().innerRadius(x * E).outerRadius(x * E + 1); - T.transition("global").duration(S).attr("transform", (V) => `translate(${F.centroid(V)})`).attr("text-anchor", (V) => nr(V.startAngle, V.endAngle)), C.select("text").transition("global").duration(S).attr("transform", (V) => `translate(${F.centroid(V)})`).attr("text-anchor", (V) => nr(V.startAngle, V.endAngle)).on("end", (V) => I()); - let L = C.size(); - function I(V) { - L--, L === 0 && (k.remove(), ti(v, m, c, d, x, O)); + function Ws(v, g, x, O) { + const k = st(_(q)).select("#" + p), N = k.selectAll("tspan"), C = k.selectAll("g").data(g, (H) => H.data.label).classed("eliminated", (H) => O.includes(H.data.label.split("#")[0]) || H.data.label.includes(m)), F = Jt().innerRadius(x * w).outerRadius(x * w + 1); + N.transition("global").duration(b).attr("transform", (H) => `translate(${F.centroid(H)})`).attr("text-anchor", (H) => rr(H.startAngle, H.endAngle)), C.select("text").transition("global").duration(b).attr("transform", (H) => `translate(${F.centroid(H)})`).attr("text-anchor", (H) => rr(H.startAngle, H.endAngle)).on("end", (H) => I()); + let V = C.size(); + function I(H) { + V--, V === 0 && (k.remove(), ti(v, g, u, h, x, O)); } } - function Qs(v, m, x, O, R, k, T, C = !0, F = !1) { - const I = dr().sort(null).value((V) => V.value)(x); - return ni(v, m, I, O, R, k, T, C, F), I; + function Js(v, g, x, O, R, k, N, C = !0, F = !1) { + const I = vr().sort(null).value((H) => H.value)(x); + return ni(v, g, I, O, R, k, N, C, F), I; } function ei() { - st(g(H)).select("#" + p).selectAll(".elected").style("stroke", "darkblue").style("stroke-width", "2px"); + st(_(q)).select("#" + c).selectAll(".elected").style("stroke", "darkblue").style("stroke-width", "2px"); } - function ni(v, m, x, O, R, k, T, C, F) { - const L = Un(n(), v), I = Gn(n(), v), qt = st(g(H)).attr("width", "100%").attr("height", u).attr("viewBox", `0 0 ${f} ${u}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", m).attr("transform", `translate(${O}, ${R})`).selectAll(".slice").data(x).enter().append("g").attr("class", "slice").classed("eliminated", (A) => L.includes(A.data.label.split("#")[0]) || A.data.label.includes(y)).classed("elected", (A) => I.includes(A.data.label.split("#")[0]) && !A.data.label.includes(y)).attr("id", (A) => A.data.label).on("mouseenter", (A, nt) => ir(A, nt)).on("mouseleave", (A, nt) => sr(A, nt)), Le = jt().outerRadius(T).innerRadius(k); + function ni(v, g, x, O, R, k, N, C, F) { + const V = Gn(n(), v), I = Kn(n(), v), Lt = st(_(q)).attr("width", "100%").attr("height", o).attr("viewBox", `0 0 ${l} ${o}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", g).attr("transform", `translate(${O}, ${R})`).selectAll(".slice").data(x).enter().append("g").attr("class", "slice").classed("eliminated", (A) => V.includes(A.data.label.split("#")[0]) || A.data.label.includes(m)).classed("elected", (A) => I.includes(A.data.label.split("#")[0]) && !A.data.label.includes(m)).attr("id", (A) => A.data.label).on("mouseenter", (A, Q) => sr(A, Q)).on("mouseleave", (A, Q) => ar(A, Q)), Ve = Jt().outerRadius(N).innerRadius(k); if (F) { - const A = jt().outerRadius(k + 1).innerRadius(k); - qt.append("path").attr("d", A).transition("global").duration(S).attr("d", (nt) => Le(nt)).attr("fill", (nt) => ln(nt)).on("end", (nt) => rr()); + const A = Jt().outerRadius(k + 1).innerRadius(k); + Lt.append("path").attr("d", A).transition("global").duration(b).attr("d", (Q) => Ve(Q)).attr("fill", (Q) => qt(Q)).on("end", (Q) => ir()); } else - qt.append("path").attr("d", (A) => Le(A)).attr("fill", (A) => ln(A)), rr(); - return C && ti(v, x, O, R, T, L), x; + Lt.append("path").attr("d", (A) => Ve(A)).attr("fill", (A) => qt(A)), ir(); + return C && ti(v, x, O, R, N, V), x; } - function ta() { - const x = st(g(H)).select("#" + b).selectAll(".eliminated"); + function Zs() { + const x = st(_(q)).select("#" + p).selectAll(".eliminated"); x.size() > 0 && x.classed("finished", !0); } - function ea() { - const x = st(g(H)).select("#" + b).selectAll(".finished"); + function Qs() { + const x = st(_(q)).select("#" + p).selectAll(".finished"); x.size() > 0 && x.remove(); } - function na(v, m) { - const R = st(g(H)).select("#" + p).selectAll(".eliminated"), k = jt().innerRadius(v), T = jt().outerRadius(m); - R.classed("finished", !0).select("path").transition("global").duration(S).attrTween("d", function(C) { - const F = Re(m, v); - return function(L) { - return T.innerRadius(F(L)), T(C); + function ta(v, g) { + const R = st(_(q)).select("#" + c).selectAll(".eliminated"), k = Jt().innerRadius(v), N = Jt().outerRadius(g); + R.classed("finished", !0).select("path").transition("global").duration(b).attrTween("d", function(C) { + const F = Ne(g, v); + return function(V) { + return N.innerRadius(F(V)), N(C); }; - }).attr("fill", (C) => `url(#${C.data.label.split("#")[0].replaceAll(" ", "-")})`), R.clone(!0).classed("finished", !0).select("path").transition("global").duration(S).attrTween("d", function(C) { - const F = Re(m, v); - return function(L) { - return k.outerRadius(F(L)), k(C); + }).attr("fill", (C) => `url(#${C.data.label.split("#")[0].replaceAll(" ", "-")})`), R.clone(!0).classed("finished", !0).select("path").transition("global").duration(b).attrTween("d", function(C) { + const F = Ne(g, v); + return function(V) { + return k.outerRadius(F(V)), k(C); }; - }).attr("fill", (C) => ln(C)); + }).attr("fill", (C) => qt(C)); } - function nr(v, m) { - const x = (v + m) / 2; + function rr(v, g) { + const x = (v + g) / 2; return x > Math.PI * 11 / 6 || x < Math.PI * 1 / 6 || x > Math.PI * 5 / 6 && x < Math.PI * 7 / 6 ? "middle" : x < Math.PI ? "start" : "end"; } - function rr() { - st(g(H)).select("#" + b).raise().append("g").remove(); + function ir() { + st(_(q)).select("#" + p).raise().append("g").remove(); } - function ra(v, m, x, O, R, k) { - const C = dr().sort(null).value((F) => F.value)(x); + function ea(v, g, x, O, R, k) { + const C = vr().sort(null).value((F) => F.value)(x); return ri( v, - m, + g, C, /* previousPieInfo, */ O, @@ -4091,75 +4099,65 @@ function Us(t, e) { k ), C; } - function ri(v, m, x, O, R, k) { - const T = Un(n(), v), C = Gn(n(), v), F = jt().outerRadius(R).innerRadius(O).startAngle((A) => A.startAngle).endAngle((A) => A.endAngle), L = jt().outerRadius(R).innerRadius(O), V = st(g(H)).select("#" + m); - V.selectAll(".slice").attr("prevStart", (A) => A.startAngle).attr("prevEnd", (A) => A.endAngle); - const J = V.selectAll(".slice").data(x, (A) => A.data.label); - J.enter().append("g").attr("class", "slice").attr("id", (A) => A.data.label).classed("eliminated", !0).on("mouseenter", (A, nt) => ir(A, nt)).on("mouseleave", (A, nt) => sr(A, nt)).append("path").attr("d", (A) => L(A)).attr("fill", (A) => ln(A)), J.classed("eliminated", (A) => T.includes(A.data.label.split("#")[0])).classed("elected", (A) => C.includes(A.data.label.split("#")[0])).on("mouseenter", (A, nt) => ir(A, nt)).on("mouseleave", (A, nt) => sr(A, nt)); - let qt = J.size(); - function Le() { - qt--, qt <= 0 && (rr(), V.selectAll(".finished").remove()); + function ri(v, g, x, O, R, k) { + const N = Gn(n(), v), C = Kn(n(), v), F = Jt().outerRadius(R).innerRadius(O).startAngle((A) => A.startAngle).endAngle((A) => A.endAngle), V = Jt().outerRadius(R).innerRadius(O), H = st(_(q)).select("#" + g); + H.selectAll(".slice").attr("prevStart", (A) => A.startAngle).attr("prevEnd", (A) => A.endAngle); + const W = H.selectAll(".slice").data(x, (A) => A.data.label); + W.enter().append("g").attr("class", "slice").attr("id", (A) => A.data.label).classed("eliminated", !0).on("mouseenter", (A, Q) => sr(A, Q)).on("mouseleave", (A, Q) => ar(A, Q)).append("path").attr("d", (A) => V(A)).attr("fill", (A) => qt(A)), W.classed("eliminated", (A) => N.includes(A.data.label.split("#")[0])).classed("elected", (A) => C.includes(A.data.label.split("#")[0])).on("mouseenter", (A, Q) => sr(A, Q)).on("mouseleave", (A, Q) => ar(A, Q)); + let Lt = W.size(); + function Ve() { + Lt--, Lt <= 0 && (ir(), H.selectAll(".finished").remove()); } - return J.select("path").transition("global").duration(S).attrTween("d", function(A) { - const nt = Number(st(this.parentNode).attr("prevStart")), aa = Number(st(this.parentNode).attr("prevEnd")), la = Re(nt, A.startAngle), oa = Re(aa, A.endAngle); - return (si) => (F.startAngle(la(si)).endAngle(oa(si)), F(A)); - }).on("end", Le), k && Zs(v, x, R, T), x; + return W.select("path").transition("global").duration(b).attrTween("d", function(A) { + const Q = Number(st(this.parentNode).attr("prevStart")), ia = Number(st(this.parentNode).attr("prevEnd")), sa = Ne(Q, A.startAngle), aa = Ne(ia, A.endAngle); + return (si) => (F.startAngle(sa(si)).endAngle(aa(si)), F(A)); + }).on("end", Ve), k && Ws(v, x, R, N), x; } - function ir(v, m) { - s(m.data.label.split("#")[0]), i("enter"), a(v.clientY); + function sr(v, g) { + s(g.data.label.split("#")[0]), i("enter"), a(v.clientY); } - function sr(v, m) { - s(m.data.label.split("#")[0]), i("leave"); + function ar(v, g) { + s(g.data.label.split("#")[0]), i("leave"); } - function ia(v, m) { + function na(v, g) { i("show-exhausted"), a(v.clientY); } - function sa(v, m) { + function ra(v, g) { i("hide-exhausted"); } - var ii = nc(); - return yr(ii, (v) => j(H, v), () => g(H)), fe(t, ii), Ur({ + var ii = tc(); + return mn(ii, (v) => J(q, v), () => _(q)), ce(t, ii), Ur({ + runFullAnimationFn: L, + animateOnePhaseFn: At, get jsonData() { return n(); }, set jsonData(v) { - n(v), Mt(); + n(v), ee(); }, get currentRound() { return r(); }, set currentRound(v) { - r(v), Mt(); + r(v), ee(); }, get mouseEventType() { return i(); }, set mouseEventType(v) { - i(v), Mt(); + i(v), ee(); }, get mouseData() { return s(); }, set mouseData(v) { - s(v), Mt(); + s(v), ee(); }, get mouseY() { return a(); }, set mouseY(v) { - a(v), Mt(); - }, - get animateOnePhase() { - return l(); - }, - set animateOnePhase(v) { - l(v), Mt(); - }, - get runFullAnimation() { - return o(); - }, - set runFullAnimation(v) { - o(v), Mt(); + a(v), ee(); } }); } @@ -4170,15 +4168,13 @@ gs( currentRound: {}, mouseEventType: {}, mouseData: {}, - mouseY: {}, - animateOnePhase: {}, - runFullAnimation: {} + mouseY: {} }, [], - [], + ["runFullAnimationFn", "animateOnePhaseFn"], !0 ); -function ic(t) { +function nc(t) { const e = []; if (!t || typeof t != "object") return { valid: !1, errors: ["Input is not a valid object"] }; @@ -4230,8 +4226,8 @@ function ic(t) { errors: e }; } -var sc = /* @__PURE__ */ Ie("  ", 1), ac = /* @__PURE__ */ Ie("About to eliminate: ", 1), lc = /* @__PURE__ */ Ie("  ", 1), oc = /* @__PURE__ */ Ie("Elected: ", 1), uc = /* @__PURE__ */ Ie("
", 1), fc = /* @__PURE__ */ Ie('


these ballots have already been eliminated.
', 1); -const cc = { +var rc = /* @__PURE__ */ Fe("  ", 1), ic = /* @__PURE__ */ Fe("About to eliminate: ", 1), sc = /* @__PURE__ */ Fe("  ", 1), ac = /* @__PURE__ */ Fe("Elected: ", 1), lc = /* @__PURE__ */ Fe("
", 1), oc = /* @__PURE__ */ Fe('


these ballots have already been eliminated.
', 1); +const uc = { hash: "svelte-hac7qn", code: `.page-container.svelte-hac7qn {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-hac7qn {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-hac7qn {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:1.3rem;left:50%;transform:translate(-50%);font-weight:bold;opacity:0;}.tooltip.svelte-hac7qn h3:where(.svelte-hac7qn) {text-align:center;}.animation-button-container.svelte-hac7qn {display:flex;justify-content:center;gap:10px;margin-bottom:1rem;}.pie-chart-container.svelte-hac7qn { /* width: 65%; */width:90%;min-width:800px; /* Larger minimum size */flex-grow:0; /* Don't grow beyond specified width */margin:0 auto;margin-right:40px; /* Add extra space on right */}.visualizations-container.svelte-hac7qn {display:flex;justify-content:space-between;width:100%;padding:0 20px;gap:80px;} @@ -4266,202 +4262,195 @@ const cc = { @media (max-width: 1300px) {.visualizations-container.svelte-hac7qn {flex-direction:column;align-items:center;} }` }; -function hc(t, e) { - Xr(e, !0), ps(t, cc); +function fc(t, e) { + Xr(e, !0), ps(t, uc); const n = 0.85; - let r = Ht(e, "electionSummary", 7), i = Ht(e, "currentRound", 7), s = Ht(e, "onRoundChanged", 7, (w) => { + let r = ve(e, "electionSummary", 7), i = ve(e, "currentRound", 7), s = ve(e, "onRoundChanged", 7, (y) => { }); - Pn(() => { - s()(i()); + Dn(() => { + s() && s()(i()); }); - let a = Ct(null), l = Ct(null), o = Ct(""), f = Ct(lt([])), u = Ct(""), h = Ct(""), c = Ct(0), d = Ct(null), p = Ct(null), _ = /* @__PURE__ */ jn(() => b(r())); - function b(w) { - if (typeof w == "string") + let a = Zt(null), l = Zt(null), o = Zt(""), f = Zt(xt([])), u = Zt(""), h = Zt(""), c = Zt(0), d = /* @__PURE__ */ Wn(() => p(r())); + function p(y) { + if (typeof y == "string") try { - w = JSON.parse(w); - } catch (D) { - return console.error("Failed to parse JSON string:", D), {}; + y = JSON.parse(y); + } catch (L) { + return console.error("Failed to parse JSON string:", L), {}; } - return console.log("RCtabSummary object status: ", ic(w)), w || {}; + return console.log("RCtabSummary object status: ", nc(y)), y || {}; } - function y() { - switch (g(u)) { + function m() { + switch (_(u)) { case "enter": - ((w) => (j(f, lt(w[0])), j(o, lt(w[1]))))(E(g(h), i())), g(a) && (g(a).style.top = String(g(c) || 20) + "px", g(a).style.opacity = String(n)); + ((y) => (J(f, xt(y[0])), J(o, xt(y[1]))))(w(_(h), i())), _(a) && (_(a).style.top = String(_(c) || 20) + "px", _(a).style.opacity = String(n)); break; case "leave": - g(a) && (g(a).style.opacity = "0"), j(f, lt([])), j(o, ""); + _(a) && (_(a).style.opacity = "0"), J(f, xt([])), J(o, ""); break; case "show-exhausted": - g(l) && (g(l).style.top = String(g(c) || 20) + "px", g(l).style.opacity = String(n)); + _(l) && (_(l).style.top = String(_(c) || 20) + "px", _(l).style.opacity = String(n)); break; case "hide-exhausted": - g(l) && (g(l).style.opacity = "0"); + _(l) && (_(l).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", g(u)); + console.log("Unknown mouse event: ", _(u)); break; } } - Pn(() => y()); - function $(w, D) { - return w == 1 ? D ? "vote was" : "vote will be" : D ? "votes were" : "votes will be"; - } - function E(w, D) { - const z = [], Y = w === "exhausted" ? kr : w; - let tt; - w == "exhausted" ? tt = Xn(g(_), 1) : tt = g(_).results[0].tally[w], z.push(`${Y} started with ${tt} votes.`); - for (let et = 1; et <= D; et++) { - et === D && (w == "exhausted" ? tt = Xn(g(_), D) : tt = g(_).results[D - 1].tally[w], z.push(`${Y} has ${tt} votes at round ${D}.`)); - const it = g(_).results[et - 1].tallyResults; - for (let $t = 0; $t < it.length; $t++) { - const qe = it[$t].transfers, $e = it[$t].eliminated, rn = it[$t].elected; - if ($e) - $e === w && z.push(`${Y} will be eliminated on round ${et}.`); - else if (w === rn && (z.push(`${Y} was elected on round ${et}.`), qe)) - for (let [ve, an] of Object.entries(qe)) - z.push(`${an} ${$(Number(an), et < D)} transferred to ${ve} on round ${et}.`); - const sn = $e || rn; - if (sn) { - const ve = Number(qe[w]); - ve && z.push(`${ve} ${$(ve, et < D)} transferred from ${sn} on round ${et}.`); + Dn(() => m()); + function E(y, L) { + return y == 1 ? L ? "vote was" : "vote will be" : L ? "votes were" : "votes will be"; + } + function w(y, L) { + const j = [], B = y === "exhausted" ? kr : y; + let it; + y == "exhausted" ? it = Un(_(d), 1) : it = _(d).results[0].tally[y], j.push(`${B} started with ${it} votes.`); + for (let et = 1; et <= L; et++) { + et === L && (y == "exhausted" ? it = Un(_(d), L) : it = _(d).results[L - 1].tally[y], j.push(`${B} has ${it} votes at round ${L}.`)); + const ut = _(d).results[et - 1].tallyResults; + for (let At = 0; At < ut.length; At++) { + const Le = ut[At].transfers, Ae = ut[At].eliminated, sn = ut[At].elected; + if (Ae) + Ae === y && j.push(`${B} will be eliminated on round ${et}.`); + else if (y === sn && (j.push(`${B} was elected on round ${et}.`), Le)) + for (let [qt, ln] of Object.entries(Le)) + j.push(`${ln} ${E(Number(ln), et < L)} transferred to ${qt} on round ${et}.`); + const an = Ae || sn; + if (an) { + const qt = Number(Le[y]); + qt && j.push(`${qt} ${E(qt, et < L)} transferred from ${an} on round ${et}.`); } } } - return [z, Y]; - } - function M() { - let w = 0; - for (let D = 1; D <= g(_).results.length; D++) { - const z = g(_).results[D - 1].tallyResults; - for (let Y = 0; Y < z.length; Y++) - z[Y].elected && w++; + return [j, B]; + } + function $() { + let y = 0; + for (let L = 1; L <= _(d).results.length; L++) { + const j = _(d).results[L - 1].tallyResults; + for (let B = 0; B < j.length; B++) + j[B].elected && y++; } - return w; - } - var S = fc(), P = Ae(S), B = wt(P); - B.__click = function(...w) { - var D; - (D = g(p)) == null || D.apply(this, w); - }; - var W = Lt(B, 2); - W.__click = function(...w) { - var D; - (D = g(d)) == null || D.apply(this, w); - }, yt(P); - var rt = Lt(P, 2), Q = wt(rt), K = wt(Q), H = wt(K); - yt(K); - var N = Lt(K, 2), q = wt(N); + return y; + } + let b; + function S() { + b && b.animateOnePhaseFn && b.animateOnePhaseFn(); + } + function P() { + b && b.runFullAnimationFn && b.runFullAnimationFn(); + } + var D = oc(), Y = Ee(D), G = yt(Y); + G.__click = P; + var K = Vt(G, 2); + K.__click = S, mt(Y); + var q = Vt(Y, 2), nt = yt(q), tt = yt(nt), T = yt(tt); + mt(tt); + var M = Vt(tt, 2), _t = yt(M); { - var Nt = (w) => { - var D = ac(), z = Lt(Ae(D)); - ur(z, 17, () => Un(g(_), i()), or, (Y, tt) => { - var et = sc(), it = Ae(et), $t = wt(it, !0); - yt(it), on(), un(() => { - _i(it, "color", he[g(tt)]), Ve($t, g(tt)); - }), fe(Y, et); - }), fe(w, D); + var Gt = (y) => { + var L = ic(), j = Vt(Ee(L)); + fr(j, 17, () => Gn(_(d), i()), ur, (B, it) => { + var et = rc(), ut = Ee(et), At = yt(ut, !0); + mt(ut), on(), un(() => { + _i(ut, "color", de[_(it)]), He(At, _(it)); + }), ce(B, et); + }), ce(y, L); }; - vi(q, (w) => { - Un(g(_), i()).length > 0 && w(Nt); + vi(_t, (y) => { + Gn(_(d), i()).length > 0 && y(Gt); }); } - var ft = Lt(q, 2); + var Pt = Vt(_t, 2); { - var Tt = (w) => { - var D = oc(), z = Lt(Ae(D)); - ur(z, 17, () => Gn(g(_), i()), or, (Y, tt) => { - var et = lc(), it = Ae(et), $t = wt(it, !0); - yt(it), on(), un(() => { - _i(it, "color", he[g(tt)]), Ve($t, g(tt)); - }), fe(Y, et); - }), fe(w, D); + var Dt = (y) => { + var L = ac(), j = Vt(Ee(L)); + fr(j, 17, () => Kn(_(d), i()), ur, (B, it) => { + var et = sc(), ut = Ee(et), At = yt(ut, !0); + mt(ut), on(), un(() => { + _i(ut, "color", de[_(it)]), He(At, _(it)); + }), ce(B, et); + }), ce(y, L); }; - vi(ft, (w) => { - Gn(g(_), i()).length > 0 && w(Tt); + vi(Pt, (y) => { + Kn(_(d), i()).length > 0 && y(Dt); }); } - yt(N), yt(Q); - var ct = Lt(Q, 2), Ft = wt(ct), ae = wt(Ft, !0); - yt(Ft); - var le = Lt(Ft, 2); - ur(le, 17, () => g(f), or, (w, D) => { - var z = uc(), Y = Ae(z), tt = wt(Y, !0); - yt(Y), on(2), un(() => Ve(tt, g(D))), fe(w, z); - }), yt(ct), yr(ct, (w) => j(a, w), () => g(a)); - var kt = Lt(ct, 2), oe = wt(kt); - oe.nodeValue = `"${kr}" means all the candidates ranked on `, on(2), yt(kt), yr(kt, (w) => j(l, w), () => g(l)); - var ue = Lt(kt, 2), ht = wt(ue), Gt = wt(ht); - return Us(Gt, { - get jsonData() { - return g(_); - }, - get currentRound() { - return i(); - }, - set currentRound(w) { - i(w); - }, - get mouseEventType() { - return g(u); - }, - set mouseEventType(w) { - j(u, lt(w)); - }, - get mouseData() { - return g(h); - }, - set mouseData(w) { - j(h, lt(w)); - }, - get mouseY() { - return g(c); - }, - set mouseY(w) { - j(c, lt(w)); - }, - get animateOnePhase() { - return g(d); - }, - set animateOnePhase(w) { - j(d, lt(w)); - }, - get runFullAnimation() { - return g(p); - }, - set runFullAnimation(w) { - j(p, lt(w)); - } - }), yt(ht), yt(ue), yt(rt), un( - (w) => { - Ve(H, `${g(_).config.contest ?? ""}, ${w ?? ""} to be elected, Round ${i() ?? ""}.`), Ve(ae, g(o)); + mt(M), mt(nt); + var Tt = Vt(nt, 2), It = yt(Tt), Kt = yt(It, !0); + mt(It); + var fe = Vt(It, 2); + fr(fe, 17, () => _(f), ur, (y, L) => { + var j = lc(), B = Ee(j), it = yt(B, !0); + mt(B), on(2), un(() => He(it, _(L))), ce(y, j); + }), mt(Tt), mn(Tt, (y) => J(a, y), () => _(a)); + var Ft = Vt(Tt, 2), jt = yt(Ft); + jt.nodeValue = `"${kr}" means all the candidates ranked on `, on(2), mt(Ft), mn(Ft, (y) => J(l, y), () => _(l)); + var rt = Vt(Ft, 2), $t = yt(rt), gt = yt($t); + return mn( + Us(gt, { + get jsonData() { + return _(d); + }, + get currentRound() { + return i(); + }, + set currentRound(y) { + i(y); + }, + get mouseEventType() { + return _(u); + }, + set mouseEventType(y) { + J(u, xt(y)); + }, + get mouseData() { + return _(h); + }, + set mouseData(y) { + J(h, xt(y)); + }, + get mouseY() { + return _(c); + }, + set mouseY(y) { + J(c, xt(y)); + } + }), + (y) => b = y, + () => b + ), mt($t), mt(rt), mt(q), un( + (y) => { + He(T, `${_(d).config.contest ?? ""}, ${y ?? ""} to be elected, Round ${i() ?? ""}.`), He(Kt, _(o)); }, - [M] - ), fe(t, S), Ur({ + [$] + ), ce(t, D), Ur({ get electionSummary() { return r(); }, - set electionSummary(w) { - r(w), Mt(); + set electionSummary(y) { + r(y), ee(); }, get currentRound() { return i(); }, - set currentRound(w) { - i(w), Mt(); + set currentRound(y) { + i(y), ee(); }, get onRoundChanged() { return s(); }, - set onRoundChanged(w = (D) => { + set onRoundChanged(y = (L) => { }) { - s(w), Mt(); + s(y), ee(); } }); } -al(["click"]); +il(["click"]); customElements.define("pie-chart", gs( - hc, + fc, { electionSummary: {}, currentRound: {}, diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 63e42253..f4d3bec1 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -1,50 +1,42 @@ {% load static %} {% load compress %} - {% compress js file %} {% endcompress %} - From d63da066acbd5a74e0d2d62cd371a758c99135bf Mon Sep 17 00:00:00 2001 From: skaphan Date: Sun, 16 Mar 2025 21:30:26 -0700 Subject: [PATCH 10/18] deleted comment that's no longer true --- templates/pie/pie-nonblocking.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index f4d3bec1..e76dbbe9 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -28,9 +28,6 @@ timeBetweenStepsMs: 3000 }); - - - // Create a callback which simulates a click on the hidden slider function updatePieChartRound(roundNum) { pieChart.setAttribute("currentRound", roundNum+1); } From 6bdf6637fadf4a594a795fef8b95fc70f6cf0909 Mon Sep 17 00:00:00 2001 From: skaphan Date: Mon, 17 Mar 2025 09:48:12 -0700 Subject: [PATCH 11/18] It helps to bind the callback in the correct way... getting closer! --- static/pie/pie-chart.es.js | 3189 ++++++++++++++-------------- templates/pie/pie-nonblocking.html | 8 +- 2 files changed, 1605 insertions(+), 1592 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 3da1c870..224f6106 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,131 +1,131 @@ -var la = Object.defineProperty; -var ai = (t) => { +var ua = Object.defineProperty; +var oi = (t) => { throw TypeError(t); }; -var oa = (t, e, n) => e in t ? la(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var kt = (t, e, n) => oa(t, typeof e != "symbol" ? e + "" : e, n), li = (t, e, n) => e.has(t) || ai("Cannot " + n); -var ft = (t, e, n) => (li(t, e, "read from private field"), n ? n.call(t) : e.get(t)), lr = (t, e, n) => e.has(t) ? ai("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), or = (t, e, n, r) => (li(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); -const ua = "5"; -typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ua); -const fa = 1, ca = 2, ha = 16, da = 1, va = 4, pa = 8, _a = 16, ga = 2, Ii = "[", Sr = "[!", Cr = "]", Ue = {}, ct = Symbol(), oi = !1, Mt = 2, Fi = 4, Mr = 8, Or = 16, le = 32, Pe = 64, En = 128, Nt = 256, Rn = 512, pt = 1024, oe = 2048, De = 4096, re = 8192, jn = 16384, ma = 32768, Pr = 65536, ya = 1 << 19, qi = 1 << 20, Ge = Symbol("$state"), Li = Symbol("legacy props"); -var Dr = Array.isArray, wa = Array.prototype.indexOf, Ir = Array.from, Nn = Object.keys, Tn = Object.defineProperty, ye = Object.getOwnPropertyDescriptor, xa = Object.prototype, ba = Array.prototype, $a = Object.getPrototypeOf; -function Vi(t) { +var fa = (t, e, n) => e in t ? ua(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var kt = (t, e, n) => fa(t, typeof e != "symbol" ? e + "" : e, n), ui = (t, e, n) => e.has(t) || oi("Cannot " + n); +var ft = (t, e, n) => (ui(t, e, "read from private field"), n ? n.call(t) : e.get(t)), or = (t, e, n) => e.has(t) ? oi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), ur = (t, e, n, r) => (ui(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); +const ca = "5"; +typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ca); +const ha = 1, da = 2, va = 16, pa = 1, _a = 4, ga = 8, ma = 16, ya = 2, Fi = "[", Sr = "[!", Mr = "]", Ge = {}, ct = Symbol(), fi = !1, Ot = 2, qi = 4, Or = 8, Pr = 16, ae = 32, De = 64, Nn = 128, Rt = 256, Tn = 512, pt = 1024, le = 2048, Ie = 4096, ne = 8192, Wn = 16384, wa = 32768, Dr = 65536, xa = 1 << 19, Li = 1 << 20, Ke = Symbol("$state"), Vi = Symbol("legacy props"); +var Ir = Array.isArray, ba = Array.prototype.indexOf, Fr = Array.from, Cn = Object.keys, kn = Object.defineProperty, we = Object.getOwnPropertyDescriptor, $a = Object.prototype, Aa = Array.prototype, Ea = Object.getPrototypeOf; +function Hi(t) { for (var e = 0; e < t.length; e++) t[e](); } -let je = [], pr = []; -function Hi() { - var t = je; - je = [], Vi(t); +let We = [], _r = []; +function Yi() { + var t = We; + We = [], Hi(t); } -function Aa() { - var t = pr; - pr = [], Vi(t); +function Ra() { + var t = _r; + _r = [], Hi(t); } -function Yi(t) { - je.length === 0 && queueMicrotask(Hi), je.push(t); +function Bi(t) { + We.length === 0 && queueMicrotask(Yi), We.push(t); } -function ui() { - je.length > 0 && Hi(), pr.length > 0 && Aa(); +function ci() { + We.length > 0 && Yi(), _r.length > 0 && Ra(); } -function Bi(t) { +function zi(t) { return t === this.v; } -function Ea(t, e) { +function Na(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function Fr(t) { - return !Ea(t, this.v); +function qr(t) { + return !Na(t, this.v); } -function Ra(t) { +function Ta(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function Na() { +function Ca() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function Ta(t) { +function ka(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function ka() { +function Sa() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Sa() { +function Ma() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function Ca(t) { +function Oa(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function Ma() { +function Pa() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Oa() { +function Da() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function Pa() { +function Ia() { throw new Error("https://svelte.dev/e/state_unsafe_local_read"); } -function Da() { +function Fa() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -let Ia = !1; -function Rt(t, e) { +let qa = !1; +function Et(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: t, reactions: null, - equals: Bi, + equals: zi, rv: 0, wv: 0 }; return n; } -function Zt(t) { - return /* @__PURE__ */ Fa(Rt(t)); +function Jt(t) { + return /* @__PURE__ */ La(Et(t)); } // @__NO_SIDE_EFFECTS__ -function qr(t, e = !1) { - const n = Rt(t); - return e || (n.equals = Fr), n; +function Lr(t, e = !1) { + const n = Et(t); + return e || (n.equals = qr), n; } // @__NO_SIDE_EFFECTS__ -function Fa(t) { - return X !== null && !St && X.f & Mt && (Bt === null ? Ha([t]) : Bt.push(t)), t; +function La(t) { + return U !== null && !St && U.f & Ot && (Bt === null ? Ba([t]) : Bt.push(t)), t; } function J(t, e) { - return X !== null && !St && us() && X.f & (Mt | Or) && // If the source was created locally within the current derived, then + return U !== null && !St && fs() && U.f & (Ot | Pr) && // If the source was created locally within the current derived, then // we allow the mutation. - (Bt === null || !Bt.includes(t)) && Da(), zi(t, e); -} -function zi(t, e) { - return t.equals(e) || (t.v, t.v = e, t.wv = Qi(), Xi(t, oe), U !== null && U.f & pt && !(U.f & (le | Pe)) && (Qt === null ? Ya([t]) : Qt.push(t))), e; + (Bt === null || !Bt.includes(t)) && Fa(), Xi(t, e); } function Xi(t, e) { + return t.equals(e) || (t.v, t.v = e, t.wv = ts(), Ui(t, le), G !== null && G.f & pt && !(G.f & (ae | De)) && (Zt === null ? za([t]) : Zt.push(t))), e; +} +function Ui(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; - a & oe || (ie(s, e), a & (pt | Nt) && (a & Mt ? Xi( + a & le || (re(s, e), a & (pt | Rt) && (a & Ot ? Ui( /** @type {Derived} */ s, - De - ) : Qn( + Ie + ) : tr( /** @type {Effect} */ s ))); } } // @__NO_SIDE_EFFECTS__ -function Wn(t) { - var e = Mt | oe, n = X !== null && X.f & Mt ? ( +function Jn(t) { + var e = Ot | le, n = U !== null && U.f & Ot ? ( /** @type {Derived} */ - X + U ) : null; - return U === null || n !== null && n.f & Nt ? e |= Nt : U.f |= qi, { + return G === null || n !== null && n.f & Rt ? e |= Rt : G.f |= Li, { ctx: vt, deps: null, effects: null, - equals: Bi, + equals: zi, f: e, fn: t, reactions: null, @@ -135,28 +135,28 @@ function Wn(t) { null ), wv: 0, - parent: n ?? U + parent: n ?? G }; } // @__NO_SIDE_EFFECTS__ -function qa(t) { - const e = /* @__PURE__ */ Wn(t); - return e.equals = Fr, e; +function Va(t) { + const e = /* @__PURE__ */ Jn(t); + return e.equals = qr, e; } -function Ui(t) { +function Gi(t) { var e = t.effects; if (e !== null) { t.effects = null; for (var n = 0; n < e.length; n += 1) - se( + ie( /** @type {Effect} */ e[n] ); } } -function La(t) { +function Ha(t) { for (var e = t.parent; e !== null; ) { - if (!(e.f & Mt)) + if (!(e.f & Ot)) return ( /** @type {Effect} */ e @@ -165,81 +165,81 @@ function La(t) { } return null; } -function Va(t) { - var e, n = U; - Ce(La(t)); +function Ya(t) { + var e, n = G; + Me(Ha(t)); try { - Ui(t), e = es(t); + Gi(t), e = ns(t); } finally { - Ce(n); + Me(n); } return e; } -function Gi(t) { - var e = Va(t), n = (pe || t.f & Nt) && t.deps !== null ? De : pt; - ie(t, n), t.equals(e) || (t.v = e, t.wv = Qi()); +function Ki(t) { + var e = Ya(t), n = (ve || t.f & Rt) && t.deps !== null ? Ie : pt; + re(t, n), t.equals(e) || (t.v = e, t.wv = ts()); } -function Lr(t) { +function Vr(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -let Z = !1; -function ne(t) { - Z = t; +let Q = !1; +function ee(t) { + Q = t; } -let z; +let X; function Xt(t) { if (t === null) - throw Lr(), Ue; - return z = t; + throw Vr(), Ge; + return X = t; } -function Jn() { +function Zn() { return Xt( /** @type {TemplateNode} */ - /* @__PURE__ */ ue(z) + /* @__PURE__ */ oe(X) ); } function mt(t) { - if (Z) { - if (/* @__PURE__ */ ue(z) !== null) - throw Lr(), Ue; - z = t; + if (Q) { + if (/* @__PURE__ */ oe(X) !== null) + throw Vr(), Ge; + X = t; } } -function on(t = 1) { - if (Z) { - for (var e = t, n = z; e--; ) +function fn(t = 1) { + if (Q) { + for (var e = t, n = X; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ ue(n); - z = n; + /* @__PURE__ */ oe(n); + X = n; } } -function _r() { - for (var t = 0, e = z; ; ) { +function gr() { + for (var t = 0, e = X; ; ) { if (e.nodeType === 8) { var n = ( /** @type {Comment} */ e.data ); - if (n === Cr) { + if (n === Mr) { if (t === 0) return e; t -= 1; - } else (n === Ii || n === Sr) && (t += 1); + } else (n === Fi || n === Sr) && (t += 1); } var r = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ue(e) + /* @__PURE__ */ oe(e) ); e.remove(), e = r; } } function xt(t, e = null, n) { - if (typeof t != "object" || t === null || Ge in t) + if (typeof t != "object" || t === null || Ke in t) return t; - const r = $a(t); - if (r !== xa && r !== ba) + const r = Ea(t); + if (r !== $a && r !== Aa) return t; - var i = /* @__PURE__ */ new Map(), s = Dr(t), a = Rt(0); - s && i.set("length", Rt( + var i = /* @__PURE__ */ new Map(), s = Ir(t), a = Et(0); + s && i.set("length", Et( /** @type {any[]} */ t.length )); @@ -249,14 +249,14 @@ function xt(t, e = null, n) { t, { defineProperty(o, f, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Ma(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Pa(); var h = i.get(f); - return h === void 0 ? (h = Rt(u.value), i.set(f, h)) : J(h, xt(u.value, l)), !0; + return h === void 0 ? (h = Et(u.value), i.set(f, h)) : J(h, xt(u.value, l)), !0; }, deleteProperty(o, f) { var u = i.get(f); if (u === void 0) - f in o && i.set(f, Rt(ct)); + f in o && i.set(f, Et(ct)); else { if (s && typeof f == "string") { var h = ( @@ -265,17 +265,17 @@ function xt(t, e = null, n) { ), c = Number(f); Number.isInteger(c) && c < h.v && J(h, c); } - J(u, ct), fi(a); + J(u, ct), hi(a); } return !0; }, get(o, f, u) { var p; - if (f === Ge) + if (f === Ke) return t; var h = i.get(f), c = f in o; - if (h === void 0 && (!c || (p = ye(o, f)) != null && p.writable) && (h = Rt(xt(c ? o[f] : ct, l)), i.set(f, h)), h !== void 0) { - var d = _(h); + if (h === void 0 && (!c || (p = we(o, f)) != null && p.writable) && (h = Et(xt(c ? o[f] : ct, l)), i.set(f, h)), h !== void 0) { + var d = g(h); return d === ct ? void 0 : d; } return Reflect.get(o, f, u); @@ -284,7 +284,7 @@ function xt(t, e = null, n) { var u = Reflect.getOwnPropertyDescriptor(o, f); if (u && "value" in u) { var h = i.get(f); - h && (u.value = _(h)); + h && (u.value = g(h)); } else if (u === void 0) { var c = i.get(f), d = c == null ? void 0 : c.v; if (c !== void 0 && d !== ct) @@ -299,29 +299,29 @@ function xt(t, e = null, n) { }, has(o, f) { var d; - if (f === Ge) + if (f === Ke) return !0; var u = i.get(f), h = u !== void 0 && u.v !== ct || Reflect.has(o, f); - if (u !== void 0 || U !== null && (!h || (d = ye(o, f)) != null && d.writable)) { - u === void 0 && (u = Rt(h ? xt(o[f], l) : ct), i.set(f, u)); - var c = _(u); + if (u !== void 0 || G !== null && (!h || (d = we(o, f)) != null && d.writable)) { + u === void 0 && (u = Et(h ? xt(o[f], l) : ct), i.set(f, u)); + var c = g(u); if (c === ct) return !1; } return h; }, set(o, f, u, h) { - var b; + var C; var c = i.get(f), d = f in o; if (s && f === "length") for (var p = u; p < /** @type {Source} */ c.v; p += 1) { var m = i.get(p + ""); - m !== void 0 ? J(m, ct) : p in o && (m = Rt(ct), i.set(p + "", m)); + m !== void 0 ? J(m, ct) : p in o && (m = Et(ct), i.set(p + "", m)); } - c === void 0 ? (!d || (b = ye(o, f)) != null && b.writable) && (c = Rt(void 0), J(c, xt(u, l)), i.set(f, c)) : (d = c.v !== ct, J(c, xt(u, l))); - var E = Reflect.getOwnPropertyDescriptor(o, f); - if (E != null && E.set && E.set.call(h, u), !d) { + c === void 0 ? (!d || (C = we(o, f)) != null && C.writable) && (c = Et(void 0), J(c, xt(u, l)), i.set(f, c)) : (d = c.v !== ct, J(c, xt(u, l))); + var b = Reflect.getOwnPropertyDescriptor(o, f); + if (b != null && b.set && b.set.call(h, u), !d) { if (s && typeof f == "string") { var w = ( /** @type {Source} */ @@ -329,12 +329,12 @@ function xt(t, e = null, n) { ), $ = Number(f); Number.isInteger($) && $ >= w.v && J(w, $ + 1); } - fi(a); + hi(a); } return !0; }, ownKeys(o) { - _(a); + g(a); var f = Reflect.ownKeys(o).filter((c) => { var d = i.get(c); return d === void 0 || d.v !== ct; @@ -344,113 +344,113 @@ function xt(t, e = null, n) { return f; }, setPrototypeOf() { - Oa(); + Da(); } } ); } -function fi(t, e = 1) { +function hi(t, e = 1) { J(t, t.v + e); } -var ci, Ki, ji, Wi; -function gr() { - if (ci === void 0) { - ci = window, Ki = /Firefox/.test(navigator.userAgent); +var di, ji, Wi, Ji; +function mr() { + if (di === void 0) { + di = window, ji = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype; - ji = ye(e, "firstChild").get, Wi = ye(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; + Wi = we(e, "firstChild").get, Ji = we(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; } } -function kn(t = "") { +function Sn(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function xe(t) { - return ji.call(t); +function be(t) { + return Wi.call(t); } // @__NO_SIDE_EFFECTS__ -function ue(t) { - return Wi.call(t); +function oe(t) { + return Ji.call(t); } function yt(t, e) { - if (!Z) - return /* @__PURE__ */ xe(t); + if (!Q) + return /* @__PURE__ */ be(t); var n = ( /** @type {TemplateNode} */ - /* @__PURE__ */ xe(z) + /* @__PURE__ */ be(X) ); if (n === null) - n = z.appendChild(kn()); + n = X.appendChild(Sn()); else if (e && n.nodeType !== 3) { - var r = kn(); + var r = Sn(); return n == null || n.before(r), Xt(r), r; } return Xt(n), n; } -function Ee(t, e) { - if (!Z) { +function Re(t, e) { + if (!Q) { var n = ( /** @type {DocumentFragment} */ - /* @__PURE__ */ xe( + /* @__PURE__ */ be( /** @type {Node} */ t ) ); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ue(n) : n; + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ oe(n) : n; } - return z; + return X; } -function Vt(t, e = 1, n = !1) { - let r = Z ? z : t; +function Lt(t, e = 1, n = !1) { + let r = Q ? X : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ ue(r); - if (!Z) + /* @__PURE__ */ oe(r); + if (!Q) return r; var s = r == null ? void 0 : r.nodeType; if (n && s !== 3) { - var a = kn(); + var a = Sn(); return r === null ? i == null || i.after(a) : r.before(a), Xt(a), a; } return Xt(r), /** @type {TemplateNode} */ r; } -function Ji(t) { +function Zi(t) { t.textContent = ""; } -let _n = !1, Sn = !1, Cn = null, gn = !1, Vr = !1; -function hi(t) { - Vr = t; +let mn = !1, Mn = !1, On = null, yn = !1, Hr = !1; +function vi(t) { + Hr = t; } -let Ke = []; -let X = null, St = !1; +let je = []; +let U = null, St = !1; function Se(t) { - X = t; -} -let U = null; -function Ce(t) { U = t; } +let G = null; +function Me(t) { + G = t; +} let Bt = null; -function Ha(t) { +function Ba(t) { Bt = t; } -let lt = null, wt = 0, Qt = null; -function Ya(t) { - Qt = t; +let lt = null, wt = 0, Zt = null; +function za(t) { + Zt = t; } -let Zi = 1, Mn = 0, pe = !1; -function Qi() { - return ++Zi; +let Qi = 1, Pn = 0, ve = !1; +function ts() { + return ++Qi; } -function nn(t) { +function rn(t) { var h; var e = t.f; - if (e & oe) + if (e & le) return !0; - if (e & De) { - var n = t.deps, r = (e & Nt) !== 0; + if (e & Ie) { + var n = t.deps, r = (e & Rt) !== 0; if (n !== null) { - var i, s, a = (e & Rn) !== 0, l = r && U !== null && !pe, o = n.length; + var i, s, a = (e & Tn) !== 0, l = r && G !== null && !ve, o = n.length; if (a || l) { var f = ( /** @type {Derived} */ @@ -458,71 +458,71 @@ function nn(t) { ), u = f.parent; for (i = 0; i < o; i++) s = n[i], (a || !((h = s == null ? void 0 : s.reactions) != null && h.includes(f))) && (s.reactions ?? (s.reactions = [])).push(f); - a && (f.f ^= Rn), l && u !== null && !(u.f & Nt) && (f.f ^= Nt); + a && (f.f ^= Tn), l && u !== null && !(u.f & Rt) && (f.f ^= Rt); } for (i = 0; i < o; i++) - if (s = n[i], nn( + if (s = n[i], rn( /** @type {Derived} */ s - ) && Gi( + ) && Ki( /** @type {Derived} */ s ), s.wv > t.wv) return !0; } - (!r || U !== null && !pe) && ie(t, pt); + (!r || G !== null && !ve) && re(t, pt); } return !1; } -function Ba(t, e) { +function Xa(t, e) { for (var n = e; n !== null; ) { - if (n.f & En) + if (n.f & Nn) try { n.fn(t); return; } catch { - n.f ^= En; + n.f ^= Nn; } n = n.parent; } - throw _n = !1, t; + throw mn = !1, t; } -function za(t) { - return (t.f & jn) === 0 && (t.parent === null || (t.parent.f & En) === 0); +function Ua(t) { + return (t.f & Wn) === 0 && (t.parent === null || (t.parent.f & Nn) === 0); } -function Zn(t, e, n, r) { - if (_n) { - if (n === null && (_n = !1), za(e)) +function Qn(t, e, n, r) { + if (mn) { + if (n === null && (mn = !1), Ua(e)) throw t; return; } - n !== null && (_n = !0); + n !== null && (mn = !0); { - Ba(t, e); + Xa(t, e); return; } } -function ts(t, e, n = !0) { +function es(t, e, n = !0) { var r = t.reactions; if (r !== null) for (var i = 0; i < r.length; i++) { var s = r[i]; - s.f & Mt ? ts( + s.f & Ot ? es( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? ie(s, oe) : s.f & pt && ie(s, De), Qn( + ) : e === s && (n ? re(s, le) : s.f & pt && re(s, Ie), tr( /** @type {Effect} */ s )); } } -function es(t) { +function ns(t) { var d; - var e = lt, n = wt, r = Qt, i = X, s = pe, a = Bt, l = vt, o = St, f = t.f; + var e = lt, n = wt, r = Zt, i = U, s = ve, a = Bt, l = vt, o = St, f = t.f; lt = /** @type {null | Value[]} */ - null, wt = 0, Qt = null, pe = (f & Nt) !== 0 && (St || !gn || X === null), X = f & (le | Pe) ? null : t, Bt = null, di(t.ctx), St = !1, Mn++; + null, wt = 0, Zt = null, ve = (f & Rt) !== 0 && (St || !yn || U === null), U = f & (ae | De) ? null : t, Bt = null, pi(t.ctx), St = !1, Pn++; try { var u = ( /** @type {Function} */ @@ -530,142 +530,142 @@ function es(t) { ), h = t.deps; if (lt !== null) { var c; - if (On(t, wt), h !== null && wt > 0) + if (Dn(t, wt), h !== null && wt > 0) for (h.length = wt + lt.length, c = 0; c < lt.length; c++) h[wt + c] = lt[c]; else t.deps = h = lt; - if (!pe) + if (!ve) for (c = wt; c < h.length; c++) ((d = h[c]).reactions ?? (d.reactions = [])).push(t); - } else h !== null && wt < h.length && (On(t, wt), h.length = wt); - if (us() && Qt !== null && !St && h !== null && !(t.f & (Mt | De | oe))) + } else h !== null && wt < h.length && (Dn(t, wt), h.length = wt); + if (fs() && Zt !== null && !St && h !== null && !(t.f & (Ot | Ie | le))) for (c = 0; c < /** @type {Source[]} */ - Qt.length; c++) - ts( - Qt[c], + Zt.length; c++) + es( + Zt[c], /** @type {Effect} */ t ); - return i !== null && Mn++, u; + return i !== null && Pn++, u; } finally { - lt = e, wt = n, Qt = r, X = i, pe = s, Bt = a, di(l), St = o; + lt = e, wt = n, Zt = r, U = i, ve = s, Bt = a, pi(l), St = o; } } -function Xa(t, e) { +function Ga(t, e) { let n = e.reactions; if (n !== null) { - var r = wa.call(n, t); + var r = ba.call(n, t); if (r !== -1) { var i = n.length - 1; i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - n === null && e.f & Mt && // Destroying a child effect while updating a parent effect can cause a dependency to appear + n === null && e.f & Ot && // 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 - (lt === null || !lt.includes(e)) && (ie(e, De), e.f & (Nt | Rn) || (e.f ^= Rn), Ui( + (lt === null || !lt.includes(e)) && (re(e, Ie), e.f & (Rt | Tn) || (e.f ^= Tn), Gi( /** @type {Derived} **/ e - ), On( + ), Dn( /** @type {Derived} **/ e, 0 )); } -function On(t, e) { +function Dn(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - Xa(t, n[r]); + Ga(t, n[r]); } -function Hr(t) { +function Yr(t) { var e = t.f; - if (!(e & jn)) { - ie(t, pt); - var n = U, r = vt, i = gn; - U = t, gn = !0; + if (!(e & Wn)) { + re(t, pt); + var n = G, r = vt, i = yn; + G = t, yn = !0; try { - e & Or ? tl(t) : ss(t), is(t); - var s = es(t); - t.teardown = typeof s == "function" ? s : null, t.wv = Zi; + e & Pr ? nl(t) : as(t), ss(t); + var s = ns(t); + t.teardown = typeof s == "function" ? s : null, t.wv = Qi; var a = t.deps, l; - oi && Ia && t.f & oe; + fi && qa && t.f & le; } catch (o) { - Zn(o, t, n, r || t.ctx); + Qn(o, t, n, r || t.ctx); } finally { - gn = i, U = n; + yn = i, G = n; } } } -function Ua() { +function Ka() { try { - ka(); + Sa(); } catch (t) { - if (Cn !== null) - Zn(t, Cn, null); + if (On !== null) + Qn(t, On, null); else throw t; } } -function ns() { +function rs() { try { - for (var t = 0; Ke.length > 0; ) { - t++ > 1e3 && Ua(); - var e = Ke, n = e.length; - Ke = []; + for (var t = 0; je.length > 0; ) { + t++ > 1e3 && Ka(); + var e = je, n = e.length; + je = []; for (var r = 0; r < n; r++) { var i = e[r]; i.f & pt || (i.f ^= pt); - var s = Ka(i); - Ga(s); + var s = Wa(i); + ja(s); } } } finally { - Sn = !1, Cn = null; + Mn = !1, On = null; } } -function Ga(t) { +function ja(t) { var e = t.length; if (e !== 0) for (var n = 0; n < e; n++) { var r = t[n]; - if (!(r.f & (jn | re))) + if (!(r.f & (Wn | ne))) try { - nn(r) && (Hr(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? as(r) : r.fn = null)); + rn(r) && (Yr(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? ls(r) : r.fn = null)); } catch (i) { - Zn(i, r, null, r.ctx); + Qn(i, r, null, r.ctx); } } } -function Qn(t) { - Sn || (Sn = !0, queueMicrotask(ns)); - for (var e = Cn = t; e.parent !== null; ) { +function tr(t) { + Mn || (Mn = !0, queueMicrotask(rs)); + for (var e = On = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (n & (Pe | le)) { + if (n & (De | ae)) { if (!(n & pt)) return; e.f ^= pt; } } - Ke.push(e); + je.push(e); } -function Ka(t) { +function Wa(t) { for (var e = [], n = t.first; n !== null; ) { - var r = n.f, i = (r & le) !== 0, s = i && (r & pt) !== 0; - if (!s && !(r & re)) { - if (r & Fi) + var r = n.f, i = (r & ae) !== 0, s = i && (r & pt) !== 0; + if (!s && !(r & ne)) { + if (r & qi) e.push(n); else if (i) n.f ^= pt; else { - var a = X; + var a = U; try { - X = n, nn(n) && Hr(n); + U = n, rn(n) && Yr(n); } catch (f) { - Zn(f, n, null, n.ctx); + Qn(f, n, null, n.ctx); } finally { - X = a; + U = a; } } var l = n.first; @@ -680,21 +680,21 @@ function Ka(t) { } return e; } -function ee(t) { +function Ht(t) { var e; - for (ui(); Ke.length > 0; ) - Sn = !0, ns(), ui(); + for (ci(); je.length > 0; ) + Mn = !0, rs(), ci(); return ( /** @type {T} */ e ); } -function _(t) { - var e = t.f, n = (e & Mt) !== 0; - if (X !== null && !St) { - Bt !== null && Bt.includes(t) && Pa(); - var r = X.deps; - t.rv < Mn && (t.rv = Mn, lt === null && r !== null && r[wt] === t ? wt++ : lt === null ? lt = [t] : (!pe || !lt.includes(t)) && lt.push(t)); +function g(t) { + var e = t.f, n = (e & Ot) !== 0; + if (U !== null && !St) { + Bt !== null && Bt.includes(t) && Ia(); + var r = U.deps; + t.rv < Pn && (t.rv = Pn, lt === null && r !== null && r[wt] === t ? wt++ : lt === null ? lt = [t] : (!ve || !lt.includes(t)) && lt.push(t)); } else if (n && /** @type {Derived} */ t.deps === null && /** @type {Derived} */ t.effects === null) { @@ -702,12 +702,12 @@ function _(t) { /** @type {Derived} */ t ), s = i.parent; - s !== null && !(s.f & Nt) && (i.f ^= Nt); + s !== null && !(s.f & Rt) && (i.f ^= Rt); } return n && (i = /** @type {Derived} */ - t, nn(i) && Gi(i)), t.v; + t, rn(i) && Ki(i)), t.v; } -function Pn(t) { +function In(t) { var e = St; try { return St = !0, t(); @@ -715,24 +715,24 @@ function Pn(t) { St = e; } } -const ja = -7169; -function ie(t, e) { - t.f = t.f & ja | e; +const Ja = -7169; +function re(t, e) { + t.f = t.f & Ja | e; } -function Wa(t) { - U === null && X === null && Ta(), X !== null && X.f & Nt && U === null && Na(), Vr && Ra(); +function Za(t) { + G === null && U === null && ka(), U !== null && U.f & Rt && G === null && Ca(), Hr && Ta(); } -function Ja(t, e) { +function Qa(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function Ie(t, e, n, r = !0) { - var i = (t & Pe) !== 0, s = U, a = { +function Fe(t, e, n, r = !0) { + var i = (t & De) !== 0, s = G, a = { ctx: vt, deps: null, nodes_start: null, nodes_end: null, - f: t | oe, + f: t | le, first: null, fn: e, last: null, @@ -745,24 +745,24 @@ function Ie(t, e, n, r = !0) { }; if (n) try { - Hr(a), a.f |= ma; + Yr(a), a.f |= wa; } catch (f) { - throw se(a), f; + throw ie(a), f; } - else e !== null && Qn(a); - var l = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (qi | En)) === 0; - if (!l && !i && r && (s !== null && Ja(a, s), X !== null && X.f & Mt)) { + else e !== null && tr(a); + var l = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (Li | Nn)) === 0; + if (!l && !i && r && (s !== null && Qa(a, s), U !== null && U.f & Ot)) { var o = ( /** @type {Derived} */ - X + U ); (o.effects ?? (o.effects = [])).push(a); } return a; } -function Dn(t) { - Wa(); - var e = U !== null && (U.f & le) !== 0 && vt !== null && !vt.m; +function Br(t) { + Za(); + var e = G !== null && (G.f & ae) !== 0 && vt !== null && !vt.m; if (e) { var n = ( /** @type {ComponentContext} */ @@ -770,101 +770,101 @@ function Dn(t) { ); (n.e ?? (n.e = [])).push({ fn: t, - effect: U, - reaction: X + effect: G, + reaction: U }); } else { - var r = Yr(t); + var r = zr(t); return r; } } -function Za(t) { - const e = Ie(Pe, t, !0); +function tl(t) { + const e = Fe(De, t, !0); return () => { - se(e); + ie(e); }; } -function Qa(t) { - const e = Ie(Pe, t, !0); +function el(t) { + const e = Fe(De, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? In(e, () => { - se(e), r(void 0); - }) : (se(e), r(void 0)); + n.outro ? Fn(e, () => { + ie(e), r(void 0); + }) : (ie(e), r(void 0)); }); } -function Yr(t) { - return Ie(Fi, t, !1); +function zr(t) { + return Fe(qi, t, !1); } -function rs(t) { - return Ie(Mr, t, !0); +function is(t) { + return Fe(Or, t, !0); } -function un(t, e = [], n = Wn) { +function cn(t, e = [], n = Jn) { const r = e.map(n); - return Br(() => t(...r.map(_))); + return Xr(() => t(...r.map(g))); } -function Br(t, e = 0) { - return Ie(Mr | Or | e, t, !0); +function Xr(t, e = 0) { + return Fe(Or | Pr | e, t, !0); } -function We(t, e = !0) { - return Ie(Mr | le, t, !0, e); +function Je(t, e = !0) { + return Fe(Or | ae, t, !0, e); } -function is(t) { +function ss(t) { var e = t.teardown; if (e !== null) { - const n = Vr, r = X; - hi(!0), Se(null); + const n = Hr, r = U; + vi(!0), Se(null); try { e.call(null); } finally { - hi(n), Se(r); + vi(n), Se(r); } } } -function ss(t, e = !1) { +function as(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { var r = n.next; - se(n, e), n = r; + ie(n, e), n = r; } } -function tl(t) { +function nl(t) { for (var e = t.first; e !== null; ) { var n = e.next; - e.f & le || se(e), e = n; + e.f & ae || ie(e), e = n; } } -function se(t, e = !0) { +function ie(t, e = !0) { var n = !1; - if ((e || t.f & ya) && t.nodes_start !== null) { + if ((e || t.f & xa) && t.nodes_start !== null) { for (var r = t.nodes_start, i = t.nodes_end; r !== null; ) { var s = r === i ? null : ( /** @type {TemplateNode} */ - /* @__PURE__ */ ue(r) + /* @__PURE__ */ oe(r) ); r.remove(), r = s; } n = !0; } - ss(t, e && !n), On(t, 0), ie(t, jn); + as(t, e && !n), Dn(t, 0), re(t, Wn); var a = t.transitions; if (a !== null) for (const o of a) o.stop(); - is(t); + ss(t); var l = t.parent; - l !== null && l.first !== null && as(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = null; + l !== null && l.first !== null && ls(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = null; } -function as(t) { +function ls(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 In(t, e) { +function Fn(t, e) { var n = []; - zr(t, n, !0), ls(n, () => { - se(t), e && e(); + Ur(t, n, !0), os(n, () => { + ie(t), e && e(); }); } -function ls(t, e) { +function os(t, e) { var n = t.length; if (n > 0) { var r = () => --n || e(); @@ -873,40 +873,40 @@ function ls(t, e) { } else e(); } -function zr(t, e, n) { - if (!(t.f & re)) { - if (t.f ^= re, t.transitions !== null) +function Ur(t, e, n) { + if (!(t.f & ne)) { + if (t.f ^= ne, t.transitions !== null) for (const a of t.transitions) (a.is_global || n) && e.push(a); for (var r = t.first; r !== null; ) { - var i = r.next, s = (r.f & Pr) !== 0 || (r.f & le) !== 0; - zr(r, e, s ? n : !1), r = i; + var i = r.next, s = (r.f & Dr) !== 0 || (r.f & ae) !== 0; + Ur(r, e, s ? n : !1), r = i; } } } -function Fn(t) { - os(t, !0); +function qn(t) { + us(t, !0); } -function os(t, e) { - if (t.f & re) { - t.f ^= re, t.f & pt || (t.f ^= pt), nn(t) && (ie(t, oe), Qn(t)); +function us(t, e) { + if (t.f & ne) { + t.f ^= ne, t.f & pt || (t.f ^= pt), rn(t) && (re(t, le), tr(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & Pr) !== 0 || (n.f & le) !== 0; - os(n, i ? e : !1), n = r; + var r = n.next, i = (n.f & Dr) !== 0 || (n.f & ae) !== 0; + us(n, i ? e : !1), n = r; } if (t.transitions !== null) for (const s of t.transitions) (s.is_global || e) && s.in(); } } -function el(t) { +function rl(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } let vt = null; -function di(t) { +function pi(t) { vt = t; } -function Xr(t, e = !1, n) { +function Gr(t, e = !1, n) { vt = { p: vt, c: null, @@ -917,21 +917,21 @@ function Xr(t, e = !1, n) { l: null }; } -function Ur(t) { +function Kr(t) { const e = vt; if (e !== null) { t !== void 0 && (e.x = t); const a = e.e; if (a !== null) { - var n = U, r = X; + var n = G, r = U; e.e = null; try { for (var i = 0; i < a.length; i++) { var s = a[i]; - Ce(s.effect), Se(s.reaction), Yr(s.fn); + Me(s.effect), Se(s.reaction), zr(s.fn); } } finally { - Ce(n), Se(r); + Me(n), Se(r); } } vt = e.p, e.m = !0; @@ -939,21 +939,21 @@ function Ur(t) { return t || /** @type {T} */ {}; } -function us() { +function fs() { return !0; } -const nl = ["touchstart", "touchmove"]; -function rl(t) { - return nl.includes(t); +const il = ["touchstart", "touchmove"]; +function sl(t) { + return il.includes(t); } -const fs = /* @__PURE__ */ new Set(), mr = /* @__PURE__ */ new Set(); -function il(t) { +const cs = /* @__PURE__ */ new Set(), yr = /* @__PURE__ */ new Set(); +function al(t) { for (var e = 0; e < t.length; e++) - fs.add(t[e]); - for (var n of mr) + cs.add(t[e]); + for (var n of yr) n(t); } -function fn(t) { +function hn(t) { var $; var e = this, n = ( /** @type {Node} */ @@ -976,14 +976,14 @@ function fn(t) { } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - Tn(t, "currentTarget", { + kn(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var u = X, h = U; - Se(null), Ce(null); + var u = U, h = G; + Se(null), Me(null); try { for (var c, d = []; s !== null; ) { var p = s.assignedSlot || s.parentNode || /** @type {any} */ @@ -994,92 +994,92 @@ function fn(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)) - if (Dr(m)) { - var [E, ...w] = m; - E.apply(s, [t, ...w]); + if (Ir(m)) { + var [b, ...w] = m; + b.apply(s, [t, ...w]); } else m.call(s, t); - } catch (b) { - c ? d.push(b) : c = b; + } catch (C) { + c ? d.push(C) : c = C; } if (t.cancelBubble || p === e || p === null) break; s = p; } if (c) { - for (let b of d) + for (let C of d) queueMicrotask(() => { - throw b; + throw C; }); throw c; } } finally { - t.__root = e, delete t.currentTarget, Se(u), Ce(h); + t.__root = e, delete t.currentTarget, Se(u), Me(h); } } } -function cs(t) { +function hs(t) { var e = document.createElement("template"); return e.innerHTML = t, e.content; } -function Je(t, e) { +function Ze(t, e) { var n = ( /** @type {Effect} */ - U + G ); n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e); } // @__NO_SIDE_EFFECTS__ -function Fe(t, e) { - var n = (e & ga) !== 0, r, i = !t.startsWith(""); +function qe(t, e) { + var n = (e & ya) !== 0, r, i = !t.startsWith(""); return () => { - if (Z) - return Je(z, null), z; - r === void 0 && (r = cs(i ? t : "" + t)); + if (Q) + return Ze(X, null), X; + r === void 0 && (r = hs(i ? t : "" + t)); var s = ( /** @type {TemplateNode} */ - n || Ki ? document.importNode(r, !0) : r.cloneNode(!0) + n || ji ? document.importNode(r, !0) : r.cloneNode(!0) ); { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ xe(s) + /* @__PURE__ */ be(s) ), l = ( /** @type {TemplateNode} */ s.lastChild ); - Je(a, l); + Ze(a, l); } return s; }; } // @__NO_SIDE_EFFECTS__ -function sl(t, e, n = "svg") { +function ll(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { - if (Z) - return Je(z, null), z; + if (Q) + return Ze(X, null), X; if (!s) { var a = ( /** @type {DocumentFragment} */ - cs(i) + hs(i) ), l = ( /** @type {Element} */ - /* @__PURE__ */ xe(a) + /* @__PURE__ */ be(a) ); s = /** @type {Element} */ - /* @__PURE__ */ xe(l); + /* @__PURE__ */ be(l); } var o = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return Je(o, o), o; + return Ze(o, o), o; }; } function ce(t, e) { - if (Z) { - U.nodes_end = z, Jn(); + if (Q) { + G.nodes_end = X, Zn(); return; } t !== null && t.before( @@ -1087,127 +1087,127 @@ function ce(t, e) { e ); } -function He(t, e) { +function Ye(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 hs(t, e) { - return ds(t, e); +function ds(t, e) { + return vs(t, e); } -function al(t, e) { - gr(), e.intro = e.intro ?? !1; - const n = e.target, r = Z, i = z; +function ol(t, e) { + mr(), e.intro = e.intro ?? !1; + const n = e.target, r = Q, i = X; try { for (var s = ( /** @type {TemplateNode} */ - /* @__PURE__ */ xe(n) + /* @__PURE__ */ be(n) ); s && (s.nodeType !== 8 || /** @type {Comment} */ - s.data !== Ii); ) + s.data !== Fi); ) s = /** @type {TemplateNode} */ - /* @__PURE__ */ ue(s); + /* @__PURE__ */ oe(s); if (!s) - throw Ue; - ne(!0), Xt( + throw Ge; + ee(!0), Xt( /** @type {Comment} */ s - ), Jn(); - const a = ds(t, { ...e, anchor: s }); - if (z === null || z.nodeType !== 8 || /** @type {Comment} */ - z.data !== Cr) - throw Lr(), Ue; - return ne(!1), /** @type {Exports} */ + ), Zn(); + const a = vs(t, { ...e, anchor: s }); + if (X === null || X.nodeType !== 8 || /** @type {Comment} */ + X.data !== Mr) + throw Vr(), Ge; + return ee(!1), /** @type {Exports} */ a; } catch (a) { - if (a === Ue) - return e.recover === !1 && Sa(), gr(), Ji(n), ne(!1), hs(t, e); + if (a === Ge) + return e.recover === !1 && Ma(), mr(), Zi(n), ee(!1), ds(t, e); throw a; } finally { - ne(r), Xt(i); + ee(r), Xt(i); } } -const Re = /* @__PURE__ */ new Map(); -function ds(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - gr(); +const Ne = /* @__PURE__ */ new Map(); +function vs(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + mr(); var l = /* @__PURE__ */ new Set(), o = (h) => { for (var c = 0; c < h.length; c++) { var d = h[c]; if (!l.has(d)) { l.add(d); - var p = rl(d); - e.addEventListener(d, fn, { passive: p }); - var m = Re.get(d); - m === void 0 ? (document.addEventListener(d, fn, { passive: p }), Re.set(d, 1)) : Re.set(d, m + 1); + var p = sl(d); + e.addEventListener(d, hn, { passive: p }); + var m = Ne.get(d); + m === void 0 ? (document.addEventListener(d, hn, { passive: p }), Ne.set(d, 1)) : Ne.set(d, m + 1); } } }; - o(Ir(fs)), mr.add(o); - var f = void 0, u = Qa(() => { - var h = n ?? e.appendChild(kn()); - return We(() => { + o(Fr(cs)), yr.add(o); + var f = void 0, u = el(() => { + var h = n ?? e.appendChild(Sn()); + return Je(() => { if (s) { - Xr({}); + Gr({}); var c = ( /** @type {ComponentContext} */ vt ); c.c = s; } - i && (r.$$events = i), Z && Je( + i && (r.$$events = i), Q && Ze( /** @type {TemplateNode} */ h, null - ), f = t(h, r) || {}, Z && (U.nodes_end = z), s && Ur(); + ), f = t(h, r) || {}, Q && (G.nodes_end = X), s && Kr(); }), () => { var p; for (var c of l) { - e.removeEventListener(c, fn); + e.removeEventListener(c, hn); var d = ( /** @type {number} */ - Re.get(c) + Ne.get(c) ); - --d === 0 ? (document.removeEventListener(c, fn), Re.delete(c)) : Re.set(c, d); + --d === 0 ? (document.removeEventListener(c, hn), Ne.delete(c)) : Ne.set(c, d); } - mr.delete(o), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); + yr.delete(o), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); }; }); - return yr.set(f, u), f; + return wr.set(f, u), f; } -let yr = /* @__PURE__ */ new WeakMap(); -function ll(t, e) { - const n = yr.get(t); - return n ? (yr.delete(t), n(e)) : Promise.resolve(); +let wr = /* @__PURE__ */ new WeakMap(); +function ul(t, e) { + const n = wr.get(t); + return n ? (wr.delete(t), n(e)) : Promise.resolve(); } -function vi(t, e, n = !1) { - Z && Jn(); - var r = t, i = null, s = null, a = ct, l = n ? Pr : 0, o = !1; +function _i(t, e, n = !1) { + Q && Zn(); + var r = t, i = null, s = null, a = ct, l = n ? Dr : 0, o = !1; const f = (h, c = !0) => { o = !0, u(c, h); }, u = (h, c) => { if (a === (a = h)) return; let d = !1; - if (Z) { + if (Q) { const p = ( /** @type {Comment} */ r.data === Sr ); - !!a === p && (r = _r(), Xt(r), ne(!1), d = !0); + !!a === p && (r = gr(), Xt(r), ee(!1), d = !0); } - a ? (i ? Fn(i) : c && (i = We(() => c(r))), s && In(s, () => { + a ? (i ? qn(i) : c && (i = Je(() => c(r))), s && Fn(s, () => { s = null; - })) : (s ? Fn(s) : c && (s = We(() => c(r))), i && In(i, () => { + })) : (s ? qn(s) : c && (s = Je(() => c(r))), i && Fn(i, () => { i = null; - })), d && ne(!0); + })), d && ee(!0); }; - Br(() => { + Xr(() => { o = !1, e(f), o || u(null, null); - }, l), Z && (r = z); + }, l), Q && (r = X); } -function ur(t, e) { +function fr(t, e) { return e; } -function ol(t, e, n, r) { +function fl(t, e, n, r) { for (var i = [], s = e.length, a = 0; a < s; a++) - zr(e[a].e, i, !0); + Ur(e[a].e, i, !0); var l = s > 0 && i.length === 0 && n !== null; if (l) { var o = ( @@ -1215,106 +1215,106 @@ function ol(t, e, n, r) { /** @type {Element} */ n.parentNode ); - Ji(o), o.append( + Zi(o), o.append( /** @type {Element} */ n ), r.clear(), he(t, e[0].prev, e[s - 1].next); } - ls(i, () => { + os(i, () => { for (var f = 0; f < s; f++) { var u = e[f]; - l || (r.delete(u.k), he(t, u.prev, u.next)), se(u.e, !l); + l || (r.delete(u.k), he(t, u.prev, u.next)), ie(u.e, !l); } }); } -function fr(t, e, n, r, i, s = null) { +function cr(t, e, n, r, i, s = null) { var a = t, l = { items: /* @__PURE__ */ new Map(), first: null }; - Z && Jn(); - var o = null, f = !1, u = /* @__PURE__ */ qa(() => { + Q && Zn(); + var o = null, f = !1, u = /* @__PURE__ */ Va(() => { var h = n(); - return Dr(h) ? h : h == null ? [] : Ir(h); + return Ir(h) ? h : h == null ? [] : Fr(h); }); - Br(() => { - var h = _(u), c = h.length; + Xr(() => { + var h = g(u), c = h.length; if (f && c === 0) return; f = c === 0; let d = !1; - if (Z) { + if (Q) { var p = ( /** @type {Comment} */ a.data === Sr ); - p !== (c === 0) && (a = _r(), Xt(a), ne(!1), d = !0); + p !== (c === 0) && (a = gr(), Xt(a), ee(!1), d = !0); } - if (Z) { - for (var m = null, E, w = 0; w < c; w++) { - if (z.nodeType === 8 && /** @type {Comment} */ - z.data === Cr) { + if (Q) { + for (var m = null, b, w = 0; w < c; w++) { + if (X.nodeType === 8 && /** @type {Comment} */ + X.data === Mr) { a = /** @type {Comment} */ - z, d = !0, ne(!1); + X, d = !0, ee(!1); break; } - var $ = h[w], b = r($, w); - E = vs( - z, + var $ = h[w], C = r($, w); + b = ps( + X, l, m, null, $, - b, + C, w, i, e, n - ), l.items.set(b, E), m = E; + ), l.items.set(C, b), m = b; } - c > 0 && Xt(_r()); + c > 0 && Xt(gr()); } - Z || ul(h, l, a, i, e, r, n), s !== null && (c === 0 ? o ? Fn(o) : o = We(() => s(a)) : o !== null && In(o, () => { + Q || cl(h, l, a, i, e, r, n), s !== null && (c === 0 ? o ? qn(o) : o = Je(() => s(a)) : o !== null && Fn(o, () => { o = null; - })), d && ne(!0), _(u); - }), Z && (a = z); + })), d && ee(!0), g(u); + }), Q && (a = X); } -function ul(t, e, n, r, i, s, a) { - var l = t.length, o = e.items, f = e.first, u = f, h, c = null, d = [], p = [], m, E, w, $; +function cl(t, e, n, r, i, s, a) { + var l = t.length, o = e.items, f = e.first, u = f, h, c = null, d = [], p = [], m, b, w, $; for ($ = 0; $ < l; $ += 1) { - if (m = t[$], E = s(m, $), w = o.get(E), w === void 0) { - var b = u ? ( + if (m = t[$], b = s(m, $), w = o.get(b), w === void 0) { + var C = u ? ( /** @type {TemplateNode} */ u.e.nodes_start ) : n; - c = vs( - b, + c = ps( + C, e, c, c === null ? e.first : c.next, m, - E, + b, $, r, i, a - ), o.set(E, c), d = [], p = [], u = c.next; + ), o.set(b, c), d = [], p = [], u = c.next; continue; } - if (fl(w, m, $), w.e.f & re && Fn(w.e), w !== u) { + if (hl(w, m, $), w.e.f & ne && qn(w.e), w !== u) { if (h !== void 0 && h.has(w)) { if (d.length < p.length) { - var S = p[0], P; - c = S.prev; - var D = d[0], Y = d[d.length - 1]; - for (P = 0; P < d.length; P += 1) - pi(d[P], S, n); - for (P = 0; P < p.length; P += 1) - h.delete(p[P]); - he(e, D.prev, Y.next), he(e, c, D), he(e, Y, S), u = S, c = Y, $ -= 1, d = [], p = []; + var A = p[0], O; + c = A.prev; + var P = d[0], K = d[d.length - 1]; + for (O = 0; O < d.length; O += 1) + gi(d[O], A, n); + for (O = 0; O < p.length; O += 1) + h.delete(p[O]); + he(e, P.prev, K.next), he(e, c, P), he(e, K, A), u = A, c = K, $ -= 1, d = [], p = []; } else - h.delete(w), pi(w, u, n), he(e, w.prev, w.next), he(e, w, c === null ? e.first : c.next), he(e, c, w), c = w; + h.delete(w), gi(w, u, n), he(e, w.prev, w.next), he(e, w, c === null ? e.first : c.next), he(e, c, w), c = w; continue; } - for (d = [], p = []; u !== null && u.k !== E; ) - u.e.f & re || (h ?? (h = /* @__PURE__ */ new Set())).add(u), p.push(u), u = u.next; + for (d = [], p = []; u !== null && u.k !== b; ) + u.e.f & ne || (h ?? (h = /* @__PURE__ */ new Set())).add(u), p.push(u), u = u.next; if (u === null) continue; w = u; @@ -1322,21 +1322,21 @@ function ul(t, e, n, r, i, s, a) { d.push(w), c = w, u = w.next; } if (u !== null || h !== void 0) { - for (var G = h === void 0 ? [] : Ir(h); u !== null; ) - u.e.f & re || G.push(u), u = u.next; - var K = G.length; - if (K > 0) { - var q = null; - ol(e, G, q, o); + for (var j = h === void 0 ? [] : Fr(h); u !== null; ) + u.e.f & ne || j.push(u), u = u.next; + var et = j.length; + if (et > 0) { + var z = null; + fl(e, j, z, o); } } - U.first = e.first && e.first.e, U.last = c && c.e; + G.first = e.first && e.first.e, G.last = c && c.e; } -function fl(t, e, n, r) { - zi(t.v, e), t.i = n; +function hl(t, e, n, r) { + Xi(t.v, e), t.i = n; } -function vs(t, e, n, r, i, s, a, l, o, f) { - var u = (o & fa) !== 0, h = (o & ha) === 0, c = u ? h ? /* @__PURE__ */ qr(i) : Rt(i) : i, d = o & ca ? Rt(a) : a, p = { +function ps(t, e, n, r, i, s, a, l, o, f) { + var u = (o & ha) !== 0, h = (o & va) === 0, c = u ? h ? /* @__PURE__ */ Lr(i) : Et(i) : i, d = o & da ? Et(a) : a, p = { i: d, v: c, k: s, @@ -1347,11 +1347,11 @@ function vs(t, e, n, r, i, s, a, l, o, f) { next: r }; try { - return p.e = We(() => l(t, c, d, f), Z), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; + return p.e = Je(() => l(t, c, d, f), Q), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; } finally { } } -function pi(t, e, n) { +function gi(t, e, n) { for (var r = t.next ? ( /** @type {TemplateNode} */ t.next.e.nodes_start @@ -1364,7 +1364,7 @@ function pi(t, e, n) { ); s !== r; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ue(s) + /* @__PURE__ */ oe(s) ); i.before(s), s = a; } @@ -1372,8 +1372,8 @@ function pi(t, e, n) { function he(t, e, n) { e === null ? t.first = n : (e.next = n, e.e.next = n && n.e), n !== null && (n.prev = e, n.e.prev = e && e.e); } -function ps(t, e) { - Yi(() => { +function _s(t, e) { + Bi(() => { var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -1391,98 +1391,94 @@ function ps(t, e) { } }); } -function _i(t, e, n, r) { +function mi(t, e, n, r) { var i = t.__styles ?? (t.__styles = {}); i[e] !== n && (i[e] = n, n == null ? t.style.removeProperty(e) : t.style.setProperty(e, n, "")); } -function gi(t, e) { - return t === e || (t == null ? void 0 : t[Ge]) === e; +function yi(t, e) { + return t === e || (t == null ? void 0 : t[Ke]) === e; } -function mn(t = {}, e, n, r) { - return Yr(() => { +function wn(t = {}, e, n, r) { + return zr(() => { var i, s; - return rs(() => { - i = s, s = [], Pn(() => { - t !== n(...s) && (e(t, ...s), i && gi(n(...i), t) && e(null, ...i)); + return is(() => { + i = s, s = [], In(() => { + t !== n(...s) && (e(t, ...s), i && yi(n(...i), t) && e(null, ...i)); }); }), () => { - Yi(() => { - s && gi(n(...s), t) && e(null, ...s); + Bi(() => { + s && yi(n(...s), t) && e(null, ...s); }); }; }), t; } -function cl(t) { - vt === null && el(), Dn(() => { - const e = Pn(t); +function dl(t) { + vt === null && rl(), Br(() => { + const e = In(t); if (typeof e == "function") return ( /** @type {() => void} */ e ); }); } -let cn = !1; -function hl(t) { - var e = cn; +let dn = !1; +function vl(t) { + var e = dn; try { - return cn = !1, [t(), cn]; + return dn = !1, [t(), dn]; } finally { - cn = e; + dn = e; } } -function mi(t, e = 1) { - const n = t() + e; - return t(n), n; -} -function ve(t, e, n, r) { - var P; - var i = (n & da) !== 0, s = !0, a = (n & pa) !== 0, l = (n & _a) !== 0, o = !1, f; - a ? [f, o] = hl(() => ( +function Qt(t, e, n, r) { + var O; + var i = (n & pa) !== 0, s = !0, a = (n & ga) !== 0, l = (n & ma) !== 0, o = !1, f; + a ? [f, o] = vl(() => ( /** @type {V} */ t[e] )) : f = /** @type {V} */ t[e]; - var u = Ge in t || Li in t, h = a && (((P = ye(t, e)) == null ? void 0 : P.set) ?? (u && e in t && ((D) => t[e] = D))) || void 0, c = ( + var u = Ke in t || Vi in t, h = a && (((O = we(t, e)) == null ? void 0 : O.set) ?? (u && e in t && ((P) => t[e] = P))) || void 0, c = ( /** @type {V} */ r - ), d = !0, p = !1, m = () => (p = !0, d && (d = !1, l ? c = Pn( + ), d = !0, p = !1, m = () => (p = !0, d && (d = !1, l ? c = In( /** @type {() => V} */ r ) : c = /** @type {V} */ r), c); - f === void 0 && r !== void 0 && (h && s && Ca(), f = m(), h && h(f)); - var E; - if (E = () => { - var D = ( + f === void 0 && r !== void 0 && (h && s && Oa(), f = m(), h && h(f)); + var b; + if (b = () => { + var P = ( /** @type {V} */ t[e] ); - return D === void 0 ? m() : (d = !0, p = !1, D); - }, !(n & va)) - return E; + return P === void 0 ? m() : (d = !0, p = !1, P); + }, !(n & _a)) + return b; if (h) { var w = t.$$legacy; - return function(D, Y) { - return arguments.length > 0 ? ((!Y || w || o) && h(Y ? E() : D), D) : E(); + return function(P, K) { + return arguments.length > 0 ? ((!K || w || o) && h(K ? b() : P), P) : b(); }; } - var $ = !1, b = /* @__PURE__ */ qr(f), S = /* @__PURE__ */ Wn(() => { - var D = E(), Y = _(b); - return $ ? ($ = !1, Y) : b.v = D; + var $ = !1, C = /* @__PURE__ */ Lr(f), A = /* @__PURE__ */ Jn(() => { + var P = b(), K = g(C); + return $ ? ($ = !1, K) : C.v = P; }); - return i || (S.equals = Fr), function(D, Y) { + return i || (A.equals = qr), function(P, K) { if (arguments.length > 0) { - const G = Y ? _(S) : a ? xt(D) : D; - return S.equals(G) || ($ = !0, J(b, G), p && c !== void 0 && (c = G), Pn(() => _(S))), D; + const j = K ? g(A) : a ? xt(P) : P; + return A.equals(j) || ($ = !0, J(C, j), p && c !== void 0 && (c = j), In(() => g(A))), P; } - return _(S); + return g(A); }; } -function dl(t) { - return new vl(t); +function pl(t) { + return new _l(t); } -var te, Et; -class vl { +var te, At; +class _l { /** * @param {ComponentConstructorOptions & { * component: any; @@ -1490,57 +1486,57 @@ class vl { */ constructor(e) { /** @type {any} */ - lr(this, te); + or(this, te); /** @type {Record} */ - lr(this, Et); + or(this, At); var s; var n = /* @__PURE__ */ new Map(), r = (a, l) => { - var o = /* @__PURE__ */ qr(l); + var o = /* @__PURE__ */ Lr(l); return n.set(a, o), o; }; const i = new Proxy( { ...e.props || {}, $$events: {} }, { get(a, l) { - return _(n.get(l) ?? r(l, Reflect.get(a, l))); + return g(n.get(l) ?? r(l, Reflect.get(a, l))); }, has(a, l) { - return l === Li ? !0 : (_(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); + return l === Vi ? !0 : (g(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); }, set(a, l, o) { return J(n.get(l) ?? r(l, o), o), Reflect.set(a, l, o); } } ); - or(this, Et, (e.hydrate ? al : hs)(e.component, { + ur(this, At, (e.hydrate ? ol : ds)(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) && ee(), or(this, te, i.$$events); - for (const a of Object.keys(ft(this, Et))) - a === "$set" || a === "$destroy" || a === "$on" || Tn(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && Ht(), ur(this, te, i.$$events); + for (const a of Object.keys(ft(this, At))) + a === "$set" || a === "$destroy" || a === "$on" || kn(this, a, { get() { - return ft(this, Et)[a]; + return ft(this, At)[a]; }, /** @param {any} value */ set(l) { - ft(this, Et)[a] = l; + ft(this, At)[a] = l; }, enumerable: !0 }); - ft(this, Et).$set = /** @param {Record} next */ + ft(this, At).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, ft(this, Et).$destroy = () => { - ll(ft(this, Et)); + }, ft(this, At).$destroy = () => { + ul(ft(this, At)); }; } /** @param {Record} props */ $set(e) { - ft(this, Et).$set(e); + ft(this, At).$set(e); } /** * @param {string} event @@ -1558,12 +1554,12 @@ class vl { }; } $destroy() { - ft(this, Et).$destroy(); + ft(this, At).$destroy(); } } -te = new WeakMap(), Et = new WeakMap(); -let _s; -typeof HTMLElement == "function" && (_s = class extends HTMLElement { +te = new WeakMap(), At = new WeakMap(); +let gs; +typeof HTMLElement == "function" && (gs = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -1627,16 +1623,16 @@ typeof HTMLElement == "function" && (_s = class extends HTMLElement { var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = pl(this); + const r = {}, i = gl(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] = yn(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = xn(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 = dl({ + this.$$c = pl({ component: this.$$ctor, target: this.shadowRoot || this, props: { @@ -1644,14 +1640,14 @@ typeof HTMLElement == "function" && (_s = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = Za(() => { - rs(() => { + }), this.$$me = tl(() => { + is(() => { var s; this.$$r = !0; - for (const a of Nn(this.$$c)) { + for (const a of Cn(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const l = yn( + const l = xn( a, this.$$d[a], this.$$p_d, @@ -1679,7 +1675,7 @@ typeof HTMLElement == "function" && (_s = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = yn(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] = xn(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -1690,12 +1686,12 @@ typeof HTMLElement == "function" && (_s = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return Nn(this.$$p_d).find( + return Cn(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function yn(t, e, n, r) { +function xn(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]) @@ -1726,7 +1722,7 @@ function yn(t, e, n, r) { return e; } } -function pl(t) { +function gl(t) { const e = {}; return t.childNodes.forEach((n) => { e[ @@ -1735,34 +1731,34 @@ function pl(t) { ] = !0; }), e; } -function gs(t, e, n, r, i, s) { - let a = class extends _s { +function ms(t, e, n, r, i, s) { + let a = class extends gs { constructor() { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return Nn(e).map( + return Cn(e).map( (l) => (e[l].attribute || l).toLowerCase() ); } }; - return Nn(e).forEach((l) => { - Tn(a.prototype, l, { + return Cn(e).forEach((l) => { + kn(a.prototype, l, { get() { return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l]; }, set(o) { var h; - o = yn(l, o, e), this.$$d[l] = o; + o = xn(l, o, e), this.$$d[l] = o; var f = this.$$c; if (f) { - var u = (h = ye(f, l)) == null ? void 0 : h.get; + var u = (h = we(f, l)) == null ? void 0 : h.get; u ? f[l] = o : f.$set({ [l]: o }); } } }); }), r.forEach((l) => { - Tn(a.prototype, l, { + kn(a.prototype, l, { get() { var o; return (o = this.$$c) == null ? void 0 : o[l]; @@ -1771,43 +1767,43 @@ function gs(t, e, n, r, i, s) { }), t.element = /** @type {any} */ a, a; } -var _l = { value: () => { +var ml = { value: () => { } }; -function ms() { +function ys() { 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 wn(n); + return new bn(n); } -function wn(t) { +function bn(t) { this._ = t; } -function gl(t, e) { +function yl(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 }; }); } -wn.prototype = ms.prototype = { - constructor: wn, +bn.prototype = ys.prototype = { + constructor: bn, on: function(t, e) { - var n = this._, r = gl(t + "", n), i, s = -1, a = r.length; + var n = this._, r = yl(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = ml(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = wl(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] = yi(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = yi(n[i], t.name, null); + if (i = (t = r[s]).type) n[i] = wi(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = wi(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 wn(t); + return new bn(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]; @@ -1819,135 +1815,135 @@ wn.prototype = ms.prototype = { for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function ml(t, e) { +function wl(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } -function yi(t, e, n) { +function wi(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { - t[r] = _l, t = t.slice(0, r).concat(t.slice(r + 1)); + t[r] = ml, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } -var wr = "http://www.w3.org/1999/xhtml"; -const wi = { +var xr = "http://www.w3.org/1999/xhtml"; +const xi = { svg: "http://www.w3.org/2000/svg", - xhtml: wr, + xhtml: xr, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function tr(t) { +function er(t) { var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), wi.hasOwnProperty(e) ? { space: wi[e], local: t } : t; + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), xi.hasOwnProperty(e) ? { space: xi[e], local: t } : t; } -function yl(t) { +function xl(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; - return n === wr && e.documentElement.namespaceURI === wr ? e.createElement(t) : e.createElementNS(n, t); + return n === xr && e.documentElement.namespaceURI === xr ? e.createElement(t) : e.createElementNS(n, t); }; } -function wl(t) { +function bl(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } -function ys(t) { - var e = tr(t); - return (e.local ? wl : yl)(e); +function ws(t) { + var e = er(t); + return (e.local ? bl : xl)(e); } -function xl() { +function $l() { } -function Gr(t) { - return t == null ? xl : function() { +function jr(t) { + return t == null ? $l : function() { return this.querySelector(t); }; } -function bl(t) { - typeof t != "function" && (t = Gr(t)); +function Al(t) { + typeof t != "function" && (t = jr(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, l = r[i] = new Array(a), o, f, u = 0; u < a; ++u) (o = s[u]) && (f = t.call(o, o.__data__, u, s)) && ("__data__" in o && (f.__data__ = o.__data__), l[u] = f); return new bt(r, this._parents); } -function $l(t) { +function El(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function Al() { +function Rl() { return []; } -function ws(t) { - return t == null ? Al : function() { +function xs(t) { + return t == null ? Rl : function() { return this.querySelectorAll(t); }; } -function El(t) { +function Nl(t) { return function() { - return $l(t.apply(this, arguments)); + return El(t.apply(this, arguments)); }; } -function Rl(t) { - typeof t == "function" ? t = El(t) : t = ws(t); +function Tl(t) { + typeof t == "function" ? t = Nl(t) : t = xs(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) for (var a = e[s], l = a.length, o, f = 0; f < l; ++f) (o = a[f]) && (r.push(t.call(o, o.__data__, f, a)), i.push(o)); return new bt(r, i); } -function xs(t) { +function bs(t) { return function() { return this.matches(t); }; } -function bs(t) { +function $s(t) { return function(e) { return e.matches(t); }; } -var Nl = Array.prototype.find; -function Tl(t) { +var Cl = Array.prototype.find; +function kl(t) { return function() { - return Nl.call(this.children, t); + return Cl.call(this.children, t); }; } -function kl() { +function Sl() { return this.firstElementChild; } -function Sl(t) { - return this.select(t == null ? kl : Tl(typeof t == "function" ? t : bs(t))); +function Ml(t) { + return this.select(t == null ? Sl : kl(typeof t == "function" ? t : $s(t))); } -var Cl = Array.prototype.filter; -function Ml() { +var Ol = Array.prototype.filter; +function Pl() { return Array.from(this.children); } -function Ol(t) { +function Dl(t) { return function() { - return Cl.call(this.children, t); + return Ol.call(this.children, t); }; } -function Pl(t) { - return this.selectAll(t == null ? Ml : Ol(typeof t == "function" ? t : bs(t))); +function Il(t) { + return this.selectAll(t == null ? Pl : Dl(typeof t == "function" ? t : $s(t))); } -function Dl(t) { - typeof t != "function" && (t = xs(t)); +function Fl(t) { + typeof t != "function" && (t = bs(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, l = r[i] = [], o, f = 0; f < a; ++f) (o = s[f]) && t.call(o, o.__data__, f, s) && l.push(o); return new bt(r, this._parents); } -function $s(t) { +function As(t) { return new Array(t.length); } -function Il() { - return new bt(this._enter || this._groups.map($s), this._parents); +function ql() { + return new bt(this._enter || this._groups.map(As), this._parents); } -function qn(t, e) { +function Ln(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -qn.prototype = { - constructor: qn, +Ln.prototype = { + constructor: Ln, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -1961,55 +1957,55 @@ qn.prototype = { return this._parent.querySelectorAll(t); } }; -function Fl(t) { +function Ll(t) { return function() { return t; }; } -function ql(t, e, n, r, i, s) { +function Vl(t, e, n, r, i, s) { for (var a = 0, l, o = e.length, f = s.length; a < f; ++a) - (l = e[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new qn(t, s[a]); + (l = e[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new Ln(t, s[a]); for (; a < o; ++a) (l = e[a]) && (i[a] = l); } -function Ll(t, e, n, r, i, s, a) { +function Hl(t, e, n, r, i, s, a) { var l, o, f = /* @__PURE__ */ new Map(), u = e.length, h = s.length, c = new Array(u), d; for (l = 0; l < u; ++l) (o = e[l]) && (c[l] = d = a.call(o, o.__data__, l, e) + "", f.has(d) ? i[l] = o : f.set(d, o)); for (l = 0; l < h; ++l) - d = a.call(t, s[l], l, s) + "", (o = f.get(d)) ? (r[l] = o, o.__data__ = s[l], f.delete(d)) : n[l] = new qn(t, s[l]); + d = a.call(t, s[l], l, s) + "", (o = f.get(d)) ? (r[l] = o, o.__data__ = s[l], f.delete(d)) : n[l] = new Ln(t, s[l]); for (l = 0; l < u; ++l) (o = e[l]) && f.get(c[l]) === o && (i[l] = o); } -function Vl(t) { +function Yl(t) { return t.__data__; } -function Hl(t, e) { - if (!arguments.length) return Array.from(this, Vl); - var n = e ? Ll : ql, r = this._parents, i = this._groups; - typeof t != "function" && (t = Fl(t)); +function Bl(t, e) { + if (!arguments.length) return Array.from(this, Yl); + var n = e ? Hl : Vl, r = this._parents, i = this._groups; + typeof t != "function" && (t = Ll(t)); for (var s = i.length, a = new Array(s), l = new Array(s), o = new Array(s), f = 0; f < s; ++f) { - var u = r[f], h = i[f], c = h.length, d = Yl(t.call(u, u && u.__data__, f, r)), p = d.length, m = l[f] = new Array(p), E = a[f] = new Array(p), w = o[f] = new Array(c); - n(u, h, m, E, w, d, e); - for (var $ = 0, b = 0, S, P; $ < p; ++$) - if (S = m[$]) { - for ($ >= b && (b = $ + 1); !(P = E[b]) && ++b < p; ) ; - S._next = P || null; + var u = r[f], h = i[f], c = h.length, d = zl(t.call(u, u && u.__data__, f, r)), p = d.length, m = l[f] = new Array(p), b = a[f] = new Array(p), w = o[f] = new Array(c); + n(u, h, m, b, w, d, e); + for (var $ = 0, C = 0, A, O; $ < p; ++$) + if (A = m[$]) { + for ($ >= C && (C = $ + 1); !(O = b[C]) && ++C < p; ) ; + A._next = O || null; } } return a = new bt(a, r), a._enter = l, a._exit = o, a; } -function Yl(t) { +function zl(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function Bl() { - return new bt(this._exit || this._groups.map($s), this._parents); +function Xl() { + return new bt(this._exit || this._groups.map(As), this._parents); } -function zl(t, e, n) { +function Ul(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 Xl(t) { +function Gl(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), l = new Array(i), o = 0; o < a; ++o) for (var f = n[o], u = r[o], h = f.length, c = l[o] = new Array(h), d, p = 0; p < h; ++p) (d = f[p] || u[p]) && (c[p] = d); @@ -2017,14 +2013,14 @@ function Xl(t) { l[o] = n[o]; return new bt(l, this._parents); } -function Ul() { +function Kl() { 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 Gl(t) { - t || (t = Kl); +function jl(t) { + t || (t = Wl); function e(h, c) { return h && c ? t(h.__data__, c.__data__) : !h - !c; } @@ -2035,17 +2031,17 @@ function Gl(t) { } return new bt(i, this._parents).order(); } -function Kl(t, e) { +function Wl(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function jl() { +function Jl() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } -function Wl() { +function Zl() { return Array.from(this); } -function Jl() { +function Ql() { 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]; @@ -2053,114 +2049,114 @@ function Jl() { } return null; } -function Zl() { +function to() { let t = 0; for (const e of this) ++t; return t; } -function Ql() { +function eo() { return !this.node(); } -function to(t) { +function no(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], s = 0, a = i.length, l; s < a; ++s) (l = i[s]) && t.call(l, l.__data__, s, i); return this; } -function eo(t) { +function ro(t) { return function() { this.removeAttribute(t); }; } -function no(t) { +function io(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function ro(t, e) { +function so(t, e) { return function() { this.setAttribute(t, e); }; } -function io(t, e) { +function ao(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } -function so(t, e) { +function lo(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function ao(t, e) { +function oo(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 lo(t, e) { - var n = tr(t); +function uo(t, e) { + var n = er(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 ? no : eo : typeof e == "function" ? n.local ? ao : so : n.local ? io : ro)(n, e)); + return this.each((e == null ? n.local ? io : ro : typeof e == "function" ? n.local ? oo : lo : n.local ? ao : so)(n, e)); } -function As(t) { +function Es(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function oo(t) { +function fo(t) { return function() { this.style.removeProperty(t); }; } -function uo(t, e, n) { +function co(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } -function fo(t, e, n) { +function ho(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function co(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? oo : typeof e == "function" ? fo : uo)(t, e, n ?? "")) : Me(this.node(), t); +function vo(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? fo : typeof e == "function" ? ho : co)(t, e, n ?? "")) : Oe(this.node(), t); } -function Me(t, e) { - return t.style.getPropertyValue(e) || As(t).getComputedStyle(t, null).getPropertyValue(e); +function Oe(t, e) { + return t.style.getPropertyValue(e) || Es(t).getComputedStyle(t, null).getPropertyValue(e); } -function ho(t) { +function po(t) { return function() { delete this[t]; }; } -function vo(t, e) { +function _o(t, e) { return function() { this[t] = e; }; } -function po(t, e) { +function go(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } -function _o(t, e) { - return arguments.length > 1 ? this.each((e == null ? ho : typeof e == "function" ? po : vo)(t, e)) : this.node()[t]; +function mo(t, e) { + return arguments.length > 1 ? this.each((e == null ? po : typeof e == "function" ? go : _o)(t, e)) : this.node()[t]; } -function Es(t) { +function Rs(t) { return t.trim().split(/^|\s+/); } -function Kr(t) { - return t.classList || new Rs(t); +function Wr(t) { + return t.classList || new Ns(t); } -function Rs(t) { - this._node = t, this._names = Es(t.getAttribute("class") || ""); +function Ns(t) { + this._node = t, this._names = Rs(t.getAttribute("class") || ""); } -Rs.prototype = { +Ns.prototype = { add: function(t) { var e = this._names.indexOf(t); e < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); @@ -2173,129 +2169,129 @@ Rs.prototype = { return this._names.indexOf(t) >= 0; } }; -function Ns(t, e) { - for (var n = Kr(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); -} function Ts(t, e) { - for (var n = Kr(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); + for (var n = Wr(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function go(t) { +function Cs(t, e) { + for (var n = Wr(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +} +function yo(t) { return function() { - Ns(this, t); + Ts(this, t); }; } -function mo(t) { +function wo(t) { return function() { - Ts(this, t); + Cs(this, t); }; } -function yo(t, e) { +function xo(t, e) { return function() { - (e.apply(this, arguments) ? Ns : Ts)(this, t); + (e.apply(this, arguments) ? Ts : Cs)(this, t); }; } -function wo(t, e) { - var n = Es(t + ""); +function bo(t, e) { + var n = Rs(t + ""); if (arguments.length < 2) { - for (var r = Kr(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Wr(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? yo : e ? go : mo)(n, e)); + return this.each((typeof e == "function" ? xo : e ? yo : wo)(n, e)); } -function xo() { +function $o() { this.textContent = ""; } -function bo(t) { +function Ao(t) { return function() { this.textContent = t; }; } -function $o(t) { +function Eo(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } -function Ao(t) { - return arguments.length ? this.each(t == null ? xo : (typeof t == "function" ? $o : bo)(t)) : this.node().textContent; +function Ro(t) { + return arguments.length ? this.each(t == null ? $o : (typeof t == "function" ? Eo : Ao)(t)) : this.node().textContent; } -function Eo() { +function No() { this.innerHTML = ""; } -function Ro(t) { +function To(t) { return function() { this.innerHTML = t; }; } -function No(t) { +function Co(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } -function To(t) { - return arguments.length ? this.each(t == null ? Eo : (typeof t == "function" ? No : Ro)(t)) : this.node().innerHTML; +function ko(t) { + return arguments.length ? this.each(t == null ? No : (typeof t == "function" ? Co : To)(t)) : this.node().innerHTML; } -function ko() { +function So() { this.nextSibling && this.parentNode.appendChild(this); } -function So() { - return this.each(ko); +function Mo() { + return this.each(So); } -function Co() { +function Oo() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function Mo() { - return this.each(Co); +function Po() { + return this.each(Oo); } -function Oo(t) { - var e = typeof t == "function" ? t : ys(t); +function Do(t) { + var e = typeof t == "function" ? t : ws(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function Po() { +function Io() { return null; } -function Do(t, e) { - var n = typeof t == "function" ? t : ys(t), r = e == null ? Po : typeof e == "function" ? e : Gr(e); +function Fo(t, e) { + var n = typeof t == "function" ? t : ws(t), r = e == null ? Io : typeof e == "function" ? e : jr(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function Io() { +function qo() { var t = this.parentNode; t && t.removeChild(this); } -function Fo() { - return this.each(Io); +function Lo() { + return this.each(qo); } -function qo() { +function Vo() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function Lo() { +function Ho() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function Vo(t) { - return this.select(t ? Lo : qo); +function Yo(t) { + return this.select(t ? Ho : Vo); } -function Ho(t) { +function Bo(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } -function Yo(t) { +function zo(t) { return function(e) { t.call(this, e, this.__data__); }; } -function Bo(t) { +function Xo(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 zo(t) { +function Uo(t) { return function() { var e = this.__on; if (e) { @@ -2305,9 +2301,9 @@ function zo(t) { } }; } -function Xo(t, e, n) { +function Go(t, e, n) { return function() { - var r = this.__on, i, s = Yo(e); + var r = this.__on, i, s = zo(e); if (r) { for (var a = 0, l = r.length; a < l; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { @@ -2318,8 +2314,8 @@ function Xo(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 Uo(t, e, n) { - var r = Bo(t + ""), i, s = r.length, a; +function Ko(t, e, n) { + var r = Xo(t + ""), i, s = r.length, a; if (arguments.length < 2) { var l = this.node().__on; if (l) { @@ -2330,27 +2326,27 @@ function Uo(t, e, n) { } return; } - for (l = e ? Xo : zo, i = 0; i < s; ++i) this.each(l(r[i], e, n)); + for (l = e ? Go : Uo, i = 0; i < s; ++i) this.each(l(r[i], e, n)); return this; } function ks(t, e, n) { - var r = As(t), i = r.CustomEvent; + var r = Es(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 Go(t, e) { +function jo(t, e) { return function() { return ks(this, t, e); }; } -function Ko(t, e) { +function Wo(t, e) { return function() { return ks(this, t, e.apply(this, arguments)); }; } -function jo(t, e) { - return this.each((typeof e == "function" ? Ko : Go)(t, e)); +function Jo(t, e) { + return this.each((typeof e == "function" ? Wo : jo)(t, e)); } -function* Wo() { +function* Zo() { 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); @@ -2359,64 +2355,64 @@ var Ss = [null]; function bt(t, e) { this._groups = t, this._parents = e; } -function qe() { +function Le() { return new bt([[document.documentElement]], Ss); } -function Jo() { +function Qo() { return this; } -bt.prototype = qe.prototype = { +bt.prototype = Le.prototype = { constructor: bt, - select: bl, - selectAll: Rl, - selectChild: Sl, - selectChildren: Pl, - filter: Dl, - data: Hl, - enter: Il, - exit: Bl, - join: zl, - merge: Xl, - selection: Jo, - order: Ul, - sort: Gl, - call: jl, - nodes: Wl, - node: Jl, - size: Zl, - empty: Ql, - each: to, - attr: lo, - style: co, - property: _o, - classed: wo, - text: Ao, - html: To, - raise: So, - lower: Mo, - append: Oo, - insert: Do, - remove: Fo, - clone: Vo, - datum: Ho, - on: Uo, - dispatch: jo, - [Symbol.iterator]: Wo + select: Al, + selectAll: Tl, + selectChild: Ml, + selectChildren: Il, + filter: Fl, + data: Bl, + enter: ql, + exit: Xl, + join: Ul, + merge: Gl, + selection: Qo, + order: Kl, + sort: jl, + call: Jl, + nodes: Zl, + node: Ql, + size: to, + empty: eo, + each: no, + attr: uo, + style: vo, + property: mo, + classed: bo, + text: Ro, + html: ko, + raise: Mo, + lower: Po, + append: Do, + insert: Fo, + remove: Lo, + clone: Yo, + datum: Bo, + on: Ko, + dispatch: Jo, + [Symbol.iterator]: Zo }; -function st(t) { +function it(t) { return typeof t == "string" ? new bt([[document.querySelector(t)]], [document.documentElement]) : new bt([[t]], Ss); } -function jr(t, e, n) { +function Jr(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } -function Cs(t, e) { +function Ms(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } -function rn() { +function sn() { } -var Ze = 0.7, Ln = 1 / Ze, ke = "\\s*([+-]?\\d+)\\s*", Qe = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", zt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Zo = /^#([0-9a-f]{3,8})$/, Qo = new RegExp(`^rgb\\(${ke},${ke},${ke}\\)$`), tu = new RegExp(`^rgb\\(${zt},${zt},${zt}\\)$`), eu = new RegExp(`^rgba\\(${ke},${ke},${ke},${Qe}\\)$`), nu = new RegExp(`^rgba\\(${zt},${zt},${zt},${Qe}\\)$`), ru = new RegExp(`^hsl\\(${Qe},${zt},${zt}\\)$`), iu = new RegExp(`^hsla\\(${Qe},${zt},${zt},${Qe}\\)$`), xi = { +var Qe = 0.7, Vn = 1 / Qe, ke = "\\s*([+-]?\\d+)\\s*", tn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", zt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", tu = /^#([0-9a-f]{3,8})$/, eu = new RegExp(`^rgb\\(${ke},${ke},${ke}\\)$`), nu = new RegExp(`^rgb\\(${zt},${zt},${zt}\\)$`), ru = new RegExp(`^rgba\\(${ke},${ke},${ke},${tn}\\)$`), iu = new RegExp(`^rgba\\(${zt},${zt},${zt},${tn}\\)$`), su = new RegExp(`^hsl\\(${tn},${zt},${zt}\\)$`), au = new RegExp(`^hsla\\(${tn},${zt},${zt},${tn}\\)$`), bi = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -2566,178 +2562,178 @@ var Ze = 0.7, Ln = 1 / Ze, ke = "\\s*([+-]?\\d+)\\s*", Qe = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -jr(rn, be, { +Jr(sn, $e, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, - hex: bi, + hex: $i, // Deprecated! Use color.formatHex. - formatHex: bi, - formatHex8: su, - formatHsl: au, - formatRgb: $i, - toString: $i + formatHex: $i, + formatHex8: lu, + formatHsl: ou, + formatRgb: Ai, + toString: Ai }); -function bi() { +function $i() { return this.rgb().formatHex(); } -function su() { +function lu() { return this.rgb().formatHex8(); } -function au() { - return Ms(this).formatHsl(); +function ou() { + return Os(this).formatHsl(); } -function $i() { +function Ai() { return this.rgb().formatRgb(); } -function be(t) { +function $e(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = Zo.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ai(e) : n === 3 ? new dt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? hn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? hn(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 = Qo.exec(t)) ? new dt(e[1], e[2], e[3], 1) : (e = tu.exec(t)) ? new dt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = eu.exec(t)) ? hn(e[1], e[2], e[3], e[4]) : (e = nu.exec(t)) ? hn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = ru.exec(t)) ? Ni(e[1], e[2] / 100, e[3] / 100, 1) : (e = iu.exec(t)) ? Ni(e[1], e[2] / 100, e[3] / 100, e[4]) : xi.hasOwnProperty(t) ? Ai(xi[t]) : t === "transparent" ? new dt(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = tu.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ei(e) : n === 3 ? new dt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? vn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? vn(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 = eu.exec(t)) ? new dt(e[1], e[2], e[3], 1) : (e = nu.exec(t)) ? new dt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = ru.exec(t)) ? vn(e[1], e[2], e[3], e[4]) : (e = iu.exec(t)) ? vn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = su.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, 1) : (e = au.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, e[4]) : bi.hasOwnProperty(t) ? Ei(bi[t]) : t === "transparent" ? new dt(NaN, NaN, NaN, 0) : null; } -function Ai(t) { +function Ei(t) { return new dt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function hn(t, e, n, r) { +function vn(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new dt(t, e, n, r); } -function lu(t) { - return t instanceof rn || (t = be(t)), t ? (t = t.rgb(), new dt(t.r, t.g, t.b, t.opacity)) : new dt(); +function uu(t) { + return t instanceof sn || (t = $e(t)), t ? (t = t.rgb(), new dt(t.r, t.g, t.b, t.opacity)) : new dt(); } -function xr(t, e, n, r) { - return arguments.length === 1 ? lu(t) : new dt(t, e, n, r ?? 1); +function br(t, e, n, r) { + return arguments.length === 1 ? uu(t) : new dt(t, e, n, r ?? 1); } function dt(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -jr(dt, xr, Cs(rn, { +Jr(dt, br, Ms(sn, { brighter(t) { - return t = t == null ? Ln : Math.pow(Ln, t), new dt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Vn : Math.pow(Vn, t), new dt(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? Ze : Math.pow(Ze, t), new dt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Qe : Math.pow(Qe, t), new dt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new dt(we(this.r), we(this.g), we(this.b), Vn(this.opacity)); + return new dt(xe(this.r), xe(this.g), xe(this.b), Hn(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: Ei, + hex: Ri, // Deprecated! Use color.formatHex. - formatHex: Ei, - formatHex8: ou, - formatRgb: Ri, - toString: Ri + formatHex: Ri, + formatHex8: fu, + formatRgb: Ni, + toString: Ni })); -function Ei() { - return `#${me(this.r)}${me(this.g)}${me(this.b)}`; +function Ri() { + return `#${ye(this.r)}${ye(this.g)}${ye(this.b)}`; } -function ou() { - return `#${me(this.r)}${me(this.g)}${me(this.b)}${me((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function fu() { + return `#${ye(this.r)}${ye(this.g)}${ye(this.b)}${ye((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } -function Ri() { - const t = Vn(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${we(this.r)}, ${we(this.g)}, ${we(this.b)}${t === 1 ? ")" : `, ${t})`}`; +function Ni() { + const t = Hn(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${xe(this.r)}, ${xe(this.g)}, ${xe(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function Vn(t) { +function Hn(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function we(t) { +function xe(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function me(t) { - return t = we(t), (t < 16 ? "0" : "") + t.toString(16); +function ye(t) { + return t = xe(t), (t < 16 ? "0" : "") + t.toString(16); } -function Ni(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Ct(t, e, n, r); +function Ti(t, e, n, r) { + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Mt(t, e, n, r); } -function Ms(t) { - if (t instanceof Ct) return new Ct(t.h, t.s, t.l, t.opacity); - if (t instanceof rn || (t = be(t)), !t) return new Ct(); - if (t instanceof Ct) return t; +function Os(t) { + if (t instanceof Mt) return new Mt(t.h, t.s, t.l, t.opacity); + if (t instanceof sn || (t = $e(t)), !t) return new Mt(); + if (t instanceof Mt) 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, l = s - i, o = (s + i) / 2; - return l ? (e === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - e) / l + 2 : a = (e - n) / l + 4, l /= o < 0.5 ? s + i : 2 - s - i, a *= 60) : l = o > 0 && o < 1 ? 0 : a, new Ct(a, l, o, t.opacity); + return l ? (e === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - e) / l + 2 : a = (e - n) / l + 4, l /= o < 0.5 ? s + i : 2 - s - i, a *= 60) : l = o > 0 && o < 1 ? 0 : a, new Mt(a, l, o, t.opacity); } -function uu(t, e, n, r) { - return arguments.length === 1 ? Ms(t) : new Ct(t, e, n, r ?? 1); +function cu(t, e, n, r) { + return arguments.length === 1 ? Os(t) : new Mt(t, e, n, r ?? 1); } -function Ct(t, e, n, r) { +function Mt(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -jr(Ct, uu, Cs(rn, { +Jr(Mt, cu, Ms(sn, { brighter(t) { - return t = t == null ? Ln : Math.pow(Ln, t), new Ct(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Vn : Math.pow(Vn, t), new Mt(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? Ze : Math.pow(Ze, t), new Ct(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Qe : Math.pow(Qe, t), new Mt(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( - cr(t >= 240 ? t - 240 : t + 120, i, r), - cr(t, i, r), - cr(t < 120 ? t + 240 : t - 120, i, r), + hr(t >= 240 ? t - 240 : t + 120, i, r), + hr(t, i, r), + hr(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new Ct(Ti(this.h), dn(this.s), dn(this.l), Vn(this.opacity)); + return new Mt(Ci(this.h), pn(this.s), pn(this.l), Hn(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 = Vn(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${Ti(this.h)}, ${dn(this.s) * 100}%, ${dn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = Hn(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${Ci(this.h)}, ${pn(this.s) * 100}%, ${pn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function Ti(t) { +function Ci(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function dn(t) { +function pn(t) { return Math.max(0, Math.min(1, t || 0)); } -function cr(t, e, n) { +function hr(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 Wr = (t) => () => t; -function fu(t, e) { +const Zr = (t) => () => t; +function hu(t, e) { return function(n) { return t + n * e; }; } -function cu(t, e, n) { +function du(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 hu(t) { - return (t = +t) == 1 ? Os : function(e, n) { - return n - e ? cu(e, n, t) : Wr(isNaN(e) ? n : e); +function vu(t) { + return (t = +t) == 1 ? Ps : function(e, n) { + return n - e ? du(e, n, t) : Zr(isNaN(e) ? n : e); }; } -function Os(t, e) { +function Ps(t, e) { var n = e - t; - return n ? fu(t, n) : Wr(isNaN(t) ? e : t); + return n ? hu(t, n) : Zr(isNaN(t) ? e : t); } -const Hn = function t(e) { - var n = hu(e); +const Yn = function t(e) { + var n = vu(e); function r(i, s) { - var a = n((i = xr(i)).r, (s = xr(s)).r), l = n(i.g, s.g), o = n(i.b, s.b), f = Os(i.opacity, s.opacity); + var a = n((i = br(i)).r, (s = br(s)).r), l = n(i.g, s.g), o = n(i.b, s.b), f = Ps(i.opacity, s.opacity); return function(u) { return i.r = a(u), i.g = l(u), i.b = o(u), i.opacity = f(u), i + ""; }; } return r.gamma = t, r; }(1); -function du(t, e) { +function pu(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { @@ -2745,19 +2741,19 @@ function du(t, e) { return r; }; } -function vu(t) { +function _u(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function pu(t, e) { +function gu(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] = Ne(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = Te(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; return function(l) { for (a = 0; a < r; ++a) s[a] = i[a](l); return s; }; } -function _u(t, e) { +function mu(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; @@ -2768,41 +2764,41 @@ function Yt(t, e) { return t * (1 - n) + e * n; }; } -function gu(t, e) { +function yu(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] = Ne(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = Te(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var br = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, hr = new RegExp(br.source, "g"); -function mu(t) { +var $r = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, dr = new RegExp($r.source, "g"); +function wu(t) { return function() { return t; }; } -function yu(t) { +function xu(t) { return function(e) { return t(e) + ""; }; } -function Ps(t, e) { - var n = br.lastIndex = hr.lastIndex = 0, r, i, s, a = -1, l = [], o = []; - for (t = t + "", e = e + ""; (r = br.exec(t)) && (i = hr.exec(e)); ) - (s = i.index) > n && (s = e.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: Yt(r, i) })), n = hr.lastIndex; - return n < e.length && (s = e.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? o[0] ? yu(o[0].x) : mu(e) : (e = o.length, function(f) { +function Ds(t, e) { + var n = $r.lastIndex = dr.lastIndex = 0, r, i, s, a = -1, l = [], o = []; + for (t = t + "", e = e + ""; (r = $r.exec(t)) && (i = dr.exec(e)); ) + (s = i.index) > n && (s = e.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: Yt(r, i) })), n = dr.lastIndex; + return n < e.length && (s = e.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? o[0] ? xu(o[0].x) : wu(e) : (e = o.length, function(f) { for (var u = 0, h; u < e; ++u) l[(h = o[u]).i] = h.x(f); return l.join(""); }); } -function Ne(t, e) { +function Te(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? Wr(e) : (n === "number" ? Yt : n === "string" ? (r = be(e)) ? (e = r, Hn) : Ps : e instanceof be ? Hn : e instanceof Date ? _u : vu(e) ? du : Array.isArray(e) ? pu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? gu : Yt)(t, e); + return e == null || n === "boolean" ? Zr(e) : (n === "number" ? Yt : n === "string" ? (r = $e(e)) ? (e = r, Yn) : Ds : e instanceof $e ? Yn : e instanceof Date ? mu : _u(e) ? pu : Array.isArray(e) ? gu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? yu : Yt)(t, e); } -var ki = 180 / Math.PI, $r = { +var ki = 180 / Math.PI, Ar = { translateX: 0, translateY: 0, rotate: 0, @@ -2810,7 +2806,7 @@ var ki = 180 / Math.PI, $r = { scaleX: 1, scaleY: 1 }; -function Ds(t, e, n, r, i, s) { +function Is(t, e, n, r, i, s) { var a, l, o; return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (o = t * n + e * r) && (n -= t * o, r -= e * o), (l = Math.sqrt(n * n + r * r)) && (n /= l, r /= l, o /= l), t * r < e * n && (t = -t, e = -e, o = -o, a = -a), { translateX: i, @@ -2821,15 +2817,15 @@ function Ds(t, e, n, r, i, s) { scaleY: l }; } -var vn; -function wu(t) { +var _n; +function bu(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? $r : Ds(e.a, e.b, e.c, e.d, e.e, e.f); + return e.isIdentity ? Ar : Is(e.a, e.b, e.c, e.d, e.e, e.f); } -function xu(t) { - return t == null || (vn || (vn = document.createElementNS("http://www.w3.org/2000/svg", "g")), vn.setAttribute("transform", t), !(t = vn.transform.baseVal.consolidate())) ? $r : (t = t.matrix, Ds(t.a, t.b, t.c, t.d, t.e, t.f)); +function $u(t) { + return t == null || (_n || (_n = document.createElementNS("http://www.w3.org/2000/svg", "g")), _n.setAttribute("transform", t), !(t = _n.transform.baseVal.consolidate())) ? Ar : (t = t.matrix, Is(t.a, t.b, t.c, t.d, t.e, t.f)); } -function Is(t, e, n, r) { +function Fs(t, e, n, r) { function i(f) { return f.length ? f.pop() + " " : ""; } @@ -2854,143 +2850,143 @@ function Is(t, e, n, r) { return function(f, u) { var h = [], c = []; return f = t(f), u = t(u), s(f.translateX, f.translateY, u.translateX, u.translateY, h, c), a(f.rotate, u.rotate, h, c), l(f.skewX, u.skewX, h, c), o(f.scaleX, f.scaleY, u.scaleX, u.scaleY, h, c), f = u = null, function(d) { - for (var p = -1, m = c.length, E; ++p < m; ) h[(E = c[p]).i] = E.x(d); + for (var p = -1, m = c.length, b; ++p < m; ) h[(b = c[p]).i] = b.x(d); return h.join(""); }; }; } -var bu = Is(wu, "px, ", "px)", "deg)"), $u = Is(xu, ", ", ")", ")"), Oe = 0, Be = 0, Ye = 0, Fs = 1e3, Yn, ze, Bn = 0, $e = 0, er = 0, tn = typeof performance == "object" && performance.now ? performance : Date, qs = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Au = Fs(bu, "px, ", "px)", "deg)"), Eu = Fs($u, ", ", ")", ")"), Pe = 0, ze = 0, Be = 0, qs = 1e3, Bn, Xe, zn = 0, Ae = 0, nr = 0, en = typeof performance == "object" && performance.now ? performance : Date, Ls = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; -function Jr() { - return $e || (qs(Au), $e = tn.now() + er); +function Qr() { + return Ae || (Ls(Ru), Ae = en.now() + nr); } -function Au() { - $e = 0; +function Ru() { + Ae = 0; } -function zn() { +function Xn() { this._call = this._time = this._next = null; } -zn.prototype = Ls.prototype = { - constructor: zn, +Xn.prototype = Vs.prototype = { + constructor: Xn, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Jr() : +n) + (e == null ? 0 : +e), !this._next && ze !== this && (ze ? ze._next = this : Yn = this, ze = this), this._call = t, this._time = n, Ar(); + n = (n == null ? Qr() : +n) + (e == null ? 0 : +e), !this._next && Xe !== this && (Xe ? Xe._next = this : Bn = this, Xe = this), this._call = t, this._time = n, Er(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, Ar()); + this._call && (this._call = null, this._time = 1 / 0, Er()); } }; -function Ls(t, e, n) { - var r = new zn(); +function Vs(t, e, n) { + var r = new Xn(); return r.restart(t, e, n), r; } -function Eu() { - Jr(), ++Oe; - for (var t = Yn, e; t; ) - (e = $e - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --Oe; +function Nu() { + Qr(), ++Pe; + for (var t = Bn, e; t; ) + (e = Ae - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --Pe; } function Si() { - $e = (Bn = tn.now()) + er, Oe = Be = 0; + Ae = (zn = en.now()) + nr, Pe = ze = 0; try { - Eu(); + Nu(); } finally { - Oe = 0, Nu(), $e = 0; + Pe = 0, Cu(), Ae = 0; } } -function Ru() { - var t = tn.now(), e = t - Bn; - e > Fs && (er -= e, Bn = t); +function Tu() { + var t = en.now(), e = t - zn; + e > qs && (nr -= e, zn = t); } -function Nu() { - for (var t, e = Yn, 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 : Yn = n); - ze = t, Ar(r); +function Cu() { + for (var t, e = Bn, 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 : Bn = n); + Xe = t, Er(r); } -function Ar(t) { - if (!Oe) { - Be && (Be = clearTimeout(Be)); - var e = t - $e; - e > 24 ? (t < 1 / 0 && (Be = setTimeout(Si, t - tn.now() - er)), Ye && (Ye = clearInterval(Ye))) : (Ye || (Bn = tn.now(), Ye = setInterval(Ru, Fs)), Oe = 1, qs(Si)); +function Er(t) { + if (!Pe) { + ze && (ze = clearTimeout(ze)); + var e = t - Ae; + e > 24 ? (t < 1 / 0 && (ze = setTimeout(Si, t - en.now() - nr)), Be && (Be = clearInterval(Be))) : (Be || (zn = en.now(), Be = setInterval(Tu, qs)), Pe = 1, Ls(Si)); } } -function Ci(t, e, n) { - var r = new zn(); +function Mi(t, e, n) { + var r = new Xn(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var Tu = ms("start", "end", "cancel", "interrupt"), ku = [], Vs = 0, Mi = 1, Er = 2, xn = 3, Oi = 4, Rr = 5, bn = 6; -function nr(t, e, n, r, i, s) { +var ku = ys("start", "end", "cancel", "interrupt"), Su = [], Hs = 0, Oi = 1, Rr = 2, $n = 3, Pi = 4, Nr = 5, An = 6; +function rr(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - Su(t, n, { + Mu(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. - on: Tu, - tween: ku, + on: ku, + tween: Su, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: Vs + state: Hs }); } -function Zr(t, e) { - var n = Ot(t, e); - if (n.state > Vs) throw new Error("too late; already scheduled"); +function ti(t, e) { + var n = Pt(t, e); + if (n.state > Hs) throw new Error("too late; already scheduled"); return n; } function Ut(t, e) { - var n = Ot(t, e); - if (n.state > xn) throw new Error("too late; already running"); + var n = Pt(t, e); + if (n.state > $n) throw new Error("too late; already running"); return n; } -function Ot(t, e) { +function Pt(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Su(t, e, n) { +function Mu(t, e, n) { var r = t.__transition, i; - r[e] = n, n.timer = Ls(s, 0, n.time); + r[e] = n, n.timer = Vs(s, 0, n.time); function s(f) { - n.state = Mi, n.timer.restart(a, n.delay, n.time), n.delay <= f && a(f - n.delay); + n.state = Oi, n.timer.restart(a, n.delay, n.time), n.delay <= f && a(f - n.delay); } function a(f) { var u, h, c, d; - if (n.state !== Mi) return o(); + if (n.state !== Oi) return o(); for (u in r) if (d = r[u], d.name === n.name) { - if (d.state === xn) return Ci(a); - d.state === Oi ? (d.state = bn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[u]) : +u < e && (d.state = bn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[u]); + if (d.state === $n) return Mi(a); + d.state === Pi ? (d.state = An, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[u]) : +u < e && (d.state = An, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[u]); } - if (Ci(function() { - n.state === xn && (n.state = Oi, n.timer.restart(l, n.delay, n.time), l(f)); - }), n.state = Er, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Er) { - for (n.state = xn, i = new Array(c = n.tween.length), u = 0, h = -1; u < c; ++u) + if (Mi(function() { + n.state === $n && (n.state = Pi, n.timer.restart(l, n.delay, n.time), l(f)); + }), n.state = Rr, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Rr) { + for (n.state = $n, i = new Array(c = n.tween.length), u = 0, h = -1; u < c; ++u) (d = n.tween[u].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d); i.length = h + 1; } } function l(f) { - for (var u = f < n.duration ? n.ease.call(null, f / n.duration) : (n.timer.restart(o), n.state = Rr, 1), h = -1, c = i.length; ++h < c; ) + for (var u = f < n.duration ? n.ease.call(null, f / n.duration) : (n.timer.restart(o), n.state = Nr, 1), h = -1, c = i.length; ++h < c; ) i[h].call(t, u); - n.state === Rr && (n.on.call("end", t, t.__data__, n.index, n.group), o()); + n.state === Nr && (n.on.call("end", t, t.__data__, n.index, n.group), o()); } function o() { - n.state = bn, n.timer.stop(), delete r[e]; + n.state = An, n.timer.stop(), delete r[e]; for (var f in r) return; delete t.__transition; } } -function Cu(t, e) { +function Ou(t, e) { var n = t.__transition, r, i, s = !0, a; if (n) { e = e == null ? null : e + ""; @@ -2999,17 +2995,17 @@ function Cu(t, e) { s = !1; continue; } - i = r.state > Er && r.state < Rr, r.state = bn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > Rr && r.state < Nr, r.state = An, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } -function Mu(t) { +function Pu(t) { return this.each(function() { - Cu(this, t); + Ou(this, t); }); } -function Ou(t, e) { +function Du(t, e) { var n, r; return function() { var i = Ut(this, t), s = i.tween; @@ -3024,7 +3020,7 @@ function Ou(t, e) { i.tween = r; }; } -function Pu(t, e, n) { +function Iu(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { @@ -3041,327 +3037,327 @@ function Pu(t, e, n) { s.tween = i; }; } -function Du(t, e) { +function Fu(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = Ot(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = Pt(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 ? Ou : Pu)(n, t, e)); + return this.each((e == null ? Du : Iu)(n, t, e)); } -function Qr(t, e, n) { +function ei(t, e, n) { var r = t._id; return t.each(function() { var i = Ut(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return Ot(i, r).value[e]; + return Pt(i, r).value[e]; }; } -function Hs(t, e) { +function Ys(t, e) { var n; - return (typeof e == "number" ? Yt : e instanceof be ? Hn : (n = be(e)) ? (e = n, Hn) : Ps)(t, e); + return (typeof e == "number" ? Yt : e instanceof $e ? Yn : (n = $e(e)) ? (e = n, Yn) : Ds)(t, e); } -function Iu(t) { +function qu(t) { return function() { this.removeAttribute(t); }; } -function Fu(t) { +function Lu(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function qu(t, e, n) { +function Vu(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 Lu(t, e, n) { +function Hu(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 Vu(t, e, n) { +function Yu(t, e, n) { var r, i, s; return function() { var a, l = n(this), o; return l == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l))); }; } -function Hu(t, e, n) { +function Bu(t, e, n) { var r, i, s; return function() { var a, l = n(this), o; return l == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l))); }; } -function Yu(t, e) { - var n = tr(t), r = n === "transform" ? $u : Hs; - return this.attrTween(t, typeof e == "function" ? (n.local ? Hu : Vu)(n, r, Qr(this, "attr." + t, e)) : e == null ? (n.local ? Fu : Iu)(n) : (n.local ? Lu : qu)(n, r, e)); +function zu(t, e) { + var n = er(t), r = n === "transform" ? Eu : Ys; + return this.attrTween(t, typeof e == "function" ? (n.local ? Bu : Yu)(n, r, ei(this, "attr." + t, e)) : e == null ? (n.local ? Lu : qu)(n) : (n.local ? Hu : Vu)(n, r, e)); } -function Bu(t, e) { +function Xu(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function zu(t, e) { +function Uu(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function Xu(t, e) { +function Gu(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && zu(t, s)), n; + return s !== r && (n = (r = s) && Uu(t, s)), n; } return i._value = e, i; } -function Uu(t, e) { +function Ku(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Bu(t, s)), n; + return s !== r && (n = (r = s) && Xu(t, s)), n; } return i._value = e, i; } -function Gu(t, e) { +function ju(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 = tr(t); - return this.tween(n, (r.local ? Xu : Uu)(r, e)); + var r = er(t); + return this.tween(n, (r.local ? Gu : Ku)(r, e)); } -function Ku(t, e) { +function Wu(t, e) { return function() { - Zr(this, t).delay = +e.apply(this, arguments); + ti(this, t).delay = +e.apply(this, arguments); }; } -function ju(t, e) { +function Ju(t, e) { return e = +e, function() { - Zr(this, t).delay = e; + ti(this, t).delay = e; }; } -function Wu(t) { +function Zu(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Ku : ju)(e, t)) : Ot(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? Wu : Ju)(e, t)) : Pt(this.node(), e).delay; } -function Ju(t, e) { +function Qu(t, e) { return function() { Ut(this, t).duration = +e.apply(this, arguments); }; } -function Zu(t, e) { +function tf(t, e) { return e = +e, function() { Ut(this, t).duration = e; }; } -function Qu(t) { +function ef(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Ju : Zu)(e, t)) : Ot(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? Qu : tf)(e, t)) : Pt(this.node(), e).duration; } -function tf(t, e) { +function nf(t, e) { if (typeof e != "function") throw new Error(); return function() { Ut(this, t).ease = e; }; } -function ef(t) { +function rf(t) { var e = this._id; - return arguments.length ? this.each(tf(e, t)) : Ot(this.node(), e).ease; + return arguments.length ? this.each(nf(e, t)) : Pt(this.node(), e).ease; } -function nf(t, e) { +function sf(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); Ut(this, t).ease = n; }; } -function rf(t) { +function af(t) { if (typeof t != "function") throw new Error(); - return this.each(nf(this._id, t)); + return this.each(sf(this._id, t)); } -function sf(t) { - typeof t != "function" && (t = xs(t)); +function lf(t) { + typeof t != "function" && (t = bs(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, l = r[i] = [], o, f = 0; f < a; ++f) (o = s[f]) && t.call(o, o.__data__, f, s) && l.push(o); - return new ae(r, this._parents, this._name, this._id); + return new se(r, this._parents, this._name, this._id); } -function af(t) { +function of(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), l = 0; l < s; ++l) for (var o = e[l], f = n[l], u = o.length, h = a[l] = new Array(u), c, d = 0; d < u; ++d) (c = o[d] || f[d]) && (h[d] = c); for (; l < r; ++l) a[l] = e[l]; - return new ae(a, this._parents, this._name, this._id); + return new se(a, this._parents, this._name, this._id); } -function lf(t) { +function uf(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 of(t, e, n) { - var r, i, s = lf(e) ? Zr : Ut; +function ff(t, e, n) { + var r, i, s = uf(e) ? ti : Ut; return function() { var a = s(this, t), l = a.on; l !== r && (i = (r = l).copy()).on(e, n), a.on = i; }; } -function uf(t, e) { +function cf(t, e) { var n = this._id; - return arguments.length < 2 ? Ot(this.node(), n).on.on(t) : this.each(of(n, t, e)); + return arguments.length < 2 ? Pt(this.node(), n).on.on(t) : this.each(ff(n, t, e)); } -function ff(t) { +function hf(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } -function cf() { - return this.on("end.remove", ff(this._id)); +function df() { + return this.on("end.remove", hf(this._id)); } -function hf(t) { +function vf(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = Gr(t)); + typeof t != "function" && (t = jr(t)); 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, f = s[a] = new Array(o), u, h, c = 0; c < o; ++c) - (u = l[c]) && (h = t.call(u, u.__data__, c, l)) && ("__data__" in u && (h.__data__ = u.__data__), f[c] = h, nr(f[c], e, n, c, f, Ot(u, n))); - return new ae(s, this._parents, e, n); + (u = l[c]) && (h = t.call(u, u.__data__, c, l)) && ("__data__" in u && (h.__data__ = u.__data__), f[c] = h, rr(f[c], e, n, c, f, Pt(u, n))); + return new se(s, this._parents, e, n); } -function df(t) { +function pf(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = ws(t)); + typeof t != "function" && (t = xs(t)); for (var r = this._groups, i = r.length, s = [], a = [], l = 0; l < i; ++l) for (var o = r[l], f = o.length, u, h = 0; h < f; ++h) if (u = o[h]) { - for (var c = t.call(u, u.__data__, h, o), d, p = Ot(u, n), m = 0, E = c.length; m < E; ++m) - (d = c[m]) && nr(d, e, n, m, c, p); + for (var c = t.call(u, u.__data__, h, o), d, p = Pt(u, n), m = 0, b = c.length; m < b; ++m) + (d = c[m]) && rr(d, e, n, m, c, p); s.push(c), a.push(u); } - return new ae(s, a, e, n); + return new se(s, a, e, n); } -var vf = qe.prototype.constructor; -function pf() { - return new vf(this._groups, this._parents); +var _f = Le.prototype.constructor; +function gf() { + return new _f(this._groups, this._parents); } -function _f(t, e) { +function mf(t, e) { var n, r, i; return function() { - var s = Me(this, t), a = (this.style.removeProperty(t), Me(this, t)); + var s = Oe(this, t), a = (this.style.removeProperty(t), Oe(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function Ys(t) { +function Bs(t) { return function() { this.style.removeProperty(t); }; } -function gf(t, e, n) { +function yf(t, e, n) { var r, i = n + "", s; return function() { - var a = Me(this, t); + var a = Oe(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function mf(t, e, n) { +function wf(t, e, n) { var r, i, s; return function() { - var a = Me(this, t), l = n(this), o = l + ""; - return l == null && (o = l = (this.style.removeProperty(t), Me(this, t))), a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l)); + var a = Oe(this, t), l = n(this), o = l + ""; + return l == null && (o = l = (this.style.removeProperty(t), Oe(this, t))), a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l)); }; } -function yf(t, e) { +function xf(t, e) { var n, r, i, s = "style." + e, a = "end." + s, l; return function() { - var o = Ut(this, t), f = o.on, u = o.value[s] == null ? l || (l = Ys(e)) : void 0; + var o = Ut(this, t), f = o.on, u = o.value[s] == null ? l || (l = Bs(e)) : void 0; (f !== n || i !== u) && (r = (n = f).copy()).on(a, i = u), o.on = r; }; } -function wf(t, e, n) { - var r = (t += "") == "transform" ? bu : Hs; - return e == null ? this.styleTween(t, _f(t, r)).on("end.style." + t, Ys(t)) : typeof e == "function" ? this.styleTween(t, mf(t, r, Qr(this, "style." + t, e))).each(yf(this._id, t)) : this.styleTween(t, gf(t, r, e), n).on("end.style." + t, null); +function bf(t, e, n) { + var r = (t += "") == "transform" ? Au : Ys; + return e == null ? this.styleTween(t, mf(t, r)).on("end.style." + t, Bs(t)) : typeof e == "function" ? this.styleTween(t, wf(t, r, ei(this, "style." + t, e))).each(xf(this._id, t)) : this.styleTween(t, yf(t, r, e), n).on("end.style." + t, null); } -function xf(t, e, n) { +function $f(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } -function bf(t, e, n) { +function Af(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && xf(t, a, n)), r; + return a !== i && (r = (i = a) && $f(t, a, n)), r; } return s._value = e, s; } -function $f(t, e, n) { +function Ef(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, bf(t, e, n ?? "")); + return this.tween(r, Af(t, e, n ?? "")); } -function Af(t) { +function Rf(t) { return function() { this.textContent = t; }; } -function Ef(t) { +function Nf(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function Rf(t) { - return this.tween("text", typeof t == "function" ? Ef(Qr(this, "text", t)) : Af(t == null ? "" : t + "")); +function Tf(t) { + return this.tween("text", typeof t == "function" ? Nf(ei(this, "text", t)) : Rf(t == null ? "" : t + "")); } -function Nf(t) { +function Cf(t) { return function(e) { this.textContent = t.call(this, e); }; } -function Tf(t) { +function kf(t) { var e, n; function r() { var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && Nf(i)), e; + return i !== n && (e = (n = i) && Cf(i)), e; } return r._value = t, r; } -function kf(t) { +function Sf(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, Tf(t)); + return this.tween(e, kf(t)); } -function Sf() { - for (var t = this._name, e = this._id, n = Bs(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function Mf() { + for (var t = this._name, e = this._id, n = zs(), r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], l = a.length, o, f = 0; f < l; ++f) if (o = a[f]) { - var u = Ot(o, e); - nr(o, t, n, f, a, { + var u = Pt(o, e); + rr(o, t, n, f, a, { time: u.time + u.delay + u.duration, delay: 0, duration: u.duration, ease: u.ease }); } - return new ae(r, this._parents, t, n); + return new se(r, this._parents, t, n); } -function Cf() { +function Of() { var t, e, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { var l = { value: a }, o = { value: function() { @@ -3373,85 +3369,85 @@ function Cf() { }), i === 0 && s(); }); } -var Mf = 0; -function ae(t, e, n, r) { +var Pf = 0; +function se(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function $n(t) { - return qe().transition(t); -} -function Bs() { - return ++Mf; -} -var Wt = qe.prototype; -ae.prototype = $n.prototype = { - constructor: ae, - select: hf, - selectAll: df, - selectChild: Wt.selectChild, - selectChildren: Wt.selectChildren, - filter: sf, - merge: af, - selection: pf, - transition: Sf, - call: Wt.call, - nodes: Wt.nodes, - node: Wt.node, - size: Wt.size, - empty: Wt.empty, - each: Wt.each, - on: uf, - attr: Yu, - attrTween: Gu, - style: wf, - styleTween: $f, - text: Rf, - textTween: kf, - remove: cf, - tween: Du, - delay: Wu, - duration: Qu, - ease: ef, - easeVarying: rf, - end: Cf, - [Symbol.iterator]: Wt[Symbol.iterator] +function En(t) { + return Le().transition(t); +} +function zs() { + return ++Pf; +} +var jt = Le.prototype; +se.prototype = En.prototype = { + constructor: se, + select: vf, + selectAll: pf, + selectChild: jt.selectChild, + selectChildren: jt.selectChildren, + filter: lf, + merge: of, + selection: gf, + transition: Mf, + call: jt.call, + nodes: jt.nodes, + node: jt.node, + size: jt.size, + empty: jt.empty, + each: jt.each, + on: cf, + attr: zu, + attrTween: ju, + style: bf, + styleTween: Ef, + text: Tf, + textTween: Sf, + remove: df, + tween: Fu, + delay: Zu, + duration: ef, + ease: rf, + easeVarying: af, + end: Of, + [Symbol.iterator]: jt[Symbol.iterator] }; -function Of(t) { +function Df(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var Pf = { +var If = { time: null, // Set on use. delay: 0, duration: 250, - ease: Of + ease: Df }; -function Df(t, e) { +function Ff(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 If(t) { +function qf(t) { var e, n; - t instanceof ae ? (e = t._id, t = t._name) : (e = Bs(), (n = Pf).time = Jr(), t = t == null ? null : t + ""); + t instanceof se ? (e = t._id, t = t._name) : (e = zs(), (n = If).time = Qr(), t = t == null ? null : t + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], l = a.length, o, f = 0; f < l; ++f) - (o = a[f]) && nr(o, t, e, f, a, n || Df(o, e)); - return new ae(r, this._parents, t, e); + (o = a[f]) && rr(o, t, e, f, a, n || Ff(o, e)); + return new se(r, this._parents, t, e); } -qe.prototype.interrupt = Mu; -qe.prototype.transition = If; -const Nr = Math.PI, Tr = 2 * Nr, ge = 1e-6, Ff = Tr - ge; -function zs(t) { +Le.prototype.interrupt = Pu; +Le.prototype.transition = qf; +const Tr = Math.PI, Cr = 2 * Tr, me = 1e-6, Lf = Cr - me; +function Xs(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function qf(t) { +function Vf(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return zs; + if (e > 15) return Xs; const n = 10 ** e; return function(r) { this._ += r[0]; @@ -3459,10 +3455,10 @@ function qf(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Lf { +class Hf { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? zs : qf(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? Xs : Vf(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -3484,17 +3480,17 @@ class Lf { let a = this._x1, l = this._y1, o = r - e, f = i - n, u = a - e, h = l - n, c = u * u + h * h; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > ge) if (!(Math.abs(h * o - f * u) > ge) || !s) + else if (c > me) if (!(Math.abs(h * o - f * u) > me) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let d = r - a, p = i - l, m = o * o + f * f, E = d * d + p * p, w = Math.sqrt(m), $ = Math.sqrt(c), b = s * Math.tan((Nr - Math.acos((m + c - E) / (2 * w * $))) / 2), S = b / $, P = b / w; - Math.abs(S - 1) > ge && this._append`L${e + S * u},${n + S * h}`, this._append`A${s},${s},0,0,${+(h * d > u * p)},${this._x1 = e + P * o},${this._y1 = n + P * f}`; + let d = r - a, p = i - l, m = o * o + f * f, b = d * d + p * p, w = Math.sqrt(m), $ = Math.sqrt(c), C = s * Math.tan((Tr - Math.acos((m + c - b) / (2 * w * $))) / 2), A = C / $, O = C / w; + Math.abs(A - 1) > me && this._append`L${e + A * u},${n + A * h}`, this._append`A${s},${s},0,0,${+(h * d > u * p)},${this._x1 = e + O * o},${this._y1 = n + O * f}`; } } 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 l = r * Math.cos(i), o = r * Math.sin(i), f = e + l, u = n + o, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${f},${u}` : (Math.abs(this._x1 - f) > ge || Math.abs(this._y1 - u) > ge) && this._append`L${f},${u}`, r && (c < 0 && (c = c % Tr + Tr), c > Ff ? this._append`A${r},${r},0,1,${h},${e - l},${n - o}A${r},${r},0,1,${h},${this._x1 = f},${this._y1 = u}` : c > ge && this._append`A${r},${r},0,${+(c >= Nr)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + this._x1 === null ? this._append`M${f},${u}` : (Math.abs(this._x1 - f) > me || Math.abs(this._y1 - u) > me) && this._append`L${f},${u}`, r && (c < 0 && (c = c % Cr + Cr), c > Lf ? this._append`A${r},${r},0,1,${h},${e - l},${n - o}A${r},${r},0,1,${h},${this._x1 = f},${this._y1 = u}` : c > me && this._append`A${r},${r},0,${+(c >= Tr)},${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`; @@ -3503,24 +3499,24 @@ class Lf { return this._; } } -function Vf(t) { +function Yf(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 Hf = Vf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +const Bf = Yf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); function ot(t) { return function() { return t; }; } -const Pi = Math.abs, at = Math.atan2, _e = Math.cos, Yf = Math.max, dr = Math.min, Ht = Math.sin, Te = Math.sqrt, ht = 1e-12, en = Math.PI, Xn = en / 2, An = 2 * en; -function Bf(t) { - return t > 1 ? 0 : t < -1 ? en : Math.acos(t); +const Di = Math.abs, at = Math.atan2, ge = Math.cos, zf = Math.max, vr = Math.min, Vt = Math.sin, Ce = Math.sqrt, ht = 1e-12, nn = Math.PI, Un = nn / 2, Rn = 2 * nn; +function Xf(t) { + return t > 1 ? 0 : t < -1 ? nn : Math.acos(t); } -function Di(t) { - return t >= 1 ? Xn : t <= -1 ? -Xn : Math.asin(t); +function Ii(t) { + return t >= 1 ? Un : t <= -1 ? -Un : Math.asin(t); } -function zf(t) { +function Uf(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -3532,69 +3528,69 @@ function zf(t) { e = r; } return t; - }, () => new Lf(e); + }, () => new Hf(e); } -function Xf(t) { +function Gf(t) { return t.innerRadius; } -function Uf(t) { +function Kf(t) { return t.outerRadius; } -function Gf(t) { +function jf(t) { return t.startAngle; } -function Kf(t) { +function Wf(t) { return t.endAngle; } -function jf(t) { +function Jf(t) { return t && t.padAngle; } -function Wf(t, e, n, r, i, s, a, l) { +function Zf(t, e, n, r, i, s, a, l) { var o = n - t, f = r - e, u = a - i, h = l - s, c = h * o - u * f; if (!(c * c < ht)) return c = (u * (e - s) - h * (t - i)) / c, [t + c * o, e + c * f]; } -function pn(t, e, n, r, i, s, a) { - var l = t - n, o = e - r, f = (a ? s : -s) / Te(l * l + o * o), u = f * o, h = -f * l, c = t + u, d = e + h, p = n + u, m = r + h, E = (c + p) / 2, w = (d + m) / 2, $ = p - c, b = m - d, S = $ * $ + b * b, P = i - s, D = c * m - p * d, Y = (b < 0 ? -1 : 1) * Te(Yf(0, P * P * S - D * D)), G = (D * b - $ * Y) / S, K = (-D * $ - b * Y) / S, q = (D * b + $ * Y) / S, nt = (-D * $ + b * Y) / S, tt = G - E, T = K - w, M = q - E, _t = nt - w; - return tt * tt + T * T > M * M + _t * _t && (G = q, K = nt), { - cx: G, - cy: K, +function gn(t, e, n, r, i, s, a) { + var l = t - n, o = e - r, f = (a ? s : -s) / Ce(l * l + o * o), u = f * o, h = -f * l, c = t + u, d = e + h, p = n + u, m = r + h, b = (c + p) / 2, w = (d + m) / 2, $ = p - c, C = m - d, A = $ * $ + C * C, O = i - s, P = c * m - p * d, K = (C < 0 ? -1 : 1) * Ce(zf(0, O * O * A - P * P)), j = (P * C - $ * K) / A, et = (-P * $ - C * K) / A, z = (P * C + $ * K) / A, I = (-P * $ + C * K) / A, V = j - b, N = et - w, L = z - b, _t = I - w; + return V * V + N * N > L * L + _t * _t && (j = z, et = I), { + cx: j, + cy: et, x01: -u, y01: -h, - x11: G * (i / P - 1), - y11: K * (i / P - 1) + x11: j * (i / O - 1), + y11: et * (i / O - 1) }; } -function Jt() { - var t = Xf, e = Uf, n = ot(0), r = null, i = Gf, s = Kf, a = jf, l = null, o = zf(f); +function Wt() { + var t = Gf, e = Kf, n = ot(0), r = null, i = jf, s = Wf, a = Jf, l = null, o = Uf(f); function f() { - var u, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - Xn, m = s.apply(this, arguments) - Xn, E = Pi(m - p), w = m > p; + var u, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - Un, m = s.apply(this, arguments) - Un, b = Di(m - p), w = m > p; if (l || (l = u = o()), d < c && (h = d, d = c, c = h), !(d > ht)) l.moveTo(0, 0); - else if (E > An - ht) - l.moveTo(d * _e(p), d * Ht(p)), l.arc(0, 0, d, p, m, !w), c > ht && (l.moveTo(c * _e(m), c * Ht(m)), l.arc(0, 0, c, m, p, w)); + else if (b > Rn - ht) + l.moveTo(d * ge(p), d * Vt(p)), l.arc(0, 0, d, p, m, !w), c > ht && (l.moveTo(c * ge(m), c * Vt(m)), l.arc(0, 0, c, m, p, w)); else { - var $ = p, b = m, S = p, P = m, D = E, Y = E, G = a.apply(this, arguments) / 2, K = G > ht && (r ? +r.apply(this, arguments) : Te(c * c + d * d)), q = dr(Pi(d - c) / 2, +n.apply(this, arguments)), nt = q, tt = q, T, M; - if (K > ht) { - var _t = Di(K / c * Ht(G)), Gt = Di(K / d * Ht(G)); - (D -= _t * 2) > ht ? (_t *= w ? 1 : -1, S += _t, P -= _t) : (D = 0, S = P = (p + m) / 2), (Y -= Gt * 2) > ht ? (Gt *= w ? 1 : -1, $ += Gt, b -= Gt) : (Y = 0, $ = b = (p + m) / 2); + var $ = p, C = m, A = p, O = m, P = b, K = b, j = a.apply(this, arguments) / 2, et = j > ht && (r ? +r.apply(this, arguments) : Ce(c * c + d * d)), z = vr(Di(d - c) / 2, +n.apply(this, arguments)), I = z, V = z, N, L; + if (et > ht) { + var _t = Ii(et / c * Vt(j)), Gt = Ii(et / d * Vt(j)); + (P -= _t * 2) > ht ? (_t *= w ? 1 : -1, A += _t, O -= _t) : (P = 0, A = O = (p + m) / 2), (K -= Gt * 2) > ht ? (Gt *= w ? 1 : -1, $ += Gt, C -= Gt) : (K = 0, $ = C = (p + m) / 2); } - var Pt = d * _e($), Dt = d * Ht($), Tt = c * _e(P), It = c * Ht(P); - if (q > ht) { - var Kt = d * _e(b), fe = d * Ht(b), Ft = c * _e(S), jt = c * Ht(S), rt; - if (E < en) - if (rt = Wf(Pt, Dt, Ft, jt, Kt, fe, Tt, It)) { - var $t = Pt - rt[0], gt = Dt - rt[1], y = Kt - rt[0], L = fe - rt[1], j = 1 / Ht(Bf(($t * y + gt * L) / (Te($t * $t + gt * gt) * Te(y * y + L * L))) / 2), B = Te(rt[0] * rt[0] + rt[1] * rt[1]); - nt = dr(q, (c - B) / (j - 1)), tt = dr(q, (d - B) / (j + 1)); + var st = d * ge($), Nt = d * Vt($), Kt = c * ge(O), Tt = c * Vt(O); + if (z > ht) { + var Dt = d * ge(C), ue = d * Vt(C), pe = c * ge(A), Ct = c * Vt(A), gt; + if (b < nn) + if (gt = Zf(st, Nt, pe, Ct, Dt, ue, Kt, Tt)) { + var fe = st - gt[0], It = Nt - gt[1], Ft = Dt - gt[0], x = ue - gt[1], q = 1 / Vt(Xf((fe * Ft + It * x) / (Ce(fe * fe + It * It) * Ce(Ft * Ft + x * x))) / 2), B = Ce(gt[0] * gt[0] + gt[1] * gt[1]); + I = vr(z, (c - B) / (q - 1)), V = vr(z, (d - B) / (q + 1)); } else - nt = tt = 0; + I = V = 0; } - Y > ht ? tt > ht ? (T = pn(Ft, jt, Pt, Dt, d, tt, w), M = pn(Kt, fe, Tt, It, d, tt, w), l.moveTo(T.cx + T.x01, T.cy + T.y01), tt < q ? l.arc(T.cx, T.cy, tt, at(T.y01, T.x01), at(M.y01, M.x01), !w) : (l.arc(T.cx, T.cy, tt, at(T.y01, T.x01), at(T.y11, T.x11), !w), l.arc(0, 0, d, at(T.cy + T.y11, T.cx + T.x11), at(M.cy + M.y11, M.cx + M.x11), !w), l.arc(M.cx, M.cy, tt, at(M.y11, M.x11), at(M.y01, M.x01), !w))) : (l.moveTo(Pt, Dt), l.arc(0, 0, d, $, b, !w)) : l.moveTo(Pt, Dt), !(c > ht) || !(D > ht) ? l.lineTo(Tt, It) : nt > ht ? (T = pn(Tt, It, Kt, fe, c, -nt, w), M = pn(Pt, Dt, Ft, jt, c, -nt, w), l.lineTo(T.cx + T.x01, T.cy + T.y01), nt < q ? l.arc(T.cx, T.cy, nt, at(T.y01, T.x01), at(M.y01, M.x01), !w) : (l.arc(T.cx, T.cy, nt, at(T.y01, T.x01), at(T.y11, T.x11), !w), l.arc(0, 0, c, at(T.cy + T.y11, T.cx + T.x11), at(M.cy + M.y11, M.cx + M.x11), w), l.arc(M.cx, M.cy, nt, at(M.y11, M.x11), at(M.y01, M.x01), !w))) : l.arc(0, 0, c, P, S, w); + K > ht ? V > ht ? (N = gn(pe, Ct, st, Nt, d, V, w), L = gn(Dt, ue, Kt, Tt, d, V, w), l.moveTo(N.cx + N.x01, N.cy + N.y01), V < z ? l.arc(N.cx, N.cy, V, at(N.y01, N.x01), at(L.y01, L.x01), !w) : (l.arc(N.cx, N.cy, V, at(N.y01, N.x01), at(N.y11, N.x11), !w), l.arc(0, 0, d, at(N.cy + N.y11, N.cx + N.x11), at(L.cy + L.y11, L.cx + L.x11), !w), l.arc(L.cx, L.cy, V, at(L.y11, L.x11), at(L.y01, L.x01), !w))) : (l.moveTo(st, Nt), l.arc(0, 0, d, $, C, !w)) : l.moveTo(st, Nt), !(c > ht) || !(P > ht) ? l.lineTo(Kt, Tt) : I > ht ? (N = gn(Kt, Tt, Dt, ue, c, -I, w), L = gn(st, Nt, pe, Ct, c, -I, w), l.lineTo(N.cx + N.x01, N.cy + N.y01), I < z ? l.arc(N.cx, N.cy, I, at(N.y01, N.x01), at(L.y01, L.x01), !w) : (l.arc(N.cx, N.cy, I, at(N.y01, N.x01), at(N.y11, N.x11), !w), l.arc(0, 0, c, at(N.cy + N.y11, N.cx + N.x11), at(L.cy + L.y11, L.cx + L.x11), w), l.arc(L.cx, L.cy, I, at(L.y11, L.x11), at(L.y01, L.x01), !w))) : l.arc(0, 0, c, O, A, w); } if (l.closePath(), u) return l = null, u + "" || null; } return f.centroid = function() { - var u = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - en / 2; - return [_e(h) * u, Ht(h) * u]; + var u = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - nn / 2; + return [ge(h) * u, Vt(h) * u]; }, f.innerRadius = function(u) { return arguments.length ? (t = typeof u == "function" ? u : ot(+u), f) : t; }, f.outerRadius = function(u) { @@ -3613,30 +3609,30 @@ function Jt() { return arguments.length ? (l = u ?? null, f) : l; }, f; } -function Jf(t) { +function Qf(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function Zf(t, e) { +function tc(t, e) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function Qf(t) { +function ec(t) { return t; } -function vr() { - var t = Qf, e = Zf, n = null, r = ot(0), i = ot(An), s = ot(0); +function pr() { + var t = ec, e = tc, n = null, r = ot(0), i = ot(Rn), s = ot(0); function a(l) { - var o, f = (l = Jf(l)).length, u, h, c = 0, d = new Array(f), p = new Array(f), m = +r.apply(this, arguments), E = Math.min(An, Math.max(-An, i.apply(this, arguments) - m)), w, $ = Math.min(Math.abs(E) / f, s.apply(this, arguments)), b = $ * (E < 0 ? -1 : 1), S; + var o, f = (l = Qf(l)).length, u, h, c = 0, d = new Array(f), p = new Array(f), m = +r.apply(this, arguments), b = Math.min(Rn, Math.max(-Rn, i.apply(this, arguments) - m)), w, $ = Math.min(Math.abs(b) / f, s.apply(this, arguments)), C = $ * (b < 0 ? -1 : 1), A; for (o = 0; o < f; ++o) - (S = p[d[o] = o] = +t(l[o], o, l)) > 0 && (c += S); - for (e != null ? d.sort(function(P, D) { - return e(p[P], p[D]); - }) : n != null && d.sort(function(P, D) { - return n(l[P], l[D]); - }), o = 0, h = c ? (E - f * b) / c : 0; o < f; ++o, m = w) - u = d[o], S = p[u], w = m + (S > 0 ? S * h : 0) + b, p[u] = { + (A = p[d[o] = o] = +t(l[o], o, l)) > 0 && (c += A); + for (e != null ? d.sort(function(O, P) { + return e(p[O], p[P]); + }) : n != null && d.sort(function(O, P) { + return n(l[O], l[P]); + }), o = 0, h = c ? (b - f * C) / c : 0; o < f; ++o, m = w) + u = d[o], A = p[u], w = m + (A > 0 ? A * h : 0) + C, p[u] = { data: l[u], index: o, - value: S, + value: A, startAngle: m, endAngle: w, padAngle: $ @@ -3657,16 +3653,16 @@ function vr() { return arguments.length ? (s = typeof l == "function" ? l : ot(+l), a) : s; }, a; } -function Xe(t, e, n) { +function Ue(t, e, n) { this.k = t, this.x = e, this.y = n; } -Xe.prototype = { - constructor: Xe, +Ue.prototype = { + constructor: Ue, scale: function(t) { - return t === 1 ? this : new Xe(this.k * t, this.x, this.y); + return t === 1 ? this : new Ue(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new Xe(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new Ue(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]; @@ -3696,9 +3692,9 @@ Xe.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Xe.prototype; +Ue.prototype; const de = {}, kr = "No Further Rankings"; -function Un(t, e) { +function Gn(t, e) { let n = 0; for (let r = 1; r < e; r++) { const i = t.results[r - 1].tallyResults; @@ -3712,7 +3708,7 @@ function Un(t, e) { } return n; } -function Xs(t, e, n) { +function Us(t, e, n) { if (e < 1) return []; const r = t.results[e - 1].tallyResults, i = []; @@ -3722,459 +3718,475 @@ function Xs(t, e, n) { } return i; } -function Gn(t, e) { - return Xs(t, e, "eliminated"); -} function Kn(t, e) { + return Us(t, e, "eliminated"); +} +function jn(t, e) { let n = []; for (let r = 1; r <= e; r++) - n = n.concat(Xs(t, r, "elected")); + n = n.concat(Us(t, r, "elected")); return n; } -var tc = /* @__PURE__ */ sl(''); -const ec = { hash: "svelte-3kpd", code: "" }; -function Us(t, e) { - Xr(e, !0), ps(t, ec); - let n = ve(e, "jsonData", 7), r = ve(e, "currentRound", 15), i = ve(e, "mouseEventType", 15), s = ve(e, "mouseData", 15), a = ve(e, "mouseY", 15); - const l = 800, o = 800, f = Math.min(l, o) * 0.3, u = l / 2, h = o / 2, c = "Pie", d = "Donut", p = "TextLayer", m = "#transfer", E = "url(#cross-hatch)", w = 1.15, $ = 0.1, b = 750, S = 800; - let P = [], D = [], Y = [], G = 0, K = Zt(0), q = Zt(null); - function nt() { - const v = st(_(q)); - v.select("#" + c).remove(), v.select("#" + d).remove(), v.select("#" + p).remove(); +var nc = /* @__PURE__ */ ll(''); +const rc = { hash: "svelte-3kpd", code: "" }; +function Gs(t, e) { + Gr(e, !0), _s(t, rc); + let n = Qt(e, "jsonData", 7), r = Qt(e, "currentRound", 7, 1), i = Qt(e, "mouseEventType", 15), s = Qt(e, "mouseData", 15), a = Qt(e, "mouseY", 15), l = Qt(e, "requestRoundChange", 7, (v) => { + }); + const o = 800, f = 800, u = Math.min(o, f) * 0.3, h = o / 2, c = f / 2, d = "Pie", p = "Donut", m = "TextLayer", b = "#transfer", w = "url(#cross-hatch)", $ = 1.15, C = 0.1, A = 750, O = 800; + let P = [], K = [], j = [], et = 0, z = Jt(0), I = 0, V = Jt(null); + function N() { + const v = it(g(V)); + v.select("#" + d).remove(), v.select("#" + p).remove(), v.select("#" + m).remove(); } - function tt(v) { - nt(), Y = T(v), P = Js(v, c, Y, u, h, 0, M()); + function L(v) { + l() && (W = v, l()(v)); } - cl(() => { - console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), fe(), setTimeout( + function _t(v) { + N(), j = Gt(v), P = Qs(v, d, j, h, c, 0, st()); + } + dl(() => { + console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), gt(), setTimeout( () => { - tt(r()); + _t(r()); }, 0 ); }); - function T(v) { - const g = Kt(v); - return G = Tt(v), g; + function Gt(v) { + const _ = Ct(v); + return et = ue(v), _; } - function M() { - return f; + function st() { + return u; } - function _t() { - return M() * 1.41; + function Nt() { + return st() * 1.41; } - function Gt(v, g) { - if (v === "exhausted") return Un(n(), g); + function Kt(v, _) { + if (v === "exhausted") return Gn(n(), _); { - const x = n().results[g - 1].tally; - return Number(x[v]); + const y = n().results[_ - 1].tally; + return Number(y[v]); } } - function Pt(v, g) { - return Gt(v, g).toLocaleString("en-US"); + function Tt(v, _) { + return Kt(v, _).toLocaleString("en-US"); } - function Dt(v, g) { - return (Gt(v, g) / G).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Dt(v, _) { + return (Kt(v, _) / et).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function Tt(v) { - const g = n().results[v - 1].tally; - let x = 0; - for (let [O, R] of Object.entries(g)) - x += Number(R); - return x; + function ue(v) { + const _ = n().results[v - 1].tally; + let y = 0; + for (let [M, R] of Object.entries(_)) + y += Number(R); + return y; } - function It(v, g) { - const x = n().results[g - 1].tallyResults; - let O = 0; - const R = x.findIndex((k) => (k == null ? void 0 : k.elected) && v == k.elected); + function pe(v, _) { + const y = n().results[_ - 1].tallyResults; + let M = 0; + const R = y.findIndex((k) => (k == null ? void 0 : k.elected) && v == k.elected); if (R >= 0) { - const k = x[R].transfers; + const k = y[R].transfers; if (k) - for (let [N, C] of Object.entries(k)) O += Number(C); + for (let [T, S] of Object.entries(k)) M += Number(S); } else return 0; - return O; - } - function Kt(v) { - const g = n().results; - let x = g[Math.max(0, v - 2)].tally; - const O = [], R = []; - for (let [N, C] of Object.entries(x)) - O.push({ label: N, value: 0 }); - x = g[v - 1].tally; - for (let N of O) { - const C = Number(x[N.label]), F = It(N.label, v); + return M; + } + function Ct(v) { + const _ = n().results; + let y = _[Math.max(0, v - 2)].tally; + const M = [], R = []; + for (let [T, S] of Object.entries(y)) + M.push({ label: T, value: 0 }); + y = _[v - 1].tally; + for (let T of M) { + const S = Number(y[T.label]), F = pe(T.label, v); F > 0 ? (R.push({ - label: N.label + m, + label: T.label + b, value: F - }), N.value = C - F, R.push(N)) : (N.value = C, R.push(N)); + }), T.value = S - F, R.push(T)) : (T.value = S, R.push(T)); } - const k = Un(n(), v); + const k = Gn(n(), v); return R.push({ label: "exhausted", value: k }), R; } - function fe() { - const v = st(_(q)).select("defs").select("#cross-hatch"); - let g = 0; - for (let [x, O] of Object.entries(n().results[0].tally)) { - g < 10 ? de[x] = Hf[g] : de[x] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), g++; + function gt() { + const v = it(g(V)).select("defs").select("#cross-hatch"); + let _ = 0; + for (let [y, M] of Object.entries(n().results[0].tally)) { + _ < 10 ? de[y] = Bf[_] : de[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), _++; { const R = v.clone(!0); - R.attr("id", x.replaceAll(" ", "-")).select("rect").attr("fill", de[x]), R.select("path").attr("stroke", "#505050"); + R.attr("id", y.replaceAll(" ", "-")).select("rect").attr("fill", de[y]), R.select("path").attr("stroke", "#505050"); } } - de.exhausted = E, de["Inactive Ballots"] = E; + de.exhausted = w, de["Inactive Ballots"] = w; } - function Ft() { - st(_(q)).select("#" + d).remove(); + function fe() { + it(g(V)).select("#" + p).remove(); } - function jt(v) { - const g = $n("global").duration(S); - v && g.on("end", v), Ft(), sn(r() - 1), Zs(), ta(0, M()), ei(); + function It(v, _) { + const y = En("global").duration(O); + _ && y.on("end", _), fe(), _e(v), ta(), na(0, st()), ri(); } - function rt(v) { - const g = $n("global").duration(S); - v && g.on("end", v), an(r() - 1); + function Ft(v, _) { + const y = En("global").duration(O); + _ && y.on("end", _), on(v); } - function $t(v) { - const g = $n("global").duration(S); - v && g.on("end", v), Le(r()), Ae(M()); + function x(v, _) { + const y = En("global").duration(O); + _ && y.on("end", _), an(v), ln(st()); } - function gt() { - y = !1; + function q() { + B = !1; } - let y = !1; - function L() { - if (y) { + let B = !1; + function nt() { + if (B) { console.warn("buttons locked out"); return; } - y = !0, j(); - } - function j() { - J(K, 0), B = mi(r); - const v = r() < n().results.length - 1 ? j : gt; - jt(() => { - rt(() => { - $t(v); + B = !0, I = r(), rt(); + } + function rt() { + J(z, 0); + const v = I < n().results.length - 1 ? rt : q; + It(I, () => { + Ft(I, () => { + I++, L(I), x(I, v); }); }); } - Dn(() => { - it(); + Br(() => { + ut(); }); - let B = 0; - function it() { - console.log(`previous round was ${B}, currentRound is ${r()}`), B != r() && (B == r() - 1 && B > 0 ? ut() : et(r()), B = r()); + let W = 0; + function ut() { + console.log(`previous round was ${W}, currentRound is ${r()}`), W != r() && (W == r() - 1 && W > 0 ? Ve() : $t(r()), W = r()); } - function et(v) { - if (console.log("setRoundFn called"), y) { + function $t(v) { + if (console.log("setRoundFn called"), B) { console.warn("buttons locked out"); return; } - console.log("past button lockout"), r(v), tt(r()); + console.log("past button lockout"), J(z, 0), _t(v); } - function ut() { - if (console.log("animateOneRoundFn called"), y) { + function Ve() { + if (console.log("animateOneRoundFn called"), B) { console.warn("buttons locked out"); return; } - if (console.log("past button lockout"), r() >= n().results.length) { - y = !1; + if (r() <= 1) { + console.warn(`animateOneRoundFn: can't anitmate to round ${r()}`); return; } - y = !0, _(K) === 0 ? jt(() => { - rt(() => { - $t(gt); + if (console.log("past button lockout"), I = r(), I >= n().results.length) { + B = !1; + return; + } + B = !0, g(z) === 0 ? It(I - 1, () => { + Ft(I - 1, () => { + x(I, q); }); - }) : _(K) === 1 ? rt(() => { - $t(gt); - }) : _(K) === 2 && $t(gt); + }) : g(z) === 1 ? Ft(I - 1, () => { + x(I, q); + }) : g(z) === 2 && x(I, q), J(z, 0); } - function At() { - if (console.log(`animateOnePhaseFn called, currentRound = ${r()}, displayPhase = ${_(K)}`), r() >= n().results.length) { - ei(); + function Ee() { + if (console.log(`animateOnePhaseFn called, currentRound = ${r()}, displayPhase = ${g(z)}`), r() >= n().results.length) { + ri(); return; } - J(K, (_(K) + 1) % 3), y = !0, _(K) === 1 ? (B = mi(r), jt(gt)) : _(K) === 2 ? rt(gt) : _(K) === 0 ? $t(gt) : (y = !1, console.warn("displayPhase out of range at ", _(K))); + B = !0, J(z, (g(z) + 1) % 3), I = r(), g(z) === 1 ? It(I, q) : g(z) === 2 ? Ft(I, q) : g(z) === 0 ? (I++, L(I), x(I, q)) : (B = !1, console.warn("displayPhase out of range at ", g(z))); } - function Le(v) { - Y = Kt(v), P = ea(v, c, Y, 0, M(), !0); + function an(v) { + j = Ct(v), P = ra(v, d, j, 0, st(), !0); } - function Ae(v, g) { - vr().sort(null).value((C) => C.value); - const x = st(_(q)).select("#" + d), O = Jt().outerRadius(v).innerRadius(v - 1), R = x.selectAll(".slice"); + function ln(v, _) { + pr().sort(null).value((S) => S.value); + const y = it(g(V)).select("#" + p), M = Wt().outerRadius(v).innerRadius(v - 1), R = y.selectAll(".slice"); let k = R.size(); - function N() { - k--, k === 0 && Qs(); + function T() { + k--, k === 0 && ea(); } - R.select("path").transition("global").duration(b).attr("d", (C) => O(C)).on("end", (C) => N()); + R.select("path").transition("global").duration(A).attr("d", (S) => M(S)).on("end", (S) => T()); } - function sn(v) { - const g = Gs(v, P); - D = ni(v, d, g, u, h, M(), _t(), !1, !0); + function _e(v) { + const _ = js(v, P); + K = ii(v, p, _, h, c, st(), Nt(), !1, !0); } - function an(v) { - const g = js(v, D, P); - D = ri( + function on(v) { + const _ = Js(v, K, P); + K = si( v, - d, - g, + p, + _, /* previousDonutInfoGlobal, */ - M(), - _t(), + st(), + Nt(), !1 ); } - function qt(v) { - const g = v.data.label; - return de[g.split("#")[0]]; + function un(v) { + const _ = v.data.label; + return de[_.split("#")[0]]; } - function ln(v) { - const g = {}, x = n().results[v - 1].tallyResults; - for (let O = 0; O < x.length; O++) { - let R = x[O].eliminated; - if (R === void 0 && (R = x[O].elected), R === void 0) { + function Ks(v) { + const _ = {}, y = n().results[v - 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 k = x[O].transfers; + const k = y[M].transfers; if (k === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [N, C] of Object.entries(k)) - g[N] === void 0 ? g[N] = Number(C) : g[N] += Number(C); + for (let [T, S] of Object.entries(k)) + _[T] === void 0 ? _[T] = Number(S) : _[T] += Number(S); } - return g; + return _; } - function Gs(v, g) { + function js(v, _) { console.log(`makeDonutInfo: round = ${v}`); - const x = [], O = G, R = n().results[v - 1].tallyResults; + const y = [], M = et, R = n().results[v - 1].tallyResults; for (let k = 0; k < R.length; k++) { - let N = R[k].eliminated; - if (N === void 0 && (N = R[k].elected), N === void 0) { + let T = R[k].eliminated; + if (T === void 0 && (T = R[k].elected), T === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const C = R[k].transfers; - if (C === void 0) { + const S = R[k].transfers; + if (S === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let F = g.find((I) => I.data.label == N + m); - F === void 0 && (F = g.find((I) => I.data.label == N)); - let V = 0; - if (F) V = F.startAngle; + let F = _.find((D) => D.data.label == T + b); + F === void 0 && (F = _.find((D) => D.data.label == T)); + let H = 0; + if (F) H = F.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [I, H] of Object.entries(C)) { - let W; - const Lt = g.find((Q) => Q.data.label == I); - if (Lt) - W = structuredClone(Lt); - else if (I == "exhausted") - W = { - data: { label: I, value: Number(H) }, + for (let [D, Y] of Object.entries(S)) { + let Z; + const qt = _.find((tt) => tt.data.label == D); + if (qt) + Z = structuredClone(qt); + else if (D == "exhausted") + Z = { + data: { label: D, value: Number(Y) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (I == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", H); + else if (D == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", Y); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", I); + console.warn("makeDonutInfo: unrecognized name in transfers ", D); continue; } - const A = Number(H) / O * 2 * Math.PI; - W.startAngle = V, V = W.endAngle = V + A, W.index = k, W.data.label = `${W.data.label}#${k}`, x.push(W); + const E = Number(Y) / M * 2 * Math.PI; + Z.startAngle = H, H = Z.endAngle = H + E, Z.index = k, Z.data.label = `${Z.data.label}#${k}`, y.push(Z); } } - return x; + return y; } - function Ks(v, g, x) { - const O = {}; + function Ws(v, _, y) { + const M = {}; for (let [R, k] of Object.entries(v)) { - const N = x.find((V) => R == V.data.label); - if (N === void 0) { + const T = y.find((H) => R == H.data.label); + if (T === void 0) { console.warn("getTransferStartAngles: mainPieObj not found for ", R); continue; } - const C = (N.startAngle + N.endAngle) / 2, F = v[N.data.label] / g * 2 * Math.PI; - O[N.data.label] = C - F / 2; + const S = (T.startAngle + T.endAngle) / 2, F = v[T.data.label] / _ * 2 * Math.PI; + M[T.data.label] = S - F / 2; } - return O; - } - function js(v, g, x) { - const O = [], R = G, k = ln(v), N = Ks(k, R, x); - for (let [C, F] of g.entries()) { - const V = structuredClone(F), I = F.endAngle - F.startAngle, H = x.find((W) => F.data.label.indexOf(W.data.label) === 0); - if (H) { - const W = H.data.label; - V.startAngle = N[W], N[W] += I, V.endAngle = V.startAngle + I; + return M; + } + function Js(v, _, y) { + const M = [], R = et, k = Ks(v), T = Ws(k, R, y); + for (let [S, F] of _.entries()) { + const H = structuredClone(F), D = F.endAngle - F.startAngle, Y = y.find((Z) => F.data.label.indexOf(Z.data.label) === 0); + if (Y) { + const Z = Y.data.label; + H.startAngle = T[Z], T[Z] += D, H.endAngle = H.startAngle + D; } else if (F.data.label.indexOf("exhausted") === 0) - V.startAngle = F.startAngle, V.endAngle = F.endAngle; + H.startAngle = F.startAngle, H.endAngle = F.endAngle; else { console.warn("updateDonutInfo: unrecognized slice name ", F.data.label); continue; } - V.index = C, O.push(V); + H.index = S, M.push(H); } - return O; - } - function ti(v, g, x, O, R, k) { - const C = st(_(q)).append("g").attr("id", p).attr("transform", `translate(${x}, ${O})`), F = Jt().innerRadius(R * w).outerRadius(R * w); - C.selectAll("text").data(g).enter().each(function(V) { - V.endAngle - V.startAngle < $ || V.data.label.includes(m) || st(this).append("g").attr("id", (I) => I.data.label).classed("eliminated", (I) => k.includes(I.data.label.split("#")[0]) || I.data.label.includes(m)).each(function(I, H) { - I.data.label === "exhausted" && st(this).on("mouseenter", (W, Lt) => na(W)).on("mouseleave", (W, Lt) => ra()); - }).append("text").attr("transform", (I) => `translate(${F.centroid(I)})`).attr("text-anchor", (I) => rr(I.startAngle, I.endAngle)).text((I) => I.data.label === "exhausted" ? kr : I.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((I) => Pt(I.data.label, v) + " (" + Dt(I.data.label, v) + ")"); + return M; + } + function ni(v, _, y, M, R, k) { + const S = it(g(V)).append("g").attr("id", m).attr("transform", `translate(${y}, ${M})`), F = Wt().innerRadius(R * $).outerRadius(R * $); + S.selectAll("text").data(_).enter().each(function(H) { + H.endAngle - H.startAngle < C || H.data.label.includes(b) || it(this).append("g").attr("id", (D) => D.data.label).classed("eliminated", (D) => k.includes(D.data.label.split("#")[0]) || D.data.label.includes(b)).each(function(D, Y) { + D.data.label === "exhausted" && it(this).on("mouseenter", (Z, qt) => ia(Z)).on("mouseleave", (Z, qt) => sa()); + }).append("text").attr("transform", (D) => `translate(${F.centroid(D)})`).attr("text-anchor", (D) => ir(D.startAngle, D.endAngle)).text((D) => D.data.label === "exhausted" ? kr : D.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((D) => Tt(D.data.label, v) + " (" + Dt(D.data.label, v) + ")"); }); } - function Ws(v, g, x, O) { - const k = st(_(q)).select("#" + p), N = k.selectAll("tspan"), C = k.selectAll("g").data(g, (H) => H.data.label).classed("eliminated", (H) => O.includes(H.data.label.split("#")[0]) || H.data.label.includes(m)), F = Jt().innerRadius(x * w).outerRadius(x * w + 1); - N.transition("global").duration(b).attr("transform", (H) => `translate(${F.centroid(H)})`).attr("text-anchor", (H) => rr(H.startAngle, H.endAngle)), C.select("text").transition("global").duration(b).attr("transform", (H) => `translate(${F.centroid(H)})`).attr("text-anchor", (H) => rr(H.startAngle, H.endAngle)).on("end", (H) => I()); - let V = C.size(); - function I(H) { - V--, V === 0 && (k.remove(), ti(v, g, u, h, x, O)); + function Zs(v, _, y, M) { + const k = it(g(V)).select("#" + m), T = k.selectAll("tspan"), S = k.selectAll("g").data(_, (Y) => Y.data.label).classed("eliminated", (Y) => M.includes(Y.data.label.split("#")[0]) || Y.data.label.includes(b)), F = Wt().innerRadius(y * $).outerRadius(y * $ + 1); + T.transition("global").duration(A).attr("transform", (Y) => `translate(${F.centroid(Y)})`).attr("text-anchor", (Y) => ir(Y.startAngle, Y.endAngle)), S.select("text").transition("global").duration(A).attr("transform", (Y) => `translate(${F.centroid(Y)})`).attr("text-anchor", (Y) => ir(Y.startAngle, Y.endAngle)).on("end", (Y) => D()); + let H = S.size(); + function D(Y) { + H--, H === 0 && (k.remove(), ni(v, _, h, c, y, M)); } } - function Js(v, g, x, O, R, k, N, C = !0, F = !1) { - const I = vr().sort(null).value((H) => H.value)(x); - return ni(v, g, I, O, R, k, N, C, F), I; + function Qs(v, _, y, M, R, k, T, S = !0, F = !1) { + const D = pr().sort(null).value((Y) => Y.value)(y); + return ii(v, _, D, M, R, k, T, S, F), D; } - function ei() { - st(_(q)).select("#" + c).selectAll(".elected").style("stroke", "darkblue").style("stroke-width", "2px"); + function ri() { + it(g(V)).select("#" + d).selectAll(".elected").style("stroke", "darkblue").style("stroke-width", "2px"); } - function ni(v, g, x, O, R, k, N, C, F) { - const V = Gn(n(), v), I = Kn(n(), v), Lt = st(_(q)).attr("width", "100%").attr("height", o).attr("viewBox", `0 0 ${l} ${o}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", g).attr("transform", `translate(${O}, ${R})`).selectAll(".slice").data(x).enter().append("g").attr("class", "slice").classed("eliminated", (A) => V.includes(A.data.label.split("#")[0]) || A.data.label.includes(m)).classed("elected", (A) => I.includes(A.data.label.split("#")[0]) && !A.data.label.includes(m)).attr("id", (A) => A.data.label).on("mouseenter", (A, Q) => sr(A, Q)).on("mouseleave", (A, Q) => ar(A, Q)), Ve = Jt().outerRadius(N).innerRadius(k); + function ii(v, _, y, M, R, k, T, S, F) { + const H = Kn(n(), v), D = jn(n(), v), qt = it(g(V)).attr("width", "100%").attr("height", f).attr("viewBox", `0 0 ${o} ${f}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", _).attr("transform", `translate(${M}, ${R})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (E) => H.includes(E.data.label.split("#")[0]) || E.data.label.includes(b)).classed("elected", (E) => D.includes(E.data.label.split("#")[0]) && !E.data.label.includes(b)).attr("id", (E) => E.data.label).on("mouseenter", (E, tt) => ar(E, tt)).on("mouseleave", (E, tt) => lr(E, tt)), He = Wt().outerRadius(T).innerRadius(k); if (F) { - const A = Jt().outerRadius(k + 1).innerRadius(k); - Lt.append("path").attr("d", A).transition("global").duration(b).attr("d", (Q) => Ve(Q)).attr("fill", (Q) => qt(Q)).on("end", (Q) => ir()); + const E = Wt().outerRadius(k + 1).innerRadius(k); + qt.append("path").attr("d", E).transition("global").duration(A).attr("d", (tt) => He(tt)).attr("fill", (tt) => un(tt)).on("end", (tt) => sr()); } else - Lt.append("path").attr("d", (A) => Ve(A)).attr("fill", (A) => qt(A)), ir(); - return C && ti(v, x, O, R, N, V), x; - } - function Zs() { - const x = st(_(q)).select("#" + p).selectAll(".eliminated"); - x.size() > 0 && x.classed("finished", !0); - } - function Qs() { - const x = st(_(q)).select("#" + p).selectAll(".finished"); - x.size() > 0 && x.remove(); - } - function ta(v, g) { - const R = st(_(q)).select("#" + c).selectAll(".eliminated"), k = Jt().innerRadius(v), N = Jt().outerRadius(g); - R.classed("finished", !0).select("path").transition("global").duration(b).attrTween("d", function(C) { - const F = Ne(g, v); - return function(V) { - return N.innerRadius(F(V)), N(C); + qt.append("path").attr("d", (E) => He(E)).attr("fill", (E) => un(E)), sr(); + return S && ni(v, y, M, R, T, H), y; + } + function ta() { + const y = it(g(V)).select("#" + m).selectAll(".eliminated"); + y.size() > 0 && y.classed("finished", !0); + } + function ea() { + const y = it(g(V)).select("#" + m).selectAll(".finished"); + y.size() > 0 && y.remove(); + } + function na(v, _) { + const R = it(g(V)).select("#" + d).selectAll(".eliminated"), k = Wt().innerRadius(v), T = Wt().outerRadius(_); + R.classed("finished", !0).select("path").transition("global").duration(A).attrTween("d", function(S) { + const F = Te(_, v); + return function(H) { + return T.innerRadius(F(H)), T(S); }; - }).attr("fill", (C) => `url(#${C.data.label.split("#")[0].replaceAll(" ", "-")})`), R.clone(!0).classed("finished", !0).select("path").transition("global").duration(b).attrTween("d", function(C) { - const F = Ne(g, v); - return function(V) { - return k.outerRadius(F(V)), k(C); + }).attr("fill", (S) => `url(#${S.data.label.split("#")[0].replaceAll(" ", "-")})`), R.clone(!0).classed("finished", !0).select("path").transition("global").duration(A).attrTween("d", function(S) { + const F = Te(_, v); + return function(H) { + return k.outerRadius(F(H)), k(S); }; - }).attr("fill", (C) => qt(C)); + }).attr("fill", (S) => un(S)); } - function rr(v, g) { - const x = (v + g) / 2; - return x > Math.PI * 11 / 6 || x < Math.PI * 1 / 6 || x > Math.PI * 5 / 6 && x < Math.PI * 7 / 6 ? "middle" : x < Math.PI ? "start" : "end"; + function ir(v, _) { + const y = (v + _) / 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 ir() { - st(_(q)).select("#" + p).raise().append("g").remove(); + function sr() { + it(g(V)).select("#" + m).raise().append("g").remove(); } - function ea(v, g, x, O, R, k) { - const C = vr().sort(null).value((F) => F.value)(x); - return ri( + function ra(v, _, y, M, R, k) { + const S = pr().sort(null).value((F) => F.value)(y); + return si( v, - g, - C, + _, + S, /* previousPieInfo, */ - O, + M, R, k - ), C; - } - function ri(v, g, x, O, R, k) { - const N = Gn(n(), v), C = Kn(n(), v), F = Jt().outerRadius(R).innerRadius(O).startAngle((A) => A.startAngle).endAngle((A) => A.endAngle), V = Jt().outerRadius(R).innerRadius(O), H = st(_(q)).select("#" + g); - H.selectAll(".slice").attr("prevStart", (A) => A.startAngle).attr("prevEnd", (A) => A.endAngle); - const W = H.selectAll(".slice").data(x, (A) => A.data.label); - W.enter().append("g").attr("class", "slice").attr("id", (A) => A.data.label).classed("eliminated", !0).on("mouseenter", (A, Q) => sr(A, Q)).on("mouseleave", (A, Q) => ar(A, Q)).append("path").attr("d", (A) => V(A)).attr("fill", (A) => qt(A)), W.classed("eliminated", (A) => N.includes(A.data.label.split("#")[0])).classed("elected", (A) => C.includes(A.data.label.split("#")[0])).on("mouseenter", (A, Q) => sr(A, Q)).on("mouseleave", (A, Q) => ar(A, Q)); - let Lt = W.size(); - function Ve() { - Lt--, Lt <= 0 && (ir(), H.selectAll(".finished").remove()); + ), S; + } + function si(v, _, y, M, R, k) { + const T = Kn(n(), v), S = jn(n(), v), F = Wt().outerRadius(R).innerRadius(M).startAngle((E) => E.startAngle).endAngle((E) => E.endAngle), H = Wt().outerRadius(R).innerRadius(M), Y = it(g(V)).select("#" + _); + Y.selectAll(".slice").attr("prevStart", (E) => E.startAngle).attr("prevEnd", (E) => E.endAngle); + const Z = Y.selectAll(".slice").data(y, (E) => E.data.label); + Z.enter().append("g").attr("class", "slice").attr("id", (E) => E.data.label).classed("eliminated", !0).on("mouseenter", (E, tt) => ar(E, tt)).on("mouseleave", (E, tt) => lr(E, tt)).append("path").attr("d", (E) => H(E)).attr("fill", (E) => un(E)), Z.classed("eliminated", (E) => T.includes(E.data.label.split("#")[0])).classed("elected", (E) => S.includes(E.data.label.split("#")[0])).on("mouseenter", (E, tt) => ar(E, tt)).on("mouseleave", (E, tt) => lr(E, tt)); + let qt = Z.size(); + function He() { + qt--, qt <= 0 && (sr(), Y.selectAll(".finished").remove()); } - return W.select("path").transition("global").duration(b).attrTween("d", function(A) { - const Q = Number(st(this.parentNode).attr("prevStart")), ia = Number(st(this.parentNode).attr("prevEnd")), sa = Ne(Q, A.startAngle), aa = Ne(ia, A.endAngle); - return (si) => (F.startAngle(sa(si)).endAngle(aa(si)), F(A)); - }).on("end", Ve), k && Ws(v, x, R, N), x; + return Z.select("path").transition("global").duration(A).attrTween("d", function(E) { + const tt = Number(it(this.parentNode).attr("prevStart")), aa = Number(it(this.parentNode).attr("prevEnd")), la = Te(tt, E.startAngle), oa = Te(aa, E.endAngle); + return (li) => (F.startAngle(la(li)).endAngle(oa(li)), F(E)); + }).on("end", He), k && Zs(v, y, R, T), y; } - function sr(v, g) { - s(g.data.label.split("#")[0]), i("enter"), a(v.clientY); + function ar(v, _) { + s(_.data.label.split("#")[0]), i("enter"), a(v.clientY); } - function ar(v, g) { - s(g.data.label.split("#")[0]), i("leave"); + function lr(v, _) { + s(_.data.label.split("#")[0]), i("leave"); } - function na(v, g) { + function ia(v, _) { i("show-exhausted"), a(v.clientY); } - function ra(v, g) { + function sa(v, _) { i("hide-exhausted"); } - var ii = tc(); - return mn(ii, (v) => J(q, v), () => _(q)), ce(t, ii), Ur({ - runFullAnimationFn: L, - animateOnePhaseFn: At, + var ai = nc(); + return wn(ai, (v) => J(V, v), () => g(V)), ce(t, ai), Kr({ + runFullAnimationFn: nt, + animateOnePhaseFn: Ee, get jsonData() { return n(); }, set jsonData(v) { - n(v), ee(); + n(v), Ht(); }, get currentRound() { return r(); }, - set currentRound(v) { - r(v), ee(); + set currentRound(v = 1) { + r(v), Ht(); }, get mouseEventType() { return i(); }, set mouseEventType(v) { - i(v), ee(); + i(v), Ht(); }, get mouseData() { return s(); }, set mouseData(v) { - s(v), ee(); + s(v), Ht(); }, get mouseY() { return a(); }, set mouseY(v) { - a(v), ee(); + a(v), Ht(); + }, + get requestRoundChange() { + return l(); + }, + set requestRoundChange(v = (_) => { + }) { + l(v), Ht(); } }); } -gs( - Us, +ms( + Gs, { jsonData: {}, currentRound: {}, mouseEventType: {}, mouseData: {}, - mouseY: {} + mouseY: {}, + requestRoundChange: {} }, [], ["runFullAnimationFn", "animateOnePhaseFn"], !0 ); -function nc(t) { +function ic(t) { const e = []; if (!t || typeof t != "object") return { valid: !1, errors: ["Input is not a valid object"] }; @@ -4226,8 +4238,8 @@ function nc(t) { errors: e }; } -var rc = /* @__PURE__ */ Fe("  ", 1), ic = /* @__PURE__ */ Fe("About to eliminate: ", 1), sc = /* @__PURE__ */ Fe("  ", 1), ac = /* @__PURE__ */ Fe("Elected: ", 1), lc = /* @__PURE__ */ Fe("
", 1), oc = /* @__PURE__ */ Fe('


these ballots have already been eliminated.
', 1); -const uc = { +var sc = /* @__PURE__ */ qe("  ", 1), ac = /* @__PURE__ */ qe("About to eliminate: ", 1), lc = /* @__PURE__ */ qe("  ", 1), oc = /* @__PURE__ */ qe("Elected: ", 1), uc = /* @__PURE__ */ qe("
", 1), fc = /* @__PURE__ */ qe('


these ballots have already been eliminated.
', 1); +const cc = { hash: "svelte-hac7qn", code: `.page-container.svelte-hac7qn {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-hac7qn {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-hac7qn {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:1.3rem;left:50%;transform:translate(-50%);font-weight:bold;opacity:0;}.tooltip.svelte-hac7qn h3:where(.svelte-hac7qn) {text-align:center;}.animation-button-container.svelte-hac7qn {display:flex;justify-content:center;gap:10px;margin-bottom:1rem;}.pie-chart-container.svelte-hac7qn { /* width: 65%; */width:90%;min-width:800px; /* Larger minimum size */flex-grow:0; /* Don't grow beyond specified width */margin:0 auto;margin-right:40px; /* Add extra space on right */}.visualizations-container.svelte-hac7qn {display:flex;justify-content:space-between;width:100%;padding:0 20px;gap:80px;} @@ -4262,199 +4274,196 @@ const uc = { @media (max-width: 1300px) {.visualizations-container.svelte-hac7qn {flex-direction:column;align-items:center;} }` }; -function fc(t, e) { - Xr(e, !0), ps(t, uc); +function hc(t, e) { + Gr(e, !0), _s(t, cc); const n = 0.85; - let r = ve(e, "electionSummary", 7), i = ve(e, "currentRound", 7), s = ve(e, "onRoundChanged", 7, (y) => { - }); - Dn(() => { - s() && s()(i()); - }); - let a = Zt(null), l = Zt(null), o = Zt(""), f = Zt(xt([])), u = Zt(""), h = Zt(""), c = Zt(0), d = /* @__PURE__ */ Wn(() => p(r())); - function p(y) { - if (typeof y == "string") + let r = Qt(e, "electionSummary", 7), i = Qt(e, "currentRound", 7), s = Qt(e, "requestRoundChange", 7, (x) => { + }), a = Jt(null), l = Jt(null), o = Jt(""), f = Jt(xt([])), u = Jt(""), h = Jt(""), c = Jt(0), d = /* @__PURE__ */ Jn(() => p(r())); + function p(x) { + if (typeof x == "string") try { - y = JSON.parse(y); - } catch (L) { - return console.error("Failed to parse JSON string:", L), {}; + x = JSON.parse(x); + } catch (q) { + return console.error("Failed to parse JSON string:", q), {}; } - return console.log("RCtabSummary object status: ", nc(y)), y || {}; + return console.log("RCtabSummary object status: ", ic(x)), x || {}; } - function m() { - switch (_(u)) { + function m(x) { + s() ? (console.log("onRoundChange in PieChart: passing on request for round ", x), s()(x)) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); + } + function b() { + switch (g(u)) { case "enter": - ((y) => (J(f, xt(y[0])), J(o, xt(y[1]))))(w(_(h), i())), _(a) && (_(a).style.top = String(_(c) || 20) + "px", _(a).style.opacity = String(n)); + ((x) => (J(f, xt(x[0])), J(o, xt(x[1]))))($(g(h), i())), g(a) && (g(a).style.top = String(g(c) || 20) + "px", g(a).style.opacity = String(n)); break; case "leave": - _(a) && (_(a).style.opacity = "0"), J(f, xt([])), J(o, ""); + g(a) && (g(a).style.opacity = "0"), J(f, xt([])), J(o, ""); break; case "show-exhausted": - _(l) && (_(l).style.top = String(_(c) || 20) + "px", _(l).style.opacity = String(n)); + g(l) && (g(l).style.top = String(g(c) || 20) + "px", g(l).style.opacity = String(n)); break; case "hide-exhausted": - _(l) && (_(l).style.opacity = "0"); + g(l) && (g(l).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", _(u)); + console.log("Unknown mouse event: ", g(u)); break; } } - Dn(() => m()); - function E(y, L) { - return y == 1 ? L ? "vote was" : "vote will be" : L ? "votes were" : "votes will be"; - } - function w(y, L) { - const j = [], B = y === "exhausted" ? kr : y; - let it; - y == "exhausted" ? it = Un(_(d), 1) : it = _(d).results[0].tally[y], j.push(`${B} started with ${it} votes.`); - for (let et = 1; et <= L; et++) { - et === L && (y == "exhausted" ? it = Un(_(d), L) : it = _(d).results[L - 1].tally[y], j.push(`${B} has ${it} votes at round ${L}.`)); - const ut = _(d).results[et - 1].tallyResults; - for (let At = 0; At < ut.length; At++) { - const Le = ut[At].transfers, Ae = ut[At].eliminated, sn = ut[At].elected; - if (Ae) - Ae === y && j.push(`${B} will be eliminated on round ${et}.`); - else if (y === sn && (j.push(`${B} was elected on round ${et}.`), Le)) - for (let [qt, ln] of Object.entries(Le)) - j.push(`${ln} ${E(Number(ln), et < L)} transferred to ${qt} on round ${et}.`); - const an = Ae || sn; - if (an) { - const qt = Number(Le[y]); - qt && j.push(`${qt} ${E(qt, et < L)} transferred from ${an} on round ${et}.`); + Br(() => b()); + function w(x, q) { + return x == 1 ? q ? "vote was" : "vote will be" : q ? "votes were" : "votes will be"; + } + function $(x, q) { + const B = [], nt = x === "exhausted" ? kr : x; + let rt; + x == "exhausted" ? rt = Gn(g(d), 1) : rt = g(d).results[0].tally[x], B.push(`${nt} started with ${rt} votes.`); + for (let W = 1; W <= q; W++) { + W === q && (x == "exhausted" ? rt = Gn(g(d), q) : rt = g(d).results[q - 1].tally[x], B.push(`${nt} has ${rt} votes at round ${q}.`)); + const ut = g(d).results[W - 1].tallyResults; + for (let $t = 0; $t < ut.length; $t++) { + const Ve = ut[$t].transfers, Ee = ut[$t].eliminated, an = ut[$t].elected; + if (Ee) + Ee === x && B.push(`${nt} will be eliminated on round ${W}.`); + else if (x === an && (B.push(`${nt} was elected on round ${W}.`), Ve)) + for (let [_e, on] of Object.entries(Ve)) + B.push(`${on} ${w(Number(on), W < q)} transferred to ${_e} on round ${W}.`); + const ln = Ee || an; + if (ln) { + const _e = Number(Ve[x]); + _e && B.push(`${_e} ${w(_e, W < q)} transferred from ${ln} on round ${W}.`); } } } - return [j, B]; + return [B, nt]; } - function $() { - let y = 0; - for (let L = 1; L <= _(d).results.length; L++) { - const j = _(d).results[L - 1].tallyResults; - for (let B = 0; B < j.length; B++) - j[B].elected && y++; + function C() { + let x = 0; + for (let q = 1; q <= g(d).results.length; q++) { + const B = g(d).results[q - 1].tallyResults; + for (let nt = 0; nt < B.length; nt++) + B[nt].elected && x++; } - return y; + return x; } - let b; - function S() { - b && b.animateOnePhaseFn && b.animateOnePhaseFn(); + let A; + function O() { + A && A.animateOnePhaseFn && A.animateOnePhaseFn(); } function P() { - b && b.runFullAnimationFn && b.runFullAnimationFn(); - } - var D = oc(), Y = Ee(D), G = yt(Y); - G.__click = P; - var K = Vt(G, 2); - K.__click = S, mt(Y); - var q = Vt(Y, 2), nt = yt(q), tt = yt(nt), T = yt(tt); - mt(tt); - var M = Vt(tt, 2), _t = yt(M); + A && A.runFullAnimationFn && A.runFullAnimationFn(); + } + var K = fc(), j = Re(K), et = yt(j); + et.__click = P; + var z = Lt(et, 2); + z.__click = O, mt(j); + var I = Lt(j, 2), V = yt(I), N = yt(V), L = yt(N); + mt(N); + var _t = Lt(N, 2), Gt = yt(_t); { - var Gt = (y) => { - var L = ic(), j = Vt(Ee(L)); - fr(j, 17, () => Gn(_(d), i()), ur, (B, it) => { - var et = rc(), ut = Ee(et), At = yt(ut, !0); - mt(ut), on(), un(() => { - _i(ut, "color", de[_(it)]), He(At, _(it)); - }), ce(B, et); - }), ce(y, L); + var st = (x) => { + var q = ac(), B = Lt(Re(q)); + cr(B, 17, () => Kn(g(d), i()), fr, (nt, rt) => { + var W = sc(), ut = Re(W), $t = yt(ut, !0); + mt(ut), fn(), cn(() => { + mi(ut, "color", de[g(rt)]), Ye($t, g(rt)); + }), ce(nt, W); + }), ce(x, q); }; - vi(_t, (y) => { - Gn(_(d), i()).length > 0 && y(Gt); + _i(Gt, (x) => { + Kn(g(d), i()).length > 0 && x(st); }); } - var Pt = Vt(_t, 2); + var Nt = Lt(Gt, 2); { - var Dt = (y) => { - var L = ac(), j = Vt(Ee(L)); - fr(j, 17, () => Kn(_(d), i()), ur, (B, it) => { - var et = sc(), ut = Ee(et), At = yt(ut, !0); - mt(ut), on(), un(() => { - _i(ut, "color", de[_(it)]), He(At, _(it)); - }), ce(B, et); - }), ce(y, L); + var Kt = (x) => { + var q = oc(), B = Lt(Re(q)); + cr(B, 17, () => jn(g(d), i()), fr, (nt, rt) => { + var W = lc(), ut = Re(W), $t = yt(ut, !0); + mt(ut), fn(), cn(() => { + mi(ut, "color", de[g(rt)]), Ye($t, g(rt)); + }), ce(nt, W); + }), ce(x, q); }; - vi(Pt, (y) => { - Kn(_(d), i()).length > 0 && y(Dt); + _i(Nt, (x) => { + jn(g(d), i()).length > 0 && x(Kt); }); } - mt(M), mt(nt); - var Tt = Vt(nt, 2), It = yt(Tt), Kt = yt(It, !0); - mt(It); - var fe = Vt(It, 2); - fr(fe, 17, () => _(f), ur, (y, L) => { - var j = lc(), B = Ee(j), it = yt(B, !0); - mt(B), on(2), un(() => He(it, _(L))), ce(y, j); - }), mt(Tt), mn(Tt, (y) => J(a, y), () => _(a)); - var Ft = Vt(Tt, 2), jt = yt(Ft); - jt.nodeValue = `"${kr}" means all the candidates ranked on `, on(2), mt(Ft), mn(Ft, (y) => J(l, y), () => _(l)); - var rt = Vt(Ft, 2), $t = yt(rt), gt = yt($t); - return mn( - Us(gt, { + mt(_t), mt(V); + var Tt = Lt(V, 2), Dt = yt(Tt), ue = yt(Dt, !0); + mt(Dt); + var pe = Lt(Dt, 2); + cr(pe, 17, () => g(f), fr, (x, q) => { + var B = uc(), nt = Re(B), rt = yt(nt, !0); + mt(nt), fn(2), cn(() => Ye(rt, g(q))), ce(x, B); + }), mt(Tt), wn(Tt, (x) => J(a, x), () => g(a)); + var Ct = Lt(Tt, 2), gt = yt(Ct); + gt.nodeValue = `"${kr}" means all the candidates ranked on `, fn(2), mt(Ct), wn(Ct, (x) => J(l, x), () => g(l)); + var fe = Lt(Ct, 2), It = yt(fe), Ft = yt(It); + return wn( + Gs(Ft, { get jsonData() { - return _(d); + return g(d); }, get currentRound() { return i(); }, - set currentRound(y) { - i(y); - }, + requestRoundChange: m, get mouseEventType() { - return _(u); + return g(u); }, - set mouseEventType(y) { - J(u, xt(y)); + set mouseEventType(x) { + J(u, xt(x)); }, get mouseData() { - return _(h); + return g(h); }, - set mouseData(y) { - J(h, xt(y)); + set mouseData(x) { + J(h, xt(x)); }, get mouseY() { - return _(c); + return g(c); }, - set mouseY(y) { - J(c, xt(y)); + set mouseY(x) { + J(c, xt(x)); } }), - (y) => b = y, - () => b - ), mt($t), mt(rt), mt(q), un( - (y) => { - He(T, `${_(d).config.contest ?? ""}, ${y ?? ""} to be elected, Round ${i() ?? ""}.`), He(Kt, _(o)); + (x) => A = x, + () => A + ), mt(It), mt(fe), mt(I), cn( + (x) => { + Ye(L, `${g(d).config.contest ?? ""}, ${x ?? ""} to be elected, Round ${i() ?? ""}.`), Ye(ue, g(o)); }, - [$] - ), ce(t, D), Ur({ + [C] + ), ce(t, K), Kr({ get electionSummary() { return r(); }, - set electionSummary(y) { - r(y), ee(); + set electionSummary(x) { + r(x), Ht(); }, get currentRound() { return i(); }, - set currentRound(y) { - i(y), ee(); + set currentRound(x) { + i(x), Ht(); }, - get onRoundChanged() { + get requestRoundChange() { return s(); }, - set onRoundChanged(y = (L) => { + set requestRoundChange(x = (q) => { }) { - s(y), ee(); + s(x), Ht(); } }); } -il(["click"]); -customElements.define("pie-chart", gs( - fc, +al(["click"]); +customElements.define("pie-chart", ms( + hc, { electionSummary: {}, currentRound: {}, - onRoundChanged: {} + requestRoundChange: {} }, [], [], diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index e76dbbe9..cf957520 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -12,7 +12,7 @@ // Create the pie-chart element const pieChart = document.createElement("pie-chart"); pieChart.setAttribute("electionSummary", JSON.stringify(electionSummary)); - pieChart.setAttribute('onRoundChanged', updateSliderRound); + pieChart.requestRoundChange = updateRound; // Append it to the div document.getElementById("pie-body").appendChild(pieChart); @@ -32,7 +32,11 @@ pieChart.setAttribute("currentRound", roundNum+1); } - function updateSliderRound(roundNum) { + // When the pie chart is animating it knows it is advancing rounds, but to avoid reactive + // loops it requests to be told the new currentRound rather than using 2-way binding. + // And we also update the slider state while we're at it. + function updateRound(roundNum) { + pieChart.setAttribute("currentRound", roundNum); document.getElementById('pie-slider-container').setAttribute('value', roundNum-1); } From 236c955672d50e10986ea7ca01d088853cb4061c Mon Sep 17 00:00:00 2001 From: skaphan Date: Mon, 17 Mar 2025 16:51:29 -0700 Subject: [PATCH 12/18] Everything is working except updating slider when pie chart animates. New candidateColors prop that can be set. --- static/pie/pie-chart.es.js | 3204 ++++++++++++++-------------- templates/pie/pie-nonblocking.html | 31 +- 2 files changed, 1637 insertions(+), 1598 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 224f6106..f8204e37 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,131 +1,131 @@ -var ua = Object.defineProperty; -var oi = (t) => { +var fa = Object.defineProperty; +var ui = (t) => { throw TypeError(t); }; -var fa = (t, e, n) => e in t ? ua(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var kt = (t, e, n) => fa(t, typeof e != "symbol" ? e + "" : e, n), ui = (t, e, n) => e.has(t) || oi("Cannot " + n); -var ft = (t, e, n) => (ui(t, e, "read from private field"), n ? n.call(t) : e.get(t)), or = (t, e, n) => e.has(t) ? oi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), ur = (t, e, n, r) => (ui(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); -const ca = "5"; -typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ca); -const ha = 1, da = 2, va = 16, pa = 1, _a = 4, ga = 8, ma = 16, ya = 2, Fi = "[", Sr = "[!", Mr = "]", Ge = {}, ct = Symbol(), fi = !1, Ot = 2, qi = 4, Or = 8, Pr = 16, ae = 32, De = 64, Nn = 128, Rt = 256, Tn = 512, pt = 1024, le = 2048, Ie = 4096, ne = 8192, Wn = 16384, wa = 32768, Dr = 65536, xa = 1 << 19, Li = 1 << 20, Ke = Symbol("$state"), Vi = Symbol("legacy props"); -var Ir = Array.isArray, ba = Array.prototype.indexOf, Fr = Array.from, Cn = Object.keys, kn = Object.defineProperty, we = Object.getOwnPropertyDescriptor, $a = Object.prototype, Aa = Array.prototype, Ea = Object.getPrototypeOf; -function Hi(t) { +var ca = (t, e, n) => e in t ? fa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var St = (t, e, n) => ca(t, typeof e != "symbol" ? e + "" : e, n), fi = (t, e, n) => e.has(t) || ui("Cannot " + n); +var ct = (t, e, n) => (fi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), fr = (t, e, n) => e.has(t) ? ui("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), cr = (t, e, n, r) => (fi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); +const ha = "5"; +typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ha); +const da = 1, va = 2, pa = 16, _a = 1, ga = 4, ma = 8, ya = 16, wa = 2, qi = "[", Pr = "[!", Or = "]", Ke = {}, ht = Symbol(), ci = !1, Ot = 2, Li = 4, Dr = 8, Ir = 16, le = 32, Ie = 64, Tn = 128, Ct = 256, Sn = 512, _t = 1024, oe = 2048, Fe = 4096, re = 8192, Zn = 16384, xa = 32768, Fr = 65536, ba = 1 << 19, Vi = 1 << 20, je = Symbol("$state"), Hi = Symbol("legacy props"); +var qr = Array.isArray, $a = Array.prototype.indexOf, Lr = Array.from, kn = Object.keys, Mn = Object.defineProperty, xe = Object.getOwnPropertyDescriptor, Aa = Object.prototype, Ea = Array.prototype, Ra = Object.getPrototypeOf; +function Yi(t) { for (var e = 0; e < t.length; e++) t[e](); } -let We = [], _r = []; -function Yi() { - var t = We; - We = [], Hi(t); +let Je = [], mr = []; +function Bi() { + var t = Je; + Je = [], Yi(t); } -function Ra() { - var t = _r; - _r = [], Hi(t); +function Ca() { + var t = mr; + mr = [], Yi(t); } -function Bi(t) { - We.length === 0 && queueMicrotask(Yi), We.push(t); +function zi(t) { + Je.length === 0 && queueMicrotask(Bi), Je.push(t); } -function ci() { - We.length > 0 && Yi(), _r.length > 0 && Ra(); +function hi() { + Je.length > 0 && Bi(), mr.length > 0 && Ca(); } -function zi(t) { +function Xi(t) { return t === this.v; } function Na(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function qr(t) { +function Vr(t) { return !Na(t, this.v); } function Ta(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function Ca() { +function Sa() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } function ka(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function Sa() { +function Ma() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Ma() { +function Pa() { throw new Error("https://svelte.dev/e/hydration_failed"); } function Oa(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function Pa() { +function Da() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Da() { +function Ia() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function Ia() { +function Fa() { throw new Error("https://svelte.dev/e/state_unsafe_local_read"); } -function Fa() { +function qa() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -let qa = !1; +let La = !1; function Et(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: t, reactions: null, - equals: zi, + equals: Xi, rv: 0, wv: 0 }; return n; } -function Jt(t) { - return /* @__PURE__ */ La(Et(t)); +function Zt(t) { + return /* @__PURE__ */ Va(Et(t)); } // @__NO_SIDE_EFFECTS__ -function Lr(t, e = !1) { +function Hr(t, e = !1) { const n = Et(t); - return e || (n.equals = qr), n; + return e || (n.equals = Vr), n; } // @__NO_SIDE_EFFECTS__ -function La(t) { - return U !== null && !St && U.f & Ot && (Bt === null ? Ba([t]) : Bt.push(t)), t; +function Va(t) { + return X !== null && !Mt && X.f & Ot && (zt === null ? za([t]) : zt.push(t)), t; } -function J(t, e) { - return U !== null && !St && fs() && U.f & (Ot | Pr) && // If the source was created locally within the current derived, then +function j(t, e) { + return X !== null && !Mt && cs() && X.f & (Ot | Ir) && // If the source was created locally within the current derived, then // we allow the mutation. - (Bt === null || !Bt.includes(t)) && Fa(), Xi(t, e); -} -function Xi(t, e) { - return t.equals(e) || (t.v, t.v = e, t.wv = ts(), Ui(t, le), G !== null && G.f & pt && !(G.f & (ae | De)) && (Zt === null ? za([t]) : Zt.push(t))), e; + (zt === null || !zt.includes(t)) && qa(), Ui(t, e); } function Ui(t, e) { + return t.equals(e) || (t.v, t.v = e, t.wv = es(), Gi(t, oe), U !== null && U.f & _t && !(U.f & (le | Ie)) && (te === null ? Xa([t]) : te.push(t))), e; +} +function Gi(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; - a & le || (re(s, e), a & (pt | Rt) && (a & Ot ? Ui( + a & oe || (ie(s, e), a & (_t | Ct) && (a & Ot ? Gi( /** @type {Derived} */ s, - Ie - ) : tr( + Fe + ) : nr( /** @type {Effect} */ s ))); } } // @__NO_SIDE_EFFECTS__ -function Jn(t) { - var e = Ot | le, n = U !== null && U.f & Ot ? ( +function Qn(t) { + var e = Ot | oe, n = X !== null && X.f & Ot ? ( /** @type {Derived} */ - U + X ) : null; - return G === null || n !== null && n.f & Rt ? e |= Rt : G.f |= Li, { - ctx: vt, + return U === null || n !== null && n.f & Ct ? e |= Ct : U.f |= Vi, { + ctx: pt, deps: null, effects: null, - equals: zi, + equals: Xi, f: e, fn: t, reactions: null, @@ -135,26 +135,26 @@ function Jn(t) { null ), wv: 0, - parent: n ?? G + parent: n ?? U }; } // @__NO_SIDE_EFFECTS__ -function Va(t) { - const e = /* @__PURE__ */ Jn(t); - return e.equals = qr, e; +function Ha(t) { + const e = /* @__PURE__ */ Qn(t); + return e.equals = Vr, e; } -function Gi(t) { +function Ki(t) { var e = t.effects; if (e !== null) { t.effects = null; for (var n = 0; n < e.length; n += 1) - ie( + se( /** @type {Effect} */ e[n] ); } } -function Ha(t) { +function Ya(t) { for (var e = t.parent; e !== null; ) { if (!(e.f & Ot)) return ( @@ -165,80 +165,80 @@ function Ha(t) { } return null; } -function Ya(t) { - var e, n = G; - Me(Ha(t)); +function Ba(t) { + var e, n = U; + Pe(Ya(t)); try { - Gi(t), e = ns(t); + Ki(t), e = rs(t); } finally { - Me(n); + Pe(n); } return e; } -function Ki(t) { - var e = Ya(t), n = (ve || t.f & Rt) && t.deps !== null ? Ie : pt; - re(t, n), t.equals(e) || (t.v = e, t.wv = ts()); +function ji(t) { + var e = Ba(t), n = (de || t.f & Ct) && t.deps !== null ? Fe : _t; + ie(t, n), t.equals(e) || (t.v = e, t.wv = es()); } -function Vr(t) { +function Yr(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -let Q = !1; -function ee(t) { - Q = t; +let Z = !1; +function ne(t) { + Z = t; } -let X; -function Xt(t) { +let z; +function Ut(t) { if (t === null) - throw Vr(), Ge; - return X = t; + throw Yr(), Ke; + return z = t; } -function Zn() { - return Xt( +function tr() { + return Ut( /** @type {TemplateNode} */ - /* @__PURE__ */ oe(X) + /* @__PURE__ */ ue(z) ); } -function mt(t) { - if (Q) { - if (/* @__PURE__ */ oe(X) !== null) - throw Vr(), Ge; - X = t; +function gt(t) { + if (Z) { + if (/* @__PURE__ */ ue(z) !== null) + throw Yr(), Ke; + z = t; } } -function fn(t = 1) { - if (Q) { - for (var e = t, n = X; e--; ) +function hn(t = 1) { + if (Z) { + for (var e = t, n = z; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ oe(n); - X = n; + /* @__PURE__ */ ue(n); + z = n; } } -function gr() { - for (var t = 0, e = X; ; ) { +function yr() { + for (var t = 0, e = z; ; ) { if (e.nodeType === 8) { var n = ( /** @type {Comment} */ e.data ); - if (n === Mr) { + if (n === Or) { if (t === 0) return e; t -= 1; - } else (n === Fi || n === Sr) && (t += 1); + } else (n === qi || n === Pr) && (t += 1); } var r = ( /** @type {TemplateNode} */ - /* @__PURE__ */ oe(e) + /* @__PURE__ */ ue(e) ); e.remove(), e = r; } } -function xt(t, e = null, n) { - if (typeof t != "object" || t === null || Ke in t) +function wt(t, e = null, n) { + if (typeof t != "object" || t === null || je in t) return t; - const r = Ea(t); - if (r !== $a && r !== Aa) + const r = Ra(t); + if (r !== Aa && r !== Ea) return t; - var i = /* @__PURE__ */ new Map(), s = Ir(t), a = Et(0); + var i = /* @__PURE__ */ new Map(), s = qr(t), a = Et(0); s && i.set("length", Et( /** @type {any[]} */ t.length @@ -249,34 +249,34 @@ function xt(t, e = null, n) { t, { defineProperty(o, f, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Pa(); + (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Da(); var h = i.get(f); - return h === void 0 ? (h = Et(u.value), i.set(f, h)) : J(h, xt(u.value, l)), !0; + return h === void 0 ? (h = Et(u.value), i.set(f, h)) : j(h, wt(u.value, l)), !0; }, deleteProperty(o, f) { var u = i.get(f); if (u === void 0) - f in o && i.set(f, Et(ct)); + f in o && i.set(f, Et(ht)); else { if (s && typeof f == "string") { var h = ( /** @type {Source} */ i.get("length") ), c = Number(f); - Number.isInteger(c) && c < h.v && J(h, c); + Number.isInteger(c) && c < h.v && j(h, c); } - J(u, ct), hi(a); + j(u, ht), di(a); } return !0; }, get(o, f, u) { var p; - if (f === Ke) + if (f === je) return t; var h = i.get(f), c = f in o; - if (h === void 0 && (!c || (p = we(o, f)) != null && p.writable) && (h = Et(xt(c ? o[f] : ct, l)), i.set(f, h)), h !== void 0) { + if (h === void 0 && (!c || (p = xe(o, f)) != null && p.writable) && (h = Et(wt(c ? o[f] : ht, l)), i.set(f, h)), h !== void 0) { var d = g(h); - return d === ct ? void 0 : d; + return d === ht ? void 0 : d; } return Reflect.get(o, f, u); }, @@ -287,7 +287,7 @@ function xt(t, e = null, n) { h && (u.value = g(h)); } else if (u === void 0) { var c = i.get(f), d = c == null ? void 0 : c.v; - if (c !== void 0 && d !== ct) + if (c !== void 0 && d !== ht) return { enumerable: !0, configurable: !0, @@ -299,13 +299,13 @@ function xt(t, e = null, n) { }, has(o, f) { var d; - if (f === Ke) + if (f === je) return !0; - var u = i.get(f), h = u !== void 0 && u.v !== ct || Reflect.has(o, f); - if (u !== void 0 || G !== null && (!h || (d = we(o, f)) != null && d.writable)) { - u === void 0 && (u = Et(h ? xt(o[f], l) : ct), i.set(f, u)); + var u = i.get(f), h = u !== void 0 && u.v !== ht || Reflect.has(o, f); + if (u !== void 0 || U !== null && (!h || (d = xe(o, f)) != null && d.writable)) { + u === void 0 && (u = Et(h ? wt(o[f], l) : ht), i.set(f, u)); var c = g(u); - if (c === ct) + if (c === ht) return !1; } return h; @@ -316,20 +316,20 @@ function xt(t, e = null, n) { if (s && f === "length") for (var p = u; p < /** @type {Source} */ c.v; p += 1) { - var m = i.get(p + ""); - m !== void 0 ? J(m, ct) : p in o && (m = Et(ct), i.set(p + "", m)); + var w = i.get(p + ""); + w !== void 0 ? j(w, ht) : p in o && (w = Et(ht), i.set(p + "", w)); } - c === void 0 ? (!d || (C = we(o, f)) != null && C.writable) && (c = Et(void 0), J(c, xt(u, l)), i.set(f, c)) : (d = c.v !== ct, J(c, xt(u, l))); - var b = Reflect.getOwnPropertyDescriptor(o, f); - if (b != null && b.set && b.set.call(h, u), !d) { + c === void 0 ? (!d || (C = xe(o, f)) != null && C.writable) && (c = Et(void 0), j(c, wt(u, l)), i.set(f, c)) : (d = c.v !== ht, j(c, wt(u, l))); + var $ = Reflect.getOwnPropertyDescriptor(o, f); + if ($ != null && $.set && $.set.call(h, u), !d) { if (s && typeof f == "string") { - var w = ( + var m = ( /** @type {Source} */ i.get("length") - ), $ = Number(f); - Number.isInteger($) && $ >= w.v && J(w, $ + 1); + ), A = Number(f); + Number.isInteger(A) && A >= m.v && j(m, A + 1); } - hi(a); + di(a); } return !0; }, @@ -337,120 +337,120 @@ function xt(t, e = null, n) { g(a); var f = Reflect.ownKeys(o).filter((c) => { var d = i.get(c); - return d === void 0 || d.v !== ct; + return d === void 0 || d.v !== ht; }); for (var [u, h] of i) - h.v !== ct && !(u in o) && f.push(u); + h.v !== ht && !(u in o) && f.push(u); return f; }, setPrototypeOf() { - Da(); + Ia(); } } ); } -function hi(t, e = 1) { - J(t, t.v + e); +function di(t, e = 1) { + j(t, t.v + e); } -var di, ji, Wi, Ji; -function mr() { - if (di === void 0) { - di = window, ji = /Firefox/.test(navigator.userAgent); +var vi, Wi, Ji, Zi; +function wr() { + if (vi === void 0) { + vi = window, Wi = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype; - Wi = we(e, "firstChild").get, Ji = we(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; + Ji = xe(e, "firstChild").get, Zi = xe(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; } } -function Sn(t = "") { +function Pn(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function be(t) { - return Wi.call(t); +function $e(t) { + return Ji.call(t); } // @__NO_SIDE_EFFECTS__ -function oe(t) { - return Ji.call(t); +function ue(t) { + return Zi.call(t); } -function yt(t, e) { - if (!Q) - return /* @__PURE__ */ be(t); +function mt(t, e) { + if (!Z) + return /* @__PURE__ */ $e(t); var n = ( /** @type {TemplateNode} */ - /* @__PURE__ */ be(X) + /* @__PURE__ */ $e(z) ); if (n === null) - n = X.appendChild(Sn()); + n = z.appendChild(Pn()); else if (e && n.nodeType !== 3) { - var r = Sn(); - return n == null || n.before(r), Xt(r), r; + var r = Pn(); + return n == null || n.before(r), Ut(r), r; } - return Xt(n), n; + return Ut(n), n; } -function Re(t, e) { - if (!Q) { +function Ce(t, e) { + if (!Z) { var n = ( /** @type {DocumentFragment} */ - /* @__PURE__ */ be( + /* @__PURE__ */ $e( /** @type {Node} */ t ) ); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ oe(n) : n; + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ue(n) : n; } - return X; + return z; } -function Lt(t, e = 1, n = !1) { - let r = Q ? X : t; +function Ht(t, e = 1, n = !1) { + let r = Z ? z : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ oe(r); - if (!Q) + /* @__PURE__ */ ue(r); + if (!Z) return r; var s = r == null ? void 0 : r.nodeType; if (n && s !== 3) { - var a = Sn(); - return r === null ? i == null || i.after(a) : r.before(a), Xt(a), a; + var a = Pn(); + return r === null ? i == null || i.after(a) : r.before(a), Ut(a), a; } - return Xt(r), /** @type {TemplateNode} */ + return Ut(r), /** @type {TemplateNode} */ r; } -function Zi(t) { +function Qi(t) { t.textContent = ""; } -let mn = !1, Mn = !1, On = null, yn = !1, Hr = !1; -function vi(t) { - Hr = t; -} -let je = []; -let U = null, St = !1; -function Se(t) { - U = t; +let wn = !1, On = !1, Dn = null, xn = !1, Br = !1; +function pi(t) { + Br = t; } -let G = null; +let We = []; +let X = null, Mt = !1; function Me(t) { - G = t; + X = t; } -let Bt = null; -function Ba(t) { - Bt = t; +let U = null; +function Pe(t) { + U = t; } -let lt = null, wt = 0, Zt = null; +let zt = null; function za(t) { - Zt = t; + zt = t; +} +let ot = null, yt = 0, te = null; +function Xa(t) { + te = t; } -let Qi = 1, Pn = 0, ve = !1; -function ts() { - return ++Qi; +let ts = 1, In = 0, de = !1; +function es() { + return ++ts; } -function rn(t) { +function sn(t) { var h; var e = t.f; - if (e & le) + if (e & oe) return !0; - if (e & Ie) { - var n = t.deps, r = (e & Rt) !== 0; + if (e & Fe) { + var n = t.deps, r = (e & Ct) !== 0; if (n !== null) { - var i, s, a = (e & Tn) !== 0, l = r && G !== null && !ve, o = n.length; + var i, s, a = (e & Sn) !== 0, l = r && U !== null && !de, o = n.length; if (a || l) { var f = ( /** @type {Derived} */ @@ -458,104 +458,104 @@ function rn(t) { ), u = f.parent; for (i = 0; i < o; i++) s = n[i], (a || !((h = s == null ? void 0 : s.reactions) != null && h.includes(f))) && (s.reactions ?? (s.reactions = [])).push(f); - a && (f.f ^= Tn), l && u !== null && !(u.f & Rt) && (f.f ^= Rt); + a && (f.f ^= Sn), l && u !== null && !(u.f & Ct) && (f.f ^= Ct); } for (i = 0; i < o; i++) - if (s = n[i], rn( + if (s = n[i], sn( /** @type {Derived} */ s - ) && Ki( + ) && ji( /** @type {Derived} */ s ), s.wv > t.wv) return !0; } - (!r || G !== null && !ve) && re(t, pt); + (!r || U !== null && !de) && ie(t, _t); } return !1; } -function Xa(t, e) { +function Ua(t, e) { for (var n = e; n !== null; ) { - if (n.f & Nn) + if (n.f & Tn) try { n.fn(t); return; } catch { - n.f ^= Nn; + n.f ^= Tn; } n = n.parent; } - throw mn = !1, t; + throw wn = !1, t; } -function Ua(t) { - return (t.f & Wn) === 0 && (t.parent === null || (t.parent.f & Nn) === 0); +function Ga(t) { + return (t.f & Zn) === 0 && (t.parent === null || (t.parent.f & Tn) === 0); } -function Qn(t, e, n, r) { - if (mn) { - if (n === null && (mn = !1), Ua(e)) +function er(t, e, n, r) { + if (wn) { + if (n === null && (wn = !1), Ga(e)) throw t; return; } - n !== null && (mn = !0); + n !== null && (wn = !0); { - Xa(t, e); + Ua(t, e); return; } } -function es(t, e, n = !0) { +function ns(t, e, n = !0) { var r = t.reactions; if (r !== null) for (var i = 0; i < r.length; i++) { var s = r[i]; - s.f & Ot ? es( + s.f & Ot ? ns( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? re(s, le) : s.f & pt && re(s, Ie), tr( + ) : e === s && (n ? ie(s, oe) : s.f & _t && ie(s, Fe), nr( /** @type {Effect} */ s )); } } -function ns(t) { +function rs(t) { var d; - var e = lt, n = wt, r = Zt, i = U, s = ve, a = Bt, l = vt, o = St, f = t.f; - lt = /** @type {null | Value[]} */ - null, wt = 0, Zt = null, ve = (f & Rt) !== 0 && (St || !yn || U === null), U = f & (ae | De) ? null : t, Bt = null, pi(t.ctx), St = !1, Pn++; + var e = ot, n = yt, r = te, i = X, s = de, a = zt, l = pt, o = Mt, f = t.f; + ot = /** @type {null | Value[]} */ + null, yt = 0, te = null, de = (f & Ct) !== 0 && (Mt || !xn || X === null), X = f & (le | Ie) ? null : t, zt = null, _i(t.ctx), Mt = !1, In++; try { var u = ( /** @type {Function} */ (0, t.fn)() ), h = t.deps; - if (lt !== null) { + if (ot !== null) { var c; - if (Dn(t, wt), h !== null && wt > 0) - for (h.length = wt + lt.length, c = 0; c < lt.length; c++) - h[wt + c] = lt[c]; + if (Fn(t, yt), h !== null && yt > 0) + for (h.length = yt + ot.length, c = 0; c < ot.length; c++) + h[yt + c] = ot[c]; else - t.deps = h = lt; - if (!ve) - for (c = wt; c < h.length; c++) + t.deps = h = ot; + if (!de) + for (c = yt; c < h.length; c++) ((d = h[c]).reactions ?? (d.reactions = [])).push(t); - } else h !== null && wt < h.length && (Dn(t, wt), h.length = wt); - if (fs() && Zt !== null && !St && h !== null && !(t.f & (Ot | Ie | le))) + } else h !== null && yt < h.length && (Fn(t, yt), h.length = yt); + if (cs() && te !== null && !Mt && h !== null && !(t.f & (Ot | Fe | oe))) for (c = 0; c < /** @type {Source[]} */ - Zt.length; c++) - es( - Zt[c], + te.length; c++) + ns( + te[c], /** @type {Effect} */ t ); - return i !== null && Pn++, u; + return i !== null && In++, u; } finally { - lt = e, wt = n, Zt = r, U = i, ve = s, Bt = a, pi(l), St = o; + ot = e, yt = n, te = r, X = i, de = s, zt = a, _i(l), Mt = o; } } -function Ga(t, e) { +function Ka(t, e) { let n = e.reactions; if (n !== null) { - var r = ba.call(n, t); + var r = $a.call(n, t); if (r !== -1) { var i = n.length - 1; i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); @@ -564,108 +564,108 @@ function Ga(t, e) { n === null && e.f & Ot && // 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 - (lt === null || !lt.includes(e)) && (re(e, Ie), e.f & (Rt | Tn) || (e.f ^= Tn), Gi( + (ot === null || !ot.includes(e)) && (ie(e, Fe), e.f & (Ct | Sn) || (e.f ^= Sn), Ki( /** @type {Derived} **/ e - ), Dn( + ), Fn( /** @type {Derived} **/ e, 0 )); } -function Dn(t, e) { +function Fn(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - Ga(t, n[r]); + Ka(t, n[r]); } -function Yr(t) { +function zr(t) { var e = t.f; - if (!(e & Wn)) { - re(t, pt); - var n = G, r = vt, i = yn; - G = t, yn = !0; + if (!(e & Zn)) { + ie(t, _t); + var n = U, r = pt, i = xn; + U = t, xn = !0; try { - e & Pr ? nl(t) : as(t), ss(t); - var s = ns(t); - t.teardown = typeof s == "function" ? s : null, t.wv = Qi; + e & Ir ? rl(t) : ls(t), as(t); + var s = rs(t); + t.teardown = typeof s == "function" ? s : null, t.wv = ts; var a = t.deps, l; - fi && qa && t.f & le; + ci && La && t.f & oe; } catch (o) { - Qn(o, t, n, r || t.ctx); + er(o, t, n, r || t.ctx); } finally { - yn = i, G = n; + xn = i, U = n; } } } -function Ka() { +function ja() { try { - Sa(); + Ma(); } catch (t) { - if (On !== null) - Qn(t, On, null); + if (Dn !== null) + er(t, Dn, null); else throw t; } } -function rs() { +function is() { try { - for (var t = 0; je.length > 0; ) { - t++ > 1e3 && Ka(); - var e = je, n = e.length; - je = []; + for (var t = 0; We.length > 0; ) { + t++ > 1e3 && ja(); + var e = We, n = e.length; + We = []; for (var r = 0; r < n; r++) { var i = e[r]; - i.f & pt || (i.f ^= pt); - var s = Wa(i); - ja(s); + i.f & _t || (i.f ^= _t); + var s = Ja(i); + Wa(s); } } } finally { - Mn = !1, On = null; + On = !1, Dn = null; } } -function ja(t) { +function Wa(t) { var e = t.length; if (e !== 0) for (var n = 0; n < e; n++) { var r = t[n]; - if (!(r.f & (Wn | ne))) + if (!(r.f & (Zn | re))) try { - rn(r) && (Yr(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? ls(r) : r.fn = null)); + sn(r) && (zr(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? os(r) : r.fn = null)); } catch (i) { - Qn(i, r, null, r.ctx); + er(i, r, null, r.ctx); } } } -function tr(t) { - Mn || (Mn = !0, queueMicrotask(rs)); - for (var e = On = t; e.parent !== null; ) { +function nr(t) { + On || (On = !0, queueMicrotask(is)); + for (var e = Dn = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (n & (De | ae)) { - if (!(n & pt)) return; - e.f ^= pt; + if (n & (Ie | le)) { + if (!(n & _t)) return; + e.f ^= _t; } } - je.push(e); + We.push(e); } -function Wa(t) { +function Ja(t) { for (var e = [], n = t.first; n !== null; ) { - var r = n.f, i = (r & ae) !== 0, s = i && (r & pt) !== 0; - if (!s && !(r & ne)) { - if (r & qi) + var r = n.f, i = (r & le) !== 0, s = i && (r & _t) !== 0; + if (!s && !(r & re)) { + if (r & Li) e.push(n); else if (i) - n.f ^= pt; + n.f ^= _t; else { - var a = U; + var a = X; try { - U = n, rn(n) && Yr(n); + X = n, sn(n) && zr(n); } catch (f) { - Qn(f, n, null, n.ctx); + er(f, n, null, n.ctx); } finally { - U = a; + X = a; } } var l = n.first; @@ -680,10 +680,10 @@ function Wa(t) { } return e; } -function Ht(t) { +function Rt(t) { var e; - for (ci(); je.length > 0; ) - Mn = !0, rs(), ci(); + for (hi(); We.length > 0; ) + On = !0, is(), hi(); return ( /** @type {T} */ e @@ -691,10 +691,10 @@ function Ht(t) { } function g(t) { var e = t.f, n = (e & Ot) !== 0; - if (U !== null && !St) { - Bt !== null && Bt.includes(t) && Ia(); - var r = U.deps; - t.rv < Pn && (t.rv = Pn, lt === null && r !== null && r[wt] === t ? wt++ : lt === null ? lt = [t] : (!ve || !lt.includes(t)) && lt.push(t)); + if (X !== null && !Mt) { + zt !== null && zt.includes(t) && Fa(); + var r = X.deps; + t.rv < In && (t.rv = In, ot === null && r !== null && r[yt] === t ? yt++ : ot === null ? ot = [t] : (!de || !ot.includes(t)) && ot.push(t)); } else if (n && /** @type {Derived} */ t.deps === null && /** @type {Derived} */ t.effects === null) { @@ -702,37 +702,37 @@ function g(t) { /** @type {Derived} */ t ), s = i.parent; - s !== null && !(s.f & Rt) && (i.f ^= Rt); + s !== null && !(s.f & Ct) && (i.f ^= Ct); } return n && (i = /** @type {Derived} */ - t, rn(i) && Ki(i)), t.v; + t, sn(i) && ji(i)), t.v; } -function In(t) { - var e = St; +function qn(t) { + var e = Mt; try { - return St = !0, t(); + return Mt = !0, t(); } finally { - St = e; + Mt = e; } } -const Ja = -7169; -function re(t, e) { - t.f = t.f & Ja | e; +const Za = -7169; +function ie(t, e) { + t.f = t.f & Za | e; } -function Za(t) { - G === null && U === null && ka(), U !== null && U.f & Rt && G === null && Ca(), Hr && Ta(); +function Qa(t) { + U === null && X === null && ka(), X !== null && X.f & Ct && U === null && Sa(), Br && Ta(); } -function Qa(t, e) { +function tl(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function Fe(t, e, n, r = !0) { - var i = (t & De) !== 0, s = G, a = { - ctx: vt, +function qe(t, e, n, r = !0) { + var i = (t & Ie) !== 0, s = U, a = { + ctx: pt, deps: null, nodes_start: null, nodes_end: null, - f: t | le, + f: t | oe, first: null, fn: e, last: null, @@ -745,126 +745,126 @@ function Fe(t, e, n, r = !0) { }; if (n) try { - Yr(a), a.f |= wa; + zr(a), a.f |= xa; } catch (f) { - throw ie(a), f; + throw se(a), f; } - else e !== null && tr(a); - var l = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (Li | Nn)) === 0; - if (!l && !i && r && (s !== null && Qa(a, s), U !== null && U.f & Ot)) { + else e !== null && nr(a); + var l = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (Vi | Tn)) === 0; + if (!l && !i && r && (s !== null && tl(a, s), X !== null && X.f & Ot)) { var o = ( /** @type {Derived} */ - U + X ); (o.effects ?? (o.effects = [])).push(a); } return a; } -function Br(t) { - Za(); - var e = G !== null && (G.f & ae) !== 0 && vt !== null && !vt.m; +function Xr(t) { + Qa(); + var e = U !== null && (U.f & le) !== 0 && pt !== null && !pt.m; if (e) { var n = ( /** @type {ComponentContext} */ - vt + pt ); (n.e ?? (n.e = [])).push({ fn: t, - effect: G, - reaction: U + effect: U, + reaction: X }); } else { - var r = zr(t); + var r = Ur(t); return r; } } -function tl(t) { - const e = Fe(De, t, !0); +function el(t) { + const e = qe(Ie, t, !0); return () => { - ie(e); + se(e); }; } -function el(t) { - const e = Fe(De, t, !0); +function nl(t) { + const e = qe(Ie, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Fn(e, () => { - ie(e), r(void 0); - }) : (ie(e), r(void 0)); + n.outro ? Ln(e, () => { + se(e), r(void 0); + }) : (se(e), r(void 0)); }); } -function zr(t) { - return Fe(qi, t, !1); +function Ur(t) { + return qe(Li, t, !1); } -function is(t) { - return Fe(Or, t, !0); +function ss(t) { + return qe(Dr, t, !0); } -function cn(t, e = [], n = Jn) { +function dn(t, e = [], n = Qn) { const r = e.map(n); - return Xr(() => t(...r.map(g))); + return Gr(() => t(...r.map(g))); } -function Xr(t, e = 0) { - return Fe(Or | Pr | e, t, !0); +function Gr(t, e = 0) { + return qe(Dr | Ir | e, t, !0); } -function Je(t, e = !0) { - return Fe(Or | ae, t, !0, e); +function Ze(t, e = !0) { + return qe(Dr | le, t, !0, e); } -function ss(t) { +function as(t) { var e = t.teardown; if (e !== null) { - const n = Hr, r = U; - vi(!0), Se(null); + const n = Br, r = X; + pi(!0), Me(null); try { e.call(null); } finally { - vi(n), Se(r); + pi(n), Me(r); } } } -function as(t, e = !1) { +function ls(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { var r = n.next; - ie(n, e), n = r; + se(n, e), n = r; } } -function nl(t) { +function rl(t) { for (var e = t.first; e !== null; ) { var n = e.next; - e.f & ae || ie(e), e = n; + e.f & le || se(e), e = n; } } -function ie(t, e = !0) { +function se(t, e = !0) { var n = !1; - if ((e || t.f & xa) && t.nodes_start !== null) { + if ((e || t.f & ba) && t.nodes_start !== null) { for (var r = t.nodes_start, i = t.nodes_end; r !== null; ) { var s = r === i ? null : ( /** @type {TemplateNode} */ - /* @__PURE__ */ oe(r) + /* @__PURE__ */ ue(r) ); r.remove(), r = s; } n = !0; } - as(t, e && !n), Dn(t, 0), re(t, Wn); + ls(t, e && !n), Fn(t, 0), ie(t, Zn); var a = t.transitions; if (a !== null) for (const o of a) o.stop(); - ss(t); + as(t); var l = t.parent; - l !== null && l.first !== null && ls(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = null; + l !== null && l.first !== null && os(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = null; } -function ls(t) { +function os(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 Fn(t, e) { +function Ln(t, e) { var n = []; - Ur(t, n, !0), os(n, () => { - ie(t), e && e(); + Kr(t, n, !0), us(n, () => { + se(t), e && e(); }); } -function os(t, e) { +function us(t, e) { var n = t.length; if (n > 0) { var r = () => --n || e(); @@ -873,42 +873,42 @@ function os(t, e) { } else e(); } -function Ur(t, e, n) { - if (!(t.f & ne)) { - if (t.f ^= ne, t.transitions !== null) +function Kr(t, e, n) { + if (!(t.f & re)) { + if (t.f ^= re, t.transitions !== null) for (const a of t.transitions) (a.is_global || n) && e.push(a); for (var r = t.first; r !== null; ) { - var i = r.next, s = (r.f & Dr) !== 0 || (r.f & ae) !== 0; - Ur(r, e, s ? n : !1), r = i; + var i = r.next, s = (r.f & Fr) !== 0 || (r.f & le) !== 0; + Kr(r, e, s ? n : !1), r = i; } } } -function qn(t) { - us(t, !0); +function Vn(t) { + fs(t, !0); } -function us(t, e) { - if (t.f & ne) { - t.f ^= ne, t.f & pt || (t.f ^= pt), rn(t) && (re(t, le), tr(t)); +function fs(t, e) { + if (t.f & re) { + t.f ^= re, t.f & _t || (t.f ^= _t), sn(t) && (ie(t, oe), nr(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & Dr) !== 0 || (n.f & ae) !== 0; - us(n, i ? e : !1), n = r; + var r = n.next, i = (n.f & Fr) !== 0 || (n.f & le) !== 0; + fs(n, i ? e : !1), n = r; } if (t.transitions !== null) for (const s of t.transitions) (s.is_global || e) && s.in(); } } -function rl(t) { +function il(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -let vt = null; -function pi(t) { - vt = t; +let pt = null; +function _i(t) { + pt = t; } -function Gr(t, e = !1, n) { - vt = { - p: vt, +function jr(t, e = !1, n) { + pt = { + p: pt, c: null, e: null, m: !1, @@ -917,48 +917,48 @@ function Gr(t, e = !1, n) { l: null }; } -function Kr(t) { - const e = vt; +function Wr(t) { + const e = pt; if (e !== null) { t !== void 0 && (e.x = t); const a = e.e; if (a !== null) { - var n = G, r = U; + var n = U, r = X; e.e = null; try { for (var i = 0; i < a.length; i++) { var s = a[i]; - Me(s.effect), Se(s.reaction), zr(s.fn); + Pe(s.effect), Me(s.reaction), Ur(s.fn); } } finally { - Me(n), Se(r); + Pe(n), Me(r); } } - vt = e.p, e.m = !0; + pt = e.p, e.m = !0; } return t || /** @type {T} */ {}; } -function fs() { +function cs() { return !0; } -const il = ["touchstart", "touchmove"]; -function sl(t) { - return il.includes(t); -} -const cs = /* @__PURE__ */ new Set(), yr = /* @__PURE__ */ new Set(); +const sl = ["touchstart", "touchmove"]; function al(t) { + return sl.includes(t); +} +const hs = /* @__PURE__ */ new Set(), xr = /* @__PURE__ */ new Set(); +function ll(t) { for (var e = 0; e < t.length; e++) - cs.add(t[e]); - for (var n of yr) + hs.add(t[e]); + for (var n of xr) n(t); } -function hn(t) { - var $; +function vn(t) { + var A; var e = this, n = ( /** @type {Node} */ e.ownerDocument - ), r = t.type, i = (($ = t.composedPath) == null ? void 0 : $.call(t)) || [], s = ( + ), r = t.type, i = ((A = t.composedPath) == null ? void 0 : A.call(t)) || [], s = ( /** @type {null | Element} */ i[0] || t.target ), a = 0, l = t.__root; @@ -976,29 +976,29 @@ function hn(t) { } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - kn(t, "currentTarget", { + Mn(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var u = U, h = G; - Se(null), Me(null); + var u = X, h = U; + Me(null), Pe(null); try { for (var c, d = []; s !== null; ) { var p = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { - var m = s["__" + r]; - if (m !== void 0 && (!/** @type {any} */ + var w = s["__" + r]; + if (w !== void 0 && (!/** @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)) - if (Ir(m)) { - var [b, ...w] = m; - b.apply(s, [t, ...w]); + if (qr(w)) { + var [$, ...m] = w; + $.apply(s, [t, ...m]); } else - m.call(s, t); + w.call(s, t); } catch (C) { c ? d.push(C) : c = C; } @@ -1014,72 +1014,72 @@ function hn(t) { throw c; } } finally { - t.__root = e, delete t.currentTarget, Se(u), Me(h); + t.__root = e, delete t.currentTarget, Me(u), Pe(h); } } } -function hs(t) { +function ds(t) { var e = document.createElement("template"); return e.innerHTML = t, e.content; } -function Ze(t, e) { +function Qe(t, e) { var n = ( /** @type {Effect} */ - G + U ); n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e); } // @__NO_SIDE_EFFECTS__ -function qe(t, e) { - var n = (e & ya) !== 0, r, i = !t.startsWith(""); +function Le(t, e) { + var n = (e & wa) !== 0, r, i = !t.startsWith(""); return () => { - if (Q) - return Ze(X, null), X; - r === void 0 && (r = hs(i ? t : "" + t)); + if (Z) + return Qe(z, null), z; + r === void 0 && (r = ds(i ? t : "" + t)); var s = ( /** @type {TemplateNode} */ - n || ji ? document.importNode(r, !0) : r.cloneNode(!0) + n || Wi ? document.importNode(r, !0) : r.cloneNode(!0) ); { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ be(s) + /* @__PURE__ */ $e(s) ), l = ( /** @type {TemplateNode} */ s.lastChild ); - Ze(a, l); + Qe(a, l); } return s; }; } // @__NO_SIDE_EFFECTS__ -function ll(t, e, n = "svg") { +function ol(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { - if (Q) - return Ze(X, null), X; + if (Z) + return Qe(z, null), z; if (!s) { var a = ( /** @type {DocumentFragment} */ - hs(i) + ds(i) ), l = ( /** @type {Element} */ - /* @__PURE__ */ be(a) + /* @__PURE__ */ $e(a) ); s = /** @type {Element} */ - /* @__PURE__ */ be(l); + /* @__PURE__ */ $e(l); } var o = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return Ze(o, o), o; + return Qe(o, o), o; }; } function ce(t, e) { - if (Q) { - G.nodes_end = X, Zn(); + if (Z) { + U.nodes_end = z, tr(); return; } t !== null && t.before( @@ -1087,127 +1087,127 @@ function ce(t, e) { e ); } -function Ye(t, e) { +function Be(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 ds(t, e) { - return vs(t, e); +function vs(t, e) { + return ps(t, e); } -function ol(t, e) { - mr(), e.intro = e.intro ?? !1; - const n = e.target, r = Q, i = X; +function ul(t, e) { + wr(), e.intro = e.intro ?? !1; + const n = e.target, r = Z, i = z; try { for (var s = ( /** @type {TemplateNode} */ - /* @__PURE__ */ be(n) + /* @__PURE__ */ $e(n) ); s && (s.nodeType !== 8 || /** @type {Comment} */ - s.data !== Fi); ) + s.data !== qi); ) s = /** @type {TemplateNode} */ - /* @__PURE__ */ oe(s); + /* @__PURE__ */ ue(s); if (!s) - throw Ge; - ee(!0), Xt( + throw Ke; + ne(!0), Ut( /** @type {Comment} */ s - ), Zn(); - const a = vs(t, { ...e, anchor: s }); - if (X === null || X.nodeType !== 8 || /** @type {Comment} */ - X.data !== Mr) - throw Vr(), Ge; - return ee(!1), /** @type {Exports} */ + ), tr(); + const a = ps(t, { ...e, anchor: s }); + if (z === null || z.nodeType !== 8 || /** @type {Comment} */ + z.data !== Or) + throw Yr(), Ke; + return ne(!1), /** @type {Exports} */ a; } catch (a) { - if (a === Ge) - return e.recover === !1 && Ma(), mr(), Zi(n), ee(!1), ds(t, e); + if (a === Ke) + return e.recover === !1 && Pa(), wr(), Qi(n), ne(!1), vs(t, e); throw a; } finally { - ee(r), Xt(i); + ne(r), Ut(i); } } const Ne = /* @__PURE__ */ new Map(); -function vs(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - mr(); +function ps(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { + wr(); var l = /* @__PURE__ */ new Set(), o = (h) => { for (var c = 0; c < h.length; c++) { var d = h[c]; if (!l.has(d)) { l.add(d); - var p = sl(d); - e.addEventListener(d, hn, { passive: p }); - var m = Ne.get(d); - m === void 0 ? (document.addEventListener(d, hn, { passive: p }), Ne.set(d, 1)) : Ne.set(d, m + 1); + var p = al(d); + e.addEventListener(d, vn, { passive: p }); + var w = Ne.get(d); + w === void 0 ? (document.addEventListener(d, vn, { passive: p }), Ne.set(d, 1)) : Ne.set(d, w + 1); } } }; - o(Fr(cs)), yr.add(o); - var f = void 0, u = el(() => { - var h = n ?? e.appendChild(Sn()); - return Je(() => { + o(Lr(hs)), xr.add(o); + var f = void 0, u = nl(() => { + var h = n ?? e.appendChild(Pn()); + return Ze(() => { if (s) { - Gr({}); + jr({}); var c = ( /** @type {ComponentContext} */ - vt + pt ); c.c = s; } - i && (r.$$events = i), Q && Ze( + i && (r.$$events = i), Z && Qe( /** @type {TemplateNode} */ h, null - ), f = t(h, r) || {}, Q && (G.nodes_end = X), s && Kr(); + ), f = t(h, r) || {}, Z && (U.nodes_end = z), s && Wr(); }), () => { var p; for (var c of l) { - e.removeEventListener(c, hn); + e.removeEventListener(c, vn); var d = ( /** @type {number} */ Ne.get(c) ); - --d === 0 ? (document.removeEventListener(c, hn), Ne.delete(c)) : Ne.set(c, d); + --d === 0 ? (document.removeEventListener(c, vn), Ne.delete(c)) : Ne.set(c, d); } - yr.delete(o), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); + xr.delete(o), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); }; }); - return wr.set(f, u), f; + return br.set(f, u), f; } -let wr = /* @__PURE__ */ new WeakMap(); -function ul(t, e) { - const n = wr.get(t); - return n ? (wr.delete(t), n(e)) : Promise.resolve(); +let br = /* @__PURE__ */ new WeakMap(); +function fl(t, e) { + const n = br.get(t); + return n ? (br.delete(t), n(e)) : Promise.resolve(); } -function _i(t, e, n = !1) { - Q && Zn(); - var r = t, i = null, s = null, a = ct, l = n ? Dr : 0, o = !1; +function gi(t, e, n = !1) { + Z && tr(); + var r = t, i = null, s = null, a = ht, l = n ? Fr : 0, o = !1; const f = (h, c = !0) => { o = !0, u(c, h); }, u = (h, c) => { if (a === (a = h)) return; let d = !1; - if (Q) { + if (Z) { const p = ( /** @type {Comment} */ - r.data === Sr + r.data === Pr ); - !!a === p && (r = gr(), Xt(r), ee(!1), d = !0); + !!a === p && (r = yr(), Ut(r), ne(!1), d = !0); } - a ? (i ? qn(i) : c && (i = Je(() => c(r))), s && Fn(s, () => { + a ? (i ? Vn(i) : c && (i = Ze(() => c(r))), s && Ln(s, () => { s = null; - })) : (s ? qn(s) : c && (s = Je(() => c(r))), i && Fn(i, () => { + })) : (s ? Vn(s) : c && (s = Ze(() => c(r))), i && Ln(i, () => { i = null; - })), d && ee(!0); + })), d && ne(!0); }; - Xr(() => { + Gr(() => { o = !1, e(f), o || u(null, null); - }, l), Q && (r = X); + }, l), Z && (r = z); } -function fr(t, e) { +function hr(t, e) { return e; } -function fl(t, e, n, r) { +function cl(t, e, n, r) { for (var i = [], s = e.length, a = 0; a < s; a++) - Ur(e[a].e, i, !0); + Kr(e[a].e, i, !0); var l = s > 0 && i.length === 0 && n !== null; if (l) { var o = ( @@ -1215,128 +1215,128 @@ function fl(t, e, n, r) { /** @type {Element} */ n.parentNode ); - Zi(o), o.append( + Qi(o), o.append( /** @type {Element} */ n ), r.clear(), he(t, e[0].prev, e[s - 1].next); } - os(i, () => { + us(i, () => { for (var f = 0; f < s; f++) { var u = e[f]; - l || (r.delete(u.k), he(t, u.prev, u.next)), ie(u.e, !l); + l || (r.delete(u.k), he(t, u.prev, u.next)), se(u.e, !l); } }); } -function cr(t, e, n, r, i, s = null) { +function dr(t, e, n, r, i, s = null) { var a = t, l = { items: /* @__PURE__ */ new Map(), first: null }; - Q && Zn(); - var o = null, f = !1, u = /* @__PURE__ */ Va(() => { + Z && tr(); + var o = null, f = !1, u = /* @__PURE__ */ Ha(() => { var h = n(); - return Ir(h) ? h : h == null ? [] : Fr(h); + return qr(h) ? h : h == null ? [] : Lr(h); }); - Xr(() => { + Gr(() => { var h = g(u), c = h.length; if (f && c === 0) return; f = c === 0; let d = !1; - if (Q) { + if (Z) { var p = ( /** @type {Comment} */ - a.data === Sr + a.data === Pr ); - p !== (c === 0) && (a = gr(), Xt(a), ee(!1), d = !0); + p !== (c === 0) && (a = yr(), Ut(a), ne(!1), d = !0); } - if (Q) { - for (var m = null, b, w = 0; w < c; w++) { - if (X.nodeType === 8 && /** @type {Comment} */ - X.data === Mr) { + if (Z) { + for (var w = null, $, m = 0; m < c; m++) { + if (z.nodeType === 8 && /** @type {Comment} */ + z.data === Or) { a = /** @type {Comment} */ - X, d = !0, ee(!1); + z, d = !0, ne(!1); break; } - var $ = h[w], C = r($, w); - b = ps( - X, + var A = h[m], C = r(A, m); + $ = _s( + z, l, - m, + w, null, - $, + A, C, - w, + m, i, e, n - ), l.items.set(C, b), m = b; + ), l.items.set(C, $), w = $; } - c > 0 && Xt(gr()); + c > 0 && Ut(yr()); } - Q || cl(h, l, a, i, e, r, n), s !== null && (c === 0 ? o ? qn(o) : o = Je(() => s(a)) : o !== null && Fn(o, () => { + Z || hl(h, l, a, i, e, r, n), s !== null && (c === 0 ? o ? Vn(o) : o = Ze(() => s(a)) : o !== null && Ln(o, () => { o = null; - })), d && ee(!0), g(u); - }), Q && (a = X); + })), d && ne(!0), g(u); + }), Z && (a = z); } -function cl(t, e, n, r, i, s, a) { - var l = t.length, o = e.items, f = e.first, u = f, h, c = null, d = [], p = [], m, b, w, $; - for ($ = 0; $ < l; $ += 1) { - if (m = t[$], b = s(m, $), w = o.get(b), w === void 0) { +function hl(t, e, n, r, i, s, a) { + var l = t.length, o = e.items, f = e.first, u = f, h, c = null, d = [], p = [], w, $, m, A; + for (A = 0; A < l; A += 1) { + if (w = t[A], $ = s(w, A), m = o.get($), m === void 0) { var C = u ? ( /** @type {TemplateNode} */ u.e.nodes_start ) : n; - c = ps( + c = _s( C, e, c, c === null ? e.first : c.next, - m, - b, + w, $, + A, r, i, a - ), o.set(b, c), d = [], p = [], u = c.next; + ), o.set($, c), d = [], p = [], u = c.next; continue; } - if (hl(w, m, $), w.e.f & ne && qn(w.e), w !== u) { - if (h !== void 0 && h.has(w)) { + if (dl(m, w, A), m.e.f & re && Vn(m.e), m !== u) { + if (h !== void 0 && h.has(m)) { if (d.length < p.length) { - var A = p[0], O; - c = A.prev; - var P = d[0], K = d[d.length - 1]; - for (O = 0; O < d.length; O += 1) - gi(d[O], A, n); - for (O = 0; O < p.length; O += 1) - h.delete(p[O]); - he(e, P.prev, K.next), he(e, c, P), he(e, K, A), u = A, c = K, $ -= 1, d = [], p = []; + var M = p[0], R; + c = M.prev; + var D = d[0], G = d[d.length - 1]; + for (R = 0; R < d.length; R += 1) + mi(d[R], M, n); + for (R = 0; R < p.length; R += 1) + h.delete(p[R]); + he(e, D.prev, G.next), he(e, c, D), he(e, G, M), u = M, c = G, A -= 1, d = [], p = []; } else - h.delete(w), gi(w, u, n), he(e, w.prev, w.next), he(e, w, c === null ? e.first : c.next), he(e, c, w), c = w; + h.delete(m), mi(m, u, n), he(e, m.prev, m.next), he(e, m, c === null ? e.first : c.next), he(e, c, m), c = m; continue; } - for (d = [], p = []; u !== null && u.k !== b; ) - u.e.f & ne || (h ?? (h = /* @__PURE__ */ new Set())).add(u), p.push(u), u = u.next; + for (d = [], p = []; u !== null && u.k !== $; ) + u.e.f & re || (h ?? (h = /* @__PURE__ */ new Set())).add(u), p.push(u), u = u.next; if (u === null) continue; - w = u; + m = u; } - d.push(w), c = w, u = w.next; + d.push(m), c = m, u = m.next; } if (u !== null || h !== void 0) { - for (var j = h === void 0 ? [] : Fr(h); u !== null; ) - u.e.f & ne || j.push(u), u = u.next; - var et = j.length; + for (var W = h === void 0 ? [] : Lr(h); u !== null; ) + u.e.f & re || W.push(u), u = u.next; + var et = W.length; if (et > 0) { - var z = null; - fl(e, j, z, o); + var Q = null; + cl(e, W, Q, o); } } - G.first = e.first && e.first.e, G.last = c && c.e; + U.first = e.first && e.first.e, U.last = c && c.e; } -function hl(t, e, n, r) { - Xi(t.v, e), t.i = n; +function dl(t, e, n, r) { + Ui(t.v, e), t.i = n; } -function ps(t, e, n, r, i, s, a, l, o, f) { - var u = (o & ha) !== 0, h = (o & va) === 0, c = u ? h ? /* @__PURE__ */ Lr(i) : Et(i) : i, d = o & da ? Et(a) : a, p = { +function _s(t, e, n, r, i, s, a, l, o, f) { + var u = (o & da) !== 0, h = (o & pa) === 0, c = u ? h ? /* @__PURE__ */ Hr(i) : Et(i) : i, d = o & va ? Et(a) : a, p = { i: d, v: c, k: s, @@ -1347,11 +1347,11 @@ function ps(t, e, n, r, i, s, a, l, o, f) { next: r }; try { - return p.e = Je(() => l(t, c, d, f), Q), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; + return p.e = Ze(() => l(t, c, d, f), Z), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; } finally { } } -function gi(t, e, n) { +function mi(t, e, n) { for (var r = t.next ? ( /** @type {TemplateNode} */ t.next.e.nodes_start @@ -1364,7 +1364,7 @@ function gi(t, e, n) { ); s !== r; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ oe(s) + /* @__PURE__ */ ue(s) ); i.before(s), s = a; } @@ -1372,8 +1372,8 @@ function gi(t, e, n) { function he(t, e, n) { e === null ? t.first = n : (e.next = n, e.e.next = n && n.e), n !== null && (n.prev = e, n.e.prev = e && e.e); } -function _s(t, e) { - Bi(() => { +function gs(t, e) { + zi(() => { var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ n.host ? ( @@ -1391,94 +1391,94 @@ function _s(t, e) { } }); } -function mi(t, e, n, r) { +function yi(t, e, n, r) { var i = t.__styles ?? (t.__styles = {}); i[e] !== n && (i[e] = n, n == null ? t.style.removeProperty(e) : t.style.setProperty(e, n, "")); } -function yi(t, e) { - return t === e || (t == null ? void 0 : t[Ke]) === e; +function wi(t, e) { + return t === e || (t == null ? void 0 : t[je]) === e; } -function wn(t = {}, e, n, r) { - return zr(() => { +function bn(t = {}, e, n, r) { + return Ur(() => { var i, s; - return is(() => { - i = s, s = [], In(() => { - t !== n(...s) && (e(t, ...s), i && yi(n(...i), t) && e(null, ...i)); + return ss(() => { + i = s, s = [], qn(() => { + t !== n(...s) && (e(t, ...s), i && wi(n(...i), t) && e(null, ...i)); }); }), () => { - Bi(() => { - s && yi(n(...s), t) && e(null, ...s); + zi(() => { + s && wi(n(...s), t) && e(null, ...s); }); }; }), t; } -function dl(t) { - vt === null && rl(), Br(() => { - const e = In(t); +function vl(t) { + pt === null && il(), Xr(() => { + const e = qn(t); if (typeof e == "function") return ( /** @type {() => void} */ e ); }); } -let dn = !1; -function vl(t) { - var e = dn; +let pn = !1; +function pl(t) { + var e = pn; try { - return dn = !1, [t(), dn]; + return pn = !1, [t(), pn]; } finally { - dn = e; + pn = e; } } -function Qt(t, e, n, r) { - var O; - var i = (n & pa) !== 0, s = !0, a = (n & ga) !== 0, l = (n & ma) !== 0, o = !1, f; - a ? [f, o] = vl(() => ( +function kt(t, e, n, r) { + var R; + var i = (n & _a) !== 0, s = !0, a = (n & ma) !== 0, l = (n & ya) !== 0, o = !1, f; + a ? [f, o] = pl(() => ( /** @type {V} */ t[e] )) : f = /** @type {V} */ t[e]; - var u = Ke in t || Vi in t, h = a && (((O = we(t, e)) == null ? void 0 : O.set) ?? (u && e in t && ((P) => t[e] = P))) || void 0, c = ( + var u = je in t || Hi in t, h = a && (((R = xe(t, e)) == null ? void 0 : R.set) ?? (u && e in t && ((D) => t[e] = D))) || void 0, c = ( /** @type {V} */ r - ), d = !0, p = !1, m = () => (p = !0, d && (d = !1, l ? c = In( + ), d = !0, p = !1, w = () => (p = !0, d && (d = !1, l ? c = qn( /** @type {() => V} */ r ) : c = /** @type {V} */ r), c); - f === void 0 && r !== void 0 && (h && s && Oa(), f = m(), h && h(f)); - var b; - if (b = () => { - var P = ( + f === void 0 && r !== void 0 && (h && s && Oa(), f = w(), h && h(f)); + var $; + if ($ = () => { + var D = ( /** @type {V} */ t[e] ); - return P === void 0 ? m() : (d = !0, p = !1, P); - }, !(n & _a)) - return b; + return D === void 0 ? w() : (d = !0, p = !1, D); + }, !(n & ga)) + return $; if (h) { - var w = t.$$legacy; - return function(P, K) { - return arguments.length > 0 ? ((!K || w || o) && h(K ? b() : P), P) : b(); + var m = t.$$legacy; + return function(D, G) { + return arguments.length > 0 ? ((!G || m || o) && h(G ? $() : D), D) : $(); }; } - var $ = !1, C = /* @__PURE__ */ Lr(f), A = /* @__PURE__ */ Jn(() => { - var P = b(), K = g(C); - return $ ? ($ = !1, K) : C.v = P; + var A = !1, C = /* @__PURE__ */ Hr(f), M = /* @__PURE__ */ Qn(() => { + var D = $(), G = g(C); + return A ? (A = !1, G) : C.v = D; }); - return i || (A.equals = qr), function(P, K) { + return i || (M.equals = Vr), function(D, G) { if (arguments.length > 0) { - const j = K ? g(A) : a ? xt(P) : P; - return A.equals(j) || ($ = !0, J(C, j), p && c !== void 0 && (c = j), In(() => g(A))), P; + const W = G ? g(M) : a ? wt(D) : D; + return M.equals(W) || (A = !0, j(C, W), p && c !== void 0 && (c = W), qn(() => g(M))), D; } - return g(A); + return g(M); }; } -function pl(t) { - return new _l(t); +function _l(t) { + return new gl(t); } -var te, At; -class _l { +var ee, At; +class gl { /** * @param {ComponentConstructorOptions & { * component: any; @@ -1486,12 +1486,12 @@ class _l { */ constructor(e) { /** @type {any} */ - or(this, te); + fr(this, ee); /** @type {Record} */ - or(this, At); + fr(this, At); var s; var n = /* @__PURE__ */ new Map(), r = (a, l) => { - var o = /* @__PURE__ */ Lr(l); + var o = /* @__PURE__ */ Hr(l); return n.set(a, o), o; }; const i = new Proxy( @@ -1501,42 +1501,42 @@ class _l { return g(n.get(l) ?? r(l, Reflect.get(a, l))); }, has(a, l) { - return l === Vi ? !0 : (g(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); + return l === Hi ? !0 : (g(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); }, set(a, l, o) { - return J(n.get(l) ?? r(l, o), o), Reflect.set(a, l, o); + return j(n.get(l) ?? r(l, o), o), Reflect.set(a, l, o); } } ); - ur(this, At, (e.hydrate ? ol : ds)(e.component, { + cr(this, At, (e.hydrate ? ul : vs)(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) && Ht(), ur(this, te, i.$$events); - for (const a of Object.keys(ft(this, At))) - a === "$set" || a === "$destroy" || a === "$on" || kn(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && Rt(), cr(this, ee, i.$$events); + for (const a of Object.keys(ct(this, At))) + a === "$set" || a === "$destroy" || a === "$on" || Mn(this, a, { get() { - return ft(this, At)[a]; + return ct(this, At)[a]; }, /** @param {any} value */ set(l) { - ft(this, At)[a] = l; + ct(this, At)[a] = l; }, enumerable: !0 }); - ft(this, At).$set = /** @param {Record} next */ + ct(this, At).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, ft(this, At).$destroy = () => { - ul(ft(this, At)); + }, ct(this, At).$destroy = () => { + fl(ct(this, At)); }; } /** @param {Record} props */ $set(e) { - ft(this, At).$set(e); + ct(this, At).$set(e); } /** * @param {string} event @@ -1544,22 +1544,22 @@ class _l { * @returns {any} */ $on(e, n) { - ft(this, te)[e] = ft(this, te)[e] || []; + ct(this, ee)[e] = ct(this, ee)[e] || []; const r = (...i) => n.call(this, ...i); - return ft(this, te)[e].push(r), () => { - ft(this, te)[e] = ft(this, te)[e].filter( + return ct(this, ee)[e].push(r), () => { + ct(this, ee)[e] = ct(this, ee)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - ft(this, At).$destroy(); + ct(this, At).$destroy(); } } -te = new WeakMap(), At = new WeakMap(); -let gs; -typeof HTMLElement == "function" && (gs = class extends HTMLElement { +ee = new WeakMap(), At = new WeakMap(); +let ms; +typeof HTMLElement == "function" && (ms = class extends HTMLElement { /** * @param {*} $$componentCtor * @param {*} $$slots @@ -1568,25 +1568,25 @@ typeof HTMLElement == "function" && (gs = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - kt(this, "$$ctor"); + St(this, "$$ctor"); /** Slots */ - kt(this, "$$s"); + St(this, "$$s"); /** @type {any} The Svelte component instance */ - kt(this, "$$c"); + St(this, "$$c"); /** Whether or not the custom element is connected */ - kt(this, "$$cn", !1); + St(this, "$$cn", !1); /** @type {Record} Component props data */ - kt(this, "$$d", {}); + St(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - kt(this, "$$r", !1); + St(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - kt(this, "$$p_d", {}); + St(this, "$$p_d", {}); /** @type {Record} Event listeners */ - kt(this, "$$l", {}); + St(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - kt(this, "$$l_u", /* @__PURE__ */ new Map()); + St(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - kt(this, "$$me"); + St(this, "$$me"); this.$$ctor = e, this.$$s = n, r && this.attachShadow({ mode: "open" }); } /** @@ -1623,16 +1623,16 @@ typeof HTMLElement == "function" && (gs = class extends HTMLElement { var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = gl(this); + const r = {}, i = ml(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] = xn(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = $n(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 = pl({ + this.$$c = _l({ component: this.$$ctor, target: this.shadowRoot || this, props: { @@ -1640,14 +1640,14 @@ typeof HTMLElement == "function" && (gs = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = tl(() => { - is(() => { + }), this.$$me = el(() => { + ss(() => { var s; this.$$r = !0; - for (const a of Cn(this.$$c)) { + for (const a of kn(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const l = xn( + const l = $n( a, this.$$d[a], this.$$p_d, @@ -1675,7 +1675,7 @@ typeof HTMLElement == "function" && (gs = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = xn(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] = $n(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -1686,12 +1686,12 @@ typeof HTMLElement == "function" && (gs = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return Cn(this.$$p_d).find( + return kn(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function xn(t, e, n, r) { +function $n(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]) @@ -1722,7 +1722,7 @@ function xn(t, e, n, r) { return e; } } -function gl(t) { +function ml(t) { const e = {}; return t.childNodes.forEach((n) => { e[ @@ -1731,34 +1731,34 @@ function gl(t) { ] = !0; }), e; } -function ms(t, e, n, r, i, s) { - let a = class extends gs { +function ys(t, e, n, r, i, s) { + let a = class extends ms { constructor() { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return Cn(e).map( + return kn(e).map( (l) => (e[l].attribute || l).toLowerCase() ); } }; - return Cn(e).forEach((l) => { - kn(a.prototype, l, { + return kn(e).forEach((l) => { + Mn(a.prototype, l, { get() { return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l]; }, set(o) { var h; - o = xn(l, o, e), this.$$d[l] = o; + o = $n(l, o, e), this.$$d[l] = o; var f = this.$$c; if (f) { - var u = (h = we(f, l)) == null ? void 0 : h.get; + var u = (h = xe(f, l)) == null ? void 0 : h.get; u ? f[l] = o : f.$set({ [l]: o }); } } }); }), r.forEach((l) => { - kn(a.prototype, l, { + Mn(a.prototype, l, { get() { var o; return (o = this.$$c) == null ? void 0 : o[l]; @@ -1767,43 +1767,43 @@ function ms(t, e, n, r, i, s) { }), t.element = /** @type {any} */ a, a; } -var ml = { value: () => { +var yl = { value: () => { } }; -function ys() { +function ws() { 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 bn(n); + return new An(n); } -function bn(t) { +function An(t) { this._ = t; } -function yl(t, e) { +function wl(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 }; }); } -bn.prototype = ys.prototype = { - constructor: bn, +An.prototype = ws.prototype = { + constructor: An, on: function(t, e) { - var n = this._, r = yl(t + "", n), i, s = -1, a = r.length; + var n = this._, r = wl(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = wl(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = xl(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] = wi(n[i], t.name, e); - else if (e == null) for (i in n) n[i] = wi(n[i], t.name, null); + if (i = (t = r[s]).type) n[i] = xi(n[i], t.name, e); + else if (e == null) for (i in n) n[i] = xi(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 bn(t); + return new An(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]; @@ -1815,135 +1815,135 @@ bn.prototype = ys.prototype = { for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function wl(t, e) { +function xl(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } -function wi(t, e, n) { +function xi(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { - t[r] = ml, t = t.slice(0, r).concat(t.slice(r + 1)); + t[r] = yl, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } -var xr = "http://www.w3.org/1999/xhtml"; -const xi = { +var $r = "http://www.w3.org/1999/xhtml"; +const bi = { svg: "http://www.w3.org/2000/svg", - xhtml: xr, + xhtml: $r, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function er(t) { +function rr(t) { var e = t += "", n = e.indexOf(":"); - return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), xi.hasOwnProperty(e) ? { space: xi[e], local: t } : t; + return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), bi.hasOwnProperty(e) ? { space: bi[e], local: t } : t; } -function xl(t) { +function bl(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; - return n === xr && e.documentElement.namespaceURI === xr ? e.createElement(t) : e.createElementNS(n, t); + return n === $r && e.documentElement.namespaceURI === $r ? e.createElement(t) : e.createElementNS(n, t); }; } -function bl(t) { +function $l(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } -function ws(t) { - var e = er(t); - return (e.local ? bl : xl)(e); +function xs(t) { + var e = rr(t); + return (e.local ? $l : bl)(e); } -function $l() { +function Al() { } -function jr(t) { - return t == null ? $l : function() { +function Jr(t) { + return t == null ? Al : function() { return this.querySelector(t); }; } -function Al(t) { - typeof t != "function" && (t = jr(t)); +function El(t) { + typeof t != "function" && (t = Jr(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, l = r[i] = new Array(a), o, f, u = 0; u < a; ++u) (o = s[u]) && (f = t.call(o, o.__data__, u, s)) && ("__data__" in o && (f.__data__ = o.__data__), l[u] = f); - return new bt(r, this._parents); + return new xt(r, this._parents); } -function El(t) { +function Rl(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function Rl() { +function Cl() { return []; } -function xs(t) { - return t == null ? Rl : function() { +function bs(t) { + return t == null ? Cl : function() { return this.querySelectorAll(t); }; } function Nl(t) { return function() { - return El(t.apply(this, arguments)); + return Rl(t.apply(this, arguments)); }; } function Tl(t) { - typeof t == "function" ? t = Nl(t) : t = xs(t); + typeof t == "function" ? t = Nl(t) : t = bs(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) for (var a = e[s], l = a.length, o, f = 0; f < l; ++f) (o = a[f]) && (r.push(t.call(o, o.__data__, f, a)), i.push(o)); - return new bt(r, i); + return new xt(r, i); } -function bs(t) { +function $s(t) { return function() { return this.matches(t); }; } -function $s(t) { +function As(t) { return function(e) { return e.matches(t); }; } -var Cl = Array.prototype.find; +var Sl = Array.prototype.find; function kl(t) { return function() { - return Cl.call(this.children, t); + return Sl.call(this.children, t); }; } -function Sl() { +function Ml() { return this.firstElementChild; } -function Ml(t) { - return this.select(t == null ? Sl : kl(typeof t == "function" ? t : $s(t))); +function Pl(t) { + return this.select(t == null ? Ml : kl(typeof t == "function" ? t : As(t))); } var Ol = Array.prototype.filter; -function Pl() { +function Dl() { return Array.from(this.children); } -function Dl(t) { +function Il(t) { return function() { return Ol.call(this.children, t); }; } -function Il(t) { - return this.selectAll(t == null ? Pl : Dl(typeof t == "function" ? t : $s(t))); -} function Fl(t) { - typeof t != "function" && (t = bs(t)); + return this.selectAll(t == null ? Dl : Il(typeof t == "function" ? t : As(t))); +} +function ql(t) { + typeof t != "function" && (t = $s(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, l = r[i] = [], o, f = 0; f < a; ++f) (o = s[f]) && t.call(o, o.__data__, f, s) && l.push(o); - return new bt(r, this._parents); + return new xt(r, this._parents); } -function As(t) { +function Es(t) { return new Array(t.length); } -function ql() { - return new bt(this._enter || this._groups.map(As), this._parents); +function Ll() { + return new xt(this._enter || this._groups.map(Es), this._parents); } -function Ln(t, e) { +function Hn(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -Ln.prototype = { - constructor: Ln, +Hn.prototype = { + constructor: Hn, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -1957,70 +1957,70 @@ Ln.prototype = { return this._parent.querySelectorAll(t); } }; -function Ll(t) { +function Vl(t) { return function() { return t; }; } -function Vl(t, e, n, r, i, s) { +function Hl(t, e, n, r, i, s) { for (var a = 0, l, o = e.length, f = s.length; a < f; ++a) - (l = e[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new Ln(t, s[a]); + (l = e[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new Hn(t, s[a]); for (; a < o; ++a) (l = e[a]) && (i[a] = l); } -function Hl(t, e, n, r, i, s, a) { +function Yl(t, e, n, r, i, s, a) { var l, o, f = /* @__PURE__ */ new Map(), u = e.length, h = s.length, c = new Array(u), d; for (l = 0; l < u; ++l) (o = e[l]) && (c[l] = d = a.call(o, o.__data__, l, e) + "", f.has(d) ? i[l] = o : f.set(d, o)); for (l = 0; l < h; ++l) - d = a.call(t, s[l], l, s) + "", (o = f.get(d)) ? (r[l] = o, o.__data__ = s[l], f.delete(d)) : n[l] = new Ln(t, s[l]); + d = a.call(t, s[l], l, s) + "", (o = f.get(d)) ? (r[l] = o, o.__data__ = s[l], f.delete(d)) : n[l] = new Hn(t, s[l]); for (l = 0; l < u; ++l) (o = e[l]) && f.get(c[l]) === o && (i[l] = o); } -function Yl(t) { +function Bl(t) { return t.__data__; } -function Bl(t, e) { - if (!arguments.length) return Array.from(this, Yl); - var n = e ? Hl : Vl, r = this._parents, i = this._groups; - typeof t != "function" && (t = Ll(t)); +function zl(t, e) { + if (!arguments.length) return Array.from(this, Bl); + var n = e ? Yl : Hl, r = this._parents, i = this._groups; + typeof t != "function" && (t = Vl(t)); for (var s = i.length, a = new Array(s), l = new Array(s), o = new Array(s), f = 0; f < s; ++f) { - var u = r[f], h = i[f], c = h.length, d = zl(t.call(u, u && u.__data__, f, r)), p = d.length, m = l[f] = new Array(p), b = a[f] = new Array(p), w = o[f] = new Array(c); - n(u, h, m, b, w, d, e); - for (var $ = 0, C = 0, A, O; $ < p; ++$) - if (A = m[$]) { - for ($ >= C && (C = $ + 1); !(O = b[C]) && ++C < p; ) ; - A._next = O || null; + var u = r[f], h = i[f], c = h.length, d = Xl(t.call(u, u && u.__data__, f, r)), p = d.length, w = l[f] = new Array(p), $ = a[f] = new Array(p), m = o[f] = new Array(c); + n(u, h, w, $, m, d, e); + for (var A = 0, C = 0, M, R; A < p; ++A) + if (M = w[A]) { + for (A >= C && (C = A + 1); !(R = $[C]) && ++C < p; ) ; + M._next = R || null; } } - return a = new bt(a, r), a._enter = l, a._exit = o, a; + return a = new xt(a, r), a._enter = l, a._exit = o, a; } -function zl(t) { +function Xl(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function Xl() { - return new bt(this._exit || this._groups.map(As), this._parents); +function Ul() { + return new xt(this._exit || this._groups.map(Es), this._parents); } -function Ul(t, e, n) { +function Gl(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 Gl(t) { +function Kl(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), l = new Array(i), o = 0; o < a; ++o) for (var f = n[o], u = r[o], h = f.length, c = l[o] = new Array(h), d, p = 0; p < h; ++p) (d = f[p] || u[p]) && (c[p] = d); for (; o < i; ++o) l[o] = n[o]; - return new bt(l, this._parents); + return new xt(l, this._parents); } -function Kl() { +function jl() { 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 jl(t) { - t || (t = Wl); +function Wl(t) { + t || (t = Jl); function e(h, c) { return h && c ? t(h.__data__, c.__data__) : !h - !c; } @@ -2029,19 +2029,19 @@ function jl(t) { (f = a[u]) && (o[u] = f); o.sort(e); } - return new bt(i, this._parents).order(); + return new xt(i, this._parents).order(); } -function Wl(t, e) { +function Jl(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function Jl() { +function Zl() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } -function Zl() { +function Ql() { return Array.from(this); } -function Ql() { +function to() { 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]; @@ -2049,112 +2049,112 @@ function Ql() { } return null; } -function to() { +function eo() { let t = 0; for (const e of this) ++t; return t; } -function eo() { +function no() { return !this.node(); } -function no(t) { +function ro(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], s = 0, a = i.length, l; s < a; ++s) (l = i[s]) && t.call(l, l.__data__, s, i); return this; } -function ro(t) { +function io(t) { return function() { this.removeAttribute(t); }; } -function io(t) { +function so(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function so(t, e) { +function ao(t, e) { return function() { this.setAttribute(t, e); }; } -function ao(t, e) { +function lo(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } -function lo(t, e) { +function oo(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function oo(t, e) { +function uo(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 uo(t, e) { - var n = er(t); +function fo(t, e) { + var n = rr(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 ? io : ro : typeof e == "function" ? n.local ? oo : lo : n.local ? ao : so)(n, e)); + return this.each((e == null ? n.local ? so : io : typeof e == "function" ? n.local ? uo : oo : n.local ? lo : ao)(n, e)); } -function Es(t) { +function Rs(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function fo(t) { +function co(t) { return function() { this.style.removeProperty(t); }; } -function co(t, e, n) { +function ho(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } -function ho(t, e, n) { +function vo(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function vo(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? fo : typeof e == "function" ? ho : co)(t, e, n ?? "")) : Oe(this.node(), t); +function po(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? co : typeof e == "function" ? vo : ho)(t, e, n ?? "")) : Oe(this.node(), t); } function Oe(t, e) { - return t.style.getPropertyValue(e) || Es(t).getComputedStyle(t, null).getPropertyValue(e); + return t.style.getPropertyValue(e) || Rs(t).getComputedStyle(t, null).getPropertyValue(e); } -function po(t) { +function _o(t) { return function() { delete this[t]; }; } -function _o(t, e) { +function go(t, e) { return function() { this[t] = e; }; } -function go(t, e) { +function mo(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } -function mo(t, e) { - return arguments.length > 1 ? this.each((e == null ? po : typeof e == "function" ? go : _o)(t, e)) : this.node()[t]; +function yo(t, e) { + return arguments.length > 1 ? this.each((e == null ? _o : typeof e == "function" ? mo : go)(t, e)) : this.node()[t]; } -function Rs(t) { +function Cs(t) { return t.trim().split(/^|\s+/); } -function Wr(t) { +function Zr(t) { return t.classList || new Ns(t); } function Ns(t) { - this._node = t, this._names = Rs(t.getAttribute("class") || ""); + this._node = t, this._names = Cs(t.getAttribute("class") || ""); } Ns.prototype = { add: function(t) { @@ -2170,50 +2170,50 @@ Ns.prototype = { } }; function Ts(t, e) { - for (var n = Wr(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); + for (var n = Zr(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } -function Cs(t, e) { - for (var n = Wr(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); +function Ss(t, e) { + for (var n = Zr(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function yo(t) { +function wo(t) { return function() { Ts(this, t); }; } -function wo(t) { +function xo(t) { return function() { - Cs(this, t); + Ss(this, t); }; } -function xo(t, e) { +function bo(t, e) { return function() { - (e.apply(this, arguments) ? Ts : Cs)(this, t); + (e.apply(this, arguments) ? Ts : Ss)(this, t); }; } -function bo(t, e) { - var n = Rs(t + ""); +function $o(t, e) { + var n = Cs(t + ""); if (arguments.length < 2) { - for (var r = Wr(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Zr(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? xo : e ? yo : wo)(n, e)); + return this.each((typeof e == "function" ? bo : e ? wo : xo)(n, e)); } -function $o() { +function Ao() { this.textContent = ""; } -function Ao(t) { +function Eo(t) { return function() { this.textContent = t; }; } -function Eo(t) { +function Ro(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } -function Ro(t) { - return arguments.length ? this.each(t == null ? $o : (typeof t == "function" ? Eo : Ao)(t)) : this.node().textContent; +function Co(t) { + return arguments.length ? this.each(t == null ? Ao : (typeof t == "function" ? Ro : Eo)(t)) : this.node().textContent; } function No() { this.innerHTML = ""; @@ -2223,75 +2223,75 @@ function To(t) { this.innerHTML = t; }; } -function Co(t) { +function So(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } function ko(t) { - return arguments.length ? this.each(t == null ? No : (typeof t == "function" ? Co : To)(t)) : this.node().innerHTML; + return arguments.length ? this.each(t == null ? No : (typeof t == "function" ? So : To)(t)) : this.node().innerHTML; } -function So() { +function Mo() { this.nextSibling && this.parentNode.appendChild(this); } -function Mo() { - return this.each(So); +function Po() { + return this.each(Mo); } function Oo() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function Po() { +function Do() { return this.each(Oo); } -function Do(t) { - var e = typeof t == "function" ? t : ws(t); +function Io(t) { + var e = typeof t == "function" ? t : xs(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function Io() { +function Fo() { return null; } -function Fo(t, e) { - var n = typeof t == "function" ? t : ws(t), r = e == null ? Io : typeof e == "function" ? e : jr(e); +function qo(t, e) { + var n = typeof t == "function" ? t : xs(t), r = e == null ? Fo : typeof e == "function" ? e : Jr(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function qo() { +function Lo() { var t = this.parentNode; t && t.removeChild(this); } -function Lo() { - return this.each(qo); -} function Vo() { + return this.each(Lo); +} +function Ho() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function Ho() { +function Yo() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function Yo(t) { - return this.select(t ? Ho : Vo); -} function Bo(t) { - return arguments.length ? this.property("__data__", t) : this.node().__data__; + return this.select(t ? Yo : Ho); } function zo(t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; +} +function Xo(t) { return function(e) { t.call(this, e, this.__data__); }; } -function Xo(t) { +function Uo(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 Uo(t) { +function Go(t) { return function() { var e = this.__on; if (e) { @@ -2301,9 +2301,9 @@ function Uo(t) { } }; } -function Go(t, e, n) { +function Ko(t, e, n) { return function() { - var r = this.__on, i, s = zo(e); + var r = this.__on, i, s = Xo(e); if (r) { for (var a = 0, l = r.length; a < l; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { @@ -2314,8 +2314,8 @@ function Go(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 Ko(t, e, n) { - var r = Xo(t + ""), i, s = r.length, a; +function jo(t, e, n) { + var r = Uo(t + ""), i, s = r.length, a; if (arguments.length < 2) { var l = this.node().__on; if (l) { @@ -2326,93 +2326,93 @@ function Ko(t, e, n) { } return; } - for (l = e ? Go : Uo, i = 0; i < s; ++i) this.each(l(r[i], e, n)); + for (l = e ? Ko : Go, i = 0; i < s; ++i) this.each(l(r[i], e, n)); return this; } function ks(t, e, n) { - var r = Es(t), i = r.CustomEvent; + var r = Rs(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 jo(t, e) { +function Wo(t, e) { return function() { return ks(this, t, e); }; } -function Wo(t, e) { +function Jo(t, e) { return function() { return ks(this, t, e.apply(this, arguments)); }; } -function Jo(t, e) { - return this.each((typeof e == "function" ? Wo : jo)(t, e)); +function Zo(t, e) { + return this.each((typeof e == "function" ? Jo : Wo)(t, e)); } -function* Zo() { +function* Qo() { 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 Ss = [null]; -function bt(t, e) { +var Ms = [null]; +function xt(t, e) { this._groups = t, this._parents = e; } -function Le() { - return new bt([[document.documentElement]], Ss); +function Ve() { + return new xt([[document.documentElement]], Ms); } -function Qo() { +function tu() { return this; } -bt.prototype = Le.prototype = { - constructor: bt, - select: Al, +xt.prototype = Ve.prototype = { + constructor: xt, + select: El, selectAll: Tl, - selectChild: Ml, - selectChildren: Il, - filter: Fl, - data: Bl, - enter: ql, - exit: Xl, - join: Ul, - merge: Gl, - selection: Qo, - order: Kl, - sort: jl, - call: Jl, - nodes: Zl, - node: Ql, - size: to, - empty: eo, - each: no, - attr: uo, - style: vo, - property: mo, - classed: bo, - text: Ro, + selectChild: Pl, + selectChildren: Fl, + filter: ql, + data: zl, + enter: Ll, + exit: Ul, + join: Gl, + merge: Kl, + selection: tu, + order: jl, + sort: Wl, + call: Zl, + nodes: Ql, + node: to, + size: eo, + empty: no, + each: ro, + attr: fo, + style: po, + property: yo, + classed: $o, + text: Co, html: ko, - raise: Mo, - lower: Po, - append: Do, - insert: Fo, - remove: Lo, - clone: Yo, - datum: Bo, - on: Ko, - dispatch: Jo, - [Symbol.iterator]: Zo + raise: Po, + lower: Do, + append: Io, + insert: qo, + remove: Vo, + clone: Bo, + datum: zo, + on: jo, + dispatch: Zo, + [Symbol.iterator]: Qo }; -function it(t) { - return typeof t == "string" ? new bt([[document.querySelector(t)]], [document.documentElement]) : new bt([[t]], Ss); +function st(t) { + return typeof t == "string" ? new xt([[document.querySelector(t)]], [document.documentElement]) : new xt([[t]], Ms); } -function Jr(t, e, n) { +function Qr(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } -function Ms(t, e) { +function Ps(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } -function sn() { +function an() { } -var Qe = 0.7, Vn = 1 / Qe, ke = "\\s*([+-]?\\d+)\\s*", tn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", zt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", tu = /^#([0-9a-f]{3,8})$/, eu = new RegExp(`^rgb\\(${ke},${ke},${ke}\\)$`), nu = new RegExp(`^rgb\\(${zt},${zt},${zt}\\)$`), ru = new RegExp(`^rgba\\(${ke},${ke},${ke},${tn}\\)$`), iu = new RegExp(`^rgba\\(${zt},${zt},${zt},${tn}\\)$`), su = new RegExp(`^hsl\\(${tn},${zt},${zt}\\)$`), au = new RegExp(`^hsla\\(${tn},${zt},${zt},${tn}\\)$`), bi = { +var tn = 0.7, Yn = 1 / tn, ke = "\\s*([+-]?\\d+)\\s*", en = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Xt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", eu = /^#([0-9a-f]{3,8})$/, nu = new RegExp(`^rgb\\(${ke},${ke},${ke}\\)$`), ru = new RegExp(`^rgb\\(${Xt},${Xt},${Xt}\\)$`), iu = new RegExp(`^rgba\\(${ke},${ke},${ke},${en}\\)$`), su = new RegExp(`^rgba\\(${Xt},${Xt},${Xt},${en}\\)$`), au = new RegExp(`^hsl\\(${en},${Xt},${Xt}\\)$`), lu = new RegExp(`^hsla\\(${en},${Xt},${Xt},${en}\\)$`), $i = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -2562,178 +2562,178 @@ var Qe = 0.7, Vn = 1 / Qe, ke = "\\s*([+-]?\\d+)\\s*", tn = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Jr(sn, $e, { +Qr(an, Ae, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, - hex: $i, + hex: Ai, // Deprecated! Use color.formatHex. - formatHex: $i, - formatHex8: lu, - formatHsl: ou, - formatRgb: Ai, - toString: Ai + formatHex: Ai, + formatHex8: ou, + formatHsl: uu, + formatRgb: Ei, + toString: Ei }); -function $i() { +function Ai() { return this.rgb().formatHex(); } -function lu() { +function ou() { return this.rgb().formatHex8(); } -function ou() { +function uu() { return Os(this).formatHsl(); } -function Ai() { +function Ei() { return this.rgb().formatRgb(); } -function $e(t) { +function Ae(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = tu.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ei(e) : n === 3 ? new dt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? vn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? vn(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 = eu.exec(t)) ? new dt(e[1], e[2], e[3], 1) : (e = nu.exec(t)) ? new dt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = ru.exec(t)) ? vn(e[1], e[2], e[3], e[4]) : (e = iu.exec(t)) ? vn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = su.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, 1) : (e = au.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, e[4]) : bi.hasOwnProperty(t) ? Ei(bi[t]) : t === "transparent" ? new dt(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = eu.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ri(e) : n === 3 ? new vt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? _n(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? _n(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 = nu.exec(t)) ? new vt(e[1], e[2], e[3], 1) : (e = ru.exec(t)) ? new vt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = iu.exec(t)) ? _n(e[1], e[2], e[3], e[4]) : (e = su.exec(t)) ? _n(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = au.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, 1) : (e = lu.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, e[4]) : $i.hasOwnProperty(t) ? Ri($i[t]) : t === "transparent" ? new vt(NaN, NaN, NaN, 0) : null; } -function Ei(t) { - return new dt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); +function Ri(t) { + return new vt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function vn(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new dt(t, e, n, r); +function _n(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new vt(t, e, n, r); } -function uu(t) { - return t instanceof sn || (t = $e(t)), t ? (t = t.rgb(), new dt(t.r, t.g, t.b, t.opacity)) : new dt(); +function fu(t) { + return t instanceof an || (t = Ae(t)), t ? (t = t.rgb(), new vt(t.r, t.g, t.b, t.opacity)) : new vt(); } -function br(t, e, n, r) { - return arguments.length === 1 ? uu(t) : new dt(t, e, n, r ?? 1); +function Ar(t, e, n, r) { + return arguments.length === 1 ? fu(t) : new vt(t, e, n, r ?? 1); } -function dt(t, e, n, r) { +function vt(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -Jr(dt, br, Ms(sn, { +Qr(vt, Ar, Ps(an, { brighter(t) { - return t = t == null ? Vn : Math.pow(Vn, t), new dt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? Yn : Math.pow(Yn, t), new vt(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? Qe : Math.pow(Qe, t), new dt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? tn : Math.pow(tn, t), new vt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new dt(xe(this.r), xe(this.g), xe(this.b), Hn(this.opacity)); + return new vt(be(this.r), be(this.g), be(this.b), Bn(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: Ri, + hex: Ci, // Deprecated! Use color.formatHex. - formatHex: Ri, - formatHex8: fu, + formatHex: Ci, + formatHex8: cu, formatRgb: Ni, toString: Ni })); -function Ri() { - return `#${ye(this.r)}${ye(this.g)}${ye(this.b)}`; +function Ci() { + return `#${we(this.r)}${we(this.g)}${we(this.b)}`; } -function fu() { - return `#${ye(this.r)}${ye(this.g)}${ye(this.b)}${ye((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function cu() { + return `#${we(this.r)}${we(this.g)}${we(this.b)}${we((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Ni() { - const t = Hn(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${xe(this.r)}, ${xe(this.g)}, ${xe(this.b)}${t === 1 ? ")" : `, ${t})`}`; + const t = Bn(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${be(this.r)}, ${be(this.g)}, ${be(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function Hn(t) { +function Bn(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function xe(t) { +function be(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function ye(t) { - return t = xe(t), (t < 16 ? "0" : "") + t.toString(16); +function we(t) { + return t = be(t), (t < 16 ? "0" : "") + t.toString(16); } function Ti(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Mt(t, e, n, r); + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Pt(t, e, n, r); } function Os(t) { - if (t instanceof Mt) return new Mt(t.h, t.s, t.l, t.opacity); - if (t instanceof sn || (t = $e(t)), !t) return new Mt(); - if (t instanceof Mt) return t; + if (t instanceof Pt) return new Pt(t.h, t.s, t.l, t.opacity); + if (t instanceof an || (t = Ae(t)), !t) return new Pt(); + if (t instanceof Pt) 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, l = s - i, o = (s + i) / 2; - return l ? (e === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - e) / l + 2 : a = (e - n) / l + 4, l /= o < 0.5 ? s + i : 2 - s - i, a *= 60) : l = o > 0 && o < 1 ? 0 : a, new Mt(a, l, o, t.opacity); + return l ? (e === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - e) / l + 2 : a = (e - n) / l + 4, l /= o < 0.5 ? s + i : 2 - s - i, a *= 60) : l = o > 0 && o < 1 ? 0 : a, new Pt(a, l, o, t.opacity); } -function cu(t, e, n, r) { - return arguments.length === 1 ? Os(t) : new Mt(t, e, n, r ?? 1); +function hu(t, e, n, r) { + return arguments.length === 1 ? Os(t) : new Pt(t, e, n, r ?? 1); } -function Mt(t, e, n, r) { +function Pt(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -Jr(Mt, cu, Ms(sn, { +Qr(Pt, hu, Ps(an, { brighter(t) { - return t = t == null ? Vn : Math.pow(Vn, t), new Mt(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? Yn : Math.pow(Yn, t), new Pt(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? Qe : Math.pow(Qe, t), new Mt(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? tn : Math.pow(tn, t), new Pt(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( - hr(t >= 240 ? t - 240 : t + 120, i, r), - hr(t, i, r), - hr(t < 120 ? t + 240 : t - 120, i, r), + return new vt( + vr(t >= 240 ? t - 240 : t + 120, i, r), + vr(t, i, r), + vr(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new Mt(Ci(this.h), pn(this.s), pn(this.l), Hn(this.opacity)); + return new Pt(Si(this.h), gn(this.s), gn(this.l), Bn(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 = Hn(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${Ci(this.h)}, ${pn(this.s) * 100}%, ${pn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = Bn(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${Si(this.h)}, ${gn(this.s) * 100}%, ${gn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); -function Ci(t) { +function Si(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function pn(t) { +function gn(t) { return Math.max(0, Math.min(1, t || 0)); } -function hr(t, e, n) { +function vr(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 Zr = (t) => () => t; -function hu(t, e) { +const ti = (t) => () => t; +function du(t, e) { return function(n) { return t + n * e; }; } -function du(t, e, n) { +function vu(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 vu(t) { - return (t = +t) == 1 ? Ps : function(e, n) { - return n - e ? du(e, n, t) : Zr(isNaN(e) ? n : e); +function pu(t) { + return (t = +t) == 1 ? Ds : function(e, n) { + return n - e ? vu(e, n, t) : ti(isNaN(e) ? n : e); }; } -function Ps(t, e) { +function Ds(t, e) { var n = e - t; - return n ? hu(t, n) : Zr(isNaN(t) ? e : t); + return n ? du(t, n) : ti(isNaN(t) ? e : t); } -const Yn = function t(e) { - var n = vu(e); +const zn = function t(e) { + var n = pu(e); function r(i, s) { - var a = n((i = br(i)).r, (s = br(s)).r), l = n(i.g, s.g), o = n(i.b, s.b), f = Ps(i.opacity, s.opacity); + var a = n((i = Ar(i)).r, (s = Ar(s)).r), l = n(i.g, s.g), o = n(i.b, s.b), f = Ds(i.opacity, s.opacity); return function(u) { return i.r = a(u), i.g = l(u), i.b = o(u), i.opacity = f(u), i + ""; }; } return r.gamma = t, r; }(1); -function pu(t, e) { +function _u(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { @@ -2741,10 +2741,10 @@ function pu(t, e) { return r; }; } -function _u(t) { +function gu(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function gu(t, e) { +function mu(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] = Te(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; @@ -2753,18 +2753,18 @@ function gu(t, e) { return s; }; } -function mu(t, e) { +function yu(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; }; } -function Yt(t, e) { +function Bt(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } -function yu(t, e) { +function wu(t, e) { var n = {}, r = {}, i; (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {}); for (i in e) @@ -2774,31 +2774,31 @@ function yu(t, e) { return r; }; } -var $r = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, dr = new RegExp($r.source, "g"); -function wu(t) { +var Er = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, pr = new RegExp(Er.source, "g"); +function xu(t) { return function() { return t; }; } -function xu(t) { +function bu(t) { return function(e) { return t(e) + ""; }; } -function Ds(t, e) { - var n = $r.lastIndex = dr.lastIndex = 0, r, i, s, a = -1, l = [], o = []; - for (t = t + "", e = e + ""; (r = $r.exec(t)) && (i = dr.exec(e)); ) - (s = i.index) > n && (s = e.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: Yt(r, i) })), n = dr.lastIndex; - return n < e.length && (s = e.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? o[0] ? xu(o[0].x) : wu(e) : (e = o.length, function(f) { +function Is(t, e) { + var n = Er.lastIndex = pr.lastIndex = 0, r, i, s, a = -1, l = [], o = []; + for (t = t + "", e = e + ""; (r = Er.exec(t)) && (i = pr.exec(e)); ) + (s = i.index) > n && (s = e.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: Bt(r, i) })), n = pr.lastIndex; + return n < e.length && (s = e.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? o[0] ? bu(o[0].x) : xu(e) : (e = o.length, function(f) { for (var u = 0, h; u < e; ++u) l[(h = o[u]).i] = h.x(f); return l.join(""); }); } function Te(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? Zr(e) : (n === "number" ? Yt : n === "string" ? (r = $e(e)) ? (e = r, Yn) : Ds : e instanceof $e ? Yn : e instanceof Date ? mu : _u(e) ? pu : Array.isArray(e) ? gu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? yu : Yt)(t, e); + return e == null || n === "boolean" ? ti(e) : (n === "number" ? Bt : n === "string" ? (r = Ae(e)) ? (e = r, zn) : Is : e instanceof Ae ? zn : e instanceof Date ? yu : gu(e) ? _u : Array.isArray(e) ? mu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? wu : Bt)(t, e); } -var ki = 180 / Math.PI, Ar = { +var ki = 180 / Math.PI, Rr = { translateX: 0, translateY: 0, rotate: 0, @@ -2806,7 +2806,7 @@ var ki = 180 / Math.PI, Ar = { scaleX: 1, scaleY: 1 }; -function Is(t, e, n, r, i, s) { +function Fs(t, e, n, r, i, s) { var a, l, o; return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (o = t * n + e * r) && (n -= t * o, r -= e * o), (l = Math.sqrt(n * n + r * r)) && (n /= l, r /= l, o /= l), t * r < e * n && (t = -t, e = -e, o = -o, a = -a), { translateX: i, @@ -2817,145 +2817,145 @@ function Is(t, e, n, r, i, s) { scaleY: l }; } -var _n; -function bu(t) { +var mn; +function $u(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? Ar : Is(e.a, e.b, e.c, e.d, e.e, e.f); + return e.isIdentity ? Rr : Fs(e.a, e.b, e.c, e.d, e.e, e.f); } -function $u(t) { - return t == null || (_n || (_n = document.createElementNS("http://www.w3.org/2000/svg", "g")), _n.setAttribute("transform", t), !(t = _n.transform.baseVal.consolidate())) ? Ar : (t = t.matrix, Is(t.a, t.b, t.c, t.d, t.e, t.f)); +function Au(t) { + return t == null || (mn || (mn = document.createElementNS("http://www.w3.org/2000/svg", "g")), mn.setAttribute("transform", t), !(t = mn.transform.baseVal.consolidate())) ? Rr : (t = t.matrix, Fs(t.a, t.b, t.c, t.d, t.e, t.f)); } -function Fs(t, e, n, r) { +function qs(t, e, n, r) { function i(f) { return f.length ? f.pop() + " " : ""; } function s(f, u, h, c, d, p) { if (f !== h || u !== c) { - var m = d.push("translate(", null, e, null, n); - p.push({ i: m - 4, x: Yt(f, h) }, { i: m - 2, x: Yt(u, c) }); + var w = d.push("translate(", null, e, null, n); + p.push({ i: w - 4, x: Bt(f, h) }, { i: w - 2, x: Bt(u, c) }); } else (h || c) && d.push("translate(" + h + e + c + n); } function a(f, u, h, c) { - f !== u ? (f - u > 180 ? u += 360 : u - f > 180 && (f += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Yt(f, u) })) : u && h.push(i(h) + "rotate(" + u + r); + f !== u ? (f - u > 180 ? u += 360 : u - f > 180 && (f += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Bt(f, u) })) : u && h.push(i(h) + "rotate(" + u + r); } function l(f, u, h, c) { - f !== u ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Yt(f, u) }) : u && h.push(i(h) + "skewX(" + u + r); + f !== u ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Bt(f, u) }) : u && h.push(i(h) + "skewX(" + u + r); } function o(f, u, h, c, d, p) { if (f !== h || u !== c) { - var m = d.push(i(d) + "scale(", null, ",", null, ")"); - p.push({ i: m - 4, x: Yt(f, h) }, { i: m - 2, x: Yt(u, c) }); + var w = d.push(i(d) + "scale(", null, ",", null, ")"); + p.push({ i: w - 4, x: Bt(f, h) }, { i: w - 2, x: Bt(u, c) }); } else (h !== 1 || c !== 1) && d.push(i(d) + "scale(" + h + "," + c + ")"); } return function(f, u) { var h = [], c = []; return f = t(f), u = t(u), s(f.translateX, f.translateY, u.translateX, u.translateY, h, c), a(f.rotate, u.rotate, h, c), l(f.skewX, u.skewX, h, c), o(f.scaleX, f.scaleY, u.scaleX, u.scaleY, h, c), f = u = null, function(d) { - for (var p = -1, m = c.length, b; ++p < m; ) h[(b = c[p]).i] = b.x(d); + for (var p = -1, w = c.length, $; ++p < w; ) h[($ = c[p]).i] = $.x(d); return h.join(""); }; }; } -var Au = Fs(bu, "px, ", "px)", "deg)"), Eu = Fs($u, ", ", ")", ")"), Pe = 0, ze = 0, Be = 0, qs = 1e3, Bn, Xe, zn = 0, Ae = 0, nr = 0, en = typeof performance == "object" && performance.now ? performance : Date, Ls = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Eu = qs($u, "px, ", "px)", "deg)"), Ru = qs(Au, ", ", ")", ")"), De = 0, Xe = 0, ze = 0, Ls = 1e3, Xn, Ue, Un = 0, Ee = 0, ir = 0, nn = typeof performance == "object" && performance.now ? performance : Date, Vs = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; -function Qr() { - return Ae || (Ls(Ru), Ae = en.now() + nr); +function ei() { + return Ee || (Vs(Cu), Ee = nn.now() + ir); } -function Ru() { - Ae = 0; +function Cu() { + Ee = 0; } -function Xn() { +function Gn() { this._call = this._time = this._next = null; } -Xn.prototype = Vs.prototype = { - constructor: Xn, +Gn.prototype = Hs.prototype = { + constructor: Gn, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? Qr() : +n) + (e == null ? 0 : +e), !this._next && Xe !== this && (Xe ? Xe._next = this : Bn = this, Xe = this), this._call = t, this._time = n, Er(); + n = (n == null ? ei() : +n) + (e == null ? 0 : +e), !this._next && Ue !== this && (Ue ? Ue._next = this : Xn = this, Ue = this), this._call = t, this._time = n, Cr(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, Er()); + this._call && (this._call = null, this._time = 1 / 0, Cr()); } }; -function Vs(t, e, n) { - var r = new Xn(); +function Hs(t, e, n) { + var r = new Gn(); return r.restart(t, e, n), r; } function Nu() { - Qr(), ++Pe; - for (var t = Bn, e; t; ) - (e = Ae - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --Pe; + ei(), ++De; + for (var t = Xn, e; t; ) + (e = Ee - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --De; } -function Si() { - Ae = (zn = en.now()) + nr, Pe = ze = 0; +function Mi() { + Ee = (Un = nn.now()) + ir, De = Xe = 0; try { Nu(); } finally { - Pe = 0, Cu(), Ae = 0; + De = 0, Su(), Ee = 0; } } function Tu() { - var t = en.now(), e = t - zn; - e > qs && (nr -= e, zn = t); + var t = nn.now(), e = t - Un; + e > Ls && (ir -= e, Un = t); } -function Cu() { - for (var t, e = Bn, 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 : Bn = n); - Xe = t, Er(r); +function Su() { + for (var t, e = Xn, 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 : Xn = n); + Ue = t, Cr(r); } -function Er(t) { - if (!Pe) { - ze && (ze = clearTimeout(ze)); - var e = t - Ae; - e > 24 ? (t < 1 / 0 && (ze = setTimeout(Si, t - en.now() - nr)), Be && (Be = clearInterval(Be))) : (Be || (zn = en.now(), Be = setInterval(Tu, qs)), Pe = 1, Ls(Si)); +function Cr(t) { + if (!De) { + Xe && (Xe = clearTimeout(Xe)); + var e = t - Ee; + e > 24 ? (t < 1 / 0 && (Xe = setTimeout(Mi, t - nn.now() - ir)), ze && (ze = clearInterval(ze))) : (ze || (Un = nn.now(), ze = setInterval(Tu, Ls)), De = 1, Vs(Mi)); } } -function Mi(t, e, n) { - var r = new Xn(); +function Pi(t, e, n) { + var r = new Gn(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var ku = ys("start", "end", "cancel", "interrupt"), Su = [], Hs = 0, Oi = 1, Rr = 2, $n = 3, Pi = 4, Nr = 5, An = 6; -function rr(t, e, n, r, i, s) { +var ku = ws("start", "end", "cancel", "interrupt"), Mu = [], Ys = 0, Oi = 1, Nr = 2, En = 3, Di = 4, Tr = 5, Rn = 6; +function sr(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - Mu(t, n, { + Pu(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. on: ku, - tween: Su, + tween: Mu, time: s.time, delay: s.delay, duration: s.duration, ease: s.ease, timer: null, - state: Hs + state: Ys }); } -function ti(t, e) { - var n = Pt(t, e); - if (n.state > Hs) throw new Error("too late; already scheduled"); +function ni(t, e) { + var n = Dt(t, e); + if (n.state > Ys) throw new Error("too late; already scheduled"); return n; } -function Ut(t, e) { - var n = Pt(t, e); - if (n.state > $n) throw new Error("too late; already running"); +function Gt(t, e) { + var n = Dt(t, e); + if (n.state > En) throw new Error("too late; already running"); return n; } -function Pt(t, e) { +function Dt(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Mu(t, e, n) { +function Pu(t, e, n) { var r = t.__transition, i; - r[e] = n, n.timer = Vs(s, 0, n.time); + r[e] = n, n.timer = Hs(s, 0, n.time); function s(f) { n.state = Oi, n.timer.restart(a, n.delay, n.time), n.delay <= f && a(f - n.delay); } @@ -2964,24 +2964,24 @@ function Mu(t, e, n) { if (n.state !== Oi) return o(); for (u in r) if (d = r[u], d.name === n.name) { - if (d.state === $n) return Mi(a); - d.state === Pi ? (d.state = An, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[u]) : +u < e && (d.state = An, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[u]); + if (d.state === En) return Pi(a); + d.state === Di ? (d.state = Rn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[u]) : +u < e && (d.state = Rn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[u]); } - if (Mi(function() { - n.state === $n && (n.state = Pi, n.timer.restart(l, n.delay, n.time), l(f)); - }), n.state = Rr, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Rr) { - for (n.state = $n, i = new Array(c = n.tween.length), u = 0, h = -1; u < c; ++u) + if (Pi(function() { + n.state === En && (n.state = Di, n.timer.restart(l, n.delay, n.time), l(f)); + }), n.state = Nr, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Nr) { + for (n.state = En, i = new Array(c = n.tween.length), u = 0, h = -1; u < c; ++u) (d = n.tween[u].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d); i.length = h + 1; } } function l(f) { - for (var u = f < n.duration ? n.ease.call(null, f / n.duration) : (n.timer.restart(o), n.state = Nr, 1), h = -1, c = i.length; ++h < c; ) + for (var u = f < n.duration ? n.ease.call(null, f / n.duration) : (n.timer.restart(o), n.state = Tr, 1), h = -1, c = i.length; ++h < c; ) i[h].call(t, u); - n.state === Nr && (n.on.call("end", t, t.__data__, n.index, n.group), o()); + n.state === Tr && (n.on.call("end", t, t.__data__, n.index, n.group), o()); } function o() { - n.state = An, n.timer.stop(), delete r[e]; + n.state = Rn, n.timer.stop(), delete r[e]; for (var f in r) return; delete t.__transition; } @@ -2995,20 +2995,20 @@ function Ou(t, e) { s = !1; continue; } - i = r.state > Rr && r.state < Nr, r.state = An, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > Nr && r.state < Tr, r.state = Rn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } -function Pu(t) { +function Du(t) { return this.each(function() { Ou(this, t); }); } -function Du(t, e) { +function Iu(t, e) { var n, r; return function() { - var i = Ut(this, t), s = i.tween; + var i = Gt(this, t), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, l = r.length; a < l; ++a) @@ -3020,11 +3020,11 @@ function Du(t, e) { i.tween = r; }; } -function Iu(t, e, n) { +function Fu(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Ut(this, t), a = s.tween; + var s = Gt(this, t), a = s.tween; if (a !== r) { i = (r = a).slice(); for (var l = { name: e, value: n }, o = 0, f = i.length; o < f; ++o) @@ -3037,279 +3037,279 @@ function Iu(t, e, n) { s.tween = i; }; } -function Fu(t, e) { +function qu(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = Pt(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = Dt(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 ? Du : Iu)(n, t, e)); + return this.each((e == null ? Iu : Fu)(n, t, e)); } -function ei(t, e, n) { +function ri(t, e, n) { var r = t._id; return t.each(function() { - var i = Ut(this, r); + var i = Gt(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return Pt(i, r).value[e]; + return Dt(i, r).value[e]; }; } -function Ys(t, e) { +function Bs(t, e) { var n; - return (typeof e == "number" ? Yt : e instanceof $e ? Yn : (n = $e(e)) ? (e = n, Yn) : Ds)(t, e); + return (typeof e == "number" ? Bt : e instanceof Ae ? zn : (n = Ae(e)) ? (e = n, zn) : Is)(t, e); } -function qu(t) { +function Lu(t) { return function() { this.removeAttribute(t); }; } -function Lu(t) { +function Vu(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function Vu(t, e, n) { +function Hu(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 Hu(t, e, n) { +function Yu(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 Yu(t, e, n) { +function Bu(t, e, n) { var r, i, s; return function() { var a, l = n(this), o; return l == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l))); }; } -function Bu(t, e, n) { +function zu(t, e, n) { var r, i, s; return function() { var a, l = n(this), o; return l == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l))); }; } -function zu(t, e) { - var n = er(t), r = n === "transform" ? Eu : Ys; - return this.attrTween(t, typeof e == "function" ? (n.local ? Bu : Yu)(n, r, ei(this, "attr." + t, e)) : e == null ? (n.local ? Lu : qu)(n) : (n.local ? Hu : Vu)(n, r, e)); -} function Xu(t, e) { + var n = rr(t), r = n === "transform" ? Ru : Bs; + return this.attrTween(t, typeof e == "function" ? (n.local ? zu : Bu)(n, r, ri(this, "attr." + t, e)) : e == null ? (n.local ? Vu : Lu)(n) : (n.local ? Yu : Hu)(n, r, e)); +} +function Uu(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function Uu(t, e) { +function Gu(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function Gu(t, e) { +function Ku(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Uu(t, s)), n; + return s !== r && (n = (r = s) && Gu(t, s)), n; } return i._value = e, i; } -function Ku(t, e) { +function ju(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Xu(t, s)), n; + return s !== r && (n = (r = s) && Uu(t, s)), n; } return i._value = e, i; } -function ju(t, e) { +function Wu(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 = er(t); - return this.tween(n, (r.local ? Gu : Ku)(r, e)); + var r = rr(t); + return this.tween(n, (r.local ? Ku : ju)(r, e)); } -function Wu(t, e) { +function Ju(t, e) { return function() { - ti(this, t).delay = +e.apply(this, arguments); + ni(this, t).delay = +e.apply(this, arguments); }; } -function Ju(t, e) { +function Zu(t, e) { return e = +e, function() { - ti(this, t).delay = e; + ni(this, t).delay = e; }; } -function Zu(t) { +function Qu(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Wu : Ju)(e, t)) : Pt(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? Ju : Zu)(e, t)) : Dt(this.node(), e).delay; } -function Qu(t, e) { +function tf(t, e) { return function() { - Ut(this, t).duration = +e.apply(this, arguments); + Gt(this, t).duration = +e.apply(this, arguments); }; } -function tf(t, e) { +function ef(t, e) { return e = +e, function() { - Ut(this, t).duration = e; + Gt(this, t).duration = e; }; } -function ef(t) { +function nf(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Qu : tf)(e, t)) : Pt(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? tf : ef)(e, t)) : Dt(this.node(), e).duration; } -function nf(t, e) { +function rf(t, e) { if (typeof e != "function") throw new Error(); return function() { - Ut(this, t).ease = e; + Gt(this, t).ease = e; }; } -function rf(t) { +function sf(t) { var e = this._id; - return arguments.length ? this.each(nf(e, t)) : Pt(this.node(), e).ease; + return arguments.length ? this.each(rf(e, t)) : Dt(this.node(), e).ease; } -function sf(t, e) { +function af(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - Ut(this, t).ease = n; + Gt(this, t).ease = n; }; } -function af(t) { +function lf(t) { if (typeof t != "function") throw new Error(); - return this.each(sf(this._id, t)); + return this.each(af(this._id, t)); } -function lf(t) { - typeof t != "function" && (t = bs(t)); +function of(t) { + typeof t != "function" && (t = $s(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, l = r[i] = [], o, f = 0; f < a; ++f) (o = s[f]) && t.call(o, o.__data__, f, s) && l.push(o); - return new se(r, this._parents, this._name, this._id); + return new ae(r, this._parents, this._name, this._id); } -function of(t) { +function uf(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), l = 0; l < s; ++l) for (var o = e[l], f = n[l], u = o.length, h = a[l] = new Array(u), c, d = 0; d < u; ++d) (c = o[d] || f[d]) && (h[d] = c); for (; l < r; ++l) a[l] = e[l]; - return new se(a, this._parents, this._name, this._id); + return new ae(a, this._parents, this._name, this._id); } -function uf(t) { +function ff(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 ff(t, e, n) { - var r, i, s = uf(e) ? ti : Ut; +function cf(t, e, n) { + var r, i, s = ff(e) ? ni : Gt; return function() { var a = s(this, t), l = a.on; l !== r && (i = (r = l).copy()).on(e, n), a.on = i; }; } -function cf(t, e) { +function hf(t, e) { var n = this._id; - return arguments.length < 2 ? Pt(this.node(), n).on.on(t) : this.each(ff(n, t, e)); + return arguments.length < 2 ? Dt(this.node(), n).on.on(t) : this.each(cf(n, t, e)); } -function hf(t) { +function df(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } -function df() { - return this.on("end.remove", hf(this._id)); +function vf() { + return this.on("end.remove", df(this._id)); } -function vf(t) { +function pf(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = jr(t)); + typeof t != "function" && (t = Jr(t)); 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, f = s[a] = new Array(o), u, h, c = 0; c < o; ++c) - (u = l[c]) && (h = t.call(u, u.__data__, c, l)) && ("__data__" in u && (h.__data__ = u.__data__), f[c] = h, rr(f[c], e, n, c, f, Pt(u, n))); - return new se(s, this._parents, e, n); + (u = l[c]) && (h = t.call(u, u.__data__, c, l)) && ("__data__" in u && (h.__data__ = u.__data__), f[c] = h, sr(f[c], e, n, c, f, Dt(u, n))); + return new ae(s, this._parents, e, n); } -function pf(t) { +function _f(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = xs(t)); + typeof t != "function" && (t = bs(t)); for (var r = this._groups, i = r.length, s = [], a = [], l = 0; l < i; ++l) for (var o = r[l], f = o.length, u, h = 0; h < f; ++h) if (u = o[h]) { - for (var c = t.call(u, u.__data__, h, o), d, p = Pt(u, n), m = 0, b = c.length; m < b; ++m) - (d = c[m]) && rr(d, e, n, m, c, p); + for (var c = t.call(u, u.__data__, h, o), d, p = Dt(u, n), w = 0, $ = c.length; w < $; ++w) + (d = c[w]) && sr(d, e, n, w, c, p); s.push(c), a.push(u); } - return new se(s, a, e, n); + return new ae(s, a, e, n); } -var _f = Le.prototype.constructor; -function gf() { - return new _f(this._groups, this._parents); +var gf = Ve.prototype.constructor; +function mf() { + return new gf(this._groups, this._parents); } -function mf(t, e) { +function yf(t, e) { var n, r, i; return function() { var s = Oe(this, t), a = (this.style.removeProperty(t), Oe(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } -function Bs(t) { +function zs(t) { return function() { this.style.removeProperty(t); }; } -function yf(t, e, n) { +function wf(t, e, n) { var r, i = n + "", s; return function() { var a = Oe(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function wf(t, e, n) { +function xf(t, e, n) { var r, i, s; return function() { var a = Oe(this, t), l = n(this), o = l + ""; return l == null && (o = l = (this.style.removeProperty(t), Oe(this, t))), a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l)); }; } -function xf(t, e) { +function bf(t, e) { var n, r, i, s = "style." + e, a = "end." + s, l; return function() { - var o = Ut(this, t), f = o.on, u = o.value[s] == null ? l || (l = Bs(e)) : void 0; + var o = Gt(this, t), f = o.on, u = o.value[s] == null ? l || (l = zs(e)) : void 0; (f !== n || i !== u) && (r = (n = f).copy()).on(a, i = u), o.on = r; }; } -function bf(t, e, n) { - var r = (t += "") == "transform" ? Au : Ys; - return e == null ? this.styleTween(t, mf(t, r)).on("end.style." + t, Bs(t)) : typeof e == "function" ? this.styleTween(t, wf(t, r, ei(this, "style." + t, e))).each(xf(this._id, t)) : this.styleTween(t, yf(t, r, e), n).on("end.style." + t, null); -} function $f(t, e, n) { + var r = (t += "") == "transform" ? Eu : Bs; + return e == null ? this.styleTween(t, yf(t, r)).on("end.style." + t, zs(t)) : typeof e == "function" ? this.styleTween(t, xf(t, r, ri(this, "style." + t, e))).each(bf(this._id, t)) : this.styleTween(t, wf(t, r, e), n).on("end.style." + t, null); +} +function Af(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } -function Af(t, e, n) { +function Ef(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && $f(t, a, n)), r; + return a !== i && (r = (i = a) && Af(t, a, n)), r; } return s._value = e, s; } -function Ef(t, e, n) { +function Rf(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, Af(t, e, n ?? "")); + return this.tween(r, Ef(t, e, n ?? "")); } -function Rf(t) { +function Cf(t) { return function() { this.textContent = t; }; @@ -3321,9 +3321,9 @@ function Nf(t) { }; } function Tf(t) { - return this.tween("text", typeof t == "function" ? Nf(ei(this, "text", t)) : Rf(t == null ? "" : t + "")); + return this.tween("text", typeof t == "function" ? Nf(ri(this, "text", t)) : Cf(t == null ? "" : t + "")); } -function Cf(t) { +function Sf(t) { return function(e) { this.textContent = t.call(this, e); }; @@ -3332,30 +3332,30 @@ function kf(t) { var e, n; function r() { var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && Cf(i)), e; + return i !== n && (e = (n = i) && Sf(i)), e; } return r._value = t, r; } -function Sf(t) { +function Mf(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, kf(t)); } -function Mf() { - for (var t = this._name, e = this._id, n = zs(), r = this._groups, i = r.length, s = 0; s < i; ++s) +function Pf() { + for (var t = this._name, e = this._id, n = Xs(), r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], l = a.length, o, f = 0; f < l; ++f) if (o = a[f]) { - var u = Pt(o, e); - rr(o, t, n, f, a, { + var u = Dt(o, e); + sr(o, t, n, f, a, { time: u.time + u.delay + u.duration, delay: 0, duration: u.duration, ease: u.ease }); } - return new se(r, this._parents, t, n); + return new ae(r, this._parents, t, n); } function Of() { var t, e, n = this, r = n._id, i = n.size(); @@ -3364,90 +3364,90 @@ function Of() { --i === 0 && s(); } }; n.each(function() { - var f = Ut(this, r), u = f.on; + var f = Gt(this, r), u = f.on; u !== t && (e = (t = u).copy(), e._.cancel.push(l), e._.interrupt.push(l), e._.end.push(o)), f.on = e; }), i === 0 && s(); }); } -var Pf = 0; -function se(t, e, n, r) { +var Df = 0; +function ae(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function En(t) { - return Le().transition(t); -} -function zs() { - return ++Pf; -} -var jt = Le.prototype; -se.prototype = En.prototype = { - constructor: se, - select: vf, - selectAll: pf, - selectChild: jt.selectChild, - selectChildren: jt.selectChildren, - filter: lf, - merge: of, - selection: gf, - transition: Mf, - call: jt.call, - nodes: jt.nodes, - node: jt.node, - size: jt.size, - empty: jt.empty, - each: jt.each, - on: cf, - attr: zu, - attrTween: ju, - style: bf, - styleTween: Ef, +function Cn(t) { + return Ve().transition(t); +} +function Xs() { + return ++Df; +} +var Wt = Ve.prototype; +ae.prototype = Cn.prototype = { + constructor: ae, + select: pf, + selectAll: _f, + selectChild: Wt.selectChild, + selectChildren: Wt.selectChildren, + filter: of, + merge: uf, + selection: mf, + transition: Pf, + call: Wt.call, + nodes: Wt.nodes, + node: Wt.node, + size: Wt.size, + empty: Wt.empty, + each: Wt.each, + on: hf, + attr: Xu, + attrTween: Wu, + style: $f, + styleTween: Rf, text: Tf, - textTween: Sf, - remove: df, - tween: Fu, - delay: Zu, - duration: ef, - ease: rf, - easeVarying: af, + textTween: Mf, + remove: vf, + tween: qu, + delay: Qu, + duration: nf, + ease: sf, + easeVarying: lf, end: Of, - [Symbol.iterator]: jt[Symbol.iterator] + [Symbol.iterator]: Wt[Symbol.iterator] }; -function Df(t) { +function If(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var If = { +var Ff = { time: null, // Set on use. delay: 0, duration: 250, - ease: Df + ease: If }; -function Ff(t, e) { +function qf(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 qf(t) { +function Lf(t) { var e, n; - t instanceof se ? (e = t._id, t = t._name) : (e = zs(), (n = If).time = Qr(), t = t == null ? null : t + ""); + t instanceof ae ? (e = t._id, t = t._name) : (e = Xs(), (n = Ff).time = ei(), t = t == null ? null : t + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], l = a.length, o, f = 0; f < l; ++f) - (o = a[f]) && rr(o, t, e, f, a, n || Ff(o, e)); - return new se(r, this._parents, t, e); + (o = a[f]) && sr(o, t, e, f, a, n || qf(o, e)); + return new ae(r, this._parents, t, e); } -Le.prototype.interrupt = Pu; -Le.prototype.transition = qf; -const Tr = Math.PI, Cr = 2 * Tr, me = 1e-6, Lf = Cr - me; -function Xs(t) { +Ve.prototype.interrupt = Du; +Ve.prototype.transition = Lf; +const Sr = Math.PI, kr = 2 * Sr, ye = 1e-6, Vf = kr - ye; +function Us(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function Vf(t) { +function Hf(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return Xs; + if (e > 15) return Us; const n = 10 ** e; return function(r) { this._ += r[0]; @@ -3455,10 +3455,10 @@ function Vf(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Hf { +class Yf { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? Xs : Vf(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? Us : Hf(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -3480,17 +3480,17 @@ class Hf { let a = this._x1, l = this._y1, o = r - e, f = i - n, u = a - e, h = l - n, c = u * u + h * h; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > me) if (!(Math.abs(h * o - f * u) > me) || !s) + else if (c > ye) if (!(Math.abs(h * o - f * u) > ye) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let d = r - a, p = i - l, m = o * o + f * f, b = d * d + p * p, w = Math.sqrt(m), $ = Math.sqrt(c), C = s * Math.tan((Tr - Math.acos((m + c - b) / (2 * w * $))) / 2), A = C / $, O = C / w; - Math.abs(A - 1) > me && this._append`L${e + A * u},${n + A * h}`, this._append`A${s},${s},0,0,${+(h * d > u * p)},${this._x1 = e + O * o},${this._y1 = n + O * f}`; + let d = r - a, p = i - l, w = o * o + f * f, $ = d * d + p * p, m = Math.sqrt(w), A = Math.sqrt(c), C = s * Math.tan((Sr - Math.acos((w + c - $) / (2 * m * A))) / 2), M = C / A, R = C / m; + Math.abs(M - 1) > ye && this._append`L${e + M * u},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * d > u * p)},${this._x1 = e + R * o},${this._y1 = n + R * f}`; } } 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 l = r * Math.cos(i), o = r * Math.sin(i), f = e + l, u = n + o, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${f},${u}` : (Math.abs(this._x1 - f) > me || Math.abs(this._y1 - u) > me) && this._append`L${f},${u}`, r && (c < 0 && (c = c % Cr + Cr), c > Lf ? this._append`A${r},${r},0,1,${h},${e - l},${n - o}A${r},${r},0,1,${h},${this._x1 = f},${this._y1 = u}` : c > me && this._append`A${r},${r},0,${+(c >= Tr)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + this._x1 === null ? this._append`M${f},${u}` : (Math.abs(this._x1 - f) > ye || Math.abs(this._y1 - u) > ye) && this._append`L${f},${u}`, r && (c < 0 && (c = c % kr + kr), c > Vf ? this._append`A${r},${r},0,1,${h},${e - l},${n - o}A${r},${r},0,1,${h},${this._x1 = f},${this._y1 = u}` : c > ye && this._append`A${r},${r},0,${+(c >= Sr)},${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`; @@ -3499,24 +3499,24 @@ class Hf { return this._; } } -function Yf(t) { +function Bf(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 Bf = Yf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function ot(t) { +const zf = Bf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function ut(t) { return function() { return t; }; } -const Di = Math.abs, at = Math.atan2, ge = Math.cos, zf = Math.max, vr = Math.min, Vt = Math.sin, Ce = Math.sqrt, ht = 1e-12, nn = Math.PI, Un = nn / 2, Rn = 2 * nn; -function Xf(t) { - return t > 1 ? 0 : t < -1 ? nn : Math.acos(t); +const Ii = Math.abs, lt = Math.atan2, me = Math.cos, Xf = Math.max, _r = Math.min, Yt = Math.sin, Se = Math.sqrt, dt = 1e-12, rn = Math.PI, Kn = rn / 2, Nn = 2 * rn; +function Uf(t) { + return t > 1 ? 0 : t < -1 ? rn : Math.acos(t); } -function Ii(t) { - return t >= 1 ? Un : t <= -1 ? -Un : Math.asin(t); +function Fi(t) { + return t >= 1 ? Kn : t <= -1 ? -Kn : Math.asin(t); } -function Uf(t) { +function Gf(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -3528,141 +3528,141 @@ function Uf(t) { e = r; } return t; - }, () => new Hf(e); + }, () => new Yf(e); } -function Gf(t) { +function Kf(t) { return t.innerRadius; } -function Kf(t) { +function jf(t) { return t.outerRadius; } -function jf(t) { +function Wf(t) { return t.startAngle; } -function Wf(t) { +function Jf(t) { return t.endAngle; } -function Jf(t) { +function Zf(t) { return t && t.padAngle; } -function Zf(t, e, n, r, i, s, a, l) { +function Qf(t, e, n, r, i, s, a, l) { var o = n - t, f = r - e, u = a - i, h = l - s, c = h * o - u * f; - if (!(c * c < ht)) + if (!(c * c < dt)) return c = (u * (e - s) - h * (t - i)) / c, [t + c * o, e + c * f]; } -function gn(t, e, n, r, i, s, a) { - var l = t - n, o = e - r, f = (a ? s : -s) / Ce(l * l + o * o), u = f * o, h = -f * l, c = t + u, d = e + h, p = n + u, m = r + h, b = (c + p) / 2, w = (d + m) / 2, $ = p - c, C = m - d, A = $ * $ + C * C, O = i - s, P = c * m - p * d, K = (C < 0 ? -1 : 1) * Ce(zf(0, O * O * A - P * P)), j = (P * C - $ * K) / A, et = (-P * $ - C * K) / A, z = (P * C + $ * K) / A, I = (-P * $ + C * K) / A, V = j - b, N = et - w, L = z - b, _t = I - w; - return V * V + N * N > L * L + _t * _t && (j = z, et = I), { - cx: j, +function yn(t, e, n, r, i, s, a) { + var l = t - n, o = e - r, f = (a ? s : -s) / Se(l * l + o * o), u = f * o, h = -f * l, c = t + u, d = e + h, p = n + u, w = r + h, $ = (c + p) / 2, m = (d + w) / 2, A = p - c, C = w - d, M = A * A + C * C, R = i - s, D = c * w - p * d, G = (C < 0 ? -1 : 1) * Se(Xf(0, R * R * M - D * D)), W = (D * C - A * G) / M, et = (-D * A - C * G) / M, Q = (D * C + A * G) / M, B = (-D * A + C * G) / M, I = W - $, b = et - m, L = Q - $, bt = B - m; + return I * I + b * b > L * L + bt * bt && (W = Q, et = B), { + cx: W, cy: et, x01: -u, y01: -h, - x11: j * (i / O - 1), - y11: et * (i / O - 1) + x11: W * (i / R - 1), + y11: et * (i / R - 1) }; } -function Wt() { - var t = Gf, e = Kf, n = ot(0), r = null, i = jf, s = Wf, a = Jf, l = null, o = Uf(f); +function Jt() { + var t = Kf, e = jf, n = ut(0), r = null, i = Wf, s = Jf, a = Zf, l = null, o = Gf(f); function f() { - var u, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - Un, m = s.apply(this, arguments) - Un, b = Di(m - p), w = m > p; - if (l || (l = u = o()), d < c && (h = d, d = c, c = h), !(d > ht)) l.moveTo(0, 0); - else if (b > Rn - ht) - l.moveTo(d * ge(p), d * Vt(p)), l.arc(0, 0, d, p, m, !w), c > ht && (l.moveTo(c * ge(m), c * Vt(m)), l.arc(0, 0, c, m, p, w)); + var u, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - Kn, w = s.apply(this, arguments) - Kn, $ = Ii(w - p), m = w > p; + if (l || (l = u = o()), d < c && (h = d, d = c, c = h), !(d > dt)) l.moveTo(0, 0); + else if ($ > Nn - dt) + l.moveTo(d * me(p), d * Yt(p)), l.arc(0, 0, d, p, w, !m), c > dt && (l.moveTo(c * me(w), c * Yt(w)), l.arc(0, 0, c, w, p, m)); else { - var $ = p, C = m, A = p, O = m, P = b, K = b, j = a.apply(this, arguments) / 2, et = j > ht && (r ? +r.apply(this, arguments) : Ce(c * c + d * d)), z = vr(Di(d - c) / 2, +n.apply(this, arguments)), I = z, V = z, N, L; - if (et > ht) { - var _t = Ii(et / c * Vt(j)), Gt = Ii(et / d * Vt(j)); - (P -= _t * 2) > ht ? (_t *= w ? 1 : -1, A += _t, O -= _t) : (P = 0, A = O = (p + m) / 2), (K -= Gt * 2) > ht ? (Gt *= w ? 1 : -1, $ += Gt, C -= Gt) : (K = 0, $ = C = (p + m) / 2); + var A = p, C = w, M = p, R = w, D = $, G = $, W = a.apply(this, arguments) / 2, et = W > dt && (r ? +r.apply(this, arguments) : Se(c * c + d * d)), Q = _r(Ii(d - c) / 2, +n.apply(this, arguments)), B = Q, I = Q, b, L; + if (et > dt) { + var bt = Fi(et / c * Yt(W)), It = Fi(et / d * Yt(W)); + (D -= bt * 2) > dt ? (bt *= m ? 1 : -1, M += bt, R -= bt) : (D = 0, M = R = (p + w) / 2), (G -= It * 2) > dt ? (It *= m ? 1 : -1, A += It, C -= It) : (G = 0, A = C = (p + w) / 2); } - var st = d * ge($), Nt = d * Vt($), Kt = c * ge(O), Tt = c * Vt(O); - if (z > ht) { - var Dt = d * ge(C), ue = d * Vt(C), pe = c * ge(A), Ct = c * Vt(A), gt; - if (b < nn) - if (gt = Zf(st, Nt, pe, Ct, Dt, ue, Kt, Tt)) { - var fe = st - gt[0], It = Nt - gt[1], Ft = Dt - gt[0], x = ue - gt[1], q = 1 / Vt(Xf((fe * Ft + It * x) / (Ce(fe * fe + It * It) * Ce(Ft * Ft + x * x))) / 2), B = Ce(gt[0] * gt[0] + gt[1] * gt[1]); - I = vr(z, (c - B) / (q - 1)), V = vr(z, (d - B) / (q + 1)); + var Nt = d * me(A), at = d * Yt(A), Kt = c * me(R), jt = c * Yt(R); + if (Q > dt) { + var Tt = d * me(C), Ft = d * Yt(C), ve = c * me(M), pe = c * Yt(M), it; + if ($ < rn) + if (it = Qf(Nt, at, ve, pe, Tt, Ft, Kt, jt)) { + var _e = Nt - it[0], fe = at - it[1], qt = Tt - it[0], Lt = Ft - it[1], x = 1 / Yt(Uf((_e * qt + fe * Lt) / (Se(_e * _e + fe * fe) * Se(qt * qt + Lt * Lt))) / 2), q = Se(it[0] * it[0] + it[1] * it[1]); + B = _r(Q, (c - q) / (x - 1)), I = _r(Q, (d - q) / (x + 1)); } else - I = V = 0; + B = I = 0; } - K > ht ? V > ht ? (N = gn(pe, Ct, st, Nt, d, V, w), L = gn(Dt, ue, Kt, Tt, d, V, w), l.moveTo(N.cx + N.x01, N.cy + N.y01), V < z ? l.arc(N.cx, N.cy, V, at(N.y01, N.x01), at(L.y01, L.x01), !w) : (l.arc(N.cx, N.cy, V, at(N.y01, N.x01), at(N.y11, N.x11), !w), l.arc(0, 0, d, at(N.cy + N.y11, N.cx + N.x11), at(L.cy + L.y11, L.cx + L.x11), !w), l.arc(L.cx, L.cy, V, at(L.y11, L.x11), at(L.y01, L.x01), !w))) : (l.moveTo(st, Nt), l.arc(0, 0, d, $, C, !w)) : l.moveTo(st, Nt), !(c > ht) || !(P > ht) ? l.lineTo(Kt, Tt) : I > ht ? (N = gn(Kt, Tt, Dt, ue, c, -I, w), L = gn(st, Nt, pe, Ct, c, -I, w), l.lineTo(N.cx + N.x01, N.cy + N.y01), I < z ? l.arc(N.cx, N.cy, I, at(N.y01, N.x01), at(L.y01, L.x01), !w) : (l.arc(N.cx, N.cy, I, at(N.y01, N.x01), at(N.y11, N.x11), !w), l.arc(0, 0, c, at(N.cy + N.y11, N.cx + N.x11), at(L.cy + L.y11, L.cx + L.x11), w), l.arc(L.cx, L.cy, I, at(L.y11, L.x11), at(L.y01, L.x01), !w))) : l.arc(0, 0, c, O, A, w); + G > dt ? I > dt ? (b = yn(ve, pe, Nt, at, d, I, m), L = yn(Tt, Ft, Kt, jt, d, I, m), l.moveTo(b.cx + b.x01, b.cy + b.y01), I < Q ? l.arc(b.cx, b.cy, I, lt(b.y01, b.x01), lt(L.y01, L.x01), !m) : (l.arc(b.cx, b.cy, I, lt(b.y01, b.x01), lt(b.y11, b.x11), !m), l.arc(0, 0, d, lt(b.cy + b.y11, b.cx + b.x11), lt(L.cy + L.y11, L.cx + L.x11), !m), l.arc(L.cx, L.cy, I, lt(L.y11, L.x11), lt(L.y01, L.x01), !m))) : (l.moveTo(Nt, at), l.arc(0, 0, d, A, C, !m)) : l.moveTo(Nt, at), !(c > dt) || !(D > dt) ? l.lineTo(Kt, jt) : B > dt ? (b = yn(Kt, jt, Tt, Ft, c, -B, m), L = yn(Nt, at, ve, pe, c, -B, m), l.lineTo(b.cx + b.x01, b.cy + b.y01), B < Q ? l.arc(b.cx, b.cy, B, lt(b.y01, b.x01), lt(L.y01, L.x01), !m) : (l.arc(b.cx, b.cy, B, lt(b.y01, b.x01), lt(b.y11, b.x11), !m), l.arc(0, 0, c, lt(b.cy + b.y11, b.cx + b.x11), lt(L.cy + L.y11, L.cx + L.x11), m), l.arc(L.cx, L.cy, B, lt(L.y11, L.x11), lt(L.y01, L.x01), !m))) : l.arc(0, 0, c, R, M, m); } if (l.closePath(), u) return l = null, u + "" || null; } return f.centroid = function() { - var u = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - nn / 2; - return [ge(h) * u, Vt(h) * u]; + var u = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - rn / 2; + return [me(h) * u, Yt(h) * u]; }, f.innerRadius = function(u) { - return arguments.length ? (t = typeof u == "function" ? u : ot(+u), f) : t; + return arguments.length ? (t = typeof u == "function" ? u : ut(+u), f) : t; }, f.outerRadius = function(u) { - return arguments.length ? (e = typeof u == "function" ? u : ot(+u), f) : e; + return arguments.length ? (e = typeof u == "function" ? u : ut(+u), f) : e; }, f.cornerRadius = function(u) { - return arguments.length ? (n = typeof u == "function" ? u : ot(+u), f) : n; + return arguments.length ? (n = typeof u == "function" ? u : ut(+u), f) : n; }, f.padRadius = function(u) { - return arguments.length ? (r = u == null ? null : typeof u == "function" ? u : ot(+u), f) : r; + return arguments.length ? (r = u == null ? null : typeof u == "function" ? u : ut(+u), f) : r; }, f.startAngle = function(u) { - return arguments.length ? (i = typeof u == "function" ? u : ot(+u), f) : i; + return arguments.length ? (i = typeof u == "function" ? u : ut(+u), f) : i; }, f.endAngle = function(u) { - return arguments.length ? (s = typeof u == "function" ? u : ot(+u), f) : s; + return arguments.length ? (s = typeof u == "function" ? u : ut(+u), f) : s; }, f.padAngle = function(u) { - return arguments.length ? (a = typeof u == "function" ? u : ot(+u), f) : a; + return arguments.length ? (a = typeof u == "function" ? u : ut(+u), f) : a; }, f.context = function(u) { return arguments.length ? (l = u ?? null, f) : l; }, f; } -function Qf(t) { +function tc(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function tc(t, e) { +function ec(t, e) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function ec(t) { +function nc(t) { return t; } -function pr() { - var t = ec, e = tc, n = null, r = ot(0), i = ot(Rn), s = ot(0); +function gr() { + var t = nc, e = ec, n = null, r = ut(0), i = ut(Nn), s = ut(0); function a(l) { - var o, f = (l = Qf(l)).length, u, h, c = 0, d = new Array(f), p = new Array(f), m = +r.apply(this, arguments), b = Math.min(Rn, Math.max(-Rn, i.apply(this, arguments) - m)), w, $ = Math.min(Math.abs(b) / f, s.apply(this, arguments)), C = $ * (b < 0 ? -1 : 1), A; + var o, f = (l = tc(l)).length, u, h, c = 0, d = new Array(f), p = new Array(f), w = +r.apply(this, arguments), $ = Math.min(Nn, Math.max(-Nn, i.apply(this, arguments) - w)), m, A = Math.min(Math.abs($) / f, s.apply(this, arguments)), C = A * ($ < 0 ? -1 : 1), M; for (o = 0; o < f; ++o) - (A = p[d[o] = o] = +t(l[o], o, l)) > 0 && (c += A); - for (e != null ? d.sort(function(O, P) { - return e(p[O], p[P]); - }) : n != null && d.sort(function(O, P) { - return n(l[O], l[P]); - }), o = 0, h = c ? (b - f * C) / c : 0; o < f; ++o, m = w) - u = d[o], A = p[u], w = m + (A > 0 ? A * h : 0) + C, p[u] = { + (M = p[d[o] = o] = +t(l[o], o, l)) > 0 && (c += M); + for (e != null ? d.sort(function(R, D) { + return e(p[R], p[D]); + }) : n != null && d.sort(function(R, D) { + return n(l[R], l[D]); + }), o = 0, h = c ? ($ - f * C) / c : 0; o < f; ++o, w = m) + u = d[o], M = p[u], m = w + (M > 0 ? M * h : 0) + C, p[u] = { data: l[u], index: o, - value: A, - startAngle: m, - endAngle: w, - padAngle: $ + value: M, + startAngle: w, + endAngle: m, + padAngle: A }; return p; } return a.value = function(l) { - return arguments.length ? (t = typeof l == "function" ? l : ot(+l), a) : t; + return arguments.length ? (t = typeof l == "function" ? l : ut(+l), a) : t; }, a.sortValues = function(l) { return arguments.length ? (e = l, n = null, a) : e; }, a.sort = function(l) { return arguments.length ? (n = l, e = null, a) : n; }, a.startAngle = function(l) { - return arguments.length ? (r = typeof l == "function" ? l : ot(+l), a) : r; + return arguments.length ? (r = typeof l == "function" ? l : ut(+l), a) : r; }, a.endAngle = function(l) { - return arguments.length ? (i = typeof l == "function" ? l : ot(+l), a) : i; + return arguments.length ? (i = typeof l == "function" ? l : ut(+l), a) : i; }, a.padAngle = function(l) { - return arguments.length ? (s = typeof l == "function" ? l : ot(+l), a) : s; + return arguments.length ? (s = typeof l == "function" ? l : ut(+l), a) : s; }, a; } -function Ue(t, e, n) { +function Ge(t, e, n) { this.k = t, this.x = e, this.y = n; } -Ue.prototype = { - constructor: Ue, +Ge.prototype = { + constructor: Ge, scale: function(t) { - return t === 1 ? this : new Ue(this.k * t, this.x, this.y); + return t === 1 ? this : new Ge(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new Ue(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new Ge(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]; @@ -3692,9 +3692,9 @@ Ue.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Ue.prototype; -const de = {}, kr = "No Further Rankings"; -function Gn(t, e) { +Ge.prototype; +const Qt = {}, Mr = "No Further Rankings"; +function jn(t, e) { let n = 0; for (let r = 1; r < e; r++) { const i = t.results[r - 1].tallyResults; @@ -3708,7 +3708,7 @@ function Gn(t, e) { } return n; } -function Us(t, e, n) { +function Gs(t, e, n) { if (e < 1) return []; const r = t.results[e - 1].tallyResults, i = []; @@ -3718,475 +3718,485 @@ function Us(t, e, n) { } return i; } -function Kn(t, e) { - return Us(t, e, "eliminated"); +function Wn(t, e) { + return Gs(t, e, "eliminated"); } -function jn(t, e) { +function Jn(t, e) { let n = []; for (let r = 1; r <= e; r++) - n = n.concat(Us(t, r, "elected")); + n = n.concat(Gs(t, r, "elected")); return n; } -var nc = /* @__PURE__ */ ll(''); -const rc = { hash: "svelte-3kpd", code: "" }; -function Gs(t, e) { - Gr(e, !0), _s(t, rc); - let n = Qt(e, "jsonData", 7), r = Qt(e, "currentRound", 7, 1), i = Qt(e, "mouseEventType", 15), s = Qt(e, "mouseData", 15), a = Qt(e, "mouseY", 15), l = Qt(e, "requestRoundChange", 7, (v) => { - }); - const o = 800, f = 800, u = Math.min(o, f) * 0.3, h = o / 2, c = f / 2, d = "Pie", p = "Donut", m = "TextLayer", b = "#transfer", w = "url(#cross-hatch)", $ = 1.15, C = 0.1, A = 750, O = 800; - let P = [], K = [], j = [], et = 0, z = Jt(0), I = 0, V = Jt(null); - function N() { - const v = it(g(V)); - v.select("#" + d).remove(), v.select("#" + p).remove(), v.select("#" + m).remove(); - } - function L(v) { - l() && (W = v, l()(v)); - } - function _t(v) { - N(), j = Gt(v), P = Qs(v, d, j, h, c, 0, st()); - } - dl(() => { - console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), gt(), setTimeout( +var rc = /* @__PURE__ */ ol(''); +const ic = { hash: "svelte-3kpd", code: "" }; +function Ks(t, e) { + jr(e, !0), gs(t, ic); + let n = kt(e, "jsonData", 7), r = kt(e, "currentRound", 7, 1), i = kt(e, "mouseEventType", 15), s = kt(e, "mouseData", 15), a = kt(e, "mouseY", 15), l = kt(e, "requestRoundChange", 7, (v) => { + }), o = kt(e, "candidateColors", 23, () => []); + const f = 800, u = 800, h = Math.min(f, u) * 0.3, c = f / 2, d = u / 2, p = "Pie", w = "Donut", $ = "TextLayer", m = "#transfer", A = "url(#cross-hatch)", C = 1.15, M = 0.1, R = 750, D = 800; + let G = [], W = [], et = [], Q = 0, B = Zt(0), I = 0, b = Zt(null); + function L() { + const v = st(g(b)); + v.select("#" + p).remove(), v.select("#" + w).remove(), v.select("#" + $).remove(); + } + function bt(v) { + l() && (K = v, l()(v)); + } + function It(v) { + L(), et = Nt(v), G = ta(v, p, et, c, d, 0, at()); + } + vl(() => { + console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), _e(), setTimeout( () => { - _t(r()); + It(r()); }, 0 ); }); - function Gt(v) { - const _ = Ct(v); - return et = ue(v), _; + function Nt(v) { + const _ = it(v); + return Q = ve(v), _; } - function st() { - return u; + function at() { + return h; } - function Nt() { - return st() * 1.41; + function Kt() { + return at() * 1.41; } - function Kt(v, _) { - if (v === "exhausted") return Gn(n(), _); + function jt(v, _) { + if (v === "exhausted") return jn(n(), _); { const y = n().results[_ - 1].tally; return Number(y[v]); } } function Tt(v, _) { - return Kt(v, _).toLocaleString("en-US"); + return jt(v, _).toLocaleString("en-US"); } - function Dt(v, _) { - return (Kt(v, _) / et).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function Ft(v, _) { + return (jt(v, _) / Q).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function ue(v) { + function ve(v) { const _ = n().results[v - 1].tally; let y = 0; - for (let [M, R] of Object.entries(_)) - y += Number(R); + for (let [P, N] of Object.entries(_)) + y += Number(N); return y; } function pe(v, _) { const y = n().results[_ - 1].tallyResults; - let M = 0; - const R = y.findIndex((k) => (k == null ? void 0 : k.elected) && v == k.elected); - if (R >= 0) { - const k = y[R].transfers; - if (k) - for (let [T, S] of Object.entries(k)) M += Number(S); + let P = 0; + const N = y.findIndex((S) => (S == null ? void 0 : S.elected) && v == S.elected); + if (N >= 0) { + const S = y[N].transfers; + if (S) + for (let [T, k] of Object.entries(S)) P += Number(k); } else return 0; - return M; + return P; } - function Ct(v) { + function it(v) { const _ = n().results; let y = _[Math.max(0, v - 2)].tally; - const M = [], R = []; - for (let [T, S] of Object.entries(y)) - M.push({ label: T, value: 0 }); + const P = [], N = []; + for (let [T, k] of Object.entries(y)) + P.push({ label: T, value: 0 }); y = _[v - 1].tally; - for (let T of M) { - const S = Number(y[T.label]), F = pe(T.label, v); - F > 0 ? (R.push({ - label: T.label + b, + for (let T of P) { + const k = Number(y[T.label]), F = pe(T.label, v); + F > 0 ? (N.push({ + label: T.label + m, value: F - }), T.value = S - F, R.push(T)) : (T.value = S, R.push(T)); + }), T.value = k - F, N.push(T)) : (T.value = k, N.push(T)); } - const k = Gn(n(), v); - return R.push({ label: "exhausted", value: k }), R; + const S = jn(n(), v); + return N.push({ label: "exhausted", value: S }), N; } - function gt() { - const v = it(g(V)).select("defs").select("#cross-hatch"); + function _e() { + const v = st(g(b)).select("defs").select("#cross-hatch"); let _ = 0; - for (let [y, M] of Object.entries(n().results[0].tally)) { - _ < 10 ? de[y] = Bf[_] : de[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), _++; + for (let [y, P] of Object.entries(n().results[0].tally)) { + !o() || o().length === 0 ? _ < 10 ? Qt[y] = zf[_] : Qt[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Qt[y] = o()[_ % o().length], _++; { - const R = v.clone(!0); - R.attr("id", y.replaceAll(" ", "-")).select("rect").attr("fill", de[y]), R.select("path").attr("stroke", "#505050"); + const N = v.clone(!0); + N.attr("id", y.replaceAll(" ", "-")).select("rect").attr("fill", Qt[y]), N.select("path").attr("stroke", "#505050"); } } - de.exhausted = w, de["Inactive Ballots"] = w; + Qt.exhausted = A, Qt["Inactive Ballots"] = A; } function fe() { - it(g(V)).select("#" + p).remove(); + st(g(b)).select("#" + w).remove(); } - function It(v, _) { - const y = En("global").duration(O); - _ && y.on("end", _), fe(), _e(v), ta(), na(0, st()), ri(); + function qt(v, _) { + const y = Cn("global").duration(D); + _ && y.on("end", _), fe(), ge(v), ea(), ra(0, at()), cn(); } - function Ft(v, _) { - const y = En("global").duration(O); - _ && y.on("end", _), on(v); + function Lt(v, _) { + const y = Cn("global").duration(D); + _ && y.on("end", _), un(v); } function x(v, _) { - const y = En("global").duration(O); - _ && y.on("end", _), an(v), ln(st()); + const y = Cn("global").duration(D); + _ && y.on("end", _), ln(v), on(at()); } function q() { - B = !1; + cn(), Y = !1; } - let B = !1; + let Y = !1; function nt() { - if (B) { - console.warn("buttons locked out"); + if (Y) { + console.warn("busy animating"); return; } - B = !0, I = r(), rt(); + Y = !0, I = r(), rt(); } function rt() { - J(z, 0); + j(B, 0); const v = I < n().results.length - 1 ? rt : q; - It(I, () => { - Ft(I, () => { - I++, L(I), x(I, v); + qt(I, () => { + Lt(I, () => { + I++, bt(I), x(I, v); }); }); } - Br(() => { - ut(); + Xr(() => { + ft(); }); - let W = 0; - function ut() { - console.log(`previous round was ${W}, currentRound is ${r()}`), W != r() && (W == r() - 1 && W > 0 ? Ve() : $t(r()), W = r()); + let K = 0; + function ft() { + if (console.log(`previous round was ${K}, currentRound is ${r()}`), Y) { + console.log("gotoNextRound: busy animating"); + return; + } + K != r() && (K == r() - 1 && K > 0 ? He() : $t(r()), K = r()); } function $t(v) { - if (console.log("setRoundFn called"), B) { - console.warn("buttons locked out"); + if (console.log("setRoundFn called"), Y) { + console.warn("busy animating"); return; } - console.log("past button lockout"), J(z, 0), _t(v); + j(B, 0), It(v); } - function Ve() { - if (console.log("animateOneRoundFn called"), B) { - console.warn("buttons locked out"); + function He() { + if (console.log("animateOneRoundFn called"), Y) { + console.warn("busy animating"); return; } if (r() <= 1) { console.warn(`animateOneRoundFn: can't anitmate to round ${r()}`); return; } - if (console.log("past button lockout"), I = r(), I >= n().results.length) { - B = !1; + if (I = r(), I > n().results.length) { + cn(), Y = !1; return; } - B = !0, g(z) === 0 ? It(I - 1, () => { - Ft(I - 1, () => { + Y = !0, g(B) === 0 ? qt(I - 1, () => { + Lt(I - 1, () => { x(I, q); }); - }) : g(z) === 1 ? Ft(I - 1, () => { + }) : g(B) === 1 ? Lt(I - 1, () => { x(I, q); - }) : g(z) === 2 && x(I, q), J(z, 0); + }) : g(B) === 2 && x(I, q), j(B, 0); } - function Ee() { - if (console.log(`animateOnePhaseFn called, currentRound = ${r()}, displayPhase = ${g(z)}`), r() >= n().results.length) { - ri(); + function Re() { + if (console.log(`animateOnePhaseFn called, currentRound = ${r()}, displayPhase = ${g(B)}`), r() > n().results.length) { + cn(), Y = !1; return; } - B = !0, J(z, (g(z) + 1) % 3), I = r(), g(z) === 1 ? It(I, q) : g(z) === 2 ? Ft(I, q) : g(z) === 0 ? (I++, L(I), x(I, q)) : (B = !1, console.warn("displayPhase out of range at ", g(z))); + Y || (Y = !0, j(B, (g(B) + 1) % 3), I = r(), g(B) === 1 ? qt(I, q) : g(B) === 2 ? Lt(I, q) : g(B) === 0 ? (I++, bt(I), x(I, q)) : (Y = !1, console.warn("displayPhase out of range at ", g(B)))); } - function an(v) { - j = Ct(v), P = ra(v, d, j, 0, st(), !0); + function ln(v) { + et = it(v), G = ia(v, p, et, 0, at(), !0); } - function ln(v, _) { - pr().sort(null).value((S) => S.value); - const y = it(g(V)).select("#" + p), M = Wt().outerRadius(v).innerRadius(v - 1), R = y.selectAll(".slice"); - let k = R.size(); + function on(v, _) { + gr().sort(null).value((k) => k.value); + const y = st(g(b)).select("#" + w), P = Jt().outerRadius(v).innerRadius(v - 1), N = y.selectAll(".slice"); + let S = N.size(); function T() { - k--, k === 0 && ea(); + S--, S === 0 && na(); } - R.select("path").transition("global").duration(A).attr("d", (S) => M(S)).on("end", (S) => T()); + N.select("path").transition("global").duration(R).attr("d", (k) => P(k)).on("end", (k) => T()); } - function _e(v) { - const _ = js(v, P); - K = ii(v, p, _, h, c, st(), Nt(), !1, !0); + function ge(v) { + const _ = Ws(v, G); + W = si(v, w, _, c, d, at(), Kt(), !1, !0); } - function on(v) { - const _ = Js(v, K, P); - K = si( + function un(v) { + const _ = Zs(v, W, G); + W = ai( v, - p, + w, _, /* previousDonutInfoGlobal, */ - st(), - Nt(), + at(), + Kt(), !1 ); } - function un(v) { + function fn(v) { const _ = v.data.label; - return de[_.split("#")[0]]; + return Qt[_.split("#")[0]]; } - function Ks(v) { + function js(v) { const _ = {}, y = n().results[v - 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 N = y[P].eliminated; + if (N === void 0 && (N = y[P].elected), N === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const k = y[M].transfers; - if (k === void 0) { + const S = y[P].transfers; + if (S === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [T, S] of Object.entries(k)) - _[T] === void 0 ? _[T] = Number(S) : _[T] += Number(S); + for (let [T, k] of Object.entries(S)) + _[T] === void 0 ? _[T] = Number(k) : _[T] += Number(k); } return _; } - function js(v, _) { - console.log(`makeDonutInfo: round = ${v}`); - const y = [], M = et, R = n().results[v - 1].tallyResults; - for (let k = 0; k < R.length; k++) { - let T = R[k].eliminated; - if (T === void 0 && (T = R[k].elected), T === void 0) { + function Ws(v, _) { + const y = [], P = Q, N = n().results[v - 1].tallyResults; + for (let S = 0; S < N.length; S++) { + let T = N[S].eliminated; + if (T === void 0 && (T = N[S].elected), T === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const S = R[k].transfers; - if (S === void 0) { + const k = N[S].transfers; + if (k === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let F = _.find((D) => D.data.label == T + b); - F === void 0 && (F = _.find((D) => D.data.label == T)); - let H = 0; - if (F) H = F.startAngle; + let F = _.find((O) => O.data.label == T + m); + F === void 0 && (F = _.find((O) => O.data.label == T)); + let V = 0; + if (F) V = F.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [D, Y] of Object.entries(S)) { - let Z; - const qt = _.find((tt) => tt.data.label == D); - if (qt) - Z = structuredClone(qt); - else if (D == "exhausted") - Z = { - data: { label: D, value: Number(Y) }, + for (let [O, H] of Object.entries(k)) { + let J; + const Vt = _.find((tt) => tt.data.label == O); + if (Vt) + J = structuredClone(Vt); + else if (O == "exhausted") + J = { + data: { label: O, value: Number(H) }, 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 = ", H); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", D); + console.warn("makeDonutInfo: unrecognized name in transfers ", O); continue; } - const E = Number(Y) / M * 2 * Math.PI; - Z.startAngle = H, H = Z.endAngle = H + E, Z.index = k, Z.data.label = `${Z.data.label}#${k}`, y.push(Z); + const E = Number(H) / P * 2 * Math.PI; + J.startAngle = V, V = J.endAngle = V + E, J.index = S, J.data.label = `${J.data.label}#${S}`, y.push(J); } } return y; } - function Ws(v, _, y) { - const M = {}; - for (let [R, k] of Object.entries(v)) { - const T = y.find((H) => R == H.data.label); + function Js(v, _, y) { + const P = {}; + for (let [N, S] of Object.entries(v)) { + const T = y.find((V) => N == V.data.label); if (T === void 0) { - console.warn("getTransferStartAngles: mainPieObj not found for ", R); + console.warn("getTransferStartAngles: mainPieObj not found for ", N); continue; } - const S = (T.startAngle + T.endAngle) / 2, F = v[T.data.label] / _ * 2 * Math.PI; - M[T.data.label] = S - F / 2; + const k = (T.startAngle + T.endAngle) / 2, F = v[T.data.label] / _ * 2 * Math.PI; + P[T.data.label] = k - F / 2; } - return M; - } - function Js(v, _, y) { - const M = [], R = et, k = Ks(v), T = Ws(k, R, y); - for (let [S, F] of _.entries()) { - const H = structuredClone(F), D = F.endAngle - F.startAngle, Y = y.find((Z) => F.data.label.indexOf(Z.data.label) === 0); - if (Y) { - const Z = Y.data.label; - H.startAngle = T[Z], T[Z] += D, H.endAngle = H.startAngle + D; + return P; + } + function Zs(v, _, y) { + const P = [], N = Q, S = js(v), T = Js(S, N, y); + for (let [k, F] of _.entries()) { + const V = structuredClone(F), O = F.endAngle - F.startAngle, H = y.find((J) => F.data.label.indexOf(J.data.label) === 0); + if (H) { + const J = H.data.label; + V.startAngle = T[J], T[J] += O, V.endAngle = V.startAngle + O; } else if (F.data.label.indexOf("exhausted") === 0) - H.startAngle = F.startAngle, H.endAngle = F.endAngle; + V.startAngle = F.startAngle, V.endAngle = F.endAngle; else { console.warn("updateDonutInfo: unrecognized slice name ", F.data.label); continue; } - H.index = S, M.push(H); + V.index = k, P.push(V); } - return M; - } - function ni(v, _, y, M, R, k) { - const S = it(g(V)).append("g").attr("id", m).attr("transform", `translate(${y}, ${M})`), F = Wt().innerRadius(R * $).outerRadius(R * $); - S.selectAll("text").data(_).enter().each(function(H) { - H.endAngle - H.startAngle < C || H.data.label.includes(b) || it(this).append("g").attr("id", (D) => D.data.label).classed("eliminated", (D) => k.includes(D.data.label.split("#")[0]) || D.data.label.includes(b)).each(function(D, Y) { - D.data.label === "exhausted" && it(this).on("mouseenter", (Z, qt) => ia(Z)).on("mouseleave", (Z, qt) => sa()); - }).append("text").attr("transform", (D) => `translate(${F.centroid(D)})`).attr("text-anchor", (D) => ir(D.startAngle, D.endAngle)).text((D) => D.data.label === "exhausted" ? kr : D.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((D) => Tt(D.data.label, v) + " (" + Dt(D.data.label, v) + ")"); + return P; + } + function ii(v, _, y, P, N, S) { + const k = st(g(b)).append("g").attr("id", $).attr("transform", `translate(${y}, ${P})`), F = Jt().innerRadius(N * C).outerRadius(N * C); + k.selectAll("text").data(_).enter().each(function(V) { + V.endAngle - V.startAngle < M || V.data.label.includes(m) || st(this).append("g").attr("id", (O) => O.data.label).classed("eliminated", (O) => S.includes(O.data.label.split("#")[0]) || O.data.label.includes(m)).each(function(O, H) { + O.data.label === "exhausted" && st(this).on("mouseenter", (J, Vt) => sa(J)).on("mouseleave", (J, Vt) => aa()); + }).append("text").attr("transform", (O) => `translate(${F.centroid(O)})`).attr("text-anchor", (O) => ar(O.startAngle, O.endAngle)).text((O) => O.data.label === "exhausted" ? Mr : O.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((O) => Tt(O.data.label, v) + " (" + Ft(O.data.label, v) + ")"); }); } - function Zs(v, _, y, M) { - const k = it(g(V)).select("#" + m), T = k.selectAll("tspan"), S = k.selectAll("g").data(_, (Y) => Y.data.label).classed("eliminated", (Y) => M.includes(Y.data.label.split("#")[0]) || Y.data.label.includes(b)), F = Wt().innerRadius(y * $).outerRadius(y * $ + 1); - T.transition("global").duration(A).attr("transform", (Y) => `translate(${F.centroid(Y)})`).attr("text-anchor", (Y) => ir(Y.startAngle, Y.endAngle)), S.select("text").transition("global").duration(A).attr("transform", (Y) => `translate(${F.centroid(Y)})`).attr("text-anchor", (Y) => ir(Y.startAngle, Y.endAngle)).on("end", (Y) => D()); - let H = S.size(); - function D(Y) { - H--, H === 0 && (k.remove(), ni(v, _, h, c, y, M)); + function Qs(v, _, y, P) { + const S = st(g(b)).select("#" + $), T = S.selectAll("tspan"), k = S.selectAll("g").data(_, (H) => H.data.label).classed("eliminated", (H) => P.includes(H.data.label.split("#")[0]) || H.data.label.includes(m)), F = Jt().innerRadius(y * C).outerRadius(y * C + 1); + T.transition("global").duration(R).attr("transform", (H) => `translate(${F.centroid(H)})`).attr("text-anchor", (H) => ar(H.startAngle, H.endAngle)), k.select("text").transition("global").duration(R).attr("transform", (H) => `translate(${F.centroid(H)})`).attr("text-anchor", (H) => ar(H.startAngle, H.endAngle)).on("end", (H) => O()); + let V = k.size(); + function O(H) { + V--, V === 0 && (S.remove(), ii(v, _, c, d, y, P)); } } - function Qs(v, _, y, M, R, k, T, S = !0, F = !1) { - const D = pr().sort(null).value((Y) => Y.value)(y); - return ii(v, _, D, M, R, k, T, S, F), D; + function ta(v, _, y, P, N, S, T, k = !0, F = !1) { + const O = gr().sort(null).value((H) => H.value)(y); + return si(v, _, O, P, N, S, T, k, F), O; } - function ri() { - it(g(V)).select("#" + d).selectAll(".elected").style("stroke", "darkblue").style("stroke-width", "2px"); + function cn() { + st(g(b)).select("#" + p).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); } - function ii(v, _, y, M, R, k, T, S, F) { - const H = Kn(n(), v), D = jn(n(), v), qt = it(g(V)).attr("width", "100%").attr("height", f).attr("viewBox", `0 0 ${o} ${f}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", _).attr("transform", `translate(${M}, ${R})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (E) => H.includes(E.data.label.split("#")[0]) || E.data.label.includes(b)).classed("elected", (E) => D.includes(E.data.label.split("#")[0]) && !E.data.label.includes(b)).attr("id", (E) => E.data.label).on("mouseenter", (E, tt) => ar(E, tt)).on("mouseleave", (E, tt) => lr(E, tt)), He = Wt().outerRadius(T).innerRadius(k); + function si(v, _, y, P, N, S, T, k, F) { + const V = Wn(n(), v), O = Jn(n(), v), Vt = st(g(b)).attr("width", "100%").attr("height", u).attr("viewBox", `0 0 ${f} ${u}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", _).attr("transform", `translate(${P}, ${N})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (E) => V.includes(E.data.label.split("#")[0]) || E.data.label.includes(m)).classed("elected", (E) => O.includes(E.data.label.split("#")[0]) && !E.data.label.includes(m)).attr("id", (E) => E.data.label).on("mouseenter", (E, tt) => or(E, tt)).on("mouseleave", (E, tt) => ur(E, tt)), Ye = Jt().outerRadius(T).innerRadius(S); if (F) { - const E = Wt().outerRadius(k + 1).innerRadius(k); - qt.append("path").attr("d", E).transition("global").duration(A).attr("d", (tt) => He(tt)).attr("fill", (tt) => un(tt)).on("end", (tt) => sr()); + const E = Jt().outerRadius(S + 1).innerRadius(S); + Vt.append("path").attr("d", E).transition("global").duration(R).attr("d", (tt) => Ye(tt)).attr("fill", (tt) => fn(tt)).on("end", (tt) => lr()); } else - qt.append("path").attr("d", (E) => He(E)).attr("fill", (E) => un(E)), sr(); - return S && ni(v, y, M, R, T, H), y; + Vt.append("path").attr("d", (E) => Ye(E)).attr("fill", (E) => fn(E)), lr(); + return k && ii(v, y, P, N, T, V), y; } - function ta() { - const y = it(g(V)).select("#" + m).selectAll(".eliminated"); + function ea() { + const y = st(g(b)).select("#" + $).selectAll(".eliminated"); y.size() > 0 && y.classed("finished", !0); } - function ea() { - const y = it(g(V)).select("#" + m).selectAll(".finished"); + function na() { + const y = st(g(b)).select("#" + $).selectAll(".finished"); y.size() > 0 && y.remove(); } - function na(v, _) { - const R = it(g(V)).select("#" + d).selectAll(".eliminated"), k = Wt().innerRadius(v), T = Wt().outerRadius(_); - R.classed("finished", !0).select("path").transition("global").duration(A).attrTween("d", function(S) { + function ra(v, _) { + const N = st(g(b)).select("#" + p).selectAll(".eliminated"), S = Jt().innerRadius(v), T = Jt().outerRadius(_); + N.classed("finished", !0).select("path").transition("global").duration(R).attrTween("d", function(k) { const F = Te(_, v); - return function(H) { - return T.innerRadius(F(H)), T(S); + return function(V) { + return T.innerRadius(F(V)), T(k); }; - }).attr("fill", (S) => `url(#${S.data.label.split("#")[0].replaceAll(" ", "-")})`), R.clone(!0).classed("finished", !0).select("path").transition("global").duration(A).attrTween("d", function(S) { + }).attr("fill", (k) => `url(#${k.data.label.split("#")[0].replaceAll(" ", "-")})`), N.clone(!0).classed("finished", !0).select("path").transition("global").duration(R).attrTween("d", function(k) { const F = Te(_, v); - return function(H) { - return k.outerRadius(F(H)), k(S); + return function(V) { + return S.outerRadius(F(V)), S(k); }; - }).attr("fill", (S) => un(S)); + }).attr("fill", (k) => fn(k)); } - function ir(v, _) { + function ar(v, _) { const y = (v + _) / 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 sr() { - it(g(V)).select("#" + m).raise().append("g").remove(); + function lr() { + st(g(b)).select("#" + $).raise().append("g").remove(); } - function ra(v, _, y, M, R, k) { - const S = pr().sort(null).value((F) => F.value)(y); - return si( + function ia(v, _, y, P, N, S) { + const k = gr().sort(null).value((F) => F.value)(y); + return ai( v, _, - S, + k, /* previousPieInfo, */ - M, - R, - k - ), S; - } - function si(v, _, y, M, R, k) { - const T = Kn(n(), v), S = jn(n(), v), F = Wt().outerRadius(R).innerRadius(M).startAngle((E) => E.startAngle).endAngle((E) => E.endAngle), H = Wt().outerRadius(R).innerRadius(M), Y = it(g(V)).select("#" + _); - Y.selectAll(".slice").attr("prevStart", (E) => E.startAngle).attr("prevEnd", (E) => E.endAngle); - const Z = Y.selectAll(".slice").data(y, (E) => E.data.label); - Z.enter().append("g").attr("class", "slice").attr("id", (E) => E.data.label).classed("eliminated", !0).on("mouseenter", (E, tt) => ar(E, tt)).on("mouseleave", (E, tt) => lr(E, tt)).append("path").attr("d", (E) => H(E)).attr("fill", (E) => un(E)), Z.classed("eliminated", (E) => T.includes(E.data.label.split("#")[0])).classed("elected", (E) => S.includes(E.data.label.split("#")[0])).on("mouseenter", (E, tt) => ar(E, tt)).on("mouseleave", (E, tt) => lr(E, tt)); - let qt = Z.size(); - function He() { - qt--, qt <= 0 && (sr(), Y.selectAll(".finished").remove()); + P, + N, + S + ), k; + } + function ai(v, _, y, P, N, S) { + const T = Wn(n(), v), k = Jn(n(), v), F = Jt().outerRadius(N).innerRadius(P).startAngle((E) => E.startAngle).endAngle((E) => E.endAngle), V = Jt().outerRadius(N).innerRadius(P), H = st(g(b)).select("#" + _); + H.selectAll(".slice").attr("prevStart", (E) => E.startAngle).attr("prevEnd", (E) => E.endAngle); + const J = H.selectAll(".slice").data(y, (E) => E.data.label); + J.enter().append("g").attr("class", "slice").attr("id", (E) => E.data.label).classed("eliminated", !0).on("mouseenter", (E, tt) => or(E, tt)).on("mouseleave", (E, tt) => ur(E, tt)).append("path").attr("d", (E) => V(E)).attr("fill", (E) => fn(E)), J.classed("eliminated", (E) => T.includes(E.data.label.split("#")[0])).classed("elected", (E) => k.includes(E.data.label.split("#")[0])).on("mouseenter", (E, tt) => or(E, tt)).on("mouseleave", (E, tt) => ur(E, tt)); + let Vt = J.size(); + function Ye() { + Vt--, Vt <= 0 && (lr(), H.selectAll(".finished").remove()); } - return Z.select("path").transition("global").duration(A).attrTween("d", function(E) { - const tt = Number(it(this.parentNode).attr("prevStart")), aa = Number(it(this.parentNode).attr("prevEnd")), la = Te(tt, E.startAngle), oa = Te(aa, E.endAngle); - return (li) => (F.startAngle(la(li)).endAngle(oa(li)), F(E)); - }).on("end", He), k && Zs(v, y, R, T), y; + return J.select("path").transition("global").duration(R).attrTween("d", function(E) { + const tt = Number(st(this.parentNode).attr("prevStart")), la = Number(st(this.parentNode).attr("prevEnd")), oa = Te(tt, E.startAngle), ua = Te(la, E.endAngle); + return (oi) => (F.startAngle(oa(oi)).endAngle(ua(oi)), F(E)); + }).on("end", Ye), S && Qs(v, y, N, T), y; } - function ar(v, _) { + function or(v, _) { s(_.data.label.split("#")[0]), i("enter"), a(v.clientY); } - function lr(v, _) { + function ur(v, _) { s(_.data.label.split("#")[0]), i("leave"); } - function ia(v, _) { + function sa(v, _) { i("show-exhausted"), a(v.clientY); } - function sa(v, _) { + function aa(v, _) { i("hide-exhausted"); } - var ai = nc(); - return wn(ai, (v) => J(V, v), () => g(V)), ce(t, ai), Kr({ + var li = rc(); + return bn(li, (v) => j(b, v), () => g(b)), ce(t, li), Wr({ runFullAnimationFn: nt, - animateOnePhaseFn: Ee, + animateOnePhaseFn: Re, get jsonData() { return n(); }, set jsonData(v) { - n(v), Ht(); + n(v), Rt(); }, get currentRound() { return r(); }, set currentRound(v = 1) { - r(v), Ht(); + r(v), Rt(); }, get mouseEventType() { return i(); }, set mouseEventType(v) { - i(v), Ht(); + i(v), Rt(); }, get mouseData() { return s(); }, set mouseData(v) { - s(v), Ht(); + s(v), Rt(); }, get mouseY() { return a(); }, set mouseY(v) { - a(v), Ht(); + a(v), Rt(); }, get requestRoundChange() { return l(); }, set requestRoundChange(v = (_) => { }) { - l(v), Ht(); + l(v), Rt(); + }, + get candidateColors() { + return o(); + }, + set candidateColors(v = []) { + o(v), Rt(); } }); } -ms( - Gs, +ys( + Ks, { jsonData: {}, currentRound: {}, mouseEventType: {}, mouseData: {}, mouseY: {}, - requestRoundChange: {} + requestRoundChange: {}, + candidateColors: {} }, [], ["runFullAnimationFn", "animateOnePhaseFn"], !0 ); -function ic(t) { +function sc(t) { const e = []; if (!t || typeof t != "object") return { valid: !1, errors: ["Input is not a valid object"] }; @@ -4238,8 +4248,8 @@ function ic(t) { errors: e }; } -var sc = /* @__PURE__ */ qe("  ", 1), ac = /* @__PURE__ */ qe("About to eliminate: ", 1), lc = /* @__PURE__ */ qe("  ", 1), oc = /* @__PURE__ */ qe("Elected: ", 1), uc = /* @__PURE__ */ qe("
", 1), fc = /* @__PURE__ */ qe('


these ballots have already been eliminated.
', 1); -const cc = { +var ac = /* @__PURE__ */ Le("  ", 1), lc = /* @__PURE__ */ Le("About to eliminate: ", 1), oc = /* @__PURE__ */ Le("  ", 1), uc = /* @__PURE__ */ Le("Elected: ", 1), fc = /* @__PURE__ */ Le("
", 1), cc = /* @__PURE__ */ Le('


these ballots have already been eliminated.
', 1); +const hc = { hash: "svelte-hac7qn", code: `.page-container.svelte-hac7qn {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-hac7qn {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-hac7qn {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:1.3rem;left:50%;transform:translate(-50%);font-weight:bold;opacity:0;}.tooltip.svelte-hac7qn h3:where(.svelte-hac7qn) {text-align:center;}.animation-button-container.svelte-hac7qn {display:flex;justify-content:center;gap:10px;margin-bottom:1rem;}.pie-chart-container.svelte-hac7qn { /* width: 65%; */width:90%;min-width:800px; /* Larger minimum size */flex-grow:0; /* Don't grow beyond specified width */margin:0 auto;margin-right:40px; /* Add extra space on right */}.visualizations-container.svelte-hac7qn {display:flex;justify-content:space-between;width:100%;padding:0 20px;gap:80px;} @@ -4274,196 +4284,206 @@ const cc = { @media (max-width: 1300px) {.visualizations-container.svelte-hac7qn {flex-direction:column;align-items:center;} }` }; -function hc(t, e) { - Gr(e, !0), _s(t, cc); +function dc(t, e) { + jr(e, !0), gs(t, hc); const n = 0.85; - let r = Qt(e, "electionSummary", 7), i = Qt(e, "currentRound", 7), s = Qt(e, "requestRoundChange", 7, (x) => { - }), a = Jt(null), l = Jt(null), o = Jt(""), f = Jt(xt([])), u = Jt(""), h = Jt(""), c = Jt(0), d = /* @__PURE__ */ Jn(() => p(r())); - function p(x) { + let r = kt(e, "electionSummary", 7), i = kt(e, "currentRound", 7), s = kt(e, "requestRoundChange", 7, (x) => { + }), a = kt(e, "candidateColors", 23, () => []), l = Zt(null), o = Zt(null), f = Zt(""), u = Zt(wt([])), h = Zt(""), c = Zt(""), d = Zt(0), p = /* @__PURE__ */ Qn(() => w(r())); + function w(x) { if (typeof x == "string") try { x = JSON.parse(x); } catch (q) { return console.error("Failed to parse JSON string:", q), {}; } - return console.log("RCtabSummary object status: ", ic(x)), x || {}; + return console.log("RCtabSummary object status: ", sc(x)), x || {}; } - function m(x) { + function $(x) { s() ? (console.log("onRoundChange in PieChart: passing on request for round ", x), s()(x)) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function b() { - switch (g(u)) { + function m() { + switch (g(h)) { case "enter": - ((x) => (J(f, xt(x[0])), J(o, xt(x[1]))))($(g(h), i())), g(a) && (g(a).style.top = String(g(c) || 20) + "px", g(a).style.opacity = String(n)); + ((x) => (j(u, wt(x[0])), j(f, wt(x[1]))))(C(g(c), i())), g(l) && (g(l).style.top = String(g(d) || 20) + "px", g(l).style.opacity = String(n)); break; case "leave": - g(a) && (g(a).style.opacity = "0"), J(f, xt([])), J(o, ""); + g(l) && (g(l).style.opacity = "0"), j(u, wt([])), j(f, ""); break; case "show-exhausted": - g(l) && (g(l).style.top = String(g(c) || 20) + "px", g(l).style.opacity = String(n)); + g(o) && (g(o).style.top = String(g(d) || 20) + "px", g(o).style.opacity = String(n)); break; case "hide-exhausted": - g(l) && (g(l).style.opacity = "0"); + g(o) && (g(o).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", g(u)); + console.log("Unknown mouse event: ", g(h)); break; } } - Br(() => b()); - function w(x, q) { + Xr(() => m()); + function A(x, q) { return x == 1 ? q ? "vote was" : "vote will be" : q ? "votes were" : "votes will be"; } - function $(x, q) { - const B = [], nt = x === "exhausted" ? kr : x; + function C(x, q) { + const Y = [], nt = x === "exhausted" ? Mr : x; let rt; - x == "exhausted" ? rt = Gn(g(d), 1) : rt = g(d).results[0].tally[x], B.push(`${nt} started with ${rt} votes.`); - for (let W = 1; W <= q; W++) { - W === q && (x == "exhausted" ? rt = Gn(g(d), q) : rt = g(d).results[q - 1].tally[x], B.push(`${nt} has ${rt} votes at round ${q}.`)); - const ut = g(d).results[W - 1].tallyResults; - for (let $t = 0; $t < ut.length; $t++) { - const Ve = ut[$t].transfers, Ee = ut[$t].eliminated, an = ut[$t].elected; - if (Ee) - Ee === x && B.push(`${nt} will be eliminated on round ${W}.`); - else if (x === an && (B.push(`${nt} was elected on round ${W}.`), Ve)) - for (let [_e, on] of Object.entries(Ve)) - B.push(`${on} ${w(Number(on), W < q)} transferred to ${_e} on round ${W}.`); - const ln = Ee || an; - if (ln) { - const _e = Number(Ve[x]); - _e && B.push(`${_e} ${w(_e, W < q)} transferred from ${ln} on round ${W}.`); + x == "exhausted" ? rt = jn(g(p), 1) : rt = g(p).results[0].tally[x], Y.push(`${nt} started with ${rt} votes.`); + for (let K = 1; K <= q; K++) { + K === q && (x == "exhausted" ? rt = jn(g(p), q) : rt = g(p).results[q - 1].tally[x], Y.push(`${nt} has ${rt} votes at round ${q}.`)); + const ft = g(p).results[K - 1].tallyResults; + for (let $t = 0; $t < ft.length; $t++) { + const He = ft[$t].transfers, Re = ft[$t].eliminated, ln = ft[$t].elected; + if (Re) + Re === x && Y.push(`${nt} will be eliminated on round ${K}.`); + else if (x === ln && (Y.push(`${nt} was elected on round ${K}.`), He)) + for (let [ge, un] of Object.entries(He)) + Y.push(`${un} ${A(Number(un), K < q)} transferred to ${ge} on round ${K}.`); + const on = Re || ln; + if (on) { + const ge = Number(He[x]); + ge && Y.push(`${ge} ${A(ge, K < q)} transferred from ${on} on round ${K}.`); } } } - return [B, nt]; + return [Y, nt]; } - function C() { + function M() { let x = 0; - for (let q = 1; q <= g(d).results.length; q++) { - const B = g(d).results[q - 1].tallyResults; - for (let nt = 0; nt < B.length; nt++) - B[nt].elected && x++; + for (let q = 1; q <= g(p).results.length; q++) { + const Y = g(p).results[q - 1].tallyResults; + for (let nt = 0; nt < Y.length; nt++) + Y[nt].elected && x++; } return x; } - let A; - function O() { - A && A.animateOnePhaseFn && A.animateOnePhaseFn(); + let R; + function D() { + R && R.animateOnePhaseFn && R.animateOnePhaseFn(); } - function P() { - A && A.runFullAnimationFn && A.runFullAnimationFn(); + function G() { + R && R.runFullAnimationFn && R.runFullAnimationFn(); } - var K = fc(), j = Re(K), et = yt(j); - et.__click = P; - var z = Lt(et, 2); - z.__click = O, mt(j); - var I = Lt(j, 2), V = yt(I), N = yt(V), L = yt(N); - mt(N); - var _t = Lt(N, 2), Gt = yt(_t); + var W = cc(), et = Ce(W), Q = mt(et); + Q.__click = G; + var B = Ht(Q, 2); + B.__click = D, gt(et); + var I = Ht(et, 2), b = mt(I), L = mt(b), bt = mt(L); + gt(L); + var It = Ht(L, 2), Nt = mt(It); { - var st = (x) => { - var q = ac(), B = Lt(Re(q)); - cr(B, 17, () => Kn(g(d), i()), fr, (nt, rt) => { - var W = sc(), ut = Re(W), $t = yt(ut, !0); - mt(ut), fn(), cn(() => { - mi(ut, "color", de[g(rt)]), Ye($t, g(rt)); - }), ce(nt, W); + var at = (x) => { + var q = lc(), Y = Ht(Ce(q)); + dr(Y, 17, () => Wn(g(p), i()), hr, (nt, rt) => { + var K = ac(), ft = Ce(K), $t = mt(ft, !0); + gt(ft), hn(), dn(() => { + yi(ft, "color", Qt[g(rt)]), Be($t, g(rt)); + }), ce(nt, K); }), ce(x, q); }; - _i(Gt, (x) => { - Kn(g(d), i()).length > 0 && x(st); + gi(Nt, (x) => { + Wn(g(p), i()).length > 0 && x(at); }); } - var Nt = Lt(Gt, 2); + var Kt = Ht(Nt, 2); { - var Kt = (x) => { - var q = oc(), B = Lt(Re(q)); - cr(B, 17, () => jn(g(d), i()), fr, (nt, rt) => { - var W = lc(), ut = Re(W), $t = yt(ut, !0); - mt(ut), fn(), cn(() => { - mi(ut, "color", de[g(rt)]), Ye($t, g(rt)); - }), ce(nt, W); + var jt = (x) => { + var q = uc(), Y = Ht(Ce(q)); + dr(Y, 17, () => Jn(g(p), i()), hr, (nt, rt) => { + var K = oc(), ft = Ce(K), $t = mt(ft, !0); + gt(ft), hn(), dn(() => { + yi(ft, "color", Qt[g(rt)]), Be($t, g(rt)); + }), ce(nt, K); }), ce(x, q); }; - _i(Nt, (x) => { - jn(g(d), i()).length > 0 && x(Kt); + gi(Kt, (x) => { + Jn(g(p), i()).length > 0 && x(jt); }); } - mt(_t), mt(V); - var Tt = Lt(V, 2), Dt = yt(Tt), ue = yt(Dt, !0); - mt(Dt); - var pe = Lt(Dt, 2); - cr(pe, 17, () => g(f), fr, (x, q) => { - var B = uc(), nt = Re(B), rt = yt(nt, !0); - mt(nt), fn(2), cn(() => Ye(rt, g(q))), ce(x, B); - }), mt(Tt), wn(Tt, (x) => J(a, x), () => g(a)); - var Ct = Lt(Tt, 2), gt = yt(Ct); - gt.nodeValue = `"${kr}" means all the candidates ranked on `, fn(2), mt(Ct), wn(Ct, (x) => J(l, x), () => g(l)); - var fe = Lt(Ct, 2), It = yt(fe), Ft = yt(It); - return wn( - Gs(Ft, { + gt(It), gt(b); + var Tt = Ht(b, 2), Ft = mt(Tt), ve = mt(Ft, !0); + gt(Ft); + var pe = Ht(Ft, 2); + dr(pe, 17, () => g(u), hr, (x, q) => { + var Y = fc(), nt = Ce(Y), rt = mt(nt, !0); + gt(nt), hn(2), dn(() => Be(rt, g(q))), ce(x, Y); + }), gt(Tt), bn(Tt, (x) => j(l, x), () => g(l)); + var it = Ht(Tt, 2), _e = mt(it); + _e.nodeValue = `"${Mr}" means all the candidates ranked on `, hn(2), gt(it), bn(it, (x) => j(o, x), () => g(o)); + var fe = Ht(it, 2), qt = mt(fe), Lt = mt(qt); + return bn( + Ks(Lt, { get jsonData() { - return g(d); + return g(p); }, get currentRound() { return i(); }, - requestRoundChange: m, + requestRoundChange: $, + get candidateColors() { + return a(); + }, get mouseEventType() { - return g(u); + return g(h); }, set mouseEventType(x) { - J(u, xt(x)); + j(h, wt(x)); }, get mouseData() { - return g(h); + return g(c); }, set mouseData(x) { - J(h, xt(x)); + j(c, wt(x)); }, get mouseY() { - return g(c); + return g(d); }, set mouseY(x) { - J(c, xt(x)); + j(d, wt(x)); } }), - (x) => A = x, - () => A - ), mt(It), mt(fe), mt(I), cn( + (x) => R = x, + () => R + ), gt(qt), gt(fe), gt(I), dn( (x) => { - Ye(L, `${g(d).config.contest ?? ""}, ${x ?? ""} to be elected, Round ${i() ?? ""}.`), Ye(ue, g(o)); + Be(bt, `${g(p).config.contest ?? ""}, ${x ?? ""} to be elected, Round ${i() ?? ""}.`), Be(ve, g(f)); }, - [C] - ), ce(t, K), Kr({ + [M] + ), ce(t, W), Wr({ get electionSummary() { return r(); }, set electionSummary(x) { - r(x), Ht(); + r(x), Rt(); }, get currentRound() { return i(); }, set currentRound(x) { - i(x), Ht(); + i(x), Rt(); }, get requestRoundChange() { return s(); }, set requestRoundChange(x = (q) => { }) { - s(x), Ht(); + s(x), Rt(); + }, + get candidateColors() { + return a(); + }, + set candidateColors(x = []) { + a(x), Rt(); } }); } -al(["click"]); -customElements.define("pie-chart", ms( - hc, +ll(["click"]); +customElements.define("pie-chart", ys( + dc, { electionSummary: {}, currentRound: {}, - requestRoundChange: {} + requestRoundChange: {}, + candidateColors: {} }, [], [], diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index cf957520..3d2c48ae 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -9,10 +9,20 @@ const electionSummary = JSON.parse(document.getElementById("rawDataId").textContent); + const candidateColors = + ["#e6194b","#3cb44b","#ffe119","#4363d8","#f58231","#911eb4","#46f0f0","#f032e6","#bcf60c","#fabebe", + "#008080","#e6beff","#9a6324","#fffac8","#800000","#aaffc3","#808000","#ffd8b1","#000075","#808080", + "#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"]; + // Create the pie-chart element const pieChart = document.createElement("pie-chart"); - pieChart.setAttribute("electionSummary", JSON.stringify(electionSummary)); + + // Functions *must* be added as properties; anything added as an attribute must be a string. + // So we don't have to re-stringify the JSON object, which will be immediately parsed again, + // we can just bind it in object form here. pieChart.requestRoundChange = updateRound; + pieChart.electionSummary = electionSummary; + pieChart.candidateColors = candidateColors; // Append it to the div document.getElementById("pie-body").appendChild(pieChart); @@ -25,19 +35,28 @@ sliderValueChanged: updatePieChartRound, timelineData: generateTimelineData(humanFriendlyEventsPerRound), timelinePeeking: !config.doUseDescriptionInsteadOfTimeline, - timeBetweenStepsMs: 3000 + timeBetweenStepsMs: 3000, + animateOnLoad: false, }); - function updatePieChartRound(roundNum) { - pieChart.setAttribute("currentRound", roundNum+1); + function updatePieChartRound(sliderIndex) { + pieChart.currentRound = sliderIndex+1; } // When the pie chart is animating it knows it is advancing rounds, but to avoid reactive // loops it requests to be told the new currentRound rather than using 2-way binding. // And we also update the slider state while we're at it. function updateRound(roundNum) { - pieChart.setAttribute("currentRound", roundNum); - document.getElementById('pie-slider-container').setAttribute('value', roundNum-1); + + pieChart.currentRound = roundNum; + + // Having trouble making the slider update when the pie chart is animating. + //document.getElementById('pie-slider-container').setAttribute('value', roundNum-1); + //document.getElementById('pie-slider-container').value = roundNum-1; + //document.getElementById('pie-slider-container').setSliderValue('slide', roundNum-1); + //trs_setSliderValue('pie-slider-container', roundNum-1); + //trs_moveSliderTo('pie-slider-container', roundNum - 1); + } From 501dd53d19ea8a0e1a674e60ebb4e03619d6aea4 Mon Sep 17 00:00:00 2001 From: skaphan Date: Mon, 17 Mar 2025 17:06:05 -0700 Subject: [PATCH 13/18] I couldn't take that color palette Bruce recommended. Switching to something Claude cobbled together (the first 10 of which happen to be the d3 schemeCategory10 colors I was using before... --- 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 3d2c48ae..348bbf78 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -9,11 +9,18 @@ const electionSummary = JSON.parse(document.getElementById("rawDataId").textContent); - const candidateColors = - ["#e6194b","#3cb44b","#ffe119","#4363d8","#f58231","#911eb4","#46f0f0","#f032e6","#bcf60c","#fabebe", + const candidateColorsButtUgly = [ + "#e6194b","#3cb44b","#ffe119","#4363d8","#f58231","#911eb4","#46f0f0","#f032e6","#bcf60c","#fabebe", "#008080","#e6beff","#9a6324","#fffac8","#800000","#aaffc3","#808000","#ffd8b1","#000075","#808080", "#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"]; + 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" + ]; + // Create the pie-chart element const pieChart = document.createElement("pie-chart"); From a6ee025d214496c93a2a2e00b86b5e602f8e06b6 Mon Sep 17 00:00:00 2001 From: skaphan Date: Mon, 17 Mar 2025 21:34:04 -0700 Subject: [PATCH 14/18] found the right method to notify slider of change of round. --- templates/pie/pie-nonblocking.html | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 348bbf78..1204cb6c 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -54,16 +54,8 @@ // loops it requests to be told the new currentRound rather than using 2-way binding. // And we also update the slider state while we're at it. function updateRound(roundNum) { - pieChart.currentRound = roundNum; - - // Having trouble making the slider update when the pie chart is animating. - //document.getElementById('pie-slider-container').setAttribute('value', roundNum-1); - //document.getElementById('pie-slider-container').value = roundNum-1; - //document.getElementById('pie-slider-container').setSliderValue('slide', roundNum-1); - //trs_setSliderValue('pie-slider-container', roundNum-1); - //trs_moveSliderTo('pie-slider-container', roundNum - 1); - + trs_moveSliderTo('pie-slider-container', roundNum - 1); } From d29c4206dd71a3b92b2b009951e95a94371435d0 Mon Sep 17 00:00:00 2001 From: skaphan Date: Tue, 18 Mar 2025 20:06:48 -0700 Subject: [PATCH 15/18] several appearance related improvements, making it serviceable on mobile. --- static/pie/pie-chart.es.js | 3160 +++++++++++++++++++----------------- 1 file changed, 1630 insertions(+), 1530 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index f8204e37..46c1d6bf 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -3,32 +3,32 @@ var ui = (t) => { throw TypeError(t); }; var ca = (t, e, n) => e in t ? fa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var St = (t, e, n) => ca(t, typeof e != "symbol" ? e + "" : e, n), fi = (t, e, n) => e.has(t) || ui("Cannot " + n); -var ct = (t, e, n) => (fi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), fr = (t, e, n) => e.has(t) ? ui("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), cr = (t, e, n, r) => (fi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); +var kt = (t, e, n) => ca(t, typeof e != "symbol" ? e + "" : e, n), fi = (t, e, n) => e.has(t) || ui("Cannot " + n); +var ct = (t, e, n) => (fi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), cr = (t, e, n) => e.has(t) ? ui("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), hr = (t, e, n, r) => (fi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); const ha = "5"; typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ha); -const da = 1, va = 2, pa = 16, _a = 1, ga = 4, ma = 8, ya = 16, wa = 2, qi = "[", Pr = "[!", Or = "]", Ke = {}, ht = Symbol(), ci = !1, Ot = 2, Li = 4, Dr = 8, Ir = 16, le = 32, Ie = 64, Tn = 128, Ct = 256, Sn = 512, _t = 1024, oe = 2048, Fe = 4096, re = 8192, Zn = 16384, xa = 32768, Fr = 65536, ba = 1 << 19, Vi = 1 << 20, je = Symbol("$state"), Hi = Symbol("legacy props"); -var qr = Array.isArray, $a = Array.prototype.indexOf, Lr = Array.from, kn = Object.keys, Mn = Object.defineProperty, xe = Object.getOwnPropertyDescriptor, Aa = Object.prototype, Ea = Array.prototype, Ra = Object.getPrototypeOf; -function Yi(t) { +const da = 1, va = 2, pa = 16, ga = 1, _a = 4, ma = 8, ya = 16, wa = 2, Li = "[", Or = "[!", Pr = "]", We = {}, ht = Symbol(), ci = !1, Dt = 2, qi = 4, Dr = 8, Fr = 16, ue = 32, qe = 64, On = 128, Tt = 256, Pn = 512, gt = 1024, fe = 2048, Ve = 4096, se = 8192, Qn = 16384, xa = 32768, Ir = 65536, ba = 1 << 19, Vi = 1 << 20, Je = Symbol("$state"), Bi = Symbol("legacy props"); +var Lr = Array.isArray, $a = Array.prototype.indexOf, qr = Array.from, Dn = Object.keys, Fn = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, Aa = Object.prototype, Ra = Array.prototype, Ea = Object.getPrototypeOf; +function Hi(t) { for (var e = 0; e < t.length; e++) t[e](); } -let Je = [], mr = []; -function Bi() { - var t = Je; - Je = [], Yi(t); +let Qe = [], yr = []; +function Yi() { + var t = Qe; + Qe = [], Hi(t); } function Ca() { - var t = mr; - mr = [], Yi(t); + var t = yr; + yr = [], Hi(t); } function zi(t) { - Je.length === 0 && queueMicrotask(Bi), Je.push(t); + Qe.length === 0 && queueMicrotask(Yi), Qe.push(t); } function hi() { - Je.length > 0 && Bi(), mr.length > 0 && Ca(); + Qe.length > 0 && Yi(), yr.length > 0 && Ca(); } -function Xi(t) { +function Ui(t) { return t === this.v; } function Na(t, e) { @@ -49,83 +49,83 @@ function ka(t) { function Ma() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Pa() { +function Oa() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function Oa(t) { +function Pa(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } function Da() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Ia() { +function Fa() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function Fa() { +function Ia() { throw new Error("https://svelte.dev/e/state_unsafe_local_read"); } -function qa() { +function La() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -let La = !1; -function Et(t, e) { +let qa = !1; +function Ct(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors v: t, reactions: null, - equals: Xi, + equals: Ui, rv: 0, wv: 0 }; return n; } -function Zt(t) { - return /* @__PURE__ */ Va(Et(t)); +function ee(t) { + return /* @__PURE__ */ Va(Ct(t)); } // @__NO_SIDE_EFFECTS__ -function Hr(t, e = !1) { - const n = Et(t); +function Br(t, e = !1) { + const n = Ct(t); return e || (n.equals = Vr), n; } // @__NO_SIDE_EFFECTS__ function Va(t) { - return X !== null && !Mt && X.f & Ot && (zt === null ? za([t]) : zt.push(t)), t; + return j !== null && !Ot && j.f & Dt && (Ut === null ? za([t]) : Ut.push(t)), t; } -function j(t, e) { - return X !== null && !Mt && cs() && X.f & (Ot | Ir) && // If the source was created locally within the current derived, then +function W(t, e) { + return j !== null && !Ot && cs() && j.f & (Dt | Fr) && // If the source was created locally within the current derived, then // we allow the mutation. - (zt === null || !zt.includes(t)) && qa(), Ui(t, e); + (Ut === null || !Ut.includes(t)) && La(), ji(t, e); } -function Ui(t, e) { - return t.equals(e) || (t.v, t.v = e, t.wv = es(), Gi(t, oe), U !== null && U.f & _t && !(U.f & (le | Ie)) && (te === null ? Xa([t]) : te.push(t))), e; +function ji(t, e) { + return t.equals(e) || (t.v, t.v = e, t.wv = es(), Xi(t, fe), X !== null && X.f & gt && !(X.f & (ue | qe)) && (ne === null ? Ua([t]) : ne.push(t))), e; } -function Gi(t, e) { +function Xi(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; - a & oe || (ie(s, e), a & (_t | Ct) && (a & Ot ? Gi( + a & fe || (ae(s, e), a & (gt | Tt) && (a & Dt ? Xi( /** @type {Derived} */ s, - Fe - ) : nr( + Ve + ) : rr( /** @type {Effect} */ s ))); } } // @__NO_SIDE_EFFECTS__ -function Qn(t) { - var e = Ot | oe, n = X !== null && X.f & Ot ? ( +function tr(t) { + var e = Dt | fe, n = j !== null && j.f & Dt ? ( /** @type {Derived} */ - X + j ) : null; - return U === null || n !== null && n.f & Ct ? e |= Ct : U.f |= Vi, { + return X === null || n !== null && n.f & Tt ? e |= Tt : X.f |= Vi, { ctx: pt, deps: null, effects: null, - equals: Xi, + equals: Ui, f: e, fn: t, reactions: null, @@ -135,28 +135,28 @@ function Qn(t) { null ), wv: 0, - parent: n ?? U + parent: n ?? X }; } // @__NO_SIDE_EFFECTS__ -function Ha(t) { - const e = /* @__PURE__ */ Qn(t); +function Ba(t) { + const e = /* @__PURE__ */ tr(t); return e.equals = Vr, e; } -function Ki(t) { +function Gi(t) { var e = t.effects; if (e !== null) { t.effects = null; for (var n = 0; n < e.length; n += 1) - se( + le( /** @type {Effect} */ e[n] ); } } -function Ya(t) { +function Ha(t) { for (var e = t.parent; e !== null; ) { - if (!(e.f & Ot)) + if (!(e.f & Dt)) return ( /** @type {Effect} */ e @@ -165,81 +165,81 @@ function Ya(t) { } return null; } -function Ba(t) { - var e, n = U; - Pe(Ya(t)); +function Ya(t) { + var e, n = X; + Fe(Ha(t)); try { - Ki(t), e = rs(t); + Gi(t), e = rs(t); } finally { - Pe(n); + Fe(n); } return e; } -function ji(t) { - var e = Ba(t), n = (de || t.f & Ct) && t.deps !== null ? Fe : _t; - ie(t, n), t.equals(e) || (t.v = e, t.wv = es()); +function Ki(t) { + var e = Ya(t), n = (ge || t.f & Tt) && t.deps !== null ? Ve : gt; + ae(t, n), t.equals(e) || (t.v = e, t.wv = es()); } -function Yr(t) { +function Hr(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -let Z = !1; -function ne(t) { - Z = t; +let Q = !1; +function ie(t) { + Q = t; } -let z; -function Ut(t) { +let U; +function Xt(t) { if (t === null) - throw Yr(), Ke; - return z = t; + throw Hr(), We; + return U = t; } -function tr() { - return Ut( +function er() { + return Xt( /** @type {TemplateNode} */ - /* @__PURE__ */ ue(z) + /* @__PURE__ */ ce(U) ); } -function gt(t) { - if (Z) { - if (/* @__PURE__ */ ue(z) !== null) - throw Yr(), Ke; - z = t; +function yt(t) { + if (Q) { + if (/* @__PURE__ */ ce(U) !== null) + throw Hr(), We; + U = t; } } -function hn(t = 1) { - if (Z) { - for (var e = t, n = z; e--; ) +function gn(t = 1) { + if (Q) { + for (var e = t, n = U; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ ue(n); - z = n; + /* @__PURE__ */ ce(n); + U = n; } } -function yr() { - for (var t = 0, e = z; ; ) { +function wr() { + for (var t = 0, e = U; ; ) { if (e.nodeType === 8) { var n = ( /** @type {Comment} */ e.data ); - if (n === Or) { + if (n === Pr) { if (t === 0) return e; t -= 1; - } else (n === qi || n === Pr) && (t += 1); + } else (n === Li || n === Or) && (t += 1); } var r = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ue(e) + /* @__PURE__ */ ce(e) ); e.remove(), e = r; } } -function wt(t, e = null, n) { - if (typeof t != "object" || t === null || je in t) +function bt(t, e = null, n) { + if (typeof t != "object" || t === null || Je in t) return t; - const r = Ra(t); - if (r !== Aa && r !== Ea) + const r = Ea(t); + if (r !== Aa && r !== Ra) return t; - var i = /* @__PURE__ */ new Map(), s = qr(t), a = Et(0); - s && i.set("length", Et( + var i = /* @__PURE__ */ new Map(), s = Lr(t), a = Ct(0); + s && i.set("length", Ct( /** @type {any[]} */ t.length )); @@ -248,44 +248,44 @@ function wt(t, e = null, n) { /** @type {any} */ t, { - defineProperty(o, f, u) { - (!("value" in u) || u.configurable === !1 || u.enumerable === !1 || u.writable === !1) && Da(); + defineProperty(u, f, o) { + (!("value" in o) || o.configurable === !1 || o.enumerable === !1 || o.writable === !1) && Da(); var h = i.get(f); - return h === void 0 ? (h = Et(u.value), i.set(f, h)) : j(h, wt(u.value, l)), !0; + return h === void 0 ? (h = Ct(o.value), i.set(f, h)) : W(h, bt(o.value, l)), !0; }, - deleteProperty(o, f) { - var u = i.get(f); - if (u === void 0) - f in o && i.set(f, Et(ht)); + deleteProperty(u, f) { + var o = i.get(f); + if (o === void 0) + f in u && i.set(f, Ct(ht)); else { if (s && typeof f == "string") { var h = ( /** @type {Source} */ i.get("length") ), c = Number(f); - Number.isInteger(c) && c < h.v && j(h, c); + Number.isInteger(c) && c < h.v && W(h, c); } - j(u, ht), di(a); + W(o, ht), di(a); } return !0; }, - get(o, f, u) { + get(u, f, o) { var p; - if (f === je) + if (f === Je) return t; - var h = i.get(f), c = f in o; - if (h === void 0 && (!c || (p = xe(o, f)) != null && p.writable) && (h = Et(wt(c ? o[f] : ht, l)), i.set(f, h)), h !== void 0) { - var d = g(h); + var h = i.get(f), c = f in u; + if (h === void 0 && (!c || (p = $e(u, f)) != null && p.writable) && (h = Ct(bt(c ? u[f] : ht, l)), i.set(f, h)), h !== void 0) { + var d = x(h); return d === ht ? void 0 : d; } - return Reflect.get(o, f, u); + return Reflect.get(u, f, o); }, - getOwnPropertyDescriptor(o, f) { - var u = Reflect.getOwnPropertyDescriptor(o, f); - if (u && "value" in u) { + getOwnPropertyDescriptor(u, f) { + var o = Reflect.getOwnPropertyDescriptor(u, f); + if (o && "value" in o) { var h = i.get(f); - h && (u.value = g(h)); - } else if (u === void 0) { + h && (o.value = x(h)); + } else if (o === void 0) { var c = i.get(f), d = c == null ? void 0 : c.v; if (c !== void 0 && d !== ht) return { @@ -295,210 +295,210 @@ function wt(t, e = null, n) { writable: !0 }; } - return u; + return o; }, - has(o, f) { + has(u, f) { var d; - if (f === je) + if (f === Je) return !0; - var u = i.get(f), h = u !== void 0 && u.v !== ht || Reflect.has(o, f); - if (u !== void 0 || U !== null && (!h || (d = xe(o, f)) != null && d.writable)) { - u === void 0 && (u = Et(h ? wt(o[f], l) : ht), i.set(f, u)); - var c = g(u); + var o = i.get(f), h = o !== void 0 && o.v !== ht || Reflect.has(u, f); + if (o !== void 0 || X !== null && (!h || (d = $e(u, f)) != null && d.writable)) { + o === void 0 && (o = Ct(h ? bt(u[f], l) : ht), i.set(f, o)); + var c = x(o); if (c === ht) return !1; } return h; }, - set(o, f, u, h) { - var C; - var c = i.get(f), d = f in o; + set(u, f, o, h) { + var T; + var c = i.get(f), d = f in u; if (s && f === "length") - for (var p = u; p < /** @type {Source} */ + for (var p = o; p < /** @type {Source} */ c.v; p += 1) { - var w = i.get(p + ""); - w !== void 0 ? j(w, ht) : p in o && (w = Et(ht), i.set(p + "", w)); + var y = i.get(p + ""); + y !== void 0 ? W(y, ht) : p in u && (y = Ct(ht), i.set(p + "", y)); } - c === void 0 ? (!d || (C = xe(o, f)) != null && C.writable) && (c = Et(void 0), j(c, wt(u, l)), i.set(f, c)) : (d = c.v !== ht, j(c, wt(u, l))); - var $ = Reflect.getOwnPropertyDescriptor(o, f); - if ($ != null && $.set && $.set.call(h, u), !d) { + c === void 0 ? (!d || (T = $e(u, f)) != null && T.writable) && (c = Ct(void 0), W(c, bt(o, l)), i.set(f, c)) : (d = c.v !== ht, W(c, bt(o, l))); + var R = Reflect.getOwnPropertyDescriptor(u, f); + if (R != null && R.set && R.set.call(h, o), !d) { if (s && typeof f == "string") { - var m = ( + var _ = ( /** @type {Source} */ i.get("length") - ), A = Number(f); - Number.isInteger(A) && A >= m.v && j(m, A + 1); + ), $ = Number(f); + Number.isInteger($) && $ >= _.v && W(_, $ + 1); } di(a); } return !0; }, - ownKeys(o) { - g(a); - var f = Reflect.ownKeys(o).filter((c) => { + ownKeys(u) { + x(a); + var f = Reflect.ownKeys(u).filter((c) => { var d = i.get(c); return d === void 0 || d.v !== ht; }); - for (var [u, h] of i) - h.v !== ht && !(u in o) && f.push(u); + for (var [o, h] of i) + h.v !== ht && !(o in u) && f.push(o); return f; }, setPrototypeOf() { - Ia(); + Fa(); } } ); } function di(t, e = 1) { - j(t, t.v + e); + W(t, t.v + e); } var vi, Wi, Ji, Zi; -function wr() { +function xr() { if (vi === void 0) { vi = window, Wi = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype; - Ji = xe(e, "firstChild").get, Zi = xe(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; + Ji = $e(e, "firstChild").get, Zi = $e(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; } } -function Pn(t = "") { +function In(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function $e(t) { +function Re(t) { return Ji.call(t); } // @__NO_SIDE_EFFECTS__ -function ue(t) { +function ce(t) { return Zi.call(t); } -function mt(t, e) { - if (!Z) - return /* @__PURE__ */ $e(t); +function wt(t, e) { + if (!Q) + return /* @__PURE__ */ Re(t); var n = ( /** @type {TemplateNode} */ - /* @__PURE__ */ $e(z) + /* @__PURE__ */ Re(U) ); if (n === null) - n = z.appendChild(Pn()); + n = U.appendChild(In()); else if (e && n.nodeType !== 3) { - var r = Pn(); - return n == null || n.before(r), Ut(r), r; + var r = In(); + return n == null || n.before(r), Xt(r), r; } - return Ut(n), n; + return Xt(n), n; } -function Ce(t, e) { - if (!Z) { +function Te(t, e) { + if (!Q) { var n = ( /** @type {DocumentFragment} */ - /* @__PURE__ */ $e( + /* @__PURE__ */ Re( /** @type {Node} */ t ) ); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ue(n) : n; + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ce(n) : n; } - return z; + return U; } function Ht(t, e = 1, n = !1) { - let r = Z ? z : t; + let r = Q ? U : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ ue(r); - if (!Z) + /* @__PURE__ */ ce(r); + if (!Q) return r; var s = r == null ? void 0 : r.nodeType; if (n && s !== 3) { - var a = Pn(); - return r === null ? i == null || i.after(a) : r.before(a), Ut(a), a; + var a = In(); + return r === null ? i == null || i.after(a) : r.before(a), Xt(a), a; } - return Ut(r), /** @type {TemplateNode} */ + return Xt(r), /** @type {TemplateNode} */ r; } function Qi(t) { t.textContent = ""; } -let wn = !1, On = !1, Dn = null, xn = !1, Br = !1; +let An = !1, Ln = !1, qn = null, Rn = !1, Yr = !1; function pi(t) { - Br = t; + Yr = t; } -let We = []; -let X = null, Mt = !1; -function Me(t) { - X = t; +let Ze = []; +let j = null, Ot = !1; +function De(t) { + j = t; } -let U = null; -function Pe(t) { - U = t; +let X = null; +function Fe(t) { + X = t; } -let zt = null; +let Ut = null; function za(t) { - zt = t; + Ut = t; } -let ot = null, yt = 0, te = null; -function Xa(t) { - te = t; +let ot = null, xt = 0, ne = null; +function Ua(t) { + ne = t; } -let ts = 1, In = 0, de = !1; +let ts = 1, Vn = 0, ge = !1; function es() { return ++ts; } -function sn(t) { +function ln(t) { var h; var e = t.f; - if (e & oe) + if (e & fe) return !0; - if (e & Fe) { - var n = t.deps, r = (e & Ct) !== 0; + if (e & Ve) { + var n = t.deps, r = (e & Tt) !== 0; if (n !== null) { - var i, s, a = (e & Sn) !== 0, l = r && U !== null && !de, o = n.length; + var i, s, a = (e & Pn) !== 0, l = r && X !== null && !ge, u = n.length; if (a || l) { var f = ( /** @type {Derived} */ t - ), u = f.parent; - for (i = 0; i < o; i++) + ), o = f.parent; + for (i = 0; i < u; i++) s = n[i], (a || !((h = s == null ? void 0 : s.reactions) != null && h.includes(f))) && (s.reactions ?? (s.reactions = [])).push(f); - a && (f.f ^= Sn), l && u !== null && !(u.f & Ct) && (f.f ^= Ct); + a && (f.f ^= Pn), l && o !== null && !(o.f & Tt) && (f.f ^= Tt); } - for (i = 0; i < o; i++) - if (s = n[i], sn( + for (i = 0; i < u; i++) + if (s = n[i], ln( /** @type {Derived} */ s - ) && ji( + ) && Ki( /** @type {Derived} */ s ), s.wv > t.wv) return !0; } - (!r || U !== null && !de) && ie(t, _t); + (!r || X !== null && !ge) && ae(t, gt); } return !1; } -function Ua(t, e) { +function ja(t, e) { for (var n = e; n !== null; ) { - if (n.f & Tn) + if (n.f & On) try { n.fn(t); return; } catch { - n.f ^= Tn; + n.f ^= On; } n = n.parent; } - throw wn = !1, t; + throw An = !1, t; } -function Ga(t) { - return (t.f & Zn) === 0 && (t.parent === null || (t.parent.f & Tn) === 0); +function Xa(t) { + return (t.f & Qn) === 0 && (t.parent === null || (t.parent.f & On) === 0); } -function er(t, e, n, r) { - if (wn) { - if (n === null && (wn = !1), Ga(e)) +function nr(t, e, n, r) { + if (An) { + if (n === null && (An = !1), Xa(e)) throw t; return; } - n !== null && (wn = !0); + n !== null && (An = !0); { - Ua(t, e); + ja(t, e); return; } } @@ -507,12 +507,12 @@ function ns(t, e, n = !0) { if (r !== null) for (var i = 0; i < r.length; i++) { var s = r[i]; - s.f & Ot ? ns( + s.f & Dt ? ns( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? ie(s, oe) : s.f & _t && ie(s, Fe), nr( + ) : e === s && (n ? ae(s, fe) : s.f & gt && ae(s, Ve), rr( /** @type {Effect} */ s )); @@ -520,39 +520,39 @@ function ns(t, e, n = !0) { } function rs(t) { var d; - var e = ot, n = yt, r = te, i = X, s = de, a = zt, l = pt, o = Mt, f = t.f; + var e = ot, n = xt, r = ne, i = j, s = ge, a = Ut, l = pt, u = Ot, f = t.f; ot = /** @type {null | Value[]} */ - null, yt = 0, te = null, de = (f & Ct) !== 0 && (Mt || !xn || X === null), X = f & (le | Ie) ? null : t, zt = null, _i(t.ctx), Mt = !1, In++; + null, xt = 0, ne = null, ge = (f & Tt) !== 0 && (Ot || !Rn || j === null), j = f & (ue | qe) ? null : t, Ut = null, gi(t.ctx), Ot = !1, Vn++; try { - var u = ( + var o = ( /** @type {Function} */ (0, t.fn)() ), h = t.deps; if (ot !== null) { var c; - if (Fn(t, yt), h !== null && yt > 0) - for (h.length = yt + ot.length, c = 0; c < ot.length; c++) - h[yt + c] = ot[c]; + if (Bn(t, xt), h !== null && xt > 0) + for (h.length = xt + ot.length, c = 0; c < ot.length; c++) + h[xt + c] = ot[c]; else t.deps = h = ot; - if (!de) - for (c = yt; c < h.length; c++) + if (!ge) + for (c = xt; c < h.length; c++) ((d = h[c]).reactions ?? (d.reactions = [])).push(t); - } else h !== null && yt < h.length && (Fn(t, yt), h.length = yt); - if (cs() && te !== null && !Mt && h !== null && !(t.f & (Ot | Fe | oe))) + } else h !== null && xt < h.length && (Bn(t, xt), h.length = xt); + if (cs() && ne !== null && !Ot && h !== null && !(t.f & (Dt | Ve | fe))) for (c = 0; c < /** @type {Source[]} */ - te.length; c++) + ne.length; c++) ns( - te[c], + ne[c], /** @type {Effect} */ t ); - return i !== null && In++, u; + return i !== null && Vn++, o; } finally { - ot = e, yt = n, te = r, X = i, de = s, zt = a, _i(l), Mt = o; + ot = e, xt = n, ne = r, j = i, ge = s, Ut = a, gi(l), Ot = u; } } -function Ka(t, e) { +function Ga(t, e) { let n = e.reactions; if (n !== null) { var r = $a.call(n, t); @@ -561,68 +561,68 @@ function Ka(t, e) { i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - n === null && e.f & Ot && // Destroying a child effect while updating a parent effect can cause a dependency to appear + n === null && e.f & Dt && // 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 || !ot.includes(e)) && (ie(e, Fe), e.f & (Ct | Sn) || (e.f ^= Sn), Ki( + (ot === null || !ot.includes(e)) && (ae(e, Ve), e.f & (Tt | Pn) || (e.f ^= Pn), Gi( /** @type {Derived} **/ e - ), Fn( + ), Bn( /** @type {Derived} **/ e, 0 )); } -function Fn(t, e) { +function Bn(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - Ka(t, n[r]); + Ga(t, n[r]); } function zr(t) { var e = t.f; - if (!(e & Zn)) { - ie(t, _t); - var n = U, r = pt, i = xn; - U = t, xn = !0; + if (!(e & Qn)) { + ae(t, gt); + var n = X, r = pt, i = Rn; + X = t, Rn = !0; try { - e & Ir ? rl(t) : ls(t), as(t); + e & Fr ? rl(t) : ls(t), as(t); var s = rs(t); t.teardown = typeof s == "function" ? s : null, t.wv = ts; var a = t.deps, l; - ci && La && t.f & oe; - } catch (o) { - er(o, t, n, r || t.ctx); + ci && qa && t.f & fe; + } catch (u) { + nr(u, t, n, r || t.ctx); } finally { - xn = i, U = n; + Rn = i, X = n; } } } -function ja() { +function Ka() { try { Ma(); } catch (t) { - if (Dn !== null) - er(t, Dn, null); + if (qn !== null) + nr(t, qn, null); else throw t; } } function is() { try { - for (var t = 0; We.length > 0; ) { - t++ > 1e3 && ja(); - var e = We, n = e.length; - We = []; + for (var t = 0; Ze.length > 0; ) { + t++ > 1e3 && Ka(); + var e = Ze, n = e.length; + Ze = []; for (var r = 0; r < n; r++) { var i = e[r]; - i.f & _t || (i.f ^= _t); + i.f & gt || (i.f ^= gt); var s = Ja(i); Wa(s); } } } finally { - On = !1, Dn = null; + Ln = !1, qn = null; } } function Wa(t) { @@ -630,42 +630,42 @@ function Wa(t) { if (e !== 0) for (var n = 0; n < e; n++) { var r = t[n]; - if (!(r.f & (Zn | re))) + if (!(r.f & (Qn | se))) try { - sn(r) && (zr(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? os(r) : r.fn = null)); + ln(r) && (zr(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? os(r) : r.fn = null)); } catch (i) { - er(i, r, null, r.ctx); + nr(i, r, null, r.ctx); } } } -function nr(t) { - On || (On = !0, queueMicrotask(is)); - for (var e = Dn = t; e.parent !== null; ) { +function rr(t) { + Ln || (Ln = !0, queueMicrotask(is)); + for (var e = qn = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (n & (Ie | le)) { - if (!(n & _t)) return; - e.f ^= _t; + if (n & (qe | ue)) { + if (!(n & gt)) return; + e.f ^= gt; } } - We.push(e); + Ze.push(e); } function Ja(t) { for (var e = [], n = t.first; n !== null; ) { - var r = n.f, i = (r & le) !== 0, s = i && (r & _t) !== 0; - if (!s && !(r & re)) { - if (r & Li) + var r = n.f, i = (r & ue) !== 0, s = i && (r & gt) !== 0; + if (!s && !(r & se)) { + if (r & qi) e.push(n); else if (i) - n.f ^= _t; + n.f ^= gt; else { - var a = X; + var a = j; try { - X = n, sn(n) && zr(n); + j = n, ln(n) && zr(n); } catch (f) { - er(f, n, null, n.ctx); + nr(f, n, null, n.ctx); } finally { - X = a; + j = a; } } var l = n.first; @@ -674,27 +674,27 @@ function Ja(t) { continue; } } - var o = n.parent; - for (n = n.next; n === null && o !== null; ) - n = o.next, o = o.parent; + var u = n.parent; + for (n = n.next; n === null && u !== null; ) + n = u.next, u = u.parent; } return e; } -function Rt(t) { +function Nt(t) { var e; - for (hi(); We.length > 0; ) - On = !0, is(), hi(); + for (hi(); Ze.length > 0; ) + Ln = !0, is(), hi(); return ( /** @type {T} */ e ); } -function g(t) { - var e = t.f, n = (e & Ot) !== 0; - if (X !== null && !Mt) { - zt !== null && zt.includes(t) && Fa(); - var r = X.deps; - t.rv < In && (t.rv = In, ot === null && r !== null && r[yt] === t ? yt++ : ot === null ? ot = [t] : (!de || !ot.includes(t)) && ot.push(t)); +function x(t) { + var e = t.f, n = (e & Dt) !== 0; + if (j !== null && !Ot) { + Ut !== null && Ut.includes(t) && Ia(); + var r = j.deps; + t.rv < Vn && (t.rv = Vn, ot === null && r !== null && r[xt] === t ? xt++ : ot === null ? ot = [t] : (!ge || !ot.includes(t)) && ot.push(t)); } else if (n && /** @type {Derived} */ t.deps === null && /** @type {Derived} */ t.effects === null) { @@ -702,37 +702,37 @@ function g(t) { /** @type {Derived} */ t ), s = i.parent; - s !== null && !(s.f & Ct) && (i.f ^= Ct); + s !== null && !(s.f & Tt) && (i.f ^= Tt); } return n && (i = /** @type {Derived} */ - t, sn(i) && ji(i)), t.v; + t, ln(i) && Ki(i)), t.v; } -function qn(t) { - var e = Mt; +function Hn(t) { + var e = Ot; try { - return Mt = !0, t(); + return Ot = !0, t(); } finally { - Mt = e; + Ot = e; } } const Za = -7169; -function ie(t, e) { +function ae(t, e) { t.f = t.f & Za | e; } function Qa(t) { - U === null && X === null && ka(), X !== null && X.f & Ct && U === null && Sa(), Br && Ta(); + X === null && j === null && ka(), j !== null && j.f & Tt && X === null && Sa(), Yr && Ta(); } function tl(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, r = !0) { - var i = (t & Ie) !== 0, s = U, a = { +function Be(t, e, n, r = !0) { + var i = (t & qe) !== 0, s = X, a = { ctx: pt, deps: null, nodes_start: null, nodes_end: null, - f: t | oe, + f: t | fe, first: null, fn: e, last: null, @@ -747,22 +747,22 @@ function qe(t, e, n, r = !0) { try { zr(a), a.f |= xa; } catch (f) { - throw se(a), f; + throw le(a), f; } - else e !== null && nr(a); - var l = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (Vi | Tn)) === 0; - if (!l && !i && r && (s !== null && tl(a, s), X !== null && X.f & Ot)) { - var o = ( + else e !== null && rr(a); + var l = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (Vi | On)) === 0; + if (!l && !i && r && (s !== null && tl(a, s), j !== null && j.f & Dt)) { + var u = ( /** @type {Derived} */ - X + j ); - (o.effects ?? (o.effects = [])).push(a); + (u.effects ?? (u.effects = [])).push(a); } return a; } -function Xr(t) { +function Ur(t) { Qa(); - var e = U !== null && (U.f & le) !== 0 && pt !== null && !pt.m; + var e = X !== null && (X.f & ue) !== 0 && pt !== null && !pt.m; if (e) { var n = ( /** @type {ComponentContext} */ @@ -770,53 +770,53 @@ function Xr(t) { ); (n.e ?? (n.e = [])).push({ fn: t, - effect: U, - reaction: X + effect: X, + reaction: j }); } else { - var r = Ur(t); + var r = jr(t); return r; } } function el(t) { - const e = qe(Ie, t, !0); + const e = Be(qe, t, !0); return () => { - se(e); + le(e); }; } function nl(t) { - const e = qe(Ie, t, !0); + const e = Be(qe, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Ln(e, () => { - se(e), r(void 0); - }) : (se(e), r(void 0)); + n.outro ? Yn(e, () => { + le(e), r(void 0); + }) : (le(e), r(void 0)); }); } -function Ur(t) { - return qe(Li, t, !1); +function jr(t) { + return Be(qi, t, !1); } function ss(t) { - return qe(Dr, t, !0); + return Be(Dr, t, !0); } -function dn(t, e = [], n = Qn) { +function _n(t, e = [], n = tr) { const r = e.map(n); - return Gr(() => t(...r.map(g))); + return Xr(() => t(...r.map(x))); } -function Gr(t, e = 0) { - return qe(Dr | Ir | e, t, !0); +function Xr(t, e = 0) { + return Be(Dr | Fr | e, t, !0); } -function Ze(t, e = !0) { - return qe(Dr | le, t, !0, e); +function tn(t, e = !0) { + return Be(Dr | ue, t, !0, e); } function as(t) { var e = t.teardown; if (e !== null) { - const n = Br, r = X; - pi(!0), Me(null); + const n = Yr, r = j; + pi(!0), De(null); try { e.call(null); } finally { - pi(n), Me(r); + pi(n), De(r); } } } @@ -824,32 +824,32 @@ function ls(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { var r = n.next; - se(n, e), n = r; + le(n, e), n = r; } } function rl(t) { for (var e = t.first; e !== null; ) { var n = e.next; - e.f & le || se(e), e = n; + e.f & ue || le(e), e = n; } } -function se(t, e = !0) { +function le(t, e = !0) { var n = !1; if ((e || t.f & ba) && t.nodes_start !== null) { for (var r = t.nodes_start, i = t.nodes_end; r !== null; ) { var s = r === i ? null : ( /** @type {TemplateNode} */ - /* @__PURE__ */ ue(r) + /* @__PURE__ */ ce(r) ); r.remove(), r = s; } n = !0; } - ls(t, e && !n), Fn(t, 0), ie(t, Zn); + ls(t, e && !n), Bn(t, 0), ae(t, Qn); var a = t.transitions; if (a !== null) - for (const o of a) - o.stop(); + for (const u of a) + u.stop(); as(t); var l = t.parent; l !== null && l.first !== null && os(t), t.next = t.prev = t.teardown = t.ctx = t.deps = t.fn = t.nodes_start = t.nodes_end = null; @@ -858,10 +858,10 @@ function os(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 Ln(t, e) { +function Yn(t, e) { var n = []; - Kr(t, n, !0), us(n, () => { - se(t), e && e(); + Gr(t, n, !0), us(n, () => { + le(t), e && e(); }); } function us(t, e) { @@ -873,25 +873,25 @@ function us(t, e) { } else e(); } -function Kr(t, e, n) { - if (!(t.f & re)) { - if (t.f ^= re, t.transitions !== null) +function Gr(t, e, n) { + if (!(t.f & se)) { + if (t.f ^= se, t.transitions !== null) for (const a of t.transitions) (a.is_global || n) && e.push(a); for (var r = t.first; r !== null; ) { - var i = r.next, s = (r.f & Fr) !== 0 || (r.f & le) !== 0; - Kr(r, e, s ? n : !1), r = i; + var i = r.next, s = (r.f & Ir) !== 0 || (r.f & ue) !== 0; + Gr(r, e, s ? n : !1), r = i; } } } -function Vn(t) { +function zn(t) { fs(t, !0); } function fs(t, e) { - if (t.f & re) { - t.f ^= re, t.f & _t || (t.f ^= _t), sn(t) && (ie(t, oe), nr(t)); + if (t.f & se) { + t.f ^= se, t.f & gt || (t.f ^= gt), ln(t) && (ae(t, fe), rr(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & Fr) !== 0 || (n.f & le) !== 0; + var r = n.next, i = (n.f & Ir) !== 0 || (n.f & ue) !== 0; fs(n, i ? e : !1), n = r; } if (t.transitions !== null) @@ -903,10 +903,10 @@ function il(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } let pt = null; -function _i(t) { +function gi(t) { pt = t; } -function jr(t, e = !1, n) { +function Kr(t, e = !1, n) { pt = { p: pt, c: null, @@ -923,15 +923,15 @@ function Wr(t) { t !== void 0 && (e.x = t); const a = e.e; if (a !== null) { - var n = U, r = X; + var n = X, r = j; e.e = null; try { for (var i = 0; i < a.length; i++) { var s = a[i]; - Pe(s.effect), Me(s.reaction), Ur(s.fn); + Fe(s.effect), De(s.reaction), jr(s.fn); } } finally { - Pe(n), Me(r); + Fe(n), De(r); } } pt = e.p, e.m = !0; @@ -946,25 +946,25 @@ const sl = ["touchstart", "touchmove"]; function al(t) { return sl.includes(t); } -const hs = /* @__PURE__ */ new Set(), xr = /* @__PURE__ */ new Set(); +const hs = /* @__PURE__ */ new Set(), br = /* @__PURE__ */ new Set(); function ll(t) { for (var e = 0; e < t.length; e++) hs.add(t[e]); - for (var n of xr) + for (var n of br) n(t); } -function vn(t) { - var A; +function mn(t) { + var $; var e = this, n = ( /** @type {Node} */ e.ownerDocument - ), r = t.type, i = ((A = t.composedPath) == null ? void 0 : A.call(t)) || [], s = ( + ), r = t.type, i = (($ = t.composedPath) == null ? void 0 : $.call(t)) || [], s = ( /** @type {null | Element} */ i[0] || t.target ), a = 0, l = t.__root; if (l) { - var o = i.indexOf(l); - if (o !== -1 && (e === document || e === /** @type {any} */ + var u = i.indexOf(l); + if (u !== -1 && (e === document || e === /** @type {any} */ window)) { t.__root = e; return; @@ -972,49 +972,49 @@ function vn(t) { var f = i.indexOf(e); if (f === -1) return; - o <= f && (a = o); + u <= f && (a = u); } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - Mn(t, "currentTarget", { + Fn(t, "currentTarget", { configurable: !0, get() { return s || n; } }); - var u = X, h = U; - Me(null), Pe(null); + var o = j, h = X; + De(null), Fe(null); try { for (var c, d = []; s !== null; ) { var p = s.assignedSlot || s.parentNode || /** @type {any} */ s.host || null; try { - var w = s["__" + r]; - if (w !== void 0 && (!/** @type {any} */ + var y = s["__" + r]; + if (y !== void 0 && (!/** @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)) - if (qr(w)) { - var [$, ...m] = w; - $.apply(s, [t, ...m]); + if (Lr(y)) { + var [R, ..._] = y; + R.apply(s, [t, ..._]); } else - w.call(s, t); - } catch (C) { - c ? d.push(C) : c = C; + y.call(s, t); + } catch (T) { + c ? d.push(T) : c = T; } if (t.cancelBubble || p === e || p === null) break; s = p; } if (c) { - for (let C of d) + for (let T of d) queueMicrotask(() => { - throw C; + throw T; }); throw c; } } finally { - t.__root = e, delete t.currentTarget, Me(u), Pe(h); + t.__root = e, delete t.currentTarget, De(o), Fe(h); } } } @@ -1022,19 +1022,19 @@ function ds(t) { var e = document.createElement("template"); return e.innerHTML = t, e.content; } -function Qe(t, e) { +function en(t, e) { var n = ( /** @type {Effect} */ - U + X ); n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e); } // @__NO_SIDE_EFFECTS__ -function Le(t, e) { +function He(t, e) { var n = (e & wa) !== 0, r, i = !t.startsWith(""); return () => { - if (Z) - return Qe(z, null), z; + if (Q) + return en(U, null), U; r === void 0 && (r = ds(i ? t : "" + t)); var s = ( /** @type {TemplateNode} */ @@ -1043,12 +1043,12 @@ function Le(t, e) { { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ $e(s) + /* @__PURE__ */ Re(s) ), l = ( /** @type {TemplateNode} */ s.lastChild ); - Qe(a, l); + en(a, l); } return s; }; @@ -1057,29 +1057,29 @@ function Le(t, e) { function ol(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { - if (Z) - return Qe(z, null), z; + if (Q) + return en(U, null), U; if (!s) { var a = ( /** @type {DocumentFragment} */ ds(i) ), l = ( /** @type {Element} */ - /* @__PURE__ */ $e(a) + /* @__PURE__ */ Re(a) ); s = /** @type {Element} */ - /* @__PURE__ */ $e(l); + /* @__PURE__ */ Re(l); } - var o = ( + var u = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return Qe(o, o), o; + return en(u, u), u; }; } -function ce(t, e) { - if (Z) { - U.nodes_end = z, tr(); +function ve(t, e) { + if (Q) { + X.nodes_end = U, er(); return; } t !== null && t.before( @@ -1087,7 +1087,7 @@ function ce(t, e) { e ); } -function Be(t, e) { +function Se(t, e) { var n = e == null ? "" : typeof e == "object" ? e + "" : e; n !== (t.__t ?? (t.__t = t.nodeValue)) && (t.__t = n, t.nodeValue = n + ""); } @@ -1095,248 +1095,248 @@ function vs(t, e) { return ps(t, e); } function ul(t, e) { - wr(), e.intro = e.intro ?? !1; - const n = e.target, r = Z, i = z; + xr(), e.intro = e.intro ?? !1; + const n = e.target, r = Q, i = U; try { for (var s = ( /** @type {TemplateNode} */ - /* @__PURE__ */ $e(n) + /* @__PURE__ */ Re(n) ); s && (s.nodeType !== 8 || /** @type {Comment} */ - s.data !== qi); ) + s.data !== Li); ) s = /** @type {TemplateNode} */ - /* @__PURE__ */ ue(s); + /* @__PURE__ */ ce(s); if (!s) - throw Ke; - ne(!0), Ut( + throw We; + ie(!0), Xt( /** @type {Comment} */ s - ), tr(); + ), er(); const a = ps(t, { ...e, anchor: s }); - if (z === null || z.nodeType !== 8 || /** @type {Comment} */ - z.data !== Or) - throw Yr(), Ke; - return ne(!1), /** @type {Exports} */ + if (U === null || U.nodeType !== 8 || /** @type {Comment} */ + U.data !== Pr) + throw Hr(), We; + return ie(!1), /** @type {Exports} */ a; } catch (a) { - if (a === Ke) - return e.recover === !1 && Pa(), wr(), Qi(n), ne(!1), vs(t, e); + if (a === We) + return e.recover === !1 && Oa(), xr(), Qi(n), ie(!1), vs(t, e); throw a; } finally { - ne(r), Ut(i); + ie(r), Xt(i); } } -const Ne = /* @__PURE__ */ new Map(); +const ke = /* @__PURE__ */ new Map(); function ps(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - wr(); - var l = /* @__PURE__ */ new Set(), o = (h) => { + xr(); + var l = /* @__PURE__ */ new Set(), u = (h) => { for (var c = 0; c < h.length; c++) { var d = h[c]; if (!l.has(d)) { l.add(d); var p = al(d); - e.addEventListener(d, vn, { passive: p }); - var w = Ne.get(d); - w === void 0 ? (document.addEventListener(d, vn, { passive: p }), Ne.set(d, 1)) : Ne.set(d, w + 1); + e.addEventListener(d, mn, { passive: p }); + var y = ke.get(d); + y === void 0 ? (document.addEventListener(d, mn, { passive: p }), ke.set(d, 1)) : ke.set(d, y + 1); } } }; - o(Lr(hs)), xr.add(o); - var f = void 0, u = nl(() => { - var h = n ?? e.appendChild(Pn()); - return Ze(() => { + u(qr(hs)), br.add(u); + var f = void 0, o = nl(() => { + var h = n ?? e.appendChild(In()); + return tn(() => { if (s) { - jr({}); + Kr({}); var c = ( /** @type {ComponentContext} */ pt ); c.c = s; } - i && (r.$$events = i), Z && Qe( + i && (r.$$events = i), Q && en( /** @type {TemplateNode} */ h, null - ), f = t(h, r) || {}, Z && (U.nodes_end = z), s && Wr(); + ), f = t(h, r) || {}, Q && (X.nodes_end = U), s && Wr(); }), () => { var p; for (var c of l) { - e.removeEventListener(c, vn); + e.removeEventListener(c, mn); var d = ( /** @type {number} */ - Ne.get(c) + ke.get(c) ); - --d === 0 ? (document.removeEventListener(c, vn), Ne.delete(c)) : Ne.set(c, d); + --d === 0 ? (document.removeEventListener(c, mn), ke.delete(c)) : ke.set(c, d); } - xr.delete(o), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); + br.delete(u), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); }; }); - return br.set(f, u), f; + return $r.set(f, o), f; } -let br = /* @__PURE__ */ new WeakMap(); +let $r = /* @__PURE__ */ new WeakMap(); function fl(t, e) { - const n = br.get(t); - return n ? (br.delete(t), n(e)) : Promise.resolve(); + const n = $r.get(t); + return n ? ($r.delete(t), n(e)) : Promise.resolve(); } -function gi(t, e, n = !1) { - Z && tr(); - var r = t, i = null, s = null, a = ht, l = n ? Fr : 0, o = !1; +function _i(t, e, n = !1) { + Q && er(); + var r = t, i = null, s = null, a = ht, l = n ? Ir : 0, u = !1; const f = (h, c = !0) => { - o = !0, u(c, h); - }, u = (h, c) => { + u = !0, o(c, h); + }, o = (h, c) => { if (a === (a = h)) return; let d = !1; - if (Z) { + if (Q) { const p = ( /** @type {Comment} */ - r.data === Pr + r.data === Or ); - !!a === p && (r = yr(), Ut(r), ne(!1), d = !0); + !!a === p && (r = wr(), Xt(r), ie(!1), d = !0); } - a ? (i ? Vn(i) : c && (i = Ze(() => c(r))), s && Ln(s, () => { + a ? (i ? zn(i) : c && (i = tn(() => c(r))), s && Yn(s, () => { s = null; - })) : (s ? Vn(s) : c && (s = Ze(() => c(r))), i && Ln(i, () => { + })) : (s ? zn(s) : c && (s = tn(() => c(r))), i && Yn(i, () => { i = null; - })), d && ne(!0); + })), d && ie(!0); }; - Gr(() => { - o = !1, e(f), o || u(null, null); - }, l), Z && (r = z); + Xr(() => { + u = !1, e(f), u || o(null, null); + }, l), Q && (r = U); } -function hr(t, e) { +function dr(t, e) { return e; } function cl(t, e, n, r) { for (var i = [], s = e.length, a = 0; a < s; a++) - Kr(e[a].e, i, !0); + Gr(e[a].e, i, !0); var l = s > 0 && i.length === 0 && n !== null; if (l) { - var o = ( + var u = ( /** @type {Element} */ /** @type {Element} */ n.parentNode ); - Qi(o), o.append( + Qi(u), u.append( /** @type {Element} */ n - ), r.clear(), he(t, e[0].prev, e[s - 1].next); + ), r.clear(), pe(t, e[0].prev, e[s - 1].next); } us(i, () => { for (var f = 0; f < s; f++) { - var u = e[f]; - l || (r.delete(u.k), he(t, u.prev, u.next)), se(u.e, !l); + var o = e[f]; + l || (r.delete(o.k), pe(t, o.prev, o.next)), le(o.e, !l); } }); } -function dr(t, e, n, r, i, s = null) { +function vr(t, e, n, r, i, s = null) { var a = t, l = { items: /* @__PURE__ */ new Map(), first: null }; - Z && tr(); - var o = null, f = !1, u = /* @__PURE__ */ Ha(() => { + Q && er(); + var u = null, f = !1, o = /* @__PURE__ */ Ba(() => { var h = n(); - return qr(h) ? h : h == null ? [] : Lr(h); + return Lr(h) ? h : h == null ? [] : qr(h); }); - Gr(() => { - var h = g(u), c = h.length; + Xr(() => { + var h = x(o), c = h.length; if (f && c === 0) return; f = c === 0; let d = !1; - if (Z) { + if (Q) { var p = ( /** @type {Comment} */ - a.data === Pr + a.data === Or ); - p !== (c === 0) && (a = yr(), Ut(a), ne(!1), d = !0); + p !== (c === 0) && (a = wr(), Xt(a), ie(!1), d = !0); } - if (Z) { - for (var w = null, $, m = 0; m < c; m++) { - if (z.nodeType === 8 && /** @type {Comment} */ - z.data === Or) { + if (Q) { + for (var y = null, R, _ = 0; _ < c; _++) { + if (U.nodeType === 8 && /** @type {Comment} */ + U.data === Pr) { a = /** @type {Comment} */ - z, d = !0, ne(!1); + U, d = !0, ie(!1); break; } - var A = h[m], C = r(A, m); - $ = _s( - z, + var $ = h[_], T = r($, _); + R = gs( + U, l, - w, + y, null, - A, - C, - m, + $, + T, + _, i, e, n - ), l.items.set(C, $), w = $; + ), l.items.set(T, R), y = R; } - c > 0 && Ut(yr()); + c > 0 && Xt(wr()); } - Z || hl(h, l, a, i, e, r, n), s !== null && (c === 0 ? o ? Vn(o) : o = Ze(() => s(a)) : o !== null && Ln(o, () => { - o = null; - })), d && ne(!0), g(u); - }), Z && (a = z); + Q || hl(h, l, a, i, e, r, n), s !== null && (c === 0 ? u ? zn(u) : u = tn(() => s(a)) : u !== null && Yn(u, () => { + u = null; + })), d && ie(!0), x(o); + }), Q && (a = U); } function hl(t, e, n, r, i, s, a) { - var l = t.length, o = e.items, f = e.first, u = f, h, c = null, d = [], p = [], w, $, m, A; - for (A = 0; A < l; A += 1) { - if (w = t[A], $ = s(w, A), m = o.get($), m === void 0) { - var C = u ? ( + var l = t.length, u = e.items, f = e.first, o = f, h, c = null, d = [], p = [], y, R, _, $; + for ($ = 0; $ < l; $ += 1) { + if (y = t[$], R = s(y, $), _ = u.get(R), _ === void 0) { + var T = o ? ( /** @type {TemplateNode} */ - u.e.nodes_start + o.e.nodes_start ) : n; - c = _s( - C, + c = gs( + T, e, c, c === null ? e.first : c.next, - w, + y, + R, $, - A, r, i, a - ), o.set($, c), d = [], p = [], u = c.next; + ), u.set(R, c), d = [], p = [], o = c.next; continue; } - if (dl(m, w, A), m.e.f & re && Vn(m.e), m !== u) { - if (h !== void 0 && h.has(m)) { + if (dl(_, y, $), _.e.f & se && zn(_.e), _ !== o) { + if (h !== void 0 && h.has(_)) { if (d.length < p.length) { - var M = p[0], R; + var M = p[0], b; c = M.prev; - var D = d[0], G = d[d.length - 1]; - for (R = 0; R < d.length; R += 1) - mi(d[R], M, n); - for (R = 0; R < p.length; R += 1) - h.delete(p[R]); - he(e, D.prev, G.next), he(e, c, D), he(e, G, M), u = M, c = G, A -= 1, d = [], p = []; + var P = d[0], z = d[d.length - 1]; + for (b = 0; b < d.length; b += 1) + mi(d[b], M, n); + for (b = 0; b < p.length; b += 1) + h.delete(p[b]); + pe(e, P.prev, z.next), pe(e, c, P), pe(e, z, M), o = M, c = z, $ -= 1, d = [], p = []; } else - h.delete(m), mi(m, u, n), he(e, m.prev, m.next), he(e, m, c === null ? e.first : c.next), he(e, c, m), c = m; + h.delete(_), mi(_, o, n), pe(e, _.prev, _.next), pe(e, _, c === null ? e.first : c.next), pe(e, c, _), c = _; continue; } - for (d = [], p = []; u !== null && u.k !== $; ) - u.e.f & re || (h ?? (h = /* @__PURE__ */ new Set())).add(u), p.push(u), u = u.next; - if (u === null) + for (d = [], p = []; o !== null && o.k !== R; ) + o.e.f & se || (h ?? (h = /* @__PURE__ */ new Set())).add(o), p.push(o), o = o.next; + if (o === null) continue; - m = u; + _ = o; } - d.push(m), c = m, u = m.next; - } - if (u !== null || h !== void 0) { - for (var W = h === void 0 ? [] : Lr(h); u !== null; ) - u.e.f & re || W.push(u), u = u.next; - var et = W.length; - if (et > 0) { - var Q = null; - cl(e, W, Q, o); + d.push(_), c = _, o = _.next; + } + if (o !== null || h !== void 0) { + for (var J = h === void 0 ? [] : qr(h); o !== null; ) + o.e.f & se || J.push(o), o = o.next; + var it = J.length; + if (it > 0) { + var nt = null; + cl(e, J, nt, u); } } - U.first = e.first && e.first.e, U.last = c && c.e; + X.first = e.first && e.first.e, X.last = c && c.e; } function dl(t, e, n, r) { - Ui(t.v, e), t.i = n; + ji(t.v, e), t.i = n; } -function _s(t, e, n, r, i, s, a, l, o, f) { - var u = (o & da) !== 0, h = (o & pa) === 0, c = u ? h ? /* @__PURE__ */ Hr(i) : Et(i) : i, d = o & va ? Et(a) : a, p = { +function gs(t, e, n, r, i, s, a, l, u, f) { + var o = (u & da) !== 0, h = (u & pa) === 0, c = o ? h ? /* @__PURE__ */ Br(i) : Ct(i) : i, d = u & va ? Ct(a) : a, p = { i: d, v: c, k: s, @@ -1347,7 +1347,7 @@ function _s(t, e, n, r, i, s, a, l, o, f) { next: r }; try { - return p.e = Ze(() => l(t, c, d, f), Z), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; + return p.e = tn(() => l(t, c, d, f), Q), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; } finally { } } @@ -1364,15 +1364,15 @@ function mi(t, e, n) { ); s !== r; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ue(s) + /* @__PURE__ */ ce(s) ); i.before(s), s = a; } } -function he(t, e, n) { +function pe(t, e, n) { e === null ? t.first = n : (e.next = n, e.e.next = n && n.e), n !== null && (n.prev = e, n.e.prev = e && e.e); } -function gs(t, e) { +function _s(t, e) { zi(() => { var n = t.getRootNode(), r = ( /** @type {ShadowRoot} */ @@ -1396,13 +1396,13 @@ function yi(t, e, n, r) { i[e] !== n && (i[e] = n, n == null ? t.style.removeProperty(e) : t.style.setProperty(e, n, "")); } function wi(t, e) { - return t === e || (t == null ? void 0 : t[je]) === e; + return t === e || (t == null ? void 0 : t[Je]) === e; } -function bn(t = {}, e, n, r) { - return Ur(() => { +function En(t = {}, e, n, r) { + return jr(() => { var i, s; return ss(() => { - i = s, s = [], qn(() => { + i = s, s = [], Hn(() => { t !== n(...s) && (e(t, ...s), i && wi(n(...i), t) && e(null, ...i)); }); }), () => { @@ -1413,72 +1413,72 @@ function bn(t = {}, e, n, r) { }), t; } function vl(t) { - pt === null && il(), Xr(() => { - const e = qn(t); + pt === null && il(), Ur(() => { + const e = Hn(t); if (typeof e == "function") return ( /** @type {() => void} */ e ); }); } -let pn = !1; +let yn = !1; function pl(t) { - var e = pn; + var e = yn; try { - return pn = !1, [t(), pn]; + return yn = !1, [t(), yn]; } finally { - pn = e; + yn = e; } } -function kt(t, e, n, r) { - var R; - var i = (n & _a) !== 0, s = !0, a = (n & ma) !== 0, l = (n & ya) !== 0, o = !1, f; - a ? [f, o] = pl(() => ( +function Mt(t, e, n, r) { + var b; + var i = (n & ga) !== 0, s = !0, a = (n & ma) !== 0, l = (n & ya) !== 0, u = !1, f; + a ? [f, u] = pl(() => ( /** @type {V} */ t[e] )) : f = /** @type {V} */ t[e]; - var u = je in t || Hi in t, h = a && (((R = xe(t, e)) == null ? void 0 : R.set) ?? (u && e in t && ((D) => t[e] = D))) || void 0, c = ( + var o = Je in t || Bi in t, h = a && (((b = $e(t, e)) == null ? void 0 : b.set) ?? (o && e in t && ((P) => t[e] = P))) || void 0, c = ( /** @type {V} */ r - ), d = !0, p = !1, w = () => (p = !0, d && (d = !1, l ? c = qn( + ), d = !0, p = !1, y = () => (p = !0, d && (d = !1, l ? c = Hn( /** @type {() => V} */ r ) : c = /** @type {V} */ r), c); - f === void 0 && r !== void 0 && (h && s && Oa(), f = w(), h && h(f)); - var $; - if ($ = () => { - var D = ( + f === void 0 && r !== void 0 && (h && s && Pa(), f = y(), h && h(f)); + var R; + if (R = () => { + var P = ( /** @type {V} */ t[e] ); - return D === void 0 ? w() : (d = !0, p = !1, D); - }, !(n & ga)) - return $; + return P === void 0 ? y() : (d = !0, p = !1, P); + }, !(n & _a)) + return R; if (h) { - var m = t.$$legacy; - return function(D, G) { - return arguments.length > 0 ? ((!G || m || o) && h(G ? $() : D), D) : $(); + var _ = t.$$legacy; + return function(P, z) { + return arguments.length > 0 ? ((!z || _ || u) && h(z ? R() : P), P) : R(); }; } - var A = !1, C = /* @__PURE__ */ Hr(f), M = /* @__PURE__ */ Qn(() => { - var D = $(), G = g(C); - return A ? (A = !1, G) : C.v = D; + var $ = !1, T = /* @__PURE__ */ Br(f), M = /* @__PURE__ */ tr(() => { + var P = R(), z = x(T); + return $ ? ($ = !1, z) : T.v = P; }); - return i || (M.equals = Vr), function(D, G) { + return i || (M.equals = Vr), function(P, z) { if (arguments.length > 0) { - const W = G ? g(M) : a ? wt(D) : D; - return M.equals(W) || (A = !0, j(C, W), p && c !== void 0 && (c = W), qn(() => g(M))), D; + const J = z ? x(M) : a ? bt(P) : P; + return M.equals(J) || ($ = !0, W(T, J), p && c !== void 0 && (c = J), Hn(() => x(M))), P; } - return g(M); + return x(M); }; } -function _l(t) { - return new gl(t); +function gl(t) { + return new _l(t); } -var ee, At; -class gl { +var re, Et; +class _l { /** * @param {ComponentConstructorOptions & { * component: any; @@ -1486,57 +1486,57 @@ class gl { */ constructor(e) { /** @type {any} */ - fr(this, ee); + cr(this, re); /** @type {Record} */ - fr(this, At); + cr(this, Et); var s; var n = /* @__PURE__ */ new Map(), r = (a, l) => { - var o = /* @__PURE__ */ Hr(l); - return n.set(a, o), o; + var u = /* @__PURE__ */ Br(l); + return n.set(a, u), u; }; const i = new Proxy( { ...e.props || {}, $$events: {} }, { get(a, l) { - return g(n.get(l) ?? r(l, Reflect.get(a, l))); + return x(n.get(l) ?? r(l, Reflect.get(a, l))); }, has(a, l) { - return l === Hi ? !0 : (g(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); + return l === Bi ? !0 : (x(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); }, - set(a, l, o) { - return j(n.get(l) ?? r(l, o), o), Reflect.set(a, l, o); + set(a, l, u) { + return W(n.get(l) ?? r(l, u), u), Reflect.set(a, l, u); } } ); - cr(this, At, (e.hydrate ? ul : vs)(e.component, { + hr(this, Et, (e.hydrate ? ul : vs)(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) && Rt(), cr(this, ee, i.$$events); - for (const a of Object.keys(ct(this, At))) - a === "$set" || a === "$destroy" || a === "$on" || Mn(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && Nt(), hr(this, re, i.$$events); + for (const a of Object.keys(ct(this, Et))) + a === "$set" || a === "$destroy" || a === "$on" || Fn(this, a, { get() { - return ct(this, At)[a]; + return ct(this, Et)[a]; }, /** @param {any} value */ set(l) { - ct(this, At)[a] = l; + ct(this, Et)[a] = l; }, enumerable: !0 }); - ct(this, At).$set = /** @param {Record} next */ + ct(this, Et).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, ct(this, At).$destroy = () => { - fl(ct(this, At)); + }, ct(this, Et).$destroy = () => { + fl(ct(this, Et)); }; } /** @param {Record} props */ $set(e) { - ct(this, At).$set(e); + ct(this, Et).$set(e); } /** * @param {string} event @@ -1544,20 +1544,20 @@ class gl { * @returns {any} */ $on(e, n) { - ct(this, ee)[e] = ct(this, ee)[e] || []; + ct(this, re)[e] = ct(this, re)[e] || []; const r = (...i) => n.call(this, ...i); - return ct(this, ee)[e].push(r), () => { - ct(this, ee)[e] = ct(this, ee)[e].filter( + return ct(this, re)[e].push(r), () => { + ct(this, re)[e] = ct(this, re)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - ct(this, At).$destroy(); + ct(this, Et).$destroy(); } } -ee = new WeakMap(), At = new WeakMap(); +re = new WeakMap(), Et = new WeakMap(); let ms; typeof HTMLElement == "function" && (ms = class extends HTMLElement { /** @@ -1568,25 +1568,25 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - St(this, "$$ctor"); + kt(this, "$$ctor"); /** Slots */ - St(this, "$$s"); + kt(this, "$$s"); /** @type {any} The Svelte component instance */ - St(this, "$$c"); + kt(this, "$$c"); /** Whether or not the custom element is connected */ - St(this, "$$cn", !1); + kt(this, "$$cn", !1); /** @type {Record} Component props data */ - St(this, "$$d", {}); + kt(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - St(this, "$$r", !1); + kt(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - St(this, "$$p_d", {}); + kt(this, "$$p_d", {}); /** @type {Record} Event listeners */ - St(this, "$$l", {}); + kt(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - St(this, "$$l_u", /* @__PURE__ */ new Map()); + kt(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - St(this, "$$me"); + kt(this, "$$me"); this.$$ctor = e, this.$$s = n, r && this.attachShadow({ mode: "open" }); } /** @@ -1617,7 +1617,7 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement { let n = function(s) { return (a) => { const l = document.createElement("slot"); - s !== "default" && (l.name = s), ce(a, l); + s !== "default" && (l.name = s), ve(a, l); }; }; var e = n; @@ -1628,11 +1628,11 @@ typeof HTMLElement == "function" && (ms = 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] = $n(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = Cn(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 = _l({ + this.$$c = gl({ component: this.$$ctor, target: this.shadowRoot || this, props: { @@ -1644,10 +1644,10 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement { ss(() => { var s; this.$$r = !0; - for (const a of kn(this.$$c)) { + for (const a of Dn(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const l = $n( + const l = Cn( a, this.$$d[a], this.$$p_d, @@ -1675,7 +1675,7 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = $n(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] = Cn(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -1686,12 +1686,12 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return kn(this.$$p_d).find( + return Dn(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function $n(t, e, n, r) { +function Cn(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]) @@ -1737,31 +1737,31 @@ function ys(t, e, n, r, i, s) { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return kn(e).map( + return Dn(e).map( (l) => (e[l].attribute || l).toLowerCase() ); } }; - return kn(e).forEach((l) => { - Mn(a.prototype, l, { + return Dn(e).forEach((l) => { + Fn(a.prototype, l, { get() { return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l]; }, - set(o) { + set(u) { var h; - o = $n(l, o, e), this.$$d[l] = o; + u = Cn(l, u, e), this.$$d[l] = u; var f = this.$$c; if (f) { - var u = (h = xe(f, l)) == null ? void 0 : h.get; - u ? f[l] = o : f.$set({ [l]: o }); + var o = (h = $e(f, l)) == null ? void 0 : h.get; + o ? f[l] = u : f.$set({ [l]: u }); } } }); }), r.forEach((l) => { - Mn(a.prototype, l, { + Fn(a.prototype, l, { get() { - var o; - return (o = this.$$c) == null ? void 0 : o[l]; + var u; + return (u = this.$$c) == null ? void 0 : u[l]; } }); }), t.element = /** @type {any} */ @@ -1774,9 +1774,9 @@ function ws() { if (!(r = arguments[t] + "") || r in n || /[\s.]/.test(r)) throw new Error("illegal type: " + r); n[r] = []; } - return new An(n); + return new Nn(n); } -function An(t) { +function Nn(t) { this._ = t; } function wl(t, e) { @@ -1786,8 +1786,8 @@ function wl(t, e) { return { type: n, name: r }; }); } -An.prototype = ws.prototype = { - constructor: An, +Nn.prototype = ws.prototype = { + constructor: Nn, on: function(t, e) { var n = this._, r = wl(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { @@ -1803,7 +1803,7 @@ An.prototype = ws.prototype = { copy: function() { var t = {}, e = this._; for (var n in e) t[n] = e[n].slice(); - return new An(t); + return new Nn(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]; @@ -1828,22 +1828,22 @@ function xi(t, e, n) { } return n != null && t.push({ name: e, value: n }), t; } -var $r = "http://www.w3.org/1999/xhtml"; +var Ar = "http://www.w3.org/1999/xhtml"; const bi = { svg: "http://www.w3.org/2000/svg", - xhtml: $r, + xhtml: Ar, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function rr(t) { +function ir(t) { var e = t += "", n = e.indexOf(":"); return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), bi.hasOwnProperty(e) ? { space: bi[e], local: t } : t; } function bl(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; - return n === $r && e.documentElement.namespaceURI === $r ? e.createElement(t) : e.createElementNS(n, t); + return n === Ar && e.documentElement.namespaceURI === Ar ? e.createElement(t) : e.createElementNS(n, t); }; } function $l(t) { @@ -1852,7 +1852,7 @@ function $l(t) { }; } function xs(t) { - var e = rr(t); + var e = ir(t); return (e.local ? $l : bl)(e); } function Al() { @@ -1862,14 +1862,14 @@ function Jr(t) { return this.querySelector(t); }; } -function El(t) { +function Rl(t) { typeof t != "function" && (t = Jr(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, l = r[i] = new Array(a), o, f, u = 0; u < a; ++u) - (o = s[u]) && (f = t.call(o, o.__data__, u, s)) && ("__data__" in o && (f.__data__ = o.__data__), l[u] = f); - return new xt(r, this._parents); + for (var s = e[i], a = s.length, l = r[i] = new Array(a), u, f, o = 0; o < a; ++o) + (u = s[o]) && (f = t.call(u, u.__data__, o, s)) && ("__data__" in u && (f.__data__ = u.__data__), l[o] = f); + return new $t(r, this._parents); } -function Rl(t) { +function El(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function Cl() { @@ -1882,15 +1882,15 @@ function bs(t) { } function Nl(t) { return function() { - return Rl(t.apply(this, arguments)); + return El(t.apply(this, arguments)); }; } function Tl(t) { typeof t == "function" ? t = Nl(t) : t = bs(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) - for (var a = e[s], l = a.length, o, f = 0; f < l; ++f) - (o = a[f]) && (r.push(t.call(o, o.__data__, f, a)), i.push(o)); - return new xt(r, i); + for (var a = e[s], l = a.length, u, f = 0; f < l; ++f) + (u = a[f]) && (r.push(t.call(u, u.__data__, f, a)), i.push(u)); + return new $t(r, i); } function $s(t) { return function() { @@ -1911,39 +1911,39 @@ function kl(t) { function Ml() { return this.firstElementChild; } -function Pl(t) { +function Ol(t) { return this.select(t == null ? Ml : kl(typeof t == "function" ? t : As(t))); } -var Ol = Array.prototype.filter; +var Pl = Array.prototype.filter; function Dl() { return Array.from(this.children); } -function Il(t) { +function Fl(t) { return function() { - return Ol.call(this.children, t); + return Pl.call(this.children, t); }; } -function Fl(t) { - return this.selectAll(t == null ? Dl : Il(typeof t == "function" ? t : As(t))); +function Il(t) { + return this.selectAll(t == null ? Dl : Fl(typeof t == "function" ? t : As(t))); } -function ql(t) { +function Ll(t) { typeof t != "function" && (t = $s(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, l = r[i] = [], o, f = 0; f < a; ++f) - (o = s[f]) && t.call(o, o.__data__, f, s) && l.push(o); - return new xt(r, this._parents); + for (var s = e[i], a = s.length, l = r[i] = [], u, f = 0; f < a; ++f) + (u = s[f]) && t.call(u, u.__data__, f, s) && l.push(u); + return new $t(r, this._parents); } -function Es(t) { +function Rs(t) { return new Array(t.length); } -function Ll() { - return new xt(this._enter || this._groups.map(Es), this._parents); +function ql() { + return new $t(this._enter || this._groups.map(Rs), this._parents); } -function Hn(t, e) { +function Un(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -Hn.prototype = { - constructor: Hn, +Un.prototype = { + constructor: Un, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -1962,58 +1962,58 @@ function Vl(t) { return t; }; } -function Hl(t, e, n, r, i, s) { - for (var a = 0, l, o = e.length, f = s.length; a < f; ++a) - (l = e[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new Hn(t, s[a]); - for (; a < o; ++a) +function Bl(t, e, n, r, i, s) { + for (var a = 0, l, u = e.length, f = s.length; a < f; ++a) + (l = e[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new Un(t, s[a]); + for (; a < u; ++a) (l = e[a]) && (i[a] = l); } -function Yl(t, e, n, r, i, s, a) { - var l, o, f = /* @__PURE__ */ new Map(), u = e.length, h = s.length, c = new Array(u), d; - for (l = 0; l < u; ++l) - (o = e[l]) && (c[l] = d = a.call(o, o.__data__, l, e) + "", f.has(d) ? i[l] = o : f.set(d, o)); +function Hl(t, e, n, r, i, s, a) { + var l, u, f = /* @__PURE__ */ new Map(), o = e.length, h = s.length, c = new Array(o), d; + for (l = 0; l < o; ++l) + (u = e[l]) && (c[l] = d = a.call(u, u.__data__, l, e) + "", f.has(d) ? i[l] = u : f.set(d, u)); for (l = 0; l < h; ++l) - d = a.call(t, s[l], l, s) + "", (o = f.get(d)) ? (r[l] = o, o.__data__ = s[l], f.delete(d)) : n[l] = new Hn(t, s[l]); - for (l = 0; l < u; ++l) - (o = e[l]) && f.get(c[l]) === o && (i[l] = o); + d = a.call(t, s[l], l, s) + "", (u = f.get(d)) ? (r[l] = u, u.__data__ = s[l], f.delete(d)) : n[l] = new Un(t, s[l]); + for (l = 0; l < o; ++l) + (u = e[l]) && f.get(c[l]) === u && (i[l] = u); } -function Bl(t) { +function Yl(t) { return t.__data__; } function zl(t, e) { - if (!arguments.length) return Array.from(this, Bl); - var n = e ? Yl : Hl, r = this._parents, i = this._groups; + if (!arguments.length) return Array.from(this, Yl); + var n = e ? Hl : Bl, r = this._parents, i = this._groups; typeof t != "function" && (t = Vl(t)); - for (var s = i.length, a = new Array(s), l = new Array(s), o = new Array(s), f = 0; f < s; ++f) { - var u = r[f], h = i[f], c = h.length, d = Xl(t.call(u, u && u.__data__, f, r)), p = d.length, w = l[f] = new Array(p), $ = a[f] = new Array(p), m = o[f] = new Array(c); - n(u, h, w, $, m, d, e); - for (var A = 0, C = 0, M, R; A < p; ++A) - if (M = w[A]) { - for (A >= C && (C = A + 1); !(R = $[C]) && ++C < p; ) ; - M._next = R || null; + for (var s = i.length, a = new Array(s), l = new Array(s), u = new Array(s), f = 0; f < s; ++f) { + var o = r[f], h = i[f], c = h.length, d = Ul(t.call(o, o && o.__data__, f, r)), p = d.length, y = l[f] = new Array(p), R = a[f] = new Array(p), _ = u[f] = new Array(c); + n(o, h, y, R, _, d, e); + for (var $ = 0, T = 0, M, b; $ < p; ++$) + if (M = y[$]) { + for ($ >= T && (T = $ + 1); !(b = R[T]) && ++T < p; ) ; + M._next = b || null; } } - return a = new xt(a, r), a._enter = l, a._exit = o, a; + return a = new $t(a, r), a._enter = l, a._exit = u, a; } -function Xl(t) { +function Ul(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function Ul() { - return new xt(this._exit || this._groups.map(Es), this._parents); +function jl() { + return new $t(this._exit || this._groups.map(Rs), this._parents); } -function Gl(t, e, n) { +function Xl(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 Kl(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), l = new Array(i), o = 0; o < a; ++o) - for (var f = n[o], u = r[o], h = f.length, c = l[o] = new Array(h), d, p = 0; p < h; ++p) - (d = f[p] || u[p]) && (c[p] = d); - for (; o < i; ++o) - l[o] = n[o]; - return new xt(l, this._parents); +function Gl(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), l = new Array(i), u = 0; u < a; ++u) + for (var f = n[u], o = r[u], h = f.length, c = l[u] = new Array(h), d, p = 0; p < h; ++p) + (d = f[p] || o[p]) && (c[p] = d); + for (; u < i; ++u) + l[u] = n[u]; + return new $t(l, this._parents); } -function jl() { +function Kl() { 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); @@ -2025,11 +2025,11 @@ function Wl(t) { 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], l = a.length, o = i[s] = new Array(l), f, u = 0; u < l; ++u) - (f = a[u]) && (o[u] = f); - o.sort(e); + for (var a = n[s], l = a.length, u = i[s] = new Array(l), f, o = 0; o < l; ++o) + (f = a[o]) && (u[o] = f); + u.sort(e); } - return new xt(i, this._parents).order(); + return new $t(i, this._parents).order(); } function Jl(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; @@ -2096,14 +2096,14 @@ function uo(t, e) { }; } function fo(t, e) { - var n = rr(t); + var n = ir(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 ? so : io : typeof e == "function" ? n.local ? uo : oo : n.local ? lo : ao)(n, e)); } -function Rs(t) { +function Es(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function co(t) { @@ -2123,17 +2123,17 @@ function vo(t, e, n) { }; } function po(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? co : typeof e == "function" ? vo : ho)(t, e, n ?? "")) : Oe(this.node(), t); + return arguments.length > 1 ? this.each((e == null ? co : typeof e == "function" ? vo : ho)(t, e, n ?? "")) : Ie(this.node(), t); } -function Oe(t, e) { - return t.style.getPropertyValue(e) || Rs(t).getComputedStyle(t, null).getPropertyValue(e); +function Ie(t, e) { + return t.style.getPropertyValue(e) || Es(t).getComputedStyle(t, null).getPropertyValue(e); } -function _o(t) { +function go(t) { return function() { delete this[t]; }; } -function go(t, e) { +function _o(t, e) { return function() { this[t] = e; }; @@ -2145,7 +2145,7 @@ function mo(t, e) { }; } function yo(t, e) { - return arguments.length > 1 ? this.each((e == null ? _o : typeof e == "function" ? mo : go)(t, e)) : this.node()[t]; + return arguments.length > 1 ? this.each((e == null ? go : typeof e == "function" ? mo : _o)(t, e)) : this.node()[t]; } function Cs(t) { return t.trim().split(/^|\s+/); @@ -2201,19 +2201,19 @@ function $o(t, e) { function Ao() { this.textContent = ""; } -function Eo(t) { +function Ro(t) { return function() { this.textContent = t; }; } -function Ro(t) { +function Eo(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } function Co(t) { - return arguments.length ? this.each(t == null ? Ao : (typeof t == "function" ? Ro : Eo)(t)) : this.node().textContent; + return arguments.length ? this.each(t == null ? Ao : (typeof t == "function" ? Eo : Ro)(t)) : this.node().textContent; } function No() { this.innerHTML = ""; @@ -2235,63 +2235,63 @@ function ko(t) { function Mo() { this.nextSibling && this.parentNode.appendChild(this); } -function Po() { +function Oo() { return this.each(Mo); } -function Oo() { +function Po() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function Do() { - return this.each(Oo); + return this.each(Po); } -function Io(t) { +function Fo(t) { var e = typeof t == "function" ? t : xs(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function Fo() { +function Io() { return null; } -function qo(t, e) { - var n = typeof t == "function" ? t : xs(t), r = e == null ? Fo : typeof e == "function" ? e : Jr(e); +function Lo(t, e) { + var n = typeof t == "function" ? t : xs(t), r = e == null ? Io : typeof e == "function" ? e : Jr(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function Lo() { +function qo() { var t = this.parentNode; t && t.removeChild(this); } function Vo() { - return this.each(Lo); + return this.each(qo); } -function Ho() { +function Bo() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function Yo() { +function Ho() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function Bo(t) { - return this.select(t ? Yo : Ho); +function Yo(t) { + return this.select(t ? Ho : Bo); } function zo(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } -function Xo(t) { +function Uo(t) { return function(e) { t.call(this, e, this.__data__); }; } -function Uo(t) { +function jo(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 Go(t) { +function Xo(t) { return function() { var e = this.__on; if (e) { @@ -2301,9 +2301,9 @@ function Go(t) { } }; } -function Ko(t, e, n) { +function Go(t, e, n) { return function() { - var r = this.__on, i, s = Xo(e); + var r = this.__on, i, s = Uo(e); if (r) { for (var a = 0, l = r.length; a < l; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { @@ -2314,23 +2314,23 @@ function Ko(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 jo(t, e, n) { - var r = Uo(t + ""), i, s = r.length, a; +function Ko(t, e, n) { + var r = jo(t + ""), i, s = r.length, a; if (arguments.length < 2) { var l = this.node().__on; if (l) { - for (var o = 0, f = l.length, u; o < f; ++o) - for (i = 0, u = l[o]; i < s; ++i) - if ((a = r[i]).type === u.type && a.name === u.name) - return u.value; + for (var u = 0, f = l.length, o; u < f; ++u) + for (i = 0, o = l[u]; i < s; ++i) + if ((a = r[i]).type === o.type && a.name === o.name) + return o.value; } return; } - for (l = e ? Ko : Go, i = 0; i < s; ++i) this.each(l(r[i], e, n)); + for (l = e ? Go : Xo, i = 0; i < s; ++i) this.each(l(r[i], e, n)); return this; } function ks(t, e, n) { - var r = Rs(t), i = r.CustomEvent; + var r = Es(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 Wo(t, e) { @@ -2352,29 +2352,29 @@ function* Qo() { (a = r[i]) && (yield a); } var Ms = [null]; -function xt(t, e) { +function $t(t, e) { this._groups = t, this._parents = e; } -function Ve() { - return new xt([[document.documentElement]], Ms); +function Ye() { + return new $t([[document.documentElement]], Ms); } function tu() { return this; } -xt.prototype = Ve.prototype = { - constructor: xt, - select: El, +$t.prototype = Ye.prototype = { + constructor: $t, + select: Rl, selectAll: Tl, - selectChild: Pl, - selectChildren: Fl, - filter: ql, + selectChild: Ol, + selectChildren: Il, + filter: Ll, data: zl, - enter: Ll, - exit: Ul, - join: Gl, - merge: Kl, + enter: ql, + exit: jl, + join: Xl, + merge: Gl, selection: tu, - order: jl, + order: Kl, sort: Wl, call: Zl, nodes: Ql, @@ -2388,31 +2388,31 @@ xt.prototype = Ve.prototype = { classed: $o, text: Co, html: ko, - raise: Po, + raise: Oo, lower: Do, - append: Io, - insert: qo, + append: Fo, + insert: Lo, remove: Vo, - clone: Bo, + clone: Yo, datum: zo, - on: jo, + on: Ko, dispatch: Zo, [Symbol.iterator]: Qo }; -function st(t) { - return typeof t == "string" ? new xt([[document.querySelector(t)]], [document.documentElement]) : new xt([[t]], Ms); +function at(t) { + return typeof t == "string" ? new $t([[document.querySelector(t)]], [document.documentElement]) : new $t([[t]], Ms); } function Qr(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } -function Ps(t, e) { +function Os(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } -function an() { +function on() { } -var tn = 0.7, Yn = 1 / tn, ke = "\\s*([+-]?\\d+)\\s*", en = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Xt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", eu = /^#([0-9a-f]{3,8})$/, nu = new RegExp(`^rgb\\(${ke},${ke},${ke}\\)$`), ru = new RegExp(`^rgb\\(${Xt},${Xt},${Xt}\\)$`), iu = new RegExp(`^rgba\\(${ke},${ke},${ke},${en}\\)$`), su = new RegExp(`^rgba\\(${Xt},${Xt},${Xt},${en}\\)$`), au = new RegExp(`^hsl\\(${en},${Xt},${Xt}\\)$`), lu = new RegExp(`^hsla\\(${en},${Xt},${Xt},${en}\\)$`), $i = { +var nn = 0.7, jn = 1 / nn, Pe = "\\s*([+-]?\\d+)\\s*", rn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", jt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", eu = /^#([0-9a-f]{3,8})$/, nu = new RegExp(`^rgb\\(${Pe},${Pe},${Pe}\\)$`), ru = new RegExp(`^rgb\\(${jt},${jt},${jt}\\)$`), iu = new RegExp(`^rgba\\(${Pe},${Pe},${Pe},${rn}\\)$`), su = new RegExp(`^rgba\\(${jt},${jt},${jt},${rn}\\)$`), au = new RegExp(`^hsl\\(${rn},${jt},${jt}\\)$`), lu = new RegExp(`^hsla\\(${rn},${jt},${jt},${rn}\\)$`), $i = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -2562,7 +2562,7 @@ var tn = 0.7, Yn = 1 / tn, ke = "\\s*([+-]?\\d+)\\s*", en = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Qr(an, Ae, { +Qr(on, Ee, { copy(t) { return Object.assign(new this.constructor(), this, t); }, @@ -2574,8 +2574,8 @@ Qr(an, Ae, { formatHex: Ai, formatHex8: ou, formatHsl: uu, - formatRgb: Ei, - toString: Ei + formatRgb: Ri, + toString: Ri }); function Ai() { return this.rgb().formatHex(); @@ -2584,42 +2584,42 @@ function ou() { return this.rgb().formatHex8(); } function uu() { - return Os(this).formatHsl(); + return Ps(this).formatHsl(); } -function Ei() { +function Ri() { return this.rgb().formatRgb(); } -function Ae(t) { +function Ee(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = eu.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ri(e) : n === 3 ? new vt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? _n(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? _n(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 = nu.exec(t)) ? new vt(e[1], e[2], e[3], 1) : (e = ru.exec(t)) ? new vt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = iu.exec(t)) ? _n(e[1], e[2], e[3], e[4]) : (e = su.exec(t)) ? _n(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = au.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, 1) : (e = lu.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, e[4]) : $i.hasOwnProperty(t) ? Ri($i[t]) : t === "transparent" ? new vt(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = eu.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ei(e) : n === 3 ? new vt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? wn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? wn(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 = nu.exec(t)) ? new vt(e[1], e[2], e[3], 1) : (e = ru.exec(t)) ? new vt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = iu.exec(t)) ? wn(e[1], e[2], e[3], e[4]) : (e = su.exec(t)) ? wn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = au.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, 1) : (e = lu.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, e[4]) : $i.hasOwnProperty(t) ? Ei($i[t]) : t === "transparent" ? new vt(NaN, NaN, NaN, 0) : null; } -function Ri(t) { +function Ei(t) { return new vt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function _n(t, e, n, r) { +function wn(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new vt(t, e, n, r); } function fu(t) { - return t instanceof an || (t = Ae(t)), t ? (t = t.rgb(), new vt(t.r, t.g, t.b, t.opacity)) : new vt(); + return t instanceof on || (t = Ee(t)), t ? (t = t.rgb(), new vt(t.r, t.g, t.b, t.opacity)) : new vt(); } -function Ar(t, e, n, r) { +function Rr(t, e, n, r) { return arguments.length === 1 ? fu(t) : new vt(t, e, n, r ?? 1); } function vt(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -Qr(vt, Ar, Ps(an, { +Qr(vt, Rr, Os(on, { brighter(t) { - return t = t == null ? Yn : Math.pow(Yn, t), new vt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? jn : Math.pow(jn, t), new vt(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? tn : Math.pow(tn, t), new vt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? nn : Math.pow(nn, t), new vt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new vt(be(this.r), be(this.g), be(this.b), Bn(this.opacity)); + return new vt(Ae(this.r), Ae(this.g), Ae(this.b), Xn(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; @@ -2632,75 +2632,75 @@ Qr(vt, Ar, Ps(an, { toString: Ni })); function Ci() { - return `#${we(this.r)}${we(this.g)}${we(this.b)}`; + return `#${be(this.r)}${be(this.g)}${be(this.b)}`; } function cu() { - return `#${we(this.r)}${we(this.g)}${we(this.b)}${we((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; + return `#${be(this.r)}${be(this.g)}${be(this.b)}${be((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Ni() { - const t = Bn(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${be(this.r)}, ${be(this.g)}, ${be(this.b)}${t === 1 ? ")" : `, ${t})`}`; + const t = Xn(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${Ae(this.r)}, ${Ae(this.g)}, ${Ae(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function Bn(t) { +function Xn(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function be(t) { +function Ae(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function we(t) { - return t = be(t), (t < 16 ? "0" : "") + t.toString(16); +function be(t) { + return t = Ae(t), (t < 16 ? "0" : "") + t.toString(16); } function Ti(t, e, n, r) { return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Pt(t, e, n, r); } -function Os(t) { +function Ps(t) { if (t instanceof Pt) return new Pt(t.h, t.s, t.l, t.opacity); - if (t instanceof an || (t = Ae(t)), !t) return new Pt(); + if (t instanceof on || (t = Ee(t)), !t) return new Pt(); if (t instanceof Pt) 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, l = s - i, o = (s + i) / 2; - return l ? (e === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - e) / l + 2 : a = (e - n) / l + 4, l /= o < 0.5 ? s + i : 2 - s - i, a *= 60) : l = o > 0 && o < 1 ? 0 : a, new Pt(a, l, o, t.opacity); + 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, l = s - i, u = (s + i) / 2; + return l ? (e === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - e) / l + 2 : a = (e - n) / l + 4, l /= u < 0.5 ? s + i : 2 - s - i, a *= 60) : l = u > 0 && u < 1 ? 0 : a, new Pt(a, l, u, t.opacity); } function hu(t, e, n, r) { - return arguments.length === 1 ? Os(t) : new Pt(t, e, n, r ?? 1); + return arguments.length === 1 ? Ps(t) : new Pt(t, e, n, r ?? 1); } function Pt(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -Qr(Pt, hu, Ps(an, { +Qr(Pt, hu, Os(on, { brighter(t) { - return t = t == null ? Yn : Math.pow(Yn, t), new Pt(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? jn : Math.pow(jn, t), new Pt(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? tn : Math.pow(tn, t), new Pt(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? nn : Math.pow(nn, t), new Pt(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 vt( - vr(t >= 240 ? t - 240 : t + 120, i, r), - vr(t, i, r), - vr(t < 120 ? t + 240 : t - 120, i, r), + pr(t >= 240 ? t - 240 : t + 120, i, r), + pr(t, i, r), + pr(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new Pt(Si(this.h), gn(this.s), gn(this.l), Bn(this.opacity)); + return new Pt(Si(this.h), xn(this.s), xn(this.l), Xn(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 = Bn(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${Si(this.h)}, ${gn(this.s) * 100}%, ${gn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = Xn(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${Si(this.h)}, ${xn(this.s) * 100}%, ${xn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function Si(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function gn(t) { +function xn(t) { return Math.max(0, Math.min(1, t || 0)); } -function vr(t, e, n) { +function pr(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 ti = (t) => () => t; @@ -2723,17 +2723,17 @@ function Ds(t, e) { var n = e - t; return n ? du(t, n) : ti(isNaN(t) ? e : t); } -const zn = function t(e) { +const Gn = function t(e) { var n = pu(e); function r(i, s) { - var a = n((i = Ar(i)).r, (s = Ar(s)).r), l = n(i.g, s.g), o = n(i.b, s.b), f = Ds(i.opacity, s.opacity); - return function(u) { - return i.r = a(u), i.g = l(u), i.b = o(u), i.opacity = f(u), i + ""; + var a = n((i = Rr(i)).r, (s = Rr(s)).r), l = n(i.g, s.g), u = n(i.b, s.b), f = Ds(i.opacity, s.opacity); + return function(o) { + return i.r = a(o), i.g = l(o), i.b = u(o), i.opacity = f(o), i + ""; }; } return r.gamma = t, r; }(1); -function _u(t, e) { +function gu(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { @@ -2741,12 +2741,12 @@ function _u(t, e) { return r; }; } -function gu(t) { +function _u(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } function mu(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] = Te(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = Me(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; return function(l) { for (a = 0; a < r; ++a) s[a] = i[a](l); @@ -2759,7 +2759,7 @@ function yu(t, e) { return n.setTime(t * (1 - r) + e * r), n; }; } -function Bt(t, e) { +function zt(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; @@ -2768,13 +2768,13 @@ function wu(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] = Te(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = Me(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var Er = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, pr = new RegExp(Er.source, "g"); +var Er = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, gr = new RegExp(Er.source, "g"); function xu(t) { return function() { return t; @@ -2785,20 +2785,20 @@ function bu(t) { return t(e) + ""; }; } -function Is(t, e) { - var n = Er.lastIndex = pr.lastIndex = 0, r, i, s, a = -1, l = [], o = []; - for (t = t + "", e = e + ""; (r = Er.exec(t)) && (i = pr.exec(e)); ) - (s = i.index) > n && (s = e.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: Bt(r, i) })), n = pr.lastIndex; - return n < e.length && (s = e.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? o[0] ? bu(o[0].x) : xu(e) : (e = o.length, function(f) { - for (var u = 0, h; u < e; ++u) l[(h = o[u]).i] = h.x(f); +function Fs(t, e) { + var n = Er.lastIndex = gr.lastIndex = 0, r, i, s, a = -1, l = [], u = []; + for (t = t + "", e = e + ""; (r = Er.exec(t)) && (i = gr.exec(e)); ) + (s = i.index) > n && (s = e.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, u.push({ i: a, x: zt(r, i) })), n = gr.lastIndex; + return n < e.length && (s = e.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? u[0] ? bu(u[0].x) : xu(e) : (e = u.length, function(f) { + for (var o = 0, h; o < e; ++o) l[(h = u[o]).i] = h.x(f); return l.join(""); }); } -function Te(t, e) { +function Me(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? ti(e) : (n === "number" ? Bt : n === "string" ? (r = Ae(e)) ? (e = r, zn) : Is : e instanceof Ae ? zn : e instanceof Date ? yu : gu(e) ? _u : Array.isArray(e) ? mu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? wu : Bt)(t, e); + return e == null || n === "boolean" ? ti(e) : (n === "number" ? zt : n === "string" ? (r = Ee(e)) ? (e = r, Gn) : Fs : e instanceof Ee ? Gn : e instanceof Date ? yu : _u(e) ? gu : Array.isArray(e) ? mu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? wu : zt)(t, e); } -var ki = 180 / Math.PI, Rr = { +var ki = 180 / Math.PI, Cr = { translateX: 0, translateY: 0, rotate: 0, @@ -2806,123 +2806,123 @@ var ki = 180 / Math.PI, Rr = { scaleX: 1, scaleY: 1 }; -function Fs(t, e, n, r, i, s) { - var a, l, o; - return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (o = t * n + e * r) && (n -= t * o, r -= e * o), (l = Math.sqrt(n * n + r * r)) && (n /= l, r /= l, o /= l), t * r < e * n && (t = -t, e = -e, o = -o, a = -a), { +function Is(t, e, n, r, i, s) { + var a, l, u; + return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (u = t * n + e * r) && (n -= t * u, r -= e * u), (l = Math.sqrt(n * n + r * r)) && (n /= l, r /= l, u /= l), t * r < e * n && (t = -t, e = -e, u = -u, a = -a), { translateX: i, translateY: s, rotate: Math.atan2(e, t) * ki, - skewX: Math.atan(o) * ki, + skewX: Math.atan(u) * ki, scaleX: a, scaleY: l }; } -var mn; +var bn; function $u(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? Rr : Fs(e.a, e.b, e.c, e.d, e.e, e.f); + return e.isIdentity ? Cr : Is(e.a, e.b, e.c, e.d, e.e, e.f); } function Au(t) { - return t == null || (mn || (mn = document.createElementNS("http://www.w3.org/2000/svg", "g")), mn.setAttribute("transform", t), !(t = mn.transform.baseVal.consolidate())) ? Rr : (t = t.matrix, Fs(t.a, t.b, t.c, t.d, t.e, t.f)); + return t == null || (bn || (bn = document.createElementNS("http://www.w3.org/2000/svg", "g")), bn.setAttribute("transform", t), !(t = bn.transform.baseVal.consolidate())) ? Cr : (t = t.matrix, Is(t.a, t.b, t.c, t.d, t.e, t.f)); } -function qs(t, e, n, r) { +function Ls(t, e, n, r) { function i(f) { return f.length ? f.pop() + " " : ""; } - function s(f, u, h, c, d, p) { - if (f !== h || u !== c) { - var w = d.push("translate(", null, e, null, n); - p.push({ i: w - 4, x: Bt(f, h) }, { i: w - 2, x: Bt(u, c) }); + function s(f, o, h, c, d, p) { + if (f !== h || o !== c) { + var y = d.push("translate(", null, e, null, n); + p.push({ i: y - 4, x: zt(f, h) }, { i: y - 2, x: zt(o, c) }); } else (h || c) && d.push("translate(" + h + e + c + n); } - function a(f, u, h, c) { - f !== u ? (f - u > 180 ? u += 360 : u - f > 180 && (f += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Bt(f, u) })) : u && h.push(i(h) + "rotate(" + u + r); + function a(f, o, h, c) { + f !== o ? (f - o > 180 ? o += 360 : o - f > 180 && (f += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: zt(f, o) })) : o && h.push(i(h) + "rotate(" + o + r); } - function l(f, u, h, c) { - f !== u ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Bt(f, u) }) : u && h.push(i(h) + "skewX(" + u + r); + function l(f, o, h, c) { + f !== o ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: zt(f, o) }) : o && h.push(i(h) + "skewX(" + o + r); } - function o(f, u, h, c, d, p) { - if (f !== h || u !== c) { - var w = d.push(i(d) + "scale(", null, ",", null, ")"); - p.push({ i: w - 4, x: Bt(f, h) }, { i: w - 2, x: Bt(u, c) }); + function u(f, o, h, c, d, p) { + if (f !== h || o !== c) { + var y = d.push(i(d) + "scale(", null, ",", null, ")"); + p.push({ i: y - 4, x: zt(f, h) }, { i: y - 2, x: zt(o, c) }); } else (h !== 1 || c !== 1) && d.push(i(d) + "scale(" + h + "," + c + ")"); } - return function(f, u) { + return function(f, o) { var h = [], c = []; - return f = t(f), u = t(u), s(f.translateX, f.translateY, u.translateX, u.translateY, h, c), a(f.rotate, u.rotate, h, c), l(f.skewX, u.skewX, h, c), o(f.scaleX, f.scaleY, u.scaleX, u.scaleY, h, c), f = u = null, function(d) { - for (var p = -1, w = c.length, $; ++p < w; ) h[($ = c[p]).i] = $.x(d); + return f = t(f), o = t(o), s(f.translateX, f.translateY, o.translateX, o.translateY, h, c), a(f.rotate, o.rotate, h, c), l(f.skewX, o.skewX, h, c), u(f.scaleX, f.scaleY, o.scaleX, o.scaleY, h, c), f = o = null, function(d) { + for (var p = -1, y = c.length, R; ++p < y; ) h[(R = c[p]).i] = R.x(d); return h.join(""); }; }; } -var Eu = qs($u, "px, ", "px)", "deg)"), Ru = qs(Au, ", ", ")", ")"), De = 0, Xe = 0, ze = 0, Ls = 1e3, Xn, Ue, Un = 0, Ee = 0, ir = 0, nn = typeof performance == "object" && performance.now ? performance : Date, Vs = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Ru = Ls($u, "px, ", "px)", "deg)"), Eu = Ls(Au, ", ", ")", ")"), Le = 0, Xe = 0, je = 0, qs = 1e3, Kn, Ge, Wn = 0, Ce = 0, sr = 0, sn = typeof performance == "object" && performance.now ? performance : Date, Vs = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function ei() { - return Ee || (Vs(Cu), Ee = nn.now() + ir); + return Ce || (Vs(Cu), Ce = sn.now() + sr); } function Cu() { - Ee = 0; + Ce = 0; } -function Gn() { +function Jn() { this._call = this._time = this._next = null; } -Gn.prototype = Hs.prototype = { - constructor: Gn, +Jn.prototype = Bs.prototype = { + constructor: Jn, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? ei() : +n) + (e == null ? 0 : +e), !this._next && Ue !== this && (Ue ? Ue._next = this : Xn = this, Ue = this), this._call = t, this._time = n, Cr(); + n = (n == null ? ei() : +n) + (e == null ? 0 : +e), !this._next && Ge !== this && (Ge ? Ge._next = this : Kn = this, Ge = this), this._call = t, this._time = n, Nr(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, Cr()); + this._call && (this._call = null, this._time = 1 / 0, Nr()); } }; -function Hs(t, e, n) { - var r = new Gn(); +function Bs(t, e, n) { + var r = new Jn(); return r.restart(t, e, n), r; } function Nu() { - ei(), ++De; - for (var t = Xn, e; t; ) - (e = Ee - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --De; + ei(), ++Le; + for (var t = Kn, e; t; ) + (e = Ce - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --Le; } function Mi() { - Ee = (Un = nn.now()) + ir, De = Xe = 0; + Ce = (Wn = sn.now()) + sr, Le = Xe = 0; try { Nu(); } finally { - De = 0, Su(), Ee = 0; + Le = 0, Su(), Ce = 0; } } function Tu() { - var t = nn.now(), e = t - Un; - e > Ls && (ir -= e, Un = t); + var t = sn.now(), e = t - Wn; + e > qs && (sr -= e, Wn = t); } function Su() { - for (var t, e = Xn, 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 : Xn = n); - Ue = t, Cr(r); + for (var t, e = Kn, 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 : Kn = n); + Ge = t, Nr(r); } -function Cr(t) { - if (!De) { +function Nr(t) { + if (!Le) { Xe && (Xe = clearTimeout(Xe)); - var e = t - Ee; - e > 24 ? (t < 1 / 0 && (Xe = setTimeout(Mi, t - nn.now() - ir)), ze && (ze = clearInterval(ze))) : (ze || (Un = nn.now(), ze = setInterval(Tu, Ls)), De = 1, Vs(Mi)); + var e = t - Ce; + e > 24 ? (t < 1 / 0 && (Xe = setTimeout(Mi, t - sn.now() - sr)), je && (je = clearInterval(je))) : (je || (Wn = sn.now(), je = setInterval(Tu, qs)), Le = 1, Vs(Mi)); } } -function Pi(t, e, n) { - var r = new Gn(); +function Oi(t, e, n) { + var r = new Jn(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var ku = ws("start", "end", "cancel", "interrupt"), Mu = [], Ys = 0, Oi = 1, Nr = 2, En = 3, Di = 4, Tr = 5, Rn = 6; -function sr(t, e, n, r, i, s) { +var ku = ws("start", "end", "cancel", "interrupt"), Mu = [], Hs = 0, Pi = 1, Tr = 2, Tn = 3, Di = 4, Sr = 5, Sn = 6; +function ar(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - Pu(t, n, { + Ou(t, n, { name: e, index: r, // For context during callback. @@ -2935,58 +2935,58 @@ function sr(t, e, n, r, i, s) { duration: s.duration, ease: s.ease, timer: null, - state: Ys + state: Hs }); } function ni(t, e) { - var n = Dt(t, e); - if (n.state > Ys) throw new Error("too late; already scheduled"); + var n = Ft(t, e); + if (n.state > Hs) throw new Error("too late; already scheduled"); return n; } function Gt(t, e) { - var n = Dt(t, e); - if (n.state > En) throw new Error("too late; already running"); + var n = Ft(t, e); + if (n.state > Tn) throw new Error("too late; already running"); return n; } -function Dt(t, e) { +function Ft(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Pu(t, e, n) { +function Ou(t, e, n) { var r = t.__transition, i; - r[e] = n, n.timer = Hs(s, 0, n.time); + r[e] = n, n.timer = Bs(s, 0, n.time); function s(f) { - n.state = Oi, n.timer.restart(a, n.delay, n.time), n.delay <= f && a(f - n.delay); + n.state = Pi, n.timer.restart(a, n.delay, n.time), n.delay <= f && a(f - n.delay); } function a(f) { - var u, h, c, d; - if (n.state !== Oi) return o(); - for (u in r) - if (d = r[u], d.name === n.name) { - if (d.state === En) return Pi(a); - d.state === Di ? (d.state = Rn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[u]) : +u < e && (d.state = Rn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[u]); + var o, h, c, d; + if (n.state !== Pi) return u(); + for (o in r) + if (d = r[o], d.name === n.name) { + if (d.state === Tn) return Oi(a); + d.state === Di ? (d.state = Sn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[o]) : +o < e && (d.state = Sn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[o]); } - if (Pi(function() { - n.state === En && (n.state = Di, n.timer.restart(l, n.delay, n.time), l(f)); - }), n.state = Nr, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Nr) { - for (n.state = En, i = new Array(c = n.tween.length), u = 0, h = -1; u < c; ++u) - (d = n.tween[u].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d); + if (Oi(function() { + n.state === Tn && (n.state = Di, n.timer.restart(l, n.delay, n.time), l(f)); + }), n.state = Tr, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Tr) { + for (n.state = Tn, i = new Array(c = n.tween.length), o = 0, h = -1; o < c; ++o) + (d = n.tween[o].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d); i.length = h + 1; } } function l(f) { - for (var u = f < n.duration ? n.ease.call(null, f / n.duration) : (n.timer.restart(o), n.state = Tr, 1), h = -1, c = i.length; ++h < c; ) - i[h].call(t, u); - n.state === Tr && (n.on.call("end", t, t.__data__, n.index, n.group), o()); + for (var o = f < n.duration ? n.ease.call(null, f / n.duration) : (n.timer.restart(u), n.state = Sr, 1), h = -1, c = i.length; ++h < c; ) + i[h].call(t, o); + n.state === Sr && (n.on.call("end", t, t.__data__, n.index, n.group), u()); } - function o() { - n.state = Rn, n.timer.stop(), delete r[e]; + function u() { + n.state = Sn, n.timer.stop(), delete r[e]; for (var f in r) return; delete t.__transition; } } -function Ou(t, e) { +function Pu(t, e) { var n = t.__transition, r, i, s = !0, a; if (n) { e = e == null ? null : e + ""; @@ -2995,17 +2995,17 @@ function Ou(t, e) { s = !1; continue; } - i = r.state > Nr && r.state < Tr, r.state = Rn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > Tr && r.state < Sr, r.state = Sn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } function Du(t) { return this.each(function() { - Ou(this, t); + Pu(this, t); }); } -function Iu(t, e) { +function Fu(t, e) { var n, r; return function() { var i = Gt(this, t), s = i.tween; @@ -3020,32 +3020,32 @@ function Iu(t, e) { i.tween = r; }; } -function Fu(t, e, n) { +function Iu(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { var s = Gt(this, t), a = s.tween; if (a !== r) { i = (r = a).slice(); - for (var l = { name: e, value: n }, o = 0, f = i.length; o < f; ++o) - if (i[o].name === e) { - i[o] = l; + for (var l = { name: e, value: n }, u = 0, f = i.length; u < f; ++u) + if (i[u].name === e) { + i[u] = l; break; } - o === f && i.push(l); + u === f && i.push(l); } s.tween = i; }; } -function qu(t, e) { +function Lu(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = Dt(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = Ft(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 ? Iu : Fu)(n, t, e)); + return this.each((e == null ? Fu : Iu)(n, t, e)); } function ri(t, e, n) { var r = t._id; @@ -3053,14 +3053,14 @@ function ri(t, e, n) { var i = Gt(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return Dt(i, r).value[e]; + return Ft(i, r).value[e]; }; } -function Bs(t, e) { +function Ys(t, e) { var n; - return (typeof e == "number" ? Bt : e instanceof Ae ? zn : (n = Ae(e)) ? (e = n, zn) : Is)(t, e); + return (typeof e == "number" ? zt : e instanceof Ee ? Gn : (n = Ee(e)) ? (e = n, Gn) : Fs)(t, e); } -function Lu(t) { +function qu(t) { return function() { this.removeAttribute(t); }; @@ -3070,61 +3070,61 @@ function Vu(t) { this.removeAttributeNS(t.space, t.local); }; } -function Hu(t, e, n) { +function Bu(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 Yu(t, e, n) { +function Hu(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 Bu(t, e, n) { +function Yu(t, e, n) { var r, i, s; return function() { - var a, l = n(this), o; - return l == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l))); + var a, l = n(this), u; + return l == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), u = l + "", a === u ? null : a === r && u === i ? s : (i = u, s = e(r = a, l))); }; } function zu(t, e, n) { var r, i, s; return function() { - var a, l = n(this), o; - return l == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), o = l + "", a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l))); + var a, l = n(this), u; + return l == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), u = l + "", a === u ? null : a === r && u === i ? s : (i = u, s = e(r = a, l))); }; } -function Xu(t, e) { - var n = rr(t), r = n === "transform" ? Ru : Bs; - return this.attrTween(t, typeof e == "function" ? (n.local ? zu : Bu)(n, r, ri(this, "attr." + t, e)) : e == null ? (n.local ? Vu : Lu)(n) : (n.local ? Yu : Hu)(n, r, e)); -} function Uu(t, e) { + var n = ir(t), r = n === "transform" ? Eu : Ys; + return this.attrTween(t, typeof e == "function" ? (n.local ? zu : Yu)(n, r, ri(this, "attr." + t, e)) : e == null ? (n.local ? Vu : qu)(n) : (n.local ? Hu : Bu)(n, r, e)); +} +function ju(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function Gu(t, e) { +function Xu(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function Ku(t, e) { +function Gu(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Gu(t, s)), n; + return s !== r && (n = (r = s) && Xu(t, s)), n; } return i._value = e, i; } -function ju(t, e) { +function Ku(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Uu(t, s)), n; + return s !== r && (n = (r = s) && ju(t, s)), n; } return i._value = e, i; } @@ -3133,8 +3133,8 @@ function Wu(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 = rr(t); - return this.tween(n, (r.local ? Ku : ju)(r, e)); + var r = ir(t); + return this.tween(n, (r.local ? Gu : Ku)(r, e)); } function Ju(t, e) { return function() { @@ -3148,7 +3148,7 @@ function Zu(t, e) { } function Qu(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Ju : Zu)(e, t)) : Dt(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? Ju : Zu)(e, t)) : Ft(this.node(), e).delay; } function tf(t, e) { return function() { @@ -3162,7 +3162,7 @@ function ef(t, e) { } function nf(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? tf : ef)(e, t)) : Dt(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? tf : ef)(e, t)) : Ft(this.node(), e).duration; } function rf(t, e) { if (typeof e != "function") throw new Error(); @@ -3172,7 +3172,7 @@ function rf(t, e) { } function sf(t) { var e = this._id; - return arguments.length ? this.each(rf(e, t)) : Dt(this.node(), e).ease; + return arguments.length ? this.each(rf(e, t)) : Ft(this.node(), e).ease; } function af(t, e) { return function() { @@ -3188,18 +3188,18 @@ function lf(t) { function of(t) { typeof t != "function" && (t = $s(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, l = r[i] = [], o, f = 0; f < a; ++f) - (o = s[f]) && t.call(o, o.__data__, f, s) && l.push(o); - return new ae(r, this._parents, this._name, this._id); + for (var s = e[i], a = s.length, l = r[i] = [], u, f = 0; f < a; ++f) + (u = s[f]) && t.call(u, u.__data__, f, s) && l.push(u); + return new oe(r, this._parents, this._name, this._id); } function uf(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), l = 0; l < s; ++l) - for (var o = e[l], f = n[l], u = o.length, h = a[l] = new Array(u), c, d = 0; d < u; ++d) - (c = o[d] || f[d]) && (h[d] = c); + for (var u = e[l], f = n[l], o = u.length, h = a[l] = new Array(o), c, d = 0; d < o; ++d) + (c = u[d] || f[d]) && (h[d] = c); for (; l < r; ++l) a[l] = e[l]; - return new ae(a, this._parents, this._name, this._id); + return new oe(a, this._parents, this._name, this._id); } function ff(t) { return (t + "").trim().split(/^|\s+/).every(function(e) { @@ -3216,7 +3216,7 @@ function cf(t, e, n) { } function hf(t, e) { var n = this._id; - return arguments.length < 2 ? Dt(this.node(), n).on.on(t) : this.each(cf(n, t, e)); + return arguments.length < 2 ? Ft(this.node(), n).on.on(t) : this.each(cf(n, t, e)); } function df(t) { return function() { @@ -3232,30 +3232,30 @@ function pf(t) { var e = this._name, n = this._id; typeof t != "function" && (t = Jr(t)); 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, f = s[a] = new Array(o), u, h, c = 0; c < o; ++c) - (u = l[c]) && (h = t.call(u, u.__data__, c, l)) && ("__data__" in u && (h.__data__ = u.__data__), f[c] = h, sr(f[c], e, n, c, f, Dt(u, n))); - return new ae(s, this._parents, e, n); + for (var l = r[a], u = l.length, f = s[a] = new Array(u), o, h, c = 0; c < u; ++c) + (o = l[c]) && (h = t.call(o, o.__data__, c, l)) && ("__data__" in o && (h.__data__ = o.__data__), f[c] = h, ar(f[c], e, n, c, f, Ft(o, n))); + return new oe(s, this._parents, e, n); } -function _f(t) { +function gf(t) { var e = this._name, n = this._id; typeof t != "function" && (t = bs(t)); for (var r = this._groups, i = r.length, s = [], a = [], l = 0; l < i; ++l) - for (var o = r[l], f = o.length, u, h = 0; h < f; ++h) - if (u = o[h]) { - for (var c = t.call(u, u.__data__, h, o), d, p = Dt(u, n), w = 0, $ = c.length; w < $; ++w) - (d = c[w]) && sr(d, e, n, w, c, p); - s.push(c), a.push(u); + for (var u = r[l], f = u.length, o, h = 0; h < f; ++h) + if (o = u[h]) { + for (var c = t.call(o, o.__data__, h, u), d, p = Ft(o, n), y = 0, R = c.length; y < R; ++y) + (d = c[y]) && ar(d, e, n, y, c, p); + s.push(c), a.push(o); } - return new ae(s, a, e, n); + return new oe(s, a, e, n); } -var gf = Ve.prototype.constructor; +var _f = Ye.prototype.constructor; function mf() { - return new gf(this._groups, this._parents); + return new _f(this._groups, this._parents); } function yf(t, e) { var n, r, i; return function() { - var s = Oe(this, t), a = (this.style.removeProperty(t), Oe(this, t)); + var s = Ie(this, t), a = (this.style.removeProperty(t), Ie(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } @@ -3267,26 +3267,26 @@ function zs(t) { function wf(t, e, n) { var r, i = n + "", s; return function() { - var a = Oe(this, t); + var a = Ie(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } function xf(t, e, n) { var r, i, s; return function() { - var a = Oe(this, t), l = n(this), o = l + ""; - return l == null && (o = l = (this.style.removeProperty(t), Oe(this, t))), a === o ? null : a === r && o === i ? s : (i = o, s = e(r = a, l)); + var a = Ie(this, t), l = n(this), u = l + ""; + return l == null && (u = l = (this.style.removeProperty(t), Ie(this, t))), a === u ? null : a === r && u === i ? s : (i = u, s = e(r = a, l)); }; } function bf(t, e) { var n, r, i, s = "style." + e, a = "end." + s, l; return function() { - var o = Gt(this, t), f = o.on, u = o.value[s] == null ? l || (l = zs(e)) : void 0; - (f !== n || i !== u) && (r = (n = f).copy()).on(a, i = u), o.on = r; + var u = Gt(this, t), f = u.on, o = u.value[s] == null ? l || (l = zs(e)) : void 0; + (f !== n || i !== o) && (r = (n = f).copy()).on(a, i = o), u.on = r; }; } function $f(t, e, n) { - var r = (t += "") == "transform" ? Eu : Bs; + var r = (t += "") == "transform" ? Ru : Ys; return e == null ? this.styleTween(t, yf(t, r)).on("end.style." + t, zs(t)) : typeof e == "function" ? this.styleTween(t, xf(t, r, ri(this, "style." + t, e))).each(bf(this._id, t)) : this.styleTween(t, wf(t, r, e), n).on("end.style." + t, null); } function Af(t, e, n) { @@ -3294,7 +3294,7 @@ function Af(t, e, n) { this.style.setProperty(t, e.call(this, r), n); }; } -function Ef(t, e, n) { +function Rf(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); @@ -3302,12 +3302,12 @@ function Ef(t, e, n) { } return s._value = e, s; } -function Rf(t, e, n) { +function Ef(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, Ef(t, e, n ?? "")); + return this.tween(r, Rf(t, e, n ?? "")); } function Cf(t) { return function() { @@ -3343,111 +3343,111 @@ function Mf(t) { if (typeof t != "function") throw new Error(); return this.tween(e, kf(t)); } -function Pf() { - for (var t = this._name, e = this._id, n = Xs(), r = this._groups, i = r.length, s = 0; s < i; ++s) - for (var a = r[s], l = a.length, o, f = 0; f < l; ++f) - if (o = a[f]) { - var u = Dt(o, e); - sr(o, t, n, f, a, { - time: u.time + u.delay + u.duration, +function Of() { + for (var t = this._name, e = this._id, n = Us(), r = this._groups, i = r.length, s = 0; s < i; ++s) + for (var a = r[s], l = a.length, u, f = 0; f < l; ++f) + if (u = a[f]) { + var o = Ft(u, e); + ar(u, t, n, f, a, { + time: o.time + o.delay + o.duration, delay: 0, - duration: u.duration, - ease: u.ease + duration: o.duration, + ease: o.ease }); } - return new ae(r, this._parents, t, n); + return new oe(r, this._parents, t, n); } -function Of() { +function Pf() { var t, e, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { - var l = { value: a }, o = { value: function() { + var l = { value: a }, u = { value: function() { --i === 0 && s(); } }; n.each(function() { - var f = Gt(this, r), u = f.on; - u !== t && (e = (t = u).copy(), e._.cancel.push(l), e._.interrupt.push(l), e._.end.push(o)), f.on = e; + var f = Gt(this, r), o = f.on; + o !== t && (e = (t = o).copy(), e._.cancel.push(l), e._.interrupt.push(l), e._.end.push(u)), f.on = e; }), i === 0 && s(); }); } var Df = 0; -function ae(t, e, n, r) { +function oe(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function Cn(t) { - return Ve().transition(t); +function kn(t) { + return Ye().transition(t); } -function Xs() { +function Us() { return ++Df; } -var Wt = Ve.prototype; -ae.prototype = Cn.prototype = { - constructor: ae, +var Qt = Ye.prototype; +oe.prototype = kn.prototype = { + constructor: oe, select: pf, - selectAll: _f, - selectChild: Wt.selectChild, - selectChildren: Wt.selectChildren, + selectAll: gf, + selectChild: Qt.selectChild, + selectChildren: Qt.selectChildren, filter: of, merge: uf, selection: mf, - transition: Pf, - call: Wt.call, - nodes: Wt.nodes, - node: Wt.node, - size: Wt.size, - empty: Wt.empty, - each: Wt.each, + transition: Of, + call: Qt.call, + nodes: Qt.nodes, + node: Qt.node, + size: Qt.size, + empty: Qt.empty, + each: Qt.each, on: hf, - attr: Xu, + attr: Uu, attrTween: Wu, style: $f, - styleTween: Rf, + styleTween: Ef, text: Tf, textTween: Mf, remove: vf, - tween: qu, + tween: Lu, delay: Qu, duration: nf, ease: sf, easeVarying: lf, - end: Of, - [Symbol.iterator]: Wt[Symbol.iterator] + end: Pf, + [Symbol.iterator]: Qt[Symbol.iterator] }; -function If(t) { +function Ff(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var Ff = { +var If = { time: null, // Set on use. delay: 0, duration: 250, - ease: If + ease: Ff }; -function qf(t, e) { +function Lf(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 Lf(t) { +function qf(t) { var e, n; - t instanceof ae ? (e = t._id, t = t._name) : (e = Xs(), (n = Ff).time = ei(), t = t == null ? null : t + ""); + t instanceof oe ? (e = t._id, t = t._name) : (e = Us(), (n = If).time = ei(), t = t == null ? null : t + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) - for (var a = r[s], l = a.length, o, f = 0; f < l; ++f) - (o = a[f]) && sr(o, t, e, f, a, n || qf(o, e)); - return new ae(r, this._parents, t, e); -} -Ve.prototype.interrupt = Du; -Ve.prototype.transition = Lf; -const Sr = Math.PI, kr = 2 * Sr, ye = 1e-6, Vf = kr - ye; -function Us(t) { + for (var a = r[s], l = a.length, u, f = 0; f < l; ++f) + (u = a[f]) && ar(u, t, e, f, a, n || Lf(u, e)); + return new oe(r, this._parents, t, e); +} +Ye.prototype.interrupt = Du; +Ye.prototype.transition = qf; +const kr = Math.PI, Mr = 2 * kr, xe = 1e-6, Vf = Mr - xe; +function js(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function Hf(t) { +function Bf(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); - if (e > 15) return Us; + if (e > 15) return js; const n = 10 ** e; return function(r) { this._ += r[0]; @@ -3455,10 +3455,10 @@ function Hf(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Yf { +class Hf { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? Us : Hf(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? js : Bf(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -3477,20 +3477,20 @@ class Yf { } 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, l = this._y1, o = r - e, f = i - n, u = a - e, h = l - n, c = u * u + h * h; + let a = this._x1, l = this._y1, u = r - e, f = i - n, o = a - e, h = l - n, c = o * o + h * h; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > ye) if (!(Math.abs(h * o - f * u) > ye) || !s) + else if (c > xe) if (!(Math.abs(h * u - f * o) > xe) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let d = r - a, p = i - l, w = o * o + f * f, $ = d * d + p * p, m = Math.sqrt(w), A = Math.sqrt(c), C = s * Math.tan((Sr - Math.acos((w + c - $) / (2 * m * A))) / 2), M = C / A, R = C / m; - Math.abs(M - 1) > ye && this._append`L${e + M * u},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * d > u * p)},${this._x1 = e + R * o},${this._y1 = n + R * f}`; + let d = r - a, p = i - l, y = u * u + f * f, R = d * d + p * p, _ = Math.sqrt(y), $ = Math.sqrt(c), T = s * Math.tan((kr - Math.acos((y + c - R) / (2 * _ * $))) / 2), M = T / $, b = T / _; + Math.abs(M - 1) > xe && this._append`L${e + M * o},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * d > o * p)},${this._x1 = e + b * u},${this._y1 = n + b * f}`; } } 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 l = r * Math.cos(i), o = r * Math.sin(i), f = e + l, u = n + o, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${f},${u}` : (Math.abs(this._x1 - f) > ye || Math.abs(this._y1 - u) > ye) && this._append`L${f},${u}`, r && (c < 0 && (c = c % kr + kr), c > Vf ? this._append`A${r},${r},0,1,${h},${e - l},${n - o}A${r},${r},0,1,${h},${this._x1 = f},${this._y1 = u}` : c > ye && this._append`A${r},${r},0,${+(c >= Sr)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + let l = r * Math.cos(i), u = r * Math.sin(i), f = e + l, o = n + u, h = 1 ^ a, c = a ? i - s : s - i; + this._x1 === null ? this._append`M${f},${o}` : (Math.abs(this._x1 - f) > xe || Math.abs(this._y1 - o) > xe) && this._append`L${f},${o}`, r && (c < 0 && (c = c % Mr + Mr), c > Vf ? this._append`A${r},${r},0,1,${h},${e - l},${n - u}A${r},${r},0,1,${h},${this._x1 = f},${this._y1 = o}` : c > xe && this._append`A${r},${r},0,${+(c >= kr)},${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`; @@ -3499,24 +3499,24 @@ class Yf { return this._; } } -function Bf(t) { +function Yf(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 zf = Bf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +const zf = Yf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); function ut(t) { return function() { return t; }; } -const Ii = Math.abs, lt = Math.atan2, me = Math.cos, Xf = Math.max, _r = Math.min, Yt = Math.sin, Se = Math.sqrt, dt = 1e-12, rn = Math.PI, Kn = rn / 2, Nn = 2 * rn; -function Uf(t) { - return t > 1 ? 0 : t < -1 ? rn : Math.acos(t); +const Fi = Math.abs, lt = Math.atan2, we = Math.cos, Uf = Math.max, _r = Math.min, Yt = Math.sin, Oe = Math.sqrt, dt = 1e-12, an = Math.PI, Zn = an / 2, Mn = 2 * an; +function jf(t) { + return t > 1 ? 0 : t < -1 ? an : Math.acos(t); } -function Fi(t) { - return t >= 1 ? Kn : t <= -1 ? -Kn : Math.asin(t); +function Ii(t) { + return t >= 1 ? Zn : t <= -1 ? -Zn : Math.asin(t); } -function Gf(t) { +function Xf(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -3528,12 +3528,12 @@ function Gf(t) { e = r; } return t; - }, () => new Yf(e); + }, () => new Hf(e); } -function Kf(t) { +function Gf(t) { return t.innerRadius; } -function jf(t) { +function Kf(t) { return t.outerRadius; } function Wf(t) { @@ -3546,67 +3546,67 @@ function Zf(t) { return t && t.padAngle; } function Qf(t, e, n, r, i, s, a, l) { - var o = n - t, f = r - e, u = a - i, h = l - s, c = h * o - u * f; + var u = n - t, f = r - e, o = a - i, h = l - s, c = h * u - o * f; if (!(c * c < dt)) - return c = (u * (e - s) - h * (t - i)) / c, [t + c * o, e + c * f]; -} -function yn(t, e, n, r, i, s, a) { - var l = t - n, o = e - r, f = (a ? s : -s) / Se(l * l + o * o), u = f * o, h = -f * l, c = t + u, d = e + h, p = n + u, w = r + h, $ = (c + p) / 2, m = (d + w) / 2, A = p - c, C = w - d, M = A * A + C * C, R = i - s, D = c * w - p * d, G = (C < 0 ? -1 : 1) * Se(Xf(0, R * R * M - D * D)), W = (D * C - A * G) / M, et = (-D * A - C * G) / M, Q = (D * C + A * G) / M, B = (-D * A + C * G) / M, I = W - $, b = et - m, L = Q - $, bt = B - m; - return I * I + b * b > L * L + bt * bt && (W = Q, et = B), { - cx: W, - cy: et, - x01: -u, + return c = (o * (e - s) - h * (t - i)) / c, [t + c * u, e + c * f]; +} +function $n(t, e, n, r, i, s, a) { + var l = t - n, u = e - r, f = (a ? s : -s) / Oe(l * l + u * u), o = f * u, h = -f * l, c = t + o, d = e + h, p = n + o, y = r + h, R = (c + p) / 2, _ = (d + y) / 2, $ = p - c, T = y - d, M = $ * $ + T * T, b = i - s, P = c * y - p * d, z = (T < 0 ? -1 : 1) * Oe(Uf(0, b * b * M - P * P)), J = (P * T - $ * z) / M, it = (-P * $ - T * z) / M, nt = (P * T + $ * z) / M, H = (-P * $ + T * z) / M, F = J - R, E = it - _, L = nt - R, G = H - _; + return F * F + E * E > L * L + G * G && (J = nt, it = H), { + cx: J, + cy: it, + x01: -o, y01: -h, - x11: W * (i / R - 1), - y11: et * (i / R - 1) + x11: J * (i / b - 1), + y11: it * (i / b - 1) }; } -function Jt() { - var t = Kf, e = jf, n = ut(0), r = null, i = Wf, s = Jf, a = Zf, l = null, o = Gf(f); +function te() { + var t = Gf, e = Kf, n = ut(0), r = null, i = Wf, s = Jf, a = Zf, l = null, u = Xf(f); function f() { - var u, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - Kn, w = s.apply(this, arguments) - Kn, $ = Ii(w - p), m = w > p; - if (l || (l = u = o()), d < c && (h = d, d = c, c = h), !(d > dt)) l.moveTo(0, 0); - else if ($ > Nn - dt) - l.moveTo(d * me(p), d * Yt(p)), l.arc(0, 0, d, p, w, !m), c > dt && (l.moveTo(c * me(w), c * Yt(w)), l.arc(0, 0, c, w, p, m)); + var o, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - Zn, y = s.apply(this, arguments) - Zn, R = Fi(y - p), _ = y > p; + if (l || (l = o = u()), d < c && (h = d, d = c, c = h), !(d > dt)) l.moveTo(0, 0); + else if (R > Mn - dt) + l.moveTo(d * we(p), d * Yt(p)), l.arc(0, 0, d, p, y, !_), c > dt && (l.moveTo(c * we(y), c * Yt(y)), l.arc(0, 0, c, y, p, _)); else { - var A = p, C = w, M = p, R = w, D = $, G = $, W = a.apply(this, arguments) / 2, et = W > dt && (r ? +r.apply(this, arguments) : Se(c * c + d * d)), Q = _r(Ii(d - c) / 2, +n.apply(this, arguments)), B = Q, I = Q, b, L; - if (et > dt) { - var bt = Fi(et / c * Yt(W)), It = Fi(et / d * Yt(W)); - (D -= bt * 2) > dt ? (bt *= m ? 1 : -1, M += bt, R -= bt) : (D = 0, M = R = (p + w) / 2), (G -= It * 2) > dt ? (It *= m ? 1 : -1, A += It, C -= It) : (G = 0, A = C = (p + w) / 2); + var $ = p, T = y, M = p, b = y, P = R, z = R, J = a.apply(this, arguments) / 2, it = J > dt && (r ? +r.apply(this, arguments) : Oe(c * c + d * d)), nt = _r(Fi(d - c) / 2, +n.apply(this, arguments)), H = nt, F = nt, E, L; + if (it > dt) { + var G = Ii(it / c * Yt(J)), he = Ii(it / d * Yt(J)); + (P -= G * 2) > dt ? (G *= _ ? 1 : -1, M += G, b -= G) : (P = 0, M = b = (p + y) / 2), (z -= he * 2) > dt ? (he *= _ ? 1 : -1, $ += he, T -= he) : (z = 0, $ = T = (p + y) / 2); } - var Nt = d * me(A), at = d * Yt(A), Kt = c * me(R), jt = c * Yt(R); - if (Q > dt) { - var Tt = d * me(C), Ft = d * Yt(C), ve = c * me(M), pe = c * Yt(M), it; - if ($ < rn) - if (it = Qf(Nt, at, ve, pe, Tt, Ft, Kt, jt)) { - var _e = Nt - it[0], fe = at - it[1], qt = Tt - it[0], Lt = Ft - it[1], x = 1 / Yt(Uf((_e * qt + fe * Lt) / (Se(_e * _e + fe * fe) * Se(qt * qt + Lt * Lt))) / 2), q = Se(it[0] * it[0] + it[1] * it[1]); - B = _r(Q, (c - q) / (x - 1)), I = _r(Q, (d - q) / (x + 1)); + var At = d * we($), _t = d * Yt($), It = c * we(b), ft = c * Yt(b); + if (nt > dt) { + var Lt = d * we(T), St = d * Yt(T), de = c * we(M), _e = c * Yt(M), mt; + if (R < an) + if (mt = Qf(At, _t, de, _e, Lt, St, It, ft)) { + var qt = At - mt[0], Vt = _t - mt[1], Kt = Lt - mt[0], Wt = St - mt[1], Jt = 1 / Yt(jf((qt * Kt + Vt * Wt) / (Oe(qt * qt + Vt * Vt) * Oe(Kt * Kt + Wt * Wt))) / 2), me = Oe(mt[0] * mt[0] + mt[1] * mt[1]); + H = _r(nt, (c - me) / (Jt - 1)), F = _r(nt, (d - me) / (Jt + 1)); } else - B = I = 0; + H = F = 0; } - G > dt ? I > dt ? (b = yn(ve, pe, Nt, at, d, I, m), L = yn(Tt, Ft, Kt, jt, d, I, m), l.moveTo(b.cx + b.x01, b.cy + b.y01), I < Q ? l.arc(b.cx, b.cy, I, lt(b.y01, b.x01), lt(L.y01, L.x01), !m) : (l.arc(b.cx, b.cy, I, lt(b.y01, b.x01), lt(b.y11, b.x11), !m), l.arc(0, 0, d, lt(b.cy + b.y11, b.cx + b.x11), lt(L.cy + L.y11, L.cx + L.x11), !m), l.arc(L.cx, L.cy, I, lt(L.y11, L.x11), lt(L.y01, L.x01), !m))) : (l.moveTo(Nt, at), l.arc(0, 0, d, A, C, !m)) : l.moveTo(Nt, at), !(c > dt) || !(D > dt) ? l.lineTo(Kt, jt) : B > dt ? (b = yn(Kt, jt, Tt, Ft, c, -B, m), L = yn(Nt, at, ve, pe, c, -B, m), l.lineTo(b.cx + b.x01, b.cy + b.y01), B < Q ? l.arc(b.cx, b.cy, B, lt(b.y01, b.x01), lt(L.y01, L.x01), !m) : (l.arc(b.cx, b.cy, B, lt(b.y01, b.x01), lt(b.y11, b.x11), !m), l.arc(0, 0, c, lt(b.cy + b.y11, b.cx + b.x11), lt(L.cy + L.y11, L.cx + L.x11), m), l.arc(L.cx, L.cy, B, lt(L.y11, L.x11), lt(L.y01, L.x01), !m))) : l.arc(0, 0, c, R, M, m); + z > dt ? F > dt ? (E = $n(de, _e, At, _t, d, F, _), L = $n(Lt, St, It, ft, d, F, _), l.moveTo(E.cx + E.x01, E.cy + E.y01), F < nt ? l.arc(E.cx, E.cy, F, lt(E.y01, E.x01), lt(L.y01, L.x01), !_) : (l.arc(E.cx, E.cy, F, lt(E.y01, E.x01), lt(E.y11, E.x11), !_), l.arc(0, 0, d, lt(E.cy + E.y11, E.cx + E.x11), lt(L.cy + L.y11, L.cx + L.x11), !_), l.arc(L.cx, L.cy, F, lt(L.y11, L.x11), lt(L.y01, L.x01), !_))) : (l.moveTo(At, _t), l.arc(0, 0, d, $, T, !_)) : l.moveTo(At, _t), !(c > dt) || !(P > dt) ? l.lineTo(It, ft) : H > dt ? (E = $n(It, ft, Lt, St, c, -H, _), L = $n(At, _t, de, _e, c, -H, _), l.lineTo(E.cx + E.x01, E.cy + E.y01), H < nt ? l.arc(E.cx, E.cy, H, lt(E.y01, E.x01), lt(L.y01, L.x01), !_) : (l.arc(E.cx, E.cy, H, lt(E.y01, E.x01), lt(E.y11, E.x11), !_), l.arc(0, 0, c, lt(E.cy + E.y11, E.cx + E.x11), lt(L.cy + L.y11, L.cx + L.x11), _), l.arc(L.cx, L.cy, H, lt(L.y11, L.x11), lt(L.y01, L.x01), !_))) : l.arc(0, 0, c, b, M, _); } - if (l.closePath(), u) return l = null, u + "" || null; + if (l.closePath(), o) return l = null, o + "" || null; } return f.centroid = function() { - var u = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - rn / 2; - return [me(h) * u, Yt(h) * u]; - }, f.innerRadius = function(u) { - return arguments.length ? (t = typeof u == "function" ? u : ut(+u), f) : t; - }, f.outerRadius = function(u) { - return arguments.length ? (e = typeof u == "function" ? u : ut(+u), f) : e; - }, f.cornerRadius = function(u) { - return arguments.length ? (n = typeof u == "function" ? u : ut(+u), f) : n; - }, f.padRadius = function(u) { - return arguments.length ? (r = u == null ? null : typeof u == "function" ? u : ut(+u), f) : r; - }, f.startAngle = function(u) { - return arguments.length ? (i = typeof u == "function" ? u : ut(+u), f) : i; - }, f.endAngle = function(u) { - return arguments.length ? (s = typeof u == "function" ? u : ut(+u), f) : s; - }, f.padAngle = function(u) { - return arguments.length ? (a = typeof u == "function" ? u : ut(+u), f) : a; - }, f.context = function(u) { - return arguments.length ? (l = u ?? null, f) : l; + var o = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - an / 2; + return [we(h) * o, Yt(h) * o]; + }, f.innerRadius = function(o) { + return arguments.length ? (t = typeof o == "function" ? o : ut(+o), f) : t; + }, f.outerRadius = function(o) { + return arguments.length ? (e = typeof o == "function" ? o : ut(+o), f) : e; + }, f.cornerRadius = function(o) { + return arguments.length ? (n = typeof o == "function" ? o : ut(+o), f) : n; + }, f.padRadius = function(o) { + return arguments.length ? (r = o == null ? null : typeof o == "function" ? o : ut(+o), f) : r; + }, f.startAngle = function(o) { + return arguments.length ? (i = typeof o == "function" ? o : ut(+o), f) : i; + }, f.endAngle = function(o) { + return arguments.length ? (s = typeof o == "function" ? o : ut(+o), f) : s; + }, f.padAngle = function(o) { + return arguments.length ? (a = typeof o == "function" ? o : ut(+o), f) : a; + }, f.context = function(o) { + return arguments.length ? (l = o ?? null, f) : l; }, f; } function tc(t) { @@ -3618,24 +3618,24 @@ function ec(t, e) { function nc(t) { return t; } -function gr() { - var t = nc, e = ec, n = null, r = ut(0), i = ut(Nn), s = ut(0); +function mr() { + var t = nc, e = ec, n = null, r = ut(0), i = ut(Mn), s = ut(0); function a(l) { - var o, f = (l = tc(l)).length, u, h, c = 0, d = new Array(f), p = new Array(f), w = +r.apply(this, arguments), $ = Math.min(Nn, Math.max(-Nn, i.apply(this, arguments) - w)), m, A = Math.min(Math.abs($) / f, s.apply(this, arguments)), C = A * ($ < 0 ? -1 : 1), M; - for (o = 0; o < f; ++o) - (M = p[d[o] = o] = +t(l[o], o, l)) > 0 && (c += M); - for (e != null ? d.sort(function(R, D) { - return e(p[R], p[D]); - }) : n != null && d.sort(function(R, D) { - return n(l[R], l[D]); - }), o = 0, h = c ? ($ - f * C) / c : 0; o < f; ++o, w = m) - u = d[o], M = p[u], m = w + (M > 0 ? M * h : 0) + C, p[u] = { - data: l[u], - index: o, + var u, f = (l = tc(l)).length, o, h, c = 0, d = new Array(f), p = new Array(f), y = +r.apply(this, arguments), R = Math.min(Mn, Math.max(-Mn, i.apply(this, arguments) - y)), _, $ = Math.min(Math.abs(R) / f, s.apply(this, arguments)), T = $ * (R < 0 ? -1 : 1), M; + for (u = 0; u < f; ++u) + (M = p[d[u] = u] = +t(l[u], u, l)) > 0 && (c += M); + for (e != null ? d.sort(function(b, P) { + return e(p[b], p[P]); + }) : n != null && d.sort(function(b, P) { + return n(l[b], l[P]); + }), u = 0, h = c ? (R - f * T) / c : 0; u < f; ++u, y = _) + o = d[u], M = p[o], _ = y + (M > 0 ? M * h : 0) + T, p[o] = { + data: l[o], + index: u, value: M, - startAngle: w, - endAngle: m, - padAngle: A + startAngle: y, + endAngle: _, + padAngle: $ }; return p; } @@ -3653,16 +3653,16 @@ function gr() { return arguments.length ? (s = typeof l == "function" ? l : ut(+l), a) : s; }, a; } -function Ge(t, e, n) { +function Ke(t, e, n) { this.k = t, this.x = e, this.y = n; } -Ge.prototype = { - constructor: Ge, +Ke.prototype = { + constructor: Ke, scale: function(t) { - return t === 1 ? this : new Ge(this.k * t, this.x, this.y); + return t === 1 ? this : new Ke(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new Ge(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new Ke(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]; @@ -3692,192 +3692,201 @@ Ge.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Ge.prototype; -const Qt = {}, Mr = "No Further Rankings"; -function jn(t, e) { - let n = 0; - for (let r = 1; r < e; r++) { - const i = t.results[r - 1].tallyResults; - for (let s = 0; s < i.length; s++) { - const a = i[s].transfers; - if (a) { - const l = a.exhausted; - l && (n += Number(l)); - } - } - } - return n; -} -function Gs(t, e, n) { - if (e < 1) - return []; - const r = t.results[e - 1].tallyResults, i = []; - for (let s = 0; s < r.length; s++) { - const a = r[s][n]; - a != null && i.push(a); - } - return i; -} -function Wn(t, e) { - return Gs(t, e, "eliminated"); -} -function Jn(t, e) { - let n = []; - for (let r = 1; r <= e; r++) - n = n.concat(Gs(t, r, "elected")); - return n; -} +Ke.prototype; var rc = /* @__PURE__ */ ol(''); -const ic = { hash: "svelte-3kpd", code: "" }; -function Ks(t, e) { - jr(e, !0), gs(t, ic); - let n = kt(e, "jsonData", 7), r = kt(e, "currentRound", 7, 1), i = kt(e, "mouseEventType", 15), s = kt(e, "mouseData", 15), a = kt(e, "mouseY", 15), l = kt(e, "requestRoundChange", 7, (v) => { - }), o = kt(e, "candidateColors", 23, () => []); - const f = 800, u = 800, h = Math.min(f, u) * 0.3, c = f / 2, d = u / 2, p = "Pie", w = "Donut", $ = "TextLayer", m = "#transfer", A = "url(#cross-hatch)", C = 1.15, M = 0.1, R = 750, D = 800; - let G = [], W = [], et = [], Q = 0, B = Zt(0), I = 0, b = Zt(null); - function L() { - const v = st(g(b)); - v.select("#" + p).remove(), v.select("#" + w).remove(), v.select("#" + $).remove(); - } - function bt(v) { - l() && (K = v, l()(v)); - } - function It(v) { - L(), et = Nt(v), G = ta(v, p, et, c, d, 0, at()); +const ic = { + hash: "svelte-1q7h3eo", + code: ` + +@media (max-width: 768px) { +} + +@media (max-width: 768px) { +}` +}; +function Xs(t, e) { + Kr(e, !0), _s(t, ic); + let n = Mt(e, "jsonData", 7), r = Mt(e, "currentRound", 7, 1), i = Mt(e, "mouseEventType", 15), s = Mt(e, "mouseData", 15), a = Mt(e, "mouseY", 15), l = Mt(e, "requestRoundChange", 7, (v) => { + }), u = Mt(e, "candidateColors", 23, () => []); + const f = 800, o = 800, h = Math.min(f, o) * 0.3, c = f / 2, d = o / 2, p = "Pie", y = "Donut", R = "TextLayer", _ = "#transfer", $ = "url(#cross-hatch)", T = 1.15, M = 0.1, b = 750, P = 800; + let z = [], J = [], it = [], nt = 0, H = ee(0), F = 0; + const E = {}, L = "No Further Rankings"; + let G = ee(null); + function he() { + const v = at(x(G)); + v.select("#" + p).remove(), v.select("#" + y).remove(), v.select("#" + R).remove(); + } + function At(v) { + l() && (rt = v, l()(v)); + } + function _t(v) { + he(), it = It(v), z = ta(v, p, it, c, d, 0, ft()); } vl(() => { - console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), _e(), setTimeout( + console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), un(), setTimeout( () => { - It(r()); + _t(r()); }, 0 ); }); - function Nt(v) { - const _ = it(v); - return Q = ve(v), _; + function It(v) { + const g = me(v); + return nt = qt(v), g; } - function at() { + function ft() { return h; } - function Kt() { - return at() * 1.41; + function Lt() { + return ft() * 1.41; + } + function St(v) { + let g = 0; + for (let m = 1; m < v; m++) { + const k = n().results[m - 1].tallyResults; + for (let A = 0; A < k.length; A++) { + const C = k[A].transfers; + if (C) { + const S = C.exhausted; + S && (g += Number(S)); + } + } + } + return g; } - function jt(v, _) { - if (v === "exhausted") return jn(n(), _); + function de(v, g) { + if (v === "exhausted") return St(g); { - const y = n().results[_ - 1].tally; - return Number(y[v]); + const m = n().results[g - 1].tally; + return Number(m[v]); } } - function Tt(v, _) { - return jt(v, _).toLocaleString("en-US"); - } - function Ft(v, _) { - return (jt(v, _) / Q).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); - } - function ve(v) { - const _ = n().results[v - 1].tally; - let y = 0; - for (let [P, N] of Object.entries(_)) - y += Number(N); - return y; - } - function pe(v, _) { - const y = n().results[_ - 1].tallyResults; - let P = 0; - const N = y.findIndex((S) => (S == null ? void 0 : S.elected) && v == S.elected); - if (N >= 0) { - const S = y[N].transfers; - if (S) - for (let [T, k] of Object.entries(S)) P += Number(k); + function _e(v, g) { + return de(v, g).toLocaleString("en-US"); + } + function mt(v, g) { + return (de(v, g) / nt).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + } + function qt(v) { + const g = n().results[v - 1].tally; + let m = 0; + for (let [k, A] of Object.entries(g)) + m += Number(A); + return m; + } + function Vt(v, g) { + if (!v || v < 1 || v > n().results.length) + return console.warn("In chsoenCandidates: round ${round} is out of range."), []; + const m = n().results[v - 1].tallyResults, k = []; + for (let A = 0; A < m.length; A++) { + const C = m[A][g]; + C != null && k.push(C); + } + return k; + } + function Kt(v) { + return Vt(v, "eliminated"); + } + function Wt(v) { + let g = []; + for (let m = 1; m <= v; m++) g = g.concat(Vt(m, "elected")); + return g; + } + function Jt(v, g) { + const m = n().results[g - 1].tallyResults; + let k = 0; + const A = m.findIndex((C) => (C == null ? void 0 : C.elected) && v == C.elected); + if (A >= 0) { + const C = m[A].transfers; + if (C) + for (let [S, O] of Object.entries(C)) k += Number(O); } else return 0; - return P; - } - function it(v) { - const _ = n().results; - let y = _[Math.max(0, v - 2)].tally; - const P = [], N = []; - for (let [T, k] of Object.entries(y)) - P.push({ label: T, value: 0 }); - y = _[v - 1].tally; - for (let T of P) { - const k = Number(y[T.label]), F = pe(T.label, v); - F > 0 ? (N.push({ - label: T.label + m, - value: F - }), T.value = k - F, N.push(T)) : (T.value = k, N.push(T)); + return k; + } + function me(v) { + const g = n().results; + let m = g[Math.max(0, v - 2)].tally; + const k = [], A = []; + for (let [S, O] of Object.entries(m)) + k.push({ label: S, value: 0 }); + m = g[v - 1].tally; + for (let S of k) { + const O = Number(m[S.label]), I = Jt(S.label, v); + I > 0 ? (A.push({ + label: S.label + _, + value: I + }), S.value = O - I, A.push(S)) : (S.value = O, A.push(S)); } - const S = jn(n(), v); - return N.push({ label: "exhausted", value: S }), N; - } - function _e() { - const v = st(g(b)).select("defs").select("#cross-hatch"); - let _ = 0; - for (let [y, P] of Object.entries(n().results[0].tally)) { - !o() || o().length === 0 ? _ < 10 ? Qt[y] = zf[_] : Qt[y] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : Qt[y] = o()[_ % o().length], _++; + const C = St(v); + return A.push({ label: "exhausted", value: C }), A; + } + function un() { + const v = at(x(G)).select("defs").select("#cross-hatch"); + let g = 0; + for (let [m, k] of Object.entries(n().results[0].tally)) { + !u() || u().length === 0 ? g < 10 ? E[m] = zf[g] : E[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : E[m] = u()[g % u().length], g++; { - const N = v.clone(!0); - N.attr("id", y.replaceAll(" ", "-")).select("rect").attr("fill", Qt[y]), N.select("path").attr("stroke", "#505050"); + const A = v.clone(!0); + A.attr("id", m.replaceAll(" ", "-")).select("rect").attr("fill", E[m]), A.select("path").attr("stroke", "#505050"); } } - Qt.exhausted = A, Qt["Inactive Ballots"] = A; + E.exhausted = $, E["Inactive Ballots"] = $; } - function fe() { - st(g(b)).select("#" + w).remove(); + function fn() { + at(x(G)).select("#" + y).remove(); } - function qt(v, _) { - const y = Cn("global").duration(D); - _ && y.on("end", _), fe(), ge(v), ea(), ra(0, at()), cn(); + function ze(v, g) { + const m = kn("global").duration(P); + g && m.on("end", g), fn(), dn(v), ea(), ra(0, ft()), pn(); } - function Lt(v, _) { - const y = Cn("global").duration(D); - _ && y.on("end", _), un(v); + function w(v, g) { + const m = kn("global").duration(P); + g && m.on("end", g), Gs(v); } - function x(v, _) { - const y = Cn("global").duration(D); - _ && y.on("end", _), ln(v), on(at()); + function q(v, g) { + const m = kn("global").duration(P); + g && m.on("end", g), hn(v), ye(ft()); } - function q() { - cn(), Y = !1; + function K() { + pn(), Y = !1; } let Y = !1; - function nt() { + function st() { if (Y) { console.warn("busy animating"); return; } - Y = !0, I = r(), rt(); - } - function rt() { - j(B, 0); - const v = I < n().results.length - 1 ? rt : q; - qt(I, () => { - Lt(I, () => { - I++, bt(I), x(I, v); + Y = !0, F = r(), tt(); + } + function tt() { + W(H, 0); + const v = F < n().results.length - 1 ? tt : K; + ze(F, () => { + w(F, () => { + F++, At(F), q(F, v); }); }); } - Xr(() => { - ft(); + Ur(() => { + Rt(); }); - let K = 0; - function ft() { - if (console.log(`previous round was ${K}, currentRound is ${r()}`), Y) { + let rt = 0; + function Rt() { + if (console.log(`previous round was ${rt}, currentRound is ${r()}`), Y) { console.log("gotoNextRound: busy animating"); return; } - K != r() && (K == r() - 1 && K > 0 ? He() : $t(r()), K = r()); + rt != r() && (rt == r() - 1 && rt > 0 ? Ne() : Zt(r()), rt = r()); } - function $t(v) { + function Zt(v) { if (console.log("setRoundFn called"), Y) { console.warn("busy animating"); return; } - j(B, 0), It(v); + W(H, 0), _t(v); } - function He() { + function Ne() { if (console.log("animateOneRoundFn called"), Y) { console.warn("busy animating"); return; @@ -3886,303 +3895,308 @@ function Ks(t, e) { console.warn(`animateOneRoundFn: can't anitmate to round ${r()}`); return; } - if (I = r(), I > n().results.length) { - cn(), Y = !1; + if (F = r(), F > n().results.length) { + pn(), Y = !1; return; } - Y = !0, g(B) === 0 ? qt(I - 1, () => { - Lt(I - 1, () => { - x(I, q); + Y = !0, x(H) === 0 ? ze(F - 1, () => { + w(F - 1, () => { + q(F, K); }); - }) : g(B) === 1 ? Lt(I - 1, () => { - x(I, q); - }) : g(B) === 2 && x(I, q), j(B, 0); + }) : x(H) === 1 ? w(F - 1, () => { + q(F, K); + }) : x(H) === 2 && q(F, K), W(H, 0); } - function Re() { - if (console.log(`animateOnePhaseFn called, currentRound = ${r()}, displayPhase = ${g(B)}`), r() > n().results.length) { - cn(), Y = !1; + function cn() { + if (console.log(`animateOnePhaseFn called, currentRound = ${r()}, displayPhase = ${x(H)}`), r() > n().results.length) { + pn(), Y = !1; return; } - Y || (Y = !0, j(B, (g(B) + 1) % 3), I = r(), g(B) === 1 ? qt(I, q) : g(B) === 2 ? Lt(I, q) : g(B) === 0 ? (I++, bt(I), x(I, q)) : (Y = !1, console.warn("displayPhase out of range at ", g(B)))); + Y || (Y = !0, W(H, (x(H) + 1) % 3), F = r(), x(H) === 1 ? ze(F, K) : x(H) === 2 ? w(F, K) : x(H) === 0 ? (F++, At(F), q(F, K)) : (Y = !1, console.warn("displayPhase out of range at ", x(H)))); } - function ln(v) { - et = it(v), G = ia(v, p, et, 0, at(), !0); + function hn(v) { + it = me(v), z = ia(v, p, it, 0, ft(), !0); } - function on(v, _) { - gr().sort(null).value((k) => k.value); - const y = st(g(b)).select("#" + w), P = Jt().outerRadius(v).innerRadius(v - 1), N = y.selectAll(".slice"); - let S = N.size(); - function T() { - S--, S === 0 && na(); + function ye(v, g) { + mr().sort(null).value((O) => O.value); + const m = at(x(G)).select("#" + y), k = te().outerRadius(v).innerRadius(v - 1), A = m.selectAll(".slice"); + let C = A.size(); + function S() { + C--, C === 0 && na(); } - N.select("path").transition("global").duration(R).attr("d", (k) => P(k)).on("end", (k) => T()); + A.select("path").transition("global").duration(b).attr("d", (O) => k(O)).on("end", (O) => S()); } - function ge(v) { - const _ = Ws(v, G); - W = si(v, w, _, c, d, at(), Kt(), !1, !0); + function dn(v) { + const g = Ws(v, z); + J = si(v, y, g, c, d, ft(), Lt(), !1, !0); } - function un(v) { - const _ = Zs(v, W, G); - W = ai( + function Gs(v) { + const g = Zs(v, J, z); + J = ai( v, - w, - _, + y, + g, /* previousDonutInfoGlobal, */ - at(), - Kt(), + ft(), + Lt(), !1 ); } - function fn(v) { - const _ = v.data.label; - return Qt[_.split("#")[0]]; + function vn(v) { + const g = v.data.label; + return E[g.split("#")[0]]; } - function js(v) { - const _ = {}, y = n().results[v - 1].tallyResults; - for (let P = 0; P < y.length; P++) { - let N = y[P].eliminated; - if (N === void 0 && (N = y[P].elected), N === void 0) { + function Ks(v) { + const g = {}, m = n().results[v - 1].tallyResults; + for (let k = 0; k < m.length; k++) { + let A = m[k].eliminated; + if (A === void 0 && (A = m[k].elected), A === void 0) { console.warn("getTransferVotes: Eliminated and Elected undefined..."); continue; } - const S = y[P].transfers; - if (S === void 0) { + const C = m[k].transfers; + if (C === void 0) { console.warn("getTransferVotes: transfers undefined..."); continue; } - for (let [T, k] of Object.entries(S)) - _[T] === void 0 ? _[T] = Number(k) : _[T] += Number(k); + for (let [S, O] of Object.entries(C)) + g[S] === void 0 ? g[S] = Number(O) : g[S] += Number(O); } - return _; + return g; } - function Ws(v, _) { - const y = [], P = Q, N = n().results[v - 1].tallyResults; - for (let S = 0; S < N.length; S++) { - let T = N[S].eliminated; - if (T === void 0 && (T = N[S].elected), T === void 0) { + function Ws(v, g) { + const m = [], k = nt, A = n().results[v - 1].tallyResults; + for (let C = 0; C < A.length; C++) { + let S = A[C].eliminated; + if (S === void 0 && (S = A[C].elected), S === void 0) { console.warn("MakeDonutInfo: Eliminated and Elected undefined..."); continue; } - const k = N[S].transfers; - if (k === void 0) { + const O = A[C].transfers; + if (O === void 0) { console.warn("makeDonutInfo: transfers undefined..."); continue; } - let F = _.find((O) => O.data.label == T + m); - F === void 0 && (F = _.find((O) => O.data.label == T)); + let I = g.find((D) => D.data.label == S + _); + I === void 0 && (I = g.find((D) => D.data.label == S)); let V = 0; - if (F) V = F.startAngle; + if (I) V = I.startAngle; else { console.warn("makeDonutInfo: No transfers"); continue; } - for (let [O, H] of Object.entries(k)) { - let J; - const Vt = _.find((tt) => tt.data.label == O); - if (Vt) - J = structuredClone(Vt); - else if (O == "exhausted") - J = { - data: { label: O, value: Number(H) }, + for (let [D, B] of Object.entries(O)) { + let Z; + const Bt = g.find((et) => et.data.label == D); + if (Bt) + Z = structuredClone(Bt); + else if (D == "exhausted") + Z = { + data: { label: D, value: Number(B) }, value: 0, index: 0, startAngle: 0, endAngle: 0, padAngle: 0 }; - else if (O == "residual surplus") { - console.warn("makeDonutInfo: residual surplus = ", H); + else if (D == "residual surplus") { + console.warn("makeDonutInfo: residual surplus = ", B); continue; } else { - console.warn("makeDonutInfo: unrecognized name in transfers ", O); + console.warn("makeDonutInfo: unrecognized name in transfers ", D); continue; } - const E = Number(H) / P * 2 * Math.PI; - J.startAngle = V, V = J.endAngle = V + E, J.index = S, J.data.label = `${J.data.label}#${S}`, y.push(J); + const N = Number(B) / k * 2 * Math.PI; + Z.startAngle = V, V = Z.endAngle = V + N, Z.index = C, Z.data.label = `${Z.data.label}#${C}`, m.push(Z); } } - return y; - } - function Js(v, _, y) { - const P = {}; - for (let [N, S] of Object.entries(v)) { - const T = y.find((V) => N == V.data.label); - if (T === void 0) { - console.warn("getTransferStartAngles: mainPieObj not found for ", N); + return m; + } + function Js(v, g, m) { + const k = {}; + for (let [A, C] of Object.entries(v)) { + const S = m.find((V) => A == V.data.label); + if (S === void 0) { + console.warn("getTransferStartAngles: mainPieObj not found for ", A); continue; } - const k = (T.startAngle + T.endAngle) / 2, F = v[T.data.label] / _ * 2 * Math.PI; - P[T.data.label] = k - F / 2; + const O = (S.startAngle + S.endAngle) / 2, I = v[S.data.label] / g * 2 * Math.PI; + k[S.data.label] = O - I / 2; } - return P; - } - function Zs(v, _, y) { - const P = [], N = Q, S = js(v), T = Js(S, N, y); - for (let [k, F] of _.entries()) { - const V = structuredClone(F), O = F.endAngle - F.startAngle, H = y.find((J) => F.data.label.indexOf(J.data.label) === 0); - if (H) { - const J = H.data.label; - V.startAngle = T[J], T[J] += O, V.endAngle = V.startAngle + O; - } else if (F.data.label.indexOf("exhausted") === 0) - V.startAngle = F.startAngle, V.endAngle = F.endAngle; + return k; + } + function Zs(v, g, m) { + const k = [], A = nt, C = Ks(v), S = Js(C, A, m); + for (let [O, I] of g.entries()) { + const V = structuredClone(I), D = I.endAngle - I.startAngle, B = m.find((Z) => I.data.label.indexOf(Z.data.label) === 0); + if (B) { + const Z = B.data.label; + V.startAngle = S[Z], S[Z] += D, V.endAngle = V.startAngle + D; + } else if (I.data.label.indexOf("exhausted") === 0) + V.startAngle = I.startAngle, V.endAngle = I.endAngle; else { - console.warn("updateDonutInfo: unrecognized slice name ", F.data.label); + console.warn("updateDonutInfo: unrecognized slice name ", I.data.label); continue; } - V.index = k, P.push(V); + V.index = O, k.push(V); } - return P; - } - function ii(v, _, y, P, N, S) { - const k = st(g(b)).append("g").attr("id", $).attr("transform", `translate(${y}, ${P})`), F = Jt().innerRadius(N * C).outerRadius(N * C); - k.selectAll("text").data(_).enter().each(function(V) { - V.endAngle - V.startAngle < M || V.data.label.includes(m) || st(this).append("g").attr("id", (O) => O.data.label).classed("eliminated", (O) => S.includes(O.data.label.split("#")[0]) || O.data.label.includes(m)).each(function(O, H) { - O.data.label === "exhausted" && st(this).on("mouseenter", (J, Vt) => sa(J)).on("mouseleave", (J, Vt) => aa()); - }).append("text").attr("transform", (O) => `translate(${F.centroid(O)})`).attr("text-anchor", (O) => ar(O.startAngle, O.endAngle)).text((O) => O.data.label === "exhausted" ? Mr : O.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((O) => Tt(O.data.label, v) + " (" + Ft(O.data.label, v) + ")"); + return k; + } + function ii(v, g, m, k, A, C) { + const O = at(x(G)).append("g").attr("id", R).attr("transform", `translate(${m}, ${k})`), I = te().innerRadius(A * T).outerRadius(A * T); + O.selectAll("text").data(g).enter().each(function(V) { + V.endAngle - V.startAngle < M || V.data.label.includes(_) || at(this).append("g").attr("id", (D) => D.data.label).classed("eliminated", (D) => C.includes(D.data.label.split("#")[0]) || D.data.label.includes(_)).each(function(D, B) { + D.data.label === "exhausted" && at(this).on("mouseenter", (Z, Bt) => sa(Z)).on("mouseleave", (Z, Bt) => aa()); + }).append("text").attr("transform", (D) => `translate(${I.centroid(D)})`).attr("text-anchor", (D) => lr(D.startAngle, D.endAngle)).text((D) => D.data.label === "exhausted" ? L : D.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((D) => _e(D.data.label, v) + " (" + mt(D.data.label, v) + ")"); }); } - function Qs(v, _, y, P) { - const S = st(g(b)).select("#" + $), T = S.selectAll("tspan"), k = S.selectAll("g").data(_, (H) => H.data.label).classed("eliminated", (H) => P.includes(H.data.label.split("#")[0]) || H.data.label.includes(m)), F = Jt().innerRadius(y * C).outerRadius(y * C + 1); - T.transition("global").duration(R).attr("transform", (H) => `translate(${F.centroid(H)})`).attr("text-anchor", (H) => ar(H.startAngle, H.endAngle)), k.select("text").transition("global").duration(R).attr("transform", (H) => `translate(${F.centroid(H)})`).attr("text-anchor", (H) => ar(H.startAngle, H.endAngle)).on("end", (H) => O()); - let V = k.size(); - function O(H) { - V--, V === 0 && (S.remove(), ii(v, _, c, d, y, P)); + function Qs(v, g, m, k) { + const C = at(x(G)).select("#" + R), S = C.selectAll("tspan"), O = C.selectAll("g").data(g, (B) => B.data.label).classed("eliminated", (B) => k.includes(B.data.label.split("#")[0]) || B.data.label.includes(_)), I = te().innerRadius(m * T).outerRadius(m * T + 1); + S.transition("global").duration(b).attr("transform", (B) => `translate(${I.centroid(B)})`).attr("text-anchor", (B) => lr(B.startAngle, B.endAngle)), O.select("text").transition("global").duration(b).attr("transform", (B) => `translate(${I.centroid(B)})`).attr("text-anchor", (B) => lr(B.startAngle, B.endAngle)).on("end", (B) => D()); + let V = O.size(); + function D(B) { + V--, V === 0 && (C.remove(), ii(v, g, c, d, m, k)); } } - function ta(v, _, y, P, N, S, T, k = !0, F = !1) { - const O = gr().sort(null).value((H) => H.value)(y); - return si(v, _, O, P, N, S, T, k, F), O; + function ta(v, g, m, k, A, C, S, O = !0, I = !1) { + const D = mr().sort(null).value((B) => B.value)(m); + return si(v, g, D, k, A, C, S, O, I), D; } - function cn() { - st(g(b)).select("#" + p).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); + function pn() { + at(x(G)).select("#" + p).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); } - function si(v, _, y, P, N, S, T, k, F) { - const V = Wn(n(), v), O = Jn(n(), v), Vt = st(g(b)).attr("width", "100%").attr("height", u).attr("viewBox", `0 0 ${f} ${u}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", _).attr("transform", `translate(${P}, ${N})`).selectAll(".slice").data(y).enter().append("g").attr("class", "slice").classed("eliminated", (E) => V.includes(E.data.label.split("#")[0]) || E.data.label.includes(m)).classed("elected", (E) => O.includes(E.data.label.split("#")[0]) && !E.data.label.includes(m)).attr("id", (E) => E.data.label).on("mouseenter", (E, tt) => or(E, tt)).on("mouseleave", (E, tt) => ur(E, tt)), Ye = Jt().outerRadius(T).innerRadius(S); - if (F) { - const E = Jt().outerRadius(S + 1).innerRadius(S); - Vt.append("path").attr("d", E).transition("global").duration(R).attr("d", (tt) => Ye(tt)).attr("fill", (tt) => fn(tt)).on("end", (tt) => lr()); + function si(v, g, m, k, A, C, S, O, I) { + const V = Kt(v), D = Wt(v), Bt = at(x(G)).attr("width", "100%").attr("height", "auto").attr("viewBox", `0 0 ${f} ${o}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", g).attr("transform", `translate(${k}, ${A})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (N) => V.includes(N.data.label.split("#")[0]) || N.data.label.includes(_)).classed("elected", (N) => D.includes(N.data.label.split("#")[0]) && !N.data.label.includes(_)).attr("id", (N) => N.data.label).on("mouseenter", (N, et) => ur(N, et)).on("mouseleave", (N, et) => fr(N, et)), Ue = te().outerRadius(S).innerRadius(C); + if (I) { + const N = te().outerRadius(C + 1).innerRadius(C); + Bt.append("path").attr("d", N).transition("global").duration(b).attr("d", (et) => Ue(et)).attr("fill", (et) => vn(et)).on("end", (et) => or()); } else - Vt.append("path").attr("d", (E) => Ye(E)).attr("fill", (E) => fn(E)), lr(); - return k && ii(v, y, P, N, T, V), y; + Bt.append("path").attr("d", (N) => Ue(N)).attr("fill", (N) => vn(N)), or(); + return O && ii(v, m, k, A, S, V), m; } function ea() { - const y = st(g(b)).select("#" + $).selectAll(".eliminated"); - y.size() > 0 && y.classed("finished", !0); + const m = at(x(G)).select("#" + R).selectAll(".eliminated"); + m.size() > 0 && m.classed("finished", !0); } function na() { - const y = st(g(b)).select("#" + $).selectAll(".finished"); - y.size() > 0 && y.remove(); + const m = at(x(G)).select("#" + R).selectAll(".finished"); + m.size() > 0 && m.remove(); } - function ra(v, _) { - const N = st(g(b)).select("#" + p).selectAll(".eliminated"), S = Jt().innerRadius(v), T = Jt().outerRadius(_); - N.classed("finished", !0).select("path").transition("global").duration(R).attrTween("d", function(k) { - const F = Te(_, v); + function ra(v, g) { + const A = at(x(G)).select("#" + p).selectAll(".eliminated"), C = te().innerRadius(v), S = te().outerRadius(g); + A.classed("finished", !0).select("path").transition("global").duration(b).attrTween("d", function(O) { + const I = Me(g, v); return function(V) { - return T.innerRadius(F(V)), T(k); + return S.innerRadius(I(V)), S(O); }; - }).attr("fill", (k) => `url(#${k.data.label.split("#")[0].replaceAll(" ", "-")})`), N.clone(!0).classed("finished", !0).select("path").transition("global").duration(R).attrTween("d", function(k) { - const F = Te(_, v); + }).attr("fill", (O) => `url(#${O.data.label.split("#")[0].replaceAll(" ", "-")})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(b).attrTween("d", function(O) { + const I = Me(g, v); return function(V) { - return S.outerRadius(F(V)), S(k); + return C.outerRadius(I(V)), C(O); }; - }).attr("fill", (k) => fn(k)); + }).attr("fill", (O) => vn(O)); } - function ar(v, _) { - const y = (v + _) / 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 lr(v, g) { + const m = (v + g) / 2; + return m > Math.PI * 11 / 6 || m < Math.PI * 1 / 6 || m > Math.PI * 5 / 6 && m < Math.PI * 7 / 6 ? "middle" : m < Math.PI ? "start" : "end"; } - function lr() { - st(g(b)).select("#" + $).raise().append("g").remove(); + function or() { + at(x(G)).select("#" + R).raise().append("g").remove(); } - function ia(v, _, y, P, N, S) { - const k = gr().sort(null).value((F) => F.value)(y); + function ia(v, g, m, k, A, C) { + const O = mr().sort(null).value((I) => I.value)(m); return ai( v, - _, - k, + g, + O, /* previousPieInfo, */ - P, - N, - S - ), k; - } - function ai(v, _, y, P, N, S) { - const T = Wn(n(), v), k = Jn(n(), v), F = Jt().outerRadius(N).innerRadius(P).startAngle((E) => E.startAngle).endAngle((E) => E.endAngle), V = Jt().outerRadius(N).innerRadius(P), H = st(g(b)).select("#" + _); - H.selectAll(".slice").attr("prevStart", (E) => E.startAngle).attr("prevEnd", (E) => E.endAngle); - const J = H.selectAll(".slice").data(y, (E) => E.data.label); - J.enter().append("g").attr("class", "slice").attr("id", (E) => E.data.label).classed("eliminated", !0).on("mouseenter", (E, tt) => or(E, tt)).on("mouseleave", (E, tt) => ur(E, tt)).append("path").attr("d", (E) => V(E)).attr("fill", (E) => fn(E)), J.classed("eliminated", (E) => T.includes(E.data.label.split("#")[0])).classed("elected", (E) => k.includes(E.data.label.split("#")[0])).on("mouseenter", (E, tt) => or(E, tt)).on("mouseleave", (E, tt) => ur(E, tt)); - let Vt = J.size(); - function Ye() { - Vt--, Vt <= 0 && (lr(), H.selectAll(".finished").remove()); + k, + A, + C + ), O; + } + function ai(v, g, m, k, A, C) { + const S = Kt(v), O = Wt(v), I = te().outerRadius(A).innerRadius(k).startAngle((N) => N.startAngle).endAngle((N) => N.endAngle), V = te().outerRadius(A).innerRadius(k), B = at(x(G)).select("#" + g); + B.selectAll(".slice").attr("prevStart", (N) => N.startAngle).attr("prevEnd", (N) => N.endAngle); + const Z = B.selectAll(".slice").data(m, (N) => N.data.label); + Z.enter().append("g").attr("class", "slice").attr("id", (N) => N.data.label).classed("eliminated", !0).on("mouseenter", (N, et) => ur(N, et)).on("mouseleave", (N, et) => fr(N, et)).append("path").attr("d", (N) => V(N)).attr("fill", (N) => vn(N)), Z.classed("eliminated", (N) => S.includes(N.data.label.split("#")[0])).classed("elected", (N) => O.includes(N.data.label.split("#")[0])).on("mouseenter", (N, et) => ur(N, et)).on("mouseleave", (N, et) => fr(N, et)); + let Bt = Z.size(); + function Ue() { + Bt--, Bt <= 0 && (or(), B.selectAll(".finished").remove()); } - return J.select("path").transition("global").duration(R).attrTween("d", function(E) { - const tt = Number(st(this.parentNode).attr("prevStart")), la = Number(st(this.parentNode).attr("prevEnd")), oa = Te(tt, E.startAngle), ua = Te(la, E.endAngle); - return (oi) => (F.startAngle(oa(oi)).endAngle(ua(oi)), F(E)); - }).on("end", Ye), S && Qs(v, y, N, T), y; + return Z.select("path").transition("global").duration(b).attrTween("d", function(N) { + const et = Number(at(this.parentNode).attr("prevStart")), la = Number(at(this.parentNode).attr("prevEnd")), oa = Me(et, N.startAngle), ua = Me(la, N.endAngle); + return (oi) => (I.startAngle(oa(oi)).endAngle(ua(oi)), I(N)); + }).on("end", Ue), C && Qs(v, m, A, S), m; } - function or(v, _) { - s(_.data.label.split("#")[0]), i("enter"), a(v.clientY); + function ur(v, g) { + s(g.data.label.split("#")[0]), i("enter"), a(v.clientY); } - function ur(v, _) { - s(_.data.label.split("#")[0]), i("leave"); + function fr(v, g) { + s(g.data.label.split("#")[0]), i("leave"); } - function sa(v, _) { + function sa(v, g) { i("show-exhausted"), a(v.clientY); } - function aa(v, _) { + function aa(v, g) { i("hide-exhausted"); } var li = rc(); - return bn(li, (v) => j(b, v), () => g(b)), ce(t, li), Wr({ - runFullAnimationFn: nt, - animateOnePhaseFn: Re, + return En(li, (v) => W(G, v), () => x(G)), ve(t, li), Wr({ + pieColors: E, + exhaustedLabel: L, + countExhaustedVotes: St, + getEliminatedCandidates: Kt, + getElectedCandidates: Wt, + runFullAnimationFn: st, + animateOnePhaseFn: cn, get jsonData() { return n(); }, set jsonData(v) { - n(v), Rt(); + n(v), Nt(); }, get currentRound() { return r(); }, set currentRound(v = 1) { - r(v), Rt(); + r(v), Nt(); }, get mouseEventType() { return i(); }, set mouseEventType(v) { - i(v), Rt(); + i(v), Nt(); }, get mouseData() { return s(); }, set mouseData(v) { - s(v), Rt(); + s(v), Nt(); }, get mouseY() { return a(); }, set mouseY(v) { - a(v), Rt(); + a(v), Nt(); }, get requestRoundChange() { return l(); }, - set requestRoundChange(v = (_) => { + set requestRoundChange(v = (g) => { }) { - l(v), Rt(); + l(v), Nt(); }, get candidateColors() { - return o(); + return u(); }, set candidateColors(v = []) { - o(v), Rt(); + u(v), Nt(); } }); } ys( - Ks, + Xs, { jsonData: {}, currentRound: {}, @@ -4193,66 +4207,125 @@ ys( candidateColors: {} }, [], - ["runFullAnimationFn", "animateOnePhaseFn"], + [ + "pieColors", + "exhaustedLabel", + "countExhaustedVotes", + "getEliminatedCandidates", + "getElectedCandidates", + "runFullAnimationFn", + "animateOnePhaseFn" + ], !0 ); function sc(t) { const e = []; - if (!t || typeof t != "object") + if (!t || typeof t != "object" || Array.isArray(t)) return { valid: !1, errors: ["Input is not a valid object"] }; - if (t.config ? t.config.contest || e.push("Config is missing contest name") : e.push("Config is missing"), !t.results || !Array.isArray(t.results)) + const n = /* @__PURE__ */ new Set(["config", "jsonFormatVersion", "results", "summary"]), r = /* @__PURE__ */ new Set(["contest", "date", "generatedBy", "jurisdiction", "office"]), i = /* @__PURE__ */ new Set(["inactiveBallots", "round", "tally", "tallyResults", "threshold"]), s = /* @__PURE__ */ new Set(["exhaustedChoices", "overvotes", "repeatedRankings", "skippedRankings"]), a = /* @__PURE__ */ new Set(["elected", "eliminated", "transfers"]), l = /* @__PURE__ */ new Set(["finalThreshold", "numCandidates", "numWinners", "totalNumBallots", "undervotes"]); + for (const h of Object.keys(t)) + n.has(h) || e.push(`Unexpected field in RCtabSummary: "${h}"`); + if (!t.config) + e.push("Config is missing"); + else if (typeof t.config != "object" || Array.isArray(t.config)) + e.push("Config must be an object"); + else { + for (const h of Object.keys(t.config)) + r.has(h) || e.push(`Unexpected field in config: "${h}"`); + t.config.contest || e.push("Config is missing contest name"); + } + if (t.jsonFormatVersion || e.push("jsonFormatVersion is missing"), !t.results) + return e.push("Results are missing"), { valid: e.length === 0, errors: e }; + if (!Array.isArray(t.results)) return e.push("Results must be an array"), { valid: e.length === 0, errors: e }; if (t.results.length === 0) return e.push("Results array is empty"), { valid: e.length === 0, errors: e }; - let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = 0; - for (let s = 0; s < t.results.length; s++) { - const a = t.results[s]; - if (typeof a.round != "number" ? e.push(`Round ${s} is missing a round number`) : s === 0 && a.round !== 1 ? e.push(`First round number should be 1, found ${a.round}`) : s > 0 && a.round !== i + 1 && e.push(`Round numbers should be sequential. Expected ${i + 1}, found ${a.round}`), i = a.round, !a.tally || typeof a.tally != "object") { - e.push(`Round ${a.round} is missing a valid tally`); + let u = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), o = 0; + for (let h = 0; h < t.results.length; h++) { + const c = t.results[h]; + for (const d of Object.keys(c)) + i.has(d) || e.push(`Round ${h + 1}: Unexpected field in results: "${d}"`); + if (typeof c.round != "number" ? e.push(`Round ${h + 1} is missing a round number`) : h === 0 && c.round !== 1 ? e.push(`First round number should be 1, found ${c.round}`) : h > 0 && c.round !== o + 1 && e.push(`Round numbers should be sequential. Expected ${o + 1}, found ${c.round}`), o = c.round || h + 1, !c.inactiveBallots) + e.push(`Round ${o}: inactiveBallots is missing`); + else if (typeof c.inactiveBallots != "object" || Array.isArray(c.inactiveBallots)) + e.push(`Round ${o}: inactiveBallots must be an object`); + else + for (const d of Object.keys(c.inactiveBallots)) + s.has(d) || e.push(`Round ${o}: Unexpected field in inactiveBallots: "${d}"`); + if (!c.tally) { + e.push(`Round ${o} is missing a tally`); continue; } - if (s === 0) - n = new Set(Object.keys(a.tally)), r = new Set(n); + if (typeof c.tally != "object" || Array.isArray(c.tally)) { + e.push(`Round ${o}: tally must be an object`); + continue; + } + if (h === 0) + u = new Set(Object.keys(c.tally)), f = new Set(u); else { - const l = new Set(Object.keys(a.tally)), o = [...l].filter((f) => !n.has(f)); - o.length > 0 && e.push(`Round ${a.round} contains new candidates not present in earlier rounds: ${o.join(", ")}`), r = l; + const d = new Set(Object.keys(c.tally)), p = [...d].filter((y) => !u.has(y)); + p.length > 0 && e.push(`Round ${o} contains new candidates not present in earlier rounds: ${p.join(", ")}`), f = d; } - if (!a.tallyResults || !Array.isArray(a.tallyResults)) { - e.push(`Round ${a.round} is missing tallyResults array`); + if (c.threshold || e.push(`Round ${o}: threshold is missing`), !c.tallyResults) { + e.push(`Round ${o} is missing tallyResults`); continue; } - for (const l of a.tallyResults) { - l.elected !== void 0 && l.eliminated !== void 0 ? e.push(`Round ${a.round} has a result with both elected and eliminated set`) : l.elected === void 0 && l.eliminated === void 0 && e.push(`Round ${a.round} has a result with neither elected nor eliminated set`); - const o = l.elected || l.eliminated; - if (o && !r.has(o) && e.push(`Round ${a.round} references candidate "${o}" who is not in the current candidate list`), !l.transfers || typeof l.transfers != "object") { - e.push(`Round ${a.round} has a result missing transfers`); + if (!Array.isArray(c.tallyResults)) { + e.push(`Round ${o}: tallyResults must be an array`); + continue; + } + for (let d = 0; d < c.tallyResults.length; d++) { + const p = c.tallyResults[d]; + for (const _ of Object.keys(p)) + a.has(_) || e.push(`Round ${o}, tallyResult ${d + 1}: Unexpected field: "${_}"`); + p.elected !== void 0 && p.eliminated !== void 0 ? e.push(`Round ${o}, tallyResult ${d + 1}: has both elected and eliminated set`) : p.elected === void 0 && p.eliminated === void 0 && e.push(`Round ${o}, tallyResult ${d + 1}: has neither elected nor eliminated set`); + const y = p.elected || p.eliminated; + if (y && !f.has(y) && e.push(`Round ${o}, tallyResult ${d + 1}: references candidate "${y}" who is not in the current candidate list`), !p.transfers) { + e.push(`Round ${o}, tallyResult ${d + 1}: missing transfers`); + continue; + } + if (typeof p.transfers != "object" || Array.isArray(p.transfers)) { + e.push(`Round ${o}, tallyResult ${d + 1}: transfers must be an object`); continue; } - const f = Object.keys(l.transfers); - for (const u of f) - u !== "exhausted" && !r.has(u) && e.push(`Round ${a.round} transfers votes to "${u}" who is not in the current candidate list`); - if (l.eliminated && o) { - const u = parseFloat(a.tally[o] || "0"); - let h = 0; - for (const c of Object.values(l.transfers)) { - const d = parseFloat(c || "0"); - isNaN(d) || (h += d); + const R = Object.keys(p.transfers); + for (const _ of R) + _ !== "exhausted" && _ !== "residual surplus" && !f.has(_) && e.push(`Round ${o}, tallyResult ${d + 1}: transfers votes to "${_}" who is not in the current candidate list`); + if (p.eliminated && y) { + const _ = parseFloat(c.tally[y] || "0"); + let $ = 0; + for (const T of Object.values(p.transfers)) { + const M = parseFloat(T || "0"); + isNaN(M) || ($ += M); } - Math.abs(u - h) > 1e-4 && e.push(`Round ${a.round}: Eliminated candidate "${o}" had ${u} votes but transferred ${h}`); + Math.abs(_ - $) > 1e-4 && e.push(`Round ${o}: Eliminated candidate "${y}" had ${_} votes but transferred ${$}`); } - o && r.delete(o); + y && f.delete(y); } } + if (!t.summary) + e.push("Summary is missing"); + else if (typeof t.summary != "object" || Array.isArray(t.summary)) + e.push("Summary must be an object"); + else { + for (const c of Object.keys(t.summary)) + l.has(c) || e.push(`Unexpected field in summary: "${c}"`); + const h = ["finalThreshold", "numCandidates", "numWinners", "totalNumBallots"]; + for (const c of h) + t.summary[c] === void 0 && e.push(`Summary is missing required field: "${c}"`); + } return { valid: e.length === 0, errors: e }; } -var ac = /* @__PURE__ */ Le("  ", 1), lc = /* @__PURE__ */ Le("About to eliminate: ", 1), oc = /* @__PURE__ */ Le("  ", 1), uc = /* @__PURE__ */ Le("Elected: ", 1), fc = /* @__PURE__ */ Le("
", 1), cc = /* @__PURE__ */ Le('


these ballots have already been eliminated.
', 1); +var ac = /* @__PURE__ */ He("  ", 1), lc = /* @__PURE__ */ He("About to eliminate: ", 1), oc = /* @__PURE__ */ He("  ", 1), uc = /* @__PURE__ */ He("Elected: ", 1), fc = /* @__PURE__ */ He("
", 1), cc = /* @__PURE__ */ He('


these ballots have already been eliminated.
', 1); const hc = { - hash: "svelte-hac7qn", - code: `.page-container.svelte-hac7qn {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-hac7qn {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-hac7qn {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:1.3rem;left:50%;transform:translate(-50%);font-weight:bold;opacity:0;}.tooltip.svelte-hac7qn h3:where(.svelte-hac7qn) {text-align:center;}.animation-button-container.svelte-hac7qn {display:flex;justify-content:center;gap:10px;margin-bottom:1rem;}.pie-chart-container.svelte-hac7qn { - /* width: 65%; */width:90%;min-width:800px; /* Larger minimum size */flex-grow:0; /* Don't grow beyond specified width */margin:0 auto;margin-right:40px; /* Add extra space on right */}.visualizations-container.svelte-hac7qn {display:flex;justify-content:space-between;width:100%;padding:0 20px;gap:80px;} + hash: "svelte-1gmy47u", + code: `.page-container.svelte-1gmy47u {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-1gmy47u {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-1gmy47u {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:1.3rem;left:50%;transform:translate(-50%);font-weight:bold;opacity:0;}.tooltip.svelte-1gmy47u h3:where(.svelte-1gmy47u) {text-align:center;}.animation-button-container.svelte-1gmy47u {display:flex;justify-content:center;gap:10px;margin-bottom:1rem;}.pie-chart-container.svelte-1gmy47u { + /* 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:-5vh;}.visualizations-container.svelte-1gmy47u {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 @@ -4281,198 +4354,225 @@ const hc = { /* Media query for smaller screens */ -@media (max-width: 1300px) {.visualizations-container.svelte-hac7qn {flex-direction:column;align-items:center;} +@media (max-width: 1300px) {.visualizations-container.svelte-1gmy47u {flex-direction:column;align-items:center;} +} + +@media (max-width: 768px) {.page-container.svelte-1gmy47u {padding:0 10px; /* Reduce padding on smaller screens */}.visualizations-container.svelte-1gmy47u {padding:0; /* Remove padding on small screens */} +}.common-header.svelte-1gmy47u {width:100%;margin-bottom:1rem;text-align:center;} + +@media (max-width: 768px) {.common-header.svelte-1gmy47u {margin-bottom:0.5rem;}h3.svelte-1gmy47u, h4.svelte-1gmy47u {margin:0.3rem 0;font-size:0.9rem;}.animation-button-container.svelte-1gmy47u {margin-bottom:0.5rem;}.pie-chart-container.svelte-1gmy47u {margin-top:-3vh;} }` }; function dc(t, e) { - jr(e, !0), gs(t, hc); + Kr(e, !0), _s(t, hc); const n = 0.85; - let r = kt(e, "electionSummary", 7), i = kt(e, "currentRound", 7), s = kt(e, "requestRoundChange", 7, (x) => { - }), a = kt(e, "candidateColors", 23, () => []), l = Zt(null), o = Zt(null), f = Zt(""), u = Zt(wt([])), h = Zt(""), c = Zt(""), d = Zt(0), p = /* @__PURE__ */ Qn(() => w(r())); - function w(x) { - if (typeof x == "string") + let r = Mt(e, "electionSummary", 7), i = Mt(e, "currentRound", 7, 1), s = Mt(e, "requestRoundChange", 7, (w) => { + }), a = Mt(e, "candidateColors", 23, () => []), l = ee(null), u = ee(null), f = ee(""), o = ee(bt([])), h = ee(""), c = ee(""), d = ee(0), p = /* @__PURE__ */ tr(() => y(r())); + function y(w) { + if (typeof w == "string") try { - x = JSON.parse(x); + w = JSON.parse(w); } catch (q) { return console.error("Failed to parse JSON string:", q), {}; } - return console.log("RCtabSummary object status: ", sc(x)), x || {}; + return console.log("RCtabSummary object status: ", sc(w)), w || {}; } - function $(x) { - s() ? (console.log("onRoundChange in PieChart: passing on request for round ", x), s()(x)) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); + function R(w) { + s() ? (console.log("onRoundChange in PieChart: passing on request for round ", w), s()(w)) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } - function m() { - switch (g(h)) { + function _() { + switch (x(h)) { case "enter": - ((x) => (j(u, wt(x[0])), j(f, wt(x[1]))))(C(g(c), i())), g(l) && (g(l).style.top = String(g(d) || 20) + "px", g(l).style.opacity = String(n)); + ((w) => (W(o, bt(w[0])), W(f, bt(w[1]))))(T(x(c), i())), x(l) && (x(l).style.top = String(x(d) || 20) + "px", x(l).style.opacity = String(n)); break; case "leave": - g(l) && (g(l).style.opacity = "0"), j(u, wt([])), j(f, ""); + x(l) && (x(l).style.opacity = "0"), W(o, bt([])), W(f, ""); break; case "show-exhausted": - g(o) && (g(o).style.top = String(g(d) || 20) + "px", g(o).style.opacity = String(n)); + x(u) && (x(u).style.top = String(x(d) || 20) + "px", x(u).style.opacity = String(n)); break; case "hide-exhausted": - g(o) && (g(o).style.opacity = "0"); + x(u) && (x(u).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", g(h)); + console.log("Unknown mouse event: ", x(h)); break; } } - Xr(() => m()); - function A(x, q) { - return x == 1 ? q ? "vote was" : "vote will be" : q ? "votes were" : "votes will be"; - } - function C(x, q) { - const Y = [], nt = x === "exhausted" ? Mr : x; - let rt; - x == "exhausted" ? rt = jn(g(p), 1) : rt = g(p).results[0].tally[x], Y.push(`${nt} started with ${rt} votes.`); - for (let K = 1; K <= q; K++) { - K === q && (x == "exhausted" ? rt = jn(g(p), q) : rt = g(p).results[q - 1].tally[x], Y.push(`${nt} has ${rt} votes at round ${q}.`)); - const ft = g(p).results[K - 1].tallyResults; - for (let $t = 0; $t < ft.length; $t++) { - const He = ft[$t].transfers, Re = ft[$t].eliminated, ln = ft[$t].elected; - if (Re) - Re === x && Y.push(`${nt} will be eliminated on round ${K}.`); - else if (x === ln && (Y.push(`${nt} was elected on round ${K}.`), He)) - for (let [ge, un] of Object.entries(He)) - Y.push(`${un} ${A(Number(un), K < q)} transferred to ${ge} on round ${K}.`); - const on = Re || ln; - if (on) { - const ge = Number(He[x]); - ge && Y.push(`${ge} ${A(ge, K < q)} transferred from ${on} on round ${K}.`); + Ur(() => _()); + function $(w, q) { + return w == 1 ? q ? "vote was" : "vote will be" : q ? "votes were" : "votes will be"; + } + function T(w, q) { + const K = [], Y = w === "exhausted" ? H() : w; + let st; + w == "exhausted" ? st = J(1) : st = x(p).results[0].tally[w], K.push(`${Y} started with ${st} votes.`); + for (let tt = 1; tt <= q; tt++) { + tt === q && (w == "exhausted" ? st = J(q) : st = x(p).results[q - 1].tally[w], K.push(`${Y} has ${st} votes at round ${q}.`)); + const rt = x(p).results[tt - 1].tallyResults; + for (let Rt = 0; Rt < rt.length; Rt++) { + const Zt = rt[Rt].transfers, Ne = rt[Rt].eliminated, cn = rt[Rt].elected; + if (Ne) + Ne === w && K.push(`${Y} will be eliminated on round ${tt}.`); + else if (w === cn && (K.push(`${Y} was elected on round ${tt}.`), Zt)) + for (let [ye, dn] of Object.entries(Zt)) + K.push(`${dn} ${$(Number(dn), tt < q)} transferred to ${ye} on round ${tt}.`); + const hn = Ne || cn; + if (hn) { + const ye = Number(Zt[w]); + ye && K.push(`${ye} ${$(ye, tt < q)} transferred from ${hn} on round ${tt}.`); } } } - return [Y, nt]; + return [K, Y]; } function M() { - let x = 0; - for (let q = 1; q <= g(p).results.length; q++) { - const Y = g(p).results[q - 1].tallyResults; - for (let nt = 0; nt < Y.length; nt++) - Y[nt].elected && x++; + let w = 0; + for (let q = 1; q <= x(p).results.length; q++) { + const K = x(p).results[q - 1].tallyResults; + for (let Y = 0; Y < K.length; Y++) + K[Y].elected && w++; } - return x; - } - let R; - function D() { - R && R.animateOnePhaseFn && R.animateOnePhaseFn(); - } - function G() { - R && R.runFullAnimationFn && R.runFullAnimationFn(); - } - var W = cc(), et = Ce(W), Q = mt(et); - Q.__click = G; - var B = Ht(Q, 2); - B.__click = D, gt(et); - var I = Ht(et, 2), b = mt(I), L = mt(b), bt = mt(L); - gt(L); - var It = Ht(L, 2), Nt = mt(It); + return w; + } + let b; + function P(w) { + return b ? b.getEliminatedCandidates(w) : []; + } + function z(w) { + return b ? b.getElectedCandidates(w) : []; + } + function J(w) { + return b ? b.countExhaustedVotes(w) : 0; + } + function it() { + b && b.animateOnePhaseFn && b.animateOnePhaseFn(); + } + function nt() { + b && b.runFullAnimationFn && b.runFullAnimationFn(); + } + function H() { + return b ? b.exhaustedLabel : ""; + } + function F() { + return b ? b.pieColors : {}; + } + var E = cc(), L = Te(E), G = wt(L); + G.__click = nt; + var he = Ht(G, 2); + he.__click = it, yt(L); + var At = Ht(L, 2), _t = wt(At), It = wt(_t), ft = wt(It); + yt(It); + var Lt = Ht(It, 2), St = wt(Lt); { - var at = (x) => { - var q = lc(), Y = Ht(Ce(q)); - dr(Y, 17, () => Wn(g(p), i()), hr, (nt, rt) => { - var K = ac(), ft = Ce(K), $t = mt(ft, !0); - gt(ft), hn(), dn(() => { - yi(ft, "color", Qt[g(rt)]), Be($t, g(rt)); - }), ce(nt, K); - }), ce(x, q); + var de = (w) => { + var q = lc(), K = Ht(Te(q)); + vr(K, 17, () => P(i()), dr, (Y, st) => { + var tt = ac(), rt = Te(tt), Rt = wt(rt, !0); + yt(rt), gn(), _n( + (Zt) => { + yi(rt, "color", Zt), Se(Rt, x(st)); + }, + [() => F()[x(st)]] + ), ve(Y, tt); + }), ve(w, q); }; - gi(Nt, (x) => { - Wn(g(p), i()).length > 0 && x(at); + _i(St, (w) => { + P(i()).length > 0 && w(de); }); } - var Kt = Ht(Nt, 2); + var _e = Ht(St, 2); { - var jt = (x) => { - var q = uc(), Y = Ht(Ce(q)); - dr(Y, 17, () => Jn(g(p), i()), hr, (nt, rt) => { - var K = oc(), ft = Ce(K), $t = mt(ft, !0); - gt(ft), hn(), dn(() => { - yi(ft, "color", Qt[g(rt)]), Be($t, g(rt)); - }), ce(nt, K); - }), ce(x, q); + var mt = (w) => { + var q = uc(), K = Ht(Te(q)); + vr(K, 17, () => z(i()), dr, (Y, st) => { + var tt = oc(), rt = Te(tt), Rt = wt(rt, !0); + yt(rt), gn(), _n( + (Zt) => { + yi(rt, "color", Zt), Se(Rt, x(st)); + }, + [() => F()[x(st)]] + ), ve(Y, tt); + }), ve(w, q); }; - gi(Kt, (x) => { - Jn(g(p), i()).length > 0 && x(jt); + _i(_e, (w) => { + z(i()).length > 0 && w(mt); }); } - gt(It), gt(b); - var Tt = Ht(b, 2), Ft = mt(Tt), ve = mt(Ft, !0); - gt(Ft); - var pe = Ht(Ft, 2); - dr(pe, 17, () => g(u), hr, (x, q) => { - var Y = fc(), nt = Ce(Y), rt = mt(nt, !0); - gt(nt), hn(2), dn(() => Be(rt, g(q))), ce(x, Y); - }), gt(Tt), bn(Tt, (x) => j(l, x), () => g(l)); - var it = Ht(Tt, 2), _e = mt(it); - _e.nodeValue = `"${Mr}" means all the candidates ranked on `, hn(2), gt(it), bn(it, (x) => j(o, x), () => g(o)); - var fe = Ht(it, 2), qt = mt(fe), Lt = mt(qt); - return bn( - Ks(Lt, { + yt(Lt), yt(_t); + var qt = Ht(_t, 2), Vt = wt(qt), Kt = wt(Vt, !0); + yt(Vt); + var Wt = Ht(Vt, 2); + vr(Wt, 17, () => x(o), dr, (w, q) => { + var K = fc(), Y = Te(K), st = wt(Y, !0); + yt(Y), gn(2), _n(() => Se(st, x(q))), ve(w, K); + }), yt(qt), En(qt, (w) => W(l, w), () => x(l)); + var Jt = Ht(qt, 2), me = wt(Jt); + gn(2), yt(Jt), En(Jt, (w) => W(u, w), () => x(u)); + var un = Ht(Jt, 2), fn = wt(un), ze = wt(fn); + return En( + Xs(ze, { get jsonData() { - return g(p); + return x(p); }, get currentRound() { return i(); }, - requestRoundChange: $, + requestRoundChange: R, get candidateColors() { return a(); }, get mouseEventType() { - return g(h); + return x(h); }, - set mouseEventType(x) { - j(h, wt(x)); + set mouseEventType(w) { + W(h, bt(w)); }, get mouseData() { - return g(c); + return x(c); }, - set mouseData(x) { - j(c, wt(x)); + set mouseData(w) { + W(c, bt(w)); }, get mouseY() { - return g(d); + return x(d); }, - set mouseY(x) { - j(d, wt(x)); + set mouseY(w) { + W(d, bt(w)); } }), - (x) => R = x, - () => R - ), gt(qt), gt(fe), gt(I), dn( - (x) => { - Be(bt, `${g(p).config.contest ?? ""}, ${x ?? ""} to be elected, Round ${i() ?? ""}.`), Be(ve, g(f)); + (w) => b = w, + () => b + ), yt(fn), yt(un), yt(At), _n( + (w, q) => { + Se(ft, `${x(p).config.contest ?? ""}, ${w ?? ""} to be elected, Round ${i() ?? ""}.`), Se(Kt, x(f)), Se(me, `"${q ?? ""}" means all the candidates ranked on `); }, - [M] - ), ce(t, W), Wr({ + [M, H] + ), ve(t, E), Wr({ get electionSummary() { return r(); }, - set electionSummary(x) { - r(x), Rt(); + set electionSummary(w) { + r(w), Nt(); }, get currentRound() { return i(); }, - set currentRound(x) { - i(x), Rt(); + set currentRound(w = 1) { + i(w), Nt(); }, get requestRoundChange() { return s(); }, - set requestRoundChange(x = (q) => { + set requestRoundChange(w = (q) => { }) { - s(x), Rt(); + s(w), Nt(); }, get candidateColors() { return a(); }, - set candidateColors(x = []) { - a(x), Rt(); + set candidateColors(w = []) { + a(w), Nt(); } }); } From f95f093b995533b378450e954abac493d07a8c1f Mon Sep 17 00:00:00 2001 From: Armin Samii Date: Wed, 19 Mar 2025 22:36:01 -0700 Subject: [PATCH 16/18] fix embedded visualization --- static/share/share.js | 2 +- templates/pie/pie-nonblocking.html | 6 +++--- visualizer/tests/testLiveBrowserHeadless.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/static/share/share.js b/static/share/share.js index 3f6adb68..059bdf94 100644 --- a/static/share/share.js +++ b/static/share/share.js @@ -21,7 +21,7 @@ function initializeOptions() ["Table, By Round (Interactive)", "table-by-round"], ["Table, By Round (Static)", "table-by-round-static"], ["Table, By Candidate", "table-by-candidate"], - ["Pie Chart", "pie-chart"] + ["Pie Chart", "pie"] ]; for (const selector of ["exportVistypeSelector", "embedlyVistypeSelector"]) diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 01b2ebd2..c716fef7 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -27,9 +27,9 @@ trs_createSliderAndTimeline({ wrapperDivId: 'pie-slider-container', - numTicks: numRounds, - tickText: generateTickTexts(numRounds), - hideActiveTickText: doHideActiveTickText(numRounds), + numTicks: {{ config.numRounds }}, + tickText: generateTickTexts({{ config.numRounds }}), + hideActiveTickText: doHideActiveTickText({{ config.numRounds }}), sliderValueChanged: goToRoundSvelte, timelineData: generateTimelineData(humanFriendlyEventsPerRound), timelinePeeking: !config.doUseDescriptionInsteadOfTimeline, diff --git a/visualizer/tests/testLiveBrowserHeadless.py b/visualizer/tests/testLiveBrowserHeadless.py index 3ff00092..5a9bec37 100644 --- a/visualizer/tests/testLiveBrowserHeadless.py +++ b/visualizer/tests/testLiveBrowserHeadless.py @@ -183,7 +183,7 @@ def test_legacy_embedded_urls(self): "tabular-by-round", "tabular-by-round-interactive", "tabular-candidate-by-round", - "pie-chart" + "pie" ] # None of the valid vistypes have errors From c006c663b142bf12f9e1a63bafa92cf99cae56a2 Mon Sep 17 00:00:00 2001 From: skaphan Date: Thu, 20 Mar 2025 17:04:52 -0700 Subject: [PATCH 17/18] Continuing work on responsiveness and scaling. --- static/pie/pie-chart.es.js | 2799 ++++++++++++++-------------- templates/pie/pie-nonblocking.html | 17 +- 2 files changed, 1423 insertions(+), 1393 deletions(-) diff --git a/static/pie/pie-chart.es.js b/static/pie/pie-chart.es.js index 46c1d6bf..b6d1c52b 100644 --- a/static/pie/pie-chart.es.js +++ b/static/pie/pie-chart.es.js @@ -1,74 +1,74 @@ -var fa = Object.defineProperty; -var ui = (t) => { +var ca = Object.defineProperty; +var oi = (t) => { throw TypeError(t); }; -var ca = (t, e, n) => e in t ? fa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var kt = (t, e, n) => ca(t, typeof e != "symbol" ? e + "" : e, n), fi = (t, e, n) => e.has(t) || ui("Cannot " + n); -var ct = (t, e, n) => (fi(t, e, "read from private field"), n ? n.call(t) : e.get(t)), cr = (t, e, n) => e.has(t) ? ui("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), hr = (t, e, n, r) => (fi(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); -const ha = "5"; -typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(ha); -const da = 1, va = 2, pa = 16, ga = 1, _a = 4, ma = 8, ya = 16, wa = 2, Li = "[", Or = "[!", Pr = "]", We = {}, ht = Symbol(), ci = !1, Dt = 2, qi = 4, Dr = 8, Fr = 16, ue = 32, qe = 64, On = 128, Tt = 256, Pn = 512, gt = 1024, fe = 2048, Ve = 4096, se = 8192, Qn = 16384, xa = 32768, Ir = 65536, ba = 1 << 19, Vi = 1 << 20, Je = Symbol("$state"), Bi = Symbol("legacy props"); -var Lr = Array.isArray, $a = Array.prototype.indexOf, qr = Array.from, Dn = Object.keys, Fn = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, Aa = Object.prototype, Ra = Array.prototype, Ea = Object.getPrototypeOf; +var ha = (t, e, n) => e in t ? ca(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var Ft = (t, e, n) => ha(t, typeof e != "symbol" ? e + "" : e, n), ui = (t, e, n) => e.has(t) || oi("Cannot " + n); +var ht = (t, e, n) => (ui(t, e, "read from private field"), n ? n.call(t) : e.get(t)), fr = (t, e, n) => e.has(t) ? oi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), cr = (t, e, n, r) => (ui(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n); +const da = "5"; +typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(da); +const va = 1, pa = 2, ga = 16, _a = 1, ma = 4, ya = 8, wa = 16, xa = 2, Li = "[", Mr = "[!", Or = "]", tn = {}, dt = Symbol(), fi = !1, Vt = 2, qi = 4, Pr = 8, Dr = 16, ce = 32, Ye = 64, Mn = 128, Mt = 256, On = 512, _t = 1024, he = 2048, ze = 4096, le = 8192, Jn = 16384, ba = 32768, Fr = 65536, $a = 1 << 19, Vi = 1 << 20, en = Symbol("$state"), Bi = Symbol("legacy props"); +var Ir = Array.isArray, Aa = Array.prototype.indexOf, Lr = Array.from, Pn = Object.keys, Dn = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, Ra = Object.prototype, Ea = Array.prototype, Ca = Object.getPrototypeOf; function Hi(t) { for (var e = 0; e < t.length; e++) t[e](); } -let Qe = [], yr = []; +let rn = [], mr = []; function Yi() { - var t = Qe; - Qe = [], Hi(t); + var t = rn; + rn = [], Hi(t); } -function Ca() { - var t = yr; - yr = [], Hi(t); +function Na() { + var t = mr; + mr = [], Hi(t); } function zi(t) { - Qe.length === 0 && queueMicrotask(Yi), Qe.push(t); + rn.length === 0 && queueMicrotask(Yi), rn.push(t); } -function hi() { - Qe.length > 0 && Yi(), yr.length > 0 && Ca(); +function ci() { + rn.length > 0 && Yi(), mr.length > 0 && Na(); } function Ui(t) { return t === this.v; } -function Na(t, e) { +function Ta(t, e) { return t != t ? e == e : t !== e || t !== null && typeof t == "object" || typeof t == "function"; } -function Vr(t) { - return !Na(t, this.v); +function qr(t) { + return !Ta(t, this.v); } -function Ta(t) { +function Sa(t) { throw new Error("https://svelte.dev/e/effect_in_teardown"); } -function Sa() { +function ka() { throw new Error("https://svelte.dev/e/effect_in_unowned_derived"); } -function ka(t) { +function Ma(t) { throw new Error("https://svelte.dev/e/effect_orphan"); } -function Ma() { +function Oa() { throw new Error("https://svelte.dev/e/effect_update_depth_exceeded"); } -function Oa() { +function Pa() { throw new Error("https://svelte.dev/e/hydration_failed"); } -function Pa(t) { +function Da(t) { throw new Error("https://svelte.dev/e/props_invalid_value"); } -function Da() { +function Fa() { throw new Error("https://svelte.dev/e/state_descriptors_fixed"); } -function Fa() { +function Ia() { throw new Error("https://svelte.dev/e/state_prototype_fixed"); } -function Ia() { +function La() { throw new Error("https://svelte.dev/e/state_unsafe_local_read"); } -function La() { +function qa() { throw new Error("https://svelte.dev/e/state_unsafe_mutation"); } -let qa = !1; -function Ct(t, e) { +let Va = !1; +function St(t, e) { var n = { f: 0, // TODO ideally we could skip this altogether, but it causes type errors @@ -80,49 +80,49 @@ function Ct(t, e) { }; return n; } -function ee(t) { - return /* @__PURE__ */ Va(Ct(t)); +function re(t) { + return /* @__PURE__ */ Ba(St(t)); } // @__NO_SIDE_EFFECTS__ -function Br(t, e = !1) { - const n = Ct(t); - return e || (n.equals = Vr), n; +function Vr(t, e = !1) { + const n = St(t); + return e || (n.equals = qr), n; } // @__NO_SIDE_EFFECTS__ -function Va(t) { - return j !== null && !Ot && j.f & Dt && (Ut === null ? za([t]) : Ut.push(t)), t; +function Ba(t) { + return j !== null && !Lt && j.f & Vt && (Kt === null ? Ua([t]) : Kt.push(t)), t; } function W(t, e) { - return j !== null && !Ot && cs() && j.f & (Dt | Fr) && // If the source was created locally within the current derived, then + return j !== null && !Lt && cs() && j.f & (Vt | Dr) && // If the source was created locally within the current derived, then // we allow the mutation. - (Ut === null || !Ut.includes(t)) && La(), ji(t, e); + (Kt === null || !Kt.includes(t)) && qa(), ji(t, e); } function ji(t, e) { - return t.equals(e) || (t.v, t.v = e, t.wv = es(), Xi(t, fe), X !== null && X.f & gt && !(X.f & (ue | qe)) && (ne === null ? Ua([t]) : ne.push(t))), e; + return t.equals(e) || (t.v, t.v = e, t.wv = es(), Xi(t, he), X !== null && X.f & _t && !(X.f & (ce | Ye)) && (ie === null ? ja([t]) : ie.push(t))), e; } function Xi(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; - a & fe || (ae(s, e), a & (gt | Tt) && (a & Dt ? Xi( + a & he || (oe(s, e), a & (_t | Mt) && (a & Vt ? Xi( /** @type {Derived} */ s, - Ve - ) : rr( + ze + ) : er( /** @type {Effect} */ s ))); } } // @__NO_SIDE_EFFECTS__ -function tr(t) { - var e = Dt | fe, n = j !== null && j.f & Dt ? ( +function Zn(t) { + var e = Vt | he, n = j !== null && j.f & Vt ? ( /** @type {Derived} */ j ) : null; - return X === null || n !== null && n.f & Tt ? e |= Tt : X.f |= Vi, { - ctx: pt, + return X === null || n !== null && n.f & Mt ? e |= Mt : X.f |= Vi, { + ctx: gt, deps: null, effects: null, equals: Ui, @@ -139,24 +139,24 @@ function tr(t) { }; } // @__NO_SIDE_EFFECTS__ -function Ba(t) { - const e = /* @__PURE__ */ tr(t); - return e.equals = Vr, e; +function Ha(t) { + const e = /* @__PURE__ */ Zn(t); + return e.equals = qr, e; } function Gi(t) { var e = t.effects; if (e !== null) { t.effects = null; for (var n = 0; n < e.length; n += 1) - le( + ue( /** @type {Effect} */ e[n] ); } } -function Ha(t) { +function Ya(t) { for (var e = t.parent; e !== null; ) { - if (!(e.f & Dt)) + if (!(e.f & Vt)) return ( /** @type {Effect} */ e @@ -165,81 +165,81 @@ function Ha(t) { } return null; } -function Ya(t) { +function za(t) { var e, n = X; - Fe(Ha(t)); + Ve(Ya(t)); try { Gi(t), e = rs(t); } finally { - Fe(n); + Ve(n); } return e; } function Ki(t) { - var e = Ya(t), n = (ge || t.f & Tt) && t.deps !== null ? Ve : gt; - ae(t, n), t.equals(e) || (t.v = e, t.wv = es()); + var e = za(t), n = (ye || t.f & Mt) && t.deps !== null ? ze : _t; + oe(t, n), t.equals(e) || (t.v = e, t.wv = es()); } -function Hr(t) { +function Br(t) { console.warn("https://svelte.dev/e/hydration_mismatch"); } -let Q = !1; -function ie(t) { - Q = t; +let tt = !1; +function ae(t) { + tt = t; } let U; -function Xt(t) { +function Bt(t) { if (t === null) - throw Hr(), We; + throw Br(), tn; return U = t; } -function er() { - return Xt( +function Qn() { + return Bt( /** @type {TemplateNode} */ - /* @__PURE__ */ ce(U) + /* @__PURE__ */ de(U) ); } -function yt(t) { - if (Q) { - if (/* @__PURE__ */ ce(U) !== null) - throw Hr(), We; +function Et(t) { + if (tt) { + if (/* @__PURE__ */ de(U) !== null) + throw Br(), tn; U = t; } } -function gn(t = 1) { - if (Q) { +function hi(t = 1) { + if (tt) { for (var e = t, n = U; e--; ) n = /** @type {TemplateNode} */ - /* @__PURE__ */ ce(n); + /* @__PURE__ */ de(n); U = n; } } -function wr() { +function yr() { for (var t = 0, e = U; ; ) { if (e.nodeType === 8) { var n = ( /** @type {Comment} */ e.data ); - if (n === Pr) { + if (n === Or) { if (t === 0) return e; t -= 1; - } else (n === Li || n === Or) && (t += 1); + } else (n === Li || n === Mr) && (t += 1); } var r = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ce(e) + /* @__PURE__ */ de(e) ); e.remove(), e = r; } } -function bt(t, e = null, n) { - if (typeof t != "object" || t === null || Je in t) +function $t(t, e = null, n) { + if (typeof t != "object" || t === null || en in t) return t; - const r = Ea(t); - if (r !== Aa && r !== Ra) + const r = Ca(t); + if (r !== Ra && r !== Ea) return t; - var i = /* @__PURE__ */ new Map(), s = Lr(t), a = Ct(0); - s && i.set("length", Ct( + var i = /* @__PURE__ */ new Map(), s = Ir(t), a = St(0); + s && i.set("length", St( /** @type {any[]} */ t.length )); @@ -249,14 +249,14 @@ function bt(t, e = null, n) { t, { defineProperty(u, f, o) { - (!("value" in o) || o.configurable === !1 || o.enumerable === !1 || o.writable === !1) && Da(); + (!("value" in o) || o.configurable === !1 || o.enumerable === !1 || o.writable === !1) && Fa(); var h = i.get(f); - return h === void 0 ? (h = Ct(o.value), i.set(f, h)) : W(h, bt(o.value, l)), !0; + return h === void 0 ? (h = St(o.value), i.set(f, h)) : W(h, $t(o.value, l)), !0; }, deleteProperty(u, f) { var o = i.get(f); if (o === void 0) - f in u && i.set(f, Ct(ht)); + f in u && i.set(f, St(dt)); else { if (s && typeof f == "string") { var h = ( @@ -265,18 +265,18 @@ function bt(t, e = null, n) { ), c = Number(f); Number.isInteger(c) && c < h.v && W(h, c); } - W(o, ht), di(a); + W(o, dt), di(a); } return !0; }, get(u, f, o) { var p; - if (f === Je) + if (f === en) return t; var h = i.get(f), c = f in u; - if (h === void 0 && (!c || (p = $e(u, f)) != null && p.writable) && (h = Ct(bt(c ? u[f] : ht, l)), i.set(f, h)), h !== void 0) { - var d = x(h); - return d === ht ? void 0 : d; + if (h === void 0 && (!c || (p = Re(u, f)) != null && p.writable) && (h = St($t(c ? u[f] : dt, l)), i.set(f, h)), h !== void 0) { + var d = w(h); + return d === dt ? void 0 : d; } return Reflect.get(u, f, o); }, @@ -284,10 +284,10 @@ function bt(t, e = null, n) { var o = Reflect.getOwnPropertyDescriptor(u, f); if (o && "value" in o) { var h = i.get(f); - h && (o.value = x(h)); + h && (o.value = w(h)); } else if (o === void 0) { var c = i.get(f), d = c == null ? void 0 : c.v; - if (c !== void 0 && d !== ht) + if (c !== void 0 && d !== dt) return { enumerable: !0, configurable: !0, @@ -299,13 +299,13 @@ function bt(t, e = null, n) { }, has(u, f) { var d; - if (f === Je) + if (f === en) return !0; - var o = i.get(f), h = o !== void 0 && o.v !== ht || Reflect.has(u, f); - if (o !== void 0 || X !== null && (!h || (d = $e(u, f)) != null && d.writable)) { - o === void 0 && (o = Ct(h ? bt(u[f], l) : ht), i.set(f, o)); - var c = x(o); - if (c === ht) + var o = i.get(f), h = o !== void 0 && o.v !== dt || Reflect.has(u, f); + if (o !== void 0 || X !== null && (!h || (d = Re(u, f)) != null && d.writable)) { + o === void 0 && (o = St(h ? $t(u[f], l) : dt), i.set(f, o)); + var c = w(o); + if (c === dt) return !1; } return h; @@ -317,9 +317,9 @@ function bt(t, e = null, n) { for (var p = o; p < /** @type {Source} */ c.v; p += 1) { var y = i.get(p + ""); - y !== void 0 ? W(y, ht) : p in u && (y = Ct(ht), i.set(p + "", y)); + y !== void 0 ? W(y, dt) : p in u && (y = St(dt), i.set(p + "", y)); } - c === void 0 ? (!d || (T = $e(u, f)) != null && T.writable) && (c = Ct(void 0), W(c, bt(o, l)), i.set(f, c)) : (d = c.v !== ht, W(c, bt(o, l))); + c === void 0 ? (!d || (T = Re(u, f)) != null && T.writable) && (c = St(void 0), W(c, $t(o, l)), i.set(f, c)) : (d = c.v !== dt, W(c, $t(o, l))); var R = Reflect.getOwnPropertyDescriptor(u, f); if (R != null && R.set && R.set.call(h, o), !d) { if (s && typeof f == "string") { @@ -334,17 +334,17 @@ function bt(t, e = null, n) { return !0; }, ownKeys(u) { - x(a); + w(a); var f = Reflect.ownKeys(u).filter((c) => { var d = i.get(c); - return d === void 0 || d.v !== ht; + return d === void 0 || d.v !== dt; }); for (var [o, h] of i) - h.v !== ht && !(o in u) && f.push(o); + h.v !== dt && !(o in u) && f.push(o); return f; }, setPrototypeOf() { - Fa(); + Ia(); } } ); @@ -353,104 +353,104 @@ function di(t, e = 1) { W(t, t.v + e); } var vi, Wi, Ji, Zi; -function xr() { +function wr() { if (vi === void 0) { vi = window, Wi = /Firefox/.test(navigator.userAgent); var t = Element.prototype, e = Node.prototype; - Ji = $e(e, "firstChild").get, Zi = $e(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; + Ji = Re(e, "firstChild").get, Zi = Re(e, "nextSibling").get, t.__click = void 0, t.__className = void 0, t.__attributes = null, t.__styles = null, t.__e = void 0, Text.prototype.__t = void 0; } } -function In(t = "") { +function Le(t = "") { return document.createTextNode(t); } // @__NO_SIDE_EFFECTS__ -function Re(t) { +function Ce(t) { return Ji.call(t); } // @__NO_SIDE_EFFECTS__ -function ce(t) { +function de(t) { return Zi.call(t); } -function wt(t, e) { - if (!Q) - return /* @__PURE__ */ Re(t); +function Ct(t, e) { + if (!tt) + return /* @__PURE__ */ Ce(t); var n = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Re(U) + /* @__PURE__ */ Ce(U) ); if (n === null) - n = U.appendChild(In()); + n = U.appendChild(Le()); else if (e && n.nodeType !== 3) { - var r = In(); - return n == null || n.before(r), Xt(r), r; + var r = Le(); + return n == null || n.before(r), Bt(r), r; } - return Xt(n), n; + return Bt(n), n; } -function Te(t, e) { - if (!Q) { +function Me(t, e) { + if (!tt) { var n = ( /** @type {DocumentFragment} */ - /* @__PURE__ */ Re( + /* @__PURE__ */ Ce( /** @type {Node} */ t ) ); - return n instanceof Comment && n.data === "" ? /* @__PURE__ */ ce(n) : n; + return n instanceof Comment && n.data === "" ? /* @__PURE__ */ de(n) : n; } return U; } -function Ht(t, e = 1, n = !1) { - let r = Q ? U : t; +function Nt(t, e = 1, n = !1) { + let r = tt ? U : t; for (var i; e--; ) i = r, r = /** @type {TemplateNode} */ - /* @__PURE__ */ ce(r); - if (!Q) + /* @__PURE__ */ de(r); + if (!tt) return r; var s = r == null ? void 0 : r.nodeType; if (n && s !== 3) { - var a = In(); - return r === null ? i == null || i.after(a) : r.before(a), Xt(a), a; + var a = Le(); + return r === null ? i == null || i.after(a) : r.before(a), Bt(a), a; } - return Xt(r), /** @type {TemplateNode} */ + return Bt(r), /** @type {TemplateNode} */ r; } function Qi(t) { t.textContent = ""; } -let An = !1, Ln = !1, qn = null, Rn = !1, Yr = !1; +let $n = !1, Fn = !1, In = null, An = !1, Hr = !1; function pi(t) { - Yr = t; + Hr = t; } -let Ze = []; -let j = null, Ot = !1; -function De(t) { +let nn = []; +let j = null, Lt = !1; +function qe(t) { j = t; } let X = null; -function Fe(t) { +function Ve(t) { X = t; } -let Ut = null; -function za(t) { - Ut = t; -} -let ot = null, xt = 0, ne = null; +let Kt = null; function Ua(t) { - ne = t; + Kt = t; } -let ts = 1, Vn = 0, ge = !1; +let ut = null, bt = 0, ie = null; +function ja(t) { + ie = t; +} +let ts = 1, Ln = 0, ye = !1; function es() { return ++ts; } -function ln(t) { +function fn(t) { var h; var e = t.f; - if (e & fe) + if (e & he) return !0; - if (e & Ve) { - var n = t.deps, r = (e & Tt) !== 0; + if (e & ze) { + var n = t.deps, r = (e & Mt) !== 0; if (n !== null) { - var i, s, a = (e & Pn) !== 0, l = r && X !== null && !ge, u = n.length; + var i, s, a = (e & On) !== 0, l = r && X !== null && !ye, u = n.length; if (a || l) { var f = ( /** @type {Derived} */ @@ -458,10 +458,10 @@ function ln(t) { ), o = f.parent; for (i = 0; i < u; i++) s = n[i], (a || !((h = s == null ? void 0 : s.reactions) != null && h.includes(f))) && (s.reactions ?? (s.reactions = [])).push(f); - a && (f.f ^= Pn), l && o !== null && !(o.f & Tt) && (f.f ^= Tt); + a && (f.f ^= On), l && o !== null && !(o.f & Mt) && (f.f ^= Mt); } for (i = 0; i < u; i++) - if (s = n[i], ln( + if (s = n[i], fn( /** @type {Derived} */ s ) && Ki( @@ -470,35 +470,35 @@ function ln(t) { ), s.wv > t.wv) return !0; } - (!r || X !== null && !ge) && ae(t, gt); + (!r || X !== null && !ye) && oe(t, _t); } return !1; } -function ja(t, e) { +function Xa(t, e) { for (var n = e; n !== null; ) { - if (n.f & On) + if (n.f & Mn) try { n.fn(t); return; } catch { - n.f ^= On; + n.f ^= Mn; } n = n.parent; } - throw An = !1, t; + throw $n = !1, t; } -function Xa(t) { - return (t.f & Qn) === 0 && (t.parent === null || (t.parent.f & On) === 0); +function Ga(t) { + return (t.f & Jn) === 0 && (t.parent === null || (t.parent.f & Mn) === 0); } -function nr(t, e, n, r) { - if (An) { - if (n === null && (An = !1), Xa(e)) +function tr(t, e, n, r) { + if ($n) { + if (n === null && ($n = !1), Ga(e)) throw t; return; } - n !== null && (An = !0); + n !== null && ($n = !0); { - ja(t, e); + Xa(t, e); return; } } @@ -507,12 +507,12 @@ function ns(t, e, n = !0) { if (r !== null) for (var i = 0; i < r.length; i++) { var s = r[i]; - s.f & Dt ? ns( + s.f & Vt ? ns( /** @type {Derived} */ s, e, !1 - ) : e === s && (n ? ae(s, fe) : s.f & gt && ae(s, Ve), rr( + ) : e === s && (n ? oe(s, he) : s.f & _t && oe(s, ze), er( /** @type {Effect} */ s )); @@ -520,150 +520,150 @@ function ns(t, e, n = !0) { } function rs(t) { var d; - var e = ot, n = xt, r = ne, i = j, s = ge, a = Ut, l = pt, u = Ot, f = t.f; - ot = /** @type {null | Value[]} */ - null, xt = 0, ne = null, ge = (f & Tt) !== 0 && (Ot || !Rn || j === null), j = f & (ue | qe) ? null : t, Ut = null, gi(t.ctx), Ot = !1, Vn++; + var e = ut, n = bt, r = ie, i = j, s = ye, a = Kt, l = gt, u = Lt, f = t.f; + ut = /** @type {null | Value[]} */ + null, bt = 0, ie = null, ye = (f & Mt) !== 0 && (Lt || !An || j === null), j = f & (ce | Ye) ? null : t, Kt = null, gi(t.ctx), Lt = !1, Ln++; try { var o = ( /** @type {Function} */ (0, t.fn)() ), h = t.deps; - if (ot !== null) { + if (ut !== null) { var c; - if (Bn(t, xt), h !== null && xt > 0) - for (h.length = xt + ot.length, c = 0; c < ot.length; c++) - h[xt + c] = ot[c]; + if (qn(t, bt), h !== null && bt > 0) + for (h.length = bt + ut.length, c = 0; c < ut.length; c++) + h[bt + c] = ut[c]; else - t.deps = h = ot; - if (!ge) - for (c = xt; c < h.length; c++) + t.deps = h = ut; + if (!ye) + for (c = bt; c < h.length; c++) ((d = h[c]).reactions ?? (d.reactions = [])).push(t); - } else h !== null && xt < h.length && (Bn(t, xt), h.length = xt); - if (cs() && ne !== null && !Ot && h !== null && !(t.f & (Dt | Ve | fe))) + } else h !== null && bt < h.length && (qn(t, bt), h.length = bt); + if (cs() && ie !== null && !Lt && h !== null && !(t.f & (Vt | ze | he))) for (c = 0; c < /** @type {Source[]} */ - ne.length; c++) + ie.length; c++) ns( - ne[c], + ie[c], /** @type {Effect} */ t ); - return i !== null && Vn++, o; + return i !== null && Ln++, o; } finally { - ot = e, xt = n, ne = r, j = i, ge = s, Ut = a, gi(l), Ot = u; + ut = e, bt = n, ie = r, j = i, ye = s, Kt = a, gi(l), Lt = u; } } -function Ga(t, e) { +function Ka(t, e) { let n = e.reactions; if (n !== null) { - var r = $a.call(n, t); + var r = Aa.call(n, t); if (r !== -1) { var i = n.length - 1; i === 0 ? n = e.reactions = null : (n[r] = n[i], n.pop()); } } - n === null && e.f & Dt && // Destroying a child effect while updating a parent effect can cause a dependency to appear + n === null && e.f & Vt && // 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 || !ot.includes(e)) && (ae(e, Ve), e.f & (Tt | Pn) || (e.f ^= Pn), Gi( + (ut === null || !ut.includes(e)) && (oe(e, ze), e.f & (Mt | On) || (e.f ^= On), Gi( /** @type {Derived} **/ e - ), Bn( + ), qn( /** @type {Derived} **/ e, 0 )); } -function Bn(t, e) { +function qn(t, e) { var n = t.deps; if (n !== null) for (var r = e; r < n.length; r++) - Ga(t, n[r]); + Ka(t, n[r]); } -function zr(t) { +function Yr(t) { var e = t.f; - if (!(e & Qn)) { - ae(t, gt); - var n = X, r = pt, i = Rn; - X = t, Rn = !0; + if (!(e & Jn)) { + oe(t, _t); + var n = X, r = gt, i = An; + X = t, An = !0; try { - e & Fr ? rl(t) : ls(t), as(t); + e & Dr ? il(t) : ls(t), as(t); var s = rs(t); t.teardown = typeof s == "function" ? s : null, t.wv = ts; var a = t.deps, l; - ci && qa && t.f & fe; + fi && Va && t.f & he; } catch (u) { - nr(u, t, n, r || t.ctx); + tr(u, t, n, r || t.ctx); } finally { - Rn = i, X = n; + An = i, X = n; } } } -function Ka() { +function Wa() { try { - Ma(); + Oa(); } catch (t) { - if (qn !== null) - nr(t, qn, null); + if (In !== null) + tr(t, In, null); else throw t; } } function is() { try { - for (var t = 0; Ze.length > 0; ) { - t++ > 1e3 && Ka(); - var e = Ze, n = e.length; - Ze = []; + for (var t = 0; nn.length > 0; ) { + t++ > 1e3 && Wa(); + var e = nn, n = e.length; + nn = []; for (var r = 0; r < n; r++) { var i = e[r]; - i.f & gt || (i.f ^= gt); - var s = Ja(i); - Wa(s); + i.f & _t || (i.f ^= _t); + var s = Za(i); + Ja(s); } } } finally { - Ln = !1, qn = null; + Fn = !1, In = null; } } -function Wa(t) { +function Ja(t) { var e = t.length; if (e !== 0) for (var n = 0; n < e; n++) { var r = t[n]; - if (!(r.f & (Qn | se))) + if (!(r.f & (Jn | le))) try { - ln(r) && (zr(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? os(r) : r.fn = null)); + fn(r) && (Yr(r), r.deps === null && r.first === null && r.nodes_start === null && (r.teardown === null ? os(r) : r.fn = null)); } catch (i) { - nr(i, r, null, r.ctx); + tr(i, r, null, r.ctx); } } } -function rr(t) { - Ln || (Ln = !0, queueMicrotask(is)); - for (var e = qn = t; e.parent !== null; ) { +function er(t) { + Fn || (Fn = !0, queueMicrotask(is)); + for (var e = In = t; e.parent !== null; ) { e = e.parent; var n = e.f; - if (n & (qe | ue)) { - if (!(n & gt)) return; - e.f ^= gt; + if (n & (Ye | ce)) { + if (!(n & _t)) return; + e.f ^= _t; } } - Ze.push(e); + nn.push(e); } -function Ja(t) { +function Za(t) { for (var e = [], n = t.first; n !== null; ) { - var r = n.f, i = (r & ue) !== 0, s = i && (r & gt) !== 0; - if (!s && !(r & se)) { + var r = n.f, i = (r & ce) !== 0, s = i && (r & _t) !== 0; + if (!s && !(r & le)) { if (r & qi) e.push(n); else if (i) - n.f ^= gt; + n.f ^= _t; else { var a = j; try { - j = n, ln(n) && zr(n); + j = n, fn(n) && Yr(n); } catch (f) { - nr(f, n, null, n.ctx); + tr(f, n, null, n.ctx); } finally { j = a; } @@ -680,21 +680,21 @@ function Ja(t) { } return e; } -function Nt(t) { +function kt(t) { var e; - for (hi(); Ze.length > 0; ) - Ln = !0, is(), hi(); + for (ci(); nn.length > 0; ) + Fn = !0, is(), ci(); return ( /** @type {T} */ e ); } -function x(t) { - var e = t.f, n = (e & Dt) !== 0; - if (j !== null && !Ot) { - Ut !== null && Ut.includes(t) && Ia(); +function w(t) { + var e = t.f, n = (e & Vt) !== 0; + if (j !== null && !Lt) { + Kt !== null && Kt.includes(t) && La(); var r = j.deps; - t.rv < Vn && (t.rv = Vn, ot === null && r !== null && r[xt] === t ? xt++ : ot === null ? ot = [t] : (!ge || !ot.includes(t)) && ot.push(t)); + t.rv < Ln && (t.rv = Ln, ut === null && r !== null && r[bt] === t ? bt++ : ut === null ? ut = [t] : (!ye || !ut.includes(t)) && ut.push(t)); } else if (n && /** @type {Derived} */ t.deps === null && /** @type {Derived} */ t.effects === null) { @@ -702,37 +702,37 @@ function x(t) { /** @type {Derived} */ t ), s = i.parent; - s !== null && !(s.f & Tt) && (i.f ^= Tt); + s !== null && !(s.f & Mt) && (i.f ^= Mt); } return n && (i = /** @type {Derived} */ - t, ln(i) && Ki(i)), t.v; + t, fn(i) && Ki(i)), t.v; } -function Hn(t) { - var e = Ot; +function Vn(t) { + var e = Lt; try { - return Ot = !0, t(); + return Lt = !0, t(); } finally { - Ot = e; + Lt = e; } } -const Za = -7169; -function ae(t, e) { - t.f = t.f & Za | e; +const Qa = -7169; +function oe(t, e) { + t.f = t.f & Qa | e; } -function Qa(t) { - X === null && j === null && ka(), j !== null && j.f & Tt && X === null && Sa(), Yr && Ta(); +function tl(t) { + X === null && j === null && Ma(), j !== null && j.f & Mt && X === null && ka(), Hr && Sa(); } -function tl(t, e) { +function el(t, e) { var n = e.last; n === null ? e.last = e.first = t : (n.next = t, t.prev = n, e.last = t); } -function Be(t, e, n, r = !0) { - var i = (t & qe) !== 0, s = X, a = { - ctx: pt, +function Ue(t, e, n, r = !0) { + var i = (t & Ye) !== 0, s = X, a = { + ctx: gt, deps: null, nodes_start: null, nodes_end: null, - f: t | fe, + f: t | he, first: null, fn: e, last: null, @@ -745,13 +745,13 @@ function Be(t, e, n, r = !0) { }; if (n) try { - zr(a), a.f |= xa; + Yr(a), a.f |= ba; } catch (f) { - throw le(a), f; + throw ue(a), f; } - else e !== null && rr(a); - var l = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (Vi | On)) === 0; - if (!l && !i && r && (s !== null && tl(a, s), j !== null && j.f & Dt)) { + else e !== null && er(a); + var l = n && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (Vi | Mn)) === 0; + if (!l && !i && r && (s !== null && el(a, s), j !== null && j.f & Vt)) { var u = ( /** @type {Derived} */ j @@ -760,13 +760,13 @@ function Be(t, e, n, r = !0) { } return a; } -function Ur(t) { - Qa(); - var e = X !== null && (X.f & ue) !== 0 && pt !== null && !pt.m; +function zr(t) { + tl(); + var e = X !== null && (X.f & ce) !== 0 && gt !== null && !gt.m; if (e) { var n = ( /** @type {ComponentContext} */ - pt + gt ); (n.e ?? (n.e = [])).push({ fn: t, @@ -774,49 +774,49 @@ function Ur(t) { reaction: j }); } else { - var r = jr(t); + var r = Ur(t); return r; } } -function el(t) { - const e = Be(qe, t, !0); +function nl(t) { + const e = Ue(Ye, t, !0); return () => { - le(e); + ue(e); }; } -function nl(t) { - const e = Be(qe, t, !0); +function rl(t) { + const e = Ue(Ye, t, !0); return (n = {}) => new Promise((r) => { - n.outro ? Yn(e, () => { - le(e), r(void 0); - }) : (le(e), r(void 0)); + n.outro ? Bn(e, () => { + ue(e), r(void 0); + }) : (ue(e), r(void 0)); }); } -function jr(t) { - return Be(qi, t, !1); +function Ur(t) { + return Ue(qi, t, !1); } function ss(t) { - return Be(Dr, t, !0); + return Ue(Pr, t, !0); } -function _n(t, e = [], n = tr) { +function pn(t, e = [], n = Zn) { const r = e.map(n); - return Xr(() => t(...r.map(x))); + return jr(() => t(...r.map(w))); } -function Xr(t, e = 0) { - return Be(Dr | Fr | e, t, !0); +function jr(t, e = 0) { + return Ue(Pr | Dr | e, t, !0); } -function tn(t, e = !0) { - return Be(Dr | ue, t, !0, e); +function sn(t, e = !0) { + return Ue(Pr | ce, t, !0, e); } function as(t) { var e = t.teardown; if (e !== null) { - const n = Yr, r = j; - pi(!0), De(null); + const n = Hr, r = j; + pi(!0), qe(null); try { e.call(null); } finally { - pi(n), De(r); + pi(n), qe(r); } } } @@ -824,28 +824,28 @@ function ls(t, e = !1) { var n = t.first; for (t.first = t.last = null; n !== null; ) { var r = n.next; - le(n, e), n = r; + ue(n, e), n = r; } } -function rl(t) { +function il(t) { for (var e = t.first; e !== null; ) { var n = e.next; - e.f & ue || le(e), e = n; + e.f & ce || ue(e), e = n; } } -function le(t, e = !0) { +function ue(t, e = !0) { var n = !1; - if ((e || t.f & ba) && t.nodes_start !== null) { + if ((e || t.f & $a) && t.nodes_start !== null) { for (var r = t.nodes_start, i = t.nodes_end; r !== null; ) { var s = r === i ? null : ( /** @type {TemplateNode} */ - /* @__PURE__ */ ce(r) + /* @__PURE__ */ de(r) ); r.remove(), r = s; } n = !0; } - ls(t, e && !n), Bn(t, 0), ae(t, Qn); + ls(t, e && !n), qn(t, 0), oe(t, Jn); var a = t.transitions; if (a !== null) for (const u of a) @@ -858,10 +858,10 @@ function os(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 Yn(t, e) { +function Bn(t, e) { var n = []; - Gr(t, n, !0), us(n, () => { - le(t), e && e(); + Xr(t, n, !0), us(n, () => { + ue(t), e && e(); }); } function us(t, e) { @@ -873,25 +873,25 @@ function us(t, e) { } else e(); } -function Gr(t, e, n) { - if (!(t.f & se)) { - if (t.f ^= se, t.transitions !== null) +function Xr(t, e, n) { + if (!(t.f & le)) { + if (t.f ^= le, t.transitions !== null) for (const a of t.transitions) (a.is_global || n) && e.push(a); for (var r = t.first; r !== null; ) { - var i = r.next, s = (r.f & Ir) !== 0 || (r.f & ue) !== 0; - Gr(r, e, s ? n : !1), r = i; + var i = r.next, s = (r.f & Fr) !== 0 || (r.f & ce) !== 0; + Xr(r, e, s ? n : !1), r = i; } } } -function zn(t) { +function Hn(t) { fs(t, !0); } function fs(t, e) { - if (t.f & se) { - t.f ^= se, t.f & gt || (t.f ^= gt), ln(t) && (ae(t, fe), rr(t)); + if (t.f & le) { + t.f ^= le, t.f & _t || (t.f ^= _t), fn(t) && (oe(t, he), er(t)); for (var n = t.first; n !== null; ) { - var r = n.next, i = (n.f & Ir) !== 0 || (n.f & ue) !== 0; + var r = n.next, i = (n.f & Fr) !== 0 || (n.f & ce) !== 0; fs(n, i ? e : !1), n = r; } if (t.transitions !== null) @@ -899,16 +899,16 @@ function fs(t, e) { (s.is_global || e) && s.in(); } } -function il(t) { +function sl(t) { throw new Error("https://svelte.dev/e/lifecycle_outside_component"); } -let pt = null; +let gt = null; function gi(t) { - pt = t; + gt = t; } -function Kr(t, e = !1, n) { - pt = { - p: pt, +function Gr(t, e = !1, n) { + gt = { + p: gt, c: null, e: null, m: !1, @@ -917,8 +917,8 @@ function Kr(t, e = !1, n) { l: null }; } -function Wr(t) { - const e = pt; +function Kr(t) { + const e = gt; if (e !== null) { t !== void 0 && (e.x = t); const a = e.e; @@ -928,13 +928,13 @@ function Wr(t) { try { for (var i = 0; i < a.length; i++) { var s = a[i]; - Fe(s.effect), De(s.reaction), jr(s.fn); + Ve(s.effect), qe(s.reaction), Ur(s.fn); } } finally { - Fe(n), De(r); + Ve(n), qe(r); } } - pt = e.p, e.m = !0; + gt = e.p, e.m = !0; } return t || /** @type {T} */ {}; @@ -942,18 +942,18 @@ function Wr(t) { function cs() { return !0; } -const sl = ["touchstart", "touchmove"]; -function al(t) { - return sl.includes(t); -} -const hs = /* @__PURE__ */ new Set(), br = /* @__PURE__ */ new Set(); +const al = ["touchstart", "touchmove"]; function ll(t) { + return al.includes(t); +} +const hs = /* @__PURE__ */ new Set(), xr = /* @__PURE__ */ new Set(); +function ol(t) { for (var e = 0; e < t.length; e++) hs.add(t[e]); - for (var n of br) + for (var n of xr) n(t); } -function mn(t) { +function gn(t) { var $; var e = this, n = ( /** @type {Node} */ @@ -976,14 +976,14 @@ function mn(t) { } if (s = /** @type {Element} */ i[a] || t.target, s !== e) { - Fn(t, "currentTarget", { + Dn(t, "currentTarget", { configurable: !0, get() { return s || n; } }); var o = j, h = X; - De(null), Fe(null); + qe(null), Ve(null); try { for (var c, d = []; s !== null; ) { var p = s.assignedSlot || s.parentNode || /** @type {any} */ @@ -994,7 +994,7 @@ function mn(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)) - if (Lr(y)) { + if (Ir(y)) { var [R, ..._] = y; R.apply(s, [t, ..._]); } else @@ -1014,7 +1014,7 @@ function mn(t) { throw c; } } finally { - t.__root = e, delete t.currentTarget, De(o), Fe(h); + t.__root = e, delete t.currentTarget, qe(o), Ve(h); } } } @@ -1022,7 +1022,7 @@ function ds(t) { var e = document.createElement("template"); return e.innerHTML = t, e.content; } -function en(t, e) { +function Ne(t, e) { var n = ( /** @type {Effect} */ X @@ -1030,11 +1030,11 @@ function en(t, e) { n.nodes_start === null && (n.nodes_start = t, n.nodes_end = e); } // @__NO_SIDE_EFFECTS__ -function He(t, e) { - var n = (e & wa) !== 0, r, i = !t.startsWith(""); +function je(t, e) { + var n = (e & xa) !== 0, r, i = !t.startsWith(""); return () => { - if (Q) - return en(U, null), U; + if (tt) + return Ne(U, null), U; r === void 0 && (r = ds(i ? t : "" + t)); var s = ( /** @type {TemplateNode} */ @@ -1043,43 +1043,51 @@ function He(t, e) { { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Re(s) + /* @__PURE__ */ Ce(s) ), l = ( /** @type {TemplateNode} */ s.lastChild ); - en(a, l); + Ne(a, l); } return s; }; } // @__NO_SIDE_EFFECTS__ -function ol(t, e, n = "svg") { +function ul(t, e, n = "svg") { var r = !t.startsWith(""), i = `<${n}>${r ? t : "" + t}`, s; return () => { - if (Q) - return en(U, null), U; + if (tt) + return Ne(U, null), U; if (!s) { var a = ( /** @type {DocumentFragment} */ ds(i) ), l = ( /** @type {Element} */ - /* @__PURE__ */ Re(a) + /* @__PURE__ */ Ce(a) ); s = /** @type {Element} */ - /* @__PURE__ */ Re(l); + /* @__PURE__ */ Ce(l); } var u = ( /** @type {TemplateNode} */ s.cloneNode(!0) ); - return en(u, u), u; + return Ne(u, u), u; }; } -function ve(t, e) { - if (Q) { - X.nodes_end = U, er(); +function _i(t = "") { + if (!tt) { + var e = Le(t + ""); + return Ne(e, e), e; + } + var n = U; + return n.nodeType !== 3 && (n.before(n = Le()), Bt(n)), Ne(n, n), n; +} +function Xt(t, e) { + if (tt) { + X.nodes_end = U, Qn(); return; } t !== null && t.before( @@ -1087,127 +1095,127 @@ function ve(t, e) { e ); } -function Se(t, e) { +function Oe(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 vs(t, e) { return ps(t, e); } -function ul(t, e) { - xr(), e.intro = e.intro ?? !1; - const n = e.target, r = Q, i = U; +function fl(t, e) { + wr(), e.intro = e.intro ?? !1; + const n = e.target, r = tt, i = U; try { for (var s = ( /** @type {TemplateNode} */ - /* @__PURE__ */ Re(n) + /* @__PURE__ */ Ce(n) ); s && (s.nodeType !== 8 || /** @type {Comment} */ s.data !== Li); ) s = /** @type {TemplateNode} */ - /* @__PURE__ */ ce(s); + /* @__PURE__ */ de(s); if (!s) - throw We; - ie(!0), Xt( + throw tn; + ae(!0), Bt( /** @type {Comment} */ s - ), er(); + ), Qn(); const a = ps(t, { ...e, anchor: s }); if (U === null || U.nodeType !== 8 || /** @type {Comment} */ - U.data !== Pr) - throw Hr(), We; - return ie(!1), /** @type {Exports} */ + U.data !== Or) + throw Br(), tn; + return ae(!1), /** @type {Exports} */ a; } catch (a) { - if (a === We) - return e.recover === !1 && Oa(), xr(), Qi(n), ie(!1), vs(t, e); + if (a === tn) + return e.recover === !1 && Pa(), wr(), Qi(n), ae(!1), vs(t, e); throw a; } finally { - ie(r), Xt(i); + ae(r), Bt(i); } } -const ke = /* @__PURE__ */ new Map(); +const Pe = /* @__PURE__ */ new Map(); function ps(t, { target: e, anchor: n, props: r = {}, events: i, context: s, intro: a = !0 }) { - xr(); + wr(); var l = /* @__PURE__ */ new Set(), u = (h) => { for (var c = 0; c < h.length; c++) { var d = h[c]; if (!l.has(d)) { l.add(d); - var p = al(d); - e.addEventListener(d, mn, { passive: p }); - var y = ke.get(d); - y === void 0 ? (document.addEventListener(d, mn, { passive: p }), ke.set(d, 1)) : ke.set(d, y + 1); + var p = ll(d); + e.addEventListener(d, gn, { passive: p }); + var y = Pe.get(d); + y === void 0 ? (document.addEventListener(d, gn, { passive: p }), Pe.set(d, 1)) : Pe.set(d, y + 1); } } }; - u(qr(hs)), br.add(u); - var f = void 0, o = nl(() => { - var h = n ?? e.appendChild(In()); - return tn(() => { + u(Lr(hs)), xr.add(u); + var f = void 0, o = rl(() => { + var h = n ?? e.appendChild(Le()); + return sn(() => { if (s) { - Kr({}); + Gr({}); var c = ( /** @type {ComponentContext} */ - pt + gt ); c.c = s; } - i && (r.$$events = i), Q && en( + i && (r.$$events = i), tt && Ne( /** @type {TemplateNode} */ h, null - ), f = t(h, r) || {}, Q && (X.nodes_end = U), s && Wr(); + ), f = t(h, r) || {}, tt && (X.nodes_end = U), s && Kr(); }), () => { var p; for (var c of l) { - e.removeEventListener(c, mn); + e.removeEventListener(c, gn); var d = ( /** @type {number} */ - ke.get(c) + Pe.get(c) ); - --d === 0 ? (document.removeEventListener(c, mn), ke.delete(c)) : ke.set(c, d); + --d === 0 ? (document.removeEventListener(c, gn), Pe.delete(c)) : Pe.set(c, d); } - br.delete(u), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); + xr.delete(u), h !== n && ((p = h.parentNode) == null || p.removeChild(h)); }; }); - return $r.set(f, o), f; + return br.set(f, o), f; } -let $r = /* @__PURE__ */ new WeakMap(); -function fl(t, e) { - const n = $r.get(t); - return n ? ($r.delete(t), n(e)) : Promise.resolve(); +let br = /* @__PURE__ */ new WeakMap(); +function cl(t, e) { + const n = br.get(t); + return n ? (br.delete(t), n(e)) : Promise.resolve(); } -function _i(t, e, n = !1) { - Q && er(); - var r = t, i = null, s = null, a = ht, l = n ? Ir : 0, u = !1; +function _n(t, e, n = !1) { + tt && Qn(); + var r = t, i = null, s = null, a = dt, l = n ? Fr : 0, u = !1; const f = (h, c = !0) => { u = !0, o(c, h); }, o = (h, c) => { if (a === (a = h)) return; let d = !1; - if (Q) { + if (tt) { const p = ( /** @type {Comment} */ - r.data === Or + r.data === Mr ); - !!a === p && (r = wr(), Xt(r), ie(!1), d = !0); + !!a === p && (r = yr(), Bt(r), ae(!1), d = !0); } - a ? (i ? zn(i) : c && (i = tn(() => c(r))), s && Yn(s, () => { + a ? (i ? Hn(i) : c && (i = sn(() => c(r))), s && Bn(s, () => { s = null; - })) : (s ? zn(s) : c && (s = tn(() => c(r))), i && Yn(i, () => { + })) : (s ? Hn(s) : c && (s = sn(() => c(r))), i && Bn(i, () => { i = null; - })), d && ie(!0); + })), d && ae(!0); }; - Xr(() => { + jr(() => { u = !1, e(f), u || o(null, null); - }, l), Q && (r = U); + }, l), tt && (r = U); } -function dr(t, e) { +function hr(t, e) { return e; } -function cl(t, e, n, r) { +function hl(t, e, n, r) { for (var i = [], s = e.length, a = 0; a < s; a++) - Gr(e[a].e, i, !0); + Xr(e[a].e, i, !0); var l = s > 0 && i.length === 0 && n !== null; if (l) { var u = ( @@ -1218,41 +1226,41 @@ function cl(t, e, n, r) { Qi(u), u.append( /** @type {Element} */ n - ), r.clear(), pe(t, e[0].prev, e[s - 1].next); + ), r.clear(), me(t, e[0].prev, e[s - 1].next); } us(i, () => { for (var f = 0; f < s; f++) { var o = e[f]; - l || (r.delete(o.k), pe(t, o.prev, o.next)), le(o.e, !l); + l || (r.delete(o.k), me(t, o.prev, o.next)), ue(o.e, !l); } }); } -function vr(t, e, n, r, i, s = null) { +function dr(t, e, n, r, i, s = null) { var a = t, l = { items: /* @__PURE__ */ new Map(), first: null }; - Q && er(); - var u = null, f = !1, o = /* @__PURE__ */ Ba(() => { + tt && Qn(); + var u = null, f = !1, o = /* @__PURE__ */ Ha(() => { var h = n(); - return Lr(h) ? h : h == null ? [] : qr(h); + return Ir(h) ? h : h == null ? [] : Lr(h); }); - Xr(() => { - var h = x(o), c = h.length; + jr(() => { + var h = w(o), c = h.length; if (f && c === 0) return; f = c === 0; let d = !1; - if (Q) { + if (tt) { var p = ( /** @type {Comment} */ - a.data === Or + a.data === Mr ); - p !== (c === 0) && (a = wr(), Xt(a), ie(!1), d = !0); + p !== (c === 0) && (a = yr(), Bt(a), ae(!1), d = !0); } - if (Q) { + if (tt) { for (var y = null, R, _ = 0; _ < c; _++) { if (U.nodeType === 8 && /** @type {Comment} */ - U.data === Pr) { + U.data === Or) { a = /** @type {Comment} */ - U, d = !0, ie(!1); + U, d = !0, ae(!1); break; } var $ = h[_], T = r($, _); @@ -1269,14 +1277,14 @@ function vr(t, e, n, r, i, s = null) { n ), l.items.set(T, R), y = R; } - c > 0 && Xt(wr()); + c > 0 && Bt(yr()); } - Q || hl(h, l, a, i, e, r, n), s !== null && (c === 0 ? u ? zn(u) : u = tn(() => s(a)) : u !== null && Yn(u, () => { + tt || dl(h, l, a, i, e, r, n), s !== null && (c === 0 ? u ? Hn(u) : u = sn(() => s(a)) : u !== null && Bn(u, () => { u = null; - })), d && ie(!0), x(o); - }), Q && (a = U); + })), d && ae(!0), w(o); + }), tt && (a = U); } -function hl(t, e, n, r, i, s, a) { +function dl(t, e, n, r, i, s, a) { var l = t.length, u = e.items, f = e.first, o = f, h, c = null, d = [], p = [], y, R, _, $; for ($ = 0; $ < l; $ += 1) { if (y = t[$], R = s(y, $), _ = u.get(R), _ === void 0) { @@ -1298,23 +1306,23 @@ function hl(t, e, n, r, i, s, a) { ), u.set(R, c), d = [], p = [], o = c.next; continue; } - if (dl(_, y, $), _.e.f & se && zn(_.e), _ !== o) { + if (vl(_, y, $), _.e.f & le && Hn(_.e), _ !== o) { if (h !== void 0 && h.has(_)) { if (d.length < p.length) { var M = p[0], b; c = M.prev; - var P = d[0], z = d[d.length - 1]; + var P = d[0], Y = d[d.length - 1]; for (b = 0; b < d.length; b += 1) mi(d[b], M, n); for (b = 0; b < p.length; b += 1) h.delete(p[b]); - pe(e, P.prev, z.next), pe(e, c, P), pe(e, z, M), o = M, c = z, $ -= 1, d = [], p = []; + me(e, P.prev, Y.next), me(e, c, P), me(e, Y, M), o = M, c = Y, $ -= 1, d = [], p = []; } else - h.delete(_), mi(_, o, n), pe(e, _.prev, _.next), pe(e, _, c === null ? e.first : c.next), pe(e, c, _), c = _; + h.delete(_), mi(_, o, n), me(e, _.prev, _.next), me(e, _, c === null ? e.first : c.next), me(e, c, _), c = _; continue; } for (d = [], p = []; o !== null && o.k !== R; ) - o.e.f & se || (h ?? (h = /* @__PURE__ */ new Set())).add(o), p.push(o), o = o.next; + o.e.f & le || (h ?? (h = /* @__PURE__ */ new Set())).add(o), p.push(o), o = o.next; if (o === null) continue; _ = o; @@ -1322,21 +1330,21 @@ function hl(t, e, n, r, i, s, a) { d.push(_), c = _, o = _.next; } if (o !== null || h !== void 0) { - for (var J = h === void 0 ? [] : qr(h); o !== null; ) - o.e.f & se || J.push(o), o = o.next; + for (var J = h === void 0 ? [] : Lr(h); o !== null; ) + o.e.f & le || J.push(o), o = o.next; var it = J.length; if (it > 0) { - var nt = null; - cl(e, J, nt, u); + var rt = null; + hl(e, J, rt, u); } } X.first = e.first && e.first.e, X.last = c && c.e; } -function dl(t, e, n, r) { +function vl(t, e, n, r) { ji(t.v, e), t.i = n; } function gs(t, e, n, r, i, s, a, l, u, f) { - var o = (u & da) !== 0, h = (u & pa) === 0, c = o ? h ? /* @__PURE__ */ Br(i) : Ct(i) : i, d = u & va ? Ct(a) : a, p = { + var o = (u & va) !== 0, h = (u & ga) === 0, c = o ? h ? /* @__PURE__ */ Vr(i) : St(i) : i, d = u & pa ? St(a) : a, p = { i: d, v: c, k: s, @@ -1347,7 +1355,7 @@ function gs(t, e, n, r, i, s, a, l, u, f) { next: r }; try { - return p.e = tn(() => l(t, c, d, f), Q), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; + return p.e = sn(() => l(t, c, d, f), tt), p.e.prev = n && n.e, p.e.next = r && r.e, n === null ? e.first = p : (n.next = p, n.e.next = p.e), r !== null && (r.prev = p, r.e.prev = p.e), p; } finally { } } @@ -1364,12 +1372,12 @@ function mi(t, e, n) { ); s !== r; ) { var a = ( /** @type {TemplateNode} */ - /* @__PURE__ */ ce(s) + /* @__PURE__ */ de(s) ); i.before(s), s = a; } } -function pe(t, e, n) { +function me(t, e, n) { e === null ? t.first = n : (e.next = n, e.e.next = n && n.e), n !== null && (n.prev = e, n.e.prev = e && e.e); } function _s(t, e) { @@ -1396,13 +1404,13 @@ function yi(t, e, n, r) { i[e] !== n && (i[e] = n, n == null ? t.style.removeProperty(e) : t.style.setProperty(e, n, "")); } function wi(t, e) { - return t === e || (t == null ? void 0 : t[Je]) === e; + return t === e || (t == null ? void 0 : t[en]) === e; } -function En(t = {}, e, n, r) { - return jr(() => { +function Rn(t = {}, e, n, r) { + return Ur(() => { var i, s; return ss(() => { - i = s, s = [], Hn(() => { + i = s, s = [], Vn(() => { t !== n(...s) && (e(t, ...s), i && wi(n(...i), t) && e(null, ...i)); }); }), () => { @@ -1412,41 +1420,41 @@ function En(t = {}, e, n, r) { }; }), t; } -function vl(t) { - pt === null && il(), Ur(() => { - const e = Hn(t); +function pl(t) { + gt === null && sl(), zr(() => { + const e = Vn(t); if (typeof e == "function") return ( /** @type {() => void} */ e ); }); } -let yn = !1; -function pl(t) { - var e = yn; +let mn = !1; +function gl(t) { + var e = mn; try { - return yn = !1, [t(), yn]; + return mn = !1, [t(), mn]; } finally { - yn = e; + mn = e; } } -function Mt(t, e, n, r) { +function It(t, e, n, r) { var b; - var i = (n & ga) !== 0, s = !0, a = (n & ma) !== 0, l = (n & ya) !== 0, u = !1, f; - a ? [f, u] = pl(() => ( + var i = (n & _a) !== 0, s = !0, a = (n & ya) !== 0, l = (n & wa) !== 0, u = !1, f; + a ? [f, u] = gl(() => ( /** @type {V} */ t[e] )) : f = /** @type {V} */ t[e]; - var o = Je in t || Bi in t, h = a && (((b = $e(t, e)) == null ? void 0 : b.set) ?? (o && e in t && ((P) => t[e] = P))) || void 0, c = ( + var o = en in t || Bi in t, h = a && (((b = Re(t, e)) == null ? void 0 : b.set) ?? (o && e in t && ((P) => t[e] = P))) || void 0, c = ( /** @type {V} */ r - ), d = !0, p = !1, y = () => (p = !0, d && (d = !1, l ? c = Hn( + ), d = !0, p = !1, y = () => (p = !0, d && (d = !1, l ? c = Vn( /** @type {() => V} */ r ) : c = /** @type {V} */ r), c); - f === void 0 && r !== void 0 && (h && s && Pa(), f = y(), h && h(f)); + f === void 0 && r !== void 0 && (h && s && Da(), f = y(), h && h(f)); var R; if (R = () => { var P = ( @@ -1454,31 +1462,31 @@ function Mt(t, e, n, r) { t[e] ); return P === void 0 ? y() : (d = !0, p = !1, P); - }, !(n & _a)) + }, !(n & ma)) return R; if (h) { var _ = t.$$legacy; - return function(P, z) { - return arguments.length > 0 ? ((!z || _ || u) && h(z ? R() : P), P) : R(); + return function(P, Y) { + return arguments.length > 0 ? ((!Y || _ || u) && h(Y ? R() : P), P) : R(); }; } - var $ = !1, T = /* @__PURE__ */ Br(f), M = /* @__PURE__ */ tr(() => { - var P = R(), z = x(T); - return $ ? ($ = !1, z) : T.v = P; + var $ = !1, T = /* @__PURE__ */ Vr(f), M = /* @__PURE__ */ Zn(() => { + var P = R(), Y = w(T); + return $ ? ($ = !1, Y) : T.v = P; }); - return i || (M.equals = Vr), function(P, z) { + return i || (M.equals = qr), function(P, Y) { if (arguments.length > 0) { - const J = z ? x(M) : a ? bt(P) : P; - return M.equals(J) || ($ = !0, W(T, J), p && c !== void 0 && (c = J), Hn(() => x(M))), P; + const J = Y ? w(M) : a ? $t(P) : P; + return M.equals(J) || ($ = !0, W(T, J), p && c !== void 0 && (c = J), Vn(() => w(M))), P; } - return x(M); + return w(M); }; } -function gl(t) { - return new _l(t); +function _l(t) { + return new ml(t); } -var re, Et; -class _l { +var se, Tt; +class ml { /** * @param {ComponentConstructorOptions & { * component: any; @@ -1486,57 +1494,57 @@ class _l { */ constructor(e) { /** @type {any} */ - cr(this, re); + fr(this, se); /** @type {Record} */ - cr(this, Et); + fr(this, Tt); var s; var n = /* @__PURE__ */ new Map(), r = (a, l) => { - var u = /* @__PURE__ */ Br(l); + var u = /* @__PURE__ */ Vr(l); return n.set(a, u), u; }; const i = new Proxy( { ...e.props || {}, $$events: {} }, { get(a, l) { - return x(n.get(l) ?? r(l, Reflect.get(a, l))); + return w(n.get(l) ?? r(l, Reflect.get(a, l))); }, has(a, l) { - return l === Bi ? !0 : (x(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); + return l === Bi ? !0 : (w(n.get(l) ?? r(l, Reflect.get(a, l))), Reflect.has(a, l)); }, set(a, l, u) { return W(n.get(l) ?? r(l, u), u), Reflect.set(a, l, u); } } ); - hr(this, Et, (e.hydrate ? ul : vs)(e.component, { + cr(this, Tt, (e.hydrate ? fl : vs)(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) && Nt(), hr(this, re, i.$$events); - for (const a of Object.keys(ct(this, Et))) - a === "$set" || a === "$destroy" || a === "$on" || Fn(this, a, { + })), (!((s = e == null ? void 0 : e.props) != null && s.$$host) || e.sync === !1) && kt(), cr(this, se, i.$$events); + for (const a of Object.keys(ht(this, Tt))) + a === "$set" || a === "$destroy" || a === "$on" || Dn(this, a, { get() { - return ct(this, Et)[a]; + return ht(this, Tt)[a]; }, /** @param {any} value */ set(l) { - ct(this, Et)[a] = l; + ht(this, Tt)[a] = l; }, enumerable: !0 }); - ct(this, Et).$set = /** @param {Record} next */ + ht(this, Tt).$set = /** @param {Record} next */ (a) => { Object.assign(i, a); - }, ct(this, Et).$destroy = () => { - fl(ct(this, Et)); + }, ht(this, Tt).$destroy = () => { + cl(ht(this, Tt)); }; } /** @param {Record} props */ $set(e) { - ct(this, Et).$set(e); + ht(this, Tt).$set(e); } /** * @param {string} event @@ -1544,20 +1552,20 @@ class _l { * @returns {any} */ $on(e, n) { - ct(this, re)[e] = ct(this, re)[e] || []; + ht(this, se)[e] = ht(this, se)[e] || []; const r = (...i) => n.call(this, ...i); - return ct(this, re)[e].push(r), () => { - ct(this, re)[e] = ct(this, re)[e].filter( + return ht(this, se)[e].push(r), () => { + ht(this, se)[e] = ht(this, se)[e].filter( /** @param {any} fn */ (i) => i !== r ); }; } $destroy() { - ct(this, Et).$destroy(); + ht(this, Tt).$destroy(); } } -re = new WeakMap(), Et = new WeakMap(); +se = new WeakMap(), Tt = new WeakMap(); let ms; typeof HTMLElement == "function" && (ms = class extends HTMLElement { /** @@ -1568,25 +1576,25 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement { constructor(e, n, r) { super(); /** The Svelte component constructor */ - kt(this, "$$ctor"); + Ft(this, "$$ctor"); /** Slots */ - kt(this, "$$s"); + Ft(this, "$$s"); /** @type {any} The Svelte component instance */ - kt(this, "$$c"); + Ft(this, "$$c"); /** Whether or not the custom element is connected */ - kt(this, "$$cn", !1); + Ft(this, "$$cn", !1); /** @type {Record} Component props data */ - kt(this, "$$d", {}); + Ft(this, "$$d", {}); /** `true` if currently in the process of reflecting component props back to attributes */ - kt(this, "$$r", !1); + Ft(this, "$$r", !1); /** @type {Record} Props definition (name, reflected, type etc) */ - kt(this, "$$p_d", {}); + Ft(this, "$$p_d", {}); /** @type {Record} Event listeners */ - kt(this, "$$l", {}); + Ft(this, "$$l", {}); /** @type {Map} Event listener unsubscribe functions */ - kt(this, "$$l_u", /* @__PURE__ */ new Map()); + Ft(this, "$$l_u", /* @__PURE__ */ new Map()); /** @type {any} The managed render effect for reflecting attributes */ - kt(this, "$$me"); + Ft(this, "$$me"); this.$$ctor = e, this.$$s = n, r && this.attachShadow({ mode: "open" }); } /** @@ -1617,22 +1625,22 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement { let n = function(s) { return (a) => { const l = document.createElement("slot"); - s !== "default" && (l.name = s), ve(a, l); + s !== "default" && (l.name = s), Xt(a, l); }; }; var e = n; if (await Promise.resolve(), !this.$$cn || this.$$c) return; - const r = {}, i = ml(this); + const r = {}, i = yl(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] = Cn(a, s.value, this.$$p_d, "toProp")); + a in this.$$d || (this.$$d[a] = En(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 = gl({ + this.$$c = _l({ component: this.$$ctor, target: this.shadowRoot || this, props: { @@ -1640,14 +1648,14 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement { $$slots: r, $$host: this } - }), this.$$me = el(() => { + }), this.$$me = nl(() => { ss(() => { var s; this.$$r = !0; - for (const a of Dn(this.$$c)) { + for (const a of Pn(this.$$c)) { if (!((s = this.$$p_d[a]) != null && s.reflect)) continue; this.$$d[a] = this.$$c[a]; - const l = Cn( + const l = En( a, this.$$d[a], this.$$p_d, @@ -1675,7 +1683,7 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement { */ attributeChangedCallback(e, n, r) { var i; - this.$$r || (e = this.$$g_p(e), this.$$d[e] = Cn(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] = En(e, r, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set({ [e]: this.$$d[e] })); } disconnectedCallback() { this.$$cn = !1, Promise.resolve().then(() => { @@ -1686,12 +1694,12 @@ typeof HTMLElement == "function" && (ms = class extends HTMLElement { * @param {string} attribute_name */ $$g_p(e) { - return Dn(this.$$p_d).find( + return Pn(this.$$p_d).find( (n) => this.$$p_d[n].attribute === e || !this.$$p_d[n].attribute && n.toLowerCase() === e ) || e; } }); -function Cn(t, e, n, r) { +function En(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]) @@ -1722,7 +1730,7 @@ function Cn(t, e, n, r) { return e; } } -function ml(t) { +function yl(t) { const e = {}; return t.childNodes.forEach((n) => { e[ @@ -1737,28 +1745,28 @@ function ys(t, e, n, r, i, s) { super(t, n, i), this.$$p_d = e; } static get observedAttributes() { - return Dn(e).map( + return Pn(e).map( (l) => (e[l].attribute || l).toLowerCase() ); } }; - return Dn(e).forEach((l) => { - Fn(a.prototype, l, { + return Pn(e).forEach((l) => { + Dn(a.prototype, l, { get() { return this.$$c && l in this.$$c ? this.$$c[l] : this.$$d[l]; }, set(u) { var h; - u = Cn(l, u, e), this.$$d[l] = u; + u = En(l, u, e), this.$$d[l] = u; var f = this.$$c; if (f) { - var o = (h = $e(f, l)) == null ? void 0 : h.get; + var o = (h = Re(f, l)) == null ? void 0 : h.get; o ? f[l] = u : f.$set({ [l]: u }); } } }); }), r.forEach((l) => { - Fn(a.prototype, l, { + Dn(a.prototype, l, { get() { var u; return (u = this.$$c) == null ? void 0 : u[l]; @@ -1767,31 +1775,31 @@ function ys(t, e, n, r, i, s) { }), t.element = /** @type {any} */ a, a; } -var yl = { value: () => { +var wl = { value: () => { } }; function ws() { 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 Nn(n); + return new Cn(n); } -function Nn(t) { +function Cn(t) { this._ = t; } -function wl(t, e) { +function xl(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 }; }); } -Nn.prototype = ws.prototype = { - constructor: Nn, +Cn.prototype = ws.prototype = { + constructor: Cn, on: function(t, e) { - var n = this._, r = wl(t + "", n), i, s = -1, a = r.length; + var n = this._, r = xl(t + "", n), i, s = -1, a = r.length; if (arguments.length < 2) { - for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = xl(n[i], t.name))) return i; + for (; ++s < a; ) if ((i = (t = r[s]).type) && (i = bl(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); @@ -1803,7 +1811,7 @@ Nn.prototype = ws.prototype = { copy: function() { var t = {}, e = this._; for (var n in e) t[n] = e[n].slice(); - return new Nn(t); + return new Cn(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]; @@ -1815,7 +1823,7 @@ Nn.prototype = ws.prototype = { for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(e, n); } }; -function xl(t, e) { +function bl(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; @@ -1823,74 +1831,74 @@ function xl(t, e) { function xi(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { - t[r] = yl, t = t.slice(0, r).concat(t.slice(r + 1)); + t[r] = wl, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } -var Ar = "http://www.w3.org/1999/xhtml"; +var $r = "http://www.w3.org/1999/xhtml"; const bi = { svg: "http://www.w3.org/2000/svg", - xhtml: Ar, + xhtml: $r, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function ir(t) { +function nr(t) { var e = t += "", n = e.indexOf(":"); return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), bi.hasOwnProperty(e) ? { space: bi[e], local: t } : t; } -function bl(t) { +function $l(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; - return n === Ar && e.documentElement.namespaceURI === Ar ? e.createElement(t) : e.createElementNS(n, t); + return n === $r && e.documentElement.namespaceURI === $r ? e.createElement(t) : e.createElementNS(n, t); }; } -function $l(t) { +function Al(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function xs(t) { - var e = ir(t); - return (e.local ? $l : bl)(e); + var e = nr(t); + return (e.local ? Al : $l)(e); } -function Al() { +function Rl() { } -function Jr(t) { - return t == null ? Al : function() { +function Wr(t) { + return t == null ? Rl : function() { return this.querySelector(t); }; } -function Rl(t) { - typeof t != "function" && (t = Jr(t)); +function El(t) { + typeof t != "function" && (t = Wr(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, l = r[i] = new Array(a), u, f, o = 0; o < a; ++o) (u = s[o]) && (f = t.call(u, u.__data__, o, s)) && ("__data__" in u && (f.__data__ = u.__data__), l[o] = f); - return new $t(r, this._parents); + return new At(r, this._parents); } -function El(t) { +function Cl(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } -function Cl() { +function Nl() { return []; } function bs(t) { - return t == null ? Cl : function() { + return t == null ? Nl : function() { return this.querySelectorAll(t); }; } -function Nl(t) { +function Tl(t) { return function() { - return El(t.apply(this, arguments)); + return Cl(t.apply(this, arguments)); }; } -function Tl(t) { - typeof t == "function" ? t = Nl(t) : t = bs(t); +function Sl(t) { + typeof t == "function" ? t = Tl(t) : t = bs(t); for (var e = this._groups, n = e.length, r = [], i = [], s = 0; s < n; ++s) for (var a = e[s], l = a.length, u, f = 0; f < l; ++f) (u = a[f]) && (r.push(t.call(u, u.__data__, f, a)), i.push(u)); - return new $t(r, i); + return new At(r, i); } function $s(t) { return function() { @@ -1902,48 +1910,48 @@ function As(t) { return e.matches(t); }; } -var Sl = Array.prototype.find; -function kl(t) { +var kl = Array.prototype.find; +function Ml(t) { return function() { - return Sl.call(this.children, t); + return kl.call(this.children, t); }; } -function Ml() { +function Ol() { return this.firstElementChild; } -function Ol(t) { - return this.select(t == null ? Ml : kl(typeof t == "function" ? t : As(t))); +function Pl(t) { + return this.select(t == null ? Ol : Ml(typeof t == "function" ? t : As(t))); } -var Pl = Array.prototype.filter; -function Dl() { +var Dl = Array.prototype.filter; +function Fl() { return Array.from(this.children); } -function Fl(t) { +function Il(t) { return function() { - return Pl.call(this.children, t); + return Dl.call(this.children, t); }; } -function Il(t) { - return this.selectAll(t == null ? Dl : Fl(typeof t == "function" ? t : As(t))); -} function Ll(t) { + return this.selectAll(t == null ? Fl : Il(typeof t == "function" ? t : As(t))); +} +function ql(t) { typeof t != "function" && (t = $s(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, l = r[i] = [], u, f = 0; f < a; ++f) (u = s[f]) && t.call(u, u.__data__, f, s) && l.push(u); - return new $t(r, this._parents); + return new At(r, this._parents); } function Rs(t) { return new Array(t.length); } -function ql() { - return new $t(this._enter || this._groups.map(Rs), this._parents); +function Vl() { + return new At(this._enter || this._groups.map(Rs), this._parents); } -function Un(t, e) { +function Yn(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } -Un.prototype = { - constructor: Un, +Yn.prototype = { + constructor: Yn, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, @@ -1957,35 +1965,35 @@ Un.prototype = { return this._parent.querySelectorAll(t); } }; -function Vl(t) { +function Bl(t) { return function() { return t; }; } -function Bl(t, e, n, r, i, s) { +function Hl(t, e, n, r, i, s) { for (var a = 0, l, u = e.length, f = s.length; a < f; ++a) - (l = e[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new Un(t, s[a]); + (l = e[a]) ? (l.__data__ = s[a], r[a] = l) : n[a] = new Yn(t, s[a]); for (; a < u; ++a) (l = e[a]) && (i[a] = l); } -function Hl(t, e, n, r, i, s, a) { +function Yl(t, e, n, r, i, s, a) { var l, u, f = /* @__PURE__ */ new Map(), o = e.length, h = s.length, c = new Array(o), d; for (l = 0; l < o; ++l) (u = e[l]) && (c[l] = d = a.call(u, u.__data__, l, e) + "", f.has(d) ? i[l] = u : f.set(d, u)); for (l = 0; l < h; ++l) - d = a.call(t, s[l], l, s) + "", (u = f.get(d)) ? (r[l] = u, u.__data__ = s[l], f.delete(d)) : n[l] = new Un(t, s[l]); + d = a.call(t, s[l], l, s) + "", (u = f.get(d)) ? (r[l] = u, u.__data__ = s[l], f.delete(d)) : n[l] = new Yn(t, s[l]); for (l = 0; l < o; ++l) (u = e[l]) && f.get(c[l]) === u && (i[l] = u); } -function Yl(t) { +function zl(t) { return t.__data__; } -function zl(t, e) { - if (!arguments.length) return Array.from(this, Yl); - var n = e ? Hl : Bl, r = this._parents, i = this._groups; - typeof t != "function" && (t = Vl(t)); +function Ul(t, e) { + if (!arguments.length) return Array.from(this, zl); + var n = e ? Yl : Hl, r = this._parents, i = this._groups; + typeof t != "function" && (t = Bl(t)); for (var s = i.length, a = new Array(s), l = new Array(s), u = new Array(s), f = 0; f < s; ++f) { - var o = r[f], h = i[f], c = h.length, d = Ul(t.call(o, o && o.__data__, f, r)), p = d.length, y = l[f] = new Array(p), R = a[f] = new Array(p), _ = u[f] = new Array(c); + var o = r[f], h = i[f], c = h.length, d = jl(t.call(o, o && o.__data__, f, r)), p = d.length, y = l[f] = new Array(p), R = a[f] = new Array(p), _ = u[f] = new Array(c); n(o, h, y, R, _, d, e); for (var $ = 0, T = 0, M, b; $ < p; ++$) if (M = y[$]) { @@ -1993,34 +2001,34 @@ function zl(t, e) { M._next = b || null; } } - return a = new $t(a, r), a._enter = l, a._exit = u, a; + return a = new At(a, r), a._enter = l, a._exit = u, a; } -function Ul(t) { +function jl(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function jl() { - return new $t(this._exit || this._groups.map(Rs), this._parents); +function Xl() { + return new At(this._exit || this._groups.map(Rs), this._parents); } -function Xl(t, e, n) { +function Gl(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 Gl(t) { +function Kl(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), l = new Array(i), u = 0; u < a; ++u) for (var f = n[u], o = r[u], h = f.length, c = l[u] = new Array(h), d, p = 0; p < h; ++p) (d = f[p] || o[p]) && (c[p] = d); for (; u < i; ++u) l[u] = n[u]; - return new $t(l, this._parents); + return new At(l, this._parents); } -function Kl() { +function Wl() { 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 Wl(t) { - t || (t = Jl); +function Jl(t) { + t || (t = Zl); function e(h, c) { return h && c ? t(h.__data__, c.__data__) : !h - !c; } @@ -2029,19 +2037,19 @@ function Wl(t) { (f = a[o]) && (u[o] = f); u.sort(e); } - return new $t(i, this._parents).order(); + return new At(i, this._parents).order(); } -function Jl(t, e) { +function Zl(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } -function Zl() { +function Ql() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } -function Ql() { +function to() { return Array.from(this); } -function to() { +function eo() { 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]; @@ -2049,108 +2057,108 @@ function to() { } return null; } -function eo() { +function no() { let t = 0; for (const e of this) ++t; return t; } -function no() { +function ro() { return !this.node(); } -function ro(t) { +function io(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], s = 0, a = i.length, l; s < a; ++s) (l = i[s]) && t.call(l, l.__data__, s, i); return this; } -function io(t) { +function so(t) { return function() { this.removeAttribute(t); }; } -function so(t) { +function ao(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function ao(t, e) { +function lo(t, e) { return function() { this.setAttribute(t, e); }; } -function lo(t, e) { +function oo(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } -function oo(t, e) { +function uo(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } -function uo(t, e) { +function fo(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 fo(t, e) { - var n = ir(t); +function co(t, e) { + var n = nr(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 ? so : io : typeof e == "function" ? n.local ? uo : oo : n.local ? lo : ao)(n, e)); + return this.each((e == null ? n.local ? ao : so : typeof e == "function" ? n.local ? fo : uo : n.local ? oo : lo)(n, e)); } function Es(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } -function co(t) { +function ho(t) { return function() { this.style.removeProperty(t); }; } -function ho(t, e, n) { +function vo(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } -function vo(t, e, n) { +function po(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } -function po(t, e, n) { - return arguments.length > 1 ? this.each((e == null ? co : typeof e == "function" ? vo : ho)(t, e, n ?? "")) : Ie(this.node(), t); +function go(t, e, n) { + return arguments.length > 1 ? this.each((e == null ? ho : typeof e == "function" ? po : vo)(t, e, n ?? "")) : Be(this.node(), t); } -function Ie(t, e) { +function Be(t, e) { return t.style.getPropertyValue(e) || Es(t).getComputedStyle(t, null).getPropertyValue(e); } -function go(t) { +function _o(t) { return function() { delete this[t]; }; } -function _o(t, e) { +function mo(t, e) { return function() { this[t] = e; }; } -function mo(t, e) { +function yo(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } -function yo(t, e) { - return arguments.length > 1 ? this.each((e == null ? go : typeof e == "function" ? mo : _o)(t, e)) : this.node()[t]; +function wo(t, e) { + return arguments.length > 1 ? this.each((e == null ? _o : typeof e == "function" ? yo : mo)(t, e)) : this.node()[t]; } function Cs(t) { return t.trim().split(/^|\s+/); } -function Zr(t) { +function Jr(t) { return t.classList || new Ns(t); } function Ns(t) { @@ -2170,128 +2178,128 @@ Ns.prototype = { } }; function Ts(t, e) { - for (var n = Zr(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); + for (var n = Jr(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } function Ss(t, e) { - for (var n = Zr(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); + for (var n = Jr(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } -function wo(t) { +function xo(t) { return function() { Ts(this, t); }; } -function xo(t) { +function bo(t) { return function() { Ss(this, t); }; } -function bo(t, e) { +function $o(t, e) { return function() { (e.apply(this, arguments) ? Ts : Ss)(this, t); }; } -function $o(t, e) { +function Ao(t, e) { var n = Cs(t + ""); if (arguments.length < 2) { - for (var r = Zr(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; + for (var r = Jr(this.node()), i = -1, s = n.length; ++i < s; ) if (!r.contains(n[i])) return !1; return !0; } - return this.each((typeof e == "function" ? bo : e ? wo : xo)(n, e)); + return this.each((typeof e == "function" ? $o : e ? xo : bo)(n, e)); } -function Ao() { +function Ro() { this.textContent = ""; } -function Ro(t) { +function Eo(t) { return function() { this.textContent = t; }; } -function Eo(t) { +function Co(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } -function Co(t) { - return arguments.length ? this.each(t == null ? Ao : (typeof t == "function" ? Eo : Ro)(t)) : this.node().textContent; +function No(t) { + return arguments.length ? this.each(t == null ? Ro : (typeof t == "function" ? Co : Eo)(t)) : this.node().textContent; } -function No() { +function To() { this.innerHTML = ""; } -function To(t) { +function So(t) { return function() { this.innerHTML = t; }; } -function So(t) { +function ko(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } -function ko(t) { - return arguments.length ? this.each(t == null ? No : (typeof t == "function" ? So : To)(t)) : this.node().innerHTML; -} -function Mo() { - this.nextSibling && this.parentNode.appendChild(this); +function Mo(t) { + return arguments.length ? this.each(t == null ? To : (typeof t == "function" ? ko : So)(t)) : this.node().innerHTML; } function Oo() { - return this.each(Mo); + this.nextSibling && this.parentNode.appendChild(this); } function Po() { - this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); + return this.each(Oo); } function Do() { - return this.each(Po); + this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function Fo(t) { +function Fo() { + return this.each(Do); +} +function Io(t) { var e = typeof t == "function" ? t : xs(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function Io() { +function Lo() { return null; } -function Lo(t, e) { - var n = typeof t == "function" ? t : xs(t), r = e == null ? Io : typeof e == "function" ? e : Jr(e); +function qo(t, e) { + var n = typeof t == "function" ? t : xs(t), r = e == null ? Lo : typeof e == "function" ? e : Wr(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } -function qo() { +function Vo() { var t = this.parentNode; t && t.removeChild(this); } -function Vo() { - return this.each(qo); -} function Bo() { + return this.each(Vo); +} +function Ho() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function Ho() { +function Yo() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } -function Yo(t) { - return this.select(t ? Ho : Bo); -} function zo(t) { - return arguments.length ? this.property("__data__", t) : this.node().__data__; + return this.select(t ? Yo : Ho); } function Uo(t) { + return arguments.length ? this.property("__data__", t) : this.node().__data__; +} +function jo(t) { return function(e) { t.call(this, e, this.__data__); }; } -function jo(t) { +function Xo(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 Xo(t) { +function Go(t) { return function() { var e = this.__on; if (e) { @@ -2301,9 +2309,9 @@ function Xo(t) { } }; } -function Go(t, e, n) { +function Ko(t, e, n) { return function() { - var r = this.__on, i, s = Uo(e); + var r = this.__on, i, s = jo(e); if (r) { for (var a = 0, l = r.length; a < l; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { @@ -2314,8 +2322,8 @@ function Go(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 Ko(t, e, n) { - var r = jo(t + ""), i, s = r.length, a; +function Wo(t, e, n) { + var r = Xo(t + ""), i, s = r.length, a; if (arguments.length < 2) { var l = this.node().__on; if (l) { @@ -2326,83 +2334,83 @@ function Ko(t, e, n) { } return; } - for (l = e ? Go : Xo, i = 0; i < s; ++i) this.each(l(r[i], e, n)); + for (l = e ? Ko : Go, i = 0; i < s; ++i) this.each(l(r[i], e, n)); return this; } function ks(t, e, n) { var r = Es(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 Wo(t, e) { +function Jo(t, e) { return function() { return ks(this, t, e); }; } -function Jo(t, e) { +function Zo(t, e) { return function() { return ks(this, t, e.apply(this, arguments)); }; } -function Zo(t, e) { - return this.each((typeof e == "function" ? Jo : Wo)(t, e)); +function Qo(t, e) { + return this.each((typeof e == "function" ? Zo : Jo)(t, e)); } -function* Qo() { +function* tu() { 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 Ms = [null]; -function $t(t, e) { +function At(t, e) { this._groups = t, this._parents = e; } -function Ye() { - return new $t([[document.documentElement]], Ms); +function Xe() { + return new At([[document.documentElement]], Ms); } -function tu() { +function eu() { return this; } -$t.prototype = Ye.prototype = { - constructor: $t, - select: Rl, - selectAll: Tl, - selectChild: Ol, - selectChildren: Il, - filter: Ll, - data: zl, - enter: ql, - exit: jl, - join: Xl, - merge: Gl, - selection: tu, - order: Kl, - sort: Wl, - call: Zl, - nodes: Ql, - node: to, - size: eo, - empty: no, - each: ro, - attr: fo, - style: po, - property: yo, - classed: $o, - text: Co, - html: ko, - raise: Oo, - lower: Do, - append: Fo, - insert: Lo, - remove: Vo, - clone: Yo, - datum: zo, - on: Ko, - dispatch: Zo, - [Symbol.iterator]: Qo +At.prototype = Xe.prototype = { + constructor: At, + select: El, + selectAll: Sl, + selectChild: Pl, + selectChildren: Ll, + filter: ql, + data: Ul, + enter: Vl, + exit: Xl, + join: Gl, + merge: Kl, + selection: eu, + order: Wl, + sort: Jl, + call: Ql, + nodes: to, + node: eo, + size: no, + empty: ro, + each: io, + attr: co, + style: go, + property: wo, + classed: Ao, + text: No, + html: Mo, + raise: Po, + lower: Fo, + append: Io, + insert: qo, + remove: Bo, + clone: zo, + datum: Uo, + on: Wo, + dispatch: Qo, + [Symbol.iterator]: tu }; function at(t) { - return typeof t == "string" ? new $t([[document.querySelector(t)]], [document.documentElement]) : new $t([[t]], Ms); + return typeof t == "string" ? new At([[document.querySelector(t)]], [document.documentElement]) : new At([[t]], Ms); } -function Qr(t, e, n) { +function Zr(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } function Os(t, e) { @@ -2410,9 +2418,9 @@ function Os(t, e) { for (var r in e) n[r] = e[r]; return n; } -function on() { +function cn() { } -var nn = 0.7, jn = 1 / nn, Pe = "\\s*([+-]?\\d+)\\s*", rn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", jt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", eu = /^#([0-9a-f]{3,8})$/, nu = new RegExp(`^rgb\\(${Pe},${Pe},${Pe}\\)$`), ru = new RegExp(`^rgb\\(${jt},${jt},${jt}\\)$`), iu = new RegExp(`^rgba\\(${Pe},${Pe},${Pe},${rn}\\)$`), su = new RegExp(`^rgba\\(${jt},${jt},${jt},${rn}\\)$`), au = new RegExp(`^hsl\\(${rn},${jt},${jt}\\)$`), lu = new RegExp(`^hsla\\(${rn},${jt},${jt},${rn}\\)$`), $i = { +var an = 0.7, zn = 1 / an, Ie = "\\s*([+-]?\\d+)\\s*", ln = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Wt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", nu = /^#([0-9a-f]{3,8})$/, ru = new RegExp(`^rgb\\(${Ie},${Ie},${Ie}\\)$`), iu = new RegExp(`^rgb\\(${Wt},${Wt},${Wt}\\)$`), su = new RegExp(`^rgba\\(${Ie},${Ie},${Ie},${ln}\\)$`), au = new RegExp(`^rgba\\(${Wt},${Wt},${Wt},${ln}\\)$`), lu = new RegExp(`^hsl\\(${ln},${Wt},${Wt}\\)$`), ou = new RegExp(`^hsla\\(${ln},${Wt},${Wt},${ln}\\)$`), $i = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, @@ -2562,7 +2570,7 @@ var nn = 0.7, jn = 1 / nn, Pe = "\\s*([+-]?\\d+)\\s*", rn = "\\s*([+-]?(?:\\d*\\ yellow: 16776960, yellowgreen: 10145074 }; -Qr(on, Ee, { +Zr(cn, Te, { copy(t) { return Object.assign(new this.constructor(), this, t); }, @@ -2572,54 +2580,54 @@ Qr(on, Ee, { hex: Ai, // Deprecated! Use color.formatHex. formatHex: Ai, - formatHex8: ou, - formatHsl: uu, + formatHex8: uu, + formatHsl: fu, formatRgb: Ri, toString: Ri }); function Ai() { return this.rgb().formatHex(); } -function ou() { +function uu() { return this.rgb().formatHex8(); } -function uu() { +function fu() { return Ps(this).formatHsl(); } function Ri() { return this.rgb().formatRgb(); } -function Ee(t) { +function Te(t) { var e, n; - return t = (t + "").trim().toLowerCase(), (e = eu.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ei(e) : n === 3 ? new vt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? wn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? wn(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 = nu.exec(t)) ? new vt(e[1], e[2], e[3], 1) : (e = ru.exec(t)) ? new vt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = iu.exec(t)) ? wn(e[1], e[2], e[3], e[4]) : (e = su.exec(t)) ? wn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = au.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, 1) : (e = lu.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, e[4]) : $i.hasOwnProperty(t) ? Ei($i[t]) : t === "transparent" ? new vt(NaN, NaN, NaN, 0) : null; + return t = (t + "").trim().toLowerCase(), (e = nu.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Ei(e) : n === 3 ? new pt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? yn(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? yn(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 = ru.exec(t)) ? new pt(e[1], e[2], e[3], 1) : (e = iu.exec(t)) ? new pt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = su.exec(t)) ? yn(e[1], e[2], e[3], e[4]) : (e = au.exec(t)) ? yn(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = lu.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, 1) : (e = ou.exec(t)) ? Ti(e[1], e[2] / 100, e[3] / 100, e[4]) : $i.hasOwnProperty(t) ? Ei($i[t]) : t === "transparent" ? new pt(NaN, NaN, NaN, 0) : null; } function Ei(t) { - return new vt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); + return new pt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } -function wn(t, e, n, r) { - return r <= 0 && (t = e = n = NaN), new vt(t, e, n, r); +function yn(t, e, n, r) { + return r <= 0 && (t = e = n = NaN), new pt(t, e, n, r); } -function fu(t) { - return t instanceof on || (t = Ee(t)), t ? (t = t.rgb(), new vt(t.r, t.g, t.b, t.opacity)) : new vt(); +function cu(t) { + return t instanceof cn || (t = Te(t)), t ? (t = t.rgb(), new pt(t.r, t.g, t.b, t.opacity)) : new pt(); } -function Rr(t, e, n, r) { - return arguments.length === 1 ? fu(t) : new vt(t, e, n, r ?? 1); +function Ar(t, e, n, r) { + return arguments.length === 1 ? cu(t) : new pt(t, e, n, r ?? 1); } -function vt(t, e, n, r) { +function pt(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } -Qr(vt, Rr, Os(on, { +Zr(pt, Ar, Os(cn, { brighter(t) { - return t = t == null ? jn : Math.pow(jn, t), new vt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? zn : Math.pow(zn, t), new pt(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { - return t = t == null ? nn : Math.pow(nn, t), new vt(this.r * t, this.g * t, this.b * t, this.opacity); + return t = t == null ? an : Math.pow(an, t), new pt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { - return new vt(Ae(this.r), Ae(this.g), Ae(this.b), Xn(this.opacity)); + return new pt(Ee(this.r), Ee(this.g), Ee(this.b), Un(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; @@ -2627,113 +2635,113 @@ Qr(vt, Rr, Os(on, { hex: Ci, // Deprecated! Use color.formatHex. formatHex: Ci, - formatHex8: cu, + formatHex8: hu, formatRgb: Ni, toString: Ni })); function Ci() { - return `#${be(this.r)}${be(this.g)}${be(this.b)}`; + return `#${Ae(this.r)}${Ae(this.g)}${Ae(this.b)}`; } -function cu() { - return `#${be(this.r)}${be(this.g)}${be(this.b)}${be((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +function hu() { + return `#${Ae(this.r)}${Ae(this.g)}${Ae(this.b)}${Ae((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Ni() { - const t = Xn(this.opacity); - return `${t === 1 ? "rgb(" : "rgba("}${Ae(this.r)}, ${Ae(this.g)}, ${Ae(this.b)}${t === 1 ? ")" : `, ${t})`}`; + const t = Un(this.opacity); + return `${t === 1 ? "rgb(" : "rgba("}${Ee(this.r)}, ${Ee(this.g)}, ${Ee(this.b)}${t === 1 ? ")" : `, ${t})`}`; } -function Xn(t) { +function Un(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } -function Ae(t) { +function Ee(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } -function be(t) { - return t = Ae(t), (t < 16 ? "0" : "") + t.toString(16); +function Ae(t) { + return t = Ee(t), (t < 16 ? "0" : "") + t.toString(16); } function Ti(t, e, n, r) { - return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Pt(t, e, n, r); + return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new qt(t, e, n, r); } function Ps(t) { - if (t instanceof Pt) return new Pt(t.h, t.s, t.l, t.opacity); - if (t instanceof on || (t = Ee(t)), !t) return new Pt(); - if (t instanceof Pt) return t; + if (t instanceof qt) return new qt(t.h, t.s, t.l, t.opacity); + if (t instanceof cn || (t = Te(t)), !t) return new qt(); + if (t instanceof qt) 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, l = s - i, u = (s + i) / 2; - return l ? (e === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - e) / l + 2 : a = (e - n) / l + 4, l /= u < 0.5 ? s + i : 2 - s - i, a *= 60) : l = u > 0 && u < 1 ? 0 : a, new Pt(a, l, u, t.opacity); + return l ? (e === s ? a = (n - r) / l + (n < r) * 6 : n === s ? a = (r - e) / l + 2 : a = (e - n) / l + 4, l /= u < 0.5 ? s + i : 2 - s - i, a *= 60) : l = u > 0 && u < 1 ? 0 : a, new qt(a, l, u, t.opacity); } -function hu(t, e, n, r) { - return arguments.length === 1 ? Ps(t) : new Pt(t, e, n, r ?? 1); +function du(t, e, n, r) { + return arguments.length === 1 ? Ps(t) : new qt(t, e, n, r ?? 1); } -function Pt(t, e, n, r) { +function qt(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } -Qr(Pt, hu, Os(on, { +Zr(qt, du, Os(cn, { brighter(t) { - return t = t == null ? jn : Math.pow(jn, t), new Pt(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? zn : Math.pow(zn, t), new qt(this.h, this.s, this.l * t, this.opacity); }, darker(t) { - return t = t == null ? nn : Math.pow(nn, t), new Pt(this.h, this.s, this.l * t, this.opacity); + return t = t == null ? an : Math.pow(an, t), new qt(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 vt( - pr(t >= 240 ? t - 240 : t + 120, i, r), - pr(t, i, r), - pr(t < 120 ? t + 240 : t - 120, i, r), + return new pt( + vr(t >= 240 ? t - 240 : t + 120, i, r), + vr(t, i, r), + vr(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { - return new Pt(Si(this.h), xn(this.s), xn(this.l), Xn(this.opacity)); + return new qt(Si(this.h), wn(this.s), wn(this.l), Un(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 = Xn(this.opacity); - return `${t === 1 ? "hsl(" : "hsla("}${Si(this.h)}, ${xn(this.s) * 100}%, ${xn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; + const t = Un(this.opacity); + return `${t === 1 ? "hsl(" : "hsla("}${Si(this.h)}, ${wn(this.s) * 100}%, ${wn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function Si(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } -function xn(t) { +function wn(t) { return Math.max(0, Math.min(1, t || 0)); } -function pr(t, e, n) { +function vr(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 ti = (t) => () => t; -function du(t, e) { +const Qr = (t) => () => t; +function vu(t, e) { return function(n) { return t + n * e; }; } -function vu(t, e, n) { +function pu(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 pu(t) { +function gu(t) { return (t = +t) == 1 ? Ds : function(e, n) { - return n - e ? vu(e, n, t) : ti(isNaN(e) ? n : e); + return n - e ? pu(e, n, t) : Qr(isNaN(e) ? n : e); }; } function Ds(t, e) { var n = e - t; - return n ? du(t, n) : ti(isNaN(t) ? e : t); + return n ? vu(t, n) : Qr(isNaN(t) ? e : t); } -const Gn = function t(e) { - var n = pu(e); +const jn = function t(e) { + var n = gu(e); function r(i, s) { - var a = n((i = Rr(i)).r, (s = Rr(s)).r), l = n(i.g, s.g), u = n(i.b, s.b), f = Ds(i.opacity, s.opacity); + var a = n((i = Ar(i)).r, (s = Ar(s)).r), l = n(i.g, s.g), u = n(i.b, s.b), f = Ds(i.opacity, s.opacity); return function(o) { return i.r = a(o), i.g = l(o), i.b = u(o), i.opacity = f(o), i + ""; }; } return r.gamma = t, r; }(1); -function gu(t, e) { +function _u(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(s) { @@ -2741,64 +2749,64 @@ function gu(t, e) { return r; }; } -function _u(t) { +function mu(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } -function mu(t, e) { +function yu(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] = Me(t[a], e[a]); + for (a = 0; a < r; ++a) i[a] = De(t[a], e[a]); for (; a < n; ++a) s[a] = e[a]; return function(l) { for (a = 0; a < r; ++a) s[a] = i[a](l); return s; }; } -function yu(t, e) { +function wu(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; }; } -function zt(t, e) { +function Gt(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } -function wu(t, e) { +function xu(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] = Me(t[i], e[i]) : r[i] = e[i]; + i in t ? n[i] = De(t[i], e[i]) : r[i] = e[i]; return function(s) { for (i in n) r[i] = n[i](s); return r; }; } -var Er = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, gr = new RegExp(Er.source, "g"); -function xu(t) { +var Rr = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, pr = new RegExp(Rr.source, "g"); +function bu(t) { return function() { return t; }; } -function bu(t) { +function $u(t) { return function(e) { return t(e) + ""; }; } function Fs(t, e) { - var n = Er.lastIndex = gr.lastIndex = 0, r, i, s, a = -1, l = [], u = []; - for (t = t + "", e = e + ""; (r = Er.exec(t)) && (i = gr.exec(e)); ) - (s = i.index) > n && (s = e.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, u.push({ i: a, x: zt(r, i) })), n = gr.lastIndex; - return n < e.length && (s = e.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? u[0] ? bu(u[0].x) : xu(e) : (e = u.length, function(f) { + var n = Rr.lastIndex = pr.lastIndex = 0, r, i, s, a = -1, l = [], u = []; + for (t = t + "", e = e + ""; (r = Rr.exec(t)) && (i = pr.exec(e)); ) + (s = i.index) > n && (s = e.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, u.push({ i: a, x: Gt(r, i) })), n = pr.lastIndex; + return n < e.length && (s = e.slice(n), l[a] ? l[a] += s : l[++a] = s), l.length < 2 ? u[0] ? $u(u[0].x) : bu(e) : (e = u.length, function(f) { for (var o = 0, h; o < e; ++o) l[(h = u[o]).i] = h.x(f); return l.join(""); }); } -function Me(t, e) { +function De(t, e) { var n = typeof e, r; - return e == null || n === "boolean" ? ti(e) : (n === "number" ? zt : n === "string" ? (r = Ee(e)) ? (e = r, Gn) : Fs : e instanceof Ee ? Gn : e instanceof Date ? yu : _u(e) ? gu : Array.isArray(e) ? mu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? wu : zt)(t, e); + return e == null || n === "boolean" ? Qr(e) : (n === "number" ? Gt : n === "string" ? (r = Te(e)) ? (e = r, jn) : Fs : e instanceof Te ? jn : e instanceof Date ? wu : mu(e) ? _u : Array.isArray(e) ? yu : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? xu : Gt)(t, e); } -var ki = 180 / Math.PI, Cr = { +var ki = 180 / Math.PI, Er = { translateX: 0, translateY: 0, rotate: 0, @@ -2817,13 +2825,13 @@ function Is(t, e, n, r, i, s) { scaleY: l }; } -var bn; -function $u(t) { +var xn; +function Au(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); - return e.isIdentity ? Cr : Is(e.a, e.b, e.c, e.d, e.e, e.f); + return e.isIdentity ? Er : Is(e.a, e.b, e.c, e.d, e.e, e.f); } -function Au(t) { - return t == null || (bn || (bn = document.createElementNS("http://www.w3.org/2000/svg", "g")), bn.setAttribute("transform", t), !(t = bn.transform.baseVal.consolidate())) ? Cr : (t = t.matrix, Is(t.a, t.b, t.c, t.d, t.e, t.f)); +function Ru(t) { + return t == null || (xn || (xn = document.createElementNS("http://www.w3.org/2000/svg", "g")), xn.setAttribute("transform", t), !(t = xn.transform.baseVal.consolidate())) ? Er : (t = t.matrix, Is(t.a, t.b, t.c, t.d, t.e, t.f)); } function Ls(t, e, n, r) { function i(f) { @@ -2832,19 +2840,19 @@ function Ls(t, e, n, r) { function s(f, o, h, c, d, p) { if (f !== h || o !== c) { var y = d.push("translate(", null, e, null, n); - p.push({ i: y - 4, x: zt(f, h) }, { i: y - 2, x: zt(o, c) }); + p.push({ i: y - 4, x: Gt(f, h) }, { i: y - 2, x: Gt(o, c) }); } else (h || c) && d.push("translate(" + h + e + c + n); } function a(f, o, h, c) { - f !== o ? (f - o > 180 ? o += 360 : o - f > 180 && (f += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: zt(f, o) })) : o && h.push(i(h) + "rotate(" + o + r); + f !== o ? (f - o > 180 ? o += 360 : o - f > 180 && (f += 360), c.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: Gt(f, o) })) : o && h.push(i(h) + "rotate(" + o + r); } function l(f, o, h, c) { - f !== o ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: zt(f, o) }) : o && h.push(i(h) + "skewX(" + o + r); + f !== o ? c.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: Gt(f, o) }) : o && h.push(i(h) + "skewX(" + o + r); } function u(f, o, h, c, d, p) { if (f !== h || o !== c) { var y = d.push(i(d) + "scale(", null, ",", null, ")"); - p.push({ i: y - 4, x: zt(f, h) }, { i: y - 2, x: zt(o, c) }); + p.push({ i: y - 4, x: Gt(f, h) }, { i: y - 2, x: Gt(o, c) }); } else (h !== 1 || c !== 1) && d.push(i(d) + "scale(" + h + "," + c + ")"); } return function(f, o) { @@ -2855,81 +2863,81 @@ function Ls(t, e, n, r) { }; }; } -var Ru = Ls($u, "px, ", "px)", "deg)"), Eu = Ls(Au, ", ", ")", ")"), Le = 0, Xe = 0, je = 0, qs = 1e3, Kn, Ge, Wn = 0, Ce = 0, sr = 0, sn = typeof performance == "object" && performance.now ? performance : Date, Vs = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { +var Eu = Ls(Au, "px, ", "px)", "deg)"), Cu = Ls(Ru, ", ", ")", ")"), He = 0, Je = 0, We = 0, qs = 1e3, Xn, Ze, Gn = 0, Se = 0, rr = 0, on = typeof performance == "object" && performance.now ? performance : Date, Vs = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; -function ei() { - return Ce || (Vs(Cu), Ce = sn.now() + sr); +function ti() { + return Se || (Vs(Nu), Se = on.now() + rr); } -function Cu() { - Ce = 0; +function Nu() { + Se = 0; } -function Jn() { +function Kn() { this._call = this._time = this._next = null; } -Jn.prototype = Bs.prototype = { - constructor: Jn, +Kn.prototype = Bs.prototype = { + constructor: Kn, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); - n = (n == null ? ei() : +n) + (e == null ? 0 : +e), !this._next && Ge !== this && (Ge ? Ge._next = this : Kn = this, Ge = this), this._call = t, this._time = n, Nr(); + n = (n == null ? ti() : +n) + (e == null ? 0 : +e), !this._next && Ze !== this && (Ze ? Ze._next = this : Xn = this, Ze = this), this._call = t, this._time = n, Cr(); }, stop: function() { - this._call && (this._call = null, this._time = 1 / 0, Nr()); + this._call && (this._call = null, this._time = 1 / 0, Cr()); } }; function Bs(t, e, n) { - var r = new Jn(); + var r = new Kn(); return r.restart(t, e, n), r; } -function Nu() { - ei(), ++Le; - for (var t = Kn, e; t; ) - (e = Ce - t._time) >= 0 && t._call.call(void 0, e), t = t._next; - --Le; +function Tu() { + ti(), ++He; + for (var t = Xn, e; t; ) + (e = Se - t._time) >= 0 && t._call.call(void 0, e), t = t._next; + --He; } function Mi() { - Ce = (Wn = sn.now()) + sr, Le = Xe = 0; + Se = (Gn = on.now()) + rr, He = Je = 0; try { - Nu(); + Tu(); } finally { - Le = 0, Su(), Ce = 0; + He = 0, ku(), Se = 0; } } -function Tu() { - var t = sn.now(), e = t - Wn; - e > qs && (sr -= e, Wn = t); -} function Su() { - for (var t, e = Kn, 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 : Kn = n); - Ge = t, Nr(r); + var t = on.now(), e = t - Gn; + e > qs && (rr -= e, Gn = t); } -function Nr(t) { - if (!Le) { - Xe && (Xe = clearTimeout(Xe)); - var e = t - Ce; - e > 24 ? (t < 1 / 0 && (Xe = setTimeout(Mi, t - sn.now() - sr)), je && (je = clearInterval(je))) : (je || (Wn = sn.now(), je = setInterval(Tu, qs)), Le = 1, Vs(Mi)); +function ku() { + for (var t, e = Xn, 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 : Xn = n); + Ze = t, Cr(r); +} +function Cr(t) { + if (!He) { + Je && (Je = clearTimeout(Je)); + var e = t - Se; + e > 24 ? (t < 1 / 0 && (Je = setTimeout(Mi, t - on.now() - rr)), We && (We = clearInterval(We))) : (We || (Gn = on.now(), We = setInterval(Su, qs)), He = 1, Vs(Mi)); } } function Oi(t, e, n) { - var r = new Jn(); + var r = new Kn(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } -var ku = ws("start", "end", "cancel", "interrupt"), Mu = [], Hs = 0, Pi = 1, Tr = 2, Tn = 3, Di = 4, Sr = 5, Sn = 6; -function ar(t, e, n, r, i, s) { +var Mu = ws("start", "end", "cancel", "interrupt"), Ou = [], Hs = 0, Pi = 1, Nr = 2, Nn = 3, Di = 4, Tr = 5, Tn = 6; +function ir(t, e, n, r, i, s) { var a = t.__transition; if (!a) t.__transition = {}; else if (n in a) return; - Ou(t, n, { + Pu(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. - on: ku, - tween: Mu, + on: Mu, + tween: Ou, time: s.time, delay: s.delay, duration: s.duration, @@ -2938,22 +2946,22 @@ function ar(t, e, n, r, i, s) { state: Hs }); } -function ni(t, e) { - var n = Ft(t, e); +function ei(t, e) { + var n = Ht(t, e); if (n.state > Hs) throw new Error("too late; already scheduled"); return n; } -function Gt(t, e) { - var n = Ft(t, e); - if (n.state > Tn) throw new Error("too late; already running"); +function Jt(t, e) { + var n = Ht(t, e); + if (n.state > Nn) throw new Error("too late; already running"); return n; } -function Ft(t, e) { +function Ht(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } -function Ou(t, e, n) { +function Pu(t, e, n) { var r = t.__transition, i; r[e] = n, n.timer = Bs(s, 0, n.time); function s(f) { @@ -2964,29 +2972,29 @@ function Ou(t, e, n) { if (n.state !== Pi) return u(); for (o in r) if (d = r[o], d.name === n.name) { - if (d.state === Tn) return Oi(a); - d.state === Di ? (d.state = Sn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[o]) : +o < e && (d.state = Sn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[o]); + if (d.state === Nn) return Oi(a); + d.state === Di ? (d.state = Tn, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[o]) : +o < e && (d.state = Tn, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[o]); } if (Oi(function() { - n.state === Tn && (n.state = Di, n.timer.restart(l, n.delay, n.time), l(f)); - }), n.state = Tr, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Tr) { - for (n.state = Tn, i = new Array(c = n.tween.length), o = 0, h = -1; o < c; ++o) + n.state === Nn && (n.state = Di, n.timer.restart(l, n.delay, n.time), l(f)); + }), n.state = Nr, n.on.call("start", t, t.__data__, n.index, n.group), n.state === Nr) { + for (n.state = Nn, i = new Array(c = n.tween.length), o = 0, h = -1; o < c; ++o) (d = n.tween[o].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d); i.length = h + 1; } } function l(f) { - for (var o = f < n.duration ? n.ease.call(null, f / n.duration) : (n.timer.restart(u), n.state = Sr, 1), h = -1, c = i.length; ++h < c; ) + for (var o = f < n.duration ? n.ease.call(null, f / n.duration) : (n.timer.restart(u), n.state = Tr, 1), h = -1, c = i.length; ++h < c; ) i[h].call(t, o); - n.state === Sr && (n.on.call("end", t, t.__data__, n.index, n.group), u()); + n.state === Tr && (n.on.call("end", t, t.__data__, n.index, n.group), u()); } function u() { - n.state = Sn, n.timer.stop(), delete r[e]; + n.state = Tn, n.timer.stop(), delete r[e]; for (var f in r) return; delete t.__transition; } } -function Pu(t, e) { +function Du(t, e) { var n = t.__transition, r, i, s = !0, a; if (n) { e = e == null ? null : e + ""; @@ -2995,20 +3003,20 @@ function Pu(t, e) { s = !1; continue; } - i = r.state > Tr && r.state < Sr, r.state = Sn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; + i = r.state > Nr && r.state < Tr, r.state = Tn, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[a]; } s && delete t.__transition; } } -function Du(t) { +function Fu(t) { return this.each(function() { - Pu(this, t); + Du(this, t); }); } -function Fu(t, e) { +function Iu(t, e) { var n, r; return function() { - var i = Gt(this, t), s = i.tween; + var i = Jt(this, t), s = i.tween; if (s !== n) { r = n = s; for (var a = 0, l = r.length; a < l; ++a) @@ -3020,11 +3028,11 @@ function Fu(t, e) { i.tween = r; }; } -function Iu(t, e, n) { +function Lu(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { - var s = Gt(this, t), a = s.tween; + var s = Jt(this, t), a = s.tween; if (a !== r) { i = (r = a).slice(); for (var l = { name: e, value: n }, u = 0, f = i.length; u < f; ++u) @@ -3037,225 +3045,225 @@ function Iu(t, e, n) { s.tween = i; }; } -function Lu(t, e) { +function qu(t, e) { var n = this._id; if (t += "", arguments.length < 2) { - for (var r = Ft(this.node(), n).tween, i = 0, s = r.length, a; i < s; ++i) + for (var r = Ht(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 ? Fu : Iu)(n, t, e)); + return this.each((e == null ? Iu : Lu)(n, t, e)); } -function ri(t, e, n) { +function ni(t, e, n) { var r = t._id; return t.each(function() { - var i = Gt(this, r); + var i = Jt(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { - return Ft(i, r).value[e]; + return Ht(i, r).value[e]; }; } function Ys(t, e) { var n; - return (typeof e == "number" ? zt : e instanceof Ee ? Gn : (n = Ee(e)) ? (e = n, Gn) : Fs)(t, e); + return (typeof e == "number" ? Gt : e instanceof Te ? jn : (n = Te(e)) ? (e = n, jn) : Fs)(t, e); } -function qu(t) { +function Vu(t) { return function() { this.removeAttribute(t); }; } -function Vu(t) { +function Bu(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } -function Bu(t, e, n) { +function Hu(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 Hu(t, e, n) { +function Yu(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 Yu(t, e, n) { +function zu(t, e, n) { var r, i, s; return function() { var a, l = n(this), u; return l == null ? void this.removeAttribute(t) : (a = this.getAttribute(t), u = l + "", a === u ? null : a === r && u === i ? s : (i = u, s = e(r = a, l))); }; } -function zu(t, e, n) { +function Uu(t, e, n) { var r, i, s; return function() { var a, l = n(this), u; return l == null ? void this.removeAttributeNS(t.space, t.local) : (a = this.getAttributeNS(t.space, t.local), u = l + "", a === u ? null : a === r && u === i ? s : (i = u, s = e(r = a, l))); }; } -function Uu(t, e) { - var n = ir(t), r = n === "transform" ? Eu : Ys; - return this.attrTween(t, typeof e == "function" ? (n.local ? zu : Yu)(n, r, ri(this, "attr." + t, e)) : e == null ? (n.local ? Vu : qu)(n) : (n.local ? Hu : Bu)(n, r, e)); -} function ju(t, e) { + var n = nr(t), r = n === "transform" ? Cu : Ys; + return this.attrTween(t, typeof e == "function" ? (n.local ? Uu : zu)(n, r, ni(this, "attr." + t, e)) : e == null ? (n.local ? Bu : Vu)(n) : (n.local ? Yu : Hu)(n, r, e)); +} +function Xu(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } -function Xu(t, e) { +function Gu(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } -function Gu(t, e) { +function Ku(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && Xu(t, s)), n; + return s !== r && (n = (r = s) && Gu(t, s)), n; } return i._value = e, i; } -function Ku(t, e) { +function Wu(t, e) { var n, r; function i() { var s = e.apply(this, arguments); - return s !== r && (n = (r = s) && ju(t, s)), n; + return s !== r && (n = (r = s) && Xu(t, s)), n; } return i._value = e, i; } -function Wu(t, e) { +function Ju(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 = ir(t); - return this.tween(n, (r.local ? Gu : Ku)(r, e)); + var r = nr(t); + return this.tween(n, (r.local ? Ku : Wu)(r, e)); } -function Ju(t, e) { +function Zu(t, e) { return function() { - ni(this, t).delay = +e.apply(this, arguments); + ei(this, t).delay = +e.apply(this, arguments); }; } -function Zu(t, e) { +function Qu(t, e) { return e = +e, function() { - ni(this, t).delay = e; + ei(this, t).delay = e; }; } -function Qu(t) { +function tf(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? Ju : Zu)(e, t)) : Ft(this.node(), e).delay; + return arguments.length ? this.each((typeof t == "function" ? Zu : Qu)(e, t)) : Ht(this.node(), e).delay; } -function tf(t, e) { +function ef(t, e) { return function() { - Gt(this, t).duration = +e.apply(this, arguments); + Jt(this, t).duration = +e.apply(this, arguments); }; } -function ef(t, e) { +function nf(t, e) { return e = +e, function() { - Gt(this, t).duration = e; + Jt(this, t).duration = e; }; } -function nf(t) { +function rf(t) { var e = this._id; - return arguments.length ? this.each((typeof t == "function" ? tf : ef)(e, t)) : Ft(this.node(), e).duration; + return arguments.length ? this.each((typeof t == "function" ? ef : nf)(e, t)) : Ht(this.node(), e).duration; } -function rf(t, e) { +function sf(t, e) { if (typeof e != "function") throw new Error(); return function() { - Gt(this, t).ease = e; + Jt(this, t).ease = e; }; } -function sf(t) { +function af(t) { var e = this._id; - return arguments.length ? this.each(rf(e, t)) : Ft(this.node(), e).ease; + return arguments.length ? this.each(sf(e, t)) : Ht(this.node(), e).ease; } -function af(t, e) { +function lf(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); - Gt(this, t).ease = n; + Jt(this, t).ease = n; }; } -function lf(t) { +function of(t) { if (typeof t != "function") throw new Error(); - return this.each(af(this._id, t)); + return this.each(lf(this._id, t)); } -function of(t) { +function uf(t) { typeof t != "function" && (t = $s(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, l = r[i] = [], u, f = 0; f < a; ++f) (u = s[f]) && t.call(u, u.__data__, f, s) && l.push(u); - return new oe(r, this._parents, this._name, this._id); + return new fe(r, this._parents, this._name, this._id); } -function uf(t) { +function ff(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), l = 0; l < s; ++l) for (var u = e[l], f = n[l], o = u.length, h = a[l] = new Array(o), c, d = 0; d < o; ++d) (c = u[d] || f[d]) && (h[d] = c); for (; l < r; ++l) a[l] = e[l]; - return new oe(a, this._parents, this._name, this._id); + return new fe(a, this._parents, this._name, this._id); } -function ff(t) { +function cf(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 cf(t, e, n) { - var r, i, s = ff(e) ? ni : Gt; +function hf(t, e, n) { + var r, i, s = cf(e) ? ei : Jt; return function() { var a = s(this, t), l = a.on; l !== r && (i = (r = l).copy()).on(e, n), a.on = i; }; } -function hf(t, e) { +function df(t, e) { var n = this._id; - return arguments.length < 2 ? Ft(this.node(), n).on.on(t) : this.each(cf(n, t, e)); + return arguments.length < 2 ? Ht(this.node(), n).on.on(t) : this.each(hf(n, t, e)); } -function df(t) { +function vf(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } -function vf() { - return this.on("end.remove", df(this._id)); +function pf() { + return this.on("end.remove", vf(this._id)); } -function pf(t) { +function gf(t) { var e = this._name, n = this._id; - typeof t != "function" && (t = Jr(t)); + typeof t != "function" && (t = Wr(t)); for (var r = this._groups, i = r.length, s = new Array(i), a = 0; a < i; ++a) for (var l = r[a], u = l.length, f = s[a] = new Array(u), o, h, c = 0; c < u; ++c) - (o = l[c]) && (h = t.call(o, o.__data__, c, l)) && ("__data__" in o && (h.__data__ = o.__data__), f[c] = h, ar(f[c], e, n, c, f, Ft(o, n))); - return new oe(s, this._parents, e, n); + (o = l[c]) && (h = t.call(o, o.__data__, c, l)) && ("__data__" in o && (h.__data__ = o.__data__), f[c] = h, ir(f[c], e, n, c, f, Ht(o, n))); + return new fe(s, this._parents, e, n); } -function gf(t) { +function _f(t) { var e = this._name, n = this._id; typeof t != "function" && (t = bs(t)); for (var r = this._groups, i = r.length, s = [], a = [], l = 0; l < i; ++l) for (var u = r[l], f = u.length, o, h = 0; h < f; ++h) if (o = u[h]) { - for (var c = t.call(o, o.__data__, h, u), d, p = Ft(o, n), y = 0, R = c.length; y < R; ++y) - (d = c[y]) && ar(d, e, n, y, c, p); + for (var c = t.call(o, o.__data__, h, u), d, p = Ht(o, n), y = 0, R = c.length; y < R; ++y) + (d = c[y]) && ir(d, e, n, y, c, p); s.push(c), a.push(o); } - return new oe(s, a, e, n); + return new fe(s, a, e, n); } -var _f = Ye.prototype.constructor; -function mf() { - return new _f(this._groups, this._parents); +var mf = Xe.prototype.constructor; +function yf() { + return new mf(this._groups, this._parents); } -function yf(t, e) { +function wf(t, e) { var n, r, i; return function() { - var s = Ie(this, t), a = (this.style.removeProperty(t), Ie(this, t)); + var s = Be(this, t), a = (this.style.removeProperty(t), Be(this, t)); return s === a ? null : s === n && a === r ? i : i = e(n = s, r = a); }; } @@ -3264,187 +3272,187 @@ function zs(t) { this.style.removeProperty(t); }; } -function wf(t, e, n) { +function xf(t, e, n) { var r, i = n + "", s; return function() { - var a = Ie(this, t); + var a = Be(this, t); return a === i ? null : a === r ? s : s = e(r = a, n); }; } -function xf(t, e, n) { +function bf(t, e, n) { var r, i, s; return function() { - var a = Ie(this, t), l = n(this), u = l + ""; - return l == null && (u = l = (this.style.removeProperty(t), Ie(this, t))), a === u ? null : a === r && u === i ? s : (i = u, s = e(r = a, l)); + var a = Be(this, t), l = n(this), u = l + ""; + return l == null && (u = l = (this.style.removeProperty(t), Be(this, t))), a === u ? null : a === r && u === i ? s : (i = u, s = e(r = a, l)); }; } -function bf(t, e) { +function $f(t, e) { var n, r, i, s = "style." + e, a = "end." + s, l; return function() { - var u = Gt(this, t), f = u.on, o = u.value[s] == null ? l || (l = zs(e)) : void 0; + var u = Jt(this, t), f = u.on, o = u.value[s] == null ? l || (l = zs(e)) : void 0; (f !== n || i !== o) && (r = (n = f).copy()).on(a, i = o), u.on = r; }; } -function $f(t, e, n) { - var r = (t += "") == "transform" ? Ru : Ys; - return e == null ? this.styleTween(t, yf(t, r)).on("end.style." + t, zs(t)) : typeof e == "function" ? this.styleTween(t, xf(t, r, ri(this, "style." + t, e))).each(bf(this._id, t)) : this.styleTween(t, wf(t, r, e), n).on("end.style." + t, null); -} function Af(t, e, n) { + var r = (t += "") == "transform" ? Eu : Ys; + return e == null ? this.styleTween(t, wf(t, r)).on("end.style." + t, zs(t)) : typeof e == "function" ? this.styleTween(t, bf(t, r, ni(this, "style." + t, e))).each($f(this._id, t)) : this.styleTween(t, xf(t, r, e), n).on("end.style." + t, null); +} +function Rf(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } -function Rf(t, e, n) { +function Ef(t, e, n) { var r, i; function s() { var a = e.apply(this, arguments); - return a !== i && (r = (i = a) && Af(t, a, n)), r; + return a !== i && (r = (i = a) && Rf(t, a, n)), r; } return s._value = e, s; } -function Ef(t, e, n) { +function Cf(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, Rf(t, e, n ?? "")); + return this.tween(r, Ef(t, e, n ?? "")); } -function Cf(t) { +function Nf(t) { return function() { this.textContent = t; }; } -function Nf(t) { +function Tf(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } -function Tf(t) { - return this.tween("text", typeof t == "function" ? Nf(ri(this, "text", t)) : Cf(t == null ? "" : t + "")); -} function Sf(t) { + return this.tween("text", typeof t == "function" ? Tf(ni(this, "text", t)) : Nf(t == null ? "" : t + "")); +} +function kf(t) { return function(e) { this.textContent = t.call(this, e); }; } -function kf(t) { +function Mf(t) { var e, n; function r() { var i = t.apply(this, arguments); - return i !== n && (e = (n = i) && Sf(i)), e; + return i !== n && (e = (n = i) && kf(i)), e; } return r._value = t, r; } -function Mf(t) { +function Of(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, kf(t)); + return this.tween(e, Mf(t)); } -function Of() { +function Pf() { for (var t = this._name, e = this._id, n = Us(), r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], l = a.length, u, f = 0; f < l; ++f) if (u = a[f]) { - var o = Ft(u, e); - ar(u, t, n, f, a, { + var o = Ht(u, e); + ir(u, t, n, f, a, { time: o.time + o.delay + o.duration, delay: 0, duration: o.duration, ease: o.ease }); } - return new oe(r, this._parents, t, n); + return new fe(r, this._parents, t, n); } -function Pf() { +function Df() { var t, e, n = this, r = n._id, i = n.size(); return new Promise(function(s, a) { var l = { value: a }, u = { value: function() { --i === 0 && s(); } }; n.each(function() { - var f = Gt(this, r), o = f.on; + var f = Jt(this, r), o = f.on; o !== t && (e = (t = o).copy(), e._.cancel.push(l), e._.interrupt.push(l), e._.end.push(u)), f.on = e; }), i === 0 && s(); }); } -var Df = 0; -function oe(t, e, n, r) { +var Ff = 0; +function fe(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } -function kn(t) { - return Ye().transition(t); +function Sn(t) { + return Xe().transition(t); } function Us() { - return ++Df; -} -var Qt = Ye.prototype; -oe.prototype = kn.prototype = { - constructor: oe, - select: pf, - selectAll: gf, - selectChild: Qt.selectChild, - selectChildren: Qt.selectChildren, - filter: of, - merge: uf, - selection: mf, - transition: Of, - call: Qt.call, - nodes: Qt.nodes, - node: Qt.node, - size: Qt.size, - empty: Qt.empty, - each: Qt.each, - on: hf, - attr: Uu, - attrTween: Wu, - style: $f, - styleTween: Ef, - text: Tf, - textTween: Mf, - remove: vf, - tween: Lu, - delay: Qu, - duration: nf, - ease: sf, - easeVarying: lf, - end: Pf, - [Symbol.iterator]: Qt[Symbol.iterator] + return ++Ff; +} +var ee = Xe.prototype; +fe.prototype = Sn.prototype = { + constructor: fe, + select: gf, + selectAll: _f, + selectChild: ee.selectChild, + selectChildren: ee.selectChildren, + filter: uf, + merge: ff, + selection: yf, + transition: Pf, + call: ee.call, + nodes: ee.nodes, + node: ee.node, + size: ee.size, + empty: ee.empty, + each: ee.each, + on: df, + attr: ju, + attrTween: Ju, + style: Af, + styleTween: Cf, + text: Sf, + textTween: Of, + remove: pf, + tween: qu, + delay: tf, + duration: rf, + ease: af, + easeVarying: of, + end: Df, + [Symbol.iterator]: ee[Symbol.iterator] }; -function Ff(t) { +function If(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } -var If = { +var Lf = { time: null, // Set on use. delay: 0, duration: 250, - ease: Ff + ease: If }; -function Lf(t, e) { +function qf(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 qf(t) { +function Vf(t) { var e, n; - t instanceof oe ? (e = t._id, t = t._name) : (e = Us(), (n = If).time = ei(), t = t == null ? null : t + ""); + t instanceof fe ? (e = t._id, t = t._name) : (e = Us(), (n = Lf).time = ti(), t = t == null ? null : t + ""); for (var r = this._groups, i = r.length, s = 0; s < i; ++s) for (var a = r[s], l = a.length, u, f = 0; f < l; ++f) - (u = a[f]) && ar(u, t, e, f, a, n || Lf(u, e)); - return new oe(r, this._parents, t, e); + (u = a[f]) && ir(u, t, e, f, a, n || qf(u, e)); + return new fe(r, this._parents, t, e); } -Ye.prototype.interrupt = Du; -Ye.prototype.transition = qf; -const kr = Math.PI, Mr = 2 * kr, xe = 1e-6, Vf = Mr - xe; +Xe.prototype.interrupt = Fu; +Xe.prototype.transition = Vf; +const Sr = Math.PI, kr = 2 * Sr, $e = 1e-6, Bf = kr - $e; function js(t) { this._ += t[0]; for (let e = 1, n = t.length; e < n; ++e) this._ += arguments[e] + t[e]; } -function Bf(t) { +function Hf(t) { let e = Math.floor(t); if (!(e >= 0)) throw new Error(`invalid digits: ${t}`); if (e > 15) return js; @@ -3455,10 +3463,10 @@ function Bf(t) { this._ += Math.round(arguments[i] * n) / n + r[i]; }; } -class Hf { +class Yf { constructor(e) { this._x0 = this._y0 = // start of current subpath - this._x1 = this._y1 = null, this._ = "", this._append = e == null ? js : Bf(e); + this._x1 = this._y1 = null, this._ = "", this._append = e == null ? js : Hf(e); } moveTo(e, n) { this._append`M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +n}`; @@ -3480,17 +3488,17 @@ class Hf { let a = this._x1, l = this._y1, u = r - e, f = i - n, o = a - e, h = l - n, c = o * o + h * h; if (this._x1 === null) this._append`M${this._x1 = e},${this._y1 = n}`; - else if (c > xe) if (!(Math.abs(h * u - f * o) > xe) || !s) + else if (c > $e) if (!(Math.abs(h * u - f * o) > $e) || !s) this._append`L${this._x1 = e},${this._y1 = n}`; else { - let d = r - a, p = i - l, y = u * u + f * f, R = d * d + p * p, _ = Math.sqrt(y), $ = Math.sqrt(c), T = s * Math.tan((kr - Math.acos((y + c - R) / (2 * _ * $))) / 2), M = T / $, b = T / _; - Math.abs(M - 1) > xe && this._append`L${e + M * o},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * d > o * p)},${this._x1 = e + b * u},${this._y1 = n + b * f}`; + let d = r - a, p = i - l, y = u * u + f * f, R = d * d + p * p, _ = Math.sqrt(y), $ = Math.sqrt(c), T = s * Math.tan((Sr - Math.acos((y + c - R) / (2 * _ * $))) / 2), M = T / $, b = T / _; + Math.abs(M - 1) > $e && this._append`L${e + M * o},${n + M * h}`, this._append`A${s},${s},0,0,${+(h * d > o * p)},${this._x1 = e + b * u},${this._y1 = n + b * f}`; } } 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 l = r * Math.cos(i), u = r * Math.sin(i), f = e + l, o = n + u, h = 1 ^ a, c = a ? i - s : s - i; - this._x1 === null ? this._append`M${f},${o}` : (Math.abs(this._x1 - f) > xe || Math.abs(this._y1 - o) > xe) && this._append`L${f},${o}`, r && (c < 0 && (c = c % Mr + Mr), c > Vf ? this._append`A${r},${r},0,1,${h},${e - l},${n - u}A${r},${r},0,1,${h},${this._x1 = f},${this._y1 = o}` : c > xe && this._append`A${r},${r},0,${+(c >= kr)},${h},${this._x1 = e + r * Math.cos(s)},${this._y1 = n + r * Math.sin(s)}`); + this._x1 === null ? this._append`M${f},${o}` : (Math.abs(this._x1 - f) > $e || Math.abs(this._y1 - o) > $e) && this._append`L${f},${o}`, r && (c < 0 && (c = c % kr + kr), c > Bf ? this._append`A${r},${r},0,1,${h},${e - l},${n - u}A${r},${r},0,1,${h},${this._x1 = f},${this._y1 = o}` : c > $e && this._append`A${r},${r},0,${+(c >= Sr)},${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`; @@ -3499,24 +3507,24 @@ class Hf { return this._; } } -function Yf(t) { +function zf(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 zf = Yf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); -function ut(t) { +const Uf = zf("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"); +function ft(t) { return function() { return t; }; } -const Fi = Math.abs, lt = Math.atan2, we = Math.cos, Uf = Math.max, _r = Math.min, Yt = Math.sin, Oe = Math.sqrt, dt = 1e-12, an = Math.PI, Zn = an / 2, Mn = 2 * an; -function jf(t) { - return t > 1 ? 0 : t < -1 ? an : Math.acos(t); +const Fi = Math.abs, ot = Math.atan2, be = Math.cos, jf = Math.max, gr = Math.min, jt = Math.sin, Fe = Math.sqrt, vt = 1e-12, un = Math.PI, Wn = un / 2, kn = 2 * un; +function Xf(t) { + return t > 1 ? 0 : t < -1 ? un : Math.acos(t); } function Ii(t) { - return t >= 1 ? Zn : t <= -1 ? -Zn : Math.asin(t); + return t >= 1 ? Wn : t <= -1 ? -Wn : Math.asin(t); } -function Xf(t) { +function Gf(t) { let e = 3; return t.digits = function(n) { if (!arguments.length) return e; @@ -3528,31 +3536,31 @@ function Xf(t) { e = r; } return t; - }, () => new Hf(e); + }, () => new Yf(e); } -function Gf(t) { +function Kf(t) { return t.innerRadius; } -function Kf(t) { +function Wf(t) { return t.outerRadius; } -function Wf(t) { +function Jf(t) { return t.startAngle; } -function Jf(t) { +function Zf(t) { return t.endAngle; } -function Zf(t) { +function Qf(t) { return t && t.padAngle; } -function Qf(t, e, n, r, i, s, a, l) { +function tc(t, e, n, r, i, s, a, l) { var u = n - t, f = r - e, o = a - i, h = l - s, c = h * u - o * f; - if (!(c * c < dt)) + if (!(c * c < vt)) return c = (o * (e - s) - h * (t - i)) / c, [t + c * u, e + c * f]; } -function $n(t, e, n, r, i, s, a) { - var l = t - n, u = e - r, f = (a ? s : -s) / Oe(l * l + u * u), o = f * u, h = -f * l, c = t + o, d = e + h, p = n + o, y = r + h, R = (c + p) / 2, _ = (d + y) / 2, $ = p - c, T = y - d, M = $ * $ + T * T, b = i - s, P = c * y - p * d, z = (T < 0 ? -1 : 1) * Oe(Uf(0, b * b * M - P * P)), J = (P * T - $ * z) / M, it = (-P * $ - T * z) / M, nt = (P * T + $ * z) / M, H = (-P * $ + T * z) / M, F = J - R, E = it - _, L = nt - R, G = H - _; - return F * F + E * E > L * L + G * G && (J = nt, it = H), { +function bn(t, e, n, r, i, s, a) { + var l = t - n, u = e - r, f = (a ? s : -s) / Fe(l * l + u * u), o = f * u, h = -f * l, c = t + o, d = e + h, p = n + o, y = r + h, R = (c + p) / 2, _ = (d + y) / 2, $ = p - c, T = y - d, M = $ * $ + T * T, b = i - s, P = c * y - p * d, Y = (T < 0 ? -1 : 1) * Fe(jf(0, b * b * M - P * P)), J = (P * T - $ * Y) / M, it = (-P * $ - T * Y) / M, rt = (P * T + $ * Y) / M, H = (-P * $ + T * Y) / M, F = J - R, E = it - _, L = rt - R, G = H - _; + return F * F + E * E > L * L + G * G && (J = rt, it = H), { cx: J, cy: it, x01: -o, @@ -3561,67 +3569,67 @@ function $n(t, e, n, r, i, s, a) { y11: it * (i / b - 1) }; } -function te() { - var t = Gf, e = Kf, n = ut(0), r = null, i = Wf, s = Jf, a = Zf, l = null, u = Xf(f); +function ne() { + var t = Kf, e = Wf, n = ft(0), r = null, i = Jf, s = Zf, a = Qf, l = null, u = Gf(f); function f() { - var o, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - Zn, y = s.apply(this, arguments) - Zn, R = Fi(y - p), _ = y > p; - if (l || (l = o = u()), d < c && (h = d, d = c, c = h), !(d > dt)) l.moveTo(0, 0); - else if (R > Mn - dt) - l.moveTo(d * we(p), d * Yt(p)), l.arc(0, 0, d, p, y, !_), c > dt && (l.moveTo(c * we(y), c * Yt(y)), l.arc(0, 0, c, y, p, _)); + var o, h, c = +t.apply(this, arguments), d = +e.apply(this, arguments), p = i.apply(this, arguments) - Wn, y = s.apply(this, arguments) - Wn, R = Fi(y - p), _ = y > p; + if (l || (l = o = u()), d < c && (h = d, d = c, c = h), !(d > vt)) l.moveTo(0, 0); + else if (R > kn - vt) + l.moveTo(d * be(p), d * jt(p)), l.arc(0, 0, d, p, y, !_), c > vt && (l.moveTo(c * be(y), c * jt(y)), l.arc(0, 0, c, y, p, _)); else { - var $ = p, T = y, M = p, b = y, P = R, z = R, J = a.apply(this, arguments) / 2, it = J > dt && (r ? +r.apply(this, arguments) : Oe(c * c + d * d)), nt = _r(Fi(d - c) / 2, +n.apply(this, arguments)), H = nt, F = nt, E, L; - if (it > dt) { - var G = Ii(it / c * Yt(J)), he = Ii(it / d * Yt(J)); - (P -= G * 2) > dt ? (G *= _ ? 1 : -1, M += G, b -= G) : (P = 0, M = b = (p + y) / 2), (z -= he * 2) > dt ? (he *= _ ? 1 : -1, $ += he, T -= he) : (z = 0, $ = T = (p + y) / 2); + var $ = p, T = y, M = p, b = y, P = R, Y = R, J = a.apply(this, arguments) / 2, it = J > vt && (r ? +r.apply(this, arguments) : Fe(c * c + d * d)), rt = gr(Fi(d - c) / 2, +n.apply(this, arguments)), H = rt, F = rt, E, L; + if (it > vt) { + var G = Ii(it / c * jt(J)), ve = Ii(it / d * jt(J)); + (P -= G * 2) > vt ? (G *= _ ? 1 : -1, M += G, b -= G) : (P = 0, M = b = (p + y) / 2), (Y -= ve * 2) > vt ? (ve *= _ ? 1 : -1, $ += ve, T -= ve) : (Y = 0, $ = T = (p + y) / 2); } - var At = d * we($), _t = d * Yt($), It = c * we(b), ft = c * Yt(b); - if (nt > dt) { - var Lt = d * we(T), St = d * Yt(T), de = c * we(M), _e = c * Yt(M), mt; - if (R < an) - if (mt = Qf(At, _t, de, _e, Lt, St, It, ft)) { - var qt = At - mt[0], Vt = _t - mt[1], Kt = Lt - mt[0], Wt = St - mt[1], Jt = 1 / Yt(jf((qt * Kt + Vt * Wt) / (Oe(qt * qt + Vt * Vt) * Oe(Kt * Kt + Wt * Wt))) / 2), me = Oe(mt[0] * mt[0] + mt[1] * mt[1]); - H = _r(nt, (c - me) / (Jt - 1)), F = _r(nt, (d - me) / (Jt + 1)); + var mt = d * be($), yt = d * jt($), Zt = c * be(b), ct = c * jt(b); + if (rt > vt) { + var Ot = d * be(T), Yt = d * jt(T), Qt = c * be(M), pe = c * jt(M), wt; + if (R < un) + if (wt = tc(mt, yt, Qt, pe, Ot, Yt, Zt, ct)) { + var we = mt - wt[0], ge = yt - wt[1], Rt = Ot - wt[0], Pt = Yt - wt[1], ke = 1 / jt(Xf((we * Rt + ge * Pt) / (Fe(we * we + ge * ge) * Fe(Rt * Rt + Pt * Pt))) / 2), xe = Fe(wt[0] * wt[0] + wt[1] * wt[1]); + H = gr(rt, (c - xe) / (ke - 1)), F = gr(rt, (d - xe) / (ke + 1)); } else H = F = 0; } - z > dt ? F > dt ? (E = $n(de, _e, At, _t, d, F, _), L = $n(Lt, St, It, ft, d, F, _), l.moveTo(E.cx + E.x01, E.cy + E.y01), F < nt ? l.arc(E.cx, E.cy, F, lt(E.y01, E.x01), lt(L.y01, L.x01), !_) : (l.arc(E.cx, E.cy, F, lt(E.y01, E.x01), lt(E.y11, E.x11), !_), l.arc(0, 0, d, lt(E.cy + E.y11, E.cx + E.x11), lt(L.cy + L.y11, L.cx + L.x11), !_), l.arc(L.cx, L.cy, F, lt(L.y11, L.x11), lt(L.y01, L.x01), !_))) : (l.moveTo(At, _t), l.arc(0, 0, d, $, T, !_)) : l.moveTo(At, _t), !(c > dt) || !(P > dt) ? l.lineTo(It, ft) : H > dt ? (E = $n(It, ft, Lt, St, c, -H, _), L = $n(At, _t, de, _e, c, -H, _), l.lineTo(E.cx + E.x01, E.cy + E.y01), H < nt ? l.arc(E.cx, E.cy, H, lt(E.y01, E.x01), lt(L.y01, L.x01), !_) : (l.arc(E.cx, E.cy, H, lt(E.y01, E.x01), lt(E.y11, E.x11), !_), l.arc(0, 0, c, lt(E.cy + E.y11, E.cx + E.x11), lt(L.cy + L.y11, L.cx + L.x11), _), l.arc(L.cx, L.cy, H, lt(L.y11, L.x11), lt(L.y01, L.x01), !_))) : l.arc(0, 0, c, b, M, _); + Y > vt ? F > vt ? (E = bn(Qt, pe, mt, yt, d, F, _), L = bn(Ot, Yt, Zt, ct, d, F, _), l.moveTo(E.cx + E.x01, E.cy + E.y01), F < rt ? l.arc(E.cx, E.cy, F, ot(E.y01, E.x01), ot(L.y01, L.x01), !_) : (l.arc(E.cx, E.cy, F, ot(E.y01, E.x01), ot(E.y11, E.x11), !_), l.arc(0, 0, d, ot(E.cy + E.y11, E.cx + E.x11), ot(L.cy + L.y11, L.cx + L.x11), !_), l.arc(L.cx, L.cy, F, ot(L.y11, L.x11), ot(L.y01, L.x01), !_))) : (l.moveTo(mt, yt), l.arc(0, 0, d, $, T, !_)) : l.moveTo(mt, yt), !(c > vt) || !(P > vt) ? l.lineTo(Zt, ct) : H > vt ? (E = bn(Zt, ct, Ot, Yt, c, -H, _), L = bn(mt, yt, Qt, pe, c, -H, _), l.lineTo(E.cx + E.x01, E.cy + E.y01), H < rt ? l.arc(E.cx, E.cy, H, ot(E.y01, E.x01), ot(L.y01, L.x01), !_) : (l.arc(E.cx, E.cy, H, ot(E.y01, E.x01), ot(E.y11, E.x11), !_), l.arc(0, 0, c, ot(E.cy + E.y11, E.cx + E.x11), ot(L.cy + L.y11, L.cx + L.x11), _), l.arc(L.cx, L.cy, H, ot(L.y11, L.x11), ot(L.y01, L.x01), !_))) : l.arc(0, 0, c, b, M, _); } if (l.closePath(), o) return l = null, o + "" || null; } return f.centroid = function() { - var o = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - an / 2; - return [we(h) * o, Yt(h) * o]; + var o = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, h = (+i.apply(this, arguments) + +s.apply(this, arguments)) / 2 - un / 2; + return [be(h) * o, jt(h) * o]; }, f.innerRadius = function(o) { - return arguments.length ? (t = typeof o == "function" ? o : ut(+o), f) : t; + return arguments.length ? (t = typeof o == "function" ? o : ft(+o), f) : t; }, f.outerRadius = function(o) { - return arguments.length ? (e = typeof o == "function" ? o : ut(+o), f) : e; + return arguments.length ? (e = typeof o == "function" ? o : ft(+o), f) : e; }, f.cornerRadius = function(o) { - return arguments.length ? (n = typeof o == "function" ? o : ut(+o), f) : n; + return arguments.length ? (n = typeof o == "function" ? o : ft(+o), f) : n; }, f.padRadius = function(o) { - return arguments.length ? (r = o == null ? null : typeof o == "function" ? o : ut(+o), f) : r; + return arguments.length ? (r = o == null ? null : typeof o == "function" ? o : ft(+o), f) : r; }, f.startAngle = function(o) { - return arguments.length ? (i = typeof o == "function" ? o : ut(+o), f) : i; + return arguments.length ? (i = typeof o == "function" ? o : ft(+o), f) : i; }, f.endAngle = function(o) { - return arguments.length ? (s = typeof o == "function" ? o : ut(+o), f) : s; + return arguments.length ? (s = typeof o == "function" ? o : ft(+o), f) : s; }, f.padAngle = function(o) { - return arguments.length ? (a = typeof o == "function" ? o : ut(+o), f) : a; + return arguments.length ? (a = typeof o == "function" ? o : ft(+o), f) : a; }, f.context = function(o) { return arguments.length ? (l = o ?? null, f) : l; }, f; } -function tc(t) { +function ec(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } -function ec(t, e) { +function nc(t, e) { return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } -function nc(t) { +function rc(t) { return t; } -function mr() { - var t = nc, e = ec, n = null, r = ut(0), i = ut(Mn), s = ut(0); +function _r() { + var t = rc, e = nc, n = null, r = ft(0), i = ft(kn), s = ft(0); function a(l) { - var u, f = (l = tc(l)).length, o, h, c = 0, d = new Array(f), p = new Array(f), y = +r.apply(this, arguments), R = Math.min(Mn, Math.max(-Mn, i.apply(this, arguments) - y)), _, $ = Math.min(Math.abs(R) / f, s.apply(this, arguments)), T = $ * (R < 0 ? -1 : 1), M; + var u, f = (l = ec(l)).length, o, h, c = 0, d = new Array(f), p = new Array(f), y = +r.apply(this, arguments), R = Math.min(kn, Math.max(-kn, i.apply(this, arguments) - y)), _, $ = Math.min(Math.abs(R) / f, s.apply(this, arguments)), T = $ * (R < 0 ? -1 : 1), M; for (u = 0; u < f; ++u) (M = p[d[u] = u] = +t(l[u], u, l)) > 0 && (c += M); for (e != null ? d.sort(function(b, P) { @@ -3640,29 +3648,29 @@ function mr() { return p; } return a.value = function(l) { - return arguments.length ? (t = typeof l == "function" ? l : ut(+l), a) : t; + return arguments.length ? (t = typeof l == "function" ? l : ft(+l), a) : t; }, a.sortValues = function(l) { return arguments.length ? (e = l, n = null, a) : e; }, a.sort = function(l) { return arguments.length ? (n = l, e = null, a) : n; }, a.startAngle = function(l) { - return arguments.length ? (r = typeof l == "function" ? l : ut(+l), a) : r; + return arguments.length ? (r = typeof l == "function" ? l : ft(+l), a) : r; }, a.endAngle = function(l) { - return arguments.length ? (i = typeof l == "function" ? l : ut(+l), a) : i; + return arguments.length ? (i = typeof l == "function" ? l : ft(+l), a) : i; }, a.padAngle = function(l) { - return arguments.length ? (s = typeof l == "function" ? l : ut(+l), a) : s; + return arguments.length ? (s = typeof l == "function" ? l : ft(+l), a) : s; }, a; } -function Ke(t, e, n) { +function Qe(t, e, n) { this.k = t, this.x = e, this.y = n; } -Ke.prototype = { - constructor: Ke, +Qe.prototype = { + constructor: Qe, scale: function(t) { - return t === 1 ? this : new Ke(this.k * t, this.x, this.y); + return t === 1 ? this : new Qe(this.k * t, this.x, this.y); }, translate: function(t, e) { - return t === 0 & e === 0 ? this : new Ke(this.k, this.x + this.k * t, this.y + this.k * e); + return t === 0 & e === 0 ? this : new Qe(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]; @@ -3692,55 +3700,55 @@ Ke.prototype = { return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")"; } }; -Ke.prototype; -var rc = /* @__PURE__ */ ol(''); -const ic = { - hash: "svelte-1q7h3eo", - code: ` +Qe.prototype; +var ic = /* @__PURE__ */ ul(''); +const sc = { + hash: "svelte-42cyhy", + code: `.pie-chart-svg.svelte-42cyhy {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) { +@media (max-width: 768px) {.pie-chart-svg.svelte-42cyhy {max-height:50vh; /* Smaller maximum height on mobile */} } -@media (max-width: 768px) { +@media (max-width: 768px) {.pie-chart-svg.svelte-42cyhy {max-height:60vh; /* Increase from 50vh to use more screen space */} }` }; function Xs(t, e) { - Kr(e, !0), _s(t, ic); - let n = Mt(e, "jsonData", 7), r = Mt(e, "currentRound", 7, 1), i = Mt(e, "mouseEventType", 15), s = Mt(e, "mouseData", 15), a = Mt(e, "mouseY", 15), l = Mt(e, "requestRoundChange", 7, (v) => { - }), u = Mt(e, "candidateColors", 23, () => []); + Gr(e, !0), _s(t, sc); + let n = It(e, "jsonData", 7), r = It(e, "currentRound", 7, 1), i = It(e, "mouseEventType", 15), s = It(e, "mouseData", 15), a = It(e, "mouseY", 15), l = It(e, "requestRoundChange", 7, (v) => { + }), u = It(e, "candidateColors", 23, () => []); const f = 800, o = 800, h = Math.min(f, o) * 0.3, c = f / 2, d = o / 2, p = "Pie", y = "Donut", R = "TextLayer", _ = "#transfer", $ = "url(#cross-hatch)", T = 1.15, M = 0.1, b = 750, P = 800; - let z = [], J = [], it = [], nt = 0, H = ee(0), F = 0; + let Y = [], J = [], it = [], rt = 0, H = re(0), F = 0; const E = {}, L = "No Further Rankings"; - let G = ee(null); - function he() { - const v = at(x(G)); + let G = re(null); + function ve() { + const v = at(w(G)); v.select("#" + p).remove(), v.select("#" + y).remove(), v.select("#" + R).remove(); } - function At(v) { - l() && (rt = v, l()(v)); + function mt(v) { + l() && (Q = v, l()(v)); } - function _t(v) { - he(), it = It(v), z = ta(v, p, it, c, d, 0, ft()); + function yt(v) { + ve(), it = Zt(v), Y = ea(v, p, it, c, d, 0, ct()); } - vl(() => { - console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), un(), setTimeout( + pl(() => { + console.log("PieChartGraphics component loaded and initialized"), console.log("jsonData is: ", n()), Ge(), setTimeout( () => { - _t(r()); + yt(r()); }, 0 ); }); - function It(v) { - const g = me(v); - return nt = qt(v), g; + function Zt(v) { + const g = xe(v); + return rt = we(v), g; } - function ft() { + function ct() { return h; } - function Lt() { - return ft() * 1.41; + function Ot() { + return ct() * 1.41; } - function St(v) { + function Yt(v) { let g = 0; for (let m = 1; m < v; m++) { const k = n().results[m - 1].tallyResults; @@ -3754,27 +3762,27 @@ function Xs(t, e) { } return g; } - function de(v, g) { - if (v === "exhausted") return St(g); + function Qt(v, g) { + if (v === "exhausted") return Yt(g); { const m = n().results[g - 1].tally; return Number(m[v]); } } - function _e(v, g) { - return de(v, g).toLocaleString("en-US"); + function pe(v, g) { + return Qt(v, g).toLocaleString("en-US"); } - function mt(v, g) { - return (de(v, g) / nt).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); + function wt(v, g) { + return (Qt(v, g) / rt).toLocaleString("en-US", { style: "percent", minimumFractionDigits: 1 }); } - function qt(v) { + function we(v) { const g = n().results[v - 1].tally; let m = 0; for (let [k, A] of Object.entries(g)) m += Number(A); return m; } - function Vt(v, g) { + function ge(v, g) { if (!v || v < 1 || v > n().results.length) return console.warn("In chsoenCandidates: round ${round} is out of range."), []; const m = n().results[v - 1].tallyResults, k = []; @@ -3784,15 +3792,15 @@ function Xs(t, e) { } return k; } - function Kt(v) { - return Vt(v, "eliminated"); + function Rt(v) { + return ge(v, "eliminated"); } - function Wt(v) { + function Pt(v) { let g = []; - for (let m = 1; m <= v; m++) g = g.concat(Vt(m, "elected")); + for (let m = 1; m <= v; m++) g = g.concat(ge(m, "elected")); return g; } - function Jt(v, g) { + function ke(v, g) { const m = n().results[g - 1].tallyResults; let k = 0; const A = m.findIndex((C) => (C == null ? void 0 : C.elected) && v == C.elected); @@ -3804,7 +3812,7 @@ function Xs(t, e) { return 0; return k; } - function me(v) { + function xe(v) { const g = n().results; let m = g[Math.max(0, v - 2)].tally; const k = [], A = []; @@ -3812,20 +3820,20 @@ function Xs(t, e) { k.push({ label: S, value: 0 }); m = g[v - 1].tally; for (let S of k) { - const O = Number(m[S.label]), I = Jt(S.label, v); + const O = Number(m[S.label]), I = ke(S.label, v); I > 0 ? (A.push({ label: S.label + _, value: I }), S.value = O - I, A.push(S)) : (S.value = O, A.push(S)); } - const C = St(v); + const C = Yt(v); return A.push({ label: "exhausted", value: C }), A; } - function un() { - const v = at(x(G)).select("defs").select("#cross-hatch"); + function Ge() { + const v = at(w(G)).select("defs").select("#cross-hatch"); let g = 0; for (let [m, k] of Object.entries(n().results[0].tally)) { - !u() || u().length === 0 ? g < 10 ? E[m] = zf[g] : E[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : E[m] = u()[g % u().length], g++; + !u() || u().length === 0 ? g < 10 ? E[m] = Uf[g] : E[m] = "#" + Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0") : E[m] = u()[g % u().length], g++; { const A = v.clone(!0); A.attr("id", m.replaceAll(" ", "-")).select("rect").attr("fill", E[m]), A.select("path").attr("stroke", "#505050"); @@ -3833,61 +3841,61 @@ function Xs(t, e) { } E.exhausted = $, E["Inactive Ballots"] = $; } - function fn() { - at(x(G)).select("#" + y).remove(); + function sr() { + at(w(G)).select("#" + y).remove(); } - function ze(v, g) { - const m = kn("global").duration(P); - g && m.on("end", g), fn(), dn(v), ea(), ra(0, ft()), pn(); - } - function w(v, g) { - const m = kn("global").duration(P); - g && m.on("end", g), Gs(v); + function x(v, g) { + const m = Sn("global").duration(P); + g && m.on("end", g), sr(), Gs(v), na(), ia(0, ct()), vn(); } function q(v, g) { - const m = kn("global").duration(P); - g && m.on("end", g), hn(v), ye(ft()); + const m = Sn("global").duration(P); + g && m.on("end", g), Ks(v); + } + function Z(v, g) { + const m = Sn("global").duration(P); + g && m.on("end", g), Dt(v), hn(ct()); } function K() { - pn(), Y = !1; + vn(), z = !1; } - let Y = !1; + let z = !1; function st() { - if (Y) { + if (z) { console.warn("busy animating"); return; } - Y = !0, F = r(), tt(); + z = !0, F = r(), xt(); } - function tt() { + function xt() { W(H, 0); - const v = F < n().results.length - 1 ? tt : K; - ze(F, () => { - w(F, () => { - F++, At(F), q(F, v); + const v = F < n().results.length - 1 ? xt : K; + x(F, () => { + q(F, () => { + F++, mt(F), Z(F, v); }); }); } - Ur(() => { - Rt(); + zr(() => { + te(); }); - let rt = 0; - function Rt() { - if (console.log(`previous round was ${rt}, currentRound is ${r()}`), Y) { + let Q = 0; + function te() { + if (console.log(`previous round was ${Q}, currentRound is ${r()}`), z) { console.log("gotoNextRound: busy animating"); return; } - rt != r() && (rt == r() - 1 && rt > 0 ? Ne() : Zt(r()), rt = r()); + Q != r() && (Q == r() - 1 && Q > 0 ? _e() : zt(r()), Q = r()); } - function Zt(v) { - if (console.log("setRoundFn called"), Y) { + function zt(v) { + if (console.log("setRoundFn called"), z) { console.warn("busy animating"); return; } - W(H, 0), _t(v); + W(H, 0), yt(v); } - function Ne() { - if (console.log("animateOneRoundFn called"), Y) { + function _e() { + if (console.log("animateOneRoundFn called"), z) { console.warn("busy animating"); return; } @@ -3896,57 +3904,57 @@ function Xs(t, e) { return; } if (F = r(), F > n().results.length) { - pn(), Y = !1; + vn(), z = !1; return; } - Y = !0, x(H) === 0 ? ze(F - 1, () => { - w(F - 1, () => { - q(F, K); + z = !0, w(H) === 0 ? x(F - 1, () => { + q(F - 1, () => { + Z(F, K); }); - }) : x(H) === 1 ? w(F - 1, () => { - q(F, K); - }) : x(H) === 2 && q(F, K), W(H, 0); + }) : w(H) === 1 ? q(F - 1, () => { + Z(F, K); + }) : w(H) === 2 && Z(F, K), W(H, 0); } - function cn() { - if (console.log(`animateOnePhaseFn called, currentRound = ${r()}, displayPhase = ${x(H)}`), r() > n().results.length) { - pn(), Y = !1; + function lt() { + if (console.log(`animateOnePhaseFn called, currentRound = ${r()}, displayPhase = ${w(H)}`), r() > n().results.length) { + vn(), z = !1; return; } - Y || (Y = !0, W(H, (x(H) + 1) % 3), F = r(), x(H) === 1 ? ze(F, K) : x(H) === 2 ? w(F, K) : x(H) === 0 ? (F++, At(F), q(F, K)) : (Y = !1, console.warn("displayPhase out of range at ", x(H)))); + z || (z = !0, W(H, (w(H) + 1) % 3), F = r(), w(H) === 1 ? x(F, K) : w(H) === 2 ? q(F, K) : w(H) === 0 ? (F++, mt(F), Z(F, K)) : (z = !1, console.warn("displayPhase out of range at ", w(H)))); } - function hn(v) { - it = me(v), z = ia(v, p, it, 0, ft(), !0); + function Dt(v) { + it = xe(v), Y = sa(v, p, it, 0, ct(), !0); } - function ye(v, g) { - mr().sort(null).value((O) => O.value); - const m = at(x(G)).select("#" + y), k = te().outerRadius(v).innerRadius(v - 1), A = m.selectAll(".slice"); + function hn(v, g) { + _r().sort(null).value((O) => O.value); + const m = at(w(G)).select("#" + y), k = ne().outerRadius(v).innerRadius(v - 1), A = m.selectAll(".slice"); let C = A.size(); function S() { - C--, C === 0 && na(); + C--, C === 0 && ra(); } A.select("path").transition("global").duration(b).attr("d", (O) => k(O)).on("end", (O) => S()); } - function dn(v) { - const g = Ws(v, z); - J = si(v, y, g, c, d, ft(), Lt(), !1, !0); - } function Gs(v) { - const g = Zs(v, J, z); - J = ai( + const g = Js(v, Y); + J = ii(v, y, g, c, d, ct(), Ot(), !1, !0); + } + function Ks(v) { + const g = Qs(v, J, Y); + J = si( v, y, g, /* previousDonutInfoGlobal, */ - ft(), - Lt(), + ct(), + Ot(), !1 ); } - function vn(v) { + function dn(v) { const g = v.data.label; return E[g.split("#")[0]]; } - function Ks(v) { + function Ws(v) { const g = {}, m = n().results[v - 1].tallyResults; for (let k = 0; k < m.length; k++) { let A = m[k].eliminated; @@ -3964,8 +3972,8 @@ function Xs(t, e) { } return g; } - function Ws(v, g) { - const m = [], k = nt, A = n().results[v - 1].tallyResults; + function Js(v, g) { + const m = [], k = rt, A = n().results[v - 1].tallyResults; for (let C = 0; C < A.length; C++) { let S = A[C].eliminated; if (S === void 0 && (S = A[C].elected), S === void 0) { @@ -3986,12 +3994,12 @@ function Xs(t, e) { continue; } for (let [D, B] of Object.entries(O)) { - let Z; - const Bt = g.find((et) => et.data.label == D); - if (Bt) - Z = structuredClone(Bt); + let et; + const Ut = g.find((nt) => nt.data.label == D); + if (Ut) + et = structuredClone(Ut); else if (D == "exhausted") - Z = { + et = { data: { label: D, value: Number(B) }, value: 0, index: 0, @@ -4007,12 +4015,12 @@ function Xs(t, e) { continue; } const N = Number(B) / k * 2 * Math.PI; - Z.startAngle = V, V = Z.endAngle = V + N, Z.index = C, Z.data.label = `${Z.data.label}#${C}`, m.push(Z); + et.startAngle = V, V = et.endAngle = V + N, et.index = C, et.data.label = `${et.data.label}#${C}`, m.push(et); } } return m; } - function Js(v, g, m) { + function Zs(v, g, m) { const k = {}; for (let [A, C] of Object.entries(v)) { const S = m.find((V) => A == V.data.label); @@ -4025,13 +4033,13 @@ function Xs(t, e) { } return k; } - function Zs(v, g, m) { - const k = [], A = nt, C = Ks(v), S = Js(C, A, m); + function Qs(v, g, m) { + const k = [], A = rt, C = Ws(v), S = Zs(C, A, m); for (let [O, I] of g.entries()) { - const V = structuredClone(I), D = I.endAngle - I.startAngle, B = m.find((Z) => I.data.label.indexOf(Z.data.label) === 0); + const V = structuredClone(I), D = I.endAngle - I.startAngle, B = m.find((et) => I.data.label.indexOf(et.data.label) === 0); if (B) { - const Z = B.data.label; - V.startAngle = S[Z], S[Z] += D, V.endAngle = V.startAngle + D; + const et = B.data.label; + V.startAngle = S[et], S[et] += D, V.endAngle = V.startAngle + D; } else if (I.data.label.indexOf("exhausted") === 0) V.startAngle = I.startAngle, V.endAngle = I.endAngle; else { @@ -4042,70 +4050,70 @@ function Xs(t, e) { } return k; } - function ii(v, g, m, k, A, C) { - const O = at(x(G)).append("g").attr("id", R).attr("transform", `translate(${m}, ${k})`), I = te().innerRadius(A * T).outerRadius(A * T); + function ri(v, g, m, k, A, C) { + const O = at(w(G)).append("g").attr("id", R).attr("transform", `translate(${m}, ${k})`), I = ne().innerRadius(A * T).outerRadius(A * T); O.selectAll("text").data(g).enter().each(function(V) { V.endAngle - V.startAngle < M || V.data.label.includes(_) || at(this).append("g").attr("id", (D) => D.data.label).classed("eliminated", (D) => C.includes(D.data.label.split("#")[0]) || D.data.label.includes(_)).each(function(D, B) { - D.data.label === "exhausted" && at(this).on("mouseenter", (Z, Bt) => sa(Z)).on("mouseleave", (Z, Bt) => aa()); - }).append("text").attr("transform", (D) => `translate(${I.centroid(D)})`).attr("text-anchor", (D) => lr(D.startAngle, D.endAngle)).text((D) => D.data.label === "exhausted" ? L : D.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((D) => _e(D.data.label, v) + " (" + mt(D.data.label, v) + ")"); + D.data.label === "exhausted" && at(this).on("mouseenter", (et, Ut) => aa(et)).on("mouseleave", (et, Ut) => la()); + }).append("text").attr("transform", (D) => `translate(${I.centroid(D)})`).attr("text-anchor", (D) => ar(D.startAngle, D.endAngle)).text((D) => D.data.label === "exhausted" ? L : D.data.label).append("tspan").attr("x", 0).attr("dy", "1.2em").text((D) => pe(D.data.label, v) + " (" + wt(D.data.label, v) + ")"); }); } - function Qs(v, g, m, k) { - const C = at(x(G)).select("#" + R), S = C.selectAll("tspan"), O = C.selectAll("g").data(g, (B) => B.data.label).classed("eliminated", (B) => k.includes(B.data.label.split("#")[0]) || B.data.label.includes(_)), I = te().innerRadius(m * T).outerRadius(m * T + 1); - S.transition("global").duration(b).attr("transform", (B) => `translate(${I.centroid(B)})`).attr("text-anchor", (B) => lr(B.startAngle, B.endAngle)), O.select("text").transition("global").duration(b).attr("transform", (B) => `translate(${I.centroid(B)})`).attr("text-anchor", (B) => lr(B.startAngle, B.endAngle)).on("end", (B) => D()); + function ta(v, g, m, k) { + const C = at(w(G)).select("#" + R), S = C.selectAll("tspan"), O = C.selectAll("g").data(g, (B) => B.data.label).classed("eliminated", (B) => k.includes(B.data.label.split("#")[0]) || B.data.label.includes(_)), I = ne().innerRadius(m * T).outerRadius(m * T + 1); + S.transition("global").duration(b).attr("transform", (B) => `translate(${I.centroid(B)})`).attr("text-anchor", (B) => ar(B.startAngle, B.endAngle)), O.select("text").transition("global").duration(b).attr("transform", (B) => `translate(${I.centroid(B)})`).attr("text-anchor", (B) => ar(B.startAngle, B.endAngle)).on("end", (B) => D()); let V = O.size(); function D(B) { - V--, V === 0 && (C.remove(), ii(v, g, c, d, m, k)); + V--, V === 0 && (C.remove(), ri(v, g, c, d, m, k)); } } - function ta(v, g, m, k, A, C, S, O = !0, I = !1) { - const D = mr().sort(null).value((B) => B.value)(m); - return si(v, g, D, k, A, C, S, O, I), D; + function ea(v, g, m, k, A, C, S, O = !0, I = !1) { + const D = _r().sort(null).value((B) => B.value)(m); + return ii(v, g, D, k, A, C, S, O, I), D; } - function pn() { - at(x(G)).select("#" + p).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); + function vn() { + at(w(G)).select("#" + p).selectAll(".elected").style("stroke", "yellow").style("stroke-width", "2px"); } - function si(v, g, m, k, A, C, S, O, I) { - const V = Kt(v), D = Wt(v), Bt = at(x(G)).attr("width", "100%").attr("height", "auto").attr("viewBox", `0 0 ${f} ${o}`).attr("preserveAspectRatio", "xMidYMid meet").append("g").attr("id", g).attr("transform", `translate(${k}, ${A})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (N) => V.includes(N.data.label.split("#")[0]) || N.data.label.includes(_)).classed("elected", (N) => D.includes(N.data.label.split("#")[0]) && !N.data.label.includes(_)).attr("id", (N) => N.data.label).on("mouseenter", (N, et) => ur(N, et)).on("mouseleave", (N, et) => fr(N, et)), Ue = te().outerRadius(S).innerRadius(C); + function ii(v, g, m, k, A, C, S, O, I) { + const V = Rt(v), D = Pt(v), Ut = at(w(G)).attr("viewBox", `0 0 ${f} ${o}`).attr("preserveAspectRatio", "xMidYMid meet").classed("pie-chart-svg", !0).append("g").attr("id", g).attr("transform", `translate(${k}, ${A})`).selectAll(".slice").data(m).enter().append("g").attr("class", "slice").classed("eliminated", (N) => V.includes(N.data.label.split("#")[0]) || N.data.label.includes(_)).classed("elected", (N) => D.includes(N.data.label.split("#")[0]) && !N.data.label.includes(_)).attr("id", (N) => N.data.label).on("mouseenter", (N, nt) => or(N, nt)).on("mouseleave", (N, nt) => ur(N, nt)), Ke = ne().outerRadius(S).innerRadius(C); if (I) { - const N = te().outerRadius(C + 1).innerRadius(C); - Bt.append("path").attr("d", N).transition("global").duration(b).attr("d", (et) => Ue(et)).attr("fill", (et) => vn(et)).on("end", (et) => or()); + const N = ne().outerRadius(C + 1).innerRadius(C); + Ut.append("path").attr("d", N).transition("global").duration(b).attr("d", (nt) => Ke(nt)).attr("fill", (nt) => dn(nt)).on("end", (nt) => lr()); } else - Bt.append("path").attr("d", (N) => Ue(N)).attr("fill", (N) => vn(N)), or(); - return O && ii(v, m, k, A, S, V), m; + Ut.append("path").attr("d", (N) => Ke(N)).attr("fill", (N) => dn(N)), lr(); + return O && ri(v, m, k, A, S, V), m; } - function ea() { - const m = at(x(G)).select("#" + R).selectAll(".eliminated"); + function na() { + const m = at(w(G)).select("#" + R).selectAll(".eliminated"); m.size() > 0 && m.classed("finished", !0); } - function na() { - const m = at(x(G)).select("#" + R).selectAll(".finished"); + function ra() { + const m = at(w(G)).select("#" + R).selectAll(".finished"); m.size() > 0 && m.remove(); } - function ra(v, g) { - const A = at(x(G)).select("#" + p).selectAll(".eliminated"), C = te().innerRadius(v), S = te().outerRadius(g); + function ia(v, g) { + const A = at(w(G)).select("#" + p).selectAll(".eliminated"), C = ne().innerRadius(v), S = ne().outerRadius(g); A.classed("finished", !0).select("path").transition("global").duration(b).attrTween("d", function(O) { - const I = Me(g, v); + const I = De(g, v); return function(V) { return S.innerRadius(I(V)), S(O); }; }).attr("fill", (O) => `url(#${O.data.label.split("#")[0].replaceAll(" ", "-")})`), A.clone(!0).classed("finished", !0).select("path").transition("global").duration(b).attrTween("d", function(O) { - const I = Me(g, v); + const I = De(g, v); return function(V) { return C.outerRadius(I(V)), C(O); }; - }).attr("fill", (O) => vn(O)); + }).attr("fill", (O) => dn(O)); } - function lr(v, g) { + function ar(v, g) { const m = (v + g) / 2; return m > Math.PI * 11 / 6 || m < Math.PI * 1 / 6 || m > Math.PI * 5 / 6 && m < Math.PI * 7 / 6 ? "middle" : m < Math.PI ? "start" : "end"; } - function or() { - at(x(G)).select("#" + R).raise().append("g").remove(); + function lr() { + at(w(G)).select("#" + R).raise().append("g").remove(); } - function ia(v, g, m, k, A, C) { - const O = mr().sort(null).value((I) => I.value)(m); - return ai( + function sa(v, g, m, k, A, C) { + const O = _r().sort(null).value((I) => I.value)(m); + return si( v, g, O, @@ -4115,83 +4123,83 @@ function Xs(t, e) { C ), O; } - function ai(v, g, m, k, A, C) { - const S = Kt(v), O = Wt(v), I = te().outerRadius(A).innerRadius(k).startAngle((N) => N.startAngle).endAngle((N) => N.endAngle), V = te().outerRadius(A).innerRadius(k), B = at(x(G)).select("#" + g); + function si(v, g, m, k, A, C) { + const S = Rt(v), O = Pt(v), I = ne().outerRadius(A).innerRadius(k).startAngle((N) => N.startAngle).endAngle((N) => N.endAngle), V = ne().outerRadius(A).innerRadius(k), B = at(w(G)).select("#" + g); B.selectAll(".slice").attr("prevStart", (N) => N.startAngle).attr("prevEnd", (N) => N.endAngle); - const Z = B.selectAll(".slice").data(m, (N) => N.data.label); - Z.enter().append("g").attr("class", "slice").attr("id", (N) => N.data.label).classed("eliminated", !0).on("mouseenter", (N, et) => ur(N, et)).on("mouseleave", (N, et) => fr(N, et)).append("path").attr("d", (N) => V(N)).attr("fill", (N) => vn(N)), Z.classed("eliminated", (N) => S.includes(N.data.label.split("#")[0])).classed("elected", (N) => O.includes(N.data.label.split("#")[0])).on("mouseenter", (N, et) => ur(N, et)).on("mouseleave", (N, et) => fr(N, et)); - let Bt = Z.size(); - function Ue() { - Bt--, Bt <= 0 && (or(), B.selectAll(".finished").remove()); + const et = B.selectAll(".slice").data(m, (N) => N.data.label); + et.enter().append("g").attr("class", "slice").attr("id", (N) => N.data.label).classed("eliminated", !0).on("mouseenter", (N, nt) => or(N, nt)).on("mouseleave", (N, nt) => ur(N, nt)).append("path").attr("d", (N) => V(N)).attr("fill", (N) => dn(N)), et.classed("eliminated", (N) => S.includes(N.data.label.split("#")[0])).classed("elected", (N) => O.includes(N.data.label.split("#")[0])).on("mouseenter", (N, nt) => or(N, nt)).on("mouseleave", (N, nt) => ur(N, nt)); + let Ut = et.size(); + function Ke() { + Ut--, Ut <= 0 && (lr(), B.selectAll(".finished").remove()); } - return Z.select("path").transition("global").duration(b).attrTween("d", function(N) { - const et = Number(at(this.parentNode).attr("prevStart")), la = Number(at(this.parentNode).attr("prevEnd")), oa = Me(et, N.startAngle), ua = Me(la, N.endAngle); - return (oi) => (I.startAngle(oa(oi)).endAngle(ua(oi)), I(N)); - }).on("end", Ue), C && Qs(v, m, A, S), m; + return et.select("path").transition("global").duration(b).attrTween("d", function(N) { + const nt = Number(at(this.parentNode).attr("prevStart")), oa = Number(at(this.parentNode).attr("prevEnd")), ua = De(nt, N.startAngle), fa = De(oa, N.endAngle); + return (li) => (I.startAngle(ua(li)).endAngle(fa(li)), I(N)); + }).on("end", Ke), C && ta(v, m, A, S), m; } - function ur(v, g) { + function or(v, g) { s(g.data.label.split("#")[0]), i("enter"), a(v.clientY); } - function fr(v, g) { + function ur(v, g) { s(g.data.label.split("#")[0]), i("leave"); } - function sa(v, g) { + function aa(v, g) { i("show-exhausted"), a(v.clientY); } - function aa(v, g) { + function la(v, g) { i("hide-exhausted"); } - var li = rc(); - return En(li, (v) => W(G, v), () => x(G)), ve(t, li), Wr({ + var ai = ic(); + return Rn(ai, (v) => W(G, v), () => w(G)), Xt(t, ai), Kr({ pieColors: E, exhaustedLabel: L, - countExhaustedVotes: St, - getEliminatedCandidates: Kt, - getElectedCandidates: Wt, + countExhaustedVotes: Yt, + getEliminatedCandidates: Rt, + getElectedCandidates: Pt, runFullAnimationFn: st, - animateOnePhaseFn: cn, + animateOnePhaseFn: lt, get jsonData() { return n(); }, set jsonData(v) { - n(v), Nt(); + n(v), kt(); }, get currentRound() { return r(); }, set currentRound(v = 1) { - r(v), Nt(); + r(v), kt(); }, get mouseEventType() { return i(); }, set mouseEventType(v) { - i(v), Nt(); + i(v), kt(); }, get mouseData() { return s(); }, set mouseData(v) { - s(v), Nt(); + s(v), kt(); }, get mouseY() { return a(); }, set mouseY(v) { - a(v), Nt(); + a(v), kt(); }, get requestRoundChange() { return l(); }, set requestRoundChange(v = (g) => { }) { - l(v), Nt(); + l(v), kt(); }, get candidateColors() { return u(); }, set candidateColors(v = []) { - u(v), Nt(); + u(v), kt(); } }); } @@ -4218,7 +4226,7 @@ ys( ], !0 ); -function sc(t) { +function ac(t) { const e = []; if (!t || typeof t != "object" || Array.isArray(t)) return { valid: !1, errors: ["Input is not a valid object"] }; @@ -4319,12 +4327,12 @@ function sc(t) { errors: e }; } -var ac = /* @__PURE__ */ He("  ", 1), lc = /* @__PURE__ */ He("About to eliminate: ", 1), oc = /* @__PURE__ */ He("  ", 1), uc = /* @__PURE__ */ He("Elected: ", 1), fc = /* @__PURE__ */ He("
", 1), cc = /* @__PURE__ */ He('


these ballots have already been eliminated.
', 1); -const hc = { - hash: "svelte-1gmy47u", - code: `.page-container.svelte-1gmy47u {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-1gmy47u {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-1gmy47u {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:1.3rem;left:50%;transform:translate(-50%);font-weight:bold;opacity:0;}.tooltip.svelte-1gmy47u h3:where(.svelte-1gmy47u) {text-align:center;}.animation-button-container.svelte-1gmy47u {display:flex;justify-content:center;gap:10px;margin-bottom:1rem;}.pie-chart-container.svelte-1gmy47u { +var lc = /* @__PURE__ */ je(" ", 1), oc = /* @__PURE__ */ je("About to eliminate: ", 1), uc = /* @__PURE__ */ je(" ", 1), fc = /* @__PURE__ */ je("Elected: ", 1), cc = /* @__PURE__ */ je("
", 1), hc = /* @__PURE__ */ je('


these ballots have already been eliminated.
', 1); +const dc = { + hash: "svelte-e07ae5", + code: `.page-container.svelte-e07ae5 {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-e07ae5 {width:100%;margin-bottom:1rem;text-align:center;}.tooltip.svelte-e07ae5 {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-e07ae5 h3:where(.svelte-e07ae5) {text-align:center;}.animation-button-container.svelte-e07ae5 {display:flex;justify-content:center;gap:10px;margin:0.5rem;}.pie-chart-container.svelte-e07ae5 { /* 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:-5vh;}.visualizations-container.svelte-1gmy47u {display:flex;justify-content:space-between;width:100%;padding:0 20px; + /* 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-e07ae5 {display:flex;justify-content:space-between;width:100%;padding:0 20px; /* gap: 80px; */gap:20px; /* Reduce from 80px */} @@ -4354,101 +4362,102 @@ const hc = { /* Media query for smaller screens */ -@media (max-width: 1300px) {.visualizations-container.svelte-1gmy47u {flex-direction:column;align-items:center;} +@media (max-width: 1300px) {.visualizations-container.svelte-e07ae5 {flex-direction:column;align-items:center;} } -@media (max-width: 768px) {.page-container.svelte-1gmy47u {padding:0 10px; /* Reduce padding on smaller screens */}.visualizations-container.svelte-1gmy47u {padding:0; /* Remove padding on small screens */} -}.common-header.svelte-1gmy47u {width:100%;margin-bottom:1rem;text-align:center;} +@media (max-width: 768px) {.page-container.svelte-e07ae5 {padding:0 10px; /* Reduce padding on smaller screens */}.visualizations-container.svelte-e07ae5 {padding:0; /* Remove padding on small screens */} +}h3.svelte-e07ae5, h4.svelte-e07ae5 {margin:0.5rem;} -@media (max-width: 768px) {.common-header.svelte-1gmy47u {margin-bottom:0.5rem;}h3.svelte-1gmy47u, h4.svelte-1gmy47u {margin:0.3rem 0;font-size:0.9rem;}.animation-button-container.svelte-1gmy47u {margin-bottom:0.5rem;}.pie-chart-container.svelte-1gmy47u {margin-top:-3vh;} +@media (max-width: 768px) {.common-header.svelte-e07ae5 {margin-bottom:0.5rem;}h3.svelte-e07ae5, h4.svelte-e07ae5 {margin:0.3rem 0;font-size:0.9rem;} + }` }; -function dc(t, e) { - Kr(e, !0), _s(t, hc); +function vc(t, e) { + Gr(e, !0), _s(t, dc); const n = 0.85; - let r = Mt(e, "electionSummary", 7), i = Mt(e, "currentRound", 7, 1), s = Mt(e, "requestRoundChange", 7, (w) => { - }), a = Mt(e, "candidateColors", 23, () => []), l = ee(null), u = ee(null), f = ee(""), o = ee(bt([])), h = ee(""), c = ee(""), d = ee(0), p = /* @__PURE__ */ tr(() => y(r())); - function y(w) { - if (typeof w == "string") + let r = It(e, "electionSummary", 7), i = It(e, "currentRound", 7, 1), s = It(e, "requestRoundChange", 7, (x) => { + }), a = It(e, "candidateColors", 23, () => []), l = re(null), u = re(null), f = re(""), o = re($t([])), h = re(""), c = re(""), d = re(0), p = /* @__PURE__ */ Zn(() => y(r())); + function y(x) { + if (typeof x == "string") try { - w = JSON.parse(w); + x = JSON.parse(x); } catch (q) { return console.error("Failed to parse JSON string:", q), {}; } - return console.log("RCtabSummary object status: ", sc(w)), w || {}; + return console.log("RCtabSummary object status: ", ac(x)), x || {}; } - function R(w) { - s() ? (console.log("onRoundChange in PieChart: passing on request for round ", w), s()(w)) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); + function R(x) { + s() ? (console.log("onRoundChange in PieChart: passing on request for round ", x), s()(x)) : console.warn("onRoundChange in PieChart: requestRoundChange is null"); } function _() { - switch (x(h)) { + switch (w(h)) { case "enter": - ((w) => (W(o, bt(w[0])), W(f, bt(w[1]))))(T(x(c), i())), x(l) && (x(l).style.top = String(x(d) || 20) + "px", x(l).style.opacity = String(n)); + ((x) => (W(o, $t(x[0])), W(f, $t(x[1]))))(T(w(c), i())), w(l) && (w(l).style.top = String(w(d) || 20) + "px", w(l).style.opacity = String(n)); break; case "leave": - x(l) && (x(l).style.opacity = "0"), W(o, bt([])), W(f, ""); + w(l) && (w(l).style.opacity = "0"), W(o, $t([])), W(f, ""); break; case "show-exhausted": - x(u) && (x(u).style.top = String(x(d) || 20) + "px", x(u).style.opacity = String(n)); + w(u) && (w(u).style.top = String(w(d) || 20) + "px", w(u).style.opacity = String(n)); break; case "hide-exhausted": - x(u) && (x(u).style.opacity = "0"); + w(u) && (w(u).style.opacity = "0"); break; default: - console.log("Unknown mouse event: ", x(h)); + console.log("Unknown mouse event: ", w(h)); break; } } - Ur(() => _()); - function $(w, q) { - return w == 1 ? q ? "vote was" : "vote will be" : q ? "votes were" : "votes will be"; - } - function T(w, q) { - const K = [], Y = w === "exhausted" ? H() : w; - let st; - w == "exhausted" ? st = J(1) : st = x(p).results[0].tally[w], K.push(`${Y} started with ${st} votes.`); - for (let tt = 1; tt <= q; tt++) { - tt === q && (w == "exhausted" ? st = J(q) : st = x(p).results[q - 1].tally[w], K.push(`${Y} has ${st} votes at round ${q}.`)); - const rt = x(p).results[tt - 1].tallyResults; - for (let Rt = 0; Rt < rt.length; Rt++) { - const Zt = rt[Rt].transfers, Ne = rt[Rt].eliminated, cn = rt[Rt].elected; - if (Ne) - Ne === w && K.push(`${Y} will be eliminated on round ${tt}.`); - else if (w === cn && (K.push(`${Y} was elected on round ${tt}.`), Zt)) - for (let [ye, dn] of Object.entries(Zt)) - K.push(`${dn} ${$(Number(dn), tt < q)} transferred to ${ye} on round ${tt}.`); - const hn = Ne || cn; - if (hn) { - const ye = Number(Zt[w]); - ye && K.push(`${ye} ${$(ye, tt < q)} transferred from ${hn} on round ${tt}.`); + zr(() => _()); + function $(x, q) { + return x == 1 ? q ? "vote was" : "vote will be" : q ? "votes were" : "votes will be"; + } + function T(x, q) { + const Z = [], K = x === "exhausted" ? H() : x; + let z; + x == "exhausted" ? z = J(1) : z = w(p).results[0].tally[x], Z.push(`${K} started with ${z} votes.`); + for (let st = 1; st <= q; st++) { + st === q && (x == "exhausted" ? z = J(q) : z = w(p).results[q - 1].tally[x], Z.push(`${K} has ${z} votes at round ${q}.`)); + const xt = w(p).results[st - 1].tallyResults; + for (let Q = 0; Q < xt.length; Q++) { + const te = xt[Q].transfers, zt = xt[Q].eliminated, _e = xt[Q].elected; + if (zt) + zt === x && Z.push(`${K} will be eliminated on round ${st}.`); + else if (x === _e && (Z.push(`${K} was elected on round ${st}.`), te)) + for (let [Dt, hn] of Object.entries(te)) + Z.push(`${hn} ${$(Number(hn), st < q)} transferred to ${Dt} on round ${st}.`); + const lt = zt || _e; + if (lt) { + const Dt = Number(te[x]); + Dt && Z.push(`${Dt} ${$(Dt, st < q)} transferred from ${lt} on round ${st}.`); } } } - return [K, Y]; + return [Z, K]; } function M() { - let w = 0; - for (let q = 1; q <= x(p).results.length; q++) { - const K = x(p).results[q - 1].tallyResults; - for (let Y = 0; Y < K.length; Y++) - K[Y].elected && w++; + let x = 0; + for (let q = 1; q <= w(p).results.length; q++) { + const Z = w(p).results[q - 1].tallyResults; + for (let K = 0; K < Z.length; K++) + Z[K].elected && x++; } - return w; + return x; } let b; - function P(w) { - return b ? b.getEliminatedCandidates(w) : []; + function P(x) { + return b ? b.getEliminatedCandidates(x) : []; } - function z(w) { - return b ? b.getElectedCandidates(w) : []; + function Y(x) { + return b ? b.getElectedCandidates(x) : []; } - function J(w) { - return b ? b.countExhaustedVotes(w) : 0; + function J(x) { + return b ? b.countExhaustedVotes(x) : 0; } function it() { b && b.animateOnePhaseFn && b.animateOnePhaseFn(); } - function nt() { + function rt() { b && b.runFullAnimationFn && b.runFullAnimationFn(); } function H() { @@ -4457,63 +4466,15 @@ function dc(t, e) { function F() { return b ? b.pieColors : {}; } - var E = cc(), L = Te(E), G = wt(L); - G.__click = nt; - var he = Ht(G, 2); - he.__click = it, yt(L); - var At = Ht(L, 2), _t = wt(At), It = wt(_t), ft = wt(It); - yt(It); - var Lt = Ht(It, 2), St = wt(Lt); - { - var de = (w) => { - var q = lc(), K = Ht(Te(q)); - vr(K, 17, () => P(i()), dr, (Y, st) => { - var tt = ac(), rt = Te(tt), Rt = wt(rt, !0); - yt(rt), gn(), _n( - (Zt) => { - yi(rt, "color", Zt), Se(Rt, x(st)); - }, - [() => F()[x(st)]] - ), ve(Y, tt); - }), ve(w, q); - }; - _i(St, (w) => { - P(i()).length > 0 && w(de); - }); - } - var _e = Ht(St, 2); - { - var mt = (w) => { - var q = uc(), K = Ht(Te(q)); - vr(K, 17, () => z(i()), dr, (Y, st) => { - var tt = oc(), rt = Te(tt), Rt = wt(rt, !0); - yt(rt), gn(), _n( - (Zt) => { - yi(rt, "color", Zt), Se(Rt, x(st)); - }, - [() => F()[x(st)]] - ), ve(Y, tt); - }), ve(w, q); - }; - _i(_e, (w) => { - z(i()).length > 0 && w(mt); - }); - } - yt(Lt), yt(_t); - var qt = Ht(_t, 2), Vt = wt(qt), Kt = wt(Vt, !0); - yt(Vt); - var Wt = Ht(Vt, 2); - vr(Wt, 17, () => x(o), dr, (w, q) => { - var K = fc(), Y = Te(K), st = wt(Y, !0); - yt(Y), gn(2), _n(() => Se(st, x(q))), ve(w, K); - }), yt(qt), En(qt, (w) => W(l, w), () => x(l)); - var Jt = Ht(qt, 2), me = wt(Jt); - gn(2), yt(Jt), En(Jt, (w) => W(u, w), () => x(u)); - var un = Ht(Jt, 2), fn = wt(un), ze = wt(fn); - return En( - Xs(ze, { + var E = hc(), L = Me(E), G = Ct(L); + G.__click = rt; + var ve = Nt(G, 2); + ve.__click = it, Et(L); + var mt = Nt(L, 4), yt = Ct(mt), Zt = Ct(yt), ct = Ct(Zt); + Rn( + Xs(ct, { get jsonData() { - return x(p); + return w(p); }, get currentRound() { return i(); @@ -4523,62 +4484,132 @@ function dc(t, e) { return a(); }, get mouseEventType() { - return x(h); + return w(h); }, - set mouseEventType(w) { - W(h, bt(w)); + set mouseEventType(x) { + W(h, $t(x)); }, get mouseData() { - return x(c); + return w(c); }, - set mouseData(w) { - W(c, bt(w)); + set mouseData(x) { + W(c, $t(x)); }, get mouseY() { - return x(d); + return w(d); }, - set mouseY(w) { - W(d, bt(w)); + set mouseY(x) { + W(d, $t(x)); } }), - (w) => b = w, + (x) => b = x, () => b - ), yt(fn), yt(un), yt(At), _n( - (w, q) => { - Se(ft, `${x(p).config.contest ?? ""}, ${w ?? ""} to be elected, Round ${i() ?? ""}.`), Se(Kt, x(f)), Se(me, `"${q ?? ""}" means all the candidates ranked on `); + ), Et(Zt), Et(yt); + var Ot = Nt(yt, 2), Yt = Ct(Ot); + Et(Ot); + var Qt = Nt(Ot, 2), pe = Ct(Qt); + { + var wt = (x) => { + var q = oc(), Z = Nt(Me(q)); + dr(Z, 17, () => P(i()), hr, (K, z, st) => { + var xt = lc(), Q = Me(xt), te = Ct(Q, !0); + Et(Q); + var zt = Nt(Q, 2); + { + var _e = (lt) => { + var Dt = _i(", "); + Xt(lt, Dt); + }; + _n(zt, (lt) => { + st < P(i()).length - 1 && lt(_e); + }); + } + pn( + (lt) => { + yi(Q, "color", lt), Oe(te, w(z)); + }, + [() => F()[w(z)]] + ), Xt(K, xt); + }), Xt(x, q); + }; + _n(pe, (x) => { + P(i()).length > 0 && x(wt); + }); + } + var we = Nt(pe, 2); + { + var ge = (x) => { + var q = fc(), Z = Nt(Me(q)); + dr(Z, 17, () => Y(i()), hr, (K, z, st) => { + var xt = uc(), Q = Me(xt), te = Ct(Q, !0); + Et(Q); + var zt = Nt(Q, 2); + { + var _e = (lt) => { + var Dt = _i(", "); + Xt(lt, Dt); + }; + _n(zt, (lt) => { + st < Y(i()).length - 1 && lt(_e); + }); + } + pn( + (lt) => { + yi(Q, "color", lt), Oe(te, w(z)); + }, + [() => F()[w(z)]] + ), Xt(K, xt); + }), Xt(x, q); + }; + _n(we, (x) => { + Y(i()).length > 0 && x(ge); + }); + } + Et(Qt), Et(mt); + var Rt = Nt(mt, 2), Pt = Ct(Rt), ke = Ct(Pt, !0); + Et(Pt); + var xe = Nt(Pt, 2); + dr(xe, 17, () => w(o), hr, (x, q) => { + var Z = cc(), K = Me(Z), z = Ct(K, !0); + Et(K), hi(2), pn(() => Oe(z, w(q))), Xt(x, Z); + }), Et(Rt), Rn(Rt, (x) => W(l, x), () => w(l)); + var Ge = Nt(Rt, 2), sr = Ct(Ge); + return hi(2), Et(Ge), Rn(Ge, (x) => W(u, x), () => w(u)), pn( + (x, q) => { + Oe(Yt, `${w(p).config.contest ?? ""}, ${x ?? ""} to be elected, Round ${i() ?? ""}.`), Oe(ke, w(f)), Oe(sr, `"${q ?? ""}" means all the candidates ranked on `); }, [M, H] - ), ve(t, E), Wr({ + ), Xt(t, E), Kr({ get electionSummary() { return r(); }, - set electionSummary(w) { - r(w), Nt(); + set electionSummary(x) { + r(x), kt(); }, get currentRound() { return i(); }, - set currentRound(w = 1) { - i(w), Nt(); + set currentRound(x = 1) { + i(x), kt(); }, get requestRoundChange() { return s(); }, - set requestRoundChange(w = (q) => { + set requestRoundChange(x = (q) => { }) { - s(w), Nt(); + s(x), kt(); }, get candidateColors() { return a(); }, - set candidateColors(w = []) { - a(w), Nt(); + set candidateColors(x = []) { + a(x), kt(); } }); } -ll(["click"]); +ol(["click"]); customElements.define("pie-chart", ys( - dc, + vc, { electionSummary: {}, currentRound: {}, diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index 1204cb6c..31fe2115 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -7,12 +7,11 @@ {% endcompress %} - - {% compress css file %} {% endcompress %} diff --git a/templates/pie/pie-nonblocking.html b/templates/pie/pie-nonblocking.html index c65c5d93..9072959f 100644 --- a/templates/pie/pie-nonblocking.html +++ b/templates/pie/pie-nonblocking.html @@ -6,19 +6,12 @@ {% endcompress %} +