var xn = { value: () => {
} };
function zt() {
  for (var t = 0, n = arguments.length, e = {}, r; t < n; ++t) {
    if (!(r = arguments[t] + "") || r in e || /[\s.]/.test(r)) throw new Error("illegal type: " + r);
    e[r] = [];
  }
  return new J(e);
}
function J(t) {
  this._ = t;
}
function vn(t, n) {
  return t.trim().split(/^|\s+/).map(function(e) {
    var r = "", i = e.indexOf(".");
    if (i >= 0 && (r = e.slice(i + 1), e = e.slice(0, i)), e && !n.hasOwnProperty(e)) throw new Error("unknown type: " + e);
    return { type: e, name: r };
  });
}
J.prototype = zt.prototype = {
  constructor: J,
  on: function(t, n) {
    var e = this._, r = vn(t + "", e), i, s = -1, o = r.length;
    if (arguments.length < 2) {
      for (; ++s < o; ) if ((i = (t = r[s]).type) && (i = mn(e[i], t.name))) return i;
      return;
    }
    if (n != null && typeof n != "function") throw new Error("invalid callback: " + n);
    for (; ++s < o; )
      if (i = (t = r[s]).type) e[i] = Mt(e[i], t.name, n);
      else if (n == null) for (i in e) e[i] = Mt(e[i], t.name, null);
    return this;
  },
  copy: function() {
    var t = {}, n = this._;
    for (var e in n) t[e] = n[e].slice();
    return new J(t);
  },
  call: function(t, n) {
    if ((i = arguments.length - 2) > 0) for (var e = new Array(i), r = 0, i, s; r < i; ++r) e[r] = arguments[r + 2];
    if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
    for (s = this._[t], r = 0, i = s.length; r < i; ++r) s[r].value.apply(n, e);
  },
  apply: function(t, n, e) {
    if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t);
    for (var r = this._[t], i = 0, s = r.length; i < s; ++i) r[i].value.apply(n, e);
  }
};
function mn(t, n) {
  for (var e = 0, r = t.length, i; e < r; ++e)
    if ((i = t[e]).name === n)
      return i.value;
}
function Mt(t, n, e) {
  for (var r = 0, i = t.length; r < i; ++r)
    if (t[r].name === n) {
      t[r] = xn, t = t.slice(0, r).concat(t.slice(r + 1));
      break;
    }
  return e != null && t.push({ name: n, value: e }), t;
}
var ht = "http://www.w3.org/1999/xhtml";
const St = {
  svg: "http://www.w3.org/2000/svg",
  xhtml: ht,
  xlink: "http://www.w3.org/1999/xlink",
  xml: "http://www.w3.org/XML/1998/namespace",
  xmlns: "http://www.w3.org/2000/xmlns/"
};
function at(t) {
  var n = t += "", e = n.indexOf(":");
  return e >= 0 && (n = t.slice(0, e)) !== "xmlns" && (t = t.slice(e + 1)), St.hasOwnProperty(n) ? { space: St[n], local: t } : t;
}
function bn(t) {
  return function() {
    var n = this.ownerDocument, e = this.namespaceURI;
    return e === ht && n.documentElement.namespaceURI === ht ? n.createElement(t) : n.createElementNS(e, t);
  };
}
function $n(t) {
  return function() {
    return this.ownerDocument.createElementNS(t.space, t.local);
  };
}
function Bt(t) {
  var n = at(t);
  return (n.local ? $n : bn)(n);
}
function Nn() {
}
function mt(t) {
  return t == null ? Nn : function() {
    return this.querySelector(t);
  };
}
function An(t) {
  typeof t != "function" && (t = mt(t));
  for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i)
    for (var s = n[i], o = s.length, a = r[i] = new Array(o), u, f, l = 0; l < o; ++l)
      (u = s[l]) && (f = t.call(u, u.__data__, l, s)) && ("__data__" in u && (f.__data__ = u.__data__), a[l] = f);
  return new y(r, this._parents);
}
function En(t) {
  return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
}
function kn() {
  return [];
}
function Ut(t) {
  return t == null ? kn : function() {
    return this.querySelectorAll(t);
  };
}
function Mn(t) {
  return function() {
    return En(t.apply(this, arguments));
  };
}
function Sn(t) {
  typeof t == "function" ? t = Mn(t) : t = Ut(t);
  for (var n = this._groups, e = n.length, r = [], i = [], s = 0; s < e; ++s)
    for (var o = n[s], a = o.length, u, f = 0; f < a; ++f)
      (u = o[f]) && (r.push(t.call(u, u.__data__, f, o)), i.push(u));
  return new y(r, i);
}
function Kt(t) {
  return function() {
    return this.matches(t);
  };
}
function Gt(t) {
  return function(n) {
    return n.matches(t);
  };
}
var Cn = Array.prototype.find;
function Tn(t) {
  return function() {
    return Cn.call(this.children, t);
  };
}
function Rn() {
  return this.firstElementChild;
}
function In(t) {
  return this.select(t == null ? Rn : Tn(typeof t == "function" ? t : Gt(t)));
}
var Fn = Array.prototype.filter;
function qn() {
  return Array.from(this.children);
}
function Hn(t) {
  return function() {
    return Fn.call(this.children, t);
  };
}
function Pn(t) {
  return this.selectAll(t == null ? qn : Hn(typeof t == "function" ? t : Gt(t)));
}
function Ln(t) {
  typeof t != "function" && (t = Kt(t));
  for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i)
    for (var s = n[i], o = s.length, a = r[i] = [], u, f = 0; f < o; ++f)
      (u = s[f]) && t.call(u, u.__data__, f, s) && a.push(u);
  return new y(r, this._parents);
}
function Zt(t) {
  return new Array(t.length);
}
function Xn() {
  return new y(this._enter || this._groups.map(Zt), this._parents);
}
function nt(t, n) {
  this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = n;
}
nt.prototype = {
  constructor: nt,
  appendChild: function(t) {
    return this._parent.insertBefore(t, this._next);
  },
  insertBefore: function(t, n) {
    return this._parent.insertBefore(t, n);
  },
  querySelector: function(t) {
    return this._parent.querySelector(t);
  },
  querySelectorAll: function(t) {
    return this._parent.querySelectorAll(t);
  }
};
function Dn(t) {
  return function() {
    return t;
  };
}
function On(t, n, e, r, i, s) {
  for (var o = 0, a, u = n.length, f = s.length; o < f; ++o)
    (a = n[o]) ? (a.__data__ = s[o], r[o] = a) : e[o] = new nt(t, s[o]);
  for (; o < u; ++o)
    (a = n[o]) && (i[o] = a);
}
function Vn(t, n, e, r, i, s, o) {
  var a, u, f = /* @__PURE__ */ new Map(), l = n.length, c = s.length, h = new Array(l), p;
  for (a = 0; a < l; ++a)
    (u = n[a]) && (h[a] = p = o.call(u, u.__data__, a, n) + "", f.has(p) ? i[a] = u : f.set(p, u));
  for (a = 0; a < c; ++a)
    p = o.call(t, s[a], a, s) + "", (u = f.get(p)) ? (r[a] = u, u.__data__ = s[a], f.delete(p)) : e[a] = new nt(t, s[a]);
  for (a = 0; a < l; ++a)
    (u = n[a]) && f.get(h[a]) === u && (i[a] = u);
}
function Yn(t) {
  return t.__data__;
}
function zn(t, n) {
  if (!arguments.length) return Array.from(this, Yn);
  var e = n ? Vn : On, r = this._parents, i = this._groups;
  typeof t != "function" && (t = Dn(t));
  for (var s = i.length, o = new Array(s), a = new Array(s), u = new Array(s), f = 0; f < s; ++f) {
    var l = r[f], c = i[f], h = c.length, p = Bn(t.call(l, l && l.__data__, f, r)), _ = p.length, d = a[f] = new Array(_), b = o[f] = new Array(_), G = u[f] = new Array(h);
    e(l, c, d, b, G, p, n);
    for (var A = 0, k = 0, R, P; A < _; ++A)
      if (R = d[A]) {
        for (A >= k && (k = A + 1); !(P = b[k]) && ++k < _; ) ;
        R._next = P || null;
      }
  }
  return o = new y(o, r), o._enter = a, o._exit = u, o;
}
function Bn(t) {
  return typeof t == "object" && "length" in t ? t : Array.from(t);
}
function Un() {
  return new y(this._exit || this._groups.map(Zt), this._parents);
}
function Kn(t, n, e) {
  var r = this.enter(), i = this, s = this.exit();
  return typeof t == "function" ? (r = t(r), r && (r = r.selection())) : r = r.append(t + ""), n != null && (i = n(i), i && (i = i.selection())), e == null ? s.remove() : e(s), r && i ? r.merge(i).order() : i;
}
function Gn(t) {
  for (var n = t.selection ? t.selection() : t, e = this._groups, r = n._groups, i = e.length, s = r.length, o = Math.min(i, s), a = new Array(i), u = 0; u < o; ++u)
    for (var f = e[u], l = r[u], c = f.length, h = a[u] = new Array(c), p, _ = 0; _ < c; ++_)
      (p = f[_] || l[_]) && (h[_] = p);
  for (; u < i; ++u)
    a[u] = e[u];
  return new y(a, this._parents);
}
function Zn() {
  for (var t = this._groups, n = -1, e = t.length; ++n < e; )
    for (var r = t[n], i = r.length - 1, s = r[i], o; --i >= 0; )
      (o = r[i]) && (s && o.compareDocumentPosition(s) ^ 4 && s.parentNode.insertBefore(o, s), s = o);
  return this;
}
function Qn(t) {
  t || (t = Wn);
  function n(c, h) {
    return c && h ? t(c.__data__, h.__data__) : !c - !h;
  }
  for (var e = this._groups, r = e.length, i = new Array(r), s = 0; s < r; ++s) {
    for (var o = e[s], a = o.length, u = i[s] = new Array(a), f, l = 0; l < a; ++l)
      (f = o[l]) && (u[l] = f);
    u.sort(n);
  }
  return new y(i, this._parents).order();
}
function Wn(t, n) {
  return t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN;
}
function Jn() {
  var t = arguments[0];
  return arguments[0] = this, t.apply(null, arguments), this;
}
function jn() {
  return Array.from(this);
}
function te() {
  for (var t = this._groups, n = 0, e = t.length; n < e; ++n)
    for (var r = t[n], i = 0, s = r.length; i < s; ++i) {
      var o = r[i];
      if (o) return o;
    }
  return null;
}
function ne() {
  let t = 0;
  for (const n of this) ++t;
  return t;
}
function ee() {
  return !this.node();
}
function re(t) {
  for (var n = this._groups, e = 0, r = n.length; e < r; ++e)
    for (var i = n[e], s = 0, o = i.length, a; s < o; ++s)
      (a = i[s]) && t.call(a, a.__data__, s, i);
  return this;
}
function ie(t) {
  return function() {
    this.removeAttribute(t);
  };
}
function se(t) {
  return function() {
    this.removeAttributeNS(t.space, t.local);
  };
}
function oe(t, n) {
  return function() {
    this.setAttribute(t, n);
  };
}
function ae(t, n) {
  return function() {
    this.setAttributeNS(t.space, t.local, n);
  };
}
function ue(t, n) {
  return function() {
    var e = n.apply(this, arguments);
    e == null ? this.removeAttribute(t) : this.setAttribute(t, e);
  };
}
function fe(t, n) {
  return function() {
    var e = n.apply(this, arguments);
    e == null ? this.removeAttributeNS(t.space, t.local) : this.setAttributeNS(t.space, t.local, e);
  };
}
function le(t, n) {
  var e = at(t);
  if (arguments.length < 2) {
    var r = this.node();
    return e.local ? r.getAttributeNS(e.space, e.local) : r.getAttribute(e);
  }
  return this.each((n == null ? e.local ? se : ie : typeof n == "function" ? e.local ? fe : ue : e.local ? ae : oe)(e, n));
}
function Qt(t) {
  return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView;
}
function ce(t) {
  return function() {
    this.style.removeProperty(t);
  };
}
function he(t, n, e) {
  return function() {
    this.style.setProperty(t, n, e);
  };
}
function pe(t, n, e) {
  return function() {
    var r = n.apply(this, arguments);
    r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, e);
  };
}
function _e(t, n, e) {
  return arguments.length > 1 ? this.each((n == null ? ce : typeof n == "function" ? pe : he)(t, n, e ?? "")) : q(this.node(), t);
}
function q(t, n) {
  return t.style.getPropertyValue(n) || Qt(t).getComputedStyle(t, null).getPropertyValue(n);
}
function de(t) {
  return function() {
    delete this[t];
  };
}
function ge(t, n) {
  return function() {
    this[t] = n;
  };
}
function ye(t, n) {
  return function() {
    var e = n.apply(this, arguments);
    e == null ? delete this[t] : this[t] = e;
  };
}
function we(t, n) {
  return arguments.length > 1 ? this.each((n == null ? de : typeof n == "function" ? ye : ge)(t, n)) : this.node()[t];
}
function Wt(t) {
  return t.trim().split(/^|\s+/);
}
function bt(t) {
  return t.classList || new Jt(t);
}
function Jt(t) {
  this._node = t, this._names = Wt(t.getAttribute("class") || "");
}
Jt.prototype = {
  add: function(t) {
    var n = this._names.indexOf(t);
    n < 0 && (this._names.push(t), this._node.setAttribute("class", this._names.join(" ")));
  },
  remove: function(t) {
    var n = this._names.indexOf(t);
    n >= 0 && (this._names.splice(n, 1), this._node.setAttribute("class", this._names.join(" ")));
  },
  contains: function(t) {
    return this._names.indexOf(t) >= 0;
  }
};
function jt(t, n) {
  for (var e = bt(t), r = -1, i = n.length; ++r < i; ) e.add(n[r]);
}
function tn(t, n) {
  for (var e = bt(t), r = -1, i = n.length; ++r < i; ) e.remove(n[r]);
}
function xe(t) {
  return function() {
    jt(this, t);
  };
}
function ve(t) {
  return function() {
    tn(this, t);
  };
}
function me(t, n) {
  return function() {
    (n.apply(this, arguments) ? jt : tn)(this, t);
  };
}
function be(t, n) {
  var e = Wt(t + "");
  if (arguments.length < 2) {
    for (var r = bt(this.node()), i = -1, s = e.length; ++i < s; ) if (!r.contains(e[i])) return !1;
    return !0;
  }
  return this.each((typeof n == "function" ? me : n ? xe : ve)(e, n));
}
function $e() {
  this.textContent = "";
}
function Ne(t) {
  return function() {
    this.textContent = t;
  };
}
function Ae(t) {
  return function() {
    var n = t.apply(this, arguments);
    this.textContent = n ?? "";
  };
}
function Ee(t) {
  return arguments.length ? this.each(t == null ? $e : (typeof t == "function" ? Ae : Ne)(t)) : this.node().textContent;
}
function ke() {
  this.innerHTML = "";
}
function Me(t) {
  return function() {
    this.innerHTML = t;
  };
}
function Se(t) {
  return function() {
    var n = t.apply(this, arguments);
    this.innerHTML = n ?? "";
  };
}
function Ce(t) {
  return arguments.length ? this.each(t == null ? ke : (typeof t == "function" ? Se : Me)(t)) : this.node().innerHTML;
}
function Te() {
  this.nextSibling && this.parentNode.appendChild(this);
}
function Re() {
  return this.each(Te);
}
function Ie() {
  this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function Fe() {
  return this.each(Ie);
}
function qe(t) {
  var n = typeof t == "function" ? t : Bt(t);
  return this.select(function() {
    return this.appendChild(n.apply(this, arguments));
  });
}
function He() {
  return null;
}
function Pe(t, n) {
  var e = typeof t == "function" ? t : Bt(t), r = n == null ? He : typeof n == "function" ? n : mt(n);
  return this.select(function() {
    return this.insertBefore(e.apply(this, arguments), r.apply(this, arguments) || null);
  });
}
function Le() {
  var t = this.parentNode;
  t && t.removeChild(this);
}
function Xe() {
  return this.each(Le);
}
function De() {
  var t = this.cloneNode(!1), n = this.parentNode;
  return n ? n.insertBefore(t, this.nextSibling) : t;
}
function Oe() {
  var t = this.cloneNode(!0), n = this.parentNode;
  return n ? n.insertBefore(t, this.nextSibling) : t;
}
function Ve(t) {
  return this.select(t ? Oe : De);
}
function Ye(t) {
  return arguments.length ? this.property("__data__", t) : this.node().__data__;
}
function ze(t) {
  return function(n) {
    t.call(this, n, this.__data__);
  };
}
function Be(t) {
  return t.trim().split(/^|\s+/).map(function(n) {
    var e = "", r = n.indexOf(".");
    return r >= 0 && (e = n.slice(r + 1), n = n.slice(0, r)), { type: n, name: e };
  });
}
function Ue(t) {
  return function() {
    var n = this.__on;
    if (n) {
      for (var e = 0, r = -1, i = n.length, s; e < i; ++e)
        s = n[e], (!t.type || s.type === t.type) && s.name === t.name ? this.removeEventListener(s.type, s.listener, s.options) : n[++r] = s;
      ++r ? n.length = r : delete this.__on;
    }
  };
}
function Ke(t, n, e) {
  return function() {
    var r = this.__on, i, s = ze(n);
    if (r) {
      for (var o = 0, a = r.length; o < a; ++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 = s, i.options = e), i.value = n;
          return;
        }
    }
    this.addEventListener(t.type, s, e), i = { type: t.type, name: t.name, value: n, listener: s, options: e }, r ? r.push(i) : this.__on = [i];
  };
}
function Ge(t, n, e) {
  var r = Be(t + ""), i, s = r.length, o;
  if (arguments.length < 2) {
    var a = this.node().__on;
    if (a) {
      for (var u = 0, f = a.length, l; u < f; ++u)
        for (i = 0, l = a[u]; i < s; ++i)
          if ((o = r[i]).type === l.type && o.name === l.name)
            return l.value;
    }
    return;
  }
  for (a = n ? Ke : Ue, i = 0; i < s; ++i) this.each(a(r[i], n, e));
  return this;
}
function nn(t, n, e) {
  var r = Qt(t), i = r.CustomEvent;
  typeof i == "function" ? i = new i(n, e) : (i = r.document.createEvent("Event"), e ? (i.initEvent(n, e.bubbles, e.cancelable), i.detail = e.detail) : i.initEvent(n, !1, !1)), t.dispatchEvent(i);
}
function Ze(t, n) {
  return function() {
    return nn(this, t, n);
  };
}
function Qe(t, n) {
  return function() {
    return nn(this, t, n.apply(this, arguments));
  };
}
function We(t, n) {
  return this.each((typeof n == "function" ? Qe : Ze)(t, n));
}
function* Je() {
  for (var t = this._groups, n = 0, e = t.length; n < e; ++n)
    for (var r = t[n], i = 0, s = r.length, o; i < s; ++i)
      (o = r[i]) && (yield o);
}
var en = [null];
function y(t, n) {
  this._groups = t, this._parents = n;
}
function U() {
  return new y([[document.documentElement]], en);
}
function je() {
  return this;
}
y.prototype = U.prototype = {
  constructor: y,
  select: An,
  selectAll: Sn,
  selectChild: In,
  selectChildren: Pn,
  filter: Ln,
  data: zn,
  enter: Xn,
  exit: Un,
  join: Kn,
  merge: Gn,
  selection: je,
  order: Zn,
  sort: Qn,
  call: Jn,
  nodes: jn,
  node: te,
  size: ne,
  empty: ee,
  each: re,
  attr: le,
  style: _e,
  property: we,
  classed: be,
  text: Ee,
  html: Ce,
  raise: Re,
  lower: Fe,
  append: qe,
  insert: Pe,
  remove: Xe,
  clone: Ve,
  datum: Ye,
  on: Ge,
  dispatch: We,
  [Symbol.iterator]: Je
};
function Oi(t) {
  return typeof t == "string" ? new y([[document.querySelector(t)]], [document.documentElement]) : new y([[t]], en);
}
function $t(t, n, e) {
  t.prototype = n.prototype = e, e.constructor = t;
}
function rn(t, n) {
  var e = Object.create(t.prototype);
  for (var r in n) e[r] = n[r];
  return e;
}
function K() {
}
var V = 0.7, et = 1 / V, F = "\\s*([+-]?\\d+)\\s*", Y = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", v = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", tr = /^#([0-9a-f]{3,8})$/, nr = new RegExp(`^rgb\\(${F},${F},${F}\\)$`), er = new RegExp(`^rgb\\(${v},${v},${v}\\)$`), rr = new RegExp(`^rgba\\(${F},${F},${F},${Y}\\)$`), ir = new RegExp(`^rgba\\(${v},${v},${v},${Y}\\)$`), sr = new RegExp(`^hsl\\(${Y},${v},${v}\\)$`), or = new RegExp(`^hsla\\(${Y},${v},${v},${Y}\\)$`), Ct = {
  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
};
$t(K, z, {
  copy(t) {
    return Object.assign(new this.constructor(), this, t);
  },
  displayable() {
    return this.rgb().displayable();
  },
  hex: Tt,
  // Deprecated! Use color.formatHex.
  formatHex: Tt,
  formatHex8: ar,
  formatHsl: ur,
  formatRgb: Rt,
  toString: Rt
});
function Tt() {
  return this.rgb().formatHex();
}
function ar() {
  return this.rgb().formatHex8();
}
function ur() {
  return sn(this).formatHsl();
}
function Rt() {
  return this.rgb().formatRgb();
}
function z(t) {
  var n, e;
  return t = (t + "").trim().toLowerCase(), (n = tr.exec(t)) ? (e = n[1].length, n = parseInt(n[1], 16), e === 6 ? It(n) : e === 3 ? new g(n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, (n & 15) << 4 | n & 15, 1) : e === 8 ? Z(n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, (n & 255) / 255) : e === 4 ? Z(n >> 12 & 15 | n >> 8 & 240, n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, ((n & 15) << 4 | n & 15) / 255) : null) : (n = nr.exec(t)) ? new g(n[1], n[2], n[3], 1) : (n = er.exec(t)) ? new g(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, 1) : (n = rr.exec(t)) ? Z(n[1], n[2], n[3], n[4]) : (n = ir.exec(t)) ? Z(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, n[4]) : (n = sr.exec(t)) ? Ht(n[1], n[2] / 100, n[3] / 100, 1) : (n = or.exec(t)) ? Ht(n[1], n[2] / 100, n[3] / 100, n[4]) : Ct.hasOwnProperty(t) ? It(Ct[t]) : t === "transparent" ? new g(NaN, NaN, NaN, 0) : null;
}
function It(t) {
  return new g(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
}
function Z(t, n, e, r) {
  return r <= 0 && (t = n = e = NaN), new g(t, n, e, r);
}
function fr(t) {
  return t instanceof K || (t = z(t)), t ? (t = t.rgb(), new g(t.r, t.g, t.b, t.opacity)) : new g();
}
function pt(t, n, e, r) {
  return arguments.length === 1 ? fr(t) : new g(t, n, e, r ?? 1);
}
function g(t, n, e, r) {
  this.r = +t, this.g = +n, this.b = +e, this.opacity = +r;
}
$t(g, pt, rn(K, {
  brighter(t) {
    return t = t == null ? et : Math.pow(et, t), new g(this.r * t, this.g * t, this.b * t, this.opacity);
  },
  darker(t) {
    return t = t == null ? V : Math.pow(V, t), new g(this.r * t, this.g * t, this.b * t, this.opacity);
  },
  rgb() {
    return this;
  },
  clamp() {
    return new g(C(this.r), C(this.g), C(this.b), rt(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: Ft,
  // Deprecated! Use color.formatHex.
  formatHex: Ft,
  formatHex8: lr,
  formatRgb: qt,
  toString: qt
}));
function Ft() {
  return `#${S(this.r)}${S(this.g)}${S(this.b)}`;
}
function lr() {
  return `#${S(this.r)}${S(this.g)}${S(this.b)}${S((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function qt() {
  const t = rt(this.opacity);
  return `${t === 1 ? "rgb(" : "rgba("}${C(this.r)}, ${C(this.g)}, ${C(this.b)}${t === 1 ? ")" : `, ${t})`}`;
}
function rt(t) {
  return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
}
function C(t) {
  return Math.max(0, Math.min(255, Math.round(t) || 0));
}
function S(t) {
  return t = C(t), (t < 16 ? "0" : "") + t.toString(16);
}
function Ht(t, n, e, r) {
  return r <= 0 ? t = n = e = NaN : e <= 0 || e >= 1 ? t = n = NaN : n <= 0 && (t = NaN), new w(t, n, e, r);
}
function sn(t) {
  if (t instanceof w) return new w(t.h, t.s, t.l, t.opacity);
  if (t instanceof K || (t = z(t)), !t) return new w();
  if (t instanceof w) return t;
  t = t.rgb();
  var n = t.r / 255, e = t.g / 255, r = t.b / 255, i = Math.min(n, e, r), s = Math.max(n, e, r), o = NaN, a = s - i, u = (s + i) / 2;
  return a ? (n === s ? o = (e - r) / a + (e < r) * 6 : e === s ? o = (r - n) / a + 2 : o = (n - e) / a + 4, a /= u < 0.5 ? s + i : 2 - s - i, o *= 60) : a = u > 0 && u < 1 ? 0 : o, new w(o, a, u, t.opacity);
}
function cr(t, n, e, r) {
  return arguments.length === 1 ? sn(t) : new w(t, n, e, r ?? 1);
}
function w(t, n, e, r) {
  this.h = +t, this.s = +n, this.l = +e, this.opacity = +r;
}
$t(w, cr, rn(K, {
  brighter(t) {
    return t = t == null ? et : Math.pow(et, t), new w(this.h, this.s, this.l * t, this.opacity);
  },
  darker(t) {
    return t = t == null ? V : Math.pow(V, t), new w(this.h, this.s, this.l * t, this.opacity);
  },
  rgb() {
    var t = this.h % 360 + (this.h < 0) * 360, n = isNaN(t) || isNaN(this.s) ? 0 : this.s, e = this.l, r = e + (e < 0.5 ? e : 1 - e) * n, i = 2 * e - r;
    return new g(
      lt(t >= 240 ? t - 240 : t + 120, i, r),
      lt(t, i, r),
      lt(t < 120 ? t + 240 : t - 120, i, r),
      this.opacity
    );
  },
  clamp() {
    return new w(Pt(this.h), Q(this.s), Q(this.l), rt(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 = rt(this.opacity);
    return `${t === 1 ? "hsl(" : "hsla("}${Pt(this.h)}, ${Q(this.s) * 100}%, ${Q(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
  }
}));
function Pt(t) {
  return t = (t || 0) % 360, t < 0 ? t + 360 : t;
}
function Q(t) {
  return Math.max(0, Math.min(1, t || 0));
}
function lt(t, n, e) {
  return (t < 60 ? n + (e - n) * t / 60 : t < 180 ? e : t < 240 ? n + (e - n) * (240 - t) / 60 : n) * 255;
}
const Nt = (t) => () => t;
function on(t, n) {
  return function(e) {
    return t + e * n;
  };
}
function hr(t, n, e) {
  return t = Math.pow(t, e), n = Math.pow(n, e) - t, e = 1 / e, function(r) {
    return Math.pow(t + r * n, e);
  };
}
function Vi(t, n) {
  var e = n - t;
  return e ? on(t, e > 180 || e < -180 ? e - 360 * Math.round(e / 360) : e) : Nt(isNaN(t) ? n : t);
}
function pr(t) {
  return (t = +t) == 1 ? an : function(n, e) {
    return e - n ? hr(n, e, t) : Nt(isNaN(n) ? e : n);
  };
}
function an(t, n) {
  var e = n - t;
  return e ? on(t, e) : Nt(isNaN(t) ? n : t);
}
const Lt = function t(n) {
  var e = pr(n);
  function r(i, s) {
    var o = e((i = pt(i)).r, (s = pt(s)).r), a = e(i.g, s.g), u = e(i.b, s.b), f = an(i.opacity, s.opacity);
    return function(l) {
      return i.r = o(l), i.g = a(l), i.b = u(l), i.opacity = f(l), i + "";
    };
  }
  return r.gamma = t, r;
}(1);
function E(t, n) {
  return t = +t, n = +n, function(e) {
    return t * (1 - e) + n * e;
  };
}
var _t = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ct = new RegExp(_t.source, "g");
function _r(t) {
  return function() {
    return t;
  };
}
function dr(t) {
  return function(n) {
    return t(n) + "";
  };
}
function gr(t, n) {
  var e = _t.lastIndex = ct.lastIndex = 0, r, i, s, o = -1, a = [], u = [];
  for (t = t + "", n = n + ""; (r = _t.exec(t)) && (i = ct.exec(n)); )
    (s = i.index) > e && (s = n.slice(e, s), a[o] ? a[o] += s : a[++o] = s), (r = r[0]) === (i = i[0]) ? a[o] ? a[o] += i : a[++o] = i : (a[++o] = null, u.push({ i: o, x: E(r, i) })), e = ct.lastIndex;
  return e < n.length && (s = n.slice(e), a[o] ? a[o] += s : a[++o] = s), a.length < 2 ? u[0] ? dr(u[0].x) : _r(n) : (n = u.length, function(f) {
    for (var l = 0, c; l < n; ++l) a[(c = u[l]).i] = c.x(f);
    return a.join("");
  });
}
var Xt = 180 / Math.PI, dt = {
  translateX: 0,
  translateY: 0,
  rotate: 0,
  skewX: 0,
  scaleX: 1,
  scaleY: 1
};
function un(t, n, e, r, i, s) {
  var o, a, u;
  return (o = Math.sqrt(t * t + n * n)) && (t /= o, n /= o), (u = t * e + n * r) && (e -= t * u, r -= n * u), (a = Math.sqrt(e * e + r * r)) && (e /= a, r /= a, u /= a), t * r < n * e && (t = -t, n = -n, u = -u, o = -o), {
    translateX: i,
    translateY: s,
    rotate: Math.atan2(n, t) * Xt,
    skewX: Math.atan(u) * Xt,
    scaleX: o,
    scaleY: a
  };
}
var W;
function yr(t) {
  const n = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
  return n.isIdentity ? dt : un(n.a, n.b, n.c, n.d, n.e, n.f);
}
function wr(t) {
  return t == null || (W || (W = document.createElementNS("http://www.w3.org/2000/svg", "g")), W.setAttribute("transform", t), !(t = W.transform.baseVal.consolidate())) ? dt : (t = t.matrix, un(t.a, t.b, t.c, t.d, t.e, t.f));
}
function fn(t, n, e, r) {
  function i(f) {
    return f.length ? f.pop() + " " : "";
  }
  function s(f, l, c, h, p, _) {
    if (f !== c || l !== h) {
      var d = p.push("translate(", null, n, null, e);
      _.push({ i: d - 4, x: E(f, c) }, { i: d - 2, x: E(l, h) });
    } else (c || h) && p.push("translate(" + c + n + h + e);
  }
  function o(f, l, c, h) {
    f !== l ? (f - l > 180 ? l += 360 : l - f > 180 && (f += 360), h.push({ i: c.push(i(c) + "rotate(", null, r) - 2, x: E(f, l) })) : l && c.push(i(c) + "rotate(" + l + r);
  }
  function a(f, l, c, h) {
    f !== l ? h.push({ i: c.push(i(c) + "skewX(", null, r) - 2, x: E(f, l) }) : l && c.push(i(c) + "skewX(" + l + r);
  }
  function u(f, l, c, h, p, _) {
    if (f !== c || l !== h) {
      var d = p.push(i(p) + "scale(", null, ",", null, ")");
      _.push({ i: d - 4, x: E(f, c) }, { i: d - 2, x: E(l, h) });
    } else (c !== 1 || h !== 1) && p.push(i(p) + "scale(" + c + "," + h + ")");
  }
  return function(f, l) {
    var c = [], h = [];
    return f = t(f), l = t(l), s(f.translateX, f.translateY, l.translateX, l.translateY, c, h), o(f.rotate, l.rotate, c, h), a(f.skewX, l.skewX, c, h), u(f.scaleX, f.scaleY, l.scaleX, l.scaleY, c, h), f = l = null, function(p) {
      for (var _ = -1, d = h.length, b; ++_ < d; ) c[(b = h[_]).i] = b.x(p);
      return c.join("");
    };
  };
}
var xr = fn(yr, "px, ", "px)", "deg)"), vr = fn(wr, ", ", ")", ")"), H = 0, X = 0, L = 0, ln = 1e3, it, D, st = 0, T = 0, ut = 0, B = typeof performance == "object" && performance.now ? performance : Date, cn = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(t) {
  setTimeout(t, 17);
};
function At() {
  return T || (cn(mr), T = B.now() + ut);
}
function mr() {
  T = 0;
}
function ot() {
  this._call = this._time = this._next = null;
}
ot.prototype = hn.prototype = {
  constructor: ot,
  restart: function(t, n, e) {
    if (typeof t != "function") throw new TypeError("callback is not a function");
    e = (e == null ? At() : +e) + (n == null ? 0 : +n), !this._next && D !== this && (D ? D._next = this : it = this, D = this), this._call = t, this._time = e, gt();
  },
  stop: function() {
    this._call && (this._call = null, this._time = 1 / 0, gt());
  }
};
function hn(t, n, e) {
  var r = new ot();
  return r.restart(t, n, e), r;
}
function br() {
  At(), ++H;
  for (var t = it, n; t; )
    (n = T - t._time) >= 0 && t._call.call(void 0, n), t = t._next;
  --H;
}
function Dt() {
  T = (st = B.now()) + ut, H = X = 0;
  try {
    br();
  } finally {
    H = 0, Nr(), T = 0;
  }
}
function $r() {
  var t = B.now(), n = t - st;
  n > ln && (ut -= n, st = t);
}
function Nr() {
  for (var t, n = it, e, r = 1 / 0; n; )
    n._call ? (r > n._time && (r = n._time), t = n, n = n._next) : (e = n._next, n._next = null, n = t ? t._next = e : it = e);
  D = t, gt(r);
}
function gt(t) {
  if (!H) {
    X && (X = clearTimeout(X));
    var n = t - T;
    n > 24 ? (t < 1 / 0 && (X = setTimeout(Dt, t - B.now() - ut)), L && (L = clearInterval(L))) : (L || (st = B.now(), L = setInterval($r, ln)), H = 1, cn(Dt));
  }
}
function Ot(t, n, e) {
  var r = new ot();
  return n = n == null ? 0 : +n, r.restart((i) => {
    r.stop(), t(i + n);
  }, n, e), r;
}
var Ar = zt("start", "end", "cancel", "interrupt"), Er = [], pn = 0, Vt = 1, yt = 2, j = 3, Yt = 4, wt = 5, tt = 6;
function ft(t, n, e, r, i, s) {
  var o = t.__transition;
  if (!o) t.__transition = {};
  else if (e in o) return;
  kr(t, e, {
    name: n,
    index: r,
    // For context during callback.
    group: i,
    // For context during callback.
    on: Ar,
    tween: Er,
    time: s.time,
    delay: s.delay,
    duration: s.duration,
    ease: s.ease,
    timer: null,
    state: pn
  });
}
function Et(t, n) {
  var e = x(t, n);
  if (e.state > pn) throw new Error("too late; already scheduled");
  return e;
}
function m(t, n) {
  var e = x(t, n);
  if (e.state > j) throw new Error("too late; already running");
  return e;
}
function x(t, n) {
  var e = t.__transition;
  if (!e || !(e = e[n])) throw new Error("transition not found");
  return e;
}
function kr(t, n, e) {
  var r = t.__transition, i;
  r[n] = e, e.timer = hn(s, 0, e.time);
  function s(f) {
    e.state = Vt, e.timer.restart(o, e.delay, e.time), e.delay <= f && o(f - e.delay);
  }
  function o(f) {
    var l, c, h, p;
    if (e.state !== Vt) return u();
    for (l in r)
      if (p = r[l], p.name === e.name) {
        if (p.state === j) return Ot(o);
        p.state === Yt ? (p.state = tt, p.timer.stop(), p.on.call("interrupt", t, t.__data__, p.index, p.group), delete r[l]) : +l < n && (p.state = tt, p.timer.stop(), p.on.call("cancel", t, t.__data__, p.index, p.group), delete r[l]);
      }
    if (Ot(function() {
      e.state === j && (e.state = Yt, e.timer.restart(a, e.delay, e.time), a(f));
    }), e.state = yt, e.on.call("start", t, t.__data__, e.index, e.group), e.state === yt) {
      for (e.state = j, i = new Array(h = e.tween.length), l = 0, c = -1; l < h; ++l)
        (p = e.tween[l].value.call(t, t.__data__, e.index, e.group)) && (i[++c] = p);
      i.length = c + 1;
    }
  }
  function a(f) {
    for (var l = f < e.duration ? e.ease.call(null, f / e.duration) : (e.timer.restart(u), e.state = wt, 1), c = -1, h = i.length; ++c < h; )
      i[c].call(t, l);
    e.state === wt && (e.on.call("end", t, t.__data__, e.index, e.group), u());
  }
  function u() {
    e.state = tt, e.timer.stop(), delete r[n];
    for (var f in r) return;
    delete t.__transition;
  }
}
function Mr(t, n) {
  var e = t.__transition, r, i, s = !0, o;
  if (e) {
    n = n == null ? null : n + "";
    for (o in e) {
      if ((r = e[o]).name !== n) {
        s = !1;
        continue;
      }
      i = r.state > yt && r.state < wt, r.state = tt, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete e[o];
    }
    s && delete t.__transition;
  }
}
function Sr(t) {
  return this.each(function() {
    Mr(this, t);
  });
}
function Cr(t, n) {
  var e, r;
  return function() {
    var i = m(this, t), s = i.tween;
    if (s !== e) {
      r = e = s;
      for (var o = 0, a = r.length; o < a; ++o)
        if (r[o].name === n) {
          r = r.slice(), r.splice(o, 1);
          break;
        }
    }
    i.tween = r;
  };
}
function Tr(t, n, e) {
  var r, i;
  if (typeof e != "function") throw new Error();
  return function() {
    var s = m(this, t), o = s.tween;
    if (o !== r) {
      i = (r = o).slice();
      for (var a = { name: n, value: e }, u = 0, f = i.length; u < f; ++u)
        if (i[u].name === n) {
          i[u] = a;
          break;
        }
      u === f && i.push(a);
    }
    s.tween = i;
  };
}
function Rr(t, n) {
  var e = this._id;
  if (t += "", arguments.length < 2) {
    for (var r = x(this.node(), e).tween, i = 0, s = r.length, o; i < s; ++i)
      if ((o = r[i]).name === t)
        return o.value;
    return null;
  }
  return this.each((n == null ? Cr : Tr)(e, t, n));
}
function kt(t, n, e) {
  var r = t._id;
  return t.each(function() {
    var i = m(this, r);
    (i.value || (i.value = {}))[n] = e.apply(this, arguments);
  }), function(i) {
    return x(i, r).value[n];
  };
}
function _n(t, n) {
  var e;
  return (typeof n == "number" ? E : n instanceof z ? Lt : (e = z(n)) ? (n = e, Lt) : gr)(t, n);
}
function Ir(t) {
  return function() {
    this.removeAttribute(t);
  };
}
function Fr(t) {
  return function() {
    this.removeAttributeNS(t.space, t.local);
  };
}
function qr(t, n, e) {
  var r, i = e + "", s;
  return function() {
    var o = this.getAttribute(t);
    return o === i ? null : o === r ? s : s = n(r = o, e);
  };
}
function Hr(t, n, e) {
  var r, i = e + "", s;
  return function() {
    var o = this.getAttributeNS(t.space, t.local);
    return o === i ? null : o === r ? s : s = n(r = o, e);
  };
}
function Pr(t, n, e) {
  var r, i, s;
  return function() {
    var o, a = e(this), u;
    return a == null ? void this.removeAttribute(t) : (o = this.getAttribute(t), u = a + "", o === u ? null : o === r && u === i ? s : (i = u, s = n(r = o, a)));
  };
}
function Lr(t, n, e) {
  var r, i, s;
  return function() {
    var o, a = e(this), u;
    return a == null ? void this.removeAttributeNS(t.space, t.local) : (o = this.getAttributeNS(t.space, t.local), u = a + "", o === u ? null : o === r && u === i ? s : (i = u, s = n(r = o, a)));
  };
}
function Xr(t, n) {
  var e = at(t), r = e === "transform" ? vr : _n;
  return this.attrTween(t, typeof n == "function" ? (e.local ? Lr : Pr)(e, r, kt(this, "attr." + t, n)) : n == null ? (e.local ? Fr : Ir)(e) : (e.local ? Hr : qr)(e, r, n));
}
function Dr(t, n) {
  return function(e) {
    this.setAttribute(t, n.call(this, e));
  };
}
function Or(t, n) {
  return function(e) {
    this.setAttributeNS(t.space, t.local, n.call(this, e));
  };
}
function Vr(t, n) {
  var e, r;
  function i() {
    var s = n.apply(this, arguments);
    return s !== r && (e = (r = s) && Or(t, s)), e;
  }
  return i._value = n, i;
}
function Yr(t, n) {
  var e, r;
  function i() {
    var s = n.apply(this, arguments);
    return s !== r && (e = (r = s) && Dr(t, s)), e;
  }
  return i._value = n, i;
}
function zr(t, n) {
  var e = "attr." + t;
  if (arguments.length < 2) return (e = this.tween(e)) && e._value;
  if (n == null) return this.tween(e, null);
  if (typeof n != "function") throw new Error();
  var r = at(t);
  return this.tween(e, (r.local ? Vr : Yr)(r, n));
}
function Br(t, n) {
  return function() {
    Et(this, t).delay = +n.apply(this, arguments);
  };
}
function Ur(t, n) {
  return n = +n, function() {
    Et(this, t).delay = n;
  };
}
function Kr(t) {
  var n = this._id;
  return arguments.length ? this.each((typeof t == "function" ? Br : Ur)(n, t)) : x(this.node(), n).delay;
}
function Gr(t, n) {
  return function() {
    m(this, t).duration = +n.apply(this, arguments);
  };
}
function Zr(t, n) {
  return n = +n, function() {
    m(this, t).duration = n;
  };
}
function Qr(t) {
  var n = this._id;
  return arguments.length ? this.each((typeof t == "function" ? Gr : Zr)(n, t)) : x(this.node(), n).duration;
}
function Wr(t, n) {
  if (typeof n != "function") throw new Error();
  return function() {
    m(this, t).ease = n;
  };
}
function Jr(t) {
  var n = this._id;
  return arguments.length ? this.each(Wr(n, t)) : x(this.node(), n).ease;
}
function jr(t, n) {
  return function() {
    var e = n.apply(this, arguments);
    if (typeof e != "function") throw new Error();
    m(this, t).ease = e;
  };
}
function ti(t) {
  if (typeof t != "function") throw new Error();
  return this.each(jr(this._id, t));
}
function ni(t) {
  typeof t != "function" && (t = Kt(t));
  for (var n = this._groups, e = n.length, r = new Array(e), i = 0; i < e; ++i)
    for (var s = n[i], o = s.length, a = r[i] = [], u, f = 0; f < o; ++f)
      (u = s[f]) && t.call(u, u.__data__, f, s) && a.push(u);
  return new N(r, this._parents, this._name, this._id);
}
function ei(t) {
  if (t._id !== this._id) throw new Error();
  for (var n = this._groups, e = t._groups, r = n.length, i = e.length, s = Math.min(r, i), o = new Array(r), a = 0; a < s; ++a)
    for (var u = n[a], f = e[a], l = u.length, c = o[a] = new Array(l), h, p = 0; p < l; ++p)
      (h = u[p] || f[p]) && (c[p] = h);
  for (; a < r; ++a)
    o[a] = n[a];
  return new N(o, this._parents, this._name, this._id);
}
function ri(t) {
  return (t + "").trim().split(/^|\s+/).every(function(n) {
    var e = n.indexOf(".");
    return e >= 0 && (n = n.slice(0, e)), !n || n === "start";
  });
}
function ii(t, n, e) {
  var r, i, s = ri(n) ? Et : m;
  return function() {
    var o = s(this, t), a = o.on;
    a !== r && (i = (r = a).copy()).on(n, e), o.on = i;
  };
}
function si(t, n) {
  var e = this._id;
  return arguments.length < 2 ? x(this.node(), e).on.on(t) : this.each(ii(e, t, n));
}
function oi(t) {
  return function() {
    var n = this.parentNode;
    for (var e in this.__transition) if (+e !== t) return;
    n && n.removeChild(this);
  };
}
function ai() {
  return this.on("end.remove", oi(this._id));
}
function ui(t) {
  var n = this._name, e = this._id;
  typeof t != "function" && (t = mt(t));
  for (var r = this._groups, i = r.length, s = new Array(i), o = 0; o < i; ++o)
    for (var a = r[o], u = a.length, f = s[o] = new Array(u), l, c, h = 0; h < u; ++h)
      (l = a[h]) && (c = t.call(l, l.__data__, h, a)) && ("__data__" in l && (c.__data__ = l.__data__), f[h] = c, ft(f[h], n, e, h, f, x(l, e)));
  return new N(s, this._parents, n, e);
}
function fi(t) {
  var n = this._name, e = this._id;
  typeof t != "function" && (t = Ut(t));
  for (var r = this._groups, i = r.length, s = [], o = [], a = 0; a < i; ++a)
    for (var u = r[a], f = u.length, l, c = 0; c < f; ++c)
      if (l = u[c]) {
        for (var h = t.call(l, l.__data__, c, u), p, _ = x(l, e), d = 0, b = h.length; d < b; ++d)
          (p = h[d]) && ft(p, n, e, d, h, _);
        s.push(h), o.push(l);
      }
  return new N(s, o, n, e);
}
var li = U.prototype.constructor;
function ci() {
  return new li(this._groups, this._parents);
}
function hi(t, n) {
  var e, r, i;
  return function() {
    var s = q(this, t), o = (this.style.removeProperty(t), q(this, t));
    return s === o ? null : s === e && o === r ? i : i = n(e = s, r = o);
  };
}
function dn(t) {
  return function() {
    this.style.removeProperty(t);
  };
}
function pi(t, n, e) {
  var r, i = e + "", s;
  return function() {
    var o = q(this, t);
    return o === i ? null : o === r ? s : s = n(r = o, e);
  };
}
function _i(t, n, e) {
  var r, i, s;
  return function() {
    var o = q(this, t), a = e(this), u = a + "";
    return a == null && (u = a = (this.style.removeProperty(t), q(this, t))), o === u ? null : o === r && u === i ? s : (i = u, s = n(r = o, a));
  };
}
function di(t, n) {
  var e, r, i, s = "style." + n, o = "end." + s, a;
  return function() {
    var u = m(this, t), f = u.on, l = u.value[s] == null ? a || (a = dn(n)) : void 0;
    (f !== e || i !== l) && (r = (e = f).copy()).on(o, i = l), u.on = r;
  };
}
function gi(t, n, e) {
  var r = (t += "") == "transform" ? xr : _n;
  return n == null ? this.styleTween(t, hi(t, r)).on("end.style." + t, dn(t)) : typeof n == "function" ? this.styleTween(t, _i(t, r, kt(this, "style." + t, n))).each(di(this._id, t)) : this.styleTween(t, pi(t, r, n), e).on("end.style." + t, null);
}
function yi(t, n, e) {
  return function(r) {
    this.style.setProperty(t, n.call(this, r), e);
  };
}
function wi(t, n, e) {
  var r, i;
  function s() {
    var o = n.apply(this, arguments);
    return o !== i && (r = (i = o) && yi(t, o, e)), r;
  }
  return s._value = n, s;
}
function xi(t, n, e) {
  var r = "style." + (t += "");
  if (arguments.length < 2) return (r = this.tween(r)) && r._value;
  if (n == null) return this.tween(r, null);
  if (typeof n != "function") throw new Error();
  return this.tween(r, wi(t, n, e ?? ""));
}
function vi(t) {
  return function() {
    this.textContent = t;
  };
}
function mi(t) {
  return function() {
    var n = t(this);
    this.textContent = n ?? "";
  };
}
function bi(t) {
  return this.tween("text", typeof t == "function" ? mi(kt(this, "text", t)) : vi(t == null ? "" : t + ""));
}
function $i(t) {
  return function(n) {
    this.textContent = t.call(this, n);
  };
}
function Ni(t) {
  var n, e;
  function r() {
    var i = t.apply(this, arguments);
    return i !== e && (n = (e = i) && $i(i)), n;
  }
  return r._value = t, r;
}
function Ai(t) {
  var n = "text";
  if (arguments.length < 1) return (n = this.tween(n)) && n._value;
  if (t == null) return this.tween(n, null);
  if (typeof t != "function") throw new Error();
  return this.tween(n, Ni(t));
}
function Ei() {
  for (var t = this._name, n = this._id, e = gn(), r = this._groups, i = r.length, s = 0; s < i; ++s)
    for (var o = r[s], a = o.length, u, f = 0; f < a; ++f)
      if (u = o[f]) {
        var l = x(u, n);
        ft(u, t, e, f, o, {
          time: l.time + l.delay + l.duration,
          delay: 0,
          duration: l.duration,
          ease: l.ease
        });
      }
  return new N(r, this._parents, t, e);
}
function ki() {
  var t, n, e = this, r = e._id, i = e.size();
  return new Promise(function(s, o) {
    var a = { value: o }, u = { value: function() {
      --i === 0 && s();
    } };
    e.each(function() {
      var f = m(this, r), l = f.on;
      l !== t && (n = (t = l).copy(), n._.cancel.push(a), n._.interrupt.push(a), n._.end.push(u)), f.on = n;
    }), i === 0 && s();
  });
}
var Mi = 0;
function N(t, n, e, r) {
  this._groups = t, this._parents = n, this._name = e, this._id = r;
}
function gn() {
  return ++Mi;
}
var $ = U.prototype;
N.prototype = {
  constructor: N,
  select: ui,
  selectAll: fi,
  selectChild: $.selectChild,
  selectChildren: $.selectChildren,
  filter: ni,
  merge: ei,
  selection: ci,
  transition: Ei,
  call: $.call,
  nodes: $.nodes,
  node: $.node,
  size: $.size,
  empty: $.empty,
  each: $.each,
  on: si,
  attr: Xr,
  attrTween: zr,
  style: gi,
  styleTween: xi,
  text: bi,
  textTween: Ai,
  remove: ai,
  tween: Rr,
  delay: Kr,
  duration: Qr,
  ease: Jr,
  easeVarying: ti,
  end: ki,
  [Symbol.iterator]: $[Symbol.iterator]
};
function Si(t) {
  return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
}
var Ci = {
  time: null,
  // Set on use.
  delay: 0,
  duration: 250,
  ease: Si
};
function Ti(t, n) {
  for (var e; !(e = t.__transition) || !(e = e[n]); )
    if (!(t = t.parentNode))
      throw new Error(`transition ${n} not found`);
  return e;
}
function Ri(t) {
  var n, e;
  t instanceof N ? (n = t._id, t = t._name) : (n = gn(), (e = Ci).time = At(), t = t == null ? null : t + "");
  for (var r = this._groups, i = r.length, s = 0; s < i; ++s)
    for (var o = r[s], a = o.length, u, f = 0; f < a; ++f)
      (u = o[f]) && ft(u, t, n, f, o, e || Ti(u, n));
  return new N(r, this._parents, t, n);
}
U.prototype.interrupt = Sr;
U.prototype.transition = Ri;
const xt = Math.PI, vt = 2 * xt, M = 1e-6, Ii = vt - M;
function yn(t) {
  this._ += t[0];
  for (let n = 1, e = t.length; n < e; ++n)
    this._ += arguments[n] + t[n];
}
function Fi(t) {
  let n = Math.floor(t);
  if (!(n >= 0)) throw new Error(`invalid digits: ${t}`);
  if (n > 15) return yn;
  const e = 10 ** n;
  return function(r) {
    this._ += r[0];
    for (let i = 1, s = r.length; i < s; ++i)
      this._ += Math.round(arguments[i] * e) / e + r[i];
  };
}
class qi {
  constructor(n) {
    this._x0 = this._y0 = // start of current subpath
    this._x1 = this._y1 = null, this._ = "", this._append = n == null ? yn : Fi(n);
  }
  moveTo(n, e) {
    this._append`M${this._x0 = this._x1 = +n},${this._y0 = this._y1 = +e}`;
  }
  closePath() {
    this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
  }
  lineTo(n, e) {
    this._append`L${this._x1 = +n},${this._y1 = +e}`;
  }
  quadraticCurveTo(n, e, r, i) {
    this._append`Q${+n},${+e},${this._x1 = +r},${this._y1 = +i}`;
  }
  bezierCurveTo(n, e, r, i, s, o) {
    this._append`C${+n},${+e},${+r},${+i},${this._x1 = +s},${this._y1 = +o}`;
  }
  arcTo(n, e, r, i, s) {
    if (n = +n, e = +e, r = +r, i = +i, s = +s, s < 0) throw new Error(`negative radius: ${s}`);
    let o = this._x1, a = this._y1, u = r - n, f = i - e, l = o - n, c = a - e, h = l * l + c * c;
    if (this._x1 === null)
      this._append`M${this._x1 = n},${this._y1 = e}`;
    else if (h > M) if (!(Math.abs(c * u - f * l) > M) || !s)
      this._append`L${this._x1 = n},${this._y1 = e}`;
    else {
      let p = r - o, _ = i - a, d = u * u + f * f, b = p * p + _ * _, G = Math.sqrt(d), A = Math.sqrt(h), k = s * Math.tan((xt - Math.acos((d + h - b) / (2 * G * A))) / 2), R = k / A, P = k / G;
      Math.abs(R - 1) > M && this._append`L${n + R * l},${e + R * c}`, this._append`A${s},${s},0,0,${+(c * p > l * _)},${this._x1 = n + P * u},${this._y1 = e + P * f}`;
    }
  }
  arc(n, e, r, i, s, o) {
    if (n = +n, e = +e, r = +r, o = !!o, r < 0) throw new Error(`negative radius: ${r}`);
    let a = r * Math.cos(i), u = r * Math.sin(i), f = n + a, l = e + u, c = 1 ^ o, h = o ? i - s : s - i;
    this._x1 === null ? this._append`M${f},${l}` : (Math.abs(this._x1 - f) > M || Math.abs(this._y1 - l) > M) && this._append`L${f},${l}`, r && (h < 0 && (h = h % vt + vt), h > Ii ? this._append`A${r},${r},0,1,${c},${n - a},${e - u}A${r},${r},0,1,${c},${this._x1 = f},${this._y1 = l}` : h > M && this._append`A${r},${r},0,${+(h >= xt)},${c},${this._x1 = n + r * Math.cos(s)},${this._y1 = e + r * Math.sin(s)}`);
  }
  rect(n, e, r, i) {
    this._append`M${this._x0 = this._x1 = +n},${this._y0 = this._y1 = +e}h${r = +r}v${+i}h${-r}Z`;
  }
  toString() {
    return this._;
  }
}
function I(t) {
  return function() {
    return t;
  };
}
function Hi(t) {
  let n = 3;
  return t.digits = function(e) {
    if (!arguments.length) return n;
    if (e == null)
      n = null;
    else {
      const r = Math.floor(e);
      if (!(r >= 0)) throw new RangeError(`invalid digits: ${e}`);
      n = r;
    }
    return t;
  }, () => new qi(n);
}
function Pi(t) {
  return typeof t == "object" && "length" in t ? t : Array.from(t);
}
function wn(t) {
  this._context = t;
}
wn.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(t, n) {
    switch (t = +t, n = +n, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(t, n) : this._context.moveTo(t, n);
        break;
      case 1:
        this._point = 2;
      default:
        this._context.lineTo(t, n);
        break;
    }
  }
};
function Li(t) {
  return new wn(t);
}
function Xi(t) {
  return t[0];
}
function Di(t) {
  return t[1];
}
function Yi(t, n) {
  var e = I(!0), r = null, i = Li, s = null, o = Hi(a);
  t = typeof t == "function" ? t : t === void 0 ? Xi : I(t), n = typeof n == "function" ? n : n === void 0 ? Di : I(n);
  function a(u) {
    var f, l = (u = Pi(u)).length, c, h = !1, p;
    for (r == null && (s = i(p = o())), f = 0; f <= l; ++f)
      !(f < l && e(c = u[f], f, u)) === h && ((h = !h) ? s.lineStart() : s.lineEnd()), h && s.point(+t(c, f, u), +n(c, f, u));
    if (p) return s = null, p + "" || null;
  }
  return a.x = function(u) {
    return arguments.length ? (t = typeof u == "function" ? u : I(+u), a) : t;
  }, a.y = function(u) {
    return arguments.length ? (n = typeof u == "function" ? u : I(+u), a) : n;
  }, a.defined = function(u) {
    return arguments.length ? (e = typeof u == "function" ? u : I(!!u), a) : e;
  }, a.curve = function(u) {
    return arguments.length ? (i = u, r != null && (s = i(r)), a) : i;
  }, a.context = function(u) {
    return arguments.length ? (u == null ? r = s = null : s = i(r = u), a) : r;
  }, a;
}
function O(t, n, e) {
  this.k = t, this.x = n, this.y = e;
}
O.prototype = {
  constructor: O,
  scale: function(t) {
    return t === 1 ? this : new O(this.k * t, this.x, this.y);
  },
  translate: function(t, n) {
    return t === 0 & n === 0 ? this : new O(this.k, this.x + this.k * t, this.y + this.k * n);
  },
  apply: function(t) {
    return [t[0] * this.k + this.x, t[1] * this.k + this.y];
  },
  applyX: function(t) {
    return t * this.k + this.x;
  },
  applyY: function(t) {
    return t * this.k + this.y;
  },
  invert: function(t) {
    return [(t[0] - this.x) / this.k, (t[1] - this.y) / this.k];
  },
  invertX: function(t) {
    return (t - this.x) / this.k;
  },
  invertY: function(t) {
    return (t - this.y) / this.k;
  },
  rescaleX: function(t) {
    return t.copy().domain(t.range().map(this.invertX, this).map(t.invert, t));
  },
  rescaleY: function(t) {
    return t.copy().domain(t.range().map(this.invertY, this).map(t.invert, t));
  },
  toString: function() {
    return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
  }
};
O.prototype;
export {
  K as C,
  g as R,
  Pi as a,
  Nt as b,
  I as c,
  z as d,
  Lt as e,
  gr as f,
  Li as g,
  $t as h,
  E as i,
  rn as j,
  Vi as k,
  Yi as l,
  an as n,
  fr as r,
  Oi as s,
  Hi as w
};
