mermaid
Version:
Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.
1,563 lines • 317 kB
JavaScript
function dh(t) {
for (var e = [], i = 1; i < arguments.length; i++)
e[i - 1] = arguments[i];
var r = Array.from(typeof t == "string" ? [t] : t);
r[r.length - 1] = r[r.length - 1].replace(/\r?\n([\t ]*)$/, "");
var n = r.reduce(function(a, l) {
var h = l.match(/\n([\t ]+|(?!\s).)/g);
return h ? a.concat(h.map(function(c) {
var u, g;
return (g = (u = c.match(/[\t ]/g)) === null || u === void 0 ? void 0 : u.length) !== null && g !== void 0 ? g : 0;
})) : a;
}, []);
if (n.length) {
var o = new RegExp(`
[ ]{` + Math.min.apply(Math, n) + "}", "g");
r = r.map(function(a) {
return a.replace(o, `
`);
});
}
r[0] = r[0].replace(/^\r?\n/, "");
var s = r[0];
return e.forEach(function(a, l) {
var h = s.match(/(?:^|\n)( *)$/), c = h ? h[1] : "", u = a;
typeof a == "string" && a.includes(`
`) && (u = String(a).split(`
`).map(function(g, p) {
return p === 0 ? g : "" + c + g;
}).join(`
`)), s += u + r[l + 1];
}), s;
}
var ph = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function gh(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var As = { exports: {} };
(function(t, e) {
(function(i, r) {
t.exports = r();
})(ph, function() {
var i = 1e3, r = 6e4, n = 36e5, o = "millisecond", s = "second", a = "minute", l = "hour", h = "day", c = "week", u = "month", g = "quarter", p = "year", _ = "date", v = "Invalid Date", O = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, P = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, S = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(E) {
var T = ["th", "st", "nd", "rd"], x = E % 100;
return "[" + E + (T[(x - 20) % 10] || T[x] || T[0]) + "]";
} }, z = function(E, T, x) {
var M = String(E);
return !M || M.length >= T ? E : "" + Array(T + 1 - M.length).join(x) + E;
}, Q = { s: z, z: function(E) {
var T = -E.utcOffset(), x = Math.abs(T), M = Math.floor(x / 60), y = x % 60;
return (T <= 0 ? "+" : "-") + z(M, 2, "0") + ":" + z(y, 2, "0");
}, m: function E(T, x) {
if (T.date() < x.date())
return -E(x, T);
var M = 12 * (x.year() - T.year()) + (x.month() - T.month()), y = T.clone().add(M, u), D = x - y < 0, k = T.clone().add(M + (D ? -1 : 1), u);
return +(-(M + (x - y) / (D ? y - k : k - y)) || 0);
}, a: function(E) {
return E < 0 ? Math.ceil(E) || 0 : Math.floor(E);
}, p: function(E) {
return { M: u, y: p, w: c, d: h, D: _, h: l, m: a, s, ms: o, Q: g }[E] || String(E || "").toLowerCase().replace(/s$/, "");
}, u: function(E) {
return E === void 0;
} }, X = "en", G = {};
G[X] = S;
var W = function(E) {
return E instanceof Nt;
}, Vt = function E(T, x, M) {
var y;
if (!T)
return X;
if (typeof T == "string") {
var D = T.toLowerCase();
G[D] && (y = D), x && (G[D] = x, y = D);
var k = T.split("-");
if (!y && k.length > 1)
return E(k[0]);
} else {
var H = T.name;
G[H] = T, y = H;
}
return !M && y && (X = y), y || !M && X;
}, K = function(E, T) {
if (W(E))
return E.clone();
var x = typeof T == "object" ? T : {};
return x.date = E, x.args = arguments, new Nt(x);
}, I = Q;
I.l = Vt, I.i = W, I.w = function(E, T) {
return K(E, { locale: T.$L, utc: T.$u, x: T.$x, $offset: T.$offset });
};
var Nt = function() {
function E(x) {
this.$L = Vt(x.locale, null, !0), this.parse(x);
}
var T = E.prototype;
return T.parse = function(x) {
this.$d = function(M) {
var y = M.date, D = M.utc;
if (y === null)
return /* @__PURE__ */ new Date(NaN);
if (I.u(y))
return /* @__PURE__ */ new Date();
if (y instanceof Date)
return new Date(y);
if (typeof y == "string" && !/Z$/i.test(y)) {
var k = y.match(O);
if (k) {
var H = k[2] - 1 || 0, R = (k[7] || "0").substring(0, 3);
return D ? new Date(Date.UTC(k[1], H, k[3] || 1, k[4] || 0, k[5] || 0, k[6] || 0, R)) : new Date(k[1], H, k[3] || 1, k[4] || 0, k[5] || 0, k[6] || 0, R);
}
}
return new Date(y);
}(x), this.$x = x.x || {}, this.init();
}, T.init = function() {
var x = this.$d;
this.$y = x.getFullYear(), this.$M = x.getMonth(), this.$D = x.getDate(), this.$W = x.getDay(), this.$H = x.getHours(), this.$m = x.getMinutes(), this.$s = x.getSeconds(), this.$ms = x.getMilliseconds();
}, T.$utils = function() {
return I;
}, T.isValid = function() {
return this.$d.toString() !== v;
}, T.isSame = function(x, M) {
var y = K(x);
return this.startOf(M) <= y && y <= this.endOf(M);
}, T.isAfter = function(x, M) {
return K(x) < this.startOf(M);
}, T.isBefore = function(x, M) {
return this.endOf(M) < K(x);
}, T.$g = function(x, M, y) {
return I.u(x) ? this[M] : this.set(y, x);
}, T.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, T.valueOf = function() {
return this.$d.getTime();
}, T.startOf = function(x, M) {
var y = this, D = !!I.u(M) || M, k = I.p(x), H = function(Pt, it) {
var st = I.w(y.$u ? Date.UTC(y.$y, it, Pt) : new Date(y.$y, it, Pt), y);
return D ? st : st.endOf(h);
}, R = function(Pt, it) {
return I.w(y.toDate()[Pt].apply(y.toDate("s"), (D ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(it)), y);
}, U = this.$W, q = this.$M, ct = this.$D, pt = "set" + (this.$u ? "UTC" : "");
switch (k) {
case p:
return D ? H(1, 0) : H(31, 11);
case u:
return D ? H(1, q) : H(0, q + 1);
case c:
var Xt = this.$locale().weekStart || 0, Rt = (U < Xt ? U + 7 : U) - Xt;
return H(D ? ct - Rt : ct + (6 - Rt), q);
case h:
case _:
return R(pt + "Hours", 0);
case l:
return R(pt + "Minutes", 1);
case a:
return R(pt + "Seconds", 2);
case s:
return R(pt + "Milliseconds", 3);
default:
return this.clone();
}
}, T.endOf = function(x) {
return this.startOf(x, !1);
}, T.$set = function(x, M) {
var y, D = I.p(x), k = "set" + (this.$u ? "UTC" : ""), H = (y = {}, y[h] = k + "Date", y[_] = k + "Date", y[u] = k + "Month", y[p] = k + "FullYear", y[l] = k + "Hours", y[a] = k + "Minutes", y[s] = k + "Seconds", y[o] = k + "Milliseconds", y)[D], R = D === h ? this.$D + (M - this.$W) : M;
if (D === u || D === p) {
var U = this.clone().set(_, 1);
U.$d[H](R), U.init(), this.$d = U.set(_, Math.min(this.$D, U.daysInMonth())).$d;
} else
H && this.$d[H](R);
return this.init(), this;
}, T.set = function(x, M) {
return this.clone().$set(x, M);
}, T.get = function(x) {
return this[I.p(x)]();
}, T.add = function(x, M) {
var y, D = this;
x = Number(x);
var k = I.p(M), H = function(q) {
var ct = K(D);
return I.w(ct.date(ct.date() + Math.round(q * x)), D);
};
if (k === u)
return this.set(u, this.$M + x);
if (k === p)
return this.set(p, this.$y + x);
if (k === h)
return H(1);
if (k === c)
return H(7);
var R = (y = {}, y[a] = r, y[l] = n, y[s] = i, y)[k] || 1, U = this.$d.getTime() + x * R;
return I.w(U, this);
}, T.subtract = function(x, M) {
return this.add(-1 * x, M);
}, T.format = function(x) {
var M = this, y = this.$locale();
if (!this.isValid())
return y.invalidDate || v;
var D = x || "YYYY-MM-DDTHH:mm:ssZ", k = I.z(this), H = this.$H, R = this.$m, U = this.$M, q = y.weekdays, ct = y.months, pt = function(it, st, St, Kt) {
return it && (it[st] || it(M, D)) || St[st].slice(0, Kt);
}, Xt = function(it) {
return I.s(H % 12 || 12, it, "0");
}, Rt = y.meridiem || function(it, st, St) {
var Kt = it < 12 ? "AM" : "PM";
return St ? Kt.toLowerCase() : Kt;
}, Pt = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: U + 1, MM: I.s(U + 1, 2, "0"), MMM: pt(y.monthsShort, U, ct, 3), MMMM: pt(ct, U), D: this.$D, DD: I.s(this.$D, 2, "0"), d: String(this.$W), dd: pt(y.weekdaysMin, this.$W, q, 2), ddd: pt(y.weekdaysShort, this.$W, q, 3), dddd: q[this.$W], H: String(H), HH: I.s(H, 2, "0"), h: Xt(1), hh: Xt(2), a: Rt(H, R, !0), A: Rt(H, R, !1), m: String(R), mm: I.s(R, 2, "0"), s: String(this.$s), ss: I.s(this.$s, 2, "0"), SSS: I.s(this.$ms, 3, "0"), Z: k };
return D.replace(P, function(it, st) {
return st || Pt[it] || k.replace(":", "");
});
}, T.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, T.diff = function(x, M, y) {
var D, k = I.p(M), H = K(x), R = (H.utcOffset() - this.utcOffset()) * r, U = this - H, q = I.m(this, H);
return q = (D = {}, D[p] = q / 12, D[u] = q, D[g] = q / 3, D[c] = (U - R) / 6048e5, D[h] = (U - R) / 864e5, D[l] = U / n, D[a] = U / r, D[s] = U / i, D)[k] || U, y ? q : I.a(q);
}, T.daysInMonth = function() {
return this.endOf(u).$D;
}, T.$locale = function() {
return G[this.$L];
}, T.locale = function(x, M) {
if (!x)
return this.$L;
var y = this.clone(), D = Vt(x, M, !0);
return D && (y.$L = D), y;
}, T.clone = function() {
return I.w(this.$d, this);
}, T.toDate = function() {
return new Date(this.valueOf());
}, T.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, T.toISOString = function() {
return this.$d.toISOString();
}, T.toString = function() {
return this.$d.toUTCString();
}, E;
}(), At = Nt.prototype;
return K.prototype = At, [["$ms", o], ["$s", s], ["$m", a], ["$H", l], ["$W", h], ["$M", u], ["$y", p], ["$D", _]].forEach(function(E) {
At[E[1]] = function(T) {
return this.$g(T, E[0], E[1]);
};
}), K.extend = function(E, T) {
return E.$i || (E(T, Nt, K), E.$i = !0), K;
}, K.locale = Vt, K.isDayjs = W, K.unix = function(E) {
return K(1e3 * E);
}, K.en = G[X], K.Ls = G, K.p = {}, K;
});
})(As);
var mh = As.exports;
const _h = /* @__PURE__ */ gh(mh), Wt = {
trace: 0,
debug: 1,
info: 2,
warn: 3,
error: 4,
fatal: 5
}, w = {
trace: (...t) => {
},
debug: (...t) => {
},
info: (...t) => {
},
warn: (...t) => {
},
error: (...t) => {
},
fatal: (...t) => {
}
}, vn = function(t = "fatal") {
let e = Wt.fatal;
typeof t == "string" ? (t = t.toLowerCase(), t in Wt && (e = Wt[t])) : typeof t == "number" && (e = t), w.trace = () => {
}, w.debug = () => {
}, w.info = () => {
}, w.warn = () => {
}, w.error = () => {
}, w.fatal = () => {
}, e <= Wt.fatal && (w.fatal = console.error ? console.error.bind(console, yt("FATAL"), "color: orange") : console.log.bind(console, "\x1B[35m", yt("FATAL"))), e <= Wt.error && (w.error = console.error ? console.error.bind(console, yt("ERROR"), "color: orange") : console.log.bind(console, "\x1B[31m", yt("ERROR"))), e <= Wt.warn && (w.warn = console.warn ? console.warn.bind(console, yt("WARN"), "color: orange") : console.log.bind(console, "\x1B[33m", yt("WARN"))), e <= Wt.info && (w.info = console.info ? console.info.bind(console, yt("INFO"), "color: lightblue") : console.log.bind(console, "\x1B[34m", yt("INFO"))), e <= Wt.debug && (w.debug = console.debug ? console.debug.bind(console, yt("DEBUG"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", yt("DEBUG"))), e <= Wt.trace && (w.trace = console.debug ? console.debug.bind(console, yt("TRACE"), "color: lightgreen") : console.log.bind(console, "\x1B[32m", yt("TRACE")));
}, yt = (t) => `%c${_h().format("ss.SSS")} : ${t} : `;
var kn = {};
Object.defineProperty(kn, "__esModule", { value: !0 });
var Es = kn.sanitizeUrl = void 0, yh = /^([^\w]*)(javascript|data|vbscript)/im, Ch = /&#(\w+)(^\w|;)?/g, xh = /&(newline|tab);/gi, bh = /[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim, Th = /^.+(:|:)/gim, Sh = [".", "/"];
function vh(t) {
return Sh.indexOf(t[0]) > -1;
}
function kh(t) {
return t.replace(Ch, function(e, i) {
return String.fromCharCode(i);
});
}
function wh(t) {
var e = kh(t || "").replace(xh, "").replace(bh, "").trim();
if (!e)
return "about:blank";
if (vh(e))
return e;
var i = e.match(Th);
if (!i)
return e;
var r = i[0];
return yh.test(r) ? "about:blank" : e;
}
Es = kn.sanitizeUrl = wh;
var Bh = { value: () => {
} };
function Os() {
for (var t = 0, e = arguments.length, i = {}, r; t < e; ++t) {
if (!(r = arguments[t] + "") || r in i || /[\s.]/.test(r))
throw new Error("illegal type: " + r);
i[r] = [];
}
return new Fi(i);
}
function Fi(t) {
this._ = t;
}
function Fh(t, e) {
return t.trim().split(/^|\s+/).map(function(i) {
var r = "", n = i.indexOf(".");
if (n >= 0 && (r = i.slice(n + 1), i = i.slice(0, n)), i && !e.hasOwnProperty(i))
throw new Error("unknown type: " + i);
return { type: i, name: r };
});
}
Fi.prototype = Os.prototype = {
constructor: Fi,
on: function(t, e) {
var i = this._, r = Fh(t + "", i), n, o = -1, s = r.length;
if (arguments.length < 2) {
for (; ++o < s; )
if ((n = (t = r[o]).type) && (n = Lh(i[n], t.name)))
return n;
return;
}
if (e != null && typeof e != "function")
throw new Error("invalid callback: " + e);
for (; ++o < s; )
if (n = (t = r[o]).type)
i[n] = Co(i[n], t.name, e);
else if (e == null)
for (n in i)
i[n] = Co(i[n], t.name, null);
return this;
},
copy: function() {
var t = {}, e = this._;
for (var i in e)
t[i] = e[i].slice();
return new Fi(t);
},
call: function(t, e) {
if ((n = arguments.length - 2) > 0)
for (var i = new Array(n), r = 0, n, o; r < n; ++r)
i[r] = arguments[r + 2];
if (!this._.hasOwnProperty(t))
throw new Error("unknown type: " + t);
for (o = this._[t], r = 0, n = o.length; r < n; ++r)
o[r].value.apply(e, i);
},
apply: function(t, e, i) {
if (!this._.hasOwnProperty(t))
throw new Error("unknown type: " + t);
for (var r = this._[t], n = 0, o = r.length; n < o; ++n)
r[n].value.apply(e, i);
}
};
function Lh(t, e) {
for (var i = 0, r = t.length, n; i < r; ++i)
if ((n = t[i]).name === e)
return n.value;
}
function Co(t, e, i) {
for (var r = 0, n = t.length; r < n; ++r)
if (t[r].name === e) {
t[r] = Bh, t = t.slice(0, r).concat(t.slice(r + 1));
break;
}
return i != null && t.push({ name: e, value: i }), t;
}
var en = "http://www.w3.org/1999/xhtml";
const xo = {
svg: "http://www.w3.org/2000/svg",
xhtml: en,
xlink: "http://www.w3.org/1999/xlink",
xml: "http://www.w3.org/XML/1998/namespace",
xmlns: "http://www.w3.org/2000/xmlns/"
};
function cr(t) {
var e = t += "", i = e.indexOf(":");
return i >= 0 && (e = t.slice(0, i)) !== "xmlns" && (t = t.slice(i + 1)), xo.hasOwnProperty(e) ? { space: xo[e], local: t } : t;
}
function Ah(t) {
return function() {
var e = this.ownerDocument, i = this.namespaceURI;
return i === en && e.documentElement.namespaceURI === en ? e.createElement(t) : e.createElementNS(i, t);
};
}
function Eh(t) {
return function() {
return this.ownerDocument.createElementNS(t.space, t.local);
};
}
function Ms(t) {
var e = cr(t);
return (e.local ? Eh : Ah)(e);
}
function Oh() {
}
function wn(t) {
return t == null ? Oh : function() {
return this.querySelector(t);
};
}
function Mh(t) {
typeof t != "function" && (t = wn(t));
for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n)
for (var o = e[n], s = o.length, a = r[n] = new Array(s), l, h, c = 0; c < s; ++c)
(l = o[c]) && (h = t.call(l, l.__data__, c, o)) && ("__data__" in l && (h.__data__ = l.__data__), a[c] = h);
return new mt(r, this._parents);
}
function $h(t) {
return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
}
function Ih() {
return [];
}
function $s(t) {
return t == null ? Ih : function() {
return this.querySelectorAll(t);
};
}
function Dh(t) {
return function() {
return $h(t.apply(this, arguments));
};
}
function Nh(t) {
typeof t == "function" ? t = Dh(t) : t = $s(t);
for (var e = this._groups, i = e.length, r = [], n = [], o = 0; o < i; ++o)
for (var s = e[o], a = s.length, l, h = 0; h < a; ++h)
(l = s[h]) && (r.push(t.call(l, l.__data__, h, s)), n.push(l));
return new mt(r, n);
}
function Is(t) {
return function() {
return this.matches(t);
};
}
function Ds(t) {
return function(e) {
return e.matches(t);
};
}
var Rh = Array.prototype.find;
function Ph(t) {
return function() {
return Rh.call(this.children, t);
};
}
function qh() {
return this.firstElementChild;
}
function zh(t) {
return this.select(t == null ? qh : Ph(typeof t == "function" ? t : Ds(t)));
}
var Wh = Array.prototype.filter;
function Hh() {
return Array.from(this.children);
}
function jh(t) {
return function() {
return Wh.call(this.children, t);
};
}
function Uh(t) {
return this.selectAll(t == null ? Hh : jh(typeof t == "function" ? t : Ds(t)));
}
function Yh(t) {
typeof t != "function" && (t = Is(t));
for (var e = this._groups, i = e.length, r = new Array(i), n = 0; n < i; ++n)
for (var o = e[n], s = o.length, a = r[n] = [], l, h = 0; h < s; ++h)
(l = o[h]) && t.call(l, l.__data__, h, o) && a.push(l);
return new mt(r, this._parents);
}
function Ns(t) {
return new Array(t.length);
}
function Gh() {
return new mt(this._enter || this._groups.map(Ns), this._parents);
}
function qi(t, e) {
this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e;
}
qi.prototype = {
constructor: qi,
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 Vh(t) {
return function() {
return t;
};
}
function Xh(t, e, i, r, n, o) {
for (var s = 0, a, l = e.length, h = o.length; s < h; ++s)
(a = e[s]) ? (a.__data__ = o[s], r[s] = a) : i[s] = new qi(t, o[s]);
for (; s < l; ++s)
(a = e[s]) && (n[s] = a);
}
function Kh(t, e, i, r, n, o, s) {
var a, l, h = /* @__PURE__ */ new Map(), c = e.length, u = o.length, g = new Array(c), p;
for (a = 0; a < c; ++a)
(l = e[a]) && (g[a] = p = s.call(l, l.__data__, a, e) + "", h.has(p) ? n[a] = l : h.set(p, l));
for (a = 0; a < u; ++a)
p = s.call(t, o[a], a, o) + "", (l = h.get(p)) ? (r[a] = l, l.__data__ = o[a], h.delete(p)) : i[a] = new qi(t, o[a]);
for (a = 0; a < c; ++a)
(l = e[a]) && h.get(g[a]) === l && (n[a] = l);
}
function Zh(t) {
return t.__data__;
}
function Jh(t, e) {
if (!arguments.length)
return Array.from(this, Zh);
var i = e ? Kh : Xh, r = this._parents, n = this._groups;
typeof t != "function" && (t = Vh(t));
for (var o = n.length, s = new Array(o), a = new Array(o), l = new Array(o), h = 0; h < o; ++h) {
var c = r[h], u = n[h], g = u.length, p = Qh(t.call(c, c && c.__data__, h, r)), _ = p.length, v = a[h] = new Array(_), O = s[h] = new Array(_), P = l[h] = new Array(g);
i(c, u, v, O, P, p, e);
for (var S = 0, z = 0, Q, X; S < _; ++S)
if (Q = v[S]) {
for (S >= z && (z = S + 1); !(X = O[z]) && ++z < _; )
;
Q._next = X || null;
}
}
return s = new mt(s, r), s._enter = a, s._exit = l, s;
}
function Qh(t) {
return typeof t == "object" && "length" in t ? t : Array.from(t);
}
function tc() {
return new mt(this._exit || this._groups.map(Ns), this._parents);
}
function ec(t, e, i) {
var r = this.enter(), n = this, o = this.exit();
return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (n = e(n), n && (n = n.selection())), i == null ? o.remove() : i(o), r && n ? r.merge(n).order() : n;
}
function ic(t) {
for (var e = t.selection ? t.selection() : t, i = this._groups, r = e._groups, n = i.length, o = r.length, s = Math.min(n, o), a = new Array(n), l = 0; l < s; ++l)
for (var h = i[l], c = r[l], u = h.length, g = a[l] = new Array(u), p, _ = 0; _ < u; ++_)
(p = h[_] || c[_]) && (g[_] = p);
for (; l < n; ++l)
a[l] = i[l];
return new mt(a, this._parents);
}
function rc() {
for (var t = this._groups, e = -1, i = t.length; ++e < i; )
for (var r = t[e], n = r.length - 1, o = r[n], s; --n >= 0; )
(s = r[n]) && (o && s.compareDocumentPosition(o) ^ 4 && o.parentNode.insertBefore(s, o), o = s);
return this;
}
function nc(t) {
t || (t = oc);
function e(u, g) {
return u && g ? t(u.__data__, g.__data__) : !u - !g;
}
for (var i = this._groups, r = i.length, n = new Array(r), o = 0; o < r; ++o) {
for (var s = i[o], a = s.length, l = n[o] = new Array(a), h, c = 0; c < a; ++c)
(h = s[c]) && (l[c] = h);
l.sort(e);
}
return new mt(n, this._parents).order();
}
function oc(t, e) {
return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
}
function sc() {
var t = arguments[0];
return arguments[0] = this, t.apply(null, arguments), this;
}
function ac() {
return Array.from(this);
}
function lc() {
for (var t = this._groups, e = 0, i = t.length; e < i; ++e)
for (var r = t[e], n = 0, o = r.length; n < o; ++n) {
var s = r[n];
if (s)
return s;
}
return null;
}
function hc() {
let t = 0;
for (const e of this)
++t;
return t;
}
function cc() {
return !this.node();
}
function uc(t) {
for (var e = this._groups, i = 0, r = e.length; i < r; ++i)
for (var n = e[i], o = 0, s = n.length, a; o < s; ++o)
(a = n[o]) && t.call(a, a.__data__, o, n);
return this;
}
function fc(t) {
return function() {
this.removeAttribute(t);
};
}
function dc(t) {
return function() {
this.removeAttributeNS(t.space, t.local);
};
}
function pc(t, e) {
return function() {
this.setAttribute(t, e);
};
}
function gc(t, e) {
return function() {
this.setAttributeNS(t.space, t.local, e);
};
}
function mc(t, e) {
return function() {
var i = e.apply(this, arguments);
i == null ? this.removeAttribute(t) : this.setAttribute(t, i);
};
}
function _c(t, e) {
return function() {
var i = e.apply(this, arguments);
i == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, i);
};
}
function yc(t, e) {
var i = cr(t);
if (arguments.length < 2) {
var r = this.node();
return i.local ? r.getAttributeNS(i.space, i.local) : r.getAttribute(i);
}
return this.each((e == null ? i.local ? dc : fc : typeof e == "function" ? i.local ? _c : mc : i.local ? gc : pc)(i, e));
}
function Rs(t) {
return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView;
}
function Cc(t) {
return function() {
this.style.removeProperty(t);
};
}
function xc(t, e, i) {
return function() {
this.style.setProperty(t, e, i);
};
}
function bc(t, e, i) {
return function() {
var r = e.apply(this, arguments);
r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, i);
};
}
function Tc(t, e, i) {
return arguments.length > 1 ? this.each((e == null ? Cc : typeof e == "function" ? bc : xc)(t, e, i ?? "")) : Le(this.node(), t);
}
function Le(t, e) {
return t.style.getPropertyValue(e) || Rs(t).getComputedStyle(t, null).getPropertyValue(e);
}
function Sc(t) {
return function() {
delete this[t];
};
}
function vc(t, e) {
return function() {
this[t] = e;
};
}
function kc(t, e) {
return function() {
var i = e.apply(this, arguments);
i == null ? delete this[t] : this[t] = i;
};
}
function wc(t, e) {
return arguments.length > 1 ? this.each((e == null ? Sc : typeof e == "function" ? kc : vc)(t, e)) : this.node()[t];
}
function Ps(t) {
return t.trim().split(/^|\s+/);
}
function Bn(t) {
return t.classList || new qs(t);
}
function qs(t) {
this._node = t, this._names = Ps(t.getAttribute("class") || "");
}
qs.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 zs(t, e) {
for (var i = Bn(t), r = -1, n = e.length; ++r < n; )
i.add(e[r]);
}
function Ws(t, e) {
for (var i = Bn(t), r = -1, n = e.length; ++r < n; )
i.remove(e[r]);
}
function Bc(t) {
return function() {
zs(this, t);
};
}
function Fc(t) {
return function() {
Ws(this, t);
};
}
function Lc(t, e) {
return function() {
(e.apply(this, arguments) ? zs : Ws)(this, t);
};
}
function Ac(t, e) {
var i = Ps(t + "");
if (arguments.length < 2) {
for (var r = Bn(this.node()), n = -1, o = i.length; ++n < o; )
if (!r.contains(i[n]))
return !1;
return !0;
}
return this.each((typeof e == "function" ? Lc : e ? Bc : Fc)(i, e));
}
function Ec() {
this.textContent = "";
}
function Oc(t) {
return function() {
this.textContent = t;
};
}
function Mc(t) {
return function() {
var e = t.apply(this, arguments);
this.textContent = e ?? "";
};
}
function $c(t) {
return arguments.length ? this.each(t == null ? Ec : (typeof t == "function" ? Mc : Oc)(t)) : this.node().textContent;
}
function Ic() {
this.innerHTML = "";
}
function Dc(t) {
return function() {
this.innerHTML = t;
};
}
function Nc(t) {
return function() {
var e = t.apply(this, arguments);
this.innerHTML = e ?? "";
};
}
function Rc(t) {
return arguments.length ? this.each(t == null ? Ic : (typeof t == "function" ? Nc : Dc)(t)) : this.node().innerHTML;
}
function Pc() {
this.nextSibling && this.parentNode.appendChild(this);
}
function qc() {
return this.each(Pc);
}
function zc() {
this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function Wc() {
return this.each(zc);
}
function Hc(t) {
var e = typeof t == "function" ? t : Ms(t);
return this.select(function() {
return this.appendChild(e.apply(this, arguments));
});
}
function jc() {
return null;
}
function Uc(t, e) {
var i = typeof t == "function" ? t : Ms(t), r = e == null ? jc : typeof e == "function" ? e : wn(e);
return this.select(function() {
return this.insertBefore(i.apply(this, arguments), r.apply(this, arguments) || null);
});
}
function Yc() {
var t = this.parentNode;
t && t.removeChild(this);
}
function Gc() {
return this.each(Yc);
}
function Vc() {
var t = this.cloneNode(!1), e = this.parentNode;
return e ? e.insertBefore(t, this.nextSibling) : t;
}
function Xc() {
var t = this.cloneNode(!0), e = this.parentNode;
return e ? e.insertBefore(t, this.nextSibling) : t;
}
function Kc(t) {
return this.select(t ? Xc : Vc);
}
function Zc(t) {
return arguments.length ? this.property("__data__", t) : this.node().__data__;
}
function Jc(t) {
return function(e) {
t.call(this, e, this.__data__);
};
}
function Qc(t) {
return t.trim().split(/^|\s+/).map(function(e) {
var i = "", r = e.indexOf(".");
return r >= 0 && (i = e.slice(r + 1), e = e.slice(0, r)), { type: e, name: i };
});
}
function tu(t) {
return function() {
var e = this.__on;
if (e) {
for (var i = 0, r = -1, n = e.length, o; i < n; ++i)
o = e[i], (!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 eu(t, e, i) {
return function() {
var r = this.__on, n, o = Jc(e);
if (r) {
for (var s = 0, a = r.length; s < a; ++s)
if ((n = r[s]).type === t.type && n.name === t.name) {
this.removeEventListener(n.type, n.listener, n.options), this.addEventListener(n.type, n.listener = o, n.options = i), n.value = e;
return;
}
}
this.addEventListener(t.type, o, i), n = { type: t.type, name: t.name, value: e, listener: o, options: i }, r ? r.push(n) : this.__on = [n];
};
}
function iu(t, e, i) {
var r = Qc(t + ""), n, o = r.length, s;
if (arguments.length < 2) {
var a = this.node().__on;
if (a) {
for (var l = 0, h = a.length, c; l < h; ++l)
for (n = 0, c = a[l]; n < o; ++n)
if ((s = r[n]).type === c.type && s.name === c.name)
return c.value;
}
return;
}
for (a = e ? eu : tu, n = 0; n < o; ++n)
this.each(a(r[n], e, i));
return this;
}
function Hs(t, e, i) {
var r = Rs(t), n = r.CustomEvent;
typeof n == "function" ? n = new n(e, i) : (n = r.document.createEvent("Event"), i ? (n.initEvent(e, i.bubbles, i.cancelable), n.detail = i.detail) : n.initEvent(e, !1, !1)), t.dispatchEvent(n);
}
function ru(t, e) {
return function() {
return Hs(this, t, e);
};
}
function nu(t, e) {
return function() {
return Hs(this, t, e.apply(this, arguments));
};
}
function ou(t, e) {
return this.each((typeof e == "function" ? nu : ru)(t, e));
}
function* su() {
for (var t = this._groups, e = 0, i = t.length; e < i; ++e)
for (var r = t[e], n = 0, o = r.length, s; n < o; ++n)
(s = r[n]) && (yield s);
}
var js = [null];
function mt(t, e) {
this._groups = t, this._parents = e;
}
function li() {
return new mt([[document.documentElement]], js);
}
function au() {
return this;
}
mt.prototype = li.prototype = {
constructor: mt,
select: Mh,
selectAll: Nh,
selectChild: zh,
selectChildren: Uh,
filter: Yh,
data: Jh,
enter: Gh,
exit: tc,
join: ec,
merge: ic,
selection: au,
order: rc,
sort: nc,
call: sc,
nodes: ac,
node: lc,
size: hc,
empty: cc,
each: uc,
attr: yc,
style: Tc,
property: wc,
classed: Ac,
text: $c,
html: Rc,
raise: qc,
lower: Wc,
append: Hc,
insert: Uc,
remove: Gc,
clone: Kc,
datum: Zc,
on: iu,
dispatch: ou,
[Symbol.iterator]: su
};
function Ct(t) {
return typeof t == "string" ? new mt([[document.querySelector(t)]], [document.documentElement]) : new mt([[t]], js);
}
function Fn(t, e, i) {
t.prototype = e.prototype = i, i.constructor = t;
}
function Us(t, e) {
var i = Object.create(t.prototype);
for (var r in e)
i[r] = e[r];
return i;
}
function hi() {
}
var Ke = 0.7, zi = 1 / Ke, Fe = "\\s*([+-]?\\d+)\\s*", Ze = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Ot = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", lu = /^#([0-9a-f]{3,8})$/, hu = new RegExp(`^rgb\\(${Fe},${Fe},${Fe}\\)$`), cu = new RegExp(`^rgb\\(${Ot},${Ot},${Ot}\\)$`), uu = new RegExp(`^rgba\\(${Fe},${Fe},${Fe},${Ze}\\)$`), fu = new RegExp(`^rgba\\(${Ot},${Ot},${Ot},${Ze}\\)$`), du = new RegExp(`^hsl\\(${Ze},${Ot},${Ot}\\)$`), pu = new RegExp(`^hsla\\(${Ze},${Ot},${Ot},${Ze}\\)$`), bo = {
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
};
Fn(hi, Je, {
copy(t) {
return Object.assign(new this.constructor(), this, t);
},
displayable() {
return this.rgb().displayable();
},
hex: To,
// Deprecated! Use color.formatHex.
formatHex: To,
formatHex8: gu,
formatHsl: mu,
formatRgb: So,
toString: So
});
function To() {
return this.rgb().formatHex();
}
function gu() {
return this.rgb().formatHex8();
}
function mu() {
return Ys(this).formatHsl();
}
function So() {
return this.rgb().formatRgb();
}
function Je(t) {
var e, i;
return t = (t + "").trim().toLowerCase(), (e = lu.exec(t)) ? (i = e[1].length, e = parseInt(e[1], 16), i === 6 ? vo(e) : i === 3 ? new ft(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : i === 8 ? Ci(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : i === 4 ? Ci(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 = hu.exec(t)) ? new ft(e[1], e[2], e[3], 1) : (e = cu.exec(t)) ? new ft(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = uu.exec(t)) ? Ci(e[1], e[2], e[3], e[4]) : (e = fu.exec(t)) ? Ci(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = du.exec(t)) ? Bo(e[1], e[2] / 100, e[3] / 100, 1) : (e = pu.exec(t)) ? Bo(e[1], e[2] / 100, e[3] / 100, e[4]) : bo.hasOwnProperty(t) ? vo(bo[t]) : t === "transparent" ? new ft(NaN, NaN, NaN, 0) : null;
}
function vo(t) {
return new ft(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
}
function Ci(t, e, i, r) {
return r <= 0 && (t = e = i = NaN), new ft(t, e, i, r);
}
function _u(t) {
return t instanceof hi || (t = Je(t)), t ? (t = t.rgb(), new ft(t.r, t.g, t.b, t.opacity)) : new ft();
}
function rn(t, e, i, r) {
return arguments.length === 1 ? _u(t) : new ft(t, e, i, r ?? 1);
}
function ft(t, e, i, r) {
this.r = +t, this.g = +e, this.b = +i, this.opacity = +r;
}
Fn(ft, rn, Us(hi, {
brighter(t) {
return t = t == null ? zi : Math.pow(zi, t), new ft(this.r * t, this.g * t, this.b * t, this.opacity);
},
darker(t) {
return t = t == null ? Ke : Math.pow(Ke, t), new ft(this.r * t, this.g * t, this.b * t, this.opacity);
},
rgb() {
return this;
},
clamp() {
return new ft(ce(this.r), ce(this.g), ce(this.b), Wi(this.opacity));
},
displayable() {
return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
},
hex: ko,
// Deprecated! Use color.formatHex.
formatHex: ko,
formatHex8: yu,
formatRgb: wo,
toString: wo
}));
function ko() {
return `#${he(this.r)}${he(this.g)}${he(this.b)}`;
}
function yu() {
return `#${he(this.r)}${he(this.g)}${he(this.b)}${he((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function wo() {
const t = Wi(this.opacity);
return `${t === 1 ? "rgb(" : "rgba("}${ce(this.r)}, ${ce(this.g)}, ${ce(this.b)}${t === 1 ? ")" : `, ${t})`}`;
}
function Wi(t) {
return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
}
function ce(t) {
return Math.max(0, Math.min(255, Math.round(t) || 0));
}
function he(t) {
return t = ce(t), (t < 16 ? "0" : "") + t.toString(16);
}
function Bo(t, e, i, r) {
return r <= 0 ? t = e = i = NaN : i <= 0 || i >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new kt(t, e, i, r);
}
function Ys(t) {
if (t instanceof kt)
return new kt(t.h, t.s, t.l, t.opacity);
if (t instanceof hi || (t = Je(t)), !t)
return new kt();
if (t instanceof kt)
return t;
t = t.rgb();
var e = t.r / 255, i = t.g / 255, r = t.b / 255, n = Math.min(e, i, r), o = Math.max(e, i, r), s = NaN, a = o - n, l = (o + n) / 2;
return a ? (e === o ? s = (i - r) / a + (i < r) * 6 : i === o ? s = (r - e) / a + 2 : s = (e - i) / a + 4, a /= l < 0.5 ? o + n : 2 - o - n, s *= 60) : a = l > 0 && l < 1 ? 0 : s, new kt(s, a, l, t.opacity);
}
function Cu(t, e, i, r) {
return arguments.length === 1 ? Ys(t) : new kt(t, e, i, r ?? 1);
}
function kt(t, e, i, r) {
this.h = +t, this.s = +e, this.l = +i, this.opacity = +r;
}
Fn(kt, Cu, Us(hi, {
brighter(t) {
return t = t == null ? zi : Math.pow(zi, t), new kt(this.h, this.s, this.l * t, this.opacity);
},
darker(t) {
return t = t == null ? Ke : Math.pow(Ke, t), new kt(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, i = this.l, r = i + (i < 0.5 ? i : 1 - i) * e, n = 2 * i - r;
return new ft(
Pr(t >= 240 ? t - 240 : t + 120, n, r),
Pr(t, n, r),
Pr(t < 120 ? t + 240 : t - 120, n, r),
this.opacity
);
},
clamp() {
return new kt(Fo(this.h), xi(this.s), xi(this.l), Wi(this.opacity));
},
displayable() {
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
},
formatHsl() {
const t = Wi(this.opacity);
return `${t === 1 ? "hsl(" : "hsla("}${Fo(this.h)}, ${xi(this.s) * 100}%, ${xi(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
}
}));
function Fo(t) {
return t = (t || 0) % 360, t < 0 ? t + 360 : t;
}
function xi(t) {
return Math.max(0, Math.min(1, t || 0));
}
function Pr(t, e, i) {
return (t < 60 ? e + (i - e) * t / 60 : t < 180 ? i : t < 240 ? e + (i - e) * (240 - t) / 60 : e) * 255;
}
const Ln = (t) => () => t;
function Gs(t, e) {
return function(i) {
return t + i * e;
};
}
function xu(t, e, i) {
return t = Math.pow(t, i), e = Math.pow(e, i) - t, i = 1 / i, function(r) {
return Math.pow(t + r * e, i);
};
}
function Gb(t, e) {
var i = e - t;
return i ? Gs(t, i > 180 || i < -180 ? i - 360 * Math.round(i / 360) : i) : Ln(isNaN(t) ? e : t);
}
function bu(t) {
return (t = +t) == 1 ? Vs : function(e, i) {
return i - e ? xu(e, i, t) : Ln(isNaN(e) ? i : e);
};
}
function Vs(t, e) {
var i = e - t;
return i ? Gs(t, i) : Ln(isNaN(t) ? e : t);
}
const Lo = function t(e) {
var i = bu(e);
function r(n, o) {
var s = i((n = rn(n)).r, (o = rn(o)).r), a = i(n.g, o.g), l = i(n.b, o.b), h = Vs(n.opacity, o.opacity);
return function(c) {
return n.r = s(c), n.g = a(c), n.b = l(c), n.opacity = h(c), n + "";
};
}
return r.gamma = t, r;
}(1);
function Qt(t, e) {
return t = +t, e = +e, function(i) {
return t * (1 - i) + e * i;
};
}
var nn = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, qr = new RegExp(nn.source, "g");
function Tu(t) {
return function() {
return t;
};
}
function Su(t) {
return function(e) {
return t(e) + "";
};
}
function vu(t, e) {
var i = nn.lastIndex = qr.lastIndex = 0, r, n, o, s = -1, a = [], l = [];
for (t = t + "", e = e + ""; (r = nn.exec(t)) && (n = qr.exec(e)); )
(o = n.index) > i && (o = e.slice(i, o), a[s] ? a[s] += o : a[++s] = o), (r = r[0]) === (n = n[0]) ? a[s] ? a[s] += n : a[++s] = n : (a[++s] = null, l.push({ i: s, x: Qt(r, n) })), i = qr.lastIndex;
return i < e.length && (o = e.slice(i), a[s] ? a[s] += o : a[++s] = o), a.length < 2 ? l[0] ? Su(l[0].x) : Tu(e) : (e = l.length, function(h) {
for (var c = 0, u; c < e; ++c)
a[(u = l[c]).i] = u.x(h);
return a.join("");
});
}
var Ao = 180 / Math.PI, on = {
translateX: 0,
translateY: 0,
rotate: 0,
skewX: 0,
scaleX: 1,
scaleY: 1
};
function Xs(t, e, i, r, n, o) {
var s, a, l;
return (s = Math.sqrt(t * t + e * e)) && (t /= s, e /= s), (l = t * i + e * r) && (i -= t * l, r -= e * l), (a = Math.sqrt(i * i + r * r)) && (i /= a, r /= a, l /= a), t * r < e * i && (t = -t, e = -e, l = -l, s = -s), {
translateX: n,
translateY: o,
rotate: Math.atan2(e, t) * Ao,
skewX: Math.atan(l) * Ao,
scaleX: s,
scaleY: a
};
}
var bi;
function ku(t) {
const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
return e.isIdentity ? on : Xs(e.a, e.b, e.c, e.d, e.e, e.f);
}
function wu(t) {
return t == null || (bi || (bi = document.createElementNS("http://www.w3.org/2000/svg", "g")), bi.setAttribute("transform", t), !(t = bi.transform.baseVal.consolidate())) ? on : (t = t.matrix, Xs(t.a, t.b, t.c, t.d, t.e, t.f));
}
function Ks(t, e, i, r) {
function n(h) {
return h.length ? h.pop() + " " : "";
}
function o(h, c, u, g, p, _) {
if (h !== u || c !== g) {
var v = p.push("translate(", null, e, null, i);
_.push({ i: v - 4, x: Qt(h, u) }, { i: v - 2, x: Qt(c, g) });
} else
(u || g) && p.push("translate(" + u + e + g + i);
}
function s(h, c, u, g) {
h !== c ? (h - c > 180 ? c += 360 : c - h > 180 && (h += 360), g.push({ i: u.push(n(u) + "rotate(", null, r) - 2, x: Qt(h, c) })) : c && u.push(n(u) + "rotate(" + c + r);
}
function a(h, c, u, g) {
h !== c ? g.push({ i: u.push(n(u) + "skewX(", null, r) - 2, x: Qt(h, c) }) : c && u.push(n(u) + "skewX(" + c + r);
}
function l(h, c, u, g, p, _) {
if (h !== u || c !== g) {
var v = p.push(n(p) + "scale(", null, ",", null, ")");
_.push({ i: v - 4, x: Qt(h, u) }, { i: v - 2, x: Qt(c, g) });
} else
(u !== 1 || g !== 1) && p.push(n(p) + "scale(" + u + "," + g + ")");
}
return function(h, c) {
var u = [], g = [];
return h = t(h), c = t(c), o(h.translateX, h.translateY, c.translateX, c.translateY, u, g), s(h.rotate, c.rotate, u, g), a(h.skewX, c.skewX, u, g), l(h.scaleX, h.scaleY, c.scaleX, c.scaleY, u, g), h = c = null, function(p) {
for (var _ = -1, v = g.length, O; ++_ < v; )
u[(O = g[_]).i] = O.x(p);
return u.join("");
};
};
}
var Bu = Ks(ku, "px, ", "px)", "deg)"), Fu = Ks(wu, ", ", ")", ")"), Ae = 0, He = 0, Pe = 0, Zs = 1e3, Hi, je, ji = 0, de = 0, ur = 0, Qe = typeof performance == "object" && performance.now ? performance : Date, Js = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
setTimeout(t, 17);
};
function An() {
return de || (Js(Lu), de = Qe.now() + ur);
}
function Lu() {
de = 0;
}
function Ui() {
this._call = this._time = this._next = null;
}
Ui.prototype = Qs.prototype = {
constructor: Ui,
restart: function(t, e, i) {
if (typeof t != "function")
throw new TypeError("callback is not a function");
i = (i == null ? An() : +i) + (e == null ? 0 : +e), !this._next && je !== this && (je ? je._next = this : Hi = this, je = this), this._call = t, this._time = i, sn();
},
stop: function() {
this._call && (this._call = null, this._time = 1 / 0, sn());
}
};
function Qs(t, e, i) {
var r = new Ui();
return r.restart(t, e, i), r;
}
function Au() {
An(), ++Ae;
for (var t = Hi, e; t; )
(e = de - t._time) >= 0 && t._call.call(void 0, e), t = t._next;
--Ae;
}
function Eo() {
de = (ji = Qe.now()) + ur, Ae = He = 0;
try {
Au();
} finally {
Ae = 0, Ou(), de = 0;
}
}
function Eu() {
var t = Qe.now(), e = t - ji;
e > Zs && (ur -= e, ji = t);
}
function Ou() {
for (var t, e = Hi, i, r = 1 / 0; e; )
e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (i = e._next, e._next = null, e = t ? t._next = i : Hi = i);
je = t, sn(r);
}
function sn(t) {
if (!Ae) {
He && (He = clearTimeout(He));
var e = t - de;
e > 24 ? (t < 1 / 0 && (He = setTimeout(Eo, t - Qe.now() - ur)), Pe && (Pe = clearInterval(Pe))) : (Pe || (ji = Qe.now(), Pe = setInterval(Eu, Zs)), Ae = 1, Js(Eo));
}
}
function Oo(t, e, i) {
var r = new Ui();
return e = e == null ? 0 : +e, r.restart((n) => {
r.stop(), t(n + e);
}, e, i), r;
}
var Mu = Os("start", "end", "cancel", "interrupt"), $u = [], ta = 0, Mo = 1, an = 2, Li = 3, $o = 4, ln = 5, Ai = 6;
function fr(t, e, i, r, n, o) {
var s = t.__transition;
if (!s)
t.__transition = {};
else if (i in s)
return;
Iu(t, i, {
name: e,
index: r,
// For context during callback.
group: n,
// For context during callback.
on: Mu,
tween: $u,
time: o.time,
delay: o.delay,
duration: o.duration,
ease: o.ease,
timer: null,
state: ta
});
}
function En(t, e) {
var i = Lt(t, e);
if (i.state > ta)
throw new Error("too late; already scheduled");
return i;
}
function It(t, e) {
var i = Lt(t, e);
if (i.state > Li)
throw new Error("too late; already running");
return i;
}
function Lt(t, e) {
var i = t.__transition;
if (!i || !(i = i[e]))
throw new Error("transition not found");
return i;
}
function Iu(t, e, i) {
var r = t.__transition, n;
r[e] = i, i.timer = Qs(o, 0, i.time);
function o(h) {
i.state = Mo, i.timer.restart(s, i.delay, i.time), i.delay <= h && s(h - i.delay);
}
function s(h) {
var c, u, g, p;
if (i.state !== Mo)
return l();
for (c in r)
if (p = r[c], p.name === i.name) {
if (p.state === Li)
return Oo(s);
p.state === $o ? (p.state = Ai, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[c]) : +c < e && (p.state = Ai, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[c]);
}
if (Oo(function() {
i.state === Li && (i.state = $o, i.timer.restart(a, i.delay, i.time), a(h));
}), i.state = an, i.on.call("start", t, t.__data__, i.index, i.group), i.state === an) {
for (i.state = Li, n = new Array(g = i.tween.length), c = 0, u = -1; c < g; ++c)
(p = i.tween[c].value.call(t, t.__data__, i.index, i.group)) && (n[++u] = p);
n.length = u + 1;
}
}
function a(h) {
for (var c = h < i.duration ? i.ease.call(null, h / i.duration) : (i.timer.restart(l), i.state = ln, 1), u = -1, g = n.length; ++u < g; )
n[u].call(t, c);
i.state === ln && (i.on.call("end", t, t.__data__, i.index, i.group), l());
}
function l() {
i.state = Ai, i.timer.stop(), delete r[e];
for (var h in r)
return;
delete t.__transition;
}
}
function Du(t, e) {
var i = t.__transition, r, n, o = !0, s;
if (i) {
e = e == null ? null : e + "";
for (s in i) {
if ((r = i[s]).name !== e) {
o = !1;
continue;
}
n = r.state > an && r.state < ln, r.state = Ai, r.timer.stop(), r.on.call(n ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete i[s];
}
o && delete t.__transition;
}
}
function Nu(t) {
return this.each(function() {
Du(this, t);
});
}
function Ru(t, e) {
var i, r;
return function() {
var n = It(this, t), o = n.tween;
if (o !== i) {
r = i = o;
for (var s = 0, a = r.length; s < a; ++s)
if (r[s].name === e) {
r = r.slice(), r.splice(s, 1);
break;
}
}
n.tween = r;
};
}
function Pu(t, e, i) {
var r, n;
if (typeof i != "function")
throw new Error();
return function() {
var o = It(this, t), s = o