import { r as __export } from "./chunk-BNovOVIE.js";
function define_default(a3, N, P) {
  a3.prototype = N.prototype = P, P.constructor = a3;
}
function extend(a3, N) {
  var P = Object.create(a3.prototype);
  for (var F in N) P[F] = N[F];
  return P;
}
function Color() {
}
var darker = 0.7, brighter = 1 / darker, reI = "\\s*([+-]?\\d+)\\s*", reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", reHex = /^#([0-9a-f]{3,8})$/, reRgbInteger = /* @__PURE__ */ RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`), reRgbPercent = /* @__PURE__ */ RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`), reRgbaInteger = /* @__PURE__ */ RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`), reRgbaPercent = /* @__PURE__ */ RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`), reHslPercent = /* @__PURE__ */ RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`), reHslaPercent = /* @__PURE__ */ RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`), named = {
  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
};
define_default(Color, color, {
  copy(a3) {
    return Object.assign(new this.constructor(), this, a3);
  },
  displayable() {
    return this.rgb().displayable();
  },
  hex: color_formatHex,
  formatHex: color_formatHex,
  formatHex8: color_formatHex8,
  formatHsl: color_formatHsl,
  formatRgb: color_formatRgb,
  toString: color_formatRgb
});
function color_formatHex() {
  return this.rgb().formatHex();
}
function color_formatHex8() {
  return this.rgb().formatHex8();
}
function color_formatHsl() {
  return hslConvert(this).formatHsl();
}
function color_formatRgb() {
  return this.rgb().formatRgb();
}
function color(a3) {
  var N, P;
  return a3 = (a3 + "").trim().toLowerCase(), (N = reHex.exec(a3)) ? (P = N[1].length, N = parseInt(N[1], 16), P === 6 ? rgbn(N) : P === 3 ? new Rgb(N >> 8 & 15 | N >> 4 & 240, N >> 4 & 15 | N & 240, (N & 15) << 4 | N & 15, 1) : P === 8 ? rgba(N >> 24 & 255, N >> 16 & 255, N >> 8 & 255, (N & 255) / 255) : P === 4 ? rgba(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 = reRgbInteger.exec(a3)) ? new Rgb(N[1], N[2], N[3], 1) : (N = reRgbPercent.exec(a3)) ? new Rgb(N[1] * 255 / 100, N[2] * 255 / 100, N[3] * 255 / 100, 1) : (N = reRgbaInteger.exec(a3)) ? rgba(N[1], N[2], N[3], N[4]) : (N = reRgbaPercent.exec(a3)) ? rgba(N[1] * 255 / 100, N[2] * 255 / 100, N[3] * 255 / 100, N[4]) : (N = reHslPercent.exec(a3)) ? hsla(N[1], N[2] / 100, N[3] / 100, 1) : (N = reHslaPercent.exec(a3)) ? hsla(N[1], N[2] / 100, N[3] / 100, N[4]) : named.hasOwnProperty(a3) ? rgbn(named[a3]) : a3 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
}
function rgbn(a3) {
  return new Rgb(a3 >> 16 & 255, a3 >> 8 & 255, a3 & 255, 1);
}
function rgba(a3, N, P, F) {
  return F <= 0 && (a3 = N = P = NaN), new Rgb(a3, N, P, F);
}
function rgbConvert(a3) {
  return a3 instanceof Color || (a3 = color(a3)), a3 ? (a3 = a3.rgb(), new Rgb(a3.r, a3.g, a3.b, a3.opacity)) : new Rgb();
}
function rgb(a3, N, P, F) {
  return arguments.length === 1 ? rgbConvert(a3) : new Rgb(a3, N, P, F ?? 1);
}
function Rgb(a3, N, P, F) {
  this.r = +a3, this.g = +N, this.b = +P, this.opacity = +F;
}
define_default(Rgb, rgb, extend(Color, {
  brighter(a3) {
    return a3 = a3 == null ? brighter : brighter ** +a3, new Rgb(this.r * a3, this.g * a3, this.b * a3, this.opacity);
  },
  darker(a3) {
    return a3 = a3 == null ? darker : darker ** +a3, new Rgb(this.r * a3, this.g * a3, this.b * a3, this.opacity);
  },
  rgb() {
    return this;
  },
  clamp() {
    return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(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: rgb_formatHex,
  formatHex: rgb_formatHex,
  formatHex8: rgb_formatHex8,
  formatRgb: rgb_formatRgb,
  toString: rgb_formatRgb
}));
function rgb_formatHex() {
  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
}
function rgb_formatHex8() {
  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function rgb_formatRgb() {
  let a3 = clampa(this.opacity);
  return `${a3 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a3 === 1 ? ")" : `, ${a3})`}`;
}
function clampa(a3) {
  return isNaN(a3) ? 1 : Math.max(0, Math.min(1, a3));
}
function clampi(a3) {
  return Math.max(0, Math.min(255, Math.round(a3) || 0));
}
function hex(a3) {
  return a3 = clampi(a3), (a3 < 16 ? "0" : "") + a3.toString(16);
}
function hsla(a3, N, P, F) {
  return F <= 0 ? a3 = N = P = NaN : P <= 0 || P >= 1 ? a3 = N = NaN : N <= 0 && (a3 = NaN), new Hsl(a3, N, P, F);
}
function hslConvert(a3) {
  if (a3 instanceof Hsl) return new Hsl(a3.h, a3.s, a3.l, a3.opacity);
  if (a3 instanceof Color || (a3 = color(a3)), !a3) return new Hsl();
  if (a3 instanceof Hsl) return a3;
  a3 = a3.rgb();
  var N = a3.r / 255, P = a3.g / 255, I = a3.b / 255, L = Math.min(N, P, I), R = Math.max(N, P, I), z = NaN, V = R - L, H = (R + L) / 2;
  return V ? (z = N === R ? (P - I) / V + (P < I) * 6 : P === R ? (I - N) / V + 2 : (N - P) / V + 4, V /= H < 0.5 ? R + L : 2 - R - L, z *= 60) : V = H > 0 && H < 1 ? 0 : z, new Hsl(z, V, H, a3.opacity);
}
function hsl(a3, N, P, F) {
  return arguments.length === 1 ? hslConvert(a3) : new Hsl(a3, N, P, F ?? 1);
}
function Hsl(a3, N, P, F) {
  this.h = +a3, this.s = +N, this.l = +P, this.opacity = +F;
}
define_default(Hsl, hsl, extend(Color, {
  brighter(a3) {
    return a3 = a3 == null ? brighter : brighter ** +a3, new Hsl(this.h, this.s, this.l * a3, this.opacity);
  },
  darker(a3) {
    return a3 = a3 == null ? darker : darker ** +a3, new Hsl(this.h, this.s, this.l * a3, this.opacity);
  },
  rgb() {
    var a3 = this.h % 360 + (this.h < 0) * 360, N = isNaN(a3) || isNaN(this.s) ? 0 : this.s, P = this.l, F = P + (P < 0.5 ? P : 1 - P) * N, I = 2 * P - F;
    return new Rgb(hsl2rgb(a3 >= 240 ? a3 - 240 : a3 + 120, I, F), hsl2rgb(a3, I, F), hsl2rgb(a3 < 120 ? a3 + 240 : a3 - 120, I, F), this.opacity);
  },
  clamp() {
    return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(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() {
    let a3 = clampa(this.opacity);
    return `${a3 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a3 === 1 ? ")" : `, ${a3})`}`;
  }
}));
function clamph(a3) {
  return a3 = (a3 || 0) % 360, a3 < 0 ? a3 + 360 : a3;
}
function clampt(a3) {
  return Math.max(0, Math.min(1, a3 || 0));
}
function hsl2rgb(a3, N, P) {
  return (a3 < 60 ? N + (P - N) * a3 / 60 : a3 < 180 ? P : a3 < 240 ? N + (P - N) * (240 - a3) / 60 : N) * 255;
}
const radians = Math.PI / 180, degrees$1 = 180 / Math.PI;
var K = 18, Xn = 0.96422, Yn = 1, Zn = 0.82521, t0 = 4 / 29, t1 = 6 / 29, t2 = 3 * t1 * t1, t3 = t1 * t1 * t1;
function labConvert(a3) {
  if (a3 instanceof Lab) return new Lab(a3.l, a3.a, a3.b, a3.opacity);
  if (a3 instanceof Hcl) return hcl2lab(a3);
  a3 instanceof Rgb || (a3 = rgbConvert(a3));
  var N = rgb2lrgb(a3.r), P = rgb2lrgb(a3.g), F = rgb2lrgb(a3.b), I = xyz2lab((0.2225045 * N + 0.7168786 * P + 0.0606169 * F) / Yn), L, R;
  return N === P && P === F ? L = R = I : (L = xyz2lab((0.4360747 * N + 0.3850649 * P + 0.1430804 * F) / Xn), R = xyz2lab((0.0139322 * N + 0.0971045 * P + 0.7141733 * F) / Zn)), new Lab(116 * I - 16, 500 * (L - I), 200 * (I - R), a3.opacity);
}
function lab$1(a3, N, P, F) {
  return arguments.length === 1 ? labConvert(a3) : new Lab(a3, N, P, F ?? 1);
}
function Lab(a3, N, P, F) {
  this.l = +a3, this.a = +N, this.b = +P, this.opacity = +F;
}
define_default(Lab, lab$1, extend(Color, {
  brighter(a3) {
    return new Lab(this.l + K * (a3 ?? 1), this.a, this.b, this.opacity);
  },
  darker(a3) {
    return new Lab(this.l - K * (a3 ?? 1), this.a, this.b, this.opacity);
  },
  rgb() {
    var a3 = (this.l + 16) / 116, N = isNaN(this.a) ? a3 : a3 + this.a / 500, P = isNaN(this.b) ? a3 : a3 - this.b / 200;
    return N = Xn * lab2xyz(N), a3 = Yn * lab2xyz(a3), P = Zn * lab2xyz(P), new Rgb(lrgb2rgb(3.1338561 * N - 1.6168667 * a3 - 0.4906146 * P), lrgb2rgb(-0.9787684 * N + 1.9161415 * a3 + 0.033454 * P), lrgb2rgb(0.0719453 * N - 0.2289914 * a3 + 1.4052427 * P), this.opacity);
  }
}));
function xyz2lab(a3) {
  return a3 > t3 ? a3 ** (1 / 3) : a3 / t2 + t0;
}
function lab2xyz(a3) {
  return a3 > t1 ? a3 * a3 * a3 : t2 * (a3 - t0);
}
function lrgb2rgb(a3) {
  return 255 * (a3 <= 31308e-7 ? 12.92 * a3 : 1.055 * a3 ** (1 / 2.4) - 0.055);
}
function rgb2lrgb(a3) {
  return (a3 /= 255) <= 0.04045 ? a3 / 12.92 : ((a3 + 0.055) / 1.055) ** 2.4;
}
function hclConvert(a3) {
  if (a3 instanceof Hcl) return new Hcl(a3.h, a3.c, a3.l, a3.opacity);
  if (a3 instanceof Lab || (a3 = labConvert(a3)), a3.a === 0 && a3.b === 0) return new Hcl(NaN, 0 < a3.l && a3.l < 100 ? 0 : NaN, a3.l, a3.opacity);
  var N = Math.atan2(a3.b, a3.a) * degrees$1;
  return new Hcl(N < 0 ? N + 360 : N, Math.sqrt(a3.a * a3.a + a3.b * a3.b), a3.l, a3.opacity);
}
function hcl(a3, N, P, F) {
  return arguments.length === 1 ? hclConvert(a3) : new Hcl(a3, N, P, F ?? 1);
}
function Hcl(a3, N, P, F) {
  this.h = +a3, this.c = +N, this.l = +P, this.opacity = +F;
}
function hcl2lab(a3) {
  if (isNaN(a3.h)) return new Lab(a3.l, 0, 0, a3.opacity);
  var N = a3.h * radians;
  return new Lab(a3.l, Math.cos(N) * a3.c, Math.sin(N) * a3.c, a3.opacity);
}
define_default(Hcl, hcl, extend(Color, {
  brighter(a3) {
    return new Hcl(this.h, this.c, this.l + K * (a3 ?? 1), this.opacity);
  },
  darker(a3) {
    return new Hcl(this.h, this.c, this.l - K * (a3 ?? 1), this.opacity);
  },
  rgb() {
    return hcl2lab(this).rgb();
  }
}));
var A = -0.14861, B = 1.78277, C = -0.29227, D = -0.90649, E = 1.97294, ED = E * D, EB = E * B, BC_DA = B * C - D * A;
function cubehelixConvert(a3) {
  if (a3 instanceof Cubehelix) return new Cubehelix(a3.h, a3.s, a3.l, a3.opacity);
  a3 instanceof Rgb || (a3 = rgbConvert(a3));
  var N = a3.r / 255, P = a3.g / 255, F = a3.b / 255, I = (BC_DA * F + ED * N - EB * P) / (BC_DA + ED - EB), L = F - I, R = (E * (P - I) - C * L) / D, z = Math.sqrt(R * R + L * L) / (E * I * (1 - I)), V = z ? Math.atan2(R, L) * degrees$1 - 120 : NaN;
  return new Cubehelix(V < 0 ? V + 360 : V, z, I, a3.opacity);
}
function cubehelix(a3, N, P, F) {
  return arguments.length === 1 ? cubehelixConvert(a3) : new Cubehelix(a3, N, P, F ?? 1);
}
function Cubehelix(a3, N, P, F) {
  this.h = +a3, this.s = +N, this.l = +P, this.opacity = +F;
}
define_default(Cubehelix, cubehelix, extend(Color, {
  brighter(a3) {
    return a3 = a3 == null ? brighter : brighter ** +a3, new Cubehelix(this.h, this.s, this.l * a3, this.opacity);
  },
  darker(a3) {
    return a3 = a3 == null ? darker : darker ** +a3, new Cubehelix(this.h, this.s, this.l * a3, this.opacity);
  },
  rgb() {
    var a3 = isNaN(this.h) ? 0 : (this.h + 120) * radians, N = +this.l, P = isNaN(this.s) ? 0 : this.s * N * (1 - N), F = Math.cos(a3), I = Math.sin(a3);
    return new Rgb(255 * (N + P * (A * F + B * I)), 255 * (N + P * (C * F + D * I)), 255 * (N + E * F * P), this.opacity);
  }
}));
function basis(a3, N, P, F, I) {
  var L = a3 * a3, R = L * a3;
  return ((1 - 3 * a3 + 3 * L - R) * N + (4 - 6 * L + 3 * R) * P + (1 + 3 * a3 + 3 * L - 3 * R) * F + R * I) / 6;
}
function basis_default(a3) {
  var N = a3.length - 1;
  return function(P) {
    var F = P <= 0 ? P = 0 : P >= 1 ? (P = 1, N - 1) : Math.floor(P * N), I = a3[F], L = a3[F + 1], R = F > 0 ? a3[F - 1] : 2 * I - L, z = F < N - 1 ? a3[F + 2] : 2 * L - I;
    return basis((P - F / N) * N, R, I, L, z);
  };
}
function basisClosed_default(a3) {
  var N = a3.length;
  return function(P) {
    var F = Math.floor(((P %= 1) < 0 ? ++P : P) * N), I = a3[(F + N - 1) % N], L = a3[F % N], R = a3[(F + 1) % N], z = a3[(F + 2) % N];
    return basis((P - F / N) * N, I, L, R, z);
  };
}
var constant_default = (a3) => () => a3;
function linear(a3, N) {
  return function(P) {
    return a3 + P * N;
  };
}
function exponential(a3, N, P) {
  return a3 **= +P, N = N ** +P - a3, P = 1 / P, function(F) {
    return (a3 + F * N) ** +P;
  };
}
function hue(a3, N) {
  var P = N - a3;
  return P ? linear(a3, P > 180 || P < -180 ? P - 360 * Math.round(P / 360) : P) : constant_default(isNaN(a3) ? N : a3);
}
function gamma(a3) {
  return (a3 = +a3) == 1 ? nogamma : function(N, P) {
    return P - N ? exponential(N, P, a3) : constant_default(isNaN(N) ? P : N);
  };
}
function nogamma(a3, N) {
  var P = N - a3;
  return P ? linear(a3, P) : constant_default(isNaN(a3) ? N : a3);
}
var rgb_default = (function a(N) {
  var P = gamma(N);
  function F(a3, N2) {
    var F2 = P((a3 = rgb(a3)).r, (N2 = rgb(N2)).r), I = P(a3.g, N2.g), L = P(a3.b, N2.b), R = nogamma(a3.opacity, N2.opacity);
    return function(N3) {
      return a3.r = F2(N3), a3.g = I(N3), a3.b = L(N3), a3.opacity = R(N3), a3 + "";
    };
  }
  return F.gamma = a, F;
})(1);
function rgbSpline(a3) {
  return function(N) {
    var P = N.length, F = Array(P), I = Array(P), L = Array(P), R, z;
    for (R = 0; R < P; ++R) z = rgb(N[R]), F[R] = z.r || 0, I[R] = z.g || 0, L[R] = z.b || 0;
    return F = a3(F), I = a3(I), L = a3(L), z.opacity = 1, function(a4) {
      return z.r = F(a4), z.g = I(a4), z.b = L(a4), z + "";
    };
  };
}
var rgbBasis = rgbSpline(basis_default), rgbBasisClosed = rgbSpline(basisClosed_default);
function numberArray_default(a3, N) {
  N || (N = []);
  var P = a3 ? Math.min(N.length, a3.length) : 0, F = N.slice(), I;
  return function(L) {
    for (I = 0; I < P; ++I) F[I] = a3[I] * (1 - L) + N[I] * L;
    return F;
  };
}
function isNumberArray(a3) {
  return ArrayBuffer.isView(a3) && !(a3 instanceof DataView);
}
function array_default(a3, N) {
  return (isNumberArray(N) ? numberArray_default : genericArray)(a3, N);
}
function genericArray(a3, N) {
  var P = N ? N.length : 0, F = a3 ? Math.min(P, a3.length) : 0, I = Array(F), L = Array(P), R;
  for (R = 0; R < F; ++R) I[R] = value_default(a3[R], N[R]);
  for (; R < P; ++R) L[R] = N[R];
  return function(a4) {
    for (R = 0; R < F; ++R) L[R] = I[R](a4);
    return L;
  };
}
function date_default(a3, N) {
  var P = /* @__PURE__ */ new Date();
  return a3 = +a3, N = +N, function(F) {
    return P.setTime(a3 * (1 - F) + N * F), P;
  };
}
function number_default(a3, N) {
  return a3 = +a3, N = +N, function(P) {
    return a3 * (1 - P) + N * P;
  };
}
function object_default(a3, N) {
  var P = {}, F = {}, I;
  for (I in (typeof a3 != "object" || !a3) && (a3 = {}), (typeof N != "object" || !N) && (N = {}), N) I in a3 ? P[I] = value_default(a3[I], N[I]) : F[I] = N[I];
  return function(a4) {
    for (I in P) F[I] = P[I](a4);
    return F;
  };
}
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, reB = new RegExp(reA.source, "g");
function zero(a3) {
  return function() {
    return a3;
  };
}
function one(a3) {
  return function(N) {
    return a3(N) + "";
  };
}
function string_default(a3, N) {
  var P = reA.lastIndex = reB.lastIndex = 0, F, I, L, R = -1, z = [], V = [];
  for (a3 += "", N += ""; (F = reA.exec(a3)) && (I = reB.exec(N)); ) (L = I.index) > P && (L = N.slice(P, L), z[R] ? z[R] += L : z[++R] = L), (F = F[0]) === (I = I[0]) ? z[R] ? z[R] += I : z[++R] = I : (z[++R] = null, V.push({
    i: R,
    x: number_default(F, I)
  })), P = reB.lastIndex;
  return P < N.length && (L = N.slice(P), z[R] ? z[R] += L : z[++R] = L), z.length < 2 ? V[0] ? one(V[0].x) : zero(N) : (N = V.length, function(a4) {
    for (var P2 = 0, F2; P2 < N; ++P2) z[(F2 = V[P2]).i] = F2.x(a4);
    return z.join("");
  });
}
function value_default(a3, N) {
  var P = typeof N, F;
  return N == null || P === "boolean" ? constant_default(N) : (P === "number" ? number_default : P === "string" ? (F = color(N)) ? (N = F, rgb_default) : string_default : N instanceof color ? rgb_default : N instanceof Date ? date_default : isNumberArray(N) ? numberArray_default : Array.isArray(N) ? genericArray : typeof N.valueOf != "function" && typeof N.toString != "function" || isNaN(N) ? object_default : number_default)(a3, N);
}
function discrete_default(a3) {
  var N = a3.length;
  return function(P) {
    return a3[Math.max(0, Math.min(N - 1, Math.floor(P * N)))];
  };
}
function hue_default(a3, N) {
  var P = hue(+a3, +N);
  return function(a4) {
    var N2 = P(a4);
    return N2 - 360 * Math.floor(N2 / 360);
  };
}
function round_default(a3, N) {
  return a3 = +a3, N = +N, function(P) {
    return Math.round(a3 * (1 - P) + N * P);
  };
}
var degrees = 180 / Math.PI, identity = {
  translateX: 0,
  translateY: 0,
  rotate: 0,
  skewX: 0,
  scaleX: 1,
  scaleY: 1
};
function decompose_default(a3, N, P, F, I, L) {
  var R, z, V;
  return (R = Math.sqrt(a3 * a3 + N * N)) && (a3 /= R, N /= R), (V = a3 * P + N * F) && (P -= a3 * V, F -= N * V), (z = Math.sqrt(P * P + F * F)) && (P /= z, F /= z, V /= z), a3 * F < N * P && (a3 = -a3, N = -N, V = -V, R = -R), {
    translateX: I,
    translateY: L,
    rotate: Math.atan2(N, a3) * degrees,
    skewX: Math.atan(V) * degrees,
    scaleX: R,
    scaleY: z
  };
}
var svgNode;
function parseCss(a3) {
  let N = new (typeof DOMMatrix == "function" ? DOMMatrix : WebKitCSSMatrix)(a3 + "");
  return N.isIdentity ? identity : decompose_default(N.a, N.b, N.c, N.d, N.e, N.f);
}
function parseSvg(a3) {
  return a3 == null || (svgNode || (svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g")), svgNode.setAttribute("transform", a3), !(a3 = svgNode.transform.baseVal.consolidate())) ? identity : (a3 = a3.matrix, decompose_default(a3.a, a3.b, a3.c, a3.d, a3.e, a3.f));
}
function interpolateTransform(a3, N, P, F) {
  function I(a4) {
    return a4.length ? a4.pop() + " " : "";
  }
  function L(a4, F2, I2, L2, R2, z2) {
    if (a4 !== I2 || F2 !== L2) {
      var V2 = R2.push("translate(", null, N, null, P);
      z2.push({
        i: V2 - 4,
        x: number_default(a4, I2)
      }, {
        i: V2 - 2,
        x: number_default(F2, L2)
      });
    } else (I2 || L2) && R2.push("translate(" + I2 + N + L2 + P);
  }
  function R(a4, N2, P2, L2) {
    a4 === N2 ? N2 && P2.push(I(P2) + "rotate(" + N2 + F) : (a4 - N2 > 180 ? N2 += 360 : N2 - a4 > 180 && (a4 += 360), L2.push({
      i: P2.push(I(P2) + "rotate(", null, F) - 2,
      x: number_default(a4, N2)
    }));
  }
  function z(a4, N2, P2, L2) {
    a4 === N2 ? N2 && P2.push(I(P2) + "skewX(" + N2 + F) : L2.push({
      i: P2.push(I(P2) + "skewX(", null, F) - 2,
      x: number_default(a4, N2)
    });
  }
  function V(a4, N2, P2, F2, L2, R2) {
    if (a4 !== P2 || N2 !== F2) {
      var z2 = L2.push(I(L2) + "scale(", null, ",", null, ")");
      R2.push({
        i: z2 - 4,
        x: number_default(a4, P2)
      }, {
        i: z2 - 2,
        x: number_default(N2, F2)
      });
    } else (P2 !== 1 || F2 !== 1) && L2.push(I(L2) + "scale(" + P2 + "," + F2 + ")");
  }
  return function(N2, P2) {
    var F2 = [], I2 = [];
    return N2 = a3(N2), P2 = a3(P2), L(N2.translateX, N2.translateY, P2.translateX, P2.translateY, F2, I2), R(N2.rotate, P2.rotate, F2, I2), z(N2.skewX, P2.skewX, F2, I2), V(N2.scaleX, N2.scaleY, P2.scaleX, P2.scaleY, F2, I2), N2 = P2 = null, function(a4) {
      for (var N3 = -1, P3 = I2.length, L2; ++N3 < P3; ) F2[(L2 = I2[N3]).i] = L2.x(a4);
      return F2.join("");
    };
  };
}
var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"), interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"), epsilon2 = 1e-12;
function cosh(a3) {
  return ((a3 = Math.exp(a3)) + 1 / a3) / 2;
}
function sinh(a3) {
  return ((a3 = Math.exp(a3)) - 1 / a3) / 2;
}
function tanh(a3) {
  return ((a3 = Math.exp(2 * a3)) - 1) / (a3 + 1);
}
var zoom_default = (function a2(N, P, F) {
  function I(a3, I2) {
    var L = a3[0], R = a3[1], z = a3[2], V = I2[0], H = I2[1], U = I2[2], W = V - L, G = H - R, q = W * W + G * G, J, Y;
    if (q < epsilon2) Y = Math.log(U / z) / N, J = function(a4) {
      return [
        L + a4 * W,
        R + a4 * G,
        z * Math.exp(N * a4 * Y)
      ];
    };
    else {
      var X = Math.sqrt(q), Z = (U * U - z * z + F * q) / (2 * z * P * X), Q = (U * U - z * z - F * q) / (2 * U * P * X), $ = Math.log(Math.sqrt(Z * Z + 1) - Z);
      Y = (Math.log(Math.sqrt(Q * Q + 1) - Q) - $) / N, J = function(a4) {
        var F2 = a4 * Y, I3 = cosh($), V2 = z / (P * X) * (I3 * tanh(N * F2 + $) - sinh($));
        return [
          L + V2 * W,
          R + V2 * G,
          z * I3 / cosh(N * F2 + $)
        ];
      };
    }
    return J.duration = Y * 1e3 * N / Math.SQRT2, J;
  }
  return I.rho = function(N2) {
    var P2 = Math.max(1e-3, +N2), F2 = P2 * P2;
    return a2(P2, F2, F2 * F2);
  }, I;
})(Math.SQRT2, 2, 4);
function hsl$1(a3) {
  return function(N, P) {
    var F = a3((N = hsl(N)).h, (P = hsl(P)).h), I = nogamma(N.s, P.s), L = nogamma(N.l, P.l), R = nogamma(N.opacity, P.opacity);
    return function(a4) {
      return N.h = F(a4), N.s = I(a4), N.l = L(a4), N.opacity = R(a4), N + "";
    };
  };
}
var hsl_default = hsl$1(hue), hslLong = hsl$1(nogamma);
function lab(a3, N) {
  var P = nogamma((a3 = lab$1(a3)).l, (N = lab$1(N)).l), F = nogamma(a3.a, N.a), I = nogamma(a3.b, N.b), L = nogamma(a3.opacity, N.opacity);
  return function(N2) {
    return a3.l = P(N2), a3.a = F(N2), a3.b = I(N2), a3.opacity = L(N2), a3 + "";
  };
}
function hcl$1(a3) {
  return function(N, P) {
    var F = a3((N = hcl(N)).h, (P = hcl(P)).h), I = nogamma(N.c, P.c), L = nogamma(N.l, P.l), R = nogamma(N.opacity, P.opacity);
    return function(a4) {
      return N.h = F(a4), N.c = I(a4), N.l = L(a4), N.opacity = R(a4), N + "";
    };
  };
}
var hcl_default = hcl$1(hue), hclLong = hcl$1(nogamma);
function cubehelix$1(a3) {
  return (function N(P) {
    P = +P;
    function F(N2, F2) {
      var I = a3((N2 = cubehelix(N2)).h, (F2 = cubehelix(F2)).h), L = nogamma(N2.s, F2.s), R = nogamma(N2.l, F2.l), z = nogamma(N2.opacity, F2.opacity);
      return function(a4) {
        return N2.h = I(a4), N2.s = L(a4), N2.l = R(a4 ** +P), N2.opacity = z(a4), N2 + "";
      };
    }
    return F.gamma = N, F;
  })(1);
}
var cubehelix_default = cubehelix$1(hue), cubehelixLong = cubehelix$1(nogamma);
function piecewise(a3, N) {
  N === void 0 && (N = a3, a3 = value_default);
  for (var P = 0, F = N.length - 1, I = N[0], L = Array(F < 0 ? 0 : F); P < F; ) L[P] = a3(I, I = N[++P]);
  return function(a4) {
    var N2 = Math.max(0, Math.min(F - 1, Math.floor(a4 *= F)));
    return L[N2](a4 - N2);
  };
}
function quantize_default(a3, N) {
  for (var P = Array(N), F = 0; F < N; ++F) P[F] = a3(F / (N - 1));
  return P;
}
var src_exports = /* @__PURE__ */ __export({
  interpolate: () => value_default,
  interpolateArray: () => array_default,
  interpolateBasis: () => basis_default,
  interpolateBasisClosed: () => basisClosed_default,
  interpolateCubehelix: () => cubehelix_default,
  interpolateCubehelixLong: () => cubehelixLong,
  interpolateDate: () => date_default,
  interpolateDiscrete: () => discrete_default,
  interpolateHcl: () => hcl_default,
  interpolateHclLong: () => hclLong,
  interpolateHsl: () => hsl_default,
  interpolateHslLong: () => hslLong,
  interpolateHue: () => hue_default,
  interpolateLab: () => lab,
  interpolateNumber: () => number_default,
  interpolateNumberArray: () => numberArray_default,
  interpolateObject: () => object_default,
  interpolateRgb: () => rgb_default,
  interpolateRgbBasis: () => rgbBasis,
  interpolateRgbBasisClosed: () => rgbBasisClosed,
  interpolateRound: () => round_default,
  interpolateString: () => string_default,
  interpolateTransformCss: () => interpolateTransformCss,
  interpolateTransformSvg: () => interpolateTransformSvg,
  interpolateZoom: () => zoom_default,
  piecewise: () => piecewise,
  quantize: () => quantize_default
}, 1), noop = { value: () => {
} };
function dispatch() {
  for (var a3 = 0, N = arguments.length, P = {}, F; a3 < N; ++a3) {
    if (!(F = arguments[a3] + "") || F in P || /[\s.]/.test(F)) throw Error("illegal type: " + F);
    P[F] = [];
  }
  return new Dispatch(P);
}
function Dispatch(a3) {
  this._ = a3;
}
function parseTypenames(a3, N) {
  return a3.trim().split(/^|\s+/).map(function(a4) {
    var P = "", F = a4.indexOf(".");
    if (F >= 0 && (P = a4.slice(F + 1), a4 = a4.slice(0, F)), a4 && !N.hasOwnProperty(a4)) throw Error("unknown type: " + a4);
    return {
      type: a4,
      name: P
    };
  });
}
Dispatch.prototype = dispatch.prototype = {
  constructor: Dispatch,
  on: function(a3, N) {
    var P = this._, F = parseTypenames(a3 + "", P), I, L = -1, R = F.length;
    if (arguments.length < 2) {
      for (; ++L < R; ) if ((I = (a3 = F[L]).type) && (I = get(P[I], a3.name))) return I;
      return;
    }
    if (N != null && typeof N != "function") throw Error("invalid callback: " + N);
    for (; ++L < R; ) if (I = (a3 = F[L]).type) P[I] = set(P[I], a3.name, N);
    else if (N == null) for (I in P) P[I] = set(P[I], a3.name, null);
    return this;
  },
  copy: function() {
    var a3 = {}, N = this._;
    for (var P in N) a3[P] = N[P].slice();
    return new Dispatch(a3);
  },
  call: function(a3, N) {
    if ((I = arguments.length - 2) > 0) for (var P = Array(I), F = 0, I, L; F < I; ++F) P[F] = arguments[F + 2];
    if (!this._.hasOwnProperty(a3)) throw Error("unknown type: " + a3);
    for (L = this._[a3], F = 0, I = L.length; F < I; ++F) L[F].value.apply(N, P);
  },
  apply: function(a3, N, P) {
    if (!this._.hasOwnProperty(a3)) throw Error("unknown type: " + a3);
    for (var F = this._[a3], I = 0, L = F.length; I < L; ++I) F[I].value.apply(N, P);
  }
};
function get(a3, N) {
  for (var P = 0, F = a3.length, I; P < F; ++P) if ((I = a3[P]).name === N) return I.value;
}
function set(a3, N, P) {
  for (var F = 0, I = a3.length; F < I; ++F) if (a3[F].name === N) {
    a3[F] = noop, a3 = a3.slice(0, F).concat(a3.slice(F + 1));
    break;
  }
  return P != null && a3.push({
    name: N,
    value: P
  }), a3;
}
var dispatch_default = dispatch, frame = 0, timeout = 0, interval = 0, pokeDelay = 1e3, taskHead, taskTail, clockLast = 0, clockNow = 0, clockSkew = 0, clock = typeof performance == "object" && performance.now ? performance : Date, setFrame = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(a3) {
  setTimeout(a3, 17);
};
function now() {
  return clockNow || (clockNow = (setFrame(clearNow), clock.now() + clockSkew));
}
function clearNow() {
  clockNow = 0;
}
function Timer() {
  this._call = this._time = this._next = null;
}
Timer.prototype = timer.prototype = {
  constructor: Timer,
  restart: function(a3, N, P) {
    if (typeof a3 != "function") throw TypeError("callback is not a function");
    P = (P == null ? now() : +P) + (N == null ? 0 : +N), !this._next && taskTail !== this && (taskTail ? taskTail._next = this : taskHead = this, taskTail = this), this._call = a3, this._time = P, sleep();
  },
  stop: function() {
    this._call && (this._call = null, this._time = Infinity, sleep());
  }
};
function timer(a3, N, P) {
  var F = new Timer();
  return F.restart(a3, N, P), F;
}
function timerFlush() {
  now(), ++frame;
  for (var a3 = taskHead, N; a3; ) (N = clockNow - a3._time) >= 0 && a3._call.call(void 0, N), a3 = a3._next;
  --frame;
}
function wake() {
  clockNow = (clockLast = clock.now()) + clockSkew, frame = timeout = 0;
  try {
    timerFlush();
  } finally {
    frame = 0, nap(), clockNow = 0;
  }
}
function poke() {
  var a3 = clock.now(), N = a3 - clockLast;
  N > pokeDelay && (clockSkew -= N, clockLast = a3);
}
function nap() {
  for (var a3, N = taskHead, P, F = Infinity; N; ) N._call ? (F > N._time && (F = N._time), a3 = N, N = N._next) : (P = N._next, N._next = null, N = a3 ? a3._next = P : taskHead = P);
  taskTail = a3, sleep(F);
}
function sleep(a3) {
  frame || (timeout && (timeout = clearTimeout(timeout)), a3 - clockNow > 24 ? (a3 < Infinity && (timeout = setTimeout(wake, a3 - clock.now() - clockSkew)), interval && (interval = clearInterval(interval))) : (interval || (interval = (clockLast = clock.now(), setInterval(poke, pokeDelay))), frame = 1, setFrame(wake)));
}
export {
  color as _,
  src_exports as a,
  interpolateTransformCss as c,
  value_default as d,
  string_default as f,
  lab$1 as g,
  hcl as h,
  dispatch_default as i,
  interpolateTransformSvg as l,
  rgb_default as m,
  now as n,
  piecewise as o,
  number_default as p,
  timer as r,
  hcl_default as s,
  Timer as t,
  round_default as u,
  hsl as v,
  rgb as y
};
