UNPKG

@explorables/albert_and_carl_friedrich

Version:

This explorable illustrates two dimensional random walks and the central limit theorem. Although random walks may differ on a small scale, as time progress and they all looks the same from a distance.

1,559 lines 227 kB
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('/*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer theme{:root,:host{--tw-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--tw-color-black:#000;--tw-color-white:#fff;--tw-spacing:.25rem;--tw-container-5xl:64rem;--tw-text-2xl:1.5rem;--tw-text-2xl--line-height:calc(2/1.5);--tw-text-3xl:1.875rem;--tw-text-3xl--line-height: 1.2 ;--tw-text-5xl:3rem;--tw-text-5xl--line-height:1;--tw-font-weight-light:300}}@layer base,components;@layer utilities{.tw\\:m-8{margin:calc(var(--tw-spacing)*8)}.tw\\:grid{display:grid}.tw\\:max-w-5xl{max-width:var(--tw-container-5xl)}.tw\\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.tw\\:border-1{border-style:var(--tw-border-style);border-width:1px}.tw\\:bg-white{background-color:var(--tw-color-white)}.tw\\:p-0{padding:calc(var(--tw-spacing)*0)}.tw\\:px-1{padding-inline:calc(var(--tw-spacing)*1)}.tw\\:px-10{padding-inline:calc(var(--tw-spacing)*10)}.tw\\:font-sans{font-family:var(--tw-font-sans)}.tw\\:text-2xl{font-size:var(--tw-text-2xl);line-height:var(--tw-leading,var(--tw-text-2xl--line-height))}.tw\\:text-3xl{font-size:var(--tw-text-3xl);line-height:var(--tw-leading,var(--tw-text-3xl--line-height))}.tw\\:text-5xl{font-size:var(--tw-text-5xl);line-height:var(--tw-leading,var(--tw-text-5xl--line-height))}.tw\\:font-light{--tw-font-weight:var(--tw-font-weight-light);font-weight:var(--tw-font-weight-light)}.tw\\:text-black{color:var(--tw-color-black)}@media (min-width:40rem){.tw\\:sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.tw\\:sm\\:gap-8{gap:calc(var(--tw-spacing)*8)}.tw\\:sm\\:p-0{padding:calc(var(--tw-spacing)*0)}}@media (prefers-color-scheme:dark){.tw\\:dark\\:border-white{border-color:var(--tw-color-white)}.tw\\:dark\\:bg-black{background-color:var(--tw-color-black)}.tw\\:dark\\:text-white{color:var(--tw-color-white)}}.debug-grid-16{background-image:linear-gradient(90deg,#0000ff1a 1px,#0000 1px),linear-gradient(#0000ff1a 1px,#0000 1px);background-repeat:repeat;background-size:6.25% 6.25%,6.25% 6.25%}}.explorable *,.explorable :before,.explorable :after{box-sizing:border-box}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}._displayPanel_1no3j_1,._controlPanel_1no3j_6{display:block}._insetaxis_1no3j_16{stroke:#000;stroke-width:1px}@media (prefers-color-scheme: dark){._insetaxis_1no3j_16{stroke:#fff;stroke-width:1px}}._pdf_lattice_1no3j_28{stroke:none;opacity:1}._pdf_ring_1no3j_33{fill:none;stroke-width:5px;opacity:1}._pdf_gaussian_1no3j_38{opacity:.7;stroke:none;fill:url(#gaussian_gradient)}@media (prefers-color-scheme: dark){._pdf_gaussian_1no3j_38{fill:url(#gaussian_gradient_dark)}}._pdf_triangular_1no3j_50{opacity:1;stroke:none}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})(); const nl = { display_type: "canvas", // either svg or canvas depending on explorable debug: !1, // if set to true, draws dots on the control panel to help widget placement debug_lattice: "debug-grid-16", controls_grid: { nx: 12, ny: 12 }, display_size: { width: 500, height: 500 }, controls_size: { width: 480, height: 480 }, display_class: "tw:border-1 tw-border-black tw:dark:border-white tw:p-0", controls_class: "tw:p-0", container_class: "tw:font-sans tw:font-light tw:grid tw:grid-cols-1 tw:sm:grid-cols-2 tw:sm:gap-8 tw:px-1 tw:sm:p-0 tw:m-8" }; function ue(t, n) { return t == null || n == null ? NaN : t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN; } function el(t, n) { return t == null || n == null ? NaN : n < t ? -1 : n > t ? 1 : n >= t ? 0 : NaN; } function Oo(t) { let n, e, r; t.length !== 2 ? (n = ue, e = (s, l) => ue(t(s), l), r = (s, l) => t(s) - l) : (n = t === ue || t === el ? t : rl, e = t, r = t); function i(s, l, u = 0, c = s.length) { if (u < c) { if (n(l, l) !== 0) return c; do { const h = u + c >>> 1; e(s[h], l) < 0 ? u = h + 1 : c = h; } while (u < c); } return u; } function a(s, l, u = 0, c = s.length) { if (u < c) { if (n(l, l) !== 0) return c; do { const h = u + c >>> 1; e(s[h], l) <= 0 ? u = h + 1 : c = h; } while (u < c); } return u; } function o(s, l, u = 0, c = s.length) { const h = i(s, l, u, c - 1); return h > u && r(s[h - 1], l) > -r(s[h], l) ? h - 1 : h; } return { left: i, center: o, right: a }; } function rl() { return 0; } function il(t) { return t === null ? NaN : +t; } const al = Oo(ue), ol = al.right; Oo(il).center; class Gi extends Map { constructor(n, e = ll) { if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: e } }), n != null) for (const [r, i] of n) this.set(r, i); } get(n) { return super.get(Yi(this, n)); } has(n) { return super.has(Yi(this, n)); } set(n, e) { return super.set(sl(this, n), e); } delete(n) { return super.delete(ul(this, n)); } } function Yi({ _intern: t, _key: n }, e) { const r = n(e); return t.has(r) ? t.get(r) : e; } function sl({ _intern: t, _key: n }, e) { const r = n(e); return t.has(r) ? t.get(r) : (t.set(r, e), e); } function ul({ _intern: t, _key: n }, e) { const r = n(e); return t.has(r) && (e = t.get(r), t.delete(r)), e; } function ll(t) { return t !== null && typeof t == "object" ? t.valueOf() : t; } const cl = Math.sqrt(50), fl = Math.sqrt(10), hl = Math.sqrt(2); function me(t, n, e) { const r = (n - t) / Math.max(0, e), i = Math.floor(Math.log10(r)), a = r / Math.pow(10, i), o = a >= cl ? 10 : a >= fl ? 5 : a >= hl ? 2 : 1; let s, l, u; return i < 0 ? (u = Math.pow(10, -i) / o, s = Math.round(t * u), l = Math.round(n * u), s / u < t && ++s, l / u > n && --l, u = -u) : (u = Math.pow(10, i) * o, s = Math.round(t / u), l = Math.round(n / u), s * u < t && ++s, l * u > n && --l), l < s && 0.5 <= e && e < 2 ? me(t, n, e * 2) : [s, l, u]; } function pl(t, n, e) { if (n = +n, t = +t, e = +e, !(e > 0)) return []; if (t === n) return [t]; const r = n < t, [i, a, o] = r ? me(n, t, e) : me(t, n, e); if (!(a >= i)) return []; const s = a - i + 1, l = new Array(s); if (r) if (o < 0) for (let u = 0; u < s; ++u) l[u] = (a - u) / -o; else for (let u = 0; u < s; ++u) l[u] = (a - u) * o; else if (o < 0) for (let u = 0; u < s; ++u) l[u] = (i + u) / -o; else for (let u = 0; u < s; ++u) l[u] = (i + u) * o; return l; } function Mr(t, n, e) { return n = +n, t = +t, e = +e, me(t, n, e)[2]; } function dl(t, n, e) { n = +n, t = +t, e = +e; const r = n < t, i = r ? Mr(n, t, e) : Mr(t, n, e); return (r ? -1 : 1) * (i < 0 ? 1 / -i : i); } var gl = { value: () => { } }; function Co() { for (var t = 0, n = arguments.length, e = {}, r; t < n; ++t) { if (!(r = arguments[t] + "") || r in e || /[\s.]/.test(r)) throw new Error("illegal type: " + r); e[r] = []; } return new le(e); } function le(t) { this._ = t; } function _l(t, n) { return t.trim().split(/^|\s+/).map(function(e) { var r = "", i = e.indexOf("."); if (i >= 0 && (r = e.slice(i + 1), e = e.slice(0, i)), e && !n.hasOwnProperty(e)) throw new Error("unknown type: " + e); return { type: e, name: r }; }); } le.prototype = Co.prototype = { constructor: le, on: function(t, n) { var e = this._, r = _l(t + "", e), i, a = -1, o = r.length; if (arguments.length < 2) { for (; ++a < o; ) if ((i = (t = r[a]).type) && (i = yl(e[i], t.name))) return i; return; } if (n != null && typeof n != "function") throw new Error("invalid callback: " + n); for (; ++a < o; ) if (i = (t = r[a]).type) e[i] = Vi(e[i], t.name, n); else if (n == null) for (i in e) e[i] = Vi(e[i], t.name, null); return this; }, copy: function() { var t = {}, n = this._; for (var e in n) t[e] = n[e].slice(); return new le(t); }, call: function(t, n) { if ((i = arguments.length - 2) > 0) for (var e = new Array(i), r = 0, i, a; r < i; ++r) e[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(n, e); }, apply: function(t, n, e) { 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(n, e); } }; function yl(t, n) { for (var e = 0, r = t.length, i; e < r; ++e) if ((i = t[e]).name === n) return i.value; } function Vi(t, n, e) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === n) { t[r] = gl, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return e != null && t.push({ name: n, value: e }), t; } var $r = "http://www.w3.org/1999/xhtml"; const Ki = { svg: "http://www.w3.org/2000/svg", 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 Fe(t) { var n = t += "", e = n.indexOf(":"); return e >= 0 && (n = t.slice(0, e)) !== "xmlns" && (t = t.slice(e + 1)), Ki.hasOwnProperty(n) ? { space: Ki[n], local: t } : t; } function vl(t) { return function() { var n = this.ownerDocument, e = this.namespaceURI; return e === $r && n.documentElement.namespaceURI === $r ? n.createElement(t) : n.createElementNS(e, t); }; } function ml(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function Io(t) { var n = Fe(t); return (n.local ? ml : vl)(n); } function wl() { } function ui(t) { return t == null ? wl : function() { return this.querySelector(t); }; } function bl(t) { typeof t != "function" && (t = ui(t)); for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i) for (var a = n[i], o = a.length, s = r[i] = new Array(o), l, u, c = 0; c < o; ++c) (l = a[c]) && (u = t.call(l, l.__data__, c, a)) && ("__data__" in l && (u.__data__ = l.__data__), s[c] = u); return new F(r, this._parents); } function xl(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function Ml() { return []; } function Ro(t) { return t == null ? Ml : function() { return this.querySelectorAll(t); }; } function $l(t) { return function() { return xl(t.apply(this, arguments)); }; } function Al(t) { typeof t == "function" ? t = $l(t) : t = Ro(t); for (var n = this._groups, e = n.length, r = [], i = [], a = 0; a < e; ++a) for (var o = n[a], s = o.length, l, u = 0; u < s; ++u) (l = o[u]) && (r.push(t.call(l, l.__data__, u, o)), i.push(l)); return new F(r, i); } function qo(t) { return function() { return this.matches(t); }; } function jo(t) { return function(n) { return n.matches(t); }; } var kl = Array.prototype.find; function Tl(t) { return function() { return kl.call(this.children, t); }; } function Nl() { return this.firstElementChild; } function Sl(t) { return this.select(t == null ? Nl : Tl(typeof t == "function" ? t : jo(t))); } var Pl = Array.prototype.filter; function El() { return Array.from(this.children); } function zl(t) { return function() { return Pl.call(this.children, t); }; } function Ol(t) { return this.selectAll(t == null ? El : zl(typeof t == "function" ? t : jo(t))); } function Cl(t) { typeof t != "function" && (t = qo(t)); for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i) for (var a = n[i], o = a.length, s = r[i] = [], l, u = 0; u < o; ++u) (l = a[u]) && t.call(l, l.__data__, u, a) && s.push(l); return new F(r, this._parents); } function Lo(t) { return new Array(t.length); } function Il() { return new F(this._enter || this._groups.map(Lo), this._parents); } function we(t, n) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = n; } we.prototype = { constructor: we, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, insertBefore: function(t, n) { return this._parent.insertBefore(t, n); }, querySelector: function(t) { return this._parent.querySelector(t); }, querySelectorAll: function(t) { return this._parent.querySelectorAll(t); } }; function Rl(t) { return function() { return t; }; } function ql(t, n, e, r, i, a) { for (var o = 0, s, l = n.length, u = a.length; o < u; ++o) (s = n[o]) ? (s.__data__ = a[o], r[o] = s) : e[o] = new we(t, a[o]); for (; o < l; ++o) (s = n[o]) && (i[o] = s); } function jl(t, n, e, r, i, a, o) { var s, l, u = /* @__PURE__ */ new Map(), c = n.length, h = a.length, f = new Array(c), p; for (s = 0; s < c; ++s) (l = n[s]) && (f[s] = p = o.call(l, l.__data__, s, n) + "", u.has(p) ? i[s] = l : u.set(p, l)); for (s = 0; s < h; ++s) p = o.call(t, a[s], s, a) + "", (l = u.get(p)) ? (r[s] = l, l.__data__ = a[s], u.delete(p)) : e[s] = new we(t, a[s]); for (s = 0; s < c; ++s) (l = n[s]) && u.get(f[s]) === l && (i[s] = l); } function Ll(t) { return t.__data__; } function Fl(t, n) { if (!arguments.length) return Array.from(this, Ll); var e = n ? jl : ql, r = this._parents, i = this._groups; typeof t != "function" && (t = Rl(t)); for (var a = i.length, o = new Array(a), s = new Array(a), l = new Array(a), u = 0; u < a; ++u) { var c = r[u], h = i[u], f = h.length, p = Dl(t.call(c, c && c.__data__, u, r)), d = p.length, _ = s[u] = new Array(d), m = o[u] = new Array(d), M = l[u] = new Array(f); e(c, h, _, m, M, p, n); for (var b = 0, x = 0, g, v; b < d; ++b) if (g = _[b]) { for (b >= x && (x = b + 1); !(v = m[x]) && ++x < d; ) ; g._next = v || null; } } return o = new F(o, r), o._enter = s, o._exit = l, o; } function Dl(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } function Hl() { return new F(this._exit || this._groups.map(Lo), this._parents); } function Xl(t, n, e) { var r = this.enter(), i = this, a = this.exit(); return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), n != null && (i = n(i), i && (i = i.selection())), e == null ? a.remove() : e(a), r && i ? r.merge(i).order() : i; } function Bl(t) { for (var n = t.selection ? t.selection() : t, e = this._groups, r = n._groups, i = e.length, a = r.length, o = Math.min(i, a), s = new Array(i), l = 0; l < o; ++l) for (var u = e[l], c = r[l], h = u.length, f = s[l] = new Array(h), p, d = 0; d < h; ++d) (p = u[d] || c[d]) && (f[d] = p); for (; l < i; ++l) s[l] = e[l]; return new F(s, this._parents); } function Ul() { for (var t = this._groups, n = -1, e = t.length; ++n < e; ) for (var r = t[n], 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 Gl(t) { t || (t = Yl); function n(h, f) { return h && f ? t(h.__data__, f.__data__) : !h - !f; } for (var e = this._groups, r = e.length, i = new Array(r), a = 0; a < r; ++a) { for (var o = e[a], s = o.length, l = i[a] = new Array(s), u, c = 0; c < s; ++c) (u = o[c]) && (l[c] = u); l.sort(n); } return new F(i, this._parents).order(); } function Yl(t, n) { return t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN; } function Vl() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } function Kl() { return Array.from(this); } function Wl() { for (var t = this._groups, n = 0, e = t.length; n < e; ++n) for (var r = t[n], i = 0, a = r.length; i < a; ++i) { var o = r[i]; if (o) return o; } return null; } function Zl() { let t = 0; for (const n of this) ++t; return t; } function Jl() { return !this.node(); } function Ql(t) { for (var n = this._groups, e = 0, r = n.length; e < r; ++e) for (var i = n[e], a = 0, o = i.length, s; a < o; ++a) (s = i[a]) && t.call(s, s.__data__, a, i); return this; } function tc(t) { return function() { this.removeAttribute(t); }; } function nc(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function ec(t, n) { return function() { this.setAttribute(t, n); }; } function rc(t, n) { return function() { this.setAttributeNS(t.space, t.local, n); }; } function ic(t, n) { return function() { var e = n.apply(this, arguments); e == null ? this.removeAttribute(t) : this.setAttribute(t, e); }; } function ac(t, n) { return function() { var e = n.apply(this, arguments); e == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, e); }; } function oc(t, n) { var e = Fe(t); if (arguments.length < 2) { var r = this.node(); return e.local ? r.getAttributeNS(e.space, e.local) : r.getAttribute(e); } return this.each((n == null ? e.local ? nc : tc : typeof n == "function" ? e.local ? ac : ic : e.local ? rc : ec)(e, n)); } function Fo(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function sc(t) { return function() { this.style.removeProperty(t); }; } function uc(t, n, e) { return function() { this.style.setProperty(t, n, e); }; } function lc(t, n, e) { return function() { var r = n.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, e); }; } function cc(t, n, e) { return arguments.length > 1 ? this.each((n == null ? sc : typeof n == "function" ? lc : uc)(t, n, e ?? "")) : rn(this.node(), t); } function rn(t, n) { return t.style.getPropertyValue(n) || Fo(t).getComputedStyle(t, null).getPropertyValue(n); } function fc(t) { return function() { delete this[t]; }; } function hc(t, n) { return function() { this[t] = n; }; } function pc(t, n) { return function() { var e = n.apply(this, arguments); e == null ? delete this[t] : this[t] = e; }; } function dc(t, n) { return arguments.length > 1 ? this.each((n == null ? fc : typeof n == "function" ? pc : hc)(t, n)) : this.node()[t]; } function Do(t) { return t.trim().split(/^|\s+/); } function li(t) { return t.classList || new Ho(t); } function Ho(t) { this._node = t, this._names = Do(t.getAttribute("class") || ""); } Ho.prototype = { add: function(t) { var n = this._names.indexOf(t); n < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" "))); }, remove: function(t) { var n = this._names.indexOf(t); n >= 0 && (this._names.splice(n, 1), this._node.setAttribute("class", this._names.join(" "))); }, contains: function(t) { return this._names.indexOf(t) >= 0; } }; function Xo(t, n) { for (var e = li(t), r = -1, i = n.length; ++r < i; ) e.add(n[r]); } function Bo(t, n) { for (var e = li(t), r = -1, i = n.length; ++r < i; ) e.remove(n[r]); } function gc(t) { return function() { Xo(this, t); }; } function _c(t) { return function() { Bo(this, t); }; } function yc(t, n) { return function() { (n.apply(this, arguments) ? Xo : Bo)(this, t); }; } function vc(t, n) { var e = Do(t + ""); if (arguments.length < 2) { for (var r = li(this.node()), i = -1, a = e.length; ++i < a; ) if (!r.contains(e[i])) return !1; return !0; } return this.each((typeof n == "function" ? yc : n ? gc : _c)(e, n)); } function mc() { this.textContent = ""; } function wc(t) { return function() { this.textContent = t; }; } function bc(t) { return function() { var n = t.apply(this, arguments); this.textContent = n ?? ""; }; } function xc(t) { return arguments.length ? this.each(t == null ? mc : (typeof t == "function" ? bc : wc)(t)) : this.node().textContent; } function Mc() { this.innerHTML = ""; } function $c(t) { return function() { this.innerHTML = t; }; } function Ac(t) { return function() { var n = t.apply(this, arguments); this.innerHTML = n ?? ""; }; } function kc(t) { return arguments.length ? this.each(t == null ? Mc : (typeof t == "function" ? Ac : $c)(t)) : this.node().innerHTML; } function Tc() { this.nextSibling && this.parentNode.appendChild(this); } function Nc() { return this.each(Tc); } function Sc() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function Pc() { return this.each(Sc); } function Ec(t) { var n = typeof t == "function" ? t : Io(t); return this.select(function() { return this.appendChild(n.apply(this, arguments)); }); } function zc() { return null; } function Oc(t, n) { var e = typeof t == "function" ? t : Io(t), r = n == null ? zc : typeof n == "function" ? n : ui(n); return this.select(function() { return this.insertBefore(e.apply(this, arguments), r.apply(this, arguments) || null); }); } function Cc() { var t = this.parentNode; t && t.removeChild(this); } function Ic() { return this.each(Cc); } function Rc() { var t = this.cloneNode(!1), n = this.parentNode; return n ? n.insertBefore(t, this.nextSibling) : t; } function qc() { var t = this.cloneNode(!0), n = this.parentNode; return n ? n.insertBefore(t, this.nextSibling) : t; } function jc(t) { return this.select(t ? qc : Rc); } function Lc(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } function Fc(t) { return function(n) { t.call(this, n, this.__data__); }; } function Dc(t) { return t.trim().split(/^|\s+/).map(function(n) { var e = "", r = n.indexOf("."); return r >= 0 && (e = n.slice(r + 1), n = n.slice(0, r)), { type: n, name: e }; }); } function Hc(t) { return function() { var n = this.__on; if (n) { for (var e = 0, r = -1, i = n.length, a; e < i; ++e) a = n[e], (!t.type || a.type === t.type) && a.name === t.name ? this.removeEventListener(a.type, a.listener, a.options) : n[++r] = a; ++r ? n.length = r : delete this.__on; } }; } function Xc(t, n, e) { return function() { var r = this.__on, i, a = Fc(n); 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 = e), i.value = n; return; } } this.addEventListener(t.type, a, e), i = { type: t.type, name: t.name, value: n, listener: a, options: e }, r ? r.push(i) : this.__on = [i]; }; } function Bc(t, n, e) { var r = Dc(t + ""), i, a = r.length, o; if (arguments.length < 2) { var s = this.node().__on; if (s) { for (var l = 0, u = s.length, c; l < u; ++l) for (i = 0, c = s[l]; i < a; ++i) if ((o = r[i]).type === c.type && o.name === c.name) return c.value; } return; } for (s = n ? Xc : Hc, i = 0; i < a; ++i) this.each(s(r[i], n, e)); return this; } function Uo(t, n, e) { var r = Fo(t), i = r.CustomEvent; typeof i == "function" ? i = new i(n, e) : (i = r.document.createEvent("Event"), e ? (i.initEvent(n, e.bubbles, e.cancelable), i.detail = e.detail) : i.initEvent(n, !1, !1)), t.dispatchEvent(i); } function Uc(t, n) { return function() { return Uo(this, t, n); }; } function Gc(t, n) { return function() { return Uo(this, t, n.apply(this, arguments)); }; } function Yc(t, n) { return this.each((typeof n == "function" ? Gc : Uc)(t, n)); } function* Vc() { for (var t = this._groups, n = 0, e = t.length; n < e; ++n) for (var r = t[n], i = 0, a = r.length, o; i < a; ++i) (o = r[i]) && (yield o); } var Go = [null]; function F(t, n) { this._groups = t, this._parents = n; } function Fn() { return new F([[document.documentElement]], Go); } function Kc() { return this; } F.prototype = Fn.prototype = { constructor: F, select: bl, selectAll: Al, selectChild: Sl, selectChildren: Ol, filter: Cl, data: Fl, enter: Il, exit: Hl, join: Xl, merge: Bl, selection: Kc, order: Ul, sort: Gl, call: Vl, nodes: Kl, node: Wl, size: Zl, empty: Jl, each: Ql, attr: oc, style: cc, property: dc, classed: vc, text: xc, html: kc, raise: Nc, lower: Pc, append: Ec, insert: Oc, remove: Ic, clone: jc, datum: Lc, on: Bc, dispatch: Yc, [Symbol.iterator]: Vc }; function Wc(t) { return typeof t == "string" ? new F([[document.querySelector(t)]], [document.documentElement]) : new F([[t]], Go); } function ci(t, n, e) { t.prototype = n.prototype = e, e.constructor = t; } function Yo(t, n) { var e = Object.create(t.prototype); for (var r in n) e[r] = n[r]; return e; } function Dn() { } var Tn = 0.7, be = 1 / Tn, tn = "\\s*([+-]?\\d+)\\s*", Nn = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", rt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Zc = /^#([0-9a-f]{3,8})$/, Jc = new RegExp(`^rgb\\(${tn},${tn},${tn}\\)$`), Qc = new RegExp(`^rgb\\(${rt},${rt},${rt}\\)$`), tf = new RegExp(`^rgba\\(${tn},${tn},${tn},${Nn}\\)$`), nf = new RegExp(`^rgba\\(${rt},${rt},${rt},${Nn}\\)$`), ef = new RegExp(`^hsl\\(${Nn},${rt},${rt}\\)$`), rf = new RegExp(`^hsla\\(${Nn},${rt},${rt},${Nn}\\)$`), Wi = { 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 }; ci(Dn, qt, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, hex: Zi, // Deprecated! Use color.formatHex. formatHex: Zi, formatHex8: af, formatHsl: of, formatRgb: Ji, toString: Ji }); function Zi() { return this.rgb().formatHex(); } function af() { return this.rgb().formatHex8(); } function of() { return Vo(this).formatHsl(); } function Ji() { return this.rgb().formatRgb(); } function qt(t) { var n, e; return t = (t + "").trim().toLowerCase(), (n = Zc.exec(t)) ? (e = n[1].length, n = parseInt(n[1], 16), e === 6 ? Qi(n) : e === 3 ? new R(n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, (n & 15) << 4 | n & 15, 1) : e === 8 ? Kn(n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, (n & 255) / 255) : e === 4 ? Kn(n >> 12 & 15 | n >> 8 & 240, n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, ((n & 15) << 4 | n & 15) / 255) : null) : (n = Jc.exec(t)) ? new R(n[1], n[2], n[3], 1) : (n = Qc.exec(t)) ? new R(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, 1) : (n = tf.exec(t)) ? Kn(n[1], n[2], n[3], n[4]) : (n = nf.exec(t)) ? Kn(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, n[4]) : (n = ef.exec(t)) ? ea(n[1], n[2] / 100, n[3] / 100, 1) : (n = rf.exec(t)) ? ea(n[1], n[2] / 100, n[3] / 100, n[4]) : Wi.hasOwnProperty(t) ? Qi(Wi[t]) : t === "transparent" ? new R(NaN, NaN, NaN, 0) : null; } function Qi(t) { return new R(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } function Kn(t, n, e, r) { return r <= 0 && (t = n = e = NaN), new R(t, n, e, r); } function sf(t) { return t instanceof Dn || (t = qt(t)), t ? (t = t.rgb(), new R(t.r, t.g, t.b, t.opacity)) : new R(); } function Ar(t, n, e, r) { return arguments.length === 1 ? sf(t) : new R(t, n, e, r ?? 1); } function R(t, n, e, r) { this.r = +t, this.g = +n, this.b = +e, this.opacity = +r; } ci(R, Ar, Yo(Dn, { brighter(t) { return t = t == null ? be : Math.pow(be, t), new R(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { return t = t == null ? Tn : Math.pow(Tn, t), new R(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { return new R(It(this.r), It(this.g), It(this.b), xe(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: ta, // Deprecated! Use color.formatHex. formatHex: ta, formatHex8: uf, formatRgb: na, toString: na })); function ta() { return `#${zt(this.r)}${zt(this.g)}${zt(this.b)}`; } function uf() { return `#${zt(this.r)}${zt(this.g)}${zt(this.b)}${zt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function na() { const t = xe(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${It(this.r)}, ${It(this.g)}, ${It(this.b)}${t === 1 ? ")" : `, ${t})`}`; } function xe(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function It(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } function zt(t) { return t = It(t), (t < 16 ? "0" : "") + t.toString(16); } function ea(t, n, e, r) { return r <= 0 ? t = n = e = NaN : e <= 0 || e >= 1 ? t = n = NaN : n <= 0 && (t = NaN), new Z(t, n, e, r); } function Vo(t) { if (t instanceof Z) return new Z(t.h, t.s, t.l, t.opacity); if (t instanceof Dn || (t = qt(t)), !t) return new Z(); if (t instanceof Z) return t; t = t.rgb(); var n = t.r / 255, e = t.g / 255, r = t.b / 255, i = Math.min(n, e, r), a = Math.max(n, e, r), o = NaN, s = a - i, l = (a + i) / 2; return s ? (n === a ? o = (e - r) / s + (e < r) * 6 : e === a ? o = (r - n) / s + 2 : o = (n - e) / s + 4, s /= l < 0.5 ? a + i : 2 - a - i, o *= 60) : s = l > 0 && l < 1 ? 0 : o, new Z(o, s, l, t.opacity); } function lf(t, n, e, r) { return arguments.length === 1 ? Vo(t) : new Z(t, n, e, r ?? 1); } function Z(t, n, e, r) { this.h = +t, this.s = +n, this.l = +e, this.opacity = +r; } ci(Z, lf, Yo(Dn, { brighter(t) { return t = t == null ? be : Math.pow(be, t), new Z(this.h, this.s, this.l * t, this.opacity); }, darker(t) { return t = t == null ? Tn : Math.pow(Tn, t), new Z(this.h, this.s, this.l * t, this.opacity); }, rgb() { var t = this.h % 360 + (this.h < 0) * 360, n = isNaN(t) || isNaN(this.s) ? 0 : this.s, e = this.l, r = e + (e < 0.5 ? e : 1 - e) * n, i = 2 * e - r; return new R( 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 Z(ra(this.h), Wn(this.s), Wn(this.l), xe(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 = xe(this.opacity); return `${t === 1 ? "hsl(" : "hsla("}${ra(this.h)}, ${Wn(this.s) * 100}%, ${Wn(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function ra(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } function Wn(t) { return Math.max(0, Math.min(1, t || 0)); } function cr(t, n, e) { return (t < 60 ? n + (e - n) * t / 60 : t < 180 ? e : t < 240 ? n + (e - n) * (240 - t) / 60 : n) * 255; } const fi = (t) => () => t; function cf(t, n) { return function(e) { return t + e * n; }; } function ff(t, n, e) { return t = Math.pow(t, e), n = Math.pow(n, e) - t, e = 1 / e, function(r) { return Math.pow(t + r * n, e); }; } function hf(t) { return (t = +t) == 1 ? Ko : function(n, e) { return e - n ? ff(n, e, t) : fi(isNaN(n) ? e : n); }; } function Ko(t, n) { var e = n - t; return e ? cf(t, e) : fi(isNaN(t) ? n : t); } const Me = function t(n) { var e = hf(n); function r(i, a) { var o = e((i = Ar(i)).r, (a = Ar(a)).r), s = e(i.g, a.g), l = e(i.b, a.b), u = Ko(i.opacity, a.opacity); return function(c) { return i.r = o(c), i.g = s(c), i.b = l(c), i.opacity = u(c), i + ""; }; } return r.gamma = t, r; }(1); function pf(t, n) { n || (n = []); var e = t ? Math.min(n.length, t.length) : 0, r = n.slice(), i; return function(a) { for (i = 0; i < e; ++i) r[i] = t[i] * (1 - a) + n[i] * a; return r; }; } function df(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } function gf(t, n) { var e = n ? n.length : 0, r = t ? Math.min(e, t.length) : 0, i = new Array(r), a = new Array(e), o; for (o = 0; o < r; ++o) i[o] = hi(t[o], n[o]); for (; o < e; ++o) a[o] = n[o]; return function(s) { for (o = 0; o < r; ++o) a[o] = i[o](s); return a; }; } function _f(t, n) { var e = /* @__PURE__ */ new Date(); return t = +t, n = +n, function(r) { return e.setTime(t * (1 - r) + n * r), e; }; } function K(t, n) { return t = +t, n = +n, function(e) { return t * (1 - e) + n * e; }; } function yf(t, n) { var e = {}, r = {}, i; (t === null || typeof t != "object") && (t = {}), (n === null || typeof n != "object") && (n = {}); for (i in n) i in t ? e[i] = hi(t[i], n[i]) : r[i] = n[i]; return function(a) { for (i in e) r[i] = e[i](a); return r; }; } var kr = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, fr = new RegExp(kr.source, "g"); function vf(t) { return function() { return t; }; } function mf(t) { return function(n) { return t(n) + ""; }; } function Wo(t, n) { var e = kr.lastIndex = fr.lastIndex = 0, r, i, a, o = -1, s = [], l = []; for (t = t + "", n = n + ""; (r = kr.exec(t)) && (i = fr.exec(n)); ) (a = i.index) > e && (a = n.slice(e, 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: K(r, i) })), e = fr.lastIndex; return e < n.length && (a = n.slice(e), s[o] ? s[o] += a : s[++o] = a), s.length < 2 ? l[0] ? mf(l[0].x) : vf(n) : (n = l.length, function(u) { for (var c = 0, h; c < n; ++c) s[(h = l[c]).i] = h.x(u); return s.join(""); }); } function hi(t, n) { var e = typeof n, r; return n == null || e === "boolean" ? fi(n) : (e === "number" ? K : e === "string" ? (r = qt(n)) ? (n = r, Me) : Wo : n instanceof qt ? Me : n instanceof Date ? _f : df(n) ? pf : Array.isArray(n) ? gf : typeof n.valueOf != "function" && typeof n.toString != "function" || isNaN(n) ? yf : K)(t, n); } function wf(t, n) { return t = +t, n = +n, function(e) { return Math.round(t * (1 - e) + n * e); }; } var ia = 180 / Math.PI, Tr = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function Zo(t, n, e, r, i, a) { var o, s, l; return (o = Math.sqrt(t * t + n * n)) && (t /= o, n /= o), (l = t * e + n * r) && (e -= t * l, r -= n * l), (s = Math.sqrt(e * e + r * r)) && (e /= s, r /= s, l /= s), t * r < n * e && (t = -t, n = -n, l = -l, o = -o), { translateX: i, translateY: a, rotate: Math.atan2(n, t) * ia, skewX: Math.atan(l) * ia, scaleX: o, scaleY: s }; } var Zn; function bf(t) { const n = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); return n.isIdentity ? Tr : Zo(n.a, n.b, n.c, n.d, n.e, n.f); } function xf(t) { return t == null || (Zn || (Zn = document.createElementNS("http://www.w3.org/2000/svg", "g")), Zn.setAttribute("transform", t), !(t = Zn.transform.baseVal.consolidate())) ? Tr : (t = t.matrix, Zo(t.a, t.b, t.c, t.d, t.e, t.f)); } function Jo(t, n, e, r) { function i(u) { return u.length ? u.pop() + " " : ""; } function a(u, c, h, f, p, d) { if (u !== h || c !== f) { var _ = p.push("translate(", null, n, null, e); d.push({ i: _ - 4, x: K(u, h) }, { i: _ - 2, x: K(c, f) }); } else (h || f) && p.push("translate(" + h + n + f + e); } function o(u, c, h, f) { u !== c ? (u - c > 180 ? c += 360 : c - u > 180 && (u += 360), f.push({ i: h.push(i(h) + "rotate(", null, r) - 2, x: K(u, c) })) : c && h.push(i(h) + "rotate(" + c + r); } function s(u, c, h, f) { u !== c ? f.push({ i: h.push(i(h) + "skewX(", null, r) - 2, x: K(u, c) }) : c && h.push(i(h) + "skewX(" + c + r); } function l(u, c, h, f, p, d) { if (u !== h || c !== f) { var _ = p.push(i(p) + "scale(", null, ",", null, ")"); d.push({ i: _ - 4, x: K(u, h) }, { i: _ - 2, x: K(c, f) }); } else (h !== 1 || f !== 1) && p.push(i(p) + "scale(" + h + "," + f + ")"); } return function(u, c) { var h = [], f = []; return u = t(u), c = t(c), a(u.translateX, u.translateY, c.translateX, c.translateY, h, f), o(u.rotate, c.rotate, h, f), s(u.skewX, c.skewX, h, f), l(u.scaleX, u.scaleY, c.scaleX, c.scaleY, h, f), u = c = null, function(p) { for (var d = -1, _ = f.length, m; ++d < _; ) h[(m = f[d]).i] = m.x(p); return h.join(""); }; }; } var Mf = Jo(bf, "px, ", "px)", "deg)"), $f = Jo(xf, ", ", ")", ")"), an = 0, mn = 0, gn = 0, Qo = 1e3, $e, wn, Ae = 0, jt = 0, De = 0, Sn = typeof performance == "object" && performance.now ? performance : Date, ts = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function He() { return jt || (ts(Af), jt = Sn.now() + De); } function Af() { jt = 0; } function Pn() { this._call = this._time = this._next = null; } Pn.prototype = ns.prototype = { constructor: Pn, restart: function(t, n, e) { if (typeof t != "function") throw new TypeError("callback is not a function"); e = (e == null ? He() : +e) + (n == null ? 0 : +n), !this._next && wn !== this && (wn ? wn._next = this : $e = this, wn = this), this._call = t, this._time = e, Nr(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, Nr()); } }; function ns(t, n, e) { var r = new Pn(); return r.restart(t, n, e), r; } function kf() { He(), ++an; for (var t = $e, n; t; ) (n = jt - t._time) >= 0 && t._call.call(void 0, n), t = t._next; --an; } function aa() { jt = (Ae = Sn.now()) + De, an = mn = 0; try { kf(); } finally { an = 0, Nf(), jt = 0; } } function Tf() { var t = Sn.now(), n = t - Ae; n > Qo && (De -= n, Ae = t); } function Nf() { for (var t, n = $e, e, r = 1 / 0; n; ) n._call ? (r > n._time && (r = n._time), t = n, n = n._next) : (e = n._next, n._next = null, n = t ? t._next = e : $e = e); wn = t, Nr(r); } function Nr(t) { if (!an) { mn && (mn = clearTimeout(mn)); var n = t - jt; n > 24 ? (t < 1 / 0 && (mn = setTimeout(aa, t - Sn.now() - De)), gn && (gn = clearInterval(gn))) : (gn || (Ae = Sn.now(), gn = setInterval(Tf, Qo)), an = 1, ts(aa)); } } function oa(t, n, e) { var r = new Pn(); return n = n == null ? 0 : +n, r.restart((i) => { r.stop(), t(i + n); }, n, e), r; } function Sf(t, n, e) { var r = new Pn(), i = n; return r._restart = r.restart, r.restart = function(a, o, s) { o = +o, s = s == null ? He() : +s, r._restart(function l(u) { u += i, r._restart(l, i += o, s), a(u); }, o, s); }, r.restart(t, n, e), r; } var Pf = Co("start", "end", "cancel", "interrupt"), Ef = [], es = 0, sa = 1, Sr = 2, ce = 3, ua = 4, Pr = 5, fe = 6; function Xe(t, n, e, r, i, a) { var o = t.__transition; if (!o) t.__transition = {}; else if (e in o) return; zf(t, e, { name: n, index: r, // For context during callback. group: i, // For context during callback. on: Pf, tween: Ef, time: a.time, delay: a.delay, duration: a.duration, ease: a.ease, timer: null, state: es }); } function pi(t, n) { var e = tt(t, n); if (e.state > es) throw new Error("too late; already scheduled"); return e; } function ot(t, n) { var e = tt(t, n); if (e.state > ce) throw new Error("too late; already running"); return e; } function tt(t, n) { var e = t.__transition; if (!e || !(e = e[n])) throw new Error("transition not found"); return e; } function zf(t, n, e) { var r = t.__transition, i; r[n] = e, e.timer = ns(a, 0, e.time); function a(u) { e.state = sa, e.timer.restart(o, e.delay, e.time), e.delay <= u && o(u - e.delay); } function o(u) { var c, h, f, p; if (e.state !== sa) return l(); for (c in r) if (p = r[c], p.name === e.name) { if (p.state === ce) return oa(o); p.state === ua ? (p.state = fe, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[c]) : +c < n && (p.state = fe, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[c]); } if (oa(function() { e.state === ce && (e.state = ua, e.timer.restart(s, e.delay, e.time), s(u)); }), e.state = Sr, e.on.call("start", t, t.__data__, e.index, e.group), e.state === Sr) { for (e.state = ce, i = new Array(f = e.tween.length), c = 0, h = -1; c < f; ++c) (p = e.tween[c].value.call(t, t.__data__, e.index, e.group)) && (i[++h] = p); i.length = h + 1; } } function s(u) { for (var c = u < e.duration ? e.ease.call(null, u / e.duration) : (e.timer.restart(l), e.state = Pr, 1), h = -1, f = i.length; ++h < f; ) i[h].call(t, c); e.state === Pr && (e.on.call("end", t, t.__data__, e.index, e.group), l()); } function l() { e.state = fe, e.timer.stop(), delete r[n]; for (var u in r) return; delete t.__transition; } } function Of(t, n) { var e = t.__transition, r, i, a = !0, o; if (e) { n = n == null ? null : n + ""; for (o in e) { if ((r = e[o]).name !== n) { a = !1; continue; } i = r.state > Sr && r.state < Pr, r.state = fe, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete e[o]; } a && delete t.__transition; } } function Cf(t) { return this.each(function() { Of(this, t); }); } function If(t, n) { var e, r; return function() { var i = ot(this, t), a = i.tween; if (a !== e) { r = e = a; for (var o = 0, s = r.length; o < s; ++o) if (r[o].name === n) { r = r.slice(), r.splice(o, 1); break; } } i.tween = r; }; } function Rf(t, n, e) { var r, i; if (typeof e != "function") throw new Error(); return function() { var a = ot(this, t), o = a.tween; if (o !== r) { i = (r = o).slice(); for (var s = { name: n, value: e }, l = 0, u = i.length; l < u; ++l) if (i[l].name === n) { i[l] = s; break; } l === u && i.push(s); } a.tween = i; }; } function qf(t, n) { var e = this._id; if (t += "", arguments.length < 2) { for (var r = tt(this.node(), e).tween, i = 0, a = r.length, o; i < a; ++i) if ((o = r[i]).name === t) return o.value; return null; } return this.each((n == null ? If : Rf)(e, t, n)); } function di(t, n, e) { var r = t._id; return t.each(function() { var i = ot(this, r); (i.value || (i.value = {}))[n] = e.apply(this, arguments); }), function(i) { return tt(i, r).value[n]; }; } function rs(t, n) { var e; return (typeof n == "number" ? K : n instanceof qt ? Me : (e = qt(n)) ? (n = e, Me) : Wo)(t, n); } function jf(t) { return function() { this.removeAttribute(t); }; } function Lf(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function Ff(t, n, e) { var r, i = e + "", a; return function() { var o = this.getAttribute(t); return o === i ? null : o === r ? a : a = n(r = o, e); }; } function Df(t, n, e) { var r, i = e + "", a; return function() { var o = this.getAttributeNS(t.space, t.local); return o === i ? null : o === r ? a : a = n(r = o, e); }; } function Hf(t, n, e) { var r, i, a; return function() { var o, s = e(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 = n(r = o, s))); }; } function Xf(t, n, e) { var r, i, a; return function() { var o, s = e(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 = n(r = o, s))); }; } function Bf(t, n) { var e = Fe(t), r = e === "transform" ? $f : rs; return this.attrTween(t, typeof n == "function" ? (e.local ? Xf : Hf)(e, r, di(this, "attr." + t, n)) : n == null ? (e.local ? Lf : jf)(e) : (e.local ? Df : Ff)(e, r, n)); } function Uf(t, n) { return function(e) { this.setAttribute(t, n.call(this, e)); }; } function Gf(t, n) { return function(e) { this.setAttributeNS(t.space, t.local, n.call(this, e)); }; } function Yf(t, n) { var e, r; function i() { var a = n.apply(this, arguments); return a !== r && (e = (r = a) && Gf(t, a)), e; } return i._value = n, i; } function Vf(t, n) { var e, r; function i() { var a = n.apply(this, arguments); return a !== r && (e = (r = a) && Uf(t, a)), e; } return i._value = n, i; } function Kf(t, n) { var e = "attr." + t; if (arguments.length < 2) return (e = this.tween(e)) && e._value; if (n == null) return this.tween(e, null); if (typeof n != "function") throw new Error(); var r = Fe(t); return this.tween(e, (r.local ? Yf : Vf)(r, n)); } function Wf(t, n) { return function() { pi(this, t).delay = +n.apply(this, arguments); }; } function Zf(t, n) { return n = +n, function() { pi(this, t).delay = n; }; } function Jf(t) { var n = this._id; return arguments.length ? this.each((typeof t == "function" ? Wf : Zf)(n, t)) : tt(this.node(), n).delay; } function Qf(t, n) { return function() { ot(this, t).duration = +n.apply(this, arguments); }; } function th(t, n) { return n = +n, function() { ot(this, t).duration = n; }; } function nh(t) { var n = this._id; return arguments.length ? this.each((typeof t == "function" ? Qf : th)(n, t)) : tt(this.node(), n).duration; } function eh(t, n) { if (typeof n != "function") throw new Error(); return function() { ot(this, t).ease = n; }; } function rh(t) { var n = this._id; return arguments.length ? this.each(eh(n, t)) : tt(this.node(), n).ease; } function ih(t, n) { return function() { var e = n.apply(this, arguments); if (typeof e != "function") throw new Error(); ot(this, t).ease = e; }; } function ah(t) { if (typeof t != "function") throw new Error(); return this.each(ih(this._id, t)); } function oh(t) { typeof t != "function" && (t = qo(t)); for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i) for (var a = n[i], o = a.length, s = r[i] = [], l, u = 0; u < o; ++u) (l = a[u]) && t.call(l, l.__data__, u, a) && s.push(l); return new dt(r, this._parents, this._name, this._id); } function sh(t) { if (t._id !== this._id) throw new Error(); for (var n = this._groups, e = t._groups, r = n.length, i = e.length, a = Math.min(r, i), o = new Array(r), s = 0; s < a; ++s) for (var l = n[s], u = e[s], c = l.length, h = o[s] = new Array(c), f, p = 0; p < c; ++p) (f = l[p] || u[p])