UNPKG

vue3-fortune-wheel

Version:
1,679 lines 73.3 kB
import { toValue as $e, ref as te, onMounted as He, computed as ee, reactive as yn, watch as ne, defineComponent as mn, onUnmounted as wn, createElementBlock as xt, openBlock as $t, Fragment as _n, createCommentVNode as Kt, createElementVNode as vn, unref as nt, toDisplayString as xn, normalizeStyle as $n } from "vue"; typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope; const Ae = () => { }; function An(t, e) { function n(...r) { return new Promise((i, a) => { Promise.resolve(t(() => e.apply(this, r), { fn: e, thisArg: this, args: r })).then(i).catch(a); }); } return n; } function bn(t, e = {}) { let n, r, i = Ae; const a = (l) => { clearTimeout(l), i(), i = Ae; }; let o; return (l) => { const c = $e(t), u = $e(e.maxWait); return n && a(n), c <= 0 || u !== void 0 && u <= 0 ? (r && (a(r), r = null), Promise.resolve(l())) : new Promise((h, f) => { i = e.rejectOnCancel ? f : h, o = l, u && !r && (r = setTimeout(() => { n && a(n), r = null, h(o()); }, u)), n = setTimeout(() => { r && a(r), r = null, h(l()); }, c); }); }; } function En(t, e = 200, n = {}) { return An( bn(e, n), t ); } const Mn = 20; function kn() { const t = te({ width: 600 }), e = te({ width: 600, height: 600 }), n = () => { if (typeof window < "u") { const a = window.innerWidth, o = Math.min(a, t.value.width) - Mn, s = Math.min(a, t.value.width) + 120; e.value = { width: o, height: s }; } }; He(() => { n(); }); const r = ee(() => e.value), i = ee(() => ({ width: `${r.value.width}px`, height: `${r.value.height}px`, margin: "0 auto", "will-change": "transform", transform: "translate3d(0,0,0)", "backface-visibility": "hidden", perspective: "1000px", contain: "layout paint", isolation: "isolate" })); return { wheelSize: r, wheelStyle: i }; } var Nn = { value: () => { } }; function We() { 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 Nt(n); } function Nt(t) { this._ = t; } function Sn(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 }; }); } Nt.prototype = We.prototype = { constructor: Nt, on: function(t, e) { var n = this._, r = Sn(t + "", n), i, a = -1, o = r.length; if (arguments.length < 2) { for (; ++a < o; ) if ((i = (t = r[a]).type) && (i = Rn(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++a < o; ) if (i = (t = r[a]).type) n[i] = be(n[i], t.name, e); else if (e == null) for (i in n) n[i] = be(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 Nt(t); }, call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, a; r < i; ++r) n[r] = arguments[r + 2]; if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (a = this._[t], r = 0, i = a.length; r < i; ++r) a[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, a = r.length; i < a; ++i) r[i].value.apply(e, n); } }; function Rn(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } function be(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { t[r] = Nn, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } var re = "http://www.w3.org/1999/xhtml"; const Ee = { svg: "http://www.w3.org/2000/svg", xhtml: re, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; function Vt(t) { var e = t += "", n = e.indexOf(":"); return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Ee.hasOwnProperty(e) ? { space: Ee[e], local: t } : t; } function Tn(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; return n === re && e.documentElement.namespaceURI === re ? e.createElement(t) : e.createElementNS(n, t); }; } function Cn(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function Ge(t) { var e = Vt(t); return (e.local ? Cn : Tn)(e); } function Fn() { } function he(t) { return t == null ? Fn : function() { return this.querySelector(t); }; } function In(t) { typeof t != "function" && (t = he(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var a = e[i], o = a.length, s = r[i] = new Array(o), l, c, u = 0; u < o; ++u) (l = a[u]) && (c = t.call(l, l.__data__, u, a)) && ("__data__" in l && (c.__data__ = l.__data__), s[u] = c); return new F(r, this._parents); } function Pn(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function On() { return []; } function Xe(t) { return t == null ? On : function() { return this.querySelectorAll(t); }; } function Dn(t) { return function() { return Pn(t.apply(this, arguments)); }; } function qn(t) { typeof t == "function" ? t = Dn(t) : t = Xe(t); for (var e = this._groups, n = e.length, r = [], i = [], a = 0; a < n; ++a) for (var o = e[a], s = o.length, l, c = 0; c < s; ++c) (l = o[c]) && (r.push(t.call(l, l.__data__, c, o)), i.push(l)); return new F(r, i); } function Be(t) { return function() { return this.matches(t); }; } function Ue(t) { return function(e) { return e.matches(t); }; } var Ln = Array.prototype.find; function Vn(t) { return function() { return Ln.call(this.children, t); }; } function Hn() { return this.firstElementChild; } function Wn(t) { return this.select(t == null ? Hn : Vn(typeof t == "function" ? t : Ue(t))); } var Gn = Array.prototype.filter; function Xn() { return Array.from(this.children); } function Bn(t) { return function() { return Gn.call(this.children, t); }; } function Un(t) { return this.selectAll(t == null ? Xn : Bn(typeof t == "function" ? t : Ue(t))); } function zn(t) { typeof t != "function" && (t = Be(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var a = e[i], o = a.length, s = r[i] = [], l, c = 0; c < o; ++c) (l = a[c]) && t.call(l, l.__data__, c, a) && s.push(l); return new F(r, this._parents); } function ze(t) { return new Array(t.length); } function Yn() { return new F(this._enter || this._groups.map(ze), this._parents); } function Ct(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } Ct.prototype = { constructor: Ct, 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 Kn(t) { return function() { return t; }; } function Zn(t, e, n, r, i, a) { for (var o = 0, s, l = e.length, c = a.length; o < c; ++o) (s = e[o]) ? (s.__data__ = a[o], r[o] = s) : n[o] = new Ct(t, a[o]); for (; o < l; ++o) (s = e[o]) && (i[o] = s); } function Qn(t, e, n, r, i, a, o) { var s, l, c = /* @__PURE__ */ new Map(), u = e.length, h = a.length, f = new Array(u), d; for (s = 0; s < u; ++s) (l = e[s]) && (f[s] = d = o.call(l, l.__data__, s, e) + "", c.has(d) ? i[s] = l : c.set(d, l)); for (s = 0; s < h; ++s) d = o.call(t, a[s], s, a) + "", (l = c.get(d)) ? (r[s] = l, l.__data__ = a[s], c.delete(d)) : n[s] = new Ct(t, a[s]); for (s = 0; s < u; ++s) (l = e[s]) && c.get(f[s]) === l && (i[s] = l); } function Jn(t) { return t.__data__; } function jn(t, e) { if (!arguments.length) return Array.from(this, Jn); var n = e ? Qn : Zn, r = this._parents, i = this._groups; typeof t != "function" && (t = Kn(t)); for (var a = i.length, o = new Array(a), s = new Array(a), l = new Array(a), c = 0; c < a; ++c) { var u = r[c], h = i[c], f = h.length, d = tr(t.call(u, u && u.__data__, c, r)), g = d.length, m = s[c] = new Array(g), A = o[c] = new Array(g), x = l[c] = new Array(f); n(u, h, m, A, x, d, e); for (var p = 0, _ = 0, y, v; p < g; ++p) if (y = m[p]) { for (p >= _ && (_ = p + 1); !(v = A[_]) && ++_ < g; ) ; y._next = v || null; } } return o = new F(o, r), o._enter = s, o._exit = l, o; } function tr(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } function er() { return new F(this._exit || this._groups.map(ze), this._parents); } function nr(t, e, n) { var r = this.enter(), i = this, a = 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 ? a.remove() : n(a), r && i ? r.merge(i).order() : i; } function rr(t) { for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, a = r.length, o = Math.min(i, a), s = new Array(i), l = 0; l < o; ++l) for (var c = n[l], u = r[l], h = c.length, f = s[l] = new Array(h), d, g = 0; g < h; ++g) (d = c[g] || u[g]) && (f[g] = d); for (; l < i; ++l) s[l] = n[l]; return new F(s, this._parents); } function ir() { for (var t = this._groups, e = -1, n = t.length; ++e < n; ) for (var r = t[e], i = r.length - 1, a = r[i], o; --i >= 0; ) (o = r[i]) && (a && o.compareDocumentPosition(a) ^ 4 && a.parentNode.insertBefore(o, a), a = o); return this; } function ar(t) { t || (t = or); function e(h, f) { return h && f ? t(h.__data__, f.__data__) : !h - !f; } for (var n = this._groups, r = n.length, i = new Array(r), a = 0; a < r; ++a) { for (var o = n[a], s = o.length, l = i[a] = new Array(s), c, u = 0; u < s; ++u) (c = o[u]) && (l[u] = c); l.sort(e); } return new F(i, this._parents).order(); } function or(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } function sr() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } function lr() { return Array.from(this); } function ur() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, a = r.length; i < a; ++i) { var o = r[i]; if (o) return o; } return null; } function cr() { let t = 0; for (const e of this) ++t; return t; } function fr() { return !this.node(); } function hr(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], a = 0, o = i.length, s; a < o; ++a) (s = i[a]) && t.call(s, s.__data__, a, i); return this; } function dr(t) { return function() { this.removeAttribute(t); }; } function pr(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function gr(t, e) { return function() { this.setAttribute(t, e); }; } function yr(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } function mr(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } function wr(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 _r(t, e) { var n = Vt(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 ? pr : dr : typeof e == "function" ? n.local ? wr : mr : n.local ? yr : gr)(n, e)); } function Ye(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function vr(t) { return function() { this.style.removeProperty(t); }; } function xr(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } function $r(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } function Ar(t, e, n) { return arguments.length > 1 ? this.each((e == null ? vr : typeof e == "function" ? $r : xr)(t, e, n ?? "")) : at(this.node(), t); } function at(t, e) { return t.style.getPropertyValue(e) || Ye(t).getComputedStyle(t, null).getPropertyValue(e); } function br(t) { return function() { delete this[t]; }; } function Er(t, e) { return function() { this[t] = e; }; } function Mr(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } function kr(t, e) { return arguments.length > 1 ? this.each((e == null ? br : typeof e == "function" ? Mr : Er)(t, e)) : this.node()[t]; } function Ke(t) { return t.trim().split(/^|\s+/); } function de(t) { return t.classList || new Ze(t); } function Ze(t) { this._node = t, this._names = Ke(t.getAttribute("class") || ""); } Ze.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 Qe(t, e) { for (var n = de(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } function Je(t, e) { for (var n = de(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } function Nr(t) { return function() { Qe(this, t); }; } function Sr(t) { return function() { Je(this, t); }; } function Rr(t, e) { return function() { (e.apply(this, arguments) ? Qe : Je)(this, t); }; } function Tr(t, e) { var n = Ke(t + ""); if (arguments.length < 2) { for (var r = de(this.node()), i = -1, a = n.length; ++i < a; ) if (!r.contains(n[i])) return !1; return !0; } return this.each((typeof e == "function" ? Rr : e ? Nr : Sr)(n, e)); } function Cr() { this.textContent = ""; } function Fr(t) { return function() { this.textContent = t; }; } function Ir(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } function Pr(t) { return arguments.length ? this.each(t == null ? Cr : (typeof t == "function" ? Ir : Fr)(t)) : this.node().textContent; } function Or() { this.innerHTML = ""; } function Dr(t) { return function() { this.innerHTML = t; }; } function qr(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } function Lr(t) { return arguments.length ? this.each(t == null ? Or : (typeof t == "function" ? qr : Dr)(t)) : this.node().innerHTML; } function Vr() { this.nextSibling && this.parentNode.appendChild(this); } function Hr() { return this.each(Vr); } function Wr() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function Gr() { return this.each(Wr); } function Xr(t) { var e = typeof t == "function" ? t : Ge(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } function Br() { return null; } function Ur(t, e) { var n = typeof t == "function" ? t : Ge(t), r = e == null ? Br : typeof e == "function" ? e : he(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } function zr() { var t = this.parentNode; t && t.removeChild(this); } function Yr() { return this.each(zr); } function Kr() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function Zr() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function Qr(t) { return this.select(t ? Zr : Kr); } function Jr(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } function jr(t) { return function(e) { t.call(this, e, this.__data__); }; } function ti(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 ei(t) { return function() { var e = this.__on; if (e) { for (var n = 0, r = -1, i = e.length, a; n < i; ++n) a = e[n], (!t.type || a.type === t.type) && a.name === t.name ? this.removeEventListener(a.type, a.listener, a.options) : e[++r] = a; ++r ? e.length = r : delete this.__on; } }; } function ni(t, e, n) { return function() { var r = this.__on, i, a = jr(e); if (r) { for (var o = 0, s = r.length; o < s; ++o) if ((i = r[o]).type === t.type && i.name === t.name) { this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = a, i.options = n), i.value = e; return; } } this.addEventListener(t.type, a, n), i = { type: t.type, name: t.name, value: e, listener: a, options: n }, r ? r.push(i) : this.__on = [i]; }; } function ri(t, e, n) { var r = ti(t + ""), i, a = r.length, o; if (arguments.length < 2) { var s = this.node().__on; if (s) { for (var l = 0, c = s.length, u; l < c; ++l) for (i = 0, u = s[l]; i < a; ++i) if ((o = r[i]).type === u.type && o.name === u.name) return u.value; } return; } for (s = e ? ni : ei, i = 0; i < a; ++i) this.each(s(r[i], e, n)); return this; } function je(t, e, n) { var r = Ye(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 ii(t, e) { return function() { return je(this, t, e); }; } function ai(t, e) { return function() { return je(this, t, e.apply(this, arguments)); }; } function oi(t, e) { return this.each((typeof e == "function" ? ai : ii)(t, e)); } function* si() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, a = r.length, o; i < a; ++i) (o = r[i]) && (yield o); } var tn = [null]; function F(t, e) { this._groups = t, this._parents = e; } function gt() { return new F([[document.documentElement]], tn); } function li() { return this; } F.prototype = gt.prototype = { constructor: F, select: In, selectAll: qn, selectChild: Wn, selectChildren: Un, filter: zn, data: jn, enter: Yn, exit: er, join: nr, merge: rr, selection: li, order: ir, sort: ar, call: sr, nodes: lr, node: ur, size: cr, empty: fr, each: hr, attr: _r, style: Ar, property: kr, classed: Tr, text: Pr, html: Lr, raise: Hr, lower: Gr, append: Xr, insert: Ur, remove: Yr, clone: Qr, datum: Jr, on: ri, dispatch: oi, [Symbol.iterator]: si }; function S(t) { return typeof t == "string" ? new F([[document.querySelector(t)]], [document.documentElement]) : new F([[t]], tn); } function pe(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } function en(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } function yt() { } var ft = 0.7, Ft = 1 / ft, it = "\\s*([+-]?\\d+)\\s*", ht = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", H = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", ui = /^#([0-9a-f]{3,8})$/, ci = new RegExp(`^rgb\\(${it},${it},${it}\\)$`), fi = new RegExp(`^rgb\\(${H},${H},${H}\\)$`), hi = new RegExp(`^rgba\\(${it},${it},${it},${ht}\\)$`), di = new RegExp(`^rgba\\(${H},${H},${H},${ht}\\)$`), pi = new RegExp(`^hsl\\(${ht},${H},${H}\\)$`), gi = new RegExp(`^hsla\\(${ht},${H},${H},${ht}\\)$`), Me = { 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 }; pe(yt, j, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, hex: ke, // Deprecated! Use color.formatHex. formatHex: ke, formatHex8: yi, formatHsl: mi, formatRgb: Ne, toString: Ne }); function ke() { return this.rgb().formatHex(); } function yi() { return this.rgb().formatHex8(); } function mi() { return nn(this).formatHsl(); } function Ne() { return this.rgb().formatRgb(); } function j(t) { var e, n; return t = (t + "").trim().toLowerCase(), (e = ui.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Se(e) : n === 3 ? new T(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? At(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? At(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 = ci.exec(t)) ? new T(e[1], e[2], e[3], 1) : (e = fi.exec(t)) ? new T(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = hi.exec(t)) ? At(e[1], e[2], e[3], e[4]) : (e = di.exec(t)) ? At(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = pi.exec(t)) ? Ce(e[1], e[2] / 100, e[3] / 100, 1) : (e = gi.exec(t)) ? Ce(e[1], e[2] / 100, e[3] / 100, e[4]) : Me.hasOwnProperty(t) ? Se(Me[t]) : t === "transparent" ? new T(NaN, NaN, NaN, 0) : null; } function Se(t) { return new T(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } function At(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new T(t, e, n, r); } function wi(t) { return t instanceof yt || (t = j(t)), t ? (t = t.rgb(), new T(t.r, t.g, t.b, t.opacity)) : new T(); } function ie(t, e, n, r) { return arguments.length === 1 ? wi(t) : new T(t, e, n, r ?? 1); } function T(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } pe(T, ie, en(yt, { brighter(t) { return t = t == null ? Ft : Math.pow(Ft, t), new T(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { return t = t == null ? ft : Math.pow(ft, t), new T(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { return new T(J(this.r), J(this.g), J(this.b), It(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: Re, // Deprecated! Use color.formatHex. formatHex: Re, formatHex8: _i, formatRgb: Te, toString: Te })); function Re() { return `#${Q(this.r)}${Q(this.g)}${Q(this.b)}`; } function _i() { return `#${Q(this.r)}${Q(this.g)}${Q(this.b)}${Q((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Te() { const t = It(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${J(this.r)}, ${J(this.g)}, ${J(this.b)}${t === 1 ? ")" : `, ${t})`}`; } function It(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function J(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } function Q(t) { return t = J(t), (t < 16 ? "0" : "") + t.toString(16); } function Ce(t, e, n, r) { return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new D(t, e, n, r); } function nn(t) { if (t instanceof D) return new D(t.h, t.s, t.l, t.opacity); if (t instanceof yt || (t = j(t)), !t) return new D(); if (t instanceof D) return t; t = t.rgb(); var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), a = Math.max(e, n, r), o = NaN, s = a - i, l = (a + i) / 2; return s ? (e === a ? o = (n - r) / s + (n < r) * 6 : n === a ? o = (r - e) / s + 2 : o = (e - n) / s + 4, s /= l < 0.5 ? a + i : 2 - a - i, o *= 60) : s = l > 0 && l < 1 ? 0 : o, new D(o, s, l, t.opacity); } function vi(t, e, n, r) { return arguments.length === 1 ? nn(t) : new D(t, e, n, r ?? 1); } function D(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } pe(D, vi, en(yt, { brighter(t) { return t = t == null ? Ft : Math.pow(Ft, t), new D(this.h, this.s, this.l * t, this.opacity); }, darker(t) { return t = t == null ? ft : Math.pow(ft, t), new D(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( Zt(t >= 240 ? t - 240 : t + 120, i, r), Zt(t, i, r), Zt(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { return new D(Fe(this.h), bt(this.s), bt(this.l), It(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 = It(this.opacity); return `${t === 1 ? "hsl(" : "hsla("}${Fe(this.h)}, ${bt(this.s) * 100}%, ${bt(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function Fe(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } function bt(t) { return Math.max(0, Math.min(1, t || 0)); } function Zt(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 ge = (t) => () => t; function xi(t, e) { return function(n) { return t + n * e; }; } function $i(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 Ai(t) { return (t = +t) == 1 ? rn : function(e, n) { return n - e ? $i(e, n, t) : ge(isNaN(e) ? n : e); }; } function rn(t, e) { var n = e - t; return n ? xi(t, n) : ge(isNaN(t) ? e : t); } const Pt = function t(e) { var n = Ai(e); function r(i, a) { var o = n((i = ie(i)).r, (a = ie(a)).r), s = n(i.g, a.g), l = n(i.b, a.b), c = rn(i.opacity, a.opacity); return function(u) { return i.r = o(u), i.g = s(u), i.b = l(u), i.opacity = c(u), i + ""; }; } return r.gamma = t, r; }(1); function bi(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(a) { for (i = 0; i < n; ++i) r[i] = t[i] * (1 - a) + e[i] * a; return r; }; } function Ei(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } function Mi(t, e) { var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), a = new Array(n), o; for (o = 0; o < r; ++o) i[o] = ye(t[o], e[o]); for (; o < n; ++o) a[o] = e[o]; return function(s) { for (o = 0; o < r; ++o) a[o] = i[o](s); return a; }; } function ki(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; }; } function V(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } function Ni(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(a) { for (i in n) r[i] = n[i](a); return r; }; } var ae = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Qt = new RegExp(ae.source, "g"); function Si(t) { return function() { return t; }; } function Ri(t) { return function(e) { return t(e) + ""; }; } function an(t, e) { var n = ae.lastIndex = Qt.lastIndex = 0, r, i, a, o = -1, s = [], l = []; for (t = t + "", e = e + ""; (r = ae.exec(t)) && (i = Qt.exec(e)); ) (a = i.index) > n && (a = e.slice(n, a), s[o] ? s[o] += a : s[++o] = a), (r = r[0]) === (i = i[0]) ? s[o] ? s[o] += i : s[++o] = i : (s[++o] = null, l.push({ i: o, x: V(r, i) })), n = Qt.lastIndex; return n < e.length && (a = e.slice(n), s[o] ? s[o] += a : s[++o] = a), s.length < 2 ? l[0] ? Ri(l[0].x) : Si(e) : (e = l.length, function(c) { for (var u = 0, h; u < e; ++u) s[(h = l[u]).i] = h.x(c); return s.join(""); }); } function ye(t, e) { var n = typeof e, r; return e == null || n === "boolean" ? ge(e) : (n === "number" ? V : n === "string" ? (r = j(e)) ? (e = r, Pt) : an : e instanceof j ? Pt : e instanceof Date ? ki : Ei(e) ? bi : Array.isArray(e) ? Mi : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Ni : V)(t, e); } var Ie = 180 / Math.PI, oe = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function on(t, e, n, r, i, a) { var o, s, l; return (o = Math.sqrt(t * t + e * e)) && (t /= o, e /= o), (l = t * n + e * r) && (n -= t * l, r -= e * l), (s = Math.sqrt(n * n + r * r)) && (n /= s, r /= s, l /= s), t * r < e * n && (t = -t, e = -e, l = -l, o = -o), { translateX: i, translateY: a, rotate: Math.atan2(e, t) * Ie, skewX: Math.atan(l) * Ie, scaleX: o, scaleY: s }; } var Et; function Ti(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); return e.isIdentity ? oe : on(e.a, e.b, e.c, e.d, e.e, e.f); } function Ci(t) { return t == null || (Et || (Et = document.createElementNS("http://www.w3.org/2000/svg", "g")), Et.setAttribute("transform", t), !(t = Et.transform.baseVal.consolidate())) ? oe : (t = t.matrix, on(t.a, t.b, t.c, t.d, t.e, t.f)); } function sn(t, e, n, r) { function i(c) { return c.length ? c.pop() + " " : ""; } function a(c, u, h, f, d, g) { if (c !== h || u !== f) { var m = d.push("translate(", null, e, null, n); g.push({ i: m - 4, x: V(c, h) }, { i: m - 2, x: V(u, f) }); } else (h || f) && d.push("translate(" + h + e + f + n); } function o(c, u, h, f) { c !== u ? (c - u > 180 ? u += 360 : u - c > 180 && (c += 360), f.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: V(c, u) })) : u && h.push(i(h) + "rotate(" + u + r); } function s(c, u, h, f) { c !== u ? f.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: V(c, u) }) : u && h.push(i(h) + "skewX(" + u + r); } function l(c, u, h, f, d, g) { if (c !== h || u !== f) { var m = d.push(i(d) + "scale(", null, ",", null, ")"); g.push({ i: m - 4, x: V(c, h) }, { i: m - 2, x: V(u, f) }); } else (h !== 1 || f !== 1) && d.push(i(d) + "scale(" + h + "," + f + ")"); } return function(c, u) { var h = [], f = []; return c = t(c), u = t(u), a(c.translateX, c.translateY, u.translateX, u.translateY, h, f), o(c.rotate, u.rotate, h, f), s(c.skewX, u.skewX, h, f), l(c.scaleX, c.scaleY, u.scaleX, u.scaleY, h, f), c = u = null, function(d) { for (var g = -1, m = f.length, A; ++g < m; ) h[(A = f[g]).i] = A.x(d); return h.join(""); }; }; } var Fi = sn(Ti, "px, ", "px)", "deg)"), Ii = sn(Ci, ", ", ")", ")"), ot = 0, lt = 0, st = 0, ln = 1e3, Ot, ut, Dt = 0, tt = 0, Ht = 0, dt = typeof performance == "object" && performance.now ? performance : Date, un = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function me() { return tt || (un(Pi), tt = dt.now() + Ht); } function Pi() { tt = 0; } function qt() { this._call = this._time = this._next = null; } qt.prototype = cn.prototype = { constructor: qt, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); n = (n == null ? me() : +n) + (e == null ? 0 : +e), !this._next && ut !== this && (ut ? ut._next = this : Ot = this, ut = this), this._call = t, this._time = n, se(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, se()); } }; function cn(t, e, n) { var r = new qt(); return r.restart(t, e, n), r; } function Oi() { me(), ++ot; for (var t = Ot, e; t; ) (e = tt - t._time) >= 0 && t._call.call(void 0, e), t = t._next; --ot; } function Pe() { tt = (Dt = dt.now()) + Ht, ot = lt = 0; try { Oi(); } finally { ot = 0, qi(), tt = 0; } } function Di() { var t = dt.now(), e = t - Dt; e > ln && (Ht -= e, Dt = t); } function qi() { for (var t, e = Ot, 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 : Ot = n); ut = t, se(r); } function se(t) { if (!ot) { lt && (lt = clearTimeout(lt)); var e = t - tt; e > 24 ? (t < 1 / 0 && (lt = setTimeout(Pe, t - dt.now() - Ht)), st && (st = clearInterval(st))) : (st || (Dt = dt.now(), st = setInterval(Di, ln)), ot = 1, un(Pe)); } } function Oe(t, e, n) { var r = new qt(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } var Li = We("start", "end", "cancel", "interrupt"), Vi = [], fn = 0, De = 1, le = 2, St = 3, qe = 4, ue = 5, Rt = 6; function Wt(t, e, n, r, i, a) { var o = t.__transition; if (!o) t.__transition = {}; else if (n in o) return; Hi(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. on: Li, tween: Vi, time: a.time, delay: a.delay, duration: a.duration, ease: a.ease, timer: null, state: fn }); } function we(t, e) { var n = q(t, e); if (n.state > fn) throw new Error("too late; already scheduled"); return n; } function W(t, e) { var n = q(t, e); if (n.state > St) throw new Error("too late; already running"); return n; } function q(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } function Hi(t, e, n) { var r = t.__transition, i; r[e] = n, n.timer = cn(a, 0, n.time); function a(c) { n.state = De, n.timer.restart(o, n.delay, n.time), n.delay <= c && o(c - n.delay); } function o(c) { var u, h, f, d; if (n.state !== De) return l(); for (u in r) if (d = r[u], d.name === n.name) { if (d.state === St) return Oe(o); d.state === qe ? (d.state = Rt, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[u]) : +u < e && (d.state = Rt, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[u]); } if (Oe(function() { n.state === St && (n.state = qe, n.timer.restart(s, n.delay, n.time), s(c)); }), n.state = le, n.on.call("start", t, t.__data__, n.index, n.group), n.state === le) { for (n.state = St, i = new Array(f = n.tween.length), u = 0, h = -1; u < f; ++u) (d = n.tween[u].value.call(t, t.__data__, n.index, n.group)) && (i[++h] = d); i.length = h + 1; } } function s(c) { for (var u = c < n.duration ? n.ease.call(null, c / n.duration) : (n.timer.restart(l), n.state = ue, 1), h = -1, f = i.length; ++h < f; ) i[h].call(t, u); n.state === ue && (n.on.call("end", t, t.__data__, n.index, n.group), l()); } function l() { n.state = Rt, n.timer.stop(), delete r[e]; for (var c in r) return; delete t.__transition; } } function Wi(t, e) { var n = t.__transition, r, i, a = !0, o; if (n) { e = e == null ? null : e + ""; for (o in n) { if ((r = n[o]).name !== e) { a = !1; continue; } i = r.state > le && r.state < ue, r.state = Rt, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[o]; } a && delete t.__transition; } } function Gi(t) { return this.each(function() { Wi(this, t); }); } function Xi(t, e) { var n, r; return function() { var i = W(this, t), a = i.tween; if (a !== n) { r = n = a; for (var o = 0, s = r.length; o < s; ++o) if (r[o].name === e) { r = r.slice(), r.splice(o, 1); break; } } i.tween = r; }; } function Bi(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { var a = W(this, t), o = a.tween; if (o !== r) { i = (r = o).slice(); for (var s = { name: e, value: n }, l = 0, c = i.length; l < c; ++l) if (i[l].name === e) { i[l] = s; break; } l === c && i.push(s); } a.tween = i; }; } function Ui(t, e) { var n = this._id; if (t += "", arguments.length < 2) { for (var r = q(this.node(), n).tween, i = 0, a = r.length, o; i < a; ++i) if ((o = r[i]).name === t) return o.value; return null; } return this.each((e == null ? Xi : Bi)(n, t, e)); } function _e(t, e, n) { var r = t._id; return t.each(function() { var i = W(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { return q(i, r).value[e]; }; } function hn(t, e) { var n; return (typeof e == "number" ? V : e instanceof j ? Pt : (n = j(e)) ? (e = n, Pt) : an)(t, e); } function zi(t) { return function() { this.removeAttribute(t); }; } function Yi(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function Ki(t, e, n) { var r, i = n + "", a; return function() { var o = this.getAttribute(t); return o === i ? null : o === r ? a : a = e(r = o, n); }; } function Zi(t, e, n) { var r, i = n + "", a; return function() { var o = this.getAttributeNS(t.space, t.local); return o === i ? null : o === r ? a : a = e(r = o, n); }; } function Qi(t, e, n) { var r, i, a; return function() { var o, s = n(this), l; return s == null ? void this.removeAttribute(t) : (o = this.getAttribute(t), l = s + "", o === l ? null : o === r && l === i ? a : (i = l, a = e(r = o, s))); }; } function Ji(t, e, n) { var r, i, a; return function() { var o, s = n(this), l; return s == null ? void this.removeAttributeNS(t.space, t.local) : (o = this.getAttributeNS(t.space, t.local), l = s + "", o === l ? null : o === r && l === i ? a : (i = l, a = e(r = o, s))); }; } function ji(t, e) { var n = Vt(t), r = n === "transform" ? Ii : hn; return this.attrTween(t, typeof e == "function" ? (n.local ? Ji : Qi)(n, r, _e(this, "attr." + t, e)) : e == null ? (n.local ? Yi : zi)(n) : (n.local ? Zi : Ki)(n, r, e)); } function ta(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } function ea(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } function na(t, e) { var n, r; function i() { var a = e.apply(this, arguments); return a !== r && (n = (r = a) && ea(t, a)), n; } return i._value = e, i; } function ra(t, e) { var n, r; function i() { var a = e.apply(this, arguments); return a !== r && (n = (r = a) && ta(t, a)), n; } return i._value = e, i; } function ia(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 = Vt(t); return this.tween(n, (r.local ? na : ra)(r, e)); } function aa(t, e) { return function() { we(this, t).delay = +e.apply(this, arguments); }; } function oa(t, e) { return e = +e, function() { we(this, t).delay = e; }; } function sa(t) { var e = this._id; return arguments.length ? this.each((typeof t == "function" ? aa : oa)(e, t)) : q(this.node(), e).delay; } function la(t, e) { return function() { W(this, t).duration = +e.apply(this, arguments); }; } function ua(t, e) { return e = +e, function() { W(this, t).duration = e; }; } function ca(t) { var e = this._id; return arguments.length ? this.each((typeof t == "function" ? la : ua)(e, t)) : q(this.node(), e).duration; } function fa(t, e) { if (typeof e != "function") throw new Error(); return function() { W(this, t).ease = e; }; } function ha(t) { var e = this._id; return arguments.length ? this.each(fa(e, t)) : q(this.node(), e).ease; } function da(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); W(this, t).ease = n; }; } function pa(t) { if (typeof t != "function") throw new Error(); return this.each(da(this._id, t)); } function ga(t) { typeof t != "function" && (t = Be(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var a = e[i], o = a.length, s = r[i] = [], l, c = 0; c < o; ++c) (l = a[c]) && t.call(l, l.__data__, c, a) && s.push(l); return new B(r, this._parents, this._name, this._id); } function ya(t) { if (t._id !== this._id) throw new Error(); for (var e = this._groups, n = t._groups, r = e.length, i = n.length, a = Math.min(r, i), o = new Array(r), s = 0; s < a; ++s) for (var l = e[s], c = n[s], u = l.length, h = o[s] = new Array(u), f, d = 0; d < u; ++d) (f = l[d] || c[d]) && (h[d] = f); for (; s < r; ++s) o[s] = e[s]; return new B(o, this._parents, this._name, this._id); } function ma(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 wa(t, e, n) { var r, i, a = ma(e) ? we : W; return function() { var o = a(this, t), s = o.on; s !== r && (i = (r = s).copy()).on(e, n), o.on = i; }; } function _a(t, e) { var n = this._id; return arguments.length < 2 ? q(this.node(), n).on.on(t) : this.each(wa(n, t, e)); } function va(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } function xa() { return this.on("end.remove", va(this._id)); } function $a(t) { var e = this._name, n = this._id; typeof t != "function" && (t = he(t)); for (var r = this._groups, i = r.length, a = new Array(i), o = 0; o < i; ++o) for (var s = r[o], l = s.length, c = a[o] = new Array(l), u, h, f = 0; f < l; ++f) (u = s[f]) && (h = t.call(u, u.__data__, f, s)) && ("__data__" in u && (h.__data__ = u.__data__), c[f] = h, Wt(c[f], e, n, f, c, q(u, n))); return new B(a, this._parents, e, n); } function Aa(t) { var e = this._name, n = this._id; typeof t != "function" && (t = Xe(t)); for (var r = this._groups, i = r.length, a = [], o = [], s = 0; s < i; ++s) for (var l = r[s], c = l.length, u, h = 0; h < c; ++h) if (u = l[h]) { for (var f = t.call(u, u.__data__, h, l), d, g = q(u, n), m = 0, A = f.length; m < A; ++m) (d = f[m]) && Wt(d, e, n, m, f, g); a.push(f), o.push(u); } return new B(a, o, e, n); } var ba = gt.prototype.constructor; function Ea() { return new ba(this._groups, this._parents); } function Ma(t, e) { var n, r, i; return function() { var a = at(this, t), o = (this.style.removeProperty(t), at(this, t)); return a === o ? null : a === n && o === r ? i : i = e(n = a, r = o); }; } function dn(t) { return function() { this.style.removeProperty(t); }; } function ka(t, e, n) { var r, i = n + "", a; return function() { var o = at(this, t); return o === i ? null : o === r ? a : a = e(r = o, n); }; } function Na(t, e, n) { var r, i, a; return function() { var o = at(this, t), s = n(this), l = s + ""; return s == null && (l = s = (this.style.removeProperty(t), at(this, t))), o === l ? null : o === r && l === i ? a : (i = l, a = e(r = o, s)); }; } function Sa(t, e) { var n, r, i, a = "style." + e, o = "end." + a, s; return function() { var l = W(this, t), c = l.on, u = l.value[a] == null ? s || (s = dn(e)) : void 0; (c !== n || i !== u) && (r = (n = c).copy()).on(o, i = u), l.on = r; }; } function Ra(t, e, n) { var r = (t += "") == "transform" ? Fi : hn; return e == null ? this.styleTween(t, Ma(t, r)).on("end.style." + t, dn(t)) : typeof e == "function" ? this.styleTween(t, Na(t, r, _e(this, "style." + t, e))).each(Sa(this._id, t)) : this.styleTween(t, ka(t, r, e), n).on("end.style." + t, null); } function Ta(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } function Ca(t, e, n) { var r, i; function a() { var o = e.apply(this, arguments); return o !== i && (r = (i = o) && Ta(t, o, n)), r; } return a._value = e, a; } function Fa(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, Ca(t, e, n ?? "")); } function Ia(t) { return function() { this.textContent = t; }; } function Pa(t) { return function() { var e = t(this); this.textContent = e ?? ""; }; } function Oa(t) { return this.tween("text", typeof t == "function" ? Pa(_e(this, "text", t)) : Ia(t == null ? "" : t + "")); } function Da(t) { return function(e) { this.textContent = t.call(this, e); }; } function qa(t) { var e, n; function r() { var i = t.apply(this, arguments); return i !== n && (e = (n = i) && Da(i)), e; } return r._value = t, r; } function La(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, qa(t)); } function Va() { for (var t = this._name, e = this._id, n = pn(), r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, l, c = 0; c < s; ++c) if (l = o[c]) { var u = q(l, e); Wt(l, t, n, c, o, { time: u.time + u.delay + u.duration, delay: 0, duration: u.duration, ease: u.ease }); } return new B(r, this._parents, t, n); } function Ha() { var t, e, n = this, r = n._id, i = n.size(); return new Promise(function(a, o) { var s = { value: o }, l = { value: function() { --i === 0 && a(); } }; n.each(function() { var c = W(this, r), u = c.on; u !== t && (e = (t = u).copy(), e._.cancel.push(s), e._.interrupt.push(s), e._.end.push(l)), c.on = e; }), i === 0 && a(); }); } var Wa = 0; function B(t, e, n, r) { this._groups = t, this._parents = e, this._name = n, this._id = r; } function pn() { return ++Wa; } var X = gt.prototype; B.prototype = { constructor: B, select: $a, selectAll: Aa, selectChild: X.selectChild, selectChildren: X.selectChildren, filter: ga, merge: ya, selection: Ea, tra