UNPKG

@amit.rajput/react-infinite-canvas

Version:

An Infinite Canvas Component for React where you can place your component anywhere on the canvas with zoom in, zoom out and panning functionality. It also supports custom components to control the canvas.

1,617 lines 87.2 kB
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._dotSvgContainer_64xbd_1{position:absolute;width:100%;height:100%;inset-block-start:0;inset-inline-start:0}._container_1xxyl_1{position:relative;overflow:hidden;width:100%;height:100%}._canvasWrapper_1xxyl_8{position:relative;width:100%;height:100%;overflow:hidden;background-color:var(--kf-color-bg-gray);cursor:grab;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}._canvasWrapper_1xxyl_8._panning_1xxyl_21{cursor:grabbing}._canvas_1xxyl_8{position:relative;z-index:2;width:100%;height:100%}._canvas_1xxyl_8>div:first-of-type{position:absolute;inset-inline-start:0;inset-block-start:0;transition:transform .01s ease}._contentWrapper_1xxyl_39{position:absolute}._verticalScrollBar_17thb_1{position:absolute;inset-inline-end:2px;inset-block-start:0;inset-block-end:0;background:transparent}._horizontalScrollBar_17thb_9{position:absolute;inset-block-end:2px;inset-inline-start:0;inset-inline-end:0;background:transparent}._verticalScrollBar_17thb_1>div,._horizontalScrollBar_17thb_9>div{position:absolute;border-radius:50px;z-index:8;cursor:pointer}._verticalScrollBar_17thb_1>div{width:100%}._horizontalScrollBar_17thb_9>div{height:100%}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})(); import { jsxs as he, jsx as k } from "react/jsx-runtime"; import Ke, { forwardRef as Be, useRef as j, useState as Ge, useImperativeHandle as Ze, useCallback as vt, useEffect as Qe, Fragment as Cn, memo as Nn, useMemo as Je } from "react"; var ne = "http://www.w3.org/1999/xhtml"; const Ee = { svg: "http://www.w3.org/2000/svg", xhtml: ne, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; function Gt(t) { var e = t += "", n = e.indexOf(":"); return n >= 0 && (e = t.slice(0, n)) !== "xmlns" && (t = t.slice(n + 1)), Ee.hasOwnProperty(e) ? { space: Ee[e], local: t } : t; } function An(t) { return function() { var e = this.ownerDocument, n = this.namespaceURI; return n === ne && e.documentElement.namespaceURI === ne ? e.createElement(t) : e.createElementNS(n, t); }; } function Mn(t) { return function() { return this.ownerDocument.createElementNS(t.space, t.local); }; } function We(t) { var e = Gt(t); return (e.local ? Mn : An)(e); } function zn() { } function pe(t) { return t == null ? zn : function() { return this.querySelector(t); }; } function Rn(t) { typeof t != "function" && (t = pe(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var a = e[i], o = a.length, s = r[i] = new Array(o), u, f, c = 0; c < o; ++c) (u = a[c]) && (f = t.call(u, u.__data__, c, a)) && ("__data__" in u && (f.__data__ = u.__data__), s[c] = f); return new B(r, this._parents); } function Ln(t) { return t == null ? [] : Array.isArray(t) ? t : Array.from(t); } function In() { return []; } function je(t) { return t == null ? In : function() { return this.querySelectorAll(t); }; } function $n(t) { return function() { return Ln(t.apply(this, arguments)); }; } function Dn(t) { typeof t == "function" ? t = $n(t) : t = je(t); for (var e = this._groups, n = e.length, r = [], i = [], a = 0; a < n; ++a) for (var o = e[a], s = o.length, u, f = 0; f < s; ++f) (u = o[f]) && (r.push(t.call(u, u.__data__, f, o)), i.push(u)); return new B(r, i); } function tn(t) { return function() { return this.matches(t); }; } function en(t) { return function(e) { return e.matches(t); }; } var kn = Array.prototype.find; function Pn(t) { return function() { return kn.call(this.children, t); }; } function On() { return this.firstElementChild; } function Xn(t) { return this.select(t == null ? On : Pn(typeof t == "function" ? t : en(t))); } var Fn = Array.prototype.filter; function Yn() { return Array.from(this.children); } function Vn(t) { return function() { return Fn.call(this.children, t); }; } function Un(t) { return this.selectAll(t == null ? Yn : Vn(typeof t == "function" ? t : en(t))); } function qn(t) { typeof t != "function" && (t = tn(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var a = e[i], o = a.length, s = r[i] = [], u, f = 0; f < o; ++f) (u = a[f]) && t.call(u, u.__data__, f, a) && s.push(u); return new B(r, this._parents); } function nn(t) { return new Array(t.length); } function Hn() { return new B(this._enter || this._groups.map(nn), this._parents); } function Yt(t, e) { this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = e; } Yt.prototype = { constructor: Yt, appendChild: function(t) { return this._parent.insertBefore(t, this._next); }, insertBefore: function(t, e) { return this._parent.insertBefore(t, e); }, querySelector: function(t) { return this._parent.querySelector(t); }, querySelectorAll: function(t) { return this._parent.querySelectorAll(t); } }; function Kn(t) { return function() { return t; }; } function Bn(t, e, n, r, i, a) { for (var o = 0, s, u = e.length, f = a.length; o < f; ++o) (s = e[o]) ? (s.__data__ = a[o], r[o] = s) : n[o] = new Yt(t, a[o]); for (; o < u; ++o) (s = e[o]) && (i[o] = s); } function Gn(t, e, n, r, i, a, o) { var s, u, f = /* @__PURE__ */ new Map(), c = e.length, d = a.length, m = new Array(c), g; for (s = 0; s < c; ++s) (u = e[s]) && (m[s] = g = o.call(u, u.__data__, s, e) + "", f.has(g) ? i[s] = u : f.set(g, u)); for (s = 0; s < d; ++s) g = o.call(t, a[s], s, a) + "", (u = f.get(g)) ? (r[s] = u, u.__data__ = a[s], f.delete(g)) : n[s] = new Yt(t, a[s]); for (s = 0; s < c; ++s) (u = e[s]) && f.get(m[s]) === u && (i[s] = u); } function Zn(t) { return t.__data__; } function Qn(t, e) { if (!arguments.length) return Array.from(this, Zn); var n = e ? Gn : Bn, r = this._parents, i = this._groups; typeof t != "function" && (t = Kn(t)); for (var a = i.length, o = new Array(a), s = new Array(a), u = new Array(a), f = 0; f < a; ++f) { var c = r[f], d = i[f], m = d.length, g = Jn(t.call(c, c && c.__data__, f, r)), T = g.length, S = s[f] = new Array(T), C = o[f] = new Array(T), w = u[f] = new Array(m); n(c, d, S, C, w, g, e); for (var N = 0, A = 0, P, O; N < T; ++N) if (P = S[N]) { for (N >= A && (A = N + 1); !(O = C[A]) && ++A < T; ) ; P._next = O || null; } } return o = new B(o, r), o._enter = s, o._exit = u, o; } function Jn(t) { return typeof t == "object" && "length" in t ? t : Array.from(t); } function Wn() { return new B(this._exit || this._groups.map(nn), this._parents); } function jn(t, e, n) { var r = this.enter(), i = this, a = this.exit(); return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), e != null && (i = e(i), i && (i = i.selection())), n == null ? a.remove() : n(a), r && i ? r.merge(i).order() : i; } function tr(t) { for (var e = t.selection ? t.selection() : t, n = this._groups, r = e._groups, i = n.length, a = r.length, o = Math.min(i, a), s = new Array(i), u = 0; u < o; ++u) for (var f = n[u], c = r[u], d = f.length, m = s[u] = new Array(d), g, T = 0; T < d; ++T) (g = f[T] || c[T]) && (m[T] = g); for (; u < i; ++u) s[u] = n[u]; return new B(s, this._parents); } function er() { for (var t = this._groups, e = -1, n = t.length; ++e < n; ) for (var r = t[e], i = r.length - 1, a = r[i], o; --i >= 0; ) (o = r[i]) && (a && o.compareDocumentPosition(a) ^ 4 && a.parentNode.insertBefore(o, a), a = o); return this; } function nr(t) { t || (t = rr); function e(d, m) { return d && m ? t(d.__data__, m.__data__) : !d - !m; } for (var n = this._groups, r = n.length, i = new Array(r), a = 0; a < r; ++a) { for (var o = n[a], s = o.length, u = i[a] = new Array(s), f, c = 0; c < s; ++c) (f = o[c]) && (u[c] = f); u.sort(e); } return new B(i, this._parents).order(); } function rr(t, e) { return t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN; } function ir() { var t = arguments[0]; return arguments[0] = this, t.apply(null, arguments), this; } function or() { return Array.from(this); } function ar() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, a = r.length; i < a; ++i) { var o = r[i]; if (o) return o; } return null; } function sr() { let t = 0; for (const e of this) ++t; return t; } function cr() { return !this.node(); } function ur(t) { for (var e = this._groups, n = 0, r = e.length; n < r; ++n) for (var i = e[n], a = 0, o = i.length, s; a < o; ++a) (s = i[a]) && t.call(s, s.__data__, a, i); return this; } function lr(t) { return function() { this.removeAttribute(t); }; } function fr(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function hr(t, e) { return function() { this.setAttribute(t, e); }; } function pr(t, e) { return function() { this.setAttributeNS(t.space, t.local, e); }; } function dr(t, e) { return function() { var n = e.apply(this, arguments); n == null ? this.removeAttribute(t) : this.setAttribute(t, n); }; } function _r(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 mr(t, e) { var n = Gt(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 ? fr : lr : typeof e == "function" ? n.local ? _r : dr : n.local ? pr : hr)(n, e)); } function rn(t) { return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView; } function gr(t) { return function() { this.style.removeProperty(t); }; } function yr(t, e, n) { return function() { this.style.setProperty(t, e, n); }; } function wr(t, e, n) { return function() { var r = e.apply(this, arguments); r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, n); }; } function xr(t, e, n) { return arguments.length > 1 ? this.each((e == null ? gr : typeof e == "function" ? wr : yr)(t, e, n == null ? "" : n)) : _t(this.node(), t); } function _t(t, e) { return t.style.getPropertyValue(e) || rn(t).getComputedStyle(t, null).getPropertyValue(e); } function vr(t) { return function() { delete this[t]; }; } function Sr(t, e) { return function() { this[t] = e; }; } function br(t, e) { return function() { var n = e.apply(this, arguments); n == null ? delete this[t] : this[t] = n; }; } function Er(t, e) { return arguments.length > 1 ? this.each((e == null ? vr : typeof e == "function" ? br : Sr)(t, e)) : this.node()[t]; } function on(t) { return t.trim().split(/^|\s+/); } function de(t) { return t.classList || new an(t); } function an(t) { this._node = t, this._names = on(t.getAttribute("class") || ""); } an.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 sn(t, e) { for (var n = de(t), r = -1, i = e.length; ++r < i; ) n.add(e[r]); } function cn(t, e) { for (var n = de(t), r = -1, i = e.length; ++r < i; ) n.remove(e[r]); } function Tr(t) { return function() { sn(this, t); }; } function Cr(t) { return function() { cn(this, t); }; } function Nr(t, e) { return function() { (e.apply(this, arguments) ? sn : cn)(this, t); }; } function Ar(t, e) { var n = on(t + ""); if (arguments.length < 2) { for (var r = de(this.node()), i = -1, a = n.length; ++i < a; ) if (!r.contains(n[i])) return !1; return !0; } return this.each((typeof e == "function" ? Nr : e ? Tr : Cr)(n, e)); } function Mr() { this.textContent = ""; } function zr(t) { return function() { this.textContent = t; }; } function Rr(t) { return function() { var e = t.apply(this, arguments); this.textContent = e == null ? "" : e; }; } function Lr(t) { return arguments.length ? this.each(t == null ? Mr : (typeof t == "function" ? Rr : zr)(t)) : this.node().textContent; } function Ir() { this.innerHTML = ""; } function $r(t) { return function() { this.innerHTML = t; }; } function Dr(t) { return function() { var e = t.apply(this, arguments); this.innerHTML = e == null ? "" : e; }; } function kr(t) { return arguments.length ? this.each(t == null ? Ir : (typeof t == "function" ? Dr : $r)(t)) : this.node().innerHTML; } function Pr() { this.nextSibling && this.parentNode.appendChild(this); } function Or() { return this.each(Pr); } function Xr() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } function Fr() { return this.each(Xr); } function Yr(t) { var e = typeof t == "function" ? t : We(t); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } function Vr() { return null; } function Ur(t, e) { var n = typeof t == "function" ? t : We(t), r = e == null ? Vr : typeof e == "function" ? e : pe(e); return this.select(function() { return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null); }); } function qr() { var t = this.parentNode; t && t.removeChild(this); } function Hr() { return this.each(qr); } function Kr() { var t = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function Br() { var t = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(t, this.nextSibling) : t; } function Gr(t) { return this.select(t ? Br : Kr); } function Zr(t) { return arguments.length ? this.property("__data__", t) : this.node().__data__; } function Qr(t) { return function(e) { t.call(this, e, this.__data__); }; } function Jr(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 Wr(t) { return function() { var e = this.__on; if (e) { for (var n = 0, r = -1, i = e.length, a; n < i; ++n) a = e[n], (!t.type || a.type === t.type) && a.name === t.name ? this.removeEventListener(a.type, a.listener, a.options) : e[++r] = a; ++r ? e.length = r : delete this.__on; } }; } function jr(t, e, n) { return function() { var r = this.__on, i, a = Qr(e); if (r) { for (var o = 0, s = r.length; o < s; ++o) if ((i = r[o]).type === t.type && i.name === t.name) { this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = a, i.options = n), i.value = e; return; } } this.addEventListener(t.type, a, n), i = { type: t.type, name: t.name, value: e, listener: a, options: n }, r ? r.push(i) : this.__on = [i]; }; } function ti(t, e, n) { var r = Jr(t + ""), i, a = r.length, o; if (arguments.length < 2) { var s = this.node().__on; if (s) { for (var u = 0, f = s.length, c; u < f; ++u) for (i = 0, c = s[u]; i < a; ++i) if ((o = r[i]).type === c.type && o.name === c.name) return c.value; } return; } for (s = e ? jr : Wr, i = 0; i < a; ++i) this.each(s(r[i], e, n)); return this; } function un(t, e, n) { var r = rn(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 ei(t, e) { return function() { return un(this, t, e); }; } function ni(t, e) { return function() { return un(this, t, e.apply(this, arguments)); }; } function ri(t, e) { return this.each((typeof e == "function" ? ni : ei)(t, e)); } function* ii() { for (var t = this._groups, e = 0, n = t.length; e < n; ++e) for (var r = t[e], i = 0, a = r.length, o; i < a; ++i) (o = r[i]) && (yield o); } var ln = [null]; function B(t, e) { this._groups = t, this._parents = e; } function At() { return new B([[document.documentElement]], ln); } function oi() { return this; } B.prototype = At.prototype = { constructor: B, select: Rn, selectAll: Dn, selectChild: Xn, selectChildren: Un, filter: qn, data: Qn, enter: Hn, exit: Wn, join: jn, merge: tr, selection: oi, order: er, sort: nr, call: ir, nodes: or, node: ar, size: sr, empty: cr, each: ur, attr: mr, style: xr, property: Er, classed: Ar, text: Lr, html: kr, raise: Or, lower: Fr, append: Yr, insert: Ur, remove: Hr, clone: Gr, datum: Zr, on: ti, dispatch: ri, [Symbol.iterator]: ii }; function U(t) { return typeof t == "string" ? new B([[document.querySelector(t)]], [document.documentElement]) : new B([[t]], ln); } function ai(t) { let e; for (; e = t.sourceEvent; ) t = e; return t; } function st(t, e) { if (t = ai(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]; } var si = { value: () => { } }; function _e() { 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 Pt(n); } function Pt(t) { this._ = t; } function ci(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 }; }); } Pt.prototype = _e.prototype = { constructor: Pt, on: function(t, e) { var n = this._, r = ci(t + "", n), i, a = -1, o = r.length; if (arguments.length < 2) { for (; ++a < o; ) if ((i = (t = r[a]).type) && (i = ui(n[i], t.name))) return i; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++a < o; ) if (i = (t = r[a]).type) n[i] = Te(n[i], t.name, e); else if (e == null) for (i in n) n[i] = Te(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 Pt(t); }, call: function(t, e) { if ((i = arguments.length - 2) > 0) for (var n = new Array(i), r = 0, i, a; r < i; ++r) n[r] = arguments[r + 2]; if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (a = this._[t], r = 0, i = a.length; r < i; ++r) a[r].value.apply(e, n); }, apply: function(t, e, n) { if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (var r = this._[t], i = 0, a = r.length; i < a; ++i) r[i].value.apply(e, n); } }; function ui(t, e) { for (var n = 0, r = t.length, i; n < r; ++n) if ((i = t[n]).name === e) return i.value; } function Te(t, e, n) { for (var r = 0, i = t.length; r < i; ++r) if (t[r].name === e) { t[r] = si, t = t.slice(0, r).concat(t.slice(r + 1)); break; } return n != null && t.push({ name: e, value: n }), t; } const re = { capture: !0, passive: !1 }; function ie(t) { t.preventDefault(), t.stopImmediatePropagation(); } function li(t) { var e = t.document.documentElement, n = U(t).on("dragstart.drag", ie, re); "onselectstart" in e ? n.on("selectstart.drag", ie, re) : (e.__noselect = e.style.MozUserSelect, e.style.MozUserSelect = "none"); } function fi(t, e) { var n = t.document.documentElement, r = U(t).on("dragstart.drag", null); e && (r.on("click.drag", ie, re), setTimeout(function() { r.on("click.drag", null); }, 0)), "onselectstart" in n ? r.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect); } function me(t, e, n) { t.prototype = e.prototype = n, n.constructor = t; } function fn(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } function Mt() { } var Et = 0.7, Vt = 1 / Et, dt = "\\s*([+-]?\\d+)\\s*", Tt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", tt = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", hi = /^#([0-9a-f]{3,8})$/, pi = new RegExp(`^rgb\\(${dt},${dt},${dt}\\)$`), di = new RegExp(`^rgb\\(${tt},${tt},${tt}\\)$`), _i = new RegExp(`^rgba\\(${dt},${dt},${dt},${Tt}\\)$`), mi = new RegExp(`^rgba\\(${tt},${tt},${tt},${Tt}\\)$`), gi = new RegExp(`^hsl\\(${Tt},${tt},${tt}\\)$`), yi = new RegExp(`^hsla\\(${Tt},${tt},${tt},${Tt}\\)$`), Ce = { 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 }; me(Mt, Ct, { copy(t) { return Object.assign(new this.constructor(), this, t); }, displayable() { return this.rgb().displayable(); }, hex: Ne, // Deprecated! Use color.formatHex. formatHex: Ne, formatHex8: wi, formatHsl: xi, formatRgb: Ae, toString: Ae }); function Ne() { return this.rgb().formatHex(); } function wi() { return this.rgb().formatHex8(); } function xi() { return hn(this).formatHsl(); } function Ae() { return this.rgb().formatRgb(); } function Ct(t) { var e, n; return t = (t + "").trim().toLowerCase(), (e = hi.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? Me(e) : n === 3 ? new K(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? It(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? It(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 = pi.exec(t)) ? new K(e[1], e[2], e[3], 1) : (e = di.exec(t)) ? new K(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = _i.exec(t)) ? It(e[1], e[2], e[3], e[4]) : (e = mi.exec(t)) ? It(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = gi.exec(t)) ? Le(e[1], e[2] / 100, e[3] / 100, 1) : (e = yi.exec(t)) ? Le(e[1], e[2] / 100, e[3] / 100, e[4]) : Ce.hasOwnProperty(t) ? Me(Ce[t]) : t === "transparent" ? new K(NaN, NaN, NaN, 0) : null; } function Me(t) { return new K(t >> 16 & 255, t >> 8 & 255, t & 255, 1); } function It(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new K(t, e, n, r); } function vi(t) { return t instanceof Mt || (t = Ct(t)), t ? (t = t.rgb(), new K(t.r, t.g, t.b, t.opacity)) : new K(); } function oe(t, e, n, r) { return arguments.length === 1 ? vi(t) : new K(t, e, n, r == null ? 1 : r); } function K(t, e, n, r) { this.r = +t, this.g = +e, this.b = +n, this.opacity = +r; } me(K, oe, fn(Mt, { brighter(t) { return t = t == null ? Vt : Math.pow(Vt, t), new K(this.r * t, this.g * t, this.b * t, this.opacity); }, darker(t) { return t = t == null ? Et : Math.pow(Et, t), new K(this.r * t, this.g * t, this.b * t, this.opacity); }, rgb() { return this; }, clamp() { return new K(ft(this.r), ft(this.g), ft(this.b), Ut(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: ze, // Deprecated! Use color.formatHex. formatHex: ze, formatHex8: Si, formatRgb: Re, toString: Re })); function ze() { return `#${lt(this.r)}${lt(this.g)}${lt(this.b)}`; } function Si() { return `#${lt(this.r)}${lt(this.g)}${lt(this.b)}${lt((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; } function Re() { const t = Ut(this.opacity); return `${t === 1 ? "rgb(" : "rgba("}${ft(this.r)}, ${ft(this.g)}, ${ft(this.b)}${t === 1 ? ")" : `, ${t})`}`; } function Ut(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function ft(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } function lt(t) { return t = ft(t), (t < 16 ? "0" : "") + t.toString(16); } function Le(t, e, n, r) { return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new Q(t, e, n, r); } function hn(t) { if (t instanceof Q) return new Q(t.h, t.s, t.l, t.opacity); if (t instanceof Mt || (t = Ct(t)), !t) return new Q(); if (t instanceof Q) return t; t = t.rgb(); var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), a = Math.max(e, n, r), o = NaN, s = a - i, u = (a + i) / 2; return s ? (e === a ? o = (n - r) / s + (n < r) * 6 : n === a ? o = (r - e) / s + 2 : o = (e - n) / s + 4, s /= u < 0.5 ? a + i : 2 - a - i, o *= 60) : s = u > 0 && u < 1 ? 0 : o, new Q(o, s, u, t.opacity); } function bi(t, e, n, r) { return arguments.length === 1 ? hn(t) : new Q(t, e, n, r == null ? 1 : r); } function Q(t, e, n, r) { this.h = +t, this.s = +e, this.l = +n, this.opacity = +r; } me(Q, bi, fn(Mt, { brighter(t) { return t = t == null ? Vt : Math.pow(Vt, t), new Q(this.h, this.s, this.l * t, this.opacity); }, darker(t) { return t = t == null ? Et : Math.pow(Et, t), new Q(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 K( Wt(t >= 240 ? t - 240 : t + 120, i, r), Wt(t, i, r), Wt(t < 120 ? t + 240 : t - 120, i, r), this.opacity ); }, clamp() { return new Q(Ie(this.h), $t(this.s), $t(this.l), Ut(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 = Ut(this.opacity); return `${t === 1 ? "hsl(" : "hsla("}${Ie(this.h)}, ${$t(this.s) * 100}%, ${$t(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`; } })); function Ie(t) { return t = (t || 0) % 360, t < 0 ? t + 360 : t; } function $t(t) { return Math.max(0, Math.min(1, t || 0)); } function Wt(t, e, n) { return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255; } const pn = (t) => () => t; function Ei(t, e) { return function(n) { return t + n * e; }; } function Ti(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 Ci(t) { return (t = +t) == 1 ? dn : function(e, n) { return n - e ? Ti(e, n, t) : pn(isNaN(e) ? n : e); }; } function dn(t, e) { var n = e - t; return n ? Ei(t, n) : pn(isNaN(t) ? e : t); } const $e = function t(e) { var n = Ci(e); function r(i, a) { var o = n((i = oe(i)).r, (a = oe(a)).r), s = n(i.g, a.g), u = n(i.b, a.b), f = dn(i.opacity, a.opacity); return function(c) { return i.r = o(c), i.g = s(c), i.b = u(c), i.opacity = f(c), i + ""; }; } return r.gamma = t, r; }(1); function ct(t, e) { return t = +t, e = +e, function(n) { return t * (1 - n) + e * n; }; } var ae = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, jt = new RegExp(ae.source, "g"); function Ni(t) { return function() { return t; }; } function Ai(t) { return function(e) { return t(e) + ""; }; } function Mi(t, e) { var n = ae.lastIndex = jt.lastIndex = 0, r, i, a, o = -1, s = [], u = []; for (t = t + "", e = e + ""; (r = ae.exec(t)) && (i = jt.exec(e)); ) (a = i.index) > n && (a = e.slice(n, a), s[o] ? s[o] += a : s[++o] = a), (r = r[0]) === (i = i[0]) ? s[o] ? s[o] += i : s[++o] = i : (s[++o] = null, u.push({ i: o, x: ct(r, i) })), n = jt.lastIndex; return n < e.length && (a = e.slice(n), s[o] ? s[o] += a : s[++o] = a), s.length < 2 ? u[0] ? Ai(u[0].x) : Ni(e) : (e = u.length, function(f) { for (var c = 0, d; c < e; ++c) s[(d = u[c]).i] = d.x(f); return s.join(""); }); } var De = 180 / Math.PI, se = { translateX: 0, translateY: 0, rotate: 0, skewX: 0, scaleX: 1, scaleY: 1 }; function _n(t, e, n, r, i, a) { var o, s, u; return (o = Math.sqrt(t * t + e * e)) && (t /= o, e /= o), (u = t * n + e * r) && (n -= t * u, r -= e * u), (s = Math.sqrt(n * n + r * r)) && (n /= s, r /= s, u /= s), t * r < e * n && (t = -t, e = -e, u = -u, o = -o), { translateX: i, translateY: a, rotate: Math.atan2(e, t) * De, skewX: Math.atan(u) * De, scaleX: o, scaleY: s }; } var Dt; function zi(t) { const e = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + ""); return e.isIdentity ? se : _n(e.a, e.b, e.c, e.d, e.e, e.f); } function Ri(t) { return t == null || (Dt || (Dt = document.createElementNS("http://www.w3.org/2000/svg", "g")), Dt.setAttribute("transform", t), !(t = Dt.transform.baseVal.consolidate())) ? se : (t = t.matrix, _n(t.a, t.b, t.c, t.d, t.e, t.f)); } function mn(t, e, n, r) { function i(f) { return f.length ? f.pop() + " " : ""; } function a(f, c, d, m, g, T) { if (f !== d || c !== m) { var S = g.push("translate(", null, e, null, n); T.push({ i: S - 4, x: ct(f, d) }, { i: S - 2, x: ct(c, m) }); } else (d || m) && g.push("translate(" + d + e + m + n); } function o(f, c, d, m) { f !== c ? (f - c > 180 ? c += 360 : c - f > 180 && (f += 360), m.push({ i: d.push(i(d) + "rotate(", null, r) - 2, x: ct(f, c) })) : c && d.push(i(d) + "rotate(" + c + r); } function s(f, c, d, m) { f !== c ? m.push({ i: d.push(i(d) + "skewX(", null, r) - 2, x: ct(f, c) }) : c && d.push(i(d) + "skewX(" + c + r); } function u(f, c, d, m, g, T) { if (f !== d || c !== m) { var S = g.push(i(g) + "scale(", null, ",", null, ")"); T.push({ i: S - 4, x: ct(f, d) }, { i: S - 2, x: ct(c, m) }); } else (d !== 1 || m !== 1) && g.push(i(g) + "scale(" + d + "," + m + ")"); } return function(f, c) { var d = [], m = []; return f = t(f), c = t(c), a(f.translateX, f.translateY, c.translateX, c.translateY, d, m), o(f.rotate, c.rotate, d, m), s(f.skewX, c.skewX, d, m), u(f.scaleX, f.scaleY, c.scaleX, c.scaleY, d, m), f = c = null, function(g) { for (var T = -1, S = m.length, C; ++T < S; ) d[(C = m[T]).i] = C.x(g); return d.join(""); }; }; } var Li = mn(zi, "px, ", "px)", "deg)"), Ii = mn(Ri, ", ", ")", ")"), $i = 1e-12; function ke(t) { return ((t = Math.exp(t)) + 1 / t) / 2; } function Di(t) { return ((t = Math.exp(t)) - 1 / t) / 2; } function ki(t) { return ((t = Math.exp(2 * t)) - 1) / (t + 1); } const Pi = function t(e, n, r) { function i(a, o) { var s = a[0], u = a[1], f = a[2], c = o[0], d = o[1], m = o[2], g = c - s, T = d - u, S = g * g + T * T, C, w; if (S < $i) w = Math.log(m / f) / e, C = function(L) { return [ s + L * g, u + L * T, f * Math.exp(e * L * w) ]; }; else { var N = Math.sqrt(S), A = (m * m - f * f + r * S) / (2 * f * n * N), P = (m * m - f * f - r * S) / (2 * m * n * N), O = Math.log(Math.sqrt(A * A + 1) - A), D = Math.log(Math.sqrt(P * P + 1) - P); w = (D - O) / e, C = function(L) { var z = L * w, I = ke(O), q = f / (n * N) * (I * ki(e * z + O) - Di(O)); return [ s + q * g, u + q * T, f * I / ke(e * z + O) ]; }; } return C.duration = w * 1e3 * e / Math.SQRT2, C; } return i.rho = function(a) { var o = Math.max(1e-3, +a), s = o * o, u = s * s; return t(o, s, u); }, i; }(Math.SQRT2, 2, 4); var mt = 0, wt = 0, gt = 0, gn = 1e3, qt, xt, Ht = 0, ht = 0, Zt = 0, Nt = typeof performance == "object" && performance.now ? performance : Date, yn = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) { setTimeout(t, 17); }; function ge() { return ht || (yn(Oi), ht = Nt.now() + Zt); } function Oi() { ht = 0; } function Kt() { this._call = this._time = this._next = null; } Kt.prototype = wn.prototype = { constructor: Kt, restart: function(t, e, n) { if (typeof t != "function") throw new TypeError("callback is not a function"); n = (n == null ? ge() : +n) + (e == null ? 0 : +e), !this._next && xt !== this && (xt ? xt._next = this : qt = this, xt = this), this._call = t, this._time = n, ce(); }, stop: function() { this._call && (this._call = null, this._time = 1 / 0, ce()); } }; function wn(t, e, n) { var r = new Kt(); return r.restart(t, e, n), r; } function Xi() { ge(), ++mt; for (var t = qt, e; t; ) (e = ht - t._time) >= 0 && t._call.call(void 0, e), t = t._next; --mt; } function Pe() { ht = (Ht = Nt.now()) + Zt, mt = wt = 0; try { Xi(); } finally { mt = 0, Yi(), ht = 0; } } function Fi() { var t = Nt.now(), e = t - Ht; e > gn && (Zt -= e, Ht = t); } function Yi() { for (var t, e = qt, n, r = 1 / 0; e; ) e._call ? (r > e._time && (r = e._time), t = e, e = e._next) : (n = e._next, e._next = null, e = t ? t._next = n : qt = n); xt = t, ce(r); } function ce(t) { if (!mt) { wt && (wt = clearTimeout(wt)); var e = t - ht; e > 24 ? (t < 1 / 0 && (wt = setTimeout(Pe, t - Nt.now() - Zt)), gt && (gt = clearInterval(gt))) : (gt || (Ht = Nt.now(), gt = setInterval(Fi, gn)), mt = 1, yn(Pe)); } } function Oe(t, e, n) { var r = new Kt(); return e = e == null ? 0 : +e, r.restart((i) => { r.stop(), t(i + e); }, e, n), r; } var Vi = _e("start", "end", "cancel", "interrupt"), Ui = [], xn = 0, Xe = 1, ue = 2, Ot = 3, Fe = 4, le = 5, Xt = 6; function Qt(t, e, n, r, i, a) { var o = t.__transition; if (!o) t.__transition = {}; else if (n in o) return; qi(t, n, { name: e, index: r, // For context during callback. group: i, // For context during callback. on: Vi, tween: Ui, time: a.time, delay: a.delay, duration: a.duration, ease: a.ease, timer: null, state: xn }); } function ye(t, e) { var n = J(t, e); if (n.state > xn) throw new Error("too late; already scheduled"); return n; } function et(t, e) { var n = J(t, e); if (n.state > Ot) throw new Error("too late; already running"); return n; } function J(t, e) { var n = t.__transition; if (!n || !(n = n[e])) throw new Error("transition not found"); return n; } function qi(t, e, n) { var r = t.__transition, i; r[e] = n, n.timer = wn(a, 0, n.time); function a(f) { n.state = Xe, n.timer.restart(o, n.delay, n.time), n.delay <= f && o(f - n.delay); } function o(f) { var c, d, m, g; if (n.state !== Xe) return u(); for (c in r) if (g = r[c], g.name === n.name) { if (g.state === Ot) return Oe(o); g.state === Fe ? (g.state = Xt, g.timer.stop(), g.on.call("interrupt", t, t.__data__, g.index, g.group), delete r[c]) : +c < e && (g.state = Xt, g.timer.stop(), g.on.call("cancel", t, t.__data__, g.index, g.group), delete r[c]); } if (Oe(function() { n.state === Ot && (n.state = Fe, n.timer.restart(s, n.delay, n.time), s(f)); }), n.state = ue, n.on.call("start", t, t.__data__, n.index, n.group), n.state === ue) { for (n.state = Ot, i = new Array(m = n.tween.length), c = 0, d = -1; c < m; ++c) (g = n.tween[c].value.call(t, t.__data__, n.index, n.group)) && (i[++d] = g); i.length = d + 1; } } function s(f) { for (var c = f < n.duration ? n.ease.call(null, f / n.duration) : (n.timer.restart(u), n.state = le, 1), d = -1, m = i.length; ++d < m; ) i[d].call(t, c); n.state === le && (n.on.call("end", t, t.__data__, n.index, n.group), u()); } function u() { n.state = Xt, n.timer.stop(), delete r[e]; for (var f in r) return; delete t.__transition; } } function Ft(t, e) { var n = t.__transition, r, i, a = !0, o; if (n) { e = e == null ? null : e + ""; for (o in n) { if ((r = n[o]).name !== e) { a = !1; continue; } i = r.state > ue && r.state < le, r.state = Xt, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete n[o]; } a && delete t.__transition; } } function Hi(t) { return this.each(function() { Ft(this, t); }); } function Ki(t, e) { var n, r; return function() { var i = et(this, t), a = i.tween; if (a !== n) { r = n = a; for (var o = 0, s = r.length; o < s; ++o) if (r[o].name === e) { r = r.slice(), r.splice(o, 1); break; } } i.tween = r; }; } function Bi(t, e, n) { var r, i; if (typeof n != "function") throw new Error(); return function() { var a = et(this, t), o = a.tween; if (o !== r) { i = (r = o).slice(); for (var s = { name: e, value: n }, u = 0, f = i.length; u < f; ++u) if (i[u].name === e) { i[u] = s; break; } u === f && i.push(s); } a.tween = i; }; } function Gi(t, e) { var n = this._id; if (t += "", arguments.length < 2) { for (var r = J(this.node(), n).tween, i = 0, a = r.length, o; i < a; ++i) if ((o = r[i]).name === t) return o.value; return null; } return this.each((e == null ? Ki : Bi)(n, t, e)); } function we(t, e, n) { var r = t._id; return t.each(function() { var i = et(this, r); (i.value || (i.value = {}))[e] = n.apply(this, arguments); }), function(i) { return J(i, r).value[e]; }; } function vn(t, e) { var n; return (typeof e == "number" ? ct : e instanceof Ct ? $e : (n = Ct(e)) ? (e = n, $e) : Mi)(t, e); } function Zi(t) { return function() { this.removeAttribute(t); }; } function Qi(t) { return function() { this.removeAttributeNS(t.space, t.local); }; } function Ji(t, e, n) { var r, i = n + "", a; return function() { var o = this.getAttribute(t); return o === i ? null : o === r ? a : a = e(r = o, n); }; } function Wi(t, e, n) { var r, i = n + "", a; return function() { var o = this.getAttributeNS(t.space, t.local); return o === i ? null : o === r ? a : a = e(r = o, n); }; } function ji(t, e, n) { var r, i, a; return function() { var o, s = n(this), u; return s == null ? void this.removeAttribute(t) : (o = this.getAttribute(t), u = s + "", o === u ? null : o === r && u === i ? a : (i = u, a = e(r = o, s))); }; } function to(t, e, n) { var r, i, a; return function() { var o, s = n(this), u; return s == null ? void this.removeAttributeNS(t.space, t.local) : (o = this.getAttributeNS(t.space, t.local), u = s + "", o === u ? null : o === r && u === i ? a : (i = u, a = e(r = o, s))); }; } function eo(t, e) { var n = Gt(t), r = n === "transform" ? Ii : vn; return this.attrTween(t, typeof e == "function" ? (n.local ? to : ji)(n, r, we(this, "attr." + t, e)) : e == null ? (n.local ? Qi : Zi)(n) : (n.local ? Wi : Ji)(n, r, e)); } function no(t, e) { return function(n) { this.setAttribute(t, e.call(this, n)); }; } function ro(t, e) { return function(n) { this.setAttributeNS(t.space, t.local, e.call(this, n)); }; } function io(t, e) { var n, r; function i() { var a = e.apply(this, arguments); return a !== r && (n = (r = a) && ro(t, a)), n; } return i._value = e, i; } function oo(t, e) { var n, r; function i() { var a = e.apply(this, arguments); return a !== r && (n = (r = a) && no(t, a)), n; } return i._value = e, i; } function ao(t, e) { var n = "attr." + t; if (arguments.length < 2) return (n = this.tween(n)) && n._value; if (e == null) return this.tween(n, null); if (typeof e != "function") throw new Error(); var r = Gt(t); return this.tween(n, (r.local ? io : oo)(r, e)); } function so(t, e) { return function() { ye(this, t).delay = +e.apply(this, arguments); }; } function co(t, e) { return e = +e, function() { ye(this, t).delay = e; }; } function uo(t) { var e = this._id; return arguments.length ? this.each((typeof t == "function" ? so : co)(e, t)) : J(this.node(), e).delay; } function lo(t, e) { return function() { et(this, t).duration = +e.apply(this, arguments); }; } function fo(t, e) { return e = +e, function() { et(this, t).duration = e; }; } function ho(t) { var e = this._id; return arguments.length ? this.each((typeof t == "function" ? lo : fo)(e, t)) : J(this.node(), e).duration; } function po(t, e) { if (typeof e != "function") throw new Error(); return function() { et(this, t).ease = e; }; } function _o(t) { var e = this._id; return arguments.length ? this.each(po(e, t)) : J(this.node(), e).ease; } function mo(t, e) { return function() { var n = e.apply(this, arguments); if (typeof n != "function") throw new Error(); et(this, t).ease = n; }; } function go(t) { if (typeof t != "function") throw new Error(); return this.each(mo(this._id, t)); } function yo(t) { typeof t != "function" && (t = tn(t)); for (var e = this._groups, n = e.length, r = new Array(n), i = 0; i < n; ++i) for (var a = e[i], o = a.length, s = r[i] = [], u, f = 0; f < o; ++f) (u = a[f]) && t.call(u, u.__data__, f, a) && s.push(u); return new ot(r, this._parents, this._name, this._id); } function wo(t) { if (t._id !== this._id) throw new Error(); for (var e = this._groups, n = t._groups, r = e.length, i = n.length, a = Math.min(r, i), o = new Array(r), s = 0; s < a; ++s) for (var u = e[s], f = n[s], c = u.length, d = o[s] = new Array(c), m, g = 0; g < c; ++g) (m = u[g] || f[g]) && (d[g] = m); for (; s < r; ++s) o[s] = e[s]; return new ot(o, this._parents, this._name, this._id); } function xo(t) { return (t + "").trim().split(/^|\s+/).every(function(e) { var n = e.indexOf("."); return n >= 0 && (e = e.slice(0, n)), !e || e === "start"; }); } function vo(t, e, n) { var r, i, a = xo(e) ? ye : et; return function() { var o = a(this, t), s = o.on; s !== r && (i = (r = s).copy()).on(e, n), o.on = i; }; } function So(t, e) { var n = this._id; return arguments.length < 2 ? J(this.node(), n).on.on(t) : this.each(vo(n, t, e)); } function bo(t) { return function() { var e = this.parentNode; for (var n in this.__transition) if (+n !== t) return; e && e.removeChild(this); }; } function Eo() { return this.on("end.remove", bo(this._id)); } function To(t) { var e = this._name, n = this._id; typeof t != "function" && (t = pe(t)); for (var r = this._groups, i = r.length, a = new Array(i), o = 0; o < i; ++o) for (var s = r[o], u = s.length, f = a[o] = new Array(u), c, d, m = 0; m < u; ++m) (c = s[m]) && (d = t.call(c, c.__data__, m, s)) && ("__data__" in c && (d.__data__ = c.__data__), f[m] = d, Qt(f[m], e, n, m, f, J(c, n))); return new ot(a, this._parents, e, n); } function Co(t) { var e = this._name, n = this._id; typeof t != "function" && (t = je(t)); for (var r = this._groups, i = r.length, a = [], o = [], s = 0; s < i; ++s) for (var u = r[s], f = u.length, c, d = 0; d < f; ++d) if (c = u[d]) { for (var m = t.call(c, c.__data__, d, u), g, T = J(c, n), S = 0, C = m.length; S < C; ++S) (g = m[S]) && Qt(g, e, n, S, m, T); a.push(m), o.push(c); } return new ot(a, o, e, n); } var No = At.prototype.constructor; function Ao() { return new No(this._groups, this._parents); } function Mo(t, e) { var n, r, i; return function() { var a = _t(this, t), o = (this.style.removeProperty(t), _t(this, t)); return a === o ? null : a === n && o === r ? i : i = e(n = a, r = o); }; } function Sn(t) { return function() { this.style.removeProperty(t); }; } function zo(t, e, n) { var r, i = n + "", a; return function() { var o = _t(this, t); return o === i ? null : o === r ? a : a = e(r = o, n); }; } function Ro(t, e, n) { var r, i, a; return function() { var o = _t(this, t), s = n(this), u = s + ""; return s == null && (u = s = (this.style.removeProperty(t), _t(this, t))), o === u ? null : o === r && u === i ? a : (i = u, a = e(r = o, s)); }; } function Lo(t, e) { var n, r, i, a = "style." + e, o = "end." + a, s; return function() { var u = et(this, t), f = u.on, c = u.value[a] == null ? s || (s = Sn(e)) : void 0; (f !== n || i !== c) && (r = (n = f).copy()).on(o, i = c), u.on = r; }; } function Io(t, e, n) { var r = (t += "") == "transform" ? Li : vn; return e == null ? this.styleTween(t, Mo(t, r)).on("end.style." + t, Sn(t)) : typeof e == "function" ? this.styleTween(t, Ro(t, r, we(this, "style." + t, e))).each(Lo(this._id, t)) : this.styleTween(t, zo(t, r, e), n).on("end.style." + t, null); } function $o(t, e, n) { return function(r) { this.style.setProperty(t, e.call(this, r), n); }; } function Do(t, e, n) { var r, i; function a() { var o = e.apply(this, arguments); return o !== i && (r = (i = o) && $o(t, o, n)), r; } return a._value = e, a; } function ko(t, e, n) { var r = "style." + (t += ""); if (arguments.length < 2) return (r = this.tween(r)) && r._value; if (e == null) return this.tween(r, null); if (typeof e != "function") throw new Error(); return this.tween(r, Do(t, e, n == null ? "" : n)); } function Po(t) { return function() { this.textContent = t; }; } function Oo(t) { return function() { var e = t(this); this.textContent = e == null ? "" : e; }; } function Xo(t) { return this.tween("text", typeof t == "function" ? Oo(we(this, "text", t)) : Po(t == null ? "" : t + "")); } function Fo(t) { return function(e) { this.textContent = t.call(this, e); }; } function Yo(t) { var e, n; function r() { var i = t.apply(this, arguments); return i !== n && (e = (n = i) && Fo(i)), e; } return r._value = t, r; } function Vo(t) { var e = "text"; if (arguments.length < 1) return (e = this.tween(e)) && e._value; if (t == null) return this.tween(e, null); if (typeof t != "function") throw new Error(); return this.tween(e, Yo(t)); } function Uo() { for (var t = this._name, e = this._id, n = bn(), r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, u, f = 0; f < s; ++f) if (u = o[f]) { var c = J(u, e); Qt(u, t, n, f, o, {