import { T as zt, d as Yt, t as Ut, n as Kt } from "./timer.B39XOBYL.js";
var W = "http://www.w3.org/1999/xhtml";
const ut = {
  svg: "http://www.w3.org/2000/svg",
  xhtml: W,
  xlink: "http://www.w3.org/1999/xlink",
  xml: "http://www.w3.org/XML/1998/namespace",
  xmlns: "http://www.w3.org/2000/xmlns/"
};
function Y(t) {
  var n = t += "", e = n.indexOf(":");
  return e >= 0 && (n = t.slice(0, e)) !== "xmlns" && (t = t.slice(e + 1)), ut.hasOwnProperty(n) ? { space: ut[n], local: t } : t;
}
function Gt(t) {
  return function() {
    var n = this.ownerDocument, e = this.namespaceURI;
    return e === W && n.documentElement.namespaceURI === W ? n.createElement(t) : n.createElementNS(e, t);
  };
}
function Wt(t) {
  return function() {
    return this.ownerDocument.createElementNS(t.space, t.local);
  };
}
function bt(t) {
  var n = Y(t);
  return (n.local ? Wt : Gt)(n);
}
function Jt() {
}
function nt(t) {
  return t == null ? Jt : function() {
    return this.querySelector(t);
  };
}
function Qt(t) {
  typeof t != "function" && (t = nt(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 Zt(t) {
  return t == null ? [] : Array.isArray(t) ? t : Array.from(t);
}
function jt() {
  return [];
}
function Nt(t) {
  return t == null ? jt : function() {
    return this.querySelectorAll(t);
  };
}
function tn(t) {
  return function() {
    return Zt(t.apply(this, arguments));
  };
}
function nn(t) {
  typeof t == "function" ? t = tn(t) : t = Nt(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 At(t) {
  return function() {
    return this.matches(t);
  };
}
function $t(t) {
  return function(n) {
    return n.matches(t);
  };
}
var en = Array.prototype.find;
function rn(t) {
  return function() {
    return en.call(this.children, t);
  };
}
function sn() {
  return this.firstElementChild;
}
function on(t) {
  return this.select(t == null ? sn : rn(typeof t == "function" ? t : $t(t)));
}
var an = Array.prototype.filter;
function un() {
  return Array.from(this.children);
}
function fn(t) {
  return function() {
    return an.call(this.children, t);
  };
}
function ln(t) {
  return this.selectAll(t == null ? un : fn(typeof t == "function" ? t : $t(t)));
}
function cn(t) {
  typeof t != "function" && (t = At(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 St(t) {
  return new Array(t.length);
}
function hn() {
  return new y(this._enter || this._groups.map(St), this._parents);
}
function V(t, n) {
  this.ownerDocument = t.ownerDocument, this.namespaceURI = t.namespaceURI, this._next = null, this._parent = t, this.__data__ = n;
}
V.prototype = {
  constructor: V,
  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 pn(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 V(t, s[o]);
  for (; o < u; ++o)
    (a = n[o]) && (i[o] = a);
}
function _n(t, n, e, r, i, s, o) {
  var a, u, f = /* @__PURE__ */ new Map(), l = n.length, c = s.length, h = new Array(l), d;
  for (a = 0; a < l; ++a)
    (u = n[a]) && (h[a] = d = o.call(u, u.__data__, a, n) + "", f.has(d) ? i[a] = u : f.set(d, u));
  for (a = 0; a < c; ++a)
    d = o.call(t, s[a], a, s) + "", (u = f.get(d)) ? (r[a] = u, u.__data__ = s[a], f.delete(d)) : e[a] = new V(t, s[a]);
  for (a = 0; a < l; ++a)
    (u = n[a]) && f.get(h[a]) === u && (i[a] = u);
}
function gn(t) {
  return t.__data__;
}
function xn(t, n) {
  if (!arguments.length) return Array.from(this, gn);
  var e = n ? _n : pn, 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, d = yn(t.call(l, l && l.__data__, f, r)), p = d.length, _ = a[f] = new Array(p), $ = o[f] = new Array(p), Bt = u[f] = new Array(h);
    e(l, c, _, $, Bt, d, n);
    for (var k = 0, q = 0, ot, at; k < p; ++k)
      if (ot = _[k]) {
        for (k >= q && (q = k + 1); !(at = $[q]) && ++q < p; ) ;
        ot._next = at || null;
      }
  }
  return o = new y(o, r), o._enter = a, o._exit = u, o;
}
function yn(t) {
  return typeof t == "object" && "length" in t ? t : Array.from(t);
}
function wn() {
  return new y(this._exit || this._groups.map(St), this._parents);
}
function vn(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 mn(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), d, p = 0; p < c; ++p)
      (d = f[p] || l[p]) && (h[p] = d);
  for (; u < i; ++u)
    a[u] = e[u];
  return new y(a, this._parents);
}
function bn() {
  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 Nn(t) {
  t || (t = An);
  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 An(t, n) {
  return t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN;
}
function $n() {
  var t = arguments[0];
  return arguments[0] = this, t.apply(null, arguments), this;
}
function Sn() {
  return Array.from(this);
}
function En() {
  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 Cn() {
  let t = 0;
  for (const n of this) ++t;
  return t;
}
function Rn() {
  return !this.node();
}
function kn(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 Mn(t) {
  return function() {
    this.removeAttribute(t);
  };
}
function Tn(t) {
  return function() {
    this.removeAttributeNS(t.space, t.local);
  };
}
function In(t, n) {
  return function() {
    this.setAttribute(t, n);
  };
}
function Hn(t, n) {
  return function() {
    this.setAttributeNS(t.space, t.local, n);
  };
}
function Fn(t, n) {
  return function() {
    var e = n.apply(this, arguments);
    e == null ? this.removeAttribute(t) : this.setAttribute(t, e);
  };
}
function qn(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 Xn(t, n) {
  var e = Y(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 ? Tn : Mn : typeof n == "function" ? e.local ? qn : Fn : e.local ? Hn : In)(e, n));
}
function Et(t) {
  return t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView;
}
function Dn(t) {
  return function() {
    this.style.removeProperty(t);
  };
}
function Ln(t, n, e) {
  return function() {
    this.style.setProperty(t, n, e);
  };
}
function Pn(t, n, e) {
  return function() {
    var r = n.apply(this, arguments);
    r == null ? this.style.removeProperty(t) : this.style.setProperty(t, r, e);
  };
}
function On(t, n, e) {
  return arguments.length > 1 ? this.each((n == null ? Dn : typeof n == "function" ? Pn : Ln)(t, n, e ?? "")) : R(this.node(), t);
}
function R(t, n) {
  return t.style.getPropertyValue(n) || Et(t).getComputedStyle(t, null).getPropertyValue(n);
}
function Vn(t) {
  return function() {
    delete this[t];
  };
}
function Bn(t, n) {
  return function() {
    this[t] = n;
  };
}
function zn(t, n) {
  return function() {
    var e = n.apply(this, arguments);
    e == null ? delete this[t] : this[t] = e;
  };
}
function Yn(t, n) {
  return arguments.length > 1 ? this.each((n == null ? Vn : typeof n == "function" ? zn : Bn)(t, n)) : this.node()[t];
}
function Ct(t) {
  return t.trim().split(/^|\s+/);
}
function et(t) {
  return t.classList || new Rt(t);
}
function Rt(t) {
  this._node = t, this._names = Ct(t.getAttribute("class") || "");
}
Rt.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 kt(t, n) {
  for (var e = et(t), r = -1, i = n.length; ++r < i; ) e.add(n[r]);
}
function Mt(t, n) {
  for (var e = et(t), r = -1, i = n.length; ++r < i; ) e.remove(n[r]);
}
function Un(t) {
  return function() {
    kt(this, t);
  };
}
function Kn(t) {
  return function() {
    Mt(this, t);
  };
}
function Gn(t, n) {
  return function() {
    (n.apply(this, arguments) ? kt : Mt)(this, t);
  };
}
function Wn(t, n) {
  var e = Ct(t + "");
  if (arguments.length < 2) {
    for (var r = et(this.node()), i = -1, s = e.length; ++i < s; ) if (!r.contains(e[i])) return !1;
    return !0;
  }
  return this.each((typeof n == "function" ? Gn : n ? Un : Kn)(e, n));
}
function Jn() {
  this.textContent = "";
}
function Qn(t) {
  return function() {
    this.textContent = t;
  };
}
function Zn(t) {
  return function() {
    var n = t.apply(this, arguments);
    this.textContent = n ?? "";
  };
}
function jn(t) {
  return arguments.length ? this.each(t == null ? Jn : (typeof t == "function" ? Zn : Qn)(t)) : this.node().textContent;
}
function te() {
  this.innerHTML = "";
}
function ne(t) {
  return function() {
    this.innerHTML = t;
  };
}
function ee(t) {
  return function() {
    var n = t.apply(this, arguments);
    this.innerHTML = n ?? "";
  };
}
function re(t) {
  return arguments.length ? this.each(t == null ? te : (typeof t == "function" ? ee : ne)(t)) : this.node().innerHTML;
}
function ie() {
  this.nextSibling && this.parentNode.appendChild(this);
}
function se() {
  return this.each(ie);
}
function oe() {
  this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
}
function ae() {
  return this.each(oe);
}
function ue(t) {
  var n = typeof t == "function" ? t : bt(t);
  return this.select(function() {
    return this.appendChild(n.apply(this, arguments));
  });
}
function fe() {
  return null;
}
function le(t, n) {
  var e = typeof t == "function" ? t : bt(t), r = n == null ? fe : typeof n == "function" ? n : nt(n);
  return this.select(function() {
    return this.insertBefore(e.apply(this, arguments), r.apply(this, arguments) || null);
  });
}
function ce() {
  var t = this.parentNode;
  t && t.removeChild(this);
}
function he() {
  return this.each(ce);
}
function de() {
  var t = this.cloneNode(!1), n = this.parentNode;
  return n ? n.insertBefore(t, this.nextSibling) : t;
}
function pe() {
  var t = this.cloneNode(!0), n = this.parentNode;
  return n ? n.insertBefore(t, this.nextSibling) : t;
}
function _e(t) {
  return this.select(t ? pe : de);
}
function ge(t) {
  return arguments.length ? this.property("__data__", t) : this.node().__data__;
}
function xe(t) {
  return function(n) {
    t.call(this, n, this.__data__);
  };
}
function ye(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 we(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 ve(t, n, e) {
  return function() {
    var r = this.__on, i, s = xe(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 me(t, n, e) {
  var r = ye(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 ? ve : we, i = 0; i < s; ++i) this.each(a(r[i], n, e));
  return this;
}
function Tt(t, n, e) {
  var r = Et(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 be(t, n) {
  return function() {
    return Tt(this, t, n);
  };
}
function Ne(t, n) {
  return function() {
    return Tt(this, t, n.apply(this, arguments));
  };
}
function Ae(t, n) {
  return this.each((typeof n == "function" ? Ne : be)(t, n));
}
function* $e() {
  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 Se = [null];
function y(t, n) {
  this._groups = t, this._parents = n;
}
function H() {
  return new y([[document.documentElement]], Se);
}
function Ee() {
  return this;
}
y.prototype = H.prototype = {
  constructor: y,
  select: Qt,
  selectAll: nn,
  selectChild: on,
  selectChildren: ln,
  filter: cn,
  data: xn,
  enter: hn,
  exit: wn,
  join: vn,
  merge: mn,
  selection: Ee,
  order: bn,
  sort: Nn,
  call: $n,
  nodes: Sn,
  node: En,
  size: Cn,
  empty: Rn,
  each: kn,
  attr: Xn,
  style: On,
  property: Yn,
  classed: Wn,
  text: jn,
  html: re,
  raise: se,
  lower: ae,
  append: ue,
  insert: le,
  remove: he,
  clone: _e,
  datum: ge,
  on: me,
  dispatch: Ae,
  [Symbol.iterator]: $e
};
function rt(t, n, e) {
  t.prototype = n.prototype = e, e.constructor = t;
}
function It(t, n) {
  var e = Object.create(t.prototype);
  for (var r in n) e[r] = n[r];
  return e;
}
function F() {
}
var M = 0.7, B = 1 / M, C = "\\s*([+-]?\\d+)\\s*", T = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", v = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Ce = /^#([0-9a-f]{3,8})$/, Re = new RegExp(`^rgb\\(${C},${C},${C}\\)$`), ke = new RegExp(`^rgb\\(${v},${v},${v}\\)$`), Me = new RegExp(`^rgba\\(${C},${C},${C},${T}\\)$`), Te = new RegExp(`^rgba\\(${v},${v},${v},${T}\\)$`), Ie = new RegExp(`^hsl\\(${T},${v},${v}\\)$`), He = new RegExp(`^hsla\\(${T},${v},${v},${T}\\)$`), ft = {
  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
};
rt(F, I, {
  copy(t) {
    return Object.assign(new this.constructor(), this, t);
  },
  displayable() {
    return this.rgb().displayable();
  },
  hex: lt,
  // Deprecated! Use color.formatHex.
  formatHex: lt,
  formatHex8: Fe,
  formatHsl: qe,
  formatRgb: ct,
  toString: ct
});
function lt() {
  return this.rgb().formatHex();
}
function Fe() {
  return this.rgb().formatHex8();
}
function qe() {
  return Ht(this).formatHsl();
}
function ct() {
  return this.rgb().formatRgb();
}
function I(t) {
  var n, e;
  return t = (t + "").trim().toLowerCase(), (n = Ce.exec(t)) ? (e = n[1].length, n = parseInt(n[1], 16), e === 6 ? ht(n) : e === 3 ? new g(n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, (n & 15) << 4 | n & 15, 1) : e === 8 ? X(n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, (n & 255) / 255) : e === 4 ? X(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 = Re.exec(t)) ? new g(n[1], n[2], n[3], 1) : (n = ke.exec(t)) ? new g(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, 1) : (n = Me.exec(t)) ? X(n[1], n[2], n[3], n[4]) : (n = Te.exec(t)) ? X(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, n[4]) : (n = Ie.exec(t)) ? _t(n[1], n[2] / 100, n[3] / 100, 1) : (n = He.exec(t)) ? _t(n[1], n[2] / 100, n[3] / 100, n[4]) : ft.hasOwnProperty(t) ? ht(ft[t]) : t === "transparent" ? new g(NaN, NaN, NaN, 0) : null;
}
function ht(t) {
  return new g(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
}
function X(t, n, e, r) {
  return r <= 0 && (t = n = e = NaN), new g(t, n, e, r);
}
function Xe(t) {
  return t instanceof F || (t = I(t)), t ? (t = t.rgb(), new g(t.r, t.g, t.b, t.opacity)) : new g();
}
function J(t, n, e, r) {
  return arguments.length === 1 ? Xe(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;
}
rt(g, J, It(F, {
  brighter(t) {
    return t = t == null ? B : Math.pow(B, t), new g(this.r * t, this.g * t, this.b * t, this.opacity);
  },
  darker(t) {
    return t = t == null ? M : Math.pow(M, t), new g(this.r * t, this.g * t, this.b * t, this.opacity);
  },
  rgb() {
    return this;
  },
  clamp() {
    return new g(E(this.r), E(this.g), E(this.b), z(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: dt,
  // Deprecated! Use color.formatHex.
  formatHex: dt,
  formatHex8: De,
  formatRgb: pt,
  toString: pt
}));
function dt() {
  return `#${S(this.r)}${S(this.g)}${S(this.b)}`;
}
function De() {
  return `#${S(this.r)}${S(this.g)}${S(this.b)}${S((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function pt() {
  const t = z(this.opacity);
  return `${t === 1 ? "rgb(" : "rgba("}${E(this.r)}, ${E(this.g)}, ${E(this.b)}${t === 1 ? ")" : `, ${t})`}`;
}
function z(t) {
  return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
}
function E(t) {
  return Math.max(0, Math.min(255, Math.round(t) || 0));
}
function S(t) {
  return t = E(t), (t < 16 ? "0" : "") + t.toString(16);
}
function _t(t, n, e, r) {
  return r <= 0 ? t = n = e = NaN : e <= 0 || e >= 1 ? t = n = NaN : n <= 0 && (t = NaN), new x(t, n, e, r);
}
function Ht(t) {
  if (t instanceof x) return new x(t.h, t.s, t.l, t.opacity);
  if (t instanceof F || (t = I(t)), !t) return new x();
  if (t instanceof x) 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 x(o, a, u, t.opacity);
}
function Le(t, n, e, r) {
  return arguments.length === 1 ? Ht(t) : new x(t, n, e, r ?? 1);
}
function x(t, n, e, r) {
  this.h = +t, this.s = +n, this.l = +e, this.opacity = +r;
}
rt(x, Le, It(F, {
  brighter(t) {
    return t = t == null ? B : Math.pow(B, t), new x(this.h, this.s, this.l * t, this.opacity);
  },
  darker(t) {
    return t = t == null ? M : Math.pow(M, t), new x(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(
      K(t >= 240 ? t - 240 : t + 120, i, r),
      K(t, i, r),
      K(t < 120 ? t + 240 : t - 120, i, r),
      this.opacity
    );
  },
  clamp() {
    return new x(gt(this.h), D(this.s), D(this.l), z(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 = z(this.opacity);
    return `${t === 1 ? "hsl(" : "hsla("}${gt(this.h)}, ${D(this.s) * 100}%, ${D(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
  }
}));
function gt(t) {
  return t = (t || 0) % 360, t < 0 ? t + 360 : t;
}
function D(t) {
  return Math.max(0, Math.min(1, t || 0));
}
function K(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 Ft = (t) => () => t;
function Pe(t, n) {
  return function(e) {
    return t + e * n;
  };
}
function Oe(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 Ve(t) {
  return (t = +t) == 1 ? qt : function(n, e) {
    return e - n ? Oe(n, e, t) : Ft(isNaN(n) ? e : n);
  };
}
function qt(t, n) {
  var e = n - t;
  return e ? Pe(t, e) : Ft(isNaN(t) ? n : t);
}
const xt = function t(n) {
  var e = Ve(n);
  function r(i, s) {
    var o = e((i = J(i)).r, (s = J(s)).r), a = e(i.g, s.g), u = e(i.b, s.b), f = qt(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 A(t, n) {
  return t = +t, n = +n, function(e) {
    return t * (1 - e) + n * e;
  };
}
var Q = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, G = new RegExp(Q.source, "g");
function Be(t) {
  return function() {
    return t;
  };
}
function ze(t) {
  return function(n) {
    return t(n) + "";
  };
}
function Ye(t, n) {
  var e = Q.lastIndex = G.lastIndex = 0, r, i, s, o = -1, a = [], u = [];
  for (t = t + "", n = n + ""; (r = Q.exec(t)) && (i = G.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: A(r, i) })), e = G.lastIndex;
  return e < n.length && (s = n.slice(e), a[o] ? a[o] += s : a[++o] = s), a.length < 2 ? u[0] ? ze(u[0].x) : Be(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 yt = 180 / Math.PI, Z = {
  translateX: 0,
  translateY: 0,
  rotate: 0,
  skewX: 0,
  scaleX: 1,
  scaleY: 1
};
function Xt(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) * yt,
    skewX: Math.atan(u) * yt,
    scaleX: o,
    scaleY: a
  };
}
var L;
function Ue(t) {
  const n = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(t + "");
  return n.isIdentity ? Z : Xt(n.a, n.b, n.c, n.d, n.e, n.f);
}
function Ke(t) {
  return t == null || (L || (L = document.createElementNS("http://www.w3.org/2000/svg", "g")), L.setAttribute("transform", t), !(t = L.transform.baseVal.consolidate())) ? Z : (t = t.matrix, Xt(t.a, t.b, t.c, t.d, t.e, t.f));
}
function Dt(t, n, e, r) {
  function i(f) {
    return f.length ? f.pop() + " " : "";
  }
  function s(f, l, c, h, d, p) {
    if (f !== c || l !== h) {
      var _ = d.push("translate(", null, n, null, e);
      p.push({ i: _ - 4, x: A(f, c) }, { i: _ - 2, x: A(l, h) });
    } else (c || h) && d.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: A(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: A(f, l) }) : l && c.push(i(c) + "skewX(" + l + r);
  }
  function u(f, l, c, h, d, p) {
    if (f !== c || l !== h) {
      var _ = d.push(i(d) + "scale(", null, ",", null, ")");
      p.push({ i: _ - 4, x: A(f, c) }, { i: _ - 2, x: A(l, h) });
    } else (c !== 1 || h !== 1) && d.push(i(d) + "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(d) {
      for (var p = -1, _ = h.length, $; ++p < _; ) c[($ = h[p]).i] = $.x(d);
      return c.join("");
    };
  };
}
var Ge = Dt(Ue, "px, ", "px)", "deg)"), We = Dt(Ke, ", ", ")", ")");
function wt(t, n, e) {
  var r = new zt();
  return n = n == null ? 0 : +n, r.restart((i) => {
    r.stop(), t(i + n);
  }, n, e), r;
}
var Je = Yt("start", "end", "cancel", "interrupt"), Qe = [], Lt = 0, vt = 1, j = 2, P = 3, mt = 4, tt = 5, O = 6;
function U(t, n, e, r, i, s) {
  var o = t.__transition;
  if (!o) t.__transition = {};
  else if (e in o) return;
  Ze(t, e, {
    name: n,
    index: r,
    // For context during callback.
    group: i,
    // For context during callback.
    on: Je,
    tween: Qe,
    time: s.time,
    delay: s.delay,
    duration: s.duration,
    ease: s.ease,
    timer: null,
    state: Lt
  });
}
function it(t, n) {
  var e = w(t, n);
  if (e.state > Lt) throw new Error("too late; already scheduled");
  return e;
}
function m(t, n) {
  var e = w(t, n);
  if (e.state > P) throw new Error("too late; already running");
  return e;
}
function w(t, n) {
  var e = t.__transition;
  if (!e || !(e = e[n])) throw new Error("transition not found");
  return e;
}
function Ze(t, n, e) {
  var r = t.__transition, i;
  r[n] = e, e.timer = Ut(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, d;
    if (e.state !== vt) return u();
    for (l in r)
      if (d = r[l], d.name === e.name) {
        if (d.state === P) return wt(o);
        d.state === mt ? (d.state = O, d.timer.stop(), d.on.call("interrupt", t, t.__data__, d.index, d.group), delete r[l]) : +l < n && (d.state = O, d.timer.stop(), d.on.call("cancel", t, t.__data__, d.index, d.group), delete r[l]);
      }
    if (wt(function() {
      e.state === P && (e.state = mt, e.timer.restart(a, e.delay, e.time), a(f));
    }), e.state = j, e.on.call("start", t, t.__data__, e.index, e.group), e.state === j) {
      for (e.state = P, i = new Array(h = e.tween.length), l = 0, c = -1; l < h; ++l)
        (d = e.tween[l].value.call(t, t.__data__, e.index, e.group)) && (i[++c] = d);
      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 = tt, 1), c = -1, h = i.length; ++c < h; )
      i[c].call(t, l);
    e.state === tt && (e.on.call("end", t, t.__data__, e.index, e.group), u());
  }
  function u() {
    e.state = O, e.timer.stop(), delete r[n];
    for (var f in r) return;
    delete t.__transition;
  }
}
function je(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 > j && r.state < tt, r.state = O, r.timer.stop(), r.on.call(i ? "interrupt" : "cancel", t, t.__data__, r.index, r.group), delete e[o];
    }
    s && delete t.__transition;
  }
}
function tr(t) {
  return this.each(function() {
    je(this, t);
  });
}
function nr(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 er(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 = w(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 ? nr : er)(e, t, n));
}
function st(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 w(i, r).value[n];
  };
}
function Pt(t, n) {
  var e;
  return (typeof n == "number" ? A : n instanceof I ? xt : (e = I(n)) ? (n = e, xt) : Ye)(t, n);
}
function ir(t) {
  return function() {
    this.removeAttribute(t);
  };
}
function sr(t) {
  return function() {
    this.removeAttributeNS(t.space, t.local);
  };
}
function or(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 ar(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 ur(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 fr(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 lr(t, n) {
  var e = Y(t), r = e === "transform" ? We : Pt;
  return this.attrTween(t, typeof n == "function" ? (e.local ? fr : ur)(e, r, st(this, "attr." + t, n)) : n == null ? (e.local ? sr : ir)(e) : (e.local ? ar : or)(e, r, n));
}
function cr(t, n) {
  return function(e) {
    this.setAttribute(t, n.call(this, e));
  };
}
function hr(t, n) {
  return function(e) {
    this.setAttributeNS(t.space, t.local, n.call(this, e));
  };
}
function dr(t, n) {
  var e, r;
  function i() {
    var s = n.apply(this, arguments);
    return s !== r && (e = (r = s) && hr(t, s)), e;
  }
  return i._value = n, i;
}
function pr(t, n) {
  var e, r;
  function i() {
    var s = n.apply(this, arguments);
    return s !== r && (e = (r = s) && cr(t, s)), e;
  }
  return i._value = n, i;
}
function _r(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 = Y(t);
  return this.tween(e, (r.local ? dr : pr)(r, n));
}
function gr(t, n) {
  return function() {
    it(this, t).delay = +n.apply(this, arguments);
  };
}
function xr(t, n) {
  return n = +n, function() {
    it(this, t).delay = n;
  };
}
function yr(t) {
  var n = this._id;
  return arguments.length ? this.each((typeof t == "function" ? gr : xr)(n, t)) : w(this.node(), n).delay;
}
function wr(t, n) {
  return function() {
    m(this, t).duration = +n.apply(this, arguments);
  };
}
function vr(t, n) {
  return n = +n, function() {
    m(this, t).duration = n;
  };
}
function mr(t) {
  var n = this._id;
  return arguments.length ? this.each((typeof t == "function" ? wr : vr)(n, t)) : w(this.node(), n).duration;
}
function br(t, n) {
  if (typeof n != "function") throw new Error();
  return function() {
    m(this, t).ease = n;
  };
}
function Nr(t) {
  var n = this._id;
  return arguments.length ? this.each(br(n, t)) : w(this.node(), n).ease;
}
function Ar(t, n) {
  return function() {
    var e = n.apply(this, arguments);
    if (typeof e != "function") throw new Error();
    m(this, t).ease = e;
  };
}
function $r(t) {
  if (typeof t != "function") throw new Error();
  return this.each(Ar(this._id, t));
}
function Sr(t) {
  typeof t != "function" && (t = At(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 Er(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, d = 0; d < l; ++d)
      (h = u[d] || f[d]) && (c[d] = h);
  for (; a < r; ++a)
    o[a] = n[a];
  return new N(o, this._parents, this._name, this._id);
}
function Cr(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 Rr(t, n, e) {
  var r, i, s = Cr(n) ? it : m;
  return function() {
    var o = s(this, t), a = o.on;
    a !== r && (i = (r = a).copy()).on(n, e), o.on = i;
  };
}
function kr(t, n) {
  var e = this._id;
  return arguments.length < 2 ? w(this.node(), e).on.on(t) : this.each(Rr(e, t, n));
}
function Mr(t) {
  return function() {
    var n = this.parentNode;
    for (var e in this.__transition) if (+e !== t) return;
    n && n.removeChild(this);
  };
}
function Tr() {
  return this.on("end.remove", Mr(this._id));
}
function Ir(t) {
  var n = this._name, e = this._id;
  typeof t != "function" && (t = nt(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, U(f[h], n, e, h, f, w(l, e)));
  return new N(s, this._parents, n, e);
}
function Hr(t) {
  var n = this._name, e = this._id;
  typeof t != "function" && (t = Nt(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), d, p = w(l, e), _ = 0, $ = h.length; _ < $; ++_)
          (d = h[_]) && U(d, n, e, _, h, p);
        s.push(h), o.push(l);
      }
  return new N(s, o, n, e);
}
var Fr = H.prototype.constructor;
function qr() {
  return new Fr(this._groups, this._parents);
}
function Xr(t, n) {
  var e, r, i;
  return function() {
    var s = R(this, t), o = (this.style.removeProperty(t), R(this, t));
    return s === o ? null : s === e && o === r ? i : i = n(e = s, r = o);
  };
}
function Ot(t) {
  return function() {
    this.style.removeProperty(t);
  };
}
function Dr(t, n, e) {
  var r, i = e + "", s;
  return function() {
    var o = R(this, t);
    return o === i ? null : o === r ? s : s = n(r = o, e);
  };
}
function Lr(t, n, e) {
  var r, i, s;
  return function() {
    var o = R(this, t), a = e(this), u = a + "";
    return a == null && (u = a = (this.style.removeProperty(t), R(this, t))), o === u ? null : o === r && u === i ? s : (i = u, s = n(r = o, a));
  };
}
function Pr(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 = Ot(n)) : void 0;
    (f !== e || i !== l) && (r = (e = f).copy()).on(o, i = l), u.on = r;
  };
}
function Or(t, n, e) {
  var r = (t += "") == "transform" ? Ge : Pt;
  return n == null ? this.styleTween(t, Xr(t, r)).on("end.style." + t, Ot(t)) : typeof n == "function" ? this.styleTween(t, Lr(t, r, st(this, "style." + t, n))).each(Pr(this._id, t)) : this.styleTween(t, Dr(t, r, n), e).on("end.style." + t, null);
}
function Vr(t, n, e) {
  return function(r) {
    this.style.setProperty(t, n.call(this, r), e);
  };
}
function Br(t, n, e) {
  var r, i;
  function s() {
    var o = n.apply(this, arguments);
    return o !== i && (r = (i = o) && Vr(t, o, e)), r;
  }
  return s._value = n, s;
}
function zr(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, Br(t, n, e ?? ""));
}
function Yr(t) {
  return function() {
    this.textContent = t;
  };
}
function Ur(t) {
  return function() {
    var n = t(this);
    this.textContent = n ?? "";
  };
}
function Kr(t) {
  return this.tween("text", typeof t == "function" ? Ur(st(this, "text", t)) : Yr(t == null ? "" : t + ""));
}
function Gr(t) {
  return function(n) {
    this.textContent = t.call(this, n);
  };
}
function Wr(t) {
  var n, e;
  function r() {
    var i = t.apply(this, arguments);
    return i !== e && (n = (e = i) && Gr(i)), n;
  }
  return r._value = t, r;
}
function Jr(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, Wr(t));
}
function Qr() {
  for (var t = this._name, n = this._id, e = Vt(), 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 = w(u, n);
        U(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 Zr() {
  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 jr = 0;
function N(t, n, e, r) {
  this._groups = t, this._parents = n, this._name = e, this._id = r;
}
function Vt() {
  return ++jr;
}
var b = H.prototype;
N.prototype = {
  constructor: N,
  select: Ir,
  selectAll: Hr,
  selectChild: b.selectChild,
  selectChildren: b.selectChildren,
  filter: Sr,
  merge: Er,
  selection: qr,
  transition: Qr,
  call: b.call,
  nodes: b.nodes,
  node: b.node,
  size: b.size,
  empty: b.empty,
  each: b.each,
  on: kr,
  attr: lr,
  attrTween: _r,
  style: Or,
  styleTween: zr,
  text: Kr,
  textTween: Jr,
  remove: Tr,
  tween: rr,
  delay: yr,
  duration: mr,
  ease: Nr,
  easeVarying: $r,
  end: Zr,
  [Symbol.iterator]: b[Symbol.iterator]
};
function ti(t) {
  return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
}
var ni = {
  time: null,
  // Set on use.
  delay: 0,
  duration: 250,
  ease: ti
};
function ei(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 = Vt(), (e = ni).time = Kt(), 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]) && U(u, t, n, f, o, e || ei(u, n));
  return new N(r, this._parents, t, n);
}
H.prototype.interrupt = tr;
H.prototype.transition = ri;
export {
  y as S,
  xt as a,
  Ye as b,
  Ft as c,
  I as d,
  je as e,
  A as i,
  Se as r
};
