UNPKG

dsg-gtimeline

Version:

Google-like timeline chart with DSG-specific enhancements

1,602 lines 134 kB
function se(t, e) { return t == null || e == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } function ri(t, e) { return t == null || e == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN; } function tn(t) { let e, n, r; t.length !== 2 ? (e = se, n = (u, c) => se(t(u), c), r = (u, c) => t(u) - c) : (e = t === se || t === ri ? t : ii, n = t, r = t); function i(u, c, s = 0, l = u.length) { if (s < l) { if (e(c, c) !== 0) return l; do { const f = s + l >>> 1; n(u[f], c) < 0 ? s = f + 1 : l = f; } while (s < l); } return s; } function o(u, c, s = 0, l = u.length) { if (s < l) { if (e(c, c) !== 0) return l; do { const f = s + l >>> 1; n(u[f], c) <= 0 ? s = f + 1 : l = f; } while (s < l); } return s; } function a(u, c, s = 0, l = u.length) { const f = i(u, c, s, l - 1); return f > s && r(u[f - 1], c) > -r(u[f], c) ? f - 1 : f; } return { left: i, center: a, right: o }; } function ii() { return 0; } function oi(t) { return t === null ? NaN : +t; } const ai = tn(se), si = ai.right; tn(oi).center; function ui(t, e) { let n, r; if (e === void 0) for (const i of t) i != null && (n === void 0 ? i >= i && (n = r = i) : (n > i && (n = i), r < i && (r = i))); else { let i = -1; for (let o of t) (o = e(o, ++i, t)) != null && (n === void 0 ? o >= o && (n = r = o) : (n > o && (n = o), r < o && (r = o))); } return [n, r]; } class $n extends Map { constructor(e, n = fi) { if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: n } }), e != null) for (const [r, i] of e) this.set(r, i); } get(e) { return super.get(kn(this, e)); } has(e) { return super.has(kn(this, e)); } set(e, n) { return super.set(ci(this, e), n); } delete(e) { return super.delete(li(this, e)); } } function kn({ _intern: t, _key: e }, n) { const r = e(n); return t.has(r) ? t.get(r) : n; } function ci({ _intern: t, _key: e }, n) { const r = e(n); return t.has(r) ? t.get(r) : (t.set(r, n), n); } function li({ _intern: t, _key: e }, n) { const r = e(n); return t.has(r) && (n = t.get(r), t.delete(r)), n; } function fi(t) { return t !== null && typeof t == "object" ? t.valueOf() : t; } const hi = Math.sqrt(50), di = Math.sqrt(10), gi = Math.sqrt(2); function he(t, e, n) { const r = (e - t) / Math.max(0, n), i = Math.floor(Math.log10(r)), o = r / Math.pow(10, i), a = o >= hi ? 10 : o >= di ? 5 : o >= gi ? 2 : 1; let u, c, s; return i < 0 ? (s = Math.pow(10, -i) / a, u = Math.round(t * s), c = Math.round(e * s), u / s < t && ++u, c / s > e && --c, s = -s) : (s = Math.pow(10, i) * a, u = Math.round(t / s), c = Math.round(e / s), u * s < t && ++u, c * s > e && --c), c < u && 0.5 <= n && n < 2 ? he(t, e, n * 2) : [u, c, s]; } function mi(t, e, n) { if (e = +e, t = +t, n = +n, !(n > 0)) return []; if (t === e) return [t]; const r = e < t, [i, o, a] = r ? he(e, t, n) : he(t, e, n); if (!(o >= i)) return []; const u = o - i + 1, c = new Array(u); if (r) if (a < 0) for (let s = 0; s < u; ++s) c[s] = (o - s) / -a; else for (let s = 0; s < u; ++s) c[s] = (o - s) * a; else if (a < 0) for (let s = 0; s < u; ++s) c[s] = (i + s) / -a; else for (let s = 0; s < u; ++s) c[s] = (i + s) * a; return c; } function Pe(t, e, n) { return e = +e, t = +t, n = +n, he(t, e, n)[2]; } function We(t, e, n) { e = +e, t = +t, n = +n; const r = e < t, i = r ? Pe(e, t, n) : Pe(t, e, n); return (r ? -1 : 1) * (i < 0 ? 1 / -i : i); } function cr(t, e) { let n; if (e === void 0) for (const r of t) r != null && (n < r || n === void 0 && r >= r) && (n = r); else { let r = -1; for (let i of t) (i = e(i, ++r, t)) != null && (n < i || n === void 0 && i >= i) && (n = i); } return n; } function pi(t, e) { let n; if (e === void 0) for (const r of t) r != null && (n > r || n === void 0 && r >= r) && (n = r); else { let r = -1; for (let i of t) (i = e(i, ++r, t)) != null && (n > i || n === void 0 && i >= i) && (n = i); } return n; } function yi(t, e, n) { t = +t, e = +e, n = (i = arguments.length) < 2 ? (e = t, t = 0, 1) : i < 3 ? 1 : +n; for (var r = -1, i = Math.max(0, Math.ceil((e - t) / n)) | 0, o = new Array(i); ++r < i; ) o[r] = t + r * n; return o; } function wi(t, e) { if (typeof t[Symbol.iterator] != "function") throw new TypeError("values is not iterable"); if (typeof e != "function") throw new TypeError("mapper is not a function"); return Array.from(t, (n, r) => e(n, r, t)); } function xi(t) { return t; } var Fe = 1, ue = 2, ze = 3, zt = 4, Tn = 1e-6; function vi(t) { return "translate(" + t + ",0)"; } function _i(t) { return "translate(0," + t + ")"; } function Mi(t) { return (e) => +t(e); } function bi(t, e) { return e = Math.max(0, t.bandwidth() - e * 2) / 2, t.round() && (e = Math.round(e)), (n) => +t(n) + e; } function $i() { return !this.__axis; } function en(t, e) { var n = [], r = null, i = null, o = 6, a = 6, u = 3, c = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, s = t === Fe || t === zt ? -1 : 1, l = t === zt || t === ue ? "x" : "y", f = t === Fe || t === ze ? vi : _i; function h(d) { var k = r ?? (e.ticks ? e.ticks.apply(e, n) : e.domain()), E = i ?? (e.tickFormat ? e.tickFormat.apply(e, n) : xi), Y = Math.max(o, 0) + u, L = e.range(), A = +L[0] + c, S = +L[L.length - 1] + c, p = (e.bandwidth ? bi : Mi)(e.copy(), c), b = d.selection ? d.selection() : d, g = b.selectAll(".domain").data([null]), y = b.selectAll(".tick").data(k, e).order(), w = y.exit(), N = y.enter().append("g").attr("class", "tick"), C = y.select("line"), m = y.select("text"); g = g.merge(g.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), y = y.merge(N), C = C.merge(N.append("line").attr("stroke", "currentColor").attr(l + "2", s * o)), m = m.merge(N.append("text").attr("fill", "currentColor").attr(l, s * Y).attr("dy", t === Fe ? "0em" : t === ze ? "0.71em" : "0.32em")), d !== b && (g = g.transition(d), y = y.transition(d), C = C.transition(d), m = m.transition(d), w = w.transition(d).attr("opacity", Tn).attr("transform", function(H) { return isFinite(H = p(H)) ? f(H + c) : this.getAttribute("transform"); }), N.attr("opacity", Tn).attr("transform", function(H) { var P = this.parentNode.__axis; return f((P && isFinite(P = P(H)) ? P : p(H)) + c); })), w.remove(), g.attr("d", t === zt || t === ue ? a ? "M" + s * a + "," + A + "H" + c + "V" + S + "H" + s * a : "M" + c + "," + A + "V" + S : a ? "M" + A + "," + s * a + "V" + c + "H" + S + "V" + s * a : "M" + A + "," + c + "H" + S), y.attr("opacity", 1).attr("transform", function(H) { return f(p(H) + c); }), C.attr(l + "2", s * o), m.attr(l, s * Y).text(E), b.filter($i).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === ue ? "start" : t === zt ? "end" : "middle"), b.each(function() { this.__axis = p; }); } return h.scale = function(d) { return arguments.length ? (e = d, h) : e; }, h.ticks = function() { return n = Array.from(arguments), h; }, h.tickArguments = function(d) { return arguments.length ? (n = d == null ? [] : Array.from(d), h) : n.slice(); }, h.tickValues = function(d) { return arguments.length ? (r = d == null ? null : Array.from(d), h) : r && r.slice(); }, h.tickFormat = function(d) { return arguments.length ? (i = d, h) : i; }, h.tickSize = function(d) { return arguments.length ? (o = a = +d, h) : o; }, h.tickSizeInner = function(d) { return arguments.length ? (o = +d, h) : o; }, h.tickSizeOuter = function(d) { return arguments.length ? (a = +d, h) : a; }, h.tickPadding = function(d) { return arguments.length ? (u = +d, h) : u; }, h.offset = function(d) { return arguments.length ? (c = +d, h) : c; }, h; } function al(t) { return en(ue, t); } function Sn(t) { return en(ze, t); } function sl(t) { return en(zt, t); } function nn(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } function lr(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } function Qt() { } var Xt = 0.7, de = 1 / Xt, At = "\\s*([+-]?\\d+)\\s*", Zt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", ct = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", ki = /^#([0-9a-f]{3,8})$/, Ti = new RegExp(`^rgb\\(${At},${At},${At}\\)$`), Si = new RegExp(`^rgb\\(${ct},${ct},${ct}\\)$`), Ci = new RegExp(`^rgba\\(${At},${At},${At},${Zt}\\)$`), Ai = new RegExp(`^rgba\\(${ct},${ct},${ct},${Zt}\\)$`), Di = new RegExp(`^hsl\\(${Zt},${ct},${ct}\\)$`), Ni = new RegExp(`^hsla\\(${Zt},${ct},${ct},${Zt}\\)$`), Cn = { 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 }; nn(Qt, _t, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, hex: An, // Deprecated! Use color.formatHex. formatHex: An, formatHex8: Fi, formatHsl: Ui, formatRgb: Dn, toString: Dn }); function An() { return this.rgb().formatHex(); } function Fi() { return this.rgb().formatHex8(); } function Ui() { return fr(this).formatHsl(); } function Dn() { return this.rgb().formatRgb(); } function _t(t) { var e, n; return t = (t + "").trim().toLowerCase(), (e = ki.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Nn(e) : n === 3 ? new tt(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? te(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? te(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 = Ti.exec(t)) ? new tt(e[1], e[2], e[3], 1) : (e = Si.exec(t)) ? new tt(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Ci.exec(t)) ? te(e[1], e[2], e[3], e[4]) : (e = Ai.exec(t)) ? te(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Di.exec(t)) ? Yn(e[1], e[2] / 100, e[3] / 100, 1) : (e = Ni.exec(t)) ? Yn(e[1], e[2] / 100, e[3] / 100, e[4]) : Cn.hasOwnProperty(t) ? Nn(Cn[t]) : t === "transparent" ? new tt(NaN, NaN, NaN, 0) : null; } function Nn(t) { return new tt(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } function te(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new tt(t, e, n, r); } function Yi(t) { return t instanceof Qt || (t = _t(t)), t ? (t = t.rgb(), new tt(t.r, t.g, t.b, t.opacity)) : new tt(); } function qe(t, e, n, r) { return arguments.length === 1 ? Yi(t) : new tt(t, e, n, r ?? 1); } function tt(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } nn(tt, qe, lr(Qt, { brighter(t) { return t = t == null ? de : Math.pow(de, t), new tt(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { return t = t == null ? Xt : Math.pow(Xt, t), new tt(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { return new tt(vt(this.r), vt(this.g), vt(this.b), ge(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: Fn, // Deprecated! Use color.formatHex. formatHex: Fn, formatHex8: Ei, formatRgb: Un, toString: Un })); function Fn() { return `#${xt(this.r)}${xt(this.g)}${xt(this.b)}`; } function Ei() { return `#${xt(this.r)}${xt(this.g)}${xt(this.b)}${xt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Un() { const t = ge(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${vt(this.r)}, ${vt(this.g)}, ${vt(this.b)}${t === 1 ? ")" : `, ${t})`}`; } function ge(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function vt(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } function xt(t) { return t = vt(t), (t < 16 ? "0" : "") + t.toString(16); } function Yn(t, e, n, r) { return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new ot(t, e, n, r); } function fr(t) { if (t instanceof ot) return new ot(t.h, t.s, t.l, t.opacity); if (t instanceof Qt || (t = _t(t)), !t) return new ot(); if (t instanceof ot) return t; t = t.rgb(); var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), o = Math.max(e, n, r), a = NaN, u = o - i, c = (o + i) / 2; return u ? (e === o ? a = (n - r) / u + (n < r) * 6 : n === o ? a = (r - e) / u + 2 : a = (e - n) / u + 4, u /= c < 0.5 ? o + i : 2 - o - i, a *= 60) : u = c > 0 && c < 1 ? 0 : a, new ot(a, u, c, t.opacity); } function Hi(t, e, n, r) { return arguments.length === 1 ? fr(t) : new ot(t, e, n, r ?? 1); } function ot(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } nn(ot, Hi, lr(Qt, { brighter(t) { return t = t == null ? de : Math.pow(de, t), new ot(this.h, this.s, this.l * t, this.opacity); }, darker(t) { return t = t == null ? Xt : Math.pow(Xt, t), new ot(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 tt( Ue(t >= 240 ? t - 240 : t + 120, i, r), Ue(t, i, r), Ue(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { return new ot(En(this.h), ee(this.s), ee(this.l), ge(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 = ge(this.opacity); return `${t === 1 ? "hsl(" : "hsla("}${En(this.h)}, ${ee(this.s) * 100}%, ${ee(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function En(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } function ee(t) { return Math.max(0, Math.min(1, t || 0)); } function Ue(t, e, n) { return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; } var Oi = { value: () => { } }; function rn() { 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 ce(n); } function ce(t) { this._ = t; } function Ii(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 }; }); } ce.prototype = rn.prototype = { constructor: ce, on: function(t, e) { var n = this._, r = Ii(t + "", n), i, o = -1, a = r.length; if (arguments.length < 2) { for (; ++o < a; ) if ((i = (t = r[o]).type) && (i = Ri(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++o < a; ) if (i = (t = r[o]).type) n[i] = Hn(n[i], t.name, e); else if (e == null) for (i in n) n[i] = Hn(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 ce(t); }, call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, o; r < i; ++r) n[r] = arguments[r + 2]; if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (o = this._[t], r = 0, i = o.length; r < i; ++r) o[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, o = r.length; i < o; ++i) r[i].value.apply(e, n); } }; function Ri(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } function Hn(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { t[r] = Oi, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } var Ve = "http://www.w3.org/1999/xhtml"; const On = { svg: "http://www.w3.org/2000/svg", xhtml: Ve, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; function Se(t) { var e = t += "", n = e.indexOf(":"); return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), On.hasOwnProperty(e) ? { space: On[e], local: t } : t; } function Li(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; return n === Ve && e.documentElement.namespaceURI === Ve ? e.createElement(t) : e.createElementNS(n, t); }; } function Pi(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function hr(t) { var e = Se(t); return (e.local ? Pi : Li)(e); } function Wi() { } function on(t) { return t == null ? Wi : function() { return this.querySelector(t); }; } function zi(t) { typeof t != "function" && (t = on(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var o = e[i], a = o.length, u = r[i] = new Array(a), c, s, l = 0; l < a; ++l) (c = o[l]) && (s = t.call(c, c.__data__, l, o)) && ("__data__" in c && (s.__data__ = c.__data__), u[l] = s); return new j(r, this._parents); } function dr(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function qi() { return []; } function gr(t) { return t == null ? qi : function() { return this.querySelectorAll(t); }; } function Vi(t) { return function() { return dr(t.apply(this, arguments)); }; } function Bi(t) { typeof t == "function" ? t = Vi(t) : t = gr(t); for (var e = this._groups, n = e.length, r = [], i = [], o = 0; o < n; ++o) for (var a = e[o], u = a.length, c, s = 0; s < u; ++s) (c = a[s]) && (r.push(t.call(c, c.__data__, s, a)), i.push(c)); return new j(r, i); } function mr(t) { return function() { return this.matches(t); }; } function pr(t) { return function(e) { return e.matches(t); }; } var Xi = Array.prototype.find; function Zi(t) { return function() { return Xi.call(this.children, t); }; } function Gi() { return this.firstElementChild; } function Ji(t) { return this.select(t == null ? Gi : Zi(typeof t == "function" ? t : pr(t))); } var Qi = Array.prototype.filter; function Ki() { return Array.from(this.children); } function ji(t) { return function() { return Qi.call(this.children, t); }; } function to(t) { return this.selectAll(t == null ? Ki : ji(typeof t == "function" ? t : pr(t))); } function eo(t) { typeof t != "function" && (t = mr(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var o = e[i], a = o.length, u = r[i] = [], c, s = 0; s < a; ++s) (c = o[s]) && t.call(c, c.__data__, s, o) && u.push(c); return new j(r, this._parents); } function yr(t) { return new Array(t.length); } function no() { return new j(this._enter || this._groups.map(yr), this._parents); } function me(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } me.prototype = { constructor: me, 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 ro(t) { return function() { return t; }; } function io(t, e, n, r, i, o) { for (var a = 0, u, c = e.length, s = o.length; a < s; ++a) (u = e[a]) ? (u.__data__ = o[a], r[a] = u) : n[a] = new me(t, o[a]); for (; a < c; ++a) (u = e[a]) && (i[a] = u); } function oo(t, e, n, r, i, o, a) { var u, c, s = /* @__PURE__ */ new Map(), l = e.length, f = o.length, h = new Array(l), d; for (u = 0; u < l; ++u) (c = e[u]) && (h[u] = d = a.call(c, c.__data__, u, e) + "", s.has(d) ? i[u] = c : s.set(d, c)); for (u = 0; u < f; ++u) d = a.call(t, o[u], u, o) + "", (c = s.get(d)) ? (r[u] = c, c.__data__ = o[u], s.delete(d)) : n[u] = new me(t, o[u]); for (u = 0; u < l; ++u) (c = e[u]) && s.get(h[u]) === c && (i[u] = c); } function ao(t) { return t.__data__; } function so(t, e) { if (!arguments.length) return Array.from(this, ao); var n = e ? oo : io, r = this._parents, i = this._groups; typeof t != "function" && (t = ro(t)); for (var o = i.length, a = new Array(o), u = new Array(o), c = new Array(o), s = 0; s < o; ++s) { var l = r[s], f = i[s], h = f.length, d = uo(t.call(l, l && l.__data__, s, r)), k = d.length, E = u[s] = new Array(k), Y = a[s] = new Array(k), L = c[s] = new Array(h); n(l, f, E, Y, L, d, e); for (var A = 0, S = 0, p, b; A < k; ++A) if (p = E[A]) { for (A >= S && (S = A + 1); !(b = Y[S]) && ++S < k; ) ; p._next = b || null; } } return a = new j(a, r), a._enter = u, a._exit = c, a; } function uo(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } function co() { return new j(this._exit || this._groups.map(yr), this._parents); } function lo(t, e, n) { var r = this.enter(), i = this, o = 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 ? o.remove() : n(o), r && i ? r.merge(i).order() : i; } function fo(t) { for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, o = r.length, a = Math.min(i, o), u = new Array(i), c = 0; c < a; ++c) for (var s = n[c], l = r[c], f = s.length, h = u[c] = new Array(f), d, k = 0; k < f; ++k) (d = s[k] || l[k]) && (h[k] = d); for (; c < i; ++c) u[c] = n[c]; return new j(u, this._parents); } function ho() { for (var t = this._groups, e = -1, n = t.length; ++e < n; ) for (var r = t[e], i = r.length - 1, o = r[i], a; --i >= 0; ) (a = r[i]) && (o && a.compareDocumentPosition(o) ^ 4 && o.parentNode.insertBefore(a, o), o = a); return this; } function go(t) { t || (t = mo); function e(f, h) { return f && h ? t(f.__data__, h.__data__) : !f - !h; } for (var n = this._groups, r = n.length, i = new Array(r), o = 0; o < r; ++o) { for (var a = n[o], u = a.length, c = i[o] = new Array(u), s, l = 0; l < u; ++l) (s = a[l]) && (c[l] = s); c.sort(e); } return new j(i, this._parents).order(); } function mo(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } function po() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } function yo() { return Array.from(this); } function wo() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, o = r.length; i < o; ++i) { var a = r[i]; if (a) return a; } return null; } function xo() { let t = 0; for (const e of this) ++t; return t; } function vo() { return !this.node(); } function _o(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], o = 0, a = i.length, u; o < a; ++o) (u = i[o]) && t.call(u, u.__data__, o, i); return this; } function Mo(t) { return function() { this.removeAttribute(t); }; } function bo(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function $o(t, e) { return function() { this.setAttribute(t, e); }; } function ko(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } function To(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } function So(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 Co(t, e) { var n = Se(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 ? bo : Mo : typeof e == "function" ? n.local ? So : To : n.local ? ko : $o)(n, e)); } function wr(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function Ao(t) { return function() { this.style.removeProperty(t); }; } function Do(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } function No(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } function Fo(t, e, n) { return arguments.length > 1 ? this.each((e == null ? Ao : typeof e == "function" ? No : Do)(t, e, n ?? "")) : Ft(this.node(), t); } function Ft(t, e) { return t.style.getPropertyValue(e) || wr(t).getComputedStyle(t, null).getPropertyValue(e); } function Uo(t) { return function() { delete this[t]; }; } function Yo(t, e) { return function() { this[t] = e; }; } function Eo(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } function Ho(t, e) { return arguments.length > 1 ? this.each((e == null ? Uo : typeof e == "function" ? Eo : Yo)(t, e)) : this.node()[t]; } function xr(t) { return t.trim().split(/^|\s+/); } function an(t) { return t.classList || new vr(t); } function vr(t) { this._node = t, this._names = xr(t.getAttribute("class") || ""); } vr.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 _r(t, e) { for (var n = an(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } function Mr(t, e) { for (var n = an(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } function Oo(t) { return function() { _r(this, t); }; } function Io(t) { return function() { Mr(this, t); }; } function Ro(t, e) { return function() { (e.apply(this, arguments) ? _r : Mr)(this, t); }; } function Lo(t, e) { var n = xr(t + ""); if (arguments.length < 2) { for (var r = an(this.node()), i = -1, o = n.length; ++i < o; ) if (!r.contains(n[i])) return !1; return !0; } return this.each((typeof e == "function" ? Ro : e ? Oo : Io)(n, e)); } function Po() { this.textContent = ""; } function Wo(t) { return function() { this.textContent = t; }; } function zo(t) { return function() { var e = t.apply(this, arguments); this.textContent = e ?? ""; }; } function qo(t) { return arguments.length ? this.each(t == null ? Po : (typeof t == "function" ? zo : Wo)(t)) : this.node().textContent; } function Vo() { this.innerHTML = ""; } function Bo(t) { return function() { this.innerHTML = t; }; } function Xo(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e ?? ""; }; } function Zo(t) { return arguments.length ? this.each(t == null ? Vo : (typeof t == "function" ? Xo : Bo)(t)) : this.node().innerHTML; } function Go() { this.nextSibling && this.parentNode.appendChild(this); } function Jo() { return this.each(Go); } function Qo() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function Ko() { return this.each(Qo); } function jo(t) { var e = typeof t == "function" ? t : hr(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } function ta() { return null; } function ea(t, e) { var n = typeof t == "function" ? t : hr(t), r = e == null ? ta : typeof e == "function" ? e : on(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } function na() { var t = this.parentNode; t && t.removeChild(this); } function ra() { return this.each(na); } function ia() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function oa() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function aa(t) { return this.select(t ? oa : ia); } function sa(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } function ua(t) { return function(e) { t.call(this, e, this.__data__); }; } function ca(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 la(t) { return function() { var e = this.__on; if (e) { for (var n = 0, r = -1, i = e.length, o; n < i; ++n) o = e[n], (!t.type || o.type === t.type) && o.name === t.name ? this.removeEventListener(o.type, o.listener, o.options) : e[++r] = o; ++r ? e.length = r : delete this.__on; } }; } function fa(t, e, n) { return function() { var r = this.__on, i, o = ua(e); if (r) { for (var a = 0, u = r.length; a < u; ++a) if ((i = r[a]).type === t.type && i.name === t.name) { this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = o, i.options = n), i.value = e; return; } } this.addEventListener(t.type, o, n), i = { type: t.type, name: t.name, value: e, listener: o, options: n }, r ? r.push(i) : this.__on = [i]; }; } function ha(t, e, n) { var r = ca(t + ""), i, o = r.length, a; if (arguments.length < 2) { var u = this.node().__on; if (u) { for (var c = 0, s = u.length, l; c < s; ++c) for (i = 0, l = u[c]; i < o; ++i) if ((a = r[i]).type === l.type && a.name === l.name) return l.value; } return; } for (u = e ? fa : la, i = 0; i < o; ++i) this.each(u(r[i], e, n)); return this; } function br(t, e, n) { var r = wr(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 da(t, e) { return function() { return br(this, t, e); }; } function ga(t, e) { return function() { return br(this, t, e.apply(this, arguments)); }; } function ma(t, e) { return this.each((typeof e == "function" ? ga : da)(t, e)); } function* pa() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, o = r.length, a; i < o; ++i) (a = r[i]) && (yield a); } var sn = [null]; function j(t, e) { this._groups = t, this._parents = e; } function Kt() { return new j([[document.documentElement]], sn); } function ya() { return this; } j.prototype = Kt.prototype = { constructor: j, select: zi, selectAll: Bi, selectChild: Ji, selectChildren: to, filter: eo, data: so, enter: no, exit: co, join: lo, merge: fo, selection: ya, order: ho, sort: go, call: po, nodes: yo, node: wo, size: xo, empty: vo, each: _o, attr: Co, style: Fo, property: Ho, classed: Lo, text: qo, html: Zo, raise: Jo, lower: Ko, append: jo, insert: ea, remove: ra, clone: aa, datum: sa, on: ha, dispatch: ma, [Symbol.iterator]: pa }; function R(t) { return typeof t == "string" ? new j([[document.querySelector(t)]], [document.documentElement]) : new j([[t]], sn); } function wa(t) { let e; for (; e = t.sourceEvent; ) t = e; return t; } function In(t, e) { if (t = wa(t), e === void 0 && (e = t.currentTarget), e) { var n = e.ownerSVGElement || e; if (n.createSVGPoint) { var r = n.createSVGPoint(); return r.x = t.clientX, r.y = t.clientY, r = r.matrixTransform(e.getScreenCTM().inverse()), [r.x, r.y]; } if (e.getBoundingClientRect) { var i = e.getBoundingClientRect(); return [t.clientX - i.left - e.clientLeft, t.clientY - i.top - e.clientTop]; } } return [t.pageX, t.pageY]; } function mt(t) { return typeof t == "string" ? new j([document.querySelectorAll(t)], [document.documentElement]) : new j([dr(t)], sn); } const xa = { passive: !1 }, Gt = { capture: !0, passive: !1 }; function Ye(t) { t.stopImmediatePropagation(); } function Dt(t) { t.preventDefault(), t.stopImmediatePropagation(); } function va(t) { var e = t.document.documentElement, n = R(t).on("dragstart.drag", Dt, Gt); "onselectstart" in e ? n.on("selectstart.drag", Dt, Gt) : (e.__noselect = e.style.MozUserSelect, e.style.MozUserSelect = "none"); } function _a(t, e) { var n = t.document.documentElement, r = R(t).on("dragstart.drag", null); e && (r.on("click.drag", Dt, Gt), setTimeout(function() { r.on("click.drag", null); }, 0)), "onselectstart" in n ? r.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect); } const ne = (t) => () => t; function Be(t, { sourceEvent: e, subject: n, target: r, identifier: i, active: o, x: a, y: u, dx: c, dy: s, dispatch: l }) { Object.defineProperties(this, { type: { value: t, enumerable: !0, configurable: !0 }, sourceEvent: { value: e, enumerable: !0, configurable: !0 }, subject: { value: n, enumerable: !0, configurable: !0 }, target: { value: r, enumerable: !0, configurable: !0 }, identifier: { value: i, enumerable: !0, configurable: !0 }, active: { value: o, enumerable: !0, configurable: !0 }, x: { value: a, enumerable: !0, configurable: !0 }, y: { value: u, enumerable: !0, configurable: !0 }, dx: { value: c, enumerable: !0, configurable: !0 }, dy: { value: s, enumerable: !0, configurable: !0 }, _: { value: l } }); } Be.prototype.on = function() { var t = this._.on.apply(this._, arguments); return t === this._ ? this : t; }; function Ma(t) { return !t.ctrlKey && !t.button; } function ba() { return this.parentNode; } function $a(t, e) { return e ?? { x: t.x, y: t.y }; } function ka() { return navigator.maxTouchPoints || "ontouchstart" in this; } function ul() { var t = Ma, e = ba, n = $a, r = ka, i = {}, o = rn("start", "drag", "end"), a = 0, u, c, s, l, f = 0; function h(p) { p.on("mousedown.drag", d).filter(r).on("touchstart.drag", Y).on("touchmove.drag", L, xa).on("touchend.drag touchcancel.drag", A).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); } function d(p, b) { if (!(l || !t.call(this, p, b))) { var g = S(this, e.call(this, p, b), p, b, "mouse"); g && (R(p.view).on("mousemove.drag", k, Gt).on("mouseup.drag", E, Gt), va(p.view), Ye(p), s = !1, u = p.clientX, c = p.clientY, g("start", p)); } } function k(p) { if (Dt(p), !s) { var b = p.clientX - u, g = p.clientY - c; s = b * b + g * g > f; } i.mouse("drag", p); } function E(p) { R(p.view).on("mousemove.drag mouseup.drag", null), _a(p.view, s), Dt(p), i.mouse("end", p); } function Y(p, b) { if (t.call(this, p, b)) { var g = p.changedTouches, y = e.call(this, p, b), w = g.length, N, C; for (N = 0; N < w; ++N) (C = S(this, y, p, b, g[N].identifier, g[N])) && (Ye(p), C("start", p, g[N])); } } function L(p) { var b = p.changedTouches, g = b.length, y, w; for (y = 0; y < g; ++y) (w = i[b[y].identifier]) && (Dt(p), w("drag", p, b[y])); } function A(p) { var b = p.changedTouches, g = b.length, y, w; for (l && clearTimeout(l), l = setTimeout(function() { l = null; }, 500), y = 0; y < g; ++y) (w = i[b[y].identifier]) && (Ye(p), w("end", p, b[y])); } function S(p, b, g, y, w, N) { var C = o.copy(), m = In(N || g, b), H, P, T; if ((T = n.call(p, new Be("beforestart", { sourceEvent: g, target: h, identifier: w, active: a, x: m[0], y: m[1], dx: 0, dy: 0, dispatch: C }), y)) != null) return H = T.x - m[0] || 0, P = T.y - m[1] || 0, function _(M, D, $) { var F = m, O; switch (M) { case "start": i[w] = _, O = a++; break; case "end": delete i[w], --a; case "drag": m = In($ || D, b), O = a; break; } C.call( M, p, new Be(M, { sourceEvent: D, subject: T, target: h, identifier: w, active: O, x: m[0] + H, y: m[1] + P, dx: m[0] - F[0], dy: m[1] - F[1], dispatch: C }), y ); }; } return h.filter = function(p) { return arguments.length ? (t = typeof p == "function" ? p : ne(!!p), h) : t; }, h.container = function(p) { return arguments.length ? (e = typeof p == "function" ? p : ne(p), h) : e; }, h.subject = function(p) { return arguments.length ? (n = typeof p == "function" ? p : ne(p), h) : n; }, h.touchable = function(p) { return arguments.length ? (r = typeof p == "function" ? p : ne(!!p), h) : r; }, h.on = function() { var p = o.on.apply(o, arguments); return p === o ? h : p; }, h.clickDistance = function(p) { return arguments.length ? (f = (p = +p) * p, h) : Math.sqrt(f); }, h; } function Ce(t, e) { switch (arguments.length) { case 0: break; case 1: this.range(t); break; default: this.range(e).domain(t); break; } return this; } const Rn = Symbol("implicit"); function Nt() { var t = new $n(), e = [], n = [], r = Rn; function i(o) { let a = t.get(o); if (a === void 0) { if (r !== Rn) return r; t.set(o, a = e.push(o) - 1); } return n[a % n.length]; } return i.domain = function(o) { if (!arguments.length) return e.slice(); e = [], t = new $n(); for (const a of o) t.has(a) || t.set(a, e.push(a) - 1); return i; }, i.range = function(o) { return arguments.length ? (n = Array.from(o), i) : n.slice(); }, i.unknown = function(o) { return arguments.length ? (r = o, i) : r; }, i.copy = function() { return Nt(e, n).unknown(r); }, Ce.apply(i, arguments), i; } function $r() { var t = Nt().unknown(void 0), e = t.domain, n = t.range, r = 0, i = 1, o, a, u = !1, c = 0, s = 0, l = 0.5; delete t.unknown; function f() { var h = e().length, d = i < r, k = d ? i : r, E = d ? r : i; o = (E - k) / Math.max(1, h - c + s * 2), u && (o = Math.floor(o)), k += (E - k - o * (h - c)) * l, a = o * (1 - c), u && (k = Math.round(k), a = Math.round(a)); var Y = yi(h).map(function(L) { return k + o * L; }); return n(d ? Y.reverse() : Y); } return t.domain = function(h) { return arguments.length ? (e(h), f()) : e(); }, t.range = function(h) { return arguments.length ? ([r, i] = h, r = +r, i = +i, f()) : [r, i]; }, t.rangeRound = function(h) { return [r, i] = h, r = +r, i = +i, u = !0, f(); }, t.bandwidth = function() { return a; }, t.step = function() { return o; }, t.round = function(h) { return arguments.length ? (u = !!h, f()) : u; }, t.padding = function(h) { return arguments.length ? (c = Math.min(1, s = +h), f()) : c; }, t.paddingInner = function(h) { return arguments.length ? (c = Math.min(1, h), f()) : c; }, t.paddingOuter = function(h) { return arguments.length ? (s = +h, f()) : s; }, t.align = function(h) { return arguments.length ? (l = Math.max(0, Math.min(1, h)), f()) : l; }, t.copy = function() { return $r(e(), [r, i]).round(u).paddingInner(c).paddingOuter(s).align(l); }, Ce.apply(f(), arguments); } const un = (t) => () => t; function Ta(t, e) { return function(n) { return t + n * e; }; } function Sa(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 Ca(t) { return (t = +t) == 1 ? kr : function(e, n) { return n - e ? Sa(e, n, t) : un(isNaN(e) ? n : e); }; } function kr(t, e) { var n = e - t; return n ? Ta(t, n) : un(isNaN(t) ? e : t); } const pe = function t(e) { var n = Ca(e); function r(i, o) { var a = n((i = qe(i)).r, (o = qe(o)).r), u = n(i.g, o.g), c = n(i.b, o.b), s = kr(i.opacity, o.opacity); return function(l) { return i.r = a(l), i.g = u(l), i.b = c(l), i.opacity = s(l), i + ""; }; } return r.gamma = t, r; }(1); function Aa(t, e) { e || (e = []); var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i; return function(o) { for (i = 0; i < n; ++i) r[i] = t[i] * (1 - o) + e[i] * o; return r; }; } function Da(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } function Na(t, e) { var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), o = new Array(n), a; for (a = 0; a < r; ++a) i[a] = cn(t[a], e[a]); for (; a < n; ++a) o[a] = e[a]; return function(u) { for (a = 0; a < r; ++a) o[a] = i[a](u); return o; }; } function Fa(t, e) { var n = /* @__PURE__ */ new Date(); return t = +t, e = +e, function(r) { return n.setTime(t * (1 - r) + e * r), n; }; } function it(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } function Ua(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] = cn(t[i], e[i]) : r[i] = e[i]; return function(o) { for (i in n) r[i] = n[i](o); return r; }; } var Xe = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Ee = new RegExp(Xe.source, "g"); function Ya(t) { return function() { return t; }; } function Ea(t) { return function(e) { return t(e) + ""; }; } function Tr(t, e) { var n = Xe.lastIndex = Ee.lastIndex = 0, r, i, o, a = -1, u = [], c = []; for (t = t + "", e = e + ""; (r = Xe.exec(t)) && (i = Ee.exec(e)); ) (o = i.index) > n && (o = e.slice(n, o), u[a] ? u[a] += o : u[++a] = o), (r = r[0]) === (i = i[0]) ? u[a] ? u[a] += i : u[++a] = i : (u[++a] = null, c.push({ i: a, x: it(r, i) })), n = Ee.lastIndex; return n < e.length && (o = e.slice(n), u[a] ? u[a] += o : u[++a] = o), u.length < 2 ? c[0] ? Ea(c[0].x) : Ya(e) : (e = c.length, function(s) { for (var l = 0, f; l < e; ++l) u[(f = c[l]).i] = f.x(s); return u.join(""); }); } function cn(t, e) { var n = typeof e, r; return e == null || n === "boolean" ? un(e) : (n === "number" ? it : n === "string" ? (r = _t(e)) ? (e = r, pe) : Tr : e instanceof _t ? pe : e instanceof Date ? Fa : Da(e) ? Aa : Array.isArray(e) ? Na : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? Ua : it)(t, e); } function Ha(t, e) { return t = +t, e = +e, function(n) { return Math.round(t * (1 - n) + e * n); }; } var Ln = 180 / Math.PI, Ze = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function Sr(t, e, n, r, i, o) { var a, u, c; return (a = Math.sqrt(t * t + e * e)) && (t /= a, e /= a), (c = t * n + e * r) && (n -= t * c, r -= e * c), (u = Math.sqrt(n * n + r * r)) && (n /= u, r /= u, c /= u), t * r < e * n && (t = -t, e = -e, c = -c, a = -a), { translateX: i, translateY: o, rotate: Math.atan2(e, t) * Ln, skewX: Math.atan(c) * Ln, scaleX: a, scaleY: u }; } var re; function Oa(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); return e.isIdentity ? Ze : Sr(e.a, e.b, e.c, e.d, e.e, e.f); } function Ia(t) { return t == null || (re || (re = document.createElementNS("http://www.w3.org/2000/svg", "g")), re.setAttribute("transform", t), !(t = re.transform.baseVal.consolidate())) ? Ze : (t = t.matrix, Sr(t.a, t.b, t.c, t.d, t.e, t.f)); } function Cr(t, e, n, r) { function i(s) { return s.length ? s.pop() + " " : ""; } function o(s, l, f, h, d, k) { if (s !== f || l !== h) { var E = d.push("translate(", null, e, null, n); k.push({ i: E - 4, x: it(s, f) }, { i: E - 2, x: it(l, h) }); } else (f || h) && d.push("translate(" + f + e + h + n); } function a(s, l, f, h) { s !== l ? (s - l > 180 ? l += 360 : l - s > 180 && (s += 360), h.push({ i: f.push(i(f) + "rotate(", null, r) - 2, x: it(s, l) })) : l && f.push(i(f) + "rotate(" + l + r); } function u(s, l, f, h) { s !== l ? h.push({ i: f.push(i(f) + "skewX(", null, r) - 2, x: it(s, l) }) : l && f.push(i(f) + "skewX(" + l + r); } function c(s, l, f, h, d, k) { if (s !== f || l !== h) { var E = d.push(i(d) + "scale(", null, ",", null, ")"); k.push({ i: E - 4, x: it(s, f) }, { i: E - 2, x: it(l, h) }); } else (f !== 1 || h !== 1) && d.push(i(d) + "scale(" + f + "," + h + ")"); } return function(s, l) { var f = [], h = []; return s = t(s), l = t(l), o(s.translateX, s.translateY, l.translateX, l.translateY, f, h), a(s.rotate, l.rotate, f, h), u(s.skewX, l.skewX, f, h), c(s.scaleX, s.scaleY, l.scaleX, l.scaleY, f, h), s = l = null, function(d) { for (var k = -1, E = h.length, Y; ++k < E; ) f[(Y = h[k]).i] = Y.x(d); return f.join(""); }; }; } var Ra = Cr(Oa, "px, ", "px)", "deg)"), La = Cr(Ia, ", ", ")", ")"); function Pa(t) { return function() { return t; }; } function Wa(t) { return +t; } var Pn = [0, 1]; function St(t) { return t; } function Ge(t, e) { return (e -= t = +t) ? function(n) { return (n - t) / e; } : Pa(isNaN(e) ? NaN : 0.5); } function za(t, e) { var n; return t > e && (n = t, t = e, e = n), function(r) { return Math.max(t, Math.min(e, r)); }; } function qa(t, e, n) { var r = t[0], i = t[1], o = e[0], a = e[1]; return i < r ? (r = Ge(i, r), o = n(a, o)) : (r = Ge(r, i), o = n(o, a)), function(u) { return o(r(u)); }; } function Va(t, e, n) { var r = Math.min(t.length, e.length) - 1, i = new Array(r), o = new Array(r), a = -1; for (t[r] < t[0] && (t = t.slice().reverse(), e = e.slice().reverse()); ++a < r; ) i[a] = Ge(t[a], t[a + 1]), o[a] = n(e[a], e[a + 1]); return function(u) { var c = si(t, u, 1, r) - 1; return o[c](i[c](u)); }; } function Ar(t, e) { return e.doma