@blueprint-chart/lib 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +806 -804
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -401,8 +401,8 @@ class Ws extends ct {
401
401
  if (n === zt.Right ? e.selectAll(".tick text").attr("x", -x).attr("dy", "-0.4em").attr("text-anchor", "end") : e.selectAll(".tick text").attr("x", x).attr("dy", "-0.4em").attr("text-anchor", "start"), m ? e.selectAll(".tick line").attr("x2", n === zt.Right ? -6 : 6) : e.selectAll(".tick line").remove(), c > 0 && b) {
402
402
  const A = e.select(".domain");
403
403
  if (!A.empty()) {
404
- const w = A.attr("d"), $ = w.replace(/V[\d.]+/, `V${-c}`);
405
- $ !== w && A.attr("d", $);
404
+ const w = A.attr("d"), L = w.replace(/V[\d.]+/, `V${-c}`);
405
+ L !== w && A.attr("d", L);
406
406
  }
407
407
  }
408
408
  } else
@@ -469,17 +469,17 @@ function Sl() {
469
469
  }, g = [/[+-]\d\d:?(\d\d)?|Z/, function(x) {
470
470
  (this.zone || (this.zone = {})).offset = (function(A) {
471
471
  if (!A || A === "Z") return 0;
472
- var w = A.match(/([+-]|\d\d)/g), $ = 60 * w[1] + (+w[2] || 0);
473
- return $ === 0 ? 0 : w[0] === "+" ? -$ : $;
472
+ var w = A.match(/([+-]|\d\d)/g), L = 60 * w[1] + (+w[2] || 0);
473
+ return L === 0 ? 0 : w[0] === "+" ? -L : L;
474
474
  })(x);
475
475
  }], b = function(x) {
476
476
  var A = c[x];
477
477
  return A && (A.indexOf ? A : A.s.concat(A.f));
478
478
  }, m = function(x, A) {
479
- var w, $ = c.meridiem;
480
- if ($) {
481
- for (var P = 1; P <= 24; P += 1) if (x.indexOf($(P, 0, A)) > -1) {
482
- w = P > 12;
479
+ var w, L = c.meridiem;
480
+ if (L) {
481
+ for (var O = 1; O <= 24; O += 1) if (x.indexOf(L(O, 0, A)) > -1) {
482
+ w = O > 12;
483
483
  break;
484
484
  }
485
485
  } else w = x === (A ? "pm" : "PM");
@@ -498,10 +498,10 @@ function Sl() {
498
498
  this.milliseconds = +x;
499
499
  }], s: [o, d("seconds")], ss: [o, d("seconds")], m: [o, d("minutes")], mm: [o, d("minutes")], H: [o, d("hours")], h: [o, d("hours")], HH: [o, d("hours")], hh: [o, d("hours")], D: [o, d("day")], DD: [s, d("day")], Do: [i, function(x) {
500
500
  var A = c.ordinal, w = x.match(/\d+/);
501
- if (this.day = w[0], A) for (var $ = 1; $ <= 31; $ += 1) A($).replace(/\[|\]/g, "") === x && (this.day = $);
501
+ if (this.day = w[0], A) for (var L = 1; L <= 31; L += 1) A(L).replace(/\[|\]/g, "") === x && (this.day = L);
502
502
  }], w: [o, d("week")], ww: [s, d("week")], M: [o, d("month")], MM: [s, d("month")], MMM: [i, function(x) {
503
- var A = b("months"), w = (b("monthsShort") || A.map((function($) {
504
- return $.slice(0, 3);
503
+ var A = b("months"), w = (b("monthsShort") || A.map((function(L) {
504
+ return L.slice(0, 3);
505
505
  }))).indexOf(x) + 1;
506
506
  if (w < 1) throw new Error();
507
507
  this.month = w % 12 || w;
@@ -515,22 +515,22 @@ function Sl() {
515
515
  function y(x) {
516
516
  var A, w;
517
517
  A = x, w = c && c.formats;
518
- for (var $ = (x = A.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(K, X, te) {
519
- var fe = te && te.toUpperCase();
520
- return X || w[te] || e[te] || w[fe].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(se, F, Y) {
521
- return F || Y.slice(1);
518
+ for (var L = (x = A.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(j, q, ae) {
519
+ var fe = ae && ae.toUpperCase();
520
+ return q || w[ae] || e[ae] || w[fe].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(ne, N, Y) {
521
+ return N || Y.slice(1);
522
522
  }));
523
- }))).match(r), P = $.length, D = 0; D < P; D += 1) {
524
- var H = $[D], j = v[H], _ = j && j[0], B = j && j[1];
525
- $[D] = B ? { regex: _, parser: B } : H.replace(/^\[|\]$/g, "");
523
+ }))).match(r), O = L.length, F = 0; F < O; F += 1) {
524
+ var I = L[F], J = v[I], H = J && J[0], D = J && J[1];
525
+ L[F] = D ? { regex: H, parser: D } : I.replace(/^\[|\]$/g, "");
526
526
  }
527
- return function(K) {
528
- for (var X = {}, te = 0, fe = 0; te < P; te += 1) {
529
- var se = $[te];
530
- if (typeof se == "string") fe += se.length;
527
+ return function(j) {
528
+ for (var q = {}, ae = 0, fe = 0; ae < O; ae += 1) {
529
+ var ne = L[ae];
530
+ if (typeof ne == "string") fe += ne.length;
531
531
  else {
532
- var F = se.regex, Y = se.parser, R = K.slice(fe), ie = F.exec(R)[0];
533
- Y.call(X, ie), K = K.replace(ie, "");
532
+ var N = ne.regex, Y = ne.parser, R = j.slice(fe), ie = N.exec(R)[0];
533
+ Y.call(q, ie), j = j.replace(ie, "");
534
534
  }
535
535
  }
536
536
  return (function(he) {
@@ -539,39 +539,39 @@ function Sl() {
539
539
  var ce = he.hours;
540
540
  ve ? ce < 12 && (he.hours += 12) : ce === 12 && (he.hours = 0), delete he.afternoon;
541
541
  }
542
- })(X), X;
542
+ })(q), q;
543
543
  };
544
544
  }
545
545
  return function(x, A, w) {
546
546
  w.p.customParseFormat = !0, x && x.parseTwoDigitYear && (f = x.parseTwoDigitYear);
547
- var $ = A.prototype, P = $.parse;
548
- $.parse = function(D) {
549
- var H = D.date, j = D.utc, _ = D.args;
550
- this.$u = j;
551
- var B = _[1];
552
- if (typeof B == "string") {
553
- var K = _[2] === !0, X = _[3] === !0, te = K || X, fe = _[2];
554
- X && (fe = _[2]), c = this.$locale(), !K && fe && (c = w.Ls[fe]), this.$d = (function(R, ie, he, ve) {
547
+ var L = A.prototype, O = L.parse;
548
+ L.parse = function(F) {
549
+ var I = F.date, J = F.utc, H = F.args;
550
+ this.$u = J;
551
+ var D = H[1];
552
+ if (typeof D == "string") {
553
+ var j = H[2] === !0, q = H[3] === !0, ae = j || q, fe = H[2];
554
+ q && (fe = H[2]), c = this.$locale(), !j && fe && (c = w.Ls[fe]), this.$d = (function(R, ie, he, ve) {
555
555
  try {
556
556
  if (["x", "X"].indexOf(ie) > -1) return new Date((ie === "X" ? 1e3 : 1) * R);
557
- var ce = y(ie)(R), ue = ce.year, Se = ce.month, ye = ce.day, ge = ce.hours, xe = ce.minutes, pe = ce.seconds, Me = ce.milliseconds, J = ce.zone, ae = ce.week, ke = /* @__PURE__ */ new Date(), me = ye || (ue || Se ? 1 : ke.getDate()), Ce = ue || ke.getFullYear(), we = 0;
557
+ var ce = y(ie)(R), ue = ce.year, Se = ce.month, ye = ce.day, ge = ce.hours, xe = ce.minutes, pe = ce.seconds, Me = ce.milliseconds, K = ce.zone, te = ce.week, ke = /* @__PURE__ */ new Date(), me = ye || (ue || Se ? 1 : ke.getDate()), Ce = ue || ke.getFullYear(), we = 0;
558
558
  ue && !Se || (we = Se > 0 ? Se - 1 : ke.getMonth());
559
559
  var Ne, Oe = ge || 0, Q = xe || 0, Z = pe || 0, S = Me || 0;
560
- return J ? new Date(Date.UTC(Ce, we, me, Oe, Q, Z, S + 60 * J.offset * 1e3)) : he ? new Date(Date.UTC(Ce, we, me, Oe, Q, Z, S)) : (Ne = new Date(Ce, we, me, Oe, Q, Z, S), ae && (Ne = ve(Ne).week(ae).toDate()), Ne);
560
+ return K ? new Date(Date.UTC(Ce, we, me, Oe, Q, Z, S + 60 * K.offset * 1e3)) : he ? new Date(Date.UTC(Ce, we, me, Oe, Q, Z, S)) : (Ne = new Date(Ce, we, me, Oe, Q, Z, S), te && (Ne = ve(Ne).week(te).toDate()), Ne);
561
561
  } catch {
562
562
  return /* @__PURE__ */ new Date("");
563
563
  }
564
- })(H, B, j, w), this.init(), fe && fe !== !0 && (this.$L = this.locale(fe).$L), te && H != this.format(B) && (this.$d = /* @__PURE__ */ new Date("")), c = {};
565
- } else if (B instanceof Array) for (var se = B.length, F = 1; F <= se; F += 1) {
566
- _[1] = B[F - 1];
567
- var Y = w.apply(this, _);
564
+ })(I, D, J, w), this.init(), fe && fe !== !0 && (this.$L = this.locale(fe).$L), ae && I != this.format(D) && (this.$d = /* @__PURE__ */ new Date("")), c = {};
565
+ } else if (D instanceof Array) for (var ne = D.length, N = 1; N <= ne; N += 1) {
566
+ H[1] = D[N - 1];
567
+ var Y = w.apply(this, H);
568
568
  if (Y.isValid()) {
569
569
  this.$d = Y.$d, this.$L = Y.$L, this.init();
570
570
  break;
571
571
  }
572
- F === se && (this.$d = /* @__PURE__ */ new Date(""));
572
+ N === ne && (this.$d = /* @__PURE__ */ new Date(""));
573
573
  }
574
- else P.call(this, D);
574
+ else O.call(this, F);
575
575
  };
576
576
  };
577
577
  }));
@@ -851,43 +851,43 @@ class Zs extends ct {
851
851
  const v = b || Us(d, g);
852
852
  v && m.tickFormat(v);
853
853
  const y = Xs(n), x = y ? n.domain() : [], A = y && c !== "vertical" && kr(x) !== null;
854
- let w = null, $ = !1;
854
+ let w = null, L = !1;
855
855
  if (y && !A && x.length > 1 && f > 0) {
856
- const X = f / x.length * nn, fe = Ja(x, v) > X;
857
- c === "vertical" ? $ = !0 : fe && (w = js(x, X, v), !w && c === "auto" && ($ = !0));
856
+ const q = f / x.length * nn, fe = Ja(x, v) > q;
857
+ c === "vertical" ? L = !0 : fe && (w = js(x, q, v), !w && c === "auto" && (L = !0));
858
858
  }
859
- let P = this.config("ticks");
860
- if (!P && f > 0)
859
+ let O = this.config("ticks");
860
+ if (!O && f > 0)
861
861
  if (y) {
862
862
  if (A) {
863
- const K = Fl(x, f, v);
864
- K.length < x.length && (P = K);
863
+ const j = Fl(x, f, v);
864
+ j.length < x.length && (O = j);
865
865
  }
866
866
  } else {
867
- const K = Math.max(2, Math.floor(f / Cl));
868
- m.ticks(K);
867
+ const j = Math.max(2, Math.floor(f / Cl));
868
+ m.ticks(j);
869
869
  }
870
- P && m.tickValues(P);
871
- const D = s === "above" ? 0 : o, H = a.node(), j = e === "merge" ? Ee() : 0;
870
+ O && m.tickValues(O);
871
+ const F = s === "above" ? 0 : o, I = a.node(), J = e === "merge" ? Ee() : 0;
872
872
  if (e === "merge") {
873
- if (!H)
873
+ if (!I)
874
874
  return;
875
- j > 0 ? (a.attr("transform", `translate(0,${D})`), a.duration(j).call(m)) : p.select(H).attr("transform", `translate(0,${D})`).call(m);
875
+ J > 0 ? (a.attr("transform", `translate(0,${F})`), a.duration(J).call(m)) : p.select(I).attr("transform", `translate(0,${F})`).call(m);
876
876
  } else
877
- a.attr("transform", `translate(0,${D})`), a.call(m);
878
- const _ = j > 0 ? a : H ? p.select(H) : a;
877
+ a.attr("transform", `translate(0,${F})`), a.call(m);
878
+ const H = J > 0 ? a : I ? p.select(I) : a;
879
879
  if (!this.config("showAxis"))
880
- _.select(".domain").remove();
880
+ H.select(".domain").remove();
881
881
  else if (e === "enter") {
882
- const K = this.config("zeroY");
883
- if (K != null) {
884
- const X = K - (s === "above" ? 0 : o);
885
- _.select(".domain").attr("transform", `translate(0,${X})`);
882
+ const j = this.config("zeroY");
883
+ if (j != null) {
884
+ const q = j - (s === "above" ? 0 : o);
885
+ H.select(".domain").attr("transform", `translate(0,${q})`);
886
886
  }
887
887
  }
888
- this.config("showTicks") || _.selectAll(".tick line").remove();
889
- const B = i === "auto" ? "outside" : i;
890
- B === "off" ? _.selectAll(".tick text").remove() : B === "inside" && _.selectAll(".tick text").attr("y", 0).attr("dy", "-0.6em"), $ && B !== "off" ? _.selectAll(".tick text").attr("transform", "rotate(-90)").attr("text-anchor", "end").attr("x", s === "above" ? 9 : -9).attr("y", 0).attr("dy", "0.32em") : _.selectAll(".tick text").attr("transform", null), w && B !== "off" && Vl(_, w);
888
+ this.config("showTicks") || H.selectAll(".tick line").remove();
889
+ const D = i === "auto" ? "outside" : i;
890
+ D === "off" ? H.selectAll(".tick text").remove() : D === "inside" && H.selectAll(".tick text").attr("y", 0).attr("dy", "-0.6em"), L && D !== "off" ? H.selectAll(".tick text").attr("transform", "rotate(-90)").attr("text-anchor", "end").attr("x", s === "above" ? 9 : -9).attr("y", 0).attr("dy", "0.32em") : H.selectAll(".tick text").attr("transform", null), w && D !== "off" && Vl(H, w);
891
891
  }
892
892
  postDraw() {
893
893
  const a = this.config("gridStyle"), e = this.config("height"), r = this.base.select(".bc-axis-horizontal").node();
@@ -945,12 +945,12 @@ class Hl extends ct {
945
945
  const n = this.config("colors"), s = this.config("layout"), o = this.config("valueSuffixes"), i = ((m = (b = this.base.node()) == null ? void 0 : b.ownerSVGElement) == null ? void 0 : m.parentElement) ?? document.documentElement, c = getComputedStyle(i).getPropertyValue("--bc-text-color").trim() || "#555", f = this.config("maxWidth");
946
946
  let d = 0, g = 0;
947
947
  r.each(function(v, y) {
948
- const x = p.select(this), A = o[y], $ = 16 + (A ? v.length + 1 + A.length : v.length) * 7 + 12;
949
- s === "horizontal" && f > 0 && d > 0 && d + $ > f && (d = 0, g += 20), x.attr("transform", `translate(${d},${g})`).attr("data-series", v).style("cursor", "default");
950
- let P = x.select("rect");
951
- P.empty() && (P = x.append("rect").attr("width", 12).attr("height", 12)), P.attr("fill", n[y % n.length]);
952
- let D = x.select("text");
953
- D.empty() && (D = x.append("text").attr("x", 16).attr("y", 10).attr("font-size", "12px")), D.attr("fill", c), D.selectAll("tspan").remove(), A ? (D.text(null), D.append("tspan").attr("font-weight", "bold").text(v), D.append("tspan").text(` ${A}`)) : D.text(v), s === "vertical" ? g += 20 : d += $;
948
+ const x = p.select(this), A = o[y], L = 16 + (A ? v.length + 1 + A.length : v.length) * 7 + 12;
949
+ s === "horizontal" && f > 0 && d > 0 && d + L > f && (d = 0, g += 20), x.attr("transform", `translate(${d},${g})`).attr("data-series", v).style("cursor", "default");
950
+ let O = x.select("rect");
951
+ O.empty() && (O = x.append("rect").attr("width", 12).attr("height", 12)), O.attr("fill", n[y % n.length]);
952
+ let F = x.select("text");
953
+ F.empty() && (F = x.append("text").attr("x", 16).attr("y", 10).attr("font-size", "12px")), F.attr("fill", c), F.selectAll("tspan").remove(), A ? (F.text(null), F.append("tspan").attr("font-weight", "bold").text(v), F.append("tspan").text(` ${A}`)) : F.text(v), s === "vertical" ? g += 20 : d += L;
954
954
  });
955
955
  };
956
956
  this.layer("items", a, {
@@ -1004,21 +1004,21 @@ function ba(t, a, e = Qs, r = -10, n = "top", s = "start", o = 0, i = 0, c = 0,
1004
1004
  const m = t.querySelector(".bc-legend");
1005
1005
  if (m) {
1006
1006
  let v = 0, y = 0;
1007
- const x = a.map((D, H) => {
1008
- const j = f[H];
1009
- return j ? D.length + 1 + j.length : D.length;
1007
+ const x = a.map((F, I) => {
1008
+ const J = f[I];
1009
+ return J ? F.length + 1 + J.length : F.length;
1010
1010
  });
1011
1011
  if (g === "horizontal") {
1012
- const D = x.map((B) => 16 + B * 7 + 12);
1013
- let H = 1, j = 0, _ = 0;
1014
- for (const B of D)
1015
- o > 0 && j > 0 && j + B > o ? (_ = Math.max(_, j), H++, j = B) : j += B;
1016
- _ = Math.max(_, j), v = _, y = H * 20;
1012
+ const F = x.map((D) => 16 + D * 7 + 12);
1013
+ let I = 1, J = 0, H = 0;
1014
+ for (const D of F)
1015
+ o > 0 && J > 0 && J + D > o ? (H = Math.max(H, J), I++, J = D) : J += D;
1016
+ H = Math.max(H, J), v = H, y = I * 20;
1017
1017
  } else
1018
1018
  v = Math.max(...x) * 7 + 16 + 8, y = a.length * 20;
1019
1019
  const A = d.left ?? 0, w = d.right ?? 0;
1020
- let $ = c, P = r;
1021
- g === "horizontal" ? s === "middle" ? $ += -A + (o + A + w - v) / 2 : s === "end" ? $ += o + w - v : $ += -A : s === "middle" ? P += (i - y) / 2 : s === "end" && (P += i - y), m.setAttribute("transform", `translate(${$},${P})`);
1020
+ let L = c, O = r;
1021
+ g === "horizontal" ? s === "middle" ? L += -A + (o + A + w - v) / 2 : s === "end" ? L += o + w - v : L += -A : s === "middle" ? O += (i - y) / 2 : s === "end" && (O += i - y), m.setAttribute("transform", `translate(${L},${O})`);
1022
1022
  }
1023
1023
  return Yl(t), m;
1024
1024
  }
@@ -1346,14 +1346,14 @@ function La(t) {
1346
1346
  i.selectAll(".bc-dot, .bc-bar").each(function() {
1347
1347
  const y = this, x = () => {
1348
1348
  const w = p.select(y);
1349
- let $, P;
1349
+ let L, O;
1350
1350
  if (y.tagName === "circle")
1351
- $ = parseFloat(w.attr("cx")), P = parseFloat(w.attr("cy"));
1351
+ L = parseFloat(w.attr("cx")), O = parseFloat(w.attr("cy"));
1352
1352
  else {
1353
- const D = parseFloat(w.attr("x")), H = parseFloat(w.attr("width")), j = parseFloat(w.attr("y")), _ = parseFloat(w.attr("height"));
1354
- n === st.Horizontal ? ($ = D + H, P = j + _ / 2) : ($ = D + H / 2, P = j);
1353
+ const F = parseFloat(w.attr("x")), I = parseFloat(w.attr("width")), J = parseFloat(w.attr("y")), H = parseFloat(w.attr("height"));
1354
+ n === st.Horizontal ? (L = F + I, O = J + H / 2) : (L = F + I / 2, O = J);
1355
1355
  }
1356
- b && b.attr("x1", $).attr("x2", $).style("display", null), m && m.attr("y1", P).attr("y2", P).style("display", null);
1356
+ b && b.attr("x1", L).attr("x2", L).style("display", null), m && m.attr("y1", O).attr("y2", O).style("display", null);
1357
1357
  }, A = () => {
1358
1358
  b && b.style("display", "none"), m && m.style("display", "none");
1359
1359
  };
@@ -1595,7 +1595,7 @@ function ai(t, a, e, r) {
1595
1595
  const n = "target" in a ? a.target : void 0;
1596
1596
  if (!n)
1597
1597
  return;
1598
- const s = e.data.find((A) => A.label === n);
1598
+ const s = e.data.find((L) => L.label === n);
1599
1599
  if (!s)
1600
1600
  return;
1601
1601
  const o = t.append("g").attr("data-annotation-index", String(r));
@@ -1604,55 +1604,57 @@ function ai(t, a, e, r) {
1604
1604
  let d, g;
1605
1605
  const b = a;
1606
1606
  if (b.dx != null || b.dy != null) {
1607
- const { x: A, y: w } = hs(s, e.scaleX, e.scaleY);
1608
- d = A + (Number(b.dx) || 40), g = w + (Number(b.dy) || -40);
1607
+ const { x: L, y: O } = hs(s, e.scaleX, e.scaleY);
1608
+ d = L + (Number(b.dx) || 40), g = O + (Number(b.dy) || -40);
1609
1609
  } else if (b.direction != null && b.textOffsetX == null) {
1610
- const { x: A, y: w } = hs(s, e.scaleX, e.scaleY), $ = b.direction, P = b.anchorDistance ?? 60, D = Ql($, P);
1611
- d = A + D.dx, g = w + D.dy;
1610
+ const { x: L, y: O } = hs(s, e.scaleX, e.scaleY), F = b.direction, I = b.anchorDistance ?? 60, J = Ql(F, I);
1611
+ d = L + J.dx, g = O + J.dy;
1612
1612
  } else
1613
1613
  d = f.x + (i.textOffsetX ?? -42), g = f.y + (i.textOffsetY ?? -42);
1614
1614
  const m = a.circleColor ?? "#666", v = a;
1615
- if (v.showCircle && tc(o, f.x, f.y, {
1615
+ v.showCircle && tc(o, f.x, f.y, {
1616
1616
  size: v.circleSize,
1617
1617
  style: v.circleStyle,
1618
1618
  color: m
1619
- }), a.text) {
1620
- const A = Math.max(4, Math.min(d, e.width - 4)), w = ic(d - f.x);
1621
- fn(o, a.text, A, g - 4, {
1619
+ });
1620
+ const y = Math.max(4, Math.min(d, e.width - 4)), x = Math.max(4, Math.min(g, e.height - 4));
1621
+ if (a.text) {
1622
+ const L = ic(d - f.x);
1623
+ fn(o, a.text, y, x - 4, {
1622
1624
  textColor: a.textColor,
1623
1625
  maxWidth: dn(a.maxWidth, e.width),
1624
- textAnchor: w,
1626
+ textAnchor: L,
1625
1627
  backgroundColor: e.backgroundColor,
1626
1628
  textOutline: a.textOutline
1627
1629
  });
1628
1630
  }
1629
- if (b.dx != null || b.dy != null ? i.showLine !== !1 : i.showLine === !0) {
1630
- let A = { x: d, y: g }, w = !1;
1631
- const $ = o.select(".bc-annotation-text").node();
1632
- if ($)
1631
+ if (b.dx != null || b.dy != null ? i.showLine !== !1 : i.showLine === !0 || i.showArrow === !0) {
1632
+ let L = { x: y, y: x }, O = !1;
1633
+ const F = o.select(".bc-annotation-text").node();
1634
+ if (F)
1633
1635
  try {
1634
- const j = $.getBBox();
1635
- if (j.width > 0 && j.height > 0) {
1636
- A = Kl(j, f.x, f.y);
1637
- const _ = j.x + j.width / 2;
1638
- w = Math.abs(A.x - _) < 1;
1636
+ const D = F.getBBox();
1637
+ if (D.width > 0 && D.height > 0) {
1638
+ L = Kl(D, f.x, f.y);
1639
+ const j = D.x + D.width / 2;
1640
+ O = Math.abs(L.x - j) < 1;
1639
1641
  }
1640
1642
  } catch {
1641
1643
  }
1642
- const P = i.showCircle ? (i.circleSize ?? 4) + (i.lineTargetDistance ?? 5) : i.lineTargetDistance ?? 0;
1643
- let D = f.x, H = f.y;
1644
- if (P > 0) {
1645
- const j = f.x - A.x, _ = f.y - A.y, B = Math.sqrt(j * j + _ * _);
1646
- if (B > 0) {
1647
- const K = f.x - j / B * P, X = f.y - _ / B * P, te = pa[c] ?? pa.N;
1648
- D = Math.abs(te.dx) > 0.01 ? K : f.x, H = Math.abs(te.dy) > 0.01 ? X : f.y;
1644
+ const I = i.showCircle ? (i.circleSize ?? 4) + (i.lineTargetDistance ?? 5) : i.lineTargetDistance ?? 0;
1645
+ let J = f.x, H = f.y;
1646
+ if (I > 0) {
1647
+ const D = f.x - L.x, j = f.y - L.y, q = Math.sqrt(D * D + j * j);
1648
+ if (q > 0) {
1649
+ const ae = f.x - D / q * I, fe = f.y - j / q * I, ne = pa[c] ?? pa.N;
1650
+ J = Math.abs(ne.dx) > 0.01 ? ae : f.x, H = Math.abs(ne.dy) > 0.01 ? fe : f.y;
1649
1651
  }
1650
1652
  }
1651
- nc(o, A, { x: D, y: H }, i.lineStyle ?? gt.Direct, {
1653
+ nc(o, L, { x: J, y: H }, i.lineStyle ?? gt.Direct, {
1652
1654
  showArrow: i.showArrow,
1653
1655
  lineWeight: i.lineWeight,
1654
1656
  color: m,
1655
- departVertical: w
1657
+ departVertical: O
1656
1658
  });
1657
1659
  }
1658
1660
  }
@@ -1680,22 +1682,22 @@ function ri(t, a, e, r, n) {
1680
1682
  }
1681
1683
  if (s.append("rect").attr("class", "bc-annotation-range").attr("x", i).attr("y", c).attr("width", f).attr("height", d).attr("fill", a.bgColor ?? "#ccc").attr("opacity", (a.bgOpacity ?? 20) / 100), a.text) {
1682
1684
  const g = o === st.Vertical ? f : d, b = dn(a.maxWidth, e.width) ?? Math.max(g, 50), m = a.direction ?? "center", v = 4, y = pa[m] ?? pa.center, x = 0.5 + y.dx * 0.5, A = 0.5 + y.dy * 0.5, w = Math.max(v, Math.min(i + f * x, e.width - v));
1683
- let $ = "middle";
1684
- x < 0.25 ? $ = "start" : x > 0.75 && ($ = "end");
1685
- const D = c + v + 12, H = n ? n.append("g").attr("data-annotation-index", String(r)) : s;
1686
- if (fn(H, a.text, w, D, {
1685
+ let L = "middle";
1686
+ x < 0.25 ? L = "start" : x > 0.75 && (L = "end");
1687
+ const F = c + v + 12, I = n ? n.append("g").attr("data-annotation-index", String(r)) : s;
1688
+ if (fn(I, a.text, w, F, {
1687
1689
  textColor: a.textColor,
1688
1690
  maxWidth: b,
1689
- textAnchor: $,
1691
+ textAnchor: L,
1690
1692
  backgroundColor: e.backgroundColor,
1691
1693
  textOutline: a.textOutline
1692
1694
  }), A > 0.25) {
1693
- const j = H.select(".bc-annotation-text").node();
1694
- if (j)
1695
+ const J = I.select(".bc-annotation-text").node();
1696
+ if (J)
1695
1697
  try {
1696
- const _ = j.getBBox();
1697
- let B = 0;
1698
- A > 0.75 ? B = c + d - v - (_.y + _.height) : B = c + d / 2 - (_.y + _.height / 2), Math.abs(B) > 0.5 && j.setAttribute("transform", `translate(0, ${B})`);
1698
+ const H = J.getBBox();
1699
+ let D = 0;
1700
+ A > 0.75 ? D = c + d - v - (H.y + H.height) : D = c + d / 2 - (H.y + H.height / 2), Math.abs(D) > 0.5 && J.setAttribute("transform", `translate(0, ${D})`);
1699
1701
  } catch {
1700
1702
  }
1701
1703
  }
@@ -1742,13 +1744,13 @@ function oc(t, a) {
1742
1744
  };
1743
1745
  });
1744
1746
  } else if (r.style === gt.CurveLeft || r.style === gt.CurveRight) {
1745
- const i = { x: r.fromX, y: r.fromY }, c = { x: r.toX, y: r.toY }, f = c.x - i.x, d = c.y - i.y, g = Math.sqrt(f * f + d * d), b = g * 0.8, m = r.style === gt.CurveRight ? 1 : 0, v = g / 2, y = v < b ? Math.sqrt(b * b - v * v) : 0, x = (i.x + c.x) / 2, A = (i.y + c.y) / 2, w = g > 0 ? -d / g : 0, $ = g > 0 ? f / g : 0, P = m === 1 ? 1 : -1, D = x + P * y * w, H = A + P * y * $, j = Math.atan2(i.y - H, i.x - D);
1746
- let B = Math.atan2(c.y - H, c.x - D) - j;
1747
- m === 1 && B <= 0 && (B += 2 * Math.PI), m === 0 && B >= 0 && (B -= 2 * Math.PI), n.transition().duration(a).ease(p.easeCubicOut).attrTween("d", () => (K) => {
1748
- if (K >= 0.98)
1747
+ const i = { x: r.fromX, y: r.fromY }, c = { x: r.toX, y: r.toY }, f = c.x - i.x, d = c.y - i.y, g = Math.sqrt(f * f + d * d), b = g * 0.8, m = r.style === gt.CurveRight ? 1 : 0, v = g / 2, y = v < b ? Math.sqrt(b * b - v * v) : 0, x = (i.x + c.x) / 2, A = (i.y + c.y) / 2, w = g > 0 ? -d / g : 0, L = g > 0 ? f / g : 0, O = m === 1 ? 1 : -1, F = x + O * y * w, I = A + O * y * L, J = Math.atan2(i.y - I, i.x - F);
1748
+ let D = Math.atan2(c.y - I, c.x - F) - J;
1749
+ m === 1 && D <= 0 && (D += 2 * Math.PI), m === 0 && D >= 0 && (D -= 2 * Math.PI), n.transition().duration(a).ease(p.easeCubicOut).attrTween("d", () => (j) => {
1750
+ if (j >= 0.98)
1749
1751
  return s;
1750
- const X = j + K * B, te = D + b * Math.cos(X), fe = H + b * Math.sin(X);
1751
- return `M ${i.x} ${i.y} A ${b} ${b} 0 0 ${m} ${te} ${fe}`;
1752
+ const q = J + j * D, ae = F + b * Math.cos(q), fe = I + b * Math.sin(q);
1753
+ return `M ${i.x} ${i.y} A ${b} ${b} 0 0 ${m} ${ae} ${fe}`;
1752
1754
  });
1753
1755
  } else
1754
1756
  n.transition().duration(a).ease(p.easeCubicOut).attrTween("d", () => {
@@ -1788,8 +1790,8 @@ function cc(t, a, e) {
1788
1790
  const v = g(m), y = b(m);
1789
1791
  if (r.style === gt.Direct || a.style === gt.Direct)
1790
1792
  return `M ${v.x} ${v.y} L ${y.x} ${y.y}`;
1791
- const x = y.x - v.x, A = y.y - v.y, $ = Math.sqrt(x * x + A * A) * 0.8, P = r.style === gt.CurveRight ? 1 : 0;
1792
- return `M ${v.x} ${v.y} A ${$} ${$} 0 0 ${P} ${y.x} ${y.y}`;
1793
+ const x = y.x - v.x, A = y.y - v.y, L = Math.sqrt(x * x + A * A) * 0.8, O = r.style === gt.CurveRight ? 1 : 0;
1794
+ return `M ${v.x} ${v.y} A ${L} ${L} 0 0 ${O} ${y.x} ${y.y}`;
1793
1795
  };
1794
1796
  });
1795
1797
  }
@@ -2252,77 +2254,77 @@ class Sc extends ct {
2252
2254
  }
2253
2255
  }
2254
2256
  function ui(t, a, e = {}, r = !1) {
2255
- var Me, J, ae, ke, me, Ce, we, Ne, Oe, Q, Z, S, T, O;
2257
+ var Me, K, te, ke, me, Ce, we, Ne, Oe, Q, Z, S, T, P;
2256
2258
  Ht(r);
2257
2259
  let n = null, s, o;
2258
2260
  const i = Vt.for(t);
2259
2261
  if (r) {
2260
2262
  const z = Yt(t);
2261
2263
  o = z == null ? void 0 : z.margin, i.detach(), z && z.chartType !== "bar-vertical" && (n = Bt(t)), s = /* @__PURE__ */ new Map();
2262
- for (const I of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
2263
- for (const [C, U] of Mt(I))
2264
+ for (const V of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
2265
+ for (const [C, U] of Mt(V))
2264
2266
  s.set(C, U);
2265
2267
  t.replaceChildren();
2266
2268
  }
2267
- const { body: c } = _t(t, e.frame), f = $t(c).width, d = e.categoryLabelLine === !0, g = wa(a.values, (Me = e.verticalAxis) == null ? void 0 : Me.range, (J = e.verticalAxis) == null ? void 0 : J.numberFormat, (ae = e.verticalAxis) == null ? void 0 : ae.scaleType), b = d ? He.Off : (ke = e.horizontalAxis) == null ? void 0 : ke.labelPosition, m = ea(f, (me = e.verticalAxis) == null ? void 0 : me.labelPosition, b, (Ce = e.verticalAxis) == null ? void 0 : Ce.direction, g);
2269
+ const { body: c } = _t(t, e.frame), f = $t(c).width, d = e.categoryLabelLine === !0, g = wa(a.values, (Me = e.verticalAxis) == null ? void 0 : Me.range, (K = e.verticalAxis) == null ? void 0 : K.numberFormat, (te = e.verticalAxis) == null ? void 0 : te.scaleType), b = d ? He.Off : (ke = e.horizontalAxis) == null ? void 0 : ke.labelPosition, m = ea(f, (me = e.verticalAxis) == null ? void 0 : me.labelPosition, b, (Ce = e.verticalAxis) == null ? void 0 : Ce.direction, g);
2268
2270
  if (!d) {
2269
- const z = Math.max(0, f - (m.left ?? 50) - (m.right ?? 20)), I = sn(a.labels, z, e.horizontalAxis);
2270
- I !== void 0 && (m.bottom = I);
2271
+ const z = Math.max(0, f - (m.left ?? 50) - (m.right ?? 20)), V = sn(a.labels, z, e.horizontalAxis);
2272
+ V !== void 0 && (m.bottom = V);
2271
2273
  }
2272
- const { chartArea: v, width: y, height: x, margin: A } = Gt(c, m), $ = x - (d ? ys : 0), P = Kt(o, A), D = $c(a, e), H = D.map((z) => ({
2274
+ const { chartArea: v, width: y, height: x, margin: A } = Gt(c, m), L = x - (d ? ys : 0), O = Kt(o, A), F = $c(a, e), I = F.map((z) => ({
2273
2275
  label: z,
2274
2276
  value: a.values[a.labels.indexOf(z)]
2275
- })), j = e.swapLabelValue === !0, _ = e.waterfall === !0, B = [];
2276
- if (_) {
2277
+ })), J = e.swapLabelValue === !0, H = e.waterfall === !0, D = [];
2278
+ if (H) {
2277
2279
  let z = 0;
2278
- for (const I of H) {
2280
+ for (const V of I) {
2279
2281
  const C = z;
2280
- z += I.value, B.push({ label: I.label, value: I.value, y0: C, y1: z, isTotal: !1 });
2282
+ z += V.value, D.push({ label: V.label, value: V.value, y0: C, y1: z, isTotal: !1 });
2281
2283
  }
2282
- e.waterfallTotal && B.push({ label: "Total", value: z, y0: 0, y1: z, isTotal: !0 });
2283
- }
2284
- const K = _ ? B.map((z) => z.label) : D, X = p.scaleBand().domain(K).range([0, y]).padding(ka(e.barGap)), te = ((we = e.verticalAxis) == null ? void 0 : we.scaleType) === "log", fe = _ ? B.flatMap((z) => [z.y0, z.y1]) : H.map((z) => z.value);
2285
- let [se, F] = Va(fe, (Ne = e.verticalAxis) == null ? void 0 : Ne.range, (Oe = e.verticalAxis) == null ? void 0 : Oe.scaleType);
2286
- if (e.valueLabels && se < 0 && ((Z = (Q = e.verticalAxis) == null ? void 0 : Q.range) == null ? void 0 : Z.min) == null) {
2287
- const z = F - se;
2288
- se -= z * 0.1;
2289
- }
2290
- const Y = te ? p.scaleSymlog().domain([se, F]).nice().range([$, 0]) : p.scaleLinear().domain([se, F]).nice().range([$, 0]);
2291
- i.attach(v, P);
2292
- const R = j && e.valueLabels && !_ ? (() => {
2293
- const z = new Map(H.map((I) => [I.label, I.value]));
2284
+ e.waterfallTotal && D.push({ label: "Total", value: z, y0: 0, y1: z, isTotal: !0 });
2285
+ }
2286
+ const j = H ? D.map((z) => z.label) : F, q = p.scaleBand().domain(j).range([0, y]).padding(ka(e.barGap)), ae = ((we = e.verticalAxis) == null ? void 0 : we.scaleType) === "log", fe = H ? D.flatMap((z) => [z.y0, z.y1]) : I.map((z) => z.value);
2287
+ let [ne, N] = Va(fe, (Ne = e.verticalAxis) == null ? void 0 : Ne.range, (Oe = e.verticalAxis) == null ? void 0 : Oe.scaleType);
2288
+ if (e.valueLabels && ne < 0 && ((Z = (Q = e.verticalAxis) == null ? void 0 : Q.range) == null ? void 0 : Z.min) == null) {
2289
+ const z = N - ne;
2290
+ ne -= z * 0.1;
2291
+ }
2292
+ const Y = ae ? p.scaleSymlog().domain([ne, N]).nice().range([L, 0]) : p.scaleLinear().domain([ne, N]).nice().range([L, 0]);
2293
+ i.attach(v, O);
2294
+ const R = J && e.valueLabels && !H ? (() => {
2295
+ const z = new Map(I.map((V) => [V.label, V.value]));
2294
2296
  return {
2295
2297
  ...e.horizontalAxis,
2296
2298
  width: y,
2297
- tickFormat: (I) => String(z.get(I) ?? I)
2299
+ tickFormat: (V) => String(z.get(V) ?? V)
2298
2300
  };
2299
2301
  })() : { ...e.horizontalAxis, width: y }, ie = d ? { ...R, labelPosition: He.Off } : R;
2300
2302
  i.update({
2301
2303
  vertical: { scale: Y, height: x, options: { ...e.verticalAxis, gridWidth: y, topPadding: A.top } },
2302
- horizontal: { scale: X, height: x, options: ie }
2303
- }), !te && se < 0 && F > 0 && p.select(v).append("line").attr("class", "bc-zero-baseline").attr("x1", 0).attr("x2", y).attr("y1", Y(0)).attr("y2", Y(0)).attr("stroke", "#666").attr("stroke-width", 1);
2304
+ horizontal: { scale: q, height: x, options: ie }
2305
+ }), !ae && ne < 0 && N > 0 && p.select(v).append("line").attr("class", "bc-zero-baseline").attr("x1", 0).attr("x2", y).attr("y1", Y(0)).attr("y2", Y(0)).attr("stroke", "#666").attr("stroke-width", 1);
2304
2306
  const he = new Map(
2305
2307
  (e.colorizes ?? []).map((z) => [z.target, z.color])
2306
- ), ve = new Set((e.highlights ?? []).map((z) => z.target)), ce = v.ownerSVGElement, ue = ta(ce, t, "bars", { x: 0, y: 0, width: y, height: $ }), Se = p.select(ce).select("defs"), ye = ue.replace(/^bc-clip-/, ""), ge = p.select(v).append("g").attr("clip-path", `url(#${ue})`);
2308
+ ), ve = new Set((e.highlights ?? []).map((z) => z.target)), ce = v.ownerSVGElement, ue = ta(ce, t, "bars", { x: 0, y: 0, width: y, height: L }), Se = p.select(ce).select("defs"), ye = ue.replace(/^bc-clip-/, ""), ge = p.select(v).append("g").attr("clip-path", `url(#${ue})`);
2307
2309
  if (e.barBackground) {
2308
- const z = (e.colors ?? Ta)[0], I = _ ? K : H.map((C) => C.label);
2309
- ge.selectAll(".bc-bar-bg").data(I, (C) => C).enter().append("rect").attr("class", "bc-bar-bg").attr("x", (C) => X(C) ?? 0).attr("y", 0).attr("width", X.bandwidth()).attr("height", $).attr("fill", z).attr("opacity", 0.18);
2310
+ const z = (e.colors ?? Ta)[0], V = H ? j : I.map((C) => C.label);
2311
+ ge.selectAll(".bc-bar-bg").data(V, (C) => C).enter().append("rect").attr("class", "bc-bar-bg").attr("x", (C) => q(C) ?? 0).attr("y", 0).attr("width", q.bandwidth()).attr("height", L).attr("fill", z).attr("opacity", 0.18);
2310
2312
  }
2311
- const xe = _ ? K : H.map((z) => z.label);
2313
+ const xe = H ? j : I.map((z) => z.label);
2312
2314
  if (e.barSeparators && xe.length > 1) {
2313
- const z = X.step();
2314
- for (let I = 1; I < xe.length; I++) {
2315
- const C = (X(xe[I - 1]) ?? 0) + X.bandwidth() + (z - X.bandwidth()) / 2;
2316
- ge.append("line").attr("class", "bc-bar-separator").attr("x1", C).attr("x2", C).attr("y1", 0).attr("y2", $).attr("stroke", "currentColor").attr("opacity", 0.15);
2315
+ const z = q.step();
2316
+ for (let V = 1; V < xe.length; V++) {
2317
+ const C = (q(xe[V - 1]) ?? 0) + q.bandwidth() + (z - q.bandwidth()) / 2;
2318
+ ge.append("line").attr("class", "bc-bar-separator").attr("x1", C).attr("x2", C).attr("y1", 0).attr("y2", L).attr("stroke", "currentColor").attr("opacity", 0.15);
2317
2319
  }
2318
2320
  }
2319
- if (!_ && e.connectedColumns && H.length > 1) {
2320
- const z = e.colors ?? Ta, I = e.connectionsOpacity ?? 0.15;
2321
- for (let C = 0; C < H.length - 1; C++) {
2322
- const U = H[C], E = H[C + 1];
2321
+ if (!H && e.connectedColumns && I.length > 1) {
2322
+ const z = e.colors ?? Ta, V = e.connectionsOpacity ?? 0.15;
2323
+ for (let C = 0; C < I.length - 1; C++) {
2324
+ const U = I[C], E = I[C + 1];
2323
2325
  if (U.value == null || E.value == null || Number.isNaN(U.value) || Number.isNaN(E.value) || U.value === 0 || E.value === 0)
2324
2326
  continue;
2325
- const W = (X(U.label) ?? 0) + X.bandwidth(), Ae = X(E.label) ?? 0, Pe = Math.min(Y(0), Y(U.value)), Be = Math.min(Y(0), Y(E.value)), Ye = Y(0), We = he.get(U.label) ?? z[0], Xe = he.get(E.label) ?? z[0];
2327
+ const W = (q(U.label) ?? 0) + q.bandwidth(), Ae = q(E.label) ?? 0, Pe = Math.min(Y(0), Y(U.value)), Be = Math.min(Y(0), Y(E.value)), Ye = Y(0), We = he.get(U.label) ?? z[0], Xe = he.get(E.label) ?? z[0];
2326
2328
  let Qe;
2327
2329
  if (We === Xe)
2328
2330
  Qe = We;
@@ -2330,19 +2332,19 @@ function ui(t, a, e = {}, r = !1) {
2330
2332
  const Ue = `bc-conn-grad-${ye}-${C}`, Re = Se.append("linearGradient").attr("id", Ue).attr("x1", "0%").attr("x2", "100%").attr("y1", "0%").attr("y2", "0%");
2331
2333
  Re.append("stop").attr("offset", "0%").attr("stop-color", We), Re.append("stop").attr("offset", "100%").attr("stop-color", Xe), Qe = `url(#${Ue})`;
2332
2334
  }
2333
- ge.append("polygon").attr("class", "bc-bar-connection").attr("points", `${W},${Pe} ${Ae},${Be} ${Ae},${Ye} ${W},${Ye}`).attr("fill", Qe).attr("opacity", I).attr("pointer-events", "none");
2335
+ ge.append("polygon").attr("class", "bc-bar-connection").attr("points", `${W},${Pe} ${Ae},${Be} ${Ae},${Ye} ${W},${Ye}`).attr("fill", Qe).attr("opacity", V).attr("pointer-events", "none");
2334
2336
  }
2335
2337
  }
2336
2338
  const pe = p.select(v).append("g");
2337
- if (_) {
2338
- const z = e.colors ?? Ta, I = "#333";
2339
- if (e.connectedColumns && B.length > 1) {
2339
+ if (H) {
2340
+ const z = e.colors ?? Ta, V = "#333";
2341
+ if (e.connectedColumns && D.length > 1) {
2340
2342
  const C = e.colors ?? Ta, U = e.connectionsOpacity ?? 0.15;
2341
- for (let E = 0; E < B.length - 1; E++) {
2342
- const W = B[E], Ae = B[E + 1];
2343
+ for (let E = 0; E < D.length - 1; E++) {
2344
+ const W = D[E], Ae = D[E + 1];
2343
2345
  if (Ae.isTotal || W.value == null || Ae.value == null || Number.isNaN(W.value) || Number.isNaN(Ae.value) || W.value === 0 || Ae.value === 0)
2344
2346
  continue;
2345
- const Pe = (X(W.label) ?? 0) + X.bandwidth(), Be = X(Ae.label) ?? 0, Ye = Y(W.y1), We = Y(Ae.y1), Xe = Y(W.y0), Qe = Y(Ae.y0), Ue = he.get(W.label) ?? C[0], Re = he.get(Ae.label) ?? C[0];
2347
+ const Pe = (q(W.label) ?? 0) + q.bandwidth(), Be = q(Ae.label) ?? 0, Ye = Y(W.y1), We = Y(Ae.y1), Xe = Y(W.y0), Qe = Y(Ae.y0), Ue = he.get(W.label) ?? C[0], Re = he.get(Ae.label) ?? C[0];
2346
2348
  let ft;
2347
2349
  if (Ue === Re)
2348
2350
  ft = Ue;
@@ -2353,34 +2355,34 @@ function ui(t, a, e = {}, r = !1) {
2353
2355
  ge.append("polygon").attr("class", "bc-bar-connection").attr("points", `${Pe},${Ye} ${Be},${We} ${Be},${Qe} ${Pe},${Xe}`).attr("fill", ft).attr("opacity", U).attr("pointer-events", "none");
2354
2356
  }
2355
2357
  }
2356
- for (let C = 0; C < B.length - 1; C++) {
2357
- const U = B[C], E = B[C + 1];
2358
+ for (let C = 0; C < D.length - 1; C++) {
2359
+ const U = D[C], E = D[C + 1];
2358
2360
  if (E.isTotal)
2359
2361
  break;
2360
- ge.append("line").attr("class", "bc-waterfall-connector").attr("x1", (X(U.label) ?? 0) + X.bandwidth()).attr("x2", X(E.label) ?? 0).attr("y1", Y(U.y1)).attr("y2", Y(U.y1)).attr("stroke", "currentColor").attr("stroke-dasharray", "2,2").attr("opacity", 0.3);
2362
+ ge.append("line").attr("class", "bc-waterfall-connector").attr("x1", (q(U.label) ?? 0) + q.bandwidth()).attr("x2", q(E.label) ?? 0).attr("y1", Y(U.y1)).attr("y2", Y(U.y1)).attr("stroke", "currentColor").attr("stroke-dasharray", "2,2").attr("opacity", 0.3);
2361
2363
  }
2362
- if (ge.selectAll(".bc-bar").data(B, (C) => C.label).enter().append("rect").attr("class", "bc-bar").attr("x", (C) => X(C.label) ?? 0).attr("y", (C) => Math.min(Y(C.y0), Y(C.y1))).attr("width", X.bandwidth()).attr("height", (C) => Math.abs(Y(C.y0) - Y(C.y1))).attr("fill", (C) => C.isTotal ? I : he.get(C.label) ?? z[0]).attr("opacity", (C) => ve.size > 0 ? ve.has(C.label) ? 1 : 0.2 : null), e.valueLabels) {
2364
+ if (ge.selectAll(".bc-bar").data(D, (C) => C.label).enter().append("rect").attr("class", "bc-bar").attr("x", (C) => q(C.label) ?? 0).attr("y", (C) => Math.min(Y(C.y0), Y(C.y1))).attr("width", q.bandwidth()).attr("height", (C) => Math.abs(Y(C.y0) - Y(C.y1))).attr("fill", (C) => C.isTotal ? V : he.get(C.label) ?? z[0]).attr("opacity", (C) => ve.size > 0 ? ve.has(C.label) ? 1 : 0.2 : null), e.valueLabels) {
2363
2365
  const C = e.valueLabelPosition ?? ze.Auto, U = ga(((S = e.verticalAxis) == null ? void 0 : S.numberFormat) ?? ""), E = (W) => U ? U(W) : String(W);
2364
- pe.selectAll(".bc-value-label").data(B, (W) => W.label).enter().append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("x", (W) => (X(W.label) ?? 0) + X.bandwidth() / 2).attr("y", (W) => {
2366
+ pe.selectAll(".bc-value-label").data(D, (W) => W.label).enter().append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("x", (W) => (q(W.label) ?? 0) + q.bandwidth() / 2).attr("y", (W) => {
2365
2367
  const Ae = Math.min(Y(W.y0), Y(W.y1)), Pe = Math.abs(Y(W.y0) - Y(W.y1));
2366
2368
  return C === ze.Inside ? Ae + Pe / 2 : Ae - 4;
2367
- }).attr("text-anchor", "middle").attr("dominant-baseline", C === ze.Inside ? "central" : "auto").attr("fill", (W) => C === ze.Inside ? Et(W.isTotal ? I : he.get(W.label) ?? z[0]) : "currentColor").text((W) => j ? W.label : E(W.isTotal ? W.y1 : W.value));
2369
+ }).attr("text-anchor", "middle").attr("dominant-baseline", C === ze.Inside ? "central" : "auto").attr("fill", (W) => C === ze.Inside ? Et(W.isTotal ? V : he.get(W.label) ?? z[0]) : "currentColor").text((W) => J ? W.label : E(W.isTotal ? W.y1 : W.value));
2368
2370
  }
2369
2371
  } else {
2370
- const z = $a(t), I = ge.append("g").node();
2372
+ const z = $a(t), V = ge.append("g").node();
2371
2373
  Ga(z, {
2372
2374
  role: "mark-per-category",
2373
- parent: I,
2375
+ parent: V,
2374
2376
  selector: ".bc-bar",
2375
- data: H,
2377
+ data: I,
2376
2378
  key: (U) => U.label,
2377
2379
  insert: (U) => U.append("rect").attr("class", "bc-bar"),
2378
2380
  attrs: (U) => {
2379
2381
  const E = ve.size > 0;
2380
2382
  return {
2381
- x: X(U.label) ?? 0,
2383
+ x: q(U.label) ?? 0,
2382
2384
  y: Math.min(Y(0), Y(U.value)),
2383
- width: X.bandwidth(),
2385
+ width: q.bandwidth(),
2384
2386
  height: Math.abs(Y(U.value) - Y(0)),
2385
2387
  fill: he.get(U.label) ?? (e.colors ?? Ta)[0],
2386
2388
  opacity: E ? ve.has(U.label) ? 1 : 0.35 : 1
@@ -2390,30 +2392,30 @@ function ui(t, a, e = {}, r = !1) {
2390
2392
  const C = new Sc(ge);
2391
2393
  e.tooltips && C.use(ma({ numberFormat: (T = e.verticalAxis) == null ? void 0 : T.numberFormat })), e.crosshair && C.use(La({
2392
2394
  width: y,
2393
- height: $,
2395
+ height: L,
2394
2396
  direction: e.crosshairDirection,
2395
2397
  style: e.crosshairStyle,
2396
2398
  color: e.crosshairColor
2397
- })), (O = e.annotations) != null && O.length && C.use(_a(e.annotations, {
2398
- scaleX: X,
2399
+ })), (P = e.annotations) != null && P.length && C.use(_a(e.annotations, {
2400
+ scaleX: q,
2399
2401
  scaleY: Y,
2400
- data: H,
2402
+ data: I,
2401
2403
  width: y,
2402
- height: $,
2404
+ height: L,
2403
2405
  backgroundColor: Ft(t),
2404
2406
  transition: r,
2405
2407
  priorAnnotations: s
2406
- })), C.draw(H), e.valueLabels && Lc(pe, H, X, Y, {
2408
+ })), C.draw(I), e.valueLabels && Lc(pe, I, q, Y, {
2407
2409
  position: e.valueLabelPosition,
2408
2410
  colorOverrides: he,
2409
2411
  colors: e.colors ?? Ta,
2410
- swapLabelValue: j
2412
+ swapLabelValue: J
2411
2413
  });
2412
2414
  }
2413
2415
  if (d) {
2414
2416
  const z = p.select(v).append("g").attr("class", "bc-category-labels");
2415
- for (const I of K)
2416
- z.append("text").attr("class", "bc-category-label").attr("x", (X(I) ?? 0) + X.bandwidth() / 2).attr("y", $ + ys / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(I);
2417
+ for (const V of j)
2418
+ z.append("text").attr("class", "bc-category-label").attr("x", (q(V) ?? 0) + q.bandwidth() / 2).attr("y", L + ys / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(V);
2417
2419
  }
2418
2420
  Rt(t, { chartType: "bar-vertical", margin: A }), n && (Nt(ge.node()), It(t, n));
2419
2421
  }
@@ -2465,7 +2467,7 @@ function jr(t) {
2465
2467
  return t.length * 6.5;
2466
2468
  }
2467
2469
  function hi(t, a, e = {}, r = !1) {
2468
- var Me, J, ae, ke, me, Ce, we, Ne, Oe, Q, Z;
2470
+ var Me, K, te, ke, me, Ce, we, Ne, Oe, Q, Z;
2469
2471
  Ht(r);
2470
2472
  let n = null, s, o;
2471
2473
  const i = Vt.for(t);
@@ -2473,107 +2475,107 @@ function hi(t, a, e = {}, r = !1) {
2473
2475
  const S = Yt(t);
2474
2476
  o = S == null ? void 0 : S.margin, i.detach(), S && S.chartType !== "bar-horizontal" && (n = Bt(t)), s = /* @__PURE__ */ new Map();
2475
2477
  for (const T of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
2476
- for (const [O, z] of Mt(T))
2477
- s.set(O, z);
2478
+ for (const [P, z] of Mt(T))
2479
+ s.set(P, z);
2478
2480
  t.replaceChildren();
2479
2481
  }
2480
- const { body: c } = _t(t, e.frame), f = $t(c).width, d = f > 0 && f < 400 && ((Me = e.verticalAxis) == null ? void 0 : Me.labelPosition) !== "outside", g = e.categoryLabelLine === !0 || d, b = Sr(a.labels), m = g ? He.Off : (J = e.verticalAxis) == null ? void 0 : J.labelPosition, v = ea(f, m, (ae = e.horizontalAxis) == null ? void 0 : ae.labelPosition, (ke = e.verticalAxis) == null ? void 0 : ke.direction, b, (me = e.horizontalAxis) == null ? void 0 : me.showAxis), y = e.valueLabelPosition ?? ze.Auto, x = e.swapLabelValue === !0;
2482
+ const { body: c } = _t(t, e.frame), f = $t(c).width, d = f > 0 && f < 400 && ((Me = e.verticalAxis) == null ? void 0 : Me.labelPosition) !== "outside", g = e.categoryLabelLine === !0 || d, b = Sr(a.labels), m = g ? He.Off : (K = e.verticalAxis) == null ? void 0 : K.labelPosition, v = ea(f, m, (te = e.horizontalAxis) == null ? void 0 : te.labelPosition, (ke = e.verticalAxis) == null ? void 0 : ke.direction, b, (me = e.horizontalAxis) == null ? void 0 : me.showAxis), y = e.valueLabelPosition ?? ze.Auto, x = e.swapLabelValue === !0;
2481
2483
  if (e.valueLabels && y !== ze.Inside)
2482
2484
  if (x) {
2483
- const S = a.labels.reduce((O, z) => O.length > z.length ? O : z, ""), T = jr(S) + Ur;
2485
+ const S = a.labels.reduce((P, z) => P.length > z.length ? P : z, ""), T = jr(S) + Ur;
2484
2486
  v.right = Math.max(v.right ?? 15, T);
2485
2487
  } else {
2486
- const S = Math.max(...a.values), T = Math.min(...a.values), O = S > 0 ? jr(String(S)) + Ur : 0, z = T < 0 ? jr(String(T)) + Ur : 0;
2487
- v.right = Math.max(v.right ?? 15, O), z > 0 && (v.left = (v.left ?? 50) + z);
2488
+ const S = Math.max(...a.values), T = Math.min(...a.values), P = S > 0 ? jr(String(S)) + Ur : 0, z = T < 0 ? jr(String(T)) + Ur : 0;
2489
+ v.right = Math.max(v.right ?? 15, P), z > 0 && (v.left = (v.left ?? 50) + z);
2488
2490
  }
2489
- const { chartArea: A, width: w, height: $, margin: P } = Gt(c, v), D = g ? vs : 0, H = Kt(o, P), j = Tc(a, e), _ = j.map((S) => ({
2491
+ const { chartArea: A, width: w, height: L, margin: O } = Gt(c, v), F = g ? vs : 0, I = Kt(o, O), J = Tc(a, e), H = J.map((S) => ({
2490
2492
  label: S,
2491
2493
  value: a.values[a.labels.indexOf(S)]
2492
- })), B = e.waterfall === !0, K = [];
2493
- if (B) {
2494
+ })), D = e.waterfall === !0, j = [];
2495
+ if (D) {
2494
2496
  let S = 0;
2495
- for (const T of _) {
2496
- const O = S;
2497
- S += T.value, K.push({ label: T.label, value: T.value, x0: O, x1: S, isTotal: !1 });
2497
+ for (const T of H) {
2498
+ const P = S;
2499
+ S += T.value, j.push({ label: T.label, value: T.value, x0: P, x1: S, isTotal: !1 });
2498
2500
  }
2499
- e.waterfallTotal && K.push({ label: "Total", value: S, x0: 0, x1: S, isTotal: !0 });
2501
+ e.waterfallTotal && j.push({ label: "Total", value: S, x0: 0, x1: S, isTotal: !0 });
2500
2502
  }
2501
- const X = ((Ce = e.horizontalAxis) == null ? void 0 : Ce.scaleType) === "log", te = B ? K.flatMap((S) => [S.x0, S.x1]) : _.map((S) => S.value), [fe, se] = Va(te, (we = e.horizontalAxis) == null ? void 0 : we.range, (Ne = e.horizontalAxis) == null ? void 0 : Ne.scaleType), F = X ? p.scaleSymlog().domain([fe, se]).nice().range([0, w]) : p.scaleLinear().domain([fe, se]).nice().range([0, w]), Y = B ? K.map((S) => S.label) : j, R = p.scaleBand().domain(Y).range([0, $]).padding(ka(e.barGap)), ie = x && e.valueLabels && !B ? (() => {
2502
- const S = new Map(_.map((T) => [T.label, T.value]));
2503
+ const q = ((Ce = e.horizontalAxis) == null ? void 0 : Ce.scaleType) === "log", ae = D ? j.flatMap((S) => [S.x0, S.x1]) : H.map((S) => S.value), [fe, ne] = Va(ae, (we = e.horizontalAxis) == null ? void 0 : we.range, (Ne = e.horizontalAxis) == null ? void 0 : Ne.scaleType), N = q ? p.scaleSymlog().domain([fe, ne]).nice().range([0, w]) : p.scaleLinear().domain([fe, ne]).nice().range([0, w]), Y = D ? j.map((S) => S.label) : J, R = p.scaleBand().domain(Y).range([0, L]).padding(ka(e.barGap)), ie = x && e.valueLabels && !D ? (() => {
2504
+ const S = new Map(H.map((T) => [T.label, T.value]));
2503
2505
  return {
2504
2506
  ...e.verticalAxis,
2505
- topPadding: P.top,
2507
+ topPadding: O.top,
2506
2508
  tickFormat: (T) => String(S.get(T) ?? T)
2507
2509
  };
2508
- })() : { ...e.verticalAxis, topPadding: P.top }, he = g ? { ...ie, labelPosition: He.Off, ...d ? { showAxis: !1 } : {} } : ie;
2509
- i.attach(A, H), i.update({
2510
- horizontal: { scale: F, height: $, options: { ...e.horizontalAxis, width: w } },
2511
- vertical: { scale: R, height: $, options: he },
2510
+ })() : { ...e.verticalAxis, topPadding: O.top }, he = g ? { ...ie, labelPosition: He.Off, ...d ? { showAxis: !1 } : {} } : ie;
2511
+ i.attach(A, I), i.update({
2512
+ horizontal: { scale: N, height: L, options: { ...e.horizontalAxis, width: w } },
2513
+ vertical: { scale: R, height: L, options: he },
2512
2514
  order: "horizontal-first"
2513
- }), !X && fe < 0 && se > 0 && p.select(A).append("line").attr("class", "bc-zero-baseline").attr("x1", F(0)).attr("x2", F(0)).attr("y1", 0).attr("y2", $).attr("stroke", "#666").attr("stroke-width", 1);
2515
+ }), !q && fe < 0 && ne > 0 && p.select(A).append("line").attr("class", "bc-zero-baseline").attr("x1", N(0)).attr("x2", N(0)).attr("y1", 0).attr("y2", L).attr("stroke", "#666").attr("stroke-width", 1);
2514
2516
  const ve = new Map(
2515
2517
  (e.colorizes ?? []).map((S) => [S.target, S.color])
2516
- ), ce = new Set((e.highlights ?? []).map((S) => S.target)), ue = A.ownerSVGElement, Se = ta(ue, t, "bars", { x: 0, y: 0, width: w, height: $ }), ye = p.select(ue).select("defs"), ge = Se.replace(/^bc-clip-/, ""), xe = p.select(A).append("g").attr("clip-path", `url(#${Se})`);
2518
+ ), ce = new Set((e.highlights ?? []).map((S) => S.target)), ue = A.ownerSVGElement, Se = ta(ue, t, "bars", { x: 0, y: 0, width: w, height: L }), ye = p.select(ue).select("defs"), ge = Se.replace(/^bc-clip-/, ""), xe = p.select(A).append("g").attr("clip-path", `url(#${Se})`);
2517
2519
  if (e.barBackground) {
2518
- const S = (e.colors ?? za)[0], T = B ? Y : _.map((O) => O.label);
2519
- xe.selectAll(".bc-bar-bg").data(T, (O) => O).enter().append("rect").attr("class", "bc-bar-bg").attr("x", 0).attr("y", (O) => (R(O) ?? 0) + D).attr("width", w).attr("height", R.bandwidth() - D).attr("fill", S).attr("opacity", 0.18);
2520
+ const S = (e.colors ?? za)[0], T = D ? Y : H.map((P) => P.label);
2521
+ xe.selectAll(".bc-bar-bg").data(T, (P) => P).enter().append("rect").attr("class", "bc-bar-bg").attr("x", 0).attr("y", (P) => (R(P) ?? 0) + F).attr("width", w).attr("height", R.bandwidth() - F).attr("fill", S).attr("opacity", 0.18);
2520
2522
  }
2521
- const pe = B ? Y : _.map((S) => S.label);
2523
+ const pe = D ? Y : H.map((S) => S.label);
2522
2524
  if (e.barSeparators && pe.length > 1) {
2523
2525
  const S = R.step();
2524
2526
  for (let T = 1; T < pe.length; T++) {
2525
- const O = (R(pe[T - 1]) ?? 0) + R.bandwidth() + (S - R.bandwidth()) / 2;
2526
- xe.append("line").attr("class", "bc-bar-separator").attr("x1", 0).attr("x2", w).attr("y1", O).attr("y2", O).attr("stroke", "currentColor").attr("opacity", 0.15);
2527
+ const P = (R(pe[T - 1]) ?? 0) + R.bandwidth() + (S - R.bandwidth()) / 2;
2528
+ xe.append("line").attr("class", "bc-bar-separator").attr("x1", 0).attr("x2", w).attr("y1", P).attr("y2", P).attr("stroke", "currentColor").attr("opacity", 0.15);
2527
2529
  }
2528
2530
  }
2529
- if (!B && e.connectedColumns && _.length > 1) {
2531
+ if (!D && e.connectedColumns && H.length > 1) {
2530
2532
  const S = e.colors ?? za, T = e.connectionsOpacity ?? 0.15;
2531
- for (let O = 0; O < _.length - 1; O++) {
2532
- const z = _[O], I = _[O + 1];
2533
- if (z.value == null || I.value == null || Number.isNaN(z.value) || Number.isNaN(I.value) || z.value === 0 || I.value === 0)
2533
+ for (let P = 0; P < H.length - 1; P++) {
2534
+ const z = H[P], V = H[P + 1];
2535
+ if (z.value == null || V.value == null || Number.isNaN(z.value) || Number.isNaN(V.value) || z.value === 0 || V.value === 0)
2534
2536
  continue;
2535
- const C = (R(z.label) ?? 0) + R.bandwidth(), U = (R(I.label) ?? 0) + D, E = Math.max(F(0), F(z.value)), W = Math.max(F(0), F(I.value)), Ae = F(0), Pe = ve.get(z.label) ?? S[0], Be = ve.get(I.label) ?? S[0];
2537
+ const C = (R(z.label) ?? 0) + R.bandwidth(), U = (R(V.label) ?? 0) + F, E = Math.max(N(0), N(z.value)), W = Math.max(N(0), N(V.value)), Ae = N(0), Pe = ve.get(z.label) ?? S[0], Be = ve.get(V.label) ?? S[0];
2536
2538
  let Ye;
2537
2539
  if (Pe === Be)
2538
2540
  Ye = Pe;
2539
2541
  else {
2540
- const We = `bc-conn-grad-${ge}-${O}`, Xe = ye.append("linearGradient").attr("id", We).attr("x1", "0%").attr("x2", "0%").attr("y1", "0%").attr("y2", "100%");
2542
+ const We = `bc-conn-grad-${ge}-${P}`, Xe = ye.append("linearGradient").attr("id", We).attr("x1", "0%").attr("x2", "0%").attr("y1", "0%").attr("y2", "100%");
2541
2543
  Xe.append("stop").attr("offset", "0%").attr("stop-color", Pe), Xe.append("stop").attr("offset", "100%").attr("stop-color", Be), Ye = `url(#${We})`;
2542
2544
  }
2543
2545
  xe.append("polygon").attr("class", "bc-bar-connection").attr("points", `${E},${C} ${W},${U} ${Ae},${U} ${Ae},${C}`).attr("fill", Ye).attr("opacity", T).attr("pointer-events", "none");
2544
2546
  }
2545
2547
  }
2546
- if (B) {
2548
+ if (D) {
2547
2549
  const S = e.colors ?? za, T = "#333";
2548
- if (e.connectedColumns && K.length > 1) {
2549
- const O = e.colors ?? za, z = e.connectionsOpacity ?? 0.15;
2550
- for (let I = 0; I < K.length - 1; I++) {
2551
- const C = K[I], U = K[I + 1];
2550
+ if (e.connectedColumns && j.length > 1) {
2551
+ const P = e.colors ?? za, z = e.connectionsOpacity ?? 0.15;
2552
+ for (let V = 0; V < j.length - 1; V++) {
2553
+ const C = j[V], U = j[V + 1];
2552
2554
  if (U.isTotal || C.value == null || U.value == null || Number.isNaN(C.value) || Number.isNaN(U.value) || C.value === 0 || U.value === 0)
2553
2555
  continue;
2554
- const E = (R(C.label) ?? 0) + R.bandwidth(), W = (R(U.label) ?? 0) + D, Ae = F(C.x1), Pe = F(U.x1), Be = F(C.x0), Ye = F(U.x0), We = ve.get(C.label) ?? O[0], Xe = ve.get(U.label) ?? O[0];
2556
+ const E = (R(C.label) ?? 0) + R.bandwidth(), W = (R(U.label) ?? 0) + F, Ae = N(C.x1), Pe = N(U.x1), Be = N(C.x0), Ye = N(U.x0), We = ve.get(C.label) ?? P[0], Xe = ve.get(U.label) ?? P[0];
2555
2557
  let Qe;
2556
2558
  if (We === Xe)
2557
2559
  Qe = We;
2558
2560
  else {
2559
- const Ue = `bc-conn-grad-${ge}-${I}`, Re = ye.append("linearGradient").attr("id", Ue).attr("x1", "0%").attr("x2", "0%").attr("y1", "0%").attr("y2", "100%");
2561
+ const Ue = `bc-conn-grad-${ge}-${V}`, Re = ye.append("linearGradient").attr("id", Ue).attr("x1", "0%").attr("x2", "0%").attr("y1", "0%").attr("y2", "100%");
2560
2562
  Re.append("stop").attr("offset", "0%").attr("stop-color", We), Re.append("stop").attr("offset", "100%").attr("stop-color", Xe), Qe = `url(#${Ue})`;
2561
2563
  }
2562
2564
  xe.append("polygon").attr("class", "bc-bar-connection").attr("points", `${Ae},${E} ${Pe},${W} ${Ye},${W} ${Be},${E}`).attr("fill", Qe).attr("opacity", z).attr("pointer-events", "none");
2563
2565
  }
2564
2566
  }
2565
- for (let O = 0; O < K.length - 1; O++) {
2566
- const z = K[O], I = K[O + 1];
2567
- if (I.isTotal)
2567
+ for (let P = 0; P < j.length - 1; P++) {
2568
+ const z = j[P], V = j[P + 1];
2569
+ if (V.isTotal)
2568
2570
  break;
2569
- xe.append("line").attr("class", "bc-waterfall-connector").attr("x1", F(z.x1)).attr("x2", F(z.x1)).attr("y1", (R(z.label) ?? 0) + R.bandwidth()).attr("y2", (R(I.label) ?? 0) + D).attr("stroke", "currentColor").attr("stroke-dasharray", "2,2").attr("opacity", 0.3);
2571
+ xe.append("line").attr("class", "bc-waterfall-connector").attr("x1", N(z.x1)).attr("x2", N(z.x1)).attr("y1", (R(z.label) ?? 0) + R.bandwidth()).attr("y2", (R(V.label) ?? 0) + F).attr("stroke", "currentColor").attr("stroke-dasharray", "2,2").attr("opacity", 0.3);
2570
2572
  }
2571
- if (xe.selectAll(".bc-bar").data(K, (O) => O.label).enter().append("rect").attr("class", "bc-bar").attr("x", (O) => Math.min(F(O.x0), F(O.x1))).attr("y", (O) => (R(O.label) ?? 0) + D).attr("width", (O) => Math.abs(F(O.x1) - F(O.x0))).attr("height", R.bandwidth() - D).attr("fill", (O) => O.isTotal ? T : ve.get(O.label) ?? S[0]).attr("opacity", (O) => ce.size > 0 ? ce.has(O.label) ? 1 : 0.35 : null), e.valueLabels) {
2572
- const O = y, z = ga(((Oe = e.horizontalAxis) == null ? void 0 : Oe.numberFormat) ?? ""), I = (U) => z ? z(U) : String(U);
2573
- p.select(A).append("g").selectAll(".bc-value-label").data(K, (U) => U.label).enter().append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("dominant-baseline", "central").attr("y", (U) => (R(U.label) ?? 0) + D + (R.bandwidth() - D) / 2).attr("x", (U) => {
2574
- const E = Math.max(F(U.x0), F(U.x1));
2575
- return O === ze.Inside ? E - 4 : E + 4;
2576
- }).attr("text-anchor", O === ze.Inside ? "end" : "start").attr("fill", (U) => O === ze.Inside ? Et(U.isTotal ? T : ve.get(U.label) ?? S[0]) : "currentColor").text((U) => x ? U.label : I(U.isTotal ? U.x1 : U.value));
2573
+ if (xe.selectAll(".bc-bar").data(j, (P) => P.label).enter().append("rect").attr("class", "bc-bar").attr("x", (P) => Math.min(N(P.x0), N(P.x1))).attr("y", (P) => (R(P.label) ?? 0) + F).attr("width", (P) => Math.abs(N(P.x1) - N(P.x0))).attr("height", R.bandwidth() - F).attr("fill", (P) => P.isTotal ? T : ve.get(P.label) ?? S[0]).attr("opacity", (P) => ce.size > 0 ? ce.has(P.label) ? 1 : 0.35 : null), e.valueLabels) {
2574
+ const P = y, z = ga(((Oe = e.horizontalAxis) == null ? void 0 : Oe.numberFormat) ?? ""), V = (U) => z ? z(U) : String(U);
2575
+ p.select(A).append("g").selectAll(".bc-value-label").data(j, (U) => U.label).enter().append("text").attr("class", "bc-value-label").attr("font-size", "11px").attr("dominant-baseline", "central").attr("y", (U) => (R(U.label) ?? 0) + F + (R.bandwidth() - F) / 2).attr("x", (U) => {
2576
+ const E = Math.max(N(U.x0), N(U.x1));
2577
+ return P === ze.Inside ? E - 4 : E + 4;
2578
+ }).attr("text-anchor", P === ze.Inside ? "end" : "start").attr("fill", (U) => P === ze.Inside ? Et(U.isTotal ? T : ve.get(U.label) ?? S[0]) : "currentColor").text((U) => x ? U.label : V(U.isTotal ? U.x1 : U.value));
2577
2579
  }
2578
2580
  } else {
2579
2581
  const S = $a(t), T = xe.append("g").node();
@@ -2581,58 +2583,58 @@ function hi(t, a, e = {}, r = !1) {
2581
2583
  role: "mark-per-category",
2582
2584
  parent: T,
2583
2585
  selector: ".bc-bar",
2584
- data: _,
2586
+ data: H,
2585
2587
  key: (z) => z.label,
2586
2588
  insert: (z) => z.append("rect").attr("class", "bc-bar"),
2587
2589
  attrs: (z) => {
2588
- const I = ce.size > 0;
2590
+ const V = ce.size > 0;
2589
2591
  return {
2590
- x: Math.min(F(0), F(z.value)),
2591
- y: (R(z.label) ?? 0) + D,
2592
- width: Math.abs(F(z.value) - F(0)),
2593
- height: R.bandwidth() - D,
2592
+ x: Math.min(N(0), N(z.value)),
2593
+ y: (R(z.label) ?? 0) + F,
2594
+ width: Math.abs(N(z.value) - N(0)),
2595
+ height: R.bandwidth() - F,
2594
2596
  fill: ve.get(z.label) ?? (e.colors ?? za)[0],
2595
- opacity: I ? ce.has(z.label) ? 1 : 0.35 : 1
2597
+ opacity: V ? ce.has(z.label) ? 1 : 0.35 : 1
2596
2598
  };
2597
2599
  }
2598
2600
  });
2599
- const O = new Cc(xe);
2600
- if (e.tooltips && O.use(ma({ numberFormat: (Q = e.horizontalAxis) == null ? void 0 : Q.numberFormat })), e.crosshair && O.use(La({
2601
+ const P = new Cc(xe);
2602
+ if (e.tooltips && P.use(ma({ numberFormat: (Q = e.horizontalAxis) == null ? void 0 : Q.numberFormat })), e.crosshair && P.use(La({
2601
2603
  width: w,
2602
- height: $,
2604
+ height: L,
2603
2605
  direction: e.crosshairDirection,
2604
2606
  style: e.crosshairStyle,
2605
2607
  color: e.crosshairColor,
2606
2608
  orientation: st.Horizontal
2607
- })), (Z = e.annotations) != null && Z.length && O.use(_a(e.annotations, {
2609
+ })), (Z = e.annotations) != null && Z.length && P.use(_a(e.annotations, {
2608
2610
  scaleX: R,
2609
- scaleY: F,
2610
- data: _,
2611
+ scaleY: N,
2612
+ data: H,
2611
2613
  width: w,
2612
- height: $,
2614
+ height: L,
2613
2615
  backgroundColor: Ft(t),
2614
2616
  orientation: st.Horizontal,
2615
2617
  transition: r,
2616
2618
  priorAnnotations: s
2617
- })), O.draw(_), e.valueLabels) {
2619
+ })), P.draw(H), e.valueLabels) {
2618
2620
  const z = p.select(A).append("g");
2619
- Pc(z, _, F, R, {
2621
+ Pc(z, H, N, R, {
2620
2622
  position: y,
2621
2623
  colorOverrides: ve,
2622
2624
  colors: e.colors ?? za,
2623
2625
  swapLabelValue: x,
2624
- categoryLabelOffset: D
2626
+ categoryLabelOffset: F
2625
2627
  });
2626
2628
  }
2627
2629
  }
2628
2630
  if (g) {
2629
2631
  const S = p.select(A).append("g").attr("class", "bc-category-labels");
2630
2632
  for (const T of Y) {
2631
- const O = R(T) ?? 0;
2632
- S.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", O + vs / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(T);
2633
+ const P = R(T) ?? 0;
2634
+ S.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", P + vs / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(T);
2633
2635
  }
2634
2636
  }
2635
- Rt(t, { chartType: "bar-horizontal", margin: P }), n && (Nt(xe.node()), It(t, n));
2637
+ Rt(t, { chartType: "bar-horizontal", margin: O }), n && (Nt(xe.node()), It(t, n));
2636
2638
  }
2637
2639
  function Oc(t, a, e, r, n = 0) {
2638
2640
  const s = r === ze.Inside, o = (e(t.label) ?? 0) + n + (e.bandwidth() - n) / 2;
@@ -2766,16 +2768,16 @@ function Bc(t, a, e = {}, r = !1) {
2766
2768
  s.set(le, re);
2767
2769
  t.replaceChildren();
2768
2770
  }
2769
- const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((M) => !Ma(M.name, e.seriesOverrides)), g = d.map((M) => M.name), b = e.colors ?? Fc, m = e.seriesOverrides, v = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", y = v ? "direct" : e.legend !== !1 ? "legend" : "none", x = e.legend !== !1 && !v, A = $t(c).width, w = 350, $ = e.legendPosition ?? "top", P = A > 0 && A < w && ($ === "left" || $ === "right") ? "top" : $, D = e.legendAnchor ?? "start", H = d.flatMap((M) => M.values), j = wa(H, (Ae = e.verticalAxis) == null ? void 0 : Ae.range, (Pe = e.verticalAxis) == null ? void 0 : Pe.numberFormat, (Be = e.verticalAxis) == null ? void 0 : Be.scaleType), _ = ea(A, (Ye = e.verticalAxis) == null ? void 0 : Ye.labelPosition, (We = e.horizontalAxis) == null ? void 0 : We.labelPosition, (Xe = e.verticalAxis) == null ? void 0 : Xe.direction, j), B = Math.max(0, A - (_.left ?? 50) - (_.right ?? 20)), K = sn(a.labels, B, e.horizontalAxis);
2770
- K !== void 0 && (_.bottom = K);
2771
- const X = _.top != null, te = Math.max(0, A - (_.left ?? 50) - (_.right ?? 20)), fe = x ? ya(g, P, te) : { width: 0, height: 0 }, se = x ? fe.height + 15 : 0, F = { ..._ };
2772
- if (x && P === "top") {
2773
- const M = X ? 15 : 0;
2774
- F.top = se + M;
2771
+ const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((M) => !Ma(M.name, e.seriesOverrides)), g = d.map((M) => M.name), b = e.colors ?? Fc, m = e.seriesOverrides, v = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", y = v ? "direct" : e.legend !== !1 ? "legend" : "none", x = e.legend !== !1 && !v, A = $t(c).width, w = 350, L = e.legendPosition ?? "top", O = A > 0 && A < w && (L === "left" || L === "right") ? "top" : L, F = e.legendAnchor ?? "start", I = d.flatMap((M) => M.values), J = wa(I, (Ae = e.verticalAxis) == null ? void 0 : Ae.range, (Pe = e.verticalAxis) == null ? void 0 : Pe.numberFormat, (Be = e.verticalAxis) == null ? void 0 : Be.scaleType), H = ea(A, (Ye = e.verticalAxis) == null ? void 0 : Ye.labelPosition, (We = e.horizontalAxis) == null ? void 0 : We.labelPosition, (Xe = e.verticalAxis) == null ? void 0 : Xe.direction, J), D = Math.max(0, A - (H.left ?? 50) - (H.right ?? 20)), j = sn(a.labels, D, e.horizontalAxis);
2772
+ j !== void 0 && (H.bottom = j);
2773
+ const q = H.top != null, ae = Math.max(0, A - (H.left ?? 50) - (H.right ?? 20)), fe = x ? ya(g, O, ae) : { width: 0, height: 0 }, ne = x ? fe.height + 15 : 0, N = { ...H };
2774
+ if (x && O === "top") {
2775
+ const M = q ? 15 : 0;
2776
+ N.top = ne + M;
2775
2777
  }
2776
- x && P === "bottom" && (F.bottom = (F.bottom ?? 24) + se), x && P === "left" && (F.left = (F.left ?? 50) + fe.width + 10), x && P === "right" && (F.right = (F.right ?? 20) + fe.width + 10);
2777
- const { chartArea: Y, width: R, height: ie, margin: he } = Gt(c, F), ve = Kt(o, he);
2778
- let [ce, ue] = Va(H, (Qe = e.verticalAxis) == null ? void 0 : Qe.range, (Ue = e.verticalAxis) == null ? void 0 : Ue.scaleType);
2778
+ x && O === "bottom" && (N.bottom = (N.bottom ?? 24) + ne), x && O === "left" && (N.left = (N.left ?? 50) + fe.width + 10), x && O === "right" && (N.right = (N.right ?? 20) + fe.width + 10);
2779
+ const { chartArea: Y, width: R, height: ie, margin: he } = Gt(c, N), ve = Kt(o, he);
2780
+ let [ce, ue] = Va(I, (Qe = e.verticalAxis) == null ? void 0 : Qe.range, (Ue = e.verticalAxis) == null ? void 0 : Ue.scaleType);
2779
2781
  if (e.valueLabels && ce < 0 && ((ft = (Re = e.verticalAxis) == null ? void 0 : Re.range) == null ? void 0 : ft.min) == null) {
2780
2782
  const M = ue - ce;
2781
2783
  ce -= M * 0.1;
@@ -2801,19 +2803,19 @@ function Bc(t, a, e = {}, r = !1) {
2801
2803
  Me.set(`${M}\0${re.name}`, g[Te]);
2802
2804
  });
2803
2805
  });
2804
- const J = [];
2806
+ const K = [];
2805
2807
  a.labels.forEach((M, oe) => {
2806
2808
  d.forEach((le) => {
2807
2809
  const re = f.findIndex((je) => je.name === le.name), Te = e.sortMode === "within-groups" ? Me.get(`${M}\0${le.name}`) ?? le.name : le.name;
2808
- J.push({ label: M, series: Te, seriesName: le.name, value: le.values[oe], seriesIndex: re });
2810
+ K.push({ label: M, series: Te, seriesName: le.name, value: le.values[oe], seriesIndex: re });
2809
2811
  });
2810
2812
  });
2811
- const ae = e.valueLabels ?? !1, ke = Y.ownerSVGElement, me = ta(ke, t, "bars", { x: 0, y: 0, width: R, height: ie }), Ce = p.select(Y).append("g").attr("clip-path", `url(#${me})`), we = $a(t), Ne = Ce.append("g").node();
2813
+ const te = e.valueLabels ?? !1, ke = Y.ownerSVGElement, me = ta(ke, t, "bars", { x: 0, y: 0, width: R, height: ie }), Ce = p.select(Y).append("g").attr("clip-path", `url(#${me})`), we = $a(t), Ne = Ce.append("g").node();
2812
2814
  Ga(we, {
2813
2815
  role: "mark-per-cell",
2814
2816
  parent: Ne,
2815
2817
  selector: ".bc-bar-multi",
2816
- data: J,
2818
+ data: K,
2817
2819
  key: (M) => `${M.label}\0${M.seriesName}`,
2818
2820
  insert: (M) => M.append("rect").attr("class", "bc-bar bc-bar-multi"),
2819
2821
  attrs: (M) => {
@@ -2842,41 +2844,41 @@ function Bc(t, a, e = {}, r = !1) {
2842
2844
  }));
2843
2845
  Oe.use(_a(e.annotations, { scaleX: ye, scaleY: pe, data: M, width: R, height: ie, backgroundColor: Ft(t), transition: r, priorAnnotations: s }));
2844
2846
  }
2845
- Oe.draw(J), Rt(t, { chartType: "bar-multi", margin: he }), n && (Nt(Ce.node()), It(t, n));
2847
+ Oe.draw(K), Rt(t, { chartType: "bar-multi", margin: he }), n && (Nt(Ce.node()), It(t, n));
2846
2848
  const Q = /* @__PURE__ */ new Set();
2847
2849
  d.forEach((M) => {
2848
2850
  ha(M.name, y, m) === "direct" && Q.add(M.name);
2849
2851
  });
2850
- const Z = Q.size > 0, S = Ft(t), T = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ? bt.Auto : bt.Off, O = e.directLabelAnchor ?? "middle", z = e.valueLabelPosition ?? ze.Auto;
2851
- function I() {
2852
+ const Z = Q.size > 0, S = Ft(t), T = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ? bt.Auto : bt.Off, P = e.directLabelAnchor ?? "middle", z = e.valueLabelPosition ?? ze.Auto;
2853
+ function V() {
2852
2854
  return z === ze.Inside ? ze.Inside : (z === ze.Outside, ze.Outside);
2853
2855
  }
2854
2856
  function C(M) {
2855
- return T === bt.Inside ? ze.Inside : T === bt.Outside ? ze.Outside : ae ? I() : ze.Outside;
2857
+ return T === bt.Inside ? ze.Inside : T === bt.Outside ? ze.Outside : te ? V() : ze.Outside;
2856
2858
  }
2857
2859
  function U(M, oe, le) {
2858
2860
  return le === "start" ? M + 12 : le === "end" ? M + oe - 4 : M + oe / 2;
2859
2861
  }
2860
2862
  const E = p.select(Y).append("g").attr("class", "bc-value-labels");
2861
- J.forEach((M) => {
2862
- if (!Ha(M.seriesName, ae, m))
2863
+ K.forEach((M) => {
2864
+ if (!Ha(M.seriesName, te, m))
2863
2865
  return;
2864
- const oe = (ye(M.label) ?? 0) + (ge(M.series) ?? 0) + ge.bandwidth() / 2, le = Math.min(pe(0), pe(M.value)), re = Math.abs(pe(M.value) - pe(0)), Te = I(), je = Z && Q.has(M.seriesName), Ot = M.value < 0, it = le + re;
2866
+ const oe = (ye(M.label) ?? 0) + (ge(M.series) ?? 0) + ge.bandwidth() / 2, le = Math.min(pe(0), pe(M.value)), re = Math.abs(pe(M.value) - pe(0)), Te = V(), je = Z && Q.has(M.seriesName), Ot = M.value < 0, it = le + re;
2865
2867
  let Je, Pt, na;
2866
2868
  if (Te === ze.Inside) {
2867
2869
  const fa = qe(M.seriesName, M.seriesIndex, b, m);
2868
- Pt = Et(fa), na = "central", je && C() === ze.Inside ? Je = U(le, re, O) + 14 : Je = le + re / 2;
2870
+ Pt = Et(fa), na = "central", je && C() === ze.Inside ? Je = U(le, re, P) + 14 : Je = le + re / 2;
2869
2871
  } else
2870
2872
  Pt = "currentColor", Ot ? (Je = je && C() === ze.Outside ? it + 16 : it + 4, na = "hanging") : (Je = je && C() === ze.Outside ? le - 16 : le - 4, na = "auto");
2871
2873
  E.append("text").attr("class", "bc-value-label").attr("data-series", M.seriesName).attr("x", oe).attr("y", Je).attr("text-anchor", "middle").attr("dominant-baseline", na).attr("font-size", "11px").attr("fill", Pt).text(String(M.value));
2872
- }), J.forEach((M) => {
2874
+ }), K.forEach((M) => {
2873
2875
  var Je;
2874
2876
  if (!Q.has(M.seriesName))
2875
2877
  return;
2876
2878
  const oe = (ye(M.label) ?? 0) + (ge(M.series) ?? 0) + ge.bandwidth() / 2, le = Math.min(pe(0), pe(M.value)), re = Math.abs(pe(M.value) - pe(0)), Te = ((Je = m == null ? void 0 : m.find((Pt) => Pt.name === M.seriesName)) == null ? void 0 : Je.labelText) || M.seriesName, je = C(), Ot = qe(M.seriesName, M.seriesIndex, b, m), it = p.select(Y).append("text").attr("class", "bc-direct-label").attr("data-series", M.seriesName).attr("x", oe).attr("text-anchor", "middle").attr("font-size", "10px").text(Te);
2877
2879
  if (je === ze.Inside) {
2878
- const Pt = U(le, re, O);
2879
- it.attr("y", Pt).attr("fill", Et(Ot)), O === "middle" && it.attr("dominant-baseline", "central");
2880
+ const Pt = U(le, re, P);
2881
+ it.attr("y", Pt).attr("fill", Et(Ot)), P === "middle" && it.attr("dominant-baseline", "central");
2880
2882
  } else
2881
2883
  it.attr("y", le - 4).attr("fill", li(Ot, S));
2882
2884
  });
@@ -2887,11 +2889,11 @@ function Bc(t, a, e = {}, r = !1) {
2887
2889
  return qe(re, Te, b, m);
2888
2890
  });
2889
2891
  let oe = 0, le = 0;
2890
- if (P === "top") {
2891
- const re = X ? 15 : 0;
2892
+ if (O === "top") {
2893
+ const re = q ? 15 : 0;
2892
2894
  le = -(fe.height + 10 + re);
2893
- } else P === "bottom" ? le = ie + 25 : P === "left" ? oe = -(fe.width + 10) : P === "right" && (oe = R + 10);
2894
- ba(Y, W, M, le, P, D, R, ie, oe, [], { left: he.left, right: he.right });
2895
+ } else O === "bottom" ? le = ie + 25 : O === "left" ? oe = -(fe.width + 10) : O === "right" && (oe = R + 10);
2896
+ ba(Y, W, M, le, O, F, R, ie, oe, [], { left: he.left, right: he.right });
2895
2897
  }
2896
2898
  }
2897
2899
  const Ic = {
@@ -2922,13 +2924,13 @@ function bi(t) {
2922
2924
  if (A = a === ze.Inside, v = f + g / 2, x = "central", b)
2923
2925
  A ? (m = c + 4, y = "start") : (m = c - 4, y = "end");
2924
2926
  else {
2925
- const D = c + d;
2926
- A ? (m = D - 4, y = "end") : (m = D + 4, y = "start");
2927
+ const F = c + d;
2928
+ A ? (m = F - 4, y = "end") : (m = F + 4, y = "start");
2927
2929
  }
2928
2930
  else
2929
2931
  A = a === ze.Inside, m = c + d / 2, y = "middle", b ? A ? (v = f + g / 2, x = "central") : (v = f + g + 4, x = "hanging") : A ? (v = f + g / 2, x = "central") : (v = f - 4, x = "auto");
2930
- const w = i.attr("fill") || "#ccc", $ = A ? Et(w) : "currentColor";
2931
- p.select(this.parentNode).append("text").attr("class", "bc-value-label").attr("x", m).attr("y", v).attr("text-anchor", y).attr("dominant-baseline", x).attr("font-size", "11px").attr("fill", $).text(r(o.value));
2932
+ const w = i.attr("fill") || "#ccc", L = A ? Et(w) : "currentColor";
2933
+ p.select(this.parentNode).append("text").attr("class", "bc-value-label").attr("x", m).attr("y", v).attr("text-anchor", y).attr("dominant-baseline", x).attr("font-size", "11px").attr("fill", L).text(r(o.value));
2932
2934
  }), s.selectAll(".bc-dot").each(function(o) {
2933
2935
  const i = p.select(this), c = parseFloat(i.attr("cx")), f = parseFloat(i.attr("cy"));
2934
2936
  p.select(this.parentNode).append("text").attr("class", "bc-value-label").attr("x", c).attr("y", f - 8).attr("text-anchor", "middle").attr("font-size", "11px").attr("fill", "currentColor").text(r(o.value));
@@ -2979,44 +2981,44 @@ function Cr(t, a) {
2979
2981
  container: g
2980
2982
  } = a;
2981
2983
  if (n.length === 0) {
2982
- const se = () => {
2984
+ const ne = () => {
2983
2985
  };
2984
- return g && Fa.set(g, se), se;
2986
+ return g && Fa.set(g, ne), ne;
2985
2987
  }
2986
- const b = c === Qt.Solid ? "none" : c === Qt.Dotted ? "2,2" : "4,3", m = [...new Set(n.map((se) => se.cx))].sort((se, F) => se - F), v = p.select(t);
2988
+ const b = c === Qt.Solid ? "none" : c === Qt.Dotted ? "2,2" : "4,3", m = [...new Set(n.map((ne) => ne.cx))].sort((ne, N) => ne - N), v = p.select(t);
2987
2989
  let y = null;
2988
2990
  s && (Vc(), y = document.createElement("div"), y.className = mi, document.body.appendChild(y));
2989
- const x = ".bc-annotations", A = !v.select(x).empty(), w = (se) => A ? v.insert(se, x) : v.append(se), $ = o && (i === pt.Both || i === pt.Vertical), P = o && (i === pt.Both || i === pt.Horizontal);
2990
- let D = null, H = null;
2991
- $ && (D = w("line").attr("class", "bc-crosshair bc-crosshair-v").attr("y1", 0).attr("y2", r).attr("stroke", f).attr("stroke-width", 1).style("stroke-dasharray", b).attr("pointer-events", "none").style("display", "none")), P && (H = w("line").attr("class", "bc-crosshair bc-crosshair-h").attr("x1", 0).attr("x2", e).attr("stroke", f).attr("stroke-width", 1).style("stroke-dasharray", b).attr("pointer-events", "none").style("display", "none"));
2992
- const j = w("circle").attr("class", "bc-proximity-dot").attr("r", 6).attr("fill", "none").attr("stroke", "#333").attr("stroke-width", 1).attr("opacity", 0.45).attr("pointer-events", "none").style("display", "none"), _ = w("rect").attr("class", "bc-proximity-overlay").attr("width", e).attr("height", r).attr("fill", "none").attr("pointer-events", "all");
2993
- function B(se, F) {
2991
+ const x = ".bc-annotations", A = !v.select(x).empty(), w = (ne) => A ? v.insert(ne, x) : v.append(ne), L = o && (i === pt.Both || i === pt.Vertical), O = o && (i === pt.Both || i === pt.Horizontal);
2992
+ let F = null, I = null;
2993
+ L && (F = w("line").attr("class", "bc-crosshair bc-crosshair-v").attr("y1", 0).attr("y2", r).attr("stroke", f).attr("stroke-width", 1).style("stroke-dasharray", b).attr("pointer-events", "none").style("display", "none")), O && (I = w("line").attr("class", "bc-crosshair bc-crosshair-h").attr("x1", 0).attr("x2", e).attr("stroke", f).attr("stroke-width", 1).style("stroke-dasharray", b).attr("pointer-events", "none").style("display", "none"));
2994
+ const J = w("circle").attr("class", "bc-proximity-dot").attr("r", 6).attr("fill", "none").attr("stroke", "#333").attr("stroke-width", 1).attr("opacity", 0.45).attr("pointer-events", "none").style("display", "none"), H = w("rect").attr("class", "bc-proximity-overlay").attr("width", e).attr("height", r).attr("fill", "none").attr("pointer-events", "all");
2995
+ function D(ne, N) {
2994
2996
  if (m.length === 0)
2995
2997
  return null;
2996
- const Y = p.bisectCenter(m, se), R = m[Y], ie = n.filter((ce) => ce.cx === R);
2998
+ const Y = p.bisectCenter(m, ne), R = m[Y], ie = n.filter((ce) => ce.cx === R);
2997
2999
  if (ie.length === 0)
2998
3000
  return null;
2999
- let he = ie[0], ve = Math.abs(ie[0].cy - F);
3001
+ let he = ie[0], ve = Math.abs(ie[0].cy - N);
3000
3002
  for (let ce = 1; ce < ie.length; ce++) {
3001
- const ue = Math.abs(ie[ce].cy - F);
3003
+ const ue = Math.abs(ie[ce].cy - N);
3002
3004
  ue < ve && (he = ie[ce], ve = ue);
3003
3005
  }
3004
3006
  return he;
3005
3007
  }
3006
- const K = (se) => {
3007
- const [F, Y] = p.pointer(se, t), R = B(F, Y);
3008
- R && (j.attr("cx", R.cx).attr("cy", R.cy).attr("stroke", R.color).style("display", null), y && (y.textContent = d(R), y.style.display = "block", Ns(j.node(), y, {
3008
+ const j = (ne) => {
3009
+ const [N, Y] = p.pointer(ne, t), R = D(N, Y);
3010
+ R && (J.attr("cx", R.cx).attr("cy", R.cy).attr("stroke", R.color).style("display", null), y && (y.textContent = d(R), y.style.display = "block", Ns(J.node(), y, {
3009
3011
  placement: "top",
3010
3012
  middleware: [Bs(8), Is(), Vs()]
3011
3013
  }).then(({ x: ie, y: he }) => {
3012
3014
  y && (y.style.left = `${ie}px`, y.style.top = `${he}px`);
3013
- })), D && D.attr("x1", R.cx).attr("x2", R.cx).style("display", null), H && H.attr("y1", R.cy).attr("y2", R.cy).style("display", null));
3014
- }, X = () => {
3015
- j.style("display", "none"), y && (y.style.display = "none"), D && D.style("display", "none"), H && H.style("display", "none");
3016
- }, te = _.node();
3017
- te.addEventListener("mousemove", K), te.addEventListener("mouseleave", X);
3015
+ })), F && F.attr("x1", R.cx).attr("x2", R.cx).style("display", null), I && I.attr("y1", R.cy).attr("y2", R.cy).style("display", null));
3016
+ }, q = () => {
3017
+ J.style("display", "none"), y && (y.style.display = "none"), F && F.style("display", "none"), I && I.style("display", "none");
3018
+ }, ae = H.node();
3019
+ ae.addEventListener("mousemove", j), ae.addEventListener("mouseleave", q);
3018
3020
  const fe = () => {
3019
- te.removeEventListener("mousemove", K), te.removeEventListener("mouseleave", X), _.remove(), j.remove(), y && (y.remove(), y = null), D && D.remove(), H && H.remove(), g && Fa.get(g) === fe && Fa.delete(g);
3021
+ ae.removeEventListener("mousemove", j), ae.removeEventListener("mouseleave", q), H.remove(), J.remove(), y && (y.remove(), y = null), F && F.remove(), I && I.remove(), g && Fa.get(g) === fe && Fa.delete(g);
3020
3022
  };
3021
3023
  return g && Fa.set(g, fe), fe;
3022
3024
  }
@@ -3056,7 +3058,7 @@ function hn(t, a, e, r, n = !1) {
3056
3058
  const m = Hc[s] ?? p.symbolCircle, v = Math.PI * c * c, y = p.symbol().type(m).size(v);
3057
3059
  t.selectAll("circle.bc-symbol").remove();
3058
3060
  const x = t.selectAll("path.bc-symbol").data(g).join(
3059
- (w) => w.append("path").attr("class", "bc-symbol").attr("transform", ($) => `translate(${$.cx},${$.cy})`).attr("d", y).attr("fill", ($) => i === yt.Filled ? $.color : d).attr("stroke", ($) => $.color).attr("stroke-width", i === yt.Hollow ? 1.5 : 0).attr("opacity", f),
3061
+ (w) => w.append("path").attr("class", "bc-symbol").attr("transform", (L) => `translate(${L.cx},${L.cy})`).attr("d", y).attr("fill", (L) => i === yt.Filled ? L.color : d).attr("stroke", (L) => L.color).attr("stroke-width", i === yt.Hollow ? 1.5 : 0).attr("opacity", f),
3060
3062
  (w) => w,
3061
3063
  (w) => w.remove()
3062
3064
  );
@@ -3129,7 +3131,7 @@ class Rc extends ct {
3129
3131
  }
3130
3132
  }
3131
3133
  function Wc(t, a, e = {}, r = !1) {
3132
- var xe, pe, Me, J, ae, ke, me, Ce, we, Ne, Oe, Q, Z;
3134
+ var xe, pe, Me, K, te, ke, me, Ce, we, Ne, Oe, Q, Z;
3133
3135
  Ht(r), Mr(t);
3134
3136
  let n = [], s = [], o = [], i = null, c = null, f, d;
3135
3137
  const g = Vt.for(t);
@@ -3137,27 +3139,27 @@ function Wc(t, a, e = {}, r = !1) {
3137
3139
  const S = Yt(t);
3138
3140
  d = S == null ? void 0 : S.margin, g.detach(), (S == null ? void 0 : S.chartType) === "line" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), s = Array.from(t.querySelectorAll(".bc-frame .bc-line")), o = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), i = t.querySelector(".bc-frame .bc-symbols")) : S && (c = Bt(t)), f = /* @__PURE__ */ new Map();
3139
3141
  for (const T of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
3140
- for (const [O, z] of Mt(T))
3141
- f.set(O, z);
3142
+ for (const [P, z] of Mt(T))
3143
+ f.set(P, z);
3142
3144
  t.replaceChildren();
3143
3145
  }
3144
- const { body: b } = _t(t, e.frame), m = $t(b).width, v = wa(a.values, (xe = e.verticalAxis) == null ? void 0 : xe.range, (pe = e.verticalAxis) == null ? void 0 : pe.numberFormat, (Me = e.verticalAxis) == null ? void 0 : Me.scaleType), y = ea(m, (J = e.verticalAxis) == null ? void 0 : J.labelPosition, (ae = e.horizontalAxis) == null ? void 0 : ae.labelPosition, (ke = e.verticalAxis) == null ? void 0 : ke.direction, v), { chartArea: x, width: A, height: w, margin: $ } = Gt(b, y), P = Kt(d, $), D = Lr(a.labels, (me = e.horizontalAxis) == null ? void 0 : me.range), H = D.map((S) => a.labels[S]), j = D.map((S) => a.values[S]), _ = H.map((S, T) => ({
3146
+ const { body: b } = _t(t, e.frame), m = $t(b).width, v = wa(a.values, (xe = e.verticalAxis) == null ? void 0 : xe.range, (pe = e.verticalAxis) == null ? void 0 : pe.numberFormat, (Me = e.verticalAxis) == null ? void 0 : Me.scaleType), y = ea(m, (K = e.verticalAxis) == null ? void 0 : K.labelPosition, (te = e.horizontalAxis) == null ? void 0 : te.labelPosition, (ke = e.verticalAxis) == null ? void 0 : ke.direction, v), { chartArea: x, width: A, height: w, margin: L } = Gt(b, y), O = Kt(d, L), F = Lr(a.labels, (me = e.horizontalAxis) == null ? void 0 : me.range), I = F.map((S) => a.labels[S]), J = F.map((S) => a.values[S]), H = I.map((S, T) => ({
3145
3147
  label: S,
3146
- value: j[T]
3147
- })), B = p.scalePoint().domain(H).range([0, A]).padding(e.edgePadding ? 0.6 : 0), K = B, X = (S) => B(S.label) ?? 0, te = ((Ce = e.verticalAxis) == null ? void 0 : Ce.scaleType) === "log", [fe, se] = Va(j, (we = e.verticalAxis) == null ? void 0 : we.range, (Ne = e.verticalAxis) == null ? void 0 : Ne.scaleType), F = te ? p.scaleSymlog().domain([fe, se]).nice().range([w, 0]) : p.scaleLinear().domain([fe, se]).nice().range([w, 0]), Y = F.domain(), R = Y[0] < 0 && Y[1] > 0 ? F(0) : void 0;
3148
- g.attach(x, P), g.update({
3149
- vertical: { scale: F, height: w, options: { ...e.verticalAxis, gridWidth: A, topPadding: $.top } },
3150
- horizontal: { scale: K, height: w, options: { ...e.horizontalAxis, width: A, zeroY: R } }
3148
+ value: J[T]
3149
+ })), D = p.scalePoint().domain(I).range([0, A]).padding(e.edgePadding ? 0.6 : 0), j = D, q = (S) => D(S.label) ?? 0, ae = ((Ce = e.verticalAxis) == null ? void 0 : Ce.scaleType) === "log", [fe, ne] = Va(J, (we = e.verticalAxis) == null ? void 0 : we.range, (Ne = e.verticalAxis) == null ? void 0 : Ne.scaleType), N = ae ? p.scaleSymlog().domain([fe, ne]).nice().range([w, 0]) : p.scaleLinear().domain([fe, ne]).nice().range([w, 0]), Y = N.domain(), R = Y[0] < 0 && Y[1] > 0 ? N(0) : void 0;
3150
+ g.attach(x, O), g.update({
3151
+ vertical: { scale: N, height: w, options: { ...e.verticalAxis, gridWidth: A, topPadding: L.top } },
3152
+ horizontal: { scale: j, height: w, options: { ...e.horizontalAxis, width: A, zeroY: R } }
3151
3153
  });
3152
3154
  const ie = x.ownerSVGElement, he = ta(ie, t, "plot", { x: -1, y: -1, width: A + 2, height: w + 2 }), ve = p.select(x).append("g").attr("clip-path", `url(#${he})`), ce = ve.node(), ue = ((Oe = e.colors) == null ? void 0 : Oe[0]) ?? yi, Se = Aa(e.interpolation), ye = e.lineSymbols, ge = new Rc(p.select(ce));
3153
- if (ge.config({ xPos: X, y: F, color: ue, curve: Se, areaFill: e.areaFill ?? !1, areaFillOpacity: e.areaFillOpacity ?? 0.2, height: w }), s.length > 0 || n.length > 0 || o.length > 0) {
3154
- const S = (P == null ? void 0 : P.dx) ?? 0, T = (P == null ? void 0 : P.dy) ?? 0, O = ce.querySelectorAll(":scope > g");
3155
- O[0] && vt(O[0], n, S, T), O[1] && vt(O[1], s, S, T), O[2] && vt(O[2], o, S, T);
3156
- }
3157
- if (e.valueLabels && ge.use(bi({ position: e.valueLabelPosition, orientation: st.Vertical })), ge.draw(_), (Q = e.annotations) != null && Q.length && $r(x, e.annotations, { scaleX: K, scaleY: F, data: _, width: A, height: w, backgroundColor: Ft(t), transition: r, priorAnnotations: f }), p.select(ce).selectAll(".bc-dot").attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none"), e.tooltips || e.crosshair) {
3158
- const S = _.map((T) => ({
3159
- cx: X(T),
3160
- cy: F(T.value),
3155
+ if (ge.config({ xPos: q, y: N, color: ue, curve: Se, areaFill: e.areaFill ?? !1, areaFillOpacity: e.areaFillOpacity ?? 0.2, height: w }), s.length > 0 || n.length > 0 || o.length > 0) {
3156
+ const S = (O == null ? void 0 : O.dx) ?? 0, T = (O == null ? void 0 : O.dy) ?? 0, P = ce.querySelectorAll(":scope > g");
3157
+ P[0] && vt(P[0], n, S, T), P[1] && vt(P[1], s, S, T), P[2] && vt(P[2], o, S, T);
3158
+ }
3159
+ if (e.valueLabels && ge.use(bi({ position: e.valueLabelPosition, orientation: st.Vertical })), ge.draw(H), (Q = e.annotations) != null && Q.length && $r(x, e.annotations, { scaleX: j, scaleY: N, data: H, width: A, height: w, backgroundColor: Ft(t), transition: r, priorAnnotations: f }), p.select(ce).selectAll(".bc-dot").attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none"), e.tooltips || e.crosshair) {
3160
+ const S = H.map((T) => ({
3161
+ cx: q(T),
3162
+ cy: N(T.value),
3161
3163
  label: T.label,
3162
3164
  value: T.value,
3163
3165
  color: ue
@@ -3176,16 +3178,16 @@ function Wc(t, a, e = {}, r = !1) {
3176
3178
  });
3177
3179
  }
3178
3180
  if (ye) {
3179
- const S = _.map((O, z) => ({
3180
- cx: X(O),
3181
- cy: F(O.value),
3181
+ const S = H.map((P, z) => ({
3182
+ cx: q(P),
3183
+ cy: N(P.value),
3182
3184
  color: ue,
3183
3185
  index: z
3184
3186
  }));
3185
3187
  let T;
3186
- i ? (x.appendChild(i), T = p.select(i)) : T = p.select(x).append("g").attr("class", "bc-symbols"), hn(T, S, _.length, ye, r);
3188
+ i ? (x.appendChild(i), T = p.select(i)) : T = p.select(x).append("g").attr("class", "bc-symbols"), hn(T, S, H.length, ye, r);
3187
3189
  }
3188
- Rt(t, { chartType: "line", margin: $ }), c && (Nt(ve.node()), It(t, c));
3190
+ Rt(t, { chartType: "line", margin: L }), c && (Nt(ve.node()), It(t, c));
3189
3191
  }
3190
3192
  const gn = 28, vi = 18, xi = 20;
3191
3193
  function pn(t, a, e, r = gn) {
@@ -3213,18 +3215,18 @@ function Ai(t, a, e) {
3213
3215
  function g(b, m) {
3214
3216
  if (b.length === 0)
3215
3217
  return;
3216
- b.sort((P, D) => P.midAngle - D.midAngle);
3217
- const v = m ? 0.05 : Math.PI + 0.05, y = m ? Math.PI - 0.05 : 2 * Math.PI - 0.05, x = b.map((P) => P.midAngle), A = pn(x, v, y, c), w = m ? 1 : -1, $ = t.append("g").attr("class", "bc-arc-labels");
3218
- b.forEach((P, D) => {
3219
- const H = P.showLabel !== !1, j = P.showValue !== !1;
3220
- if (!H && !j)
3218
+ b.sort((O, F) => O.midAngle - F.midAngle);
3219
+ const v = m ? 0.05 : Math.PI + 0.05, y = m ? Math.PI - 0.05 : 2 * Math.PI - 0.05, x = b.map((O) => O.midAngle), A = pn(x, v, y, c), w = m ? 1 : -1, L = t.append("g").attr("class", "bc-arc-labels");
3220
+ b.forEach((O, F) => {
3221
+ const I = O.showLabel !== !1, J = O.showValue !== !1;
3222
+ if (!I && !J)
3221
3223
  return;
3222
- const B = A[D] - Math.PI / 2, K = Math.cos(B) * o, X = Math.sin(B) * o, te = Math.cos(B) * i, fe = Math.sin(B) * i, se = te + w * xi;
3223
- $.append("polyline").attr("class", "bc-arc-label-line").attr("points", `${K},${X} ${te},${fe} ${se},${fe}`).attr("fill", "none").attr("stroke", "var(--bc-text-color, #999)").attr("stroke-width", 1).attr("opacity", 0.5);
3224
- const F = se + w * 4, Y = $.append("text").attr("class", "bc-arc-direct-label").attr("x", F).attr("y", fe).attr("text-anchor", m ? "start" : "end").attr("font-size", `${n}px`);
3225
- if (H && Y.append("tspan").attr("x", F).attr("dy", j ? "-0.1em" : "0.35em").attr("font-weight", "bold").attr("fill", li(P.color, s)).text(P.label), j) {
3226
- const R = P.displayAsPercentage && P.percentage != null ? `${Math.round(P.percentage)}%` : String(P.value);
3227
- Y.append("tspan").attr("x", F).attr("dy", H ? "1.2em" : "0.35em").attr("fill", "var(--bc-text-color, #666)").text(R);
3224
+ const D = A[F] - Math.PI / 2, j = Math.cos(D) * o, q = Math.sin(D) * o, ae = Math.cos(D) * i, fe = Math.sin(D) * i, ne = ae + w * xi;
3225
+ L.append("polyline").attr("class", "bc-arc-label-line").attr("points", `${j},${q} ${ae},${fe} ${ne},${fe}`).attr("fill", "none").attr("stroke", "var(--bc-text-color, #999)").attr("stroke-width", 1).attr("opacity", 0.5);
3226
+ const N = ne + w * 4, Y = L.append("text").attr("class", "bc-arc-direct-label").attr("x", N).attr("y", fe).attr("text-anchor", m ? "start" : "end").attr("font-size", `${n}px`);
3227
+ if (I && Y.append("tspan").attr("x", N).attr("dy", J ? "-0.1em" : "0.35em").attr("font-weight", "bold").attr("fill", li(O.color, s)).text(O.label), J) {
3228
+ const R = O.displayAsPercentage && O.percentage != null ? `${Math.round(O.percentage)}%` : String(O.value);
3229
+ Y.append("tspan").attr("x", N).attr("dy", I ? "1.2em" : "0.35em").attr("fill", "var(--bc-text-color, #666)").text(R);
3228
3230
  }
3229
3231
  });
3230
3232
  }
@@ -3346,42 +3348,42 @@ function jc(t, a, e = {}, r = !1) {
3346
3348
  let n = a, s = [], o = [], i = [], c = [], f = null, d, g;
3347
3349
  const b = Vt.for(t);
3348
3350
  if (r) {
3349
- const ne = Yt(t);
3350
- g = ne == null ? void 0 : ne.margin, b.detach(), (ne == null ? void 0 : ne.chartType) === "line-multi" ? (s = Array.from(t.querySelectorAll(".bc-frame .bc-area")), o = Array.from(t.querySelectorAll(".bc-frame .bc-line")), i = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), c = Array.from(t.querySelectorAll(".bc-frame .bc-symbols"))) : ne && (f = Bt(t)), d = /* @__PURE__ */ new Map();
3351
+ const se = Yt(t);
3352
+ g = se == null ? void 0 : se.margin, b.detach(), (se == null ? void 0 : se.chartType) === "line-multi" ? (s = Array.from(t.querySelectorAll(".bc-frame .bc-area")), o = Array.from(t.querySelectorAll(".bc-frame .bc-line")), i = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), c = Array.from(t.querySelectorAll(".bc-frame .bc-symbols"))) : se && (f = Bt(t)), d = /* @__PURE__ */ new Map();
3351
3353
  for (const Le of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
3352
3354
  for (const [Fe, Ve] of Mt(Le))
3353
3355
  d.set(Fe, Ve);
3354
3356
  t.replaceChildren();
3355
3357
  }
3356
3358
  const { body: m } = _t(t, e.frame), v = n.series ?? [];
3357
- let y = v.filter((ne) => !Ma(ne.name, e.seriesOverrides));
3358
- (e.sortMode === "total" || e.sortMode === "within-groups") && (y = [...y].sort((ne, Le) => {
3359
- const Fe = ne.values.reduce((rt, nt) => rt + nt, 0);
3359
+ let y = v.filter((se) => !Ma(se.name, e.seriesOverrides));
3360
+ (e.sortMode === "total" || e.sortMode === "within-groups") && (y = [...y].sort((se, Le) => {
3361
+ const Fe = se.values.reduce((rt, nt) => rt + nt, 0);
3360
3362
  return Le.values.reduce((rt, nt) => rt + nt, 0) - Fe;
3361
3363
  }));
3362
- const x = e.colors ?? ki, A = y.map((ne) => ne.name), w = e.seriesOverrides, $ = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", P = $ ? "direct" : e.legend !== !1 ? "legend" : "none", D = A.filter((ne) => ha(ne, P, w) === "direct"), H = e.legend !== !1 && !$, j = $t(m).width, _ = 350, B = e.legendPosition ?? "top", K = j > 0 && j < _ && (B === "left" || B === "right") ? "top" : B, X = e.legendAnchor ?? "start", te = Lr(n.labels, (M = e.horizontalAxis) == null ? void 0 : M.range), fe = te.map((ne) => n.labels[ne]);
3363
- y = y.map((ne) => ({ ...ne, values: te.map((Le) => ne.values[Le]) })), n = { ...n, labels: fe, series: y };
3364
- const se = y.flatMap((ne) => ne.values), F = wa(se, (oe = e.verticalAxis) == null ? void 0 : oe.range, (le = e.verticalAxis) == null ? void 0 : le.numberFormat, (re = e.verticalAxis) == null ? void 0 : re.scaleType), Y = ea(j, (Te = e.verticalAxis) == null ? void 0 : Te.labelPosition, (je = e.horizontalAxis) == null ? void 0 : je.labelPosition, (Ot = e.verticalAxis) == null ? void 0 : Ot.direction, F), R = D.length > 0 ? gi(D) : 0, ie = Y.top != null, he = Math.max(0, j - (Y.left ?? 50) - (Y.right ?? 20) - R), ve = H ? ya(A, K, he) : { width: 0, height: 0 }, ce = H ? ve.height + 15 : 0, ue = { ...Y };
3365
- if (H && K === "top") {
3366
- const ne = ie ? 15 : 0;
3367
- ue.top = ce + ne;
3368
- }
3369
- H && K === "bottom" && (ue.bottom = (ue.bottom ?? 24) + ce), H && K === "left" && (ue.left = (ue.left ?? 50) + ve.width + 10), H && K === "right" && (ue.right = (ue.right ?? 20) + ve.width + 10), R > 0 && (ue.right = (ue.right ?? 20) + R);
3370
- const { chartArea: Se, width: ye, height: ge, margin: xe } = Gt(m, ue), pe = Kt(g, xe), [Me, J] = Va(se, (it = e.verticalAxis) == null ? void 0 : it.range, (Je = e.verticalAxis) == null ? void 0 : Je.scaleType), ae = p.scalePoint().domain(n.labels).range([0, ye]).padding(e.edgePadding ? 0.6 : 0), ke = ae, me = (ne) => ae(n.labels[ne]) ?? 0, we = ((Pt = e.verticalAxis) == null ? void 0 : Pt.scaleType) === "log" ? p.scaleSymlog().domain([Me, J]).nice().range([ge, 0]) : p.scaleLinear().domain([Me, J]).nice().range([ge, 0]), Ne = we.domain(), Oe = Ne[0] < 0 && Ne[1] > 0 ? we(0) : void 0;
3364
+ const x = e.colors ?? ki, A = y.map((se) => se.name), w = e.seriesOverrides, L = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", O = L ? "direct" : e.legend !== !1 ? "legend" : "none", F = A.filter((se) => ha(se, O, w) === "direct"), I = e.legend !== !1 && !L, J = $t(m).width, H = 350, D = e.legendPosition ?? "top", j = J > 0 && J < H && (D === "left" || D === "right") ? "top" : D, q = e.legendAnchor ?? "start", ae = Lr(n.labels, (M = e.horizontalAxis) == null ? void 0 : M.range), fe = ae.map((se) => n.labels[se]);
3365
+ y = y.map((se) => ({ ...se, values: ae.map((Le) => se.values[Le]) })), n = { ...n, labels: fe, series: y };
3366
+ const ne = y.flatMap((se) => se.values), N = wa(ne, (oe = e.verticalAxis) == null ? void 0 : oe.range, (le = e.verticalAxis) == null ? void 0 : le.numberFormat, (re = e.verticalAxis) == null ? void 0 : re.scaleType), Y = ea(J, (Te = e.verticalAxis) == null ? void 0 : Te.labelPosition, (je = e.horizontalAxis) == null ? void 0 : je.labelPosition, (Ot = e.verticalAxis) == null ? void 0 : Ot.direction, N), R = F.length > 0 ? gi(F) : 0, ie = Y.top != null, he = Math.max(0, J - (Y.left ?? 50) - (Y.right ?? 20) - R), ve = I ? ya(A, j, he) : { width: 0, height: 0 }, ce = I ? ve.height + 15 : 0, ue = { ...Y };
3367
+ if (I && j === "top") {
3368
+ const se = ie ? 15 : 0;
3369
+ ue.top = ce + se;
3370
+ }
3371
+ I && j === "bottom" && (ue.bottom = (ue.bottom ?? 24) + ce), I && j === "left" && (ue.left = (ue.left ?? 50) + ve.width + 10), I && j === "right" && (ue.right = (ue.right ?? 20) + ve.width + 10), R > 0 && (ue.right = (ue.right ?? 20) + R);
3372
+ const { chartArea: Se, width: ye, height: ge, margin: xe } = Gt(m, ue), pe = Kt(g, xe), [Me, K] = Va(ne, (it = e.verticalAxis) == null ? void 0 : it.range, (Je = e.verticalAxis) == null ? void 0 : Je.scaleType), te = p.scalePoint().domain(n.labels).range([0, ye]).padding(e.edgePadding ? 0.6 : 0), ke = te, me = (se) => te(n.labels[se]) ?? 0, we = ((Pt = e.verticalAxis) == null ? void 0 : Pt.scaleType) === "log" ? p.scaleSymlog().domain([Me, K]).nice().range([ge, 0]) : p.scaleLinear().domain([Me, K]).nice().range([ge, 0]), Ne = we.domain(), Oe = Ne[0] < 0 && Ne[1] > 0 ? we(0) : void 0;
3371
3373
  b.attach(Se, pe), b.update({
3372
3374
  vertical: { scale: we, height: ge, options: { ...e.verticalAxis, gridWidth: ye, topPadding: xe.top } },
3373
3375
  horizontal: { scale: ke, height: ge, options: { ...e.horizontalAxis, width: ye, zeroY: Oe } }
3374
3376
  });
3375
- const Q = Se.ownerSVGElement, Z = ta(Q, t, "plot", { x: 0, y: 0, width: ye, height: ge }), S = p.select(Se).append("g").attr("clip-path", `url(#${Z})`), T = S.node(), O = y.map((ne) => ({
3376
- name: ne.name,
3377
- values: ne.values,
3378
- colorIndex: v.findIndex((Le) => Le.name === ne.name)
3377
+ const Q = Se.ownerSVGElement, Z = ta(Q, t, "plot", { x: 0, y: 0, width: ye, height: ge }), S = p.select(Se).append("g").attr("clip-path", `url(#${Z})`), T = S.node(), P = y.map((se) => ({
3378
+ name: se.name,
3379
+ values: se.values,
3380
+ colorIndex: v.findIndex((Le) => Le.name === se.name)
3379
3381
  })), z = Aa(e.interpolation);
3380
3382
  (na = e.areaFills) != null && na.length && Zc(T, e.areaFills, y, me, n.labels.length, we, z);
3381
- const I = [];
3382
- y.forEach((ne, Le) => {
3383
+ const V = [];
3384
+ y.forEach((se, Le) => {
3383
3385
  n.labels.forEach((Fe, Ve) => {
3384
- I.push({ label: Fe, value: ne.values[Ve], series: ne.name, colorIndex: Le });
3386
+ V.push({ label: Fe, value: se.values[Ve], series: se.name, colorIndex: Le });
3385
3387
  });
3386
3388
  });
3387
3389
  const C = e.lineSymbols, U = {
@@ -3389,49 +3391,49 @@ function jc(t, a, e = {}, r = !1) {
3389
3391
  dotted: "2,4",
3390
3392
  dashed: "8,4",
3391
3393
  "dash-dot": "8,4,2,4"
3392
- }, E = e.valueLabels ?? !1, W = new Set((e.highlights ?? []).map((ne) => ne.target)), Ae = W.size > 0, Pe = new Uc(p.select(T));
3393
- Pe.config({ xPos: me, y: we, colors: x, labels: n.labels, curve: z, areaFill: e.areaFill ?? !1, areaFillOpacity: e.areaFillOpacity ?? 0.2, height: ge, dots: I, highlightTargets: W });
3394
- const Be = new Set(O.map((ne) => ne.name)), Ye = s.filter((ne) => {
3394
+ }, E = e.valueLabels ?? !1, W = new Set((e.highlights ?? []).map((se) => se.target)), Ae = W.size > 0, Pe = new Uc(p.select(T));
3395
+ Pe.config({ xPos: me, y: we, colors: x, labels: n.labels, curve: z, areaFill: e.areaFill ?? !1, areaFillOpacity: e.areaFillOpacity ?? 0.2, height: ge, dots: V, highlightTargets: W });
3396
+ const Be = new Set(P.map((se) => se.name)), Ye = s.filter((se) => {
3395
3397
  var Le;
3396
- return Be.has(((Le = ne.__data__) == null ? void 0 : Le.name) ?? "");
3397
- }), We = o.filter((ne) => {
3398
+ return Be.has(((Le = se.__data__) == null ? void 0 : Le.name) ?? "");
3399
+ }), We = o.filter((se) => {
3398
3400
  var Le;
3399
- return Be.has(((Le = ne.__data__) == null ? void 0 : Le.name) ?? "");
3400
- }), Xe = i.filter((ne) => {
3401
+ return Be.has(((Le = se.__data__) == null ? void 0 : Le.name) ?? "");
3402
+ }), Xe = i.filter((se) => {
3401
3403
  var Le;
3402
- return Be.has(((Le = ne.__data__) == null ? void 0 : Le.series) ?? "");
3404
+ return Be.has(((Le = se.__data__) == null ? void 0 : Le.series) ?? "");
3403
3405
  });
3404
3406
  if (We.length > 0 || Ye.length > 0 || Xe.length > 0) {
3405
- const ne = (pe == null ? void 0 : pe.dx) ?? 0, Le = (pe == null ? void 0 : pe.dy) ?? 0, Fe = T.querySelectorAll(":scope > g");
3406
- Fe[0] && vt(Fe[0], Ye, ne, Le), Fe[1] && vt(Fe[1], We, ne, Le), Fe[2] && vt(Fe[2], Xe, ne, Le);
3407
+ const se = (pe == null ? void 0 : pe.dx) ?? 0, Le = (pe == null ? void 0 : pe.dy) ?? 0, Fe = T.querySelectorAll(":scope > g");
3408
+ Fe[0] && vt(Fe[0], Ye, se, Le), Fe[1] && vt(Fe[1], We, se, Le), Fe[2] && vt(Fe[2], Xe, se, Le);
3407
3409
  }
3408
- if (Pe.draw(O), (fa = e.annotations) != null && fa.length) {
3409
- const ne = n.labels.map((Le, Fe) => {
3410
+ if (Pe.draw(P), (fa = e.annotations) != null && fa.length) {
3411
+ const se = n.labels.map((Le, Fe) => {
3410
3412
  var Ve;
3411
3413
  return {
3412
3414
  label: Le,
3413
3415
  value: ((Ve = y[0]) == null ? void 0 : Ve.values[Fe]) ?? 0
3414
3416
  };
3415
3417
  });
3416
- $r(Se, e.annotations, { scaleX: ke, scaleY: we, data: ne, width: ye, height: ge, backgroundColor: Ft(t), transition: r, priorAnnotations: d });
3418
+ $r(Se, e.annotations, { scaleX: ke, scaleY: we, data: se, width: ye, height: ge, backgroundColor: Ft(t), transition: r, priorAnnotations: d });
3417
3419
  }
3418
3420
  const Qe = p.select(T).append("g").attr("class", "bc-value-labels");
3419
- if (I.forEach((ne) => {
3420
- if (!Ha(ne.series, E, w))
3421
+ if (V.forEach((se) => {
3422
+ if (!Ha(se.series, E, w))
3421
3423
  return;
3422
- const Le = me(n.labels.indexOf(ne.label)), Fe = we(ne.value);
3423
- Qe.append("text").attr("class", "bc-value-label").attr("data-series", ne.colorIndex).attr("x", Le).attr("y", Fe - 8).attr("text-anchor", "middle").attr("font-size", "11px").attr("fill", "currentColor").text(String(ne.value));
3424
- }), p.select(T).selectAll(".bc-line").each(function(ne) {
3425
- const Le = ne, Fe = qe(Le.name, Le.colorIndex, x, w), Ve = Dc(Le.name, w), rt = zc(Le.name, w), nt = pi(Le.name, e.interpolation ?? "linear", w), Wt = r ? p.select(this).transition().duration(Ee()) : p.select(this);
3424
+ const Le = me(n.labels.indexOf(se.label)), Fe = we(se.value);
3425
+ Qe.append("text").attr("class", "bc-value-label").attr("data-series", se.colorIndex).attr("x", Le).attr("y", Fe - 8).attr("text-anchor", "middle").attr("font-size", "11px").attr("fill", "currentColor").text(String(se.value));
3426
+ }), p.select(T).selectAll(".bc-line").each(function(se) {
3427
+ const Le = se, Fe = qe(Le.name, Le.colorIndex, x, w), Ve = Dc(Le.name, w), rt = zc(Le.name, w), nt = pi(Le.name, e.interpolation ?? "linear", w), Wt = r ? p.select(this).transition().duration(Ee()) : p.select(this);
3426
3428
  if (Wt.attr("stroke", Fe).attr("stroke-width", Ve), Ae && Wt.attr("opacity", W.has(Le.name) ? 1 : 0.3), rt !== "solid" && p.select(this).attr("stroke-dasharray", U[rt] ?? ""), nt !== (e.interpolation ?? "linear")) {
3427
3429
  const da = Aa(nt), Oa = p.line().curve(da).x((qt, qr) => me(qr)).y((qt) => we(qt));
3428
3430
  Wt.attr("d", Oa(Le.values));
3429
3431
  }
3430
- }), p.select(T).selectAll(".bc-area").each(function(ne) {
3431
- const Le = ne, Fe = qe(Le.name, Le.colorIndex, x, w), Ve = r ? p.select(this).transition().duration(Ee()) : p.select(this);
3432
+ }), p.select(T).selectAll(".bc-area").each(function(se) {
3433
+ const Le = se, Fe = qe(Le.name, Le.colorIndex, x, w), Ve = r ? p.select(this).transition().duration(Ee()) : p.select(this);
3432
3434
  Ve.attr("fill", Fe), Ae && Ve.attr("opacity", W.has(Le.name) ? e.areaFillOpacity ?? 0.2 : 0.1);
3433
3435
  }), p.select(T).selectAll(".bc-dot").attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none"), e.tooltips || e.crosshair) {
3434
- const ne = I.map((Le) => ({
3436
+ const se = V.map((Le) => ({
3435
3437
  cx: me(n.labels.indexOf(Le.label)),
3436
3438
  cy: we(Le.value),
3437
3439
  label: Le.label,
@@ -3442,7 +3444,7 @@ function jc(t, a, e = {}, r = !1) {
3442
3444
  Cr(Se, {
3443
3445
  width: ye,
3444
3446
  height: ge,
3445
- points: ne,
3447
+ points: se,
3446
3448
  tooltip: e.tooltips,
3447
3449
  crosshair: e.crosshair,
3448
3450
  crosshairDirection: e.crosshairDirection,
@@ -3459,8 +3461,8 @@ function jc(t, a, e = {}, r = !1) {
3459
3461
  symbolSize: C.size,
3460
3462
  symbolOpacity: C.opacity
3461
3463
  } : void 0, Re = n.labels.length;
3462
- y.forEach((ne, Le) => {
3463
- const Fe = Ec(ne.name, Ue, w);
3464
+ y.forEach((se, Le) => {
3465
+ const Fe = Ec(se.name, Ue, w);
3464
3466
  if (!Fe)
3465
3467
  return;
3466
3468
  const Ve = {
@@ -3471,39 +3473,39 @@ function jc(t, a, e = {}, r = !1) {
3471
3473
  opacity: Fe.symbolOpacity ?? (C == null ? void 0 : C.opacity) ?? 1
3472
3474
  }, rt = n.labels.map((Oa, qt) => ({
3473
3475
  cx: me(qt),
3474
- cy: we(ne.values[qt]),
3475
- color: qe(ne.name, Le, x, w),
3476
+ cy: we(se.values[qt]),
3477
+ color: qe(se.name, Le, x, w),
3476
3478
  index: qt
3477
- })), nt = c.find((Oa) => Oa.getAttribute("data-series-name") === ne.name);
3479
+ })), nt = c.find((Oa) => Oa.getAttribute("data-series-name") === se.name);
3478
3480
  let Wt, da = !1;
3479
- nt ? (Se.appendChild(nt), Wt = p.select(nt), da = !0) : Wt = p.select(Se).append("g").attr("class", "bc-symbols").attr("data-series", Le).attr("data-series-name", ne.name), hn(Wt, rt, Re, Ve, r && da);
3481
+ nt ? (Se.appendChild(nt), Wt = p.select(nt), da = !0) : Wt = p.select(Se).append("g").attr("class", "bc-symbols").attr("data-series", Le).attr("data-series-name", se.name), hn(Wt, rt, Re, Ve, r && da);
3480
3482
  });
3481
3483
  const ft = n.labels.length - 1, mt = me(ft) + 6, at = [];
3482
- if (y.forEach((ne, Le) => {
3484
+ if (y.forEach((se, Le) => {
3483
3485
  var nt;
3484
- if (ha(ne.name, P, w) !== "direct")
3486
+ if (ha(se.name, O, w) !== "direct")
3485
3487
  return;
3486
- const Ve = ne.values[ft], rt = ((nt = w == null ? void 0 : w.find((Wt) => Wt.name === ne.name)) == null ? void 0 : nt.labelText) || ne.name;
3487
- at.push({ name: ne.name, index: Le, naturalY: we(Ve), text: rt });
3488
+ const Ve = se.values[ft], rt = ((nt = w == null ? void 0 : w.find((Wt) => Wt.name === se.name)) == null ? void 0 : nt.labelText) || se.name;
3489
+ at.push({ name: se.name, index: Le, naturalY: we(Ve), text: rt });
3488
3490
  }), at.length > 0) {
3489
3491
  at.sort((Ve, rt) => Ve.naturalY - rt.naturalY);
3490
- const ne = at.map((Ve) => Ve.naturalY), Fe = pn(ne, 0, ge, 14);
3492
+ const se = at.map((Ve) => Ve.naturalY), Fe = pn(se, 0, ge, 14);
3491
3493
  at.forEach((Ve, rt) => {
3492
3494
  p.select(Se).append("text").attr("class", "bc-direct-label").attr("data-series", Ve.index).attr("x", mt).attr("y", Fe[rt]).attr("dy", "0.35em").attr("font-size", "11px").attr("fill", qe(Ve.name, Ve.index, x, w)).text(Ve.text);
3493
3495
  });
3494
3496
  }
3495
- const Ct = A.filter((ne) => ha(ne, P, w) === "legend");
3496
- if (H && Ct.length > 0) {
3497
- const ne = Ct.map((Ve) => {
3497
+ const Ct = A.filter((se) => ha(se, O, w) === "legend");
3498
+ if (I && Ct.length > 0) {
3499
+ const se = Ct.map((Ve) => {
3498
3500
  const rt = v.findIndex((nt) => nt.name === Ve);
3499
3501
  return qe(Ve, rt, x, w);
3500
3502
  });
3501
3503
  let Le = 0, Fe = 0;
3502
- if (K === "top") {
3504
+ if (j === "top") {
3503
3505
  const Ve = ie ? 15 : 0;
3504
3506
  Fe = -(ve.height + 10 + Ve);
3505
- } else K === "bottom" ? Fe = ge + 25 : K === "left" ? Le = -(ve.width + 10) : K === "right" && (Le = ye + 10);
3506
- ba(Se, Ct, ne, Fe, K, X, ye, ge, Le, [], { left: xe.left, right: xe.right });
3507
+ } else j === "bottom" ? Fe = ge + 25 : j === "left" ? Le = -(ve.width + 10) : j === "right" && (Le = ye + 10);
3508
+ ba(Se, Ct, se, Fe, j, q, ye, ge, Le, [], { left: xe.left, right: xe.right });
3507
3509
  }
3508
3510
  Rt(t, { chartType: "line-multi", margin: xe }), f && (Nt(S.node()), It(t, f));
3509
3511
  }
@@ -3540,10 +3542,10 @@ function Jc(t, a, e, r, n, s, o, i, c) {
3540
3542
  for (let v = 0; v < f; v++) {
3541
3543
  const y = r(v), x = n(a[v]), A = n(e[v]);
3542
3544
  if (d.push({ x: y, fromY: x, toY: A }), v < f - 1) {
3543
- const w = n(a[v + 1]), $ = n(e[v + 1]), P = Qc(x, w, A, $);
3544
- if (P !== null && P > 0 && P < 1) {
3545
- const D = y + P * (r(v + 1) - y), H = x + P * (w - x), j = A + P * ($ - A);
3546
- d.push({ x: D, fromY: H, toY: j });
3545
+ const w = n(a[v + 1]), L = n(e[v + 1]), O = Qc(x, w, A, L);
3546
+ if (O !== null && O > 0 && O < 1) {
3547
+ const F = y + O * (r(v + 1) - y), I = x + O * (w - x), J = A + O * (L - A);
3548
+ d.push({ x: F, fromY: I, toY: J });
3547
3549
  }
3548
3550
  }
3549
3551
  }
@@ -3586,8 +3588,8 @@ function Li(t, a, e, r, n = !1) {
3586
3588
  Ht(n);
3587
3589
  let s = null, o;
3588
3590
  if (n) {
3589
- const J = Yt(t), ae = r > 0 ? "donut" : "pie";
3590
- J && J.chartType !== ae && (s = Bt(t)), o = /* @__PURE__ */ new Map();
3591
+ const K = Yt(t), te = r > 0 ? "donut" : "pie";
3592
+ K && K.chartType !== te && (s = Bt(t)), o = /* @__PURE__ */ new Map();
3591
3593
  for (const ke of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
3592
3594
  for (const [me, Ce] of Mt(ke))
3593
3595
  o.set(me, Ce);
@@ -3596,51 +3598,51 @@ function Li(t, a, e, r, n = !1) {
3596
3598
  const { body: i } = _t(t, e.frame);
3597
3599
  let c = [...a.labels], f = [...a.values];
3598
3600
  if (e.sort === lt.Ascending || e.sort === lt.Descending) {
3599
- const J = c.map((ae, ke) => ({ label: ae, value: f[ke] }));
3600
- J.sort((ae, ke) => e.sort === lt.Ascending ? ae.value - ke.value : ke.value - ae.value), c = J.map((ae) => ae.label), f = J.map((ae) => ae.value);
3601
+ const K = c.map((te, ke) => ({ label: te, value: f[ke] }));
3602
+ K.sort((te, ke) => e.sort === lt.Ascending ? te.value - ke.value : ke.value - te.value), c = K.map((te) => te.label), f = K.map((te) => te.value);
3601
3603
  }
3602
3604
  if (e.sliceMax && e.sliceMax > 0 && c.length > e.sliceMax) {
3603
- const J = e.sliceMax - 1, ae = c.slice(0, J), ke = f.slice(0, J), me = f.slice(J).reduce((Ce, we) => Ce + we, 0);
3604
- ae.push(e.sliceGroupLabel ?? "Others"), ke.push(me), c = ae, f = ke;
3605
- }
3606
- const d = f.reduce((J, ae) => J + ae, 0), g = f.map((J) => d > 0 ? J / d * 100 : 0), b = e.colors ?? Kc, m = b.length < c.length && b.length >= 2 ? Ge.scale(b).mode("lch").colors(c.length) : b, v = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ? bt.Auto : bt.Off, y = !!v && !(v === bt.Auto && e.legend === !0), A = (e.showValues ?? !0) && !y ? f.map((J, ae) => `(${e.displayAsPercentage ? `${Math.round(g[ae])}%` : String(J)})`) : [], w = e.legend !== !1 && !y, $ = $t(i).width, P = 350, D = e.legendPosition ?? "top", H = $ > 0 && $ < P && (D === "left" || D === "right") ? "top" : D, j = e.legendAnchor ?? "start", _ = A.length > 0 ? c.map((J, ae) => `${J} ${A[ae]}`) : c, B = Math.max(0, $ - 50 - 20), K = w ? ya(_, H, B) : { width: 0, height: 0 }, X = w ? K.height + 15 : 0, te = {};
3607
- if (w && H === "top" && (te.top = X), w && H === "bottom" && (te.bottom = 24 + X), w && H === "left" && (te.left = 50 + K.width + 10), w && H === "right" && (te.right = 20 + K.width + 10), y) {
3608
- const J = $t(i), ae = 20, ke = J.width - 2 * ae, me = (J.height > 0 ? J.height : 400) - 2 * ae, Ce = Math.min(ke, me) / 2, we = Xc(c, Ce);
3609
- te.left = (te.left ?? ae) + we.left, te.right = (te.right ?? ae) + we.right, te.top = (te.top ?? ae) + we.top, te.bottom = (te.bottom ?? ae) + we.bottom;
3610
- }
3611
- const { chartArea: fe, width: se, height: F, margin: Y } = Gt(i, te), R = Math.min(se, F) / 2, ie = R * r, he = p.scaleOrdinal().domain(c).range(m), ve = p.pie().sort(null), ce = p.arc().innerRadius(ie).outerRadius(R), ue = p.select(fe).append("g").attr("transform", `translate(${se / 2},${F / 2})`), Se = ve(f), ye = Se.map((J, ae) => ({
3612
- label: c[ae],
3613
- arc: J,
3614
- color: he(c[ae])
3605
+ const K = e.sliceMax - 1, te = c.slice(0, K), ke = f.slice(0, K), me = f.slice(K).reduce((Ce, we) => Ce + we, 0);
3606
+ te.push(e.sliceGroupLabel ?? "Others"), ke.push(me), c = te, f = ke;
3607
+ }
3608
+ const d = f.reduce((K, te) => K + te, 0), g = f.map((K) => d > 0 ? K / d * 100 : 0), b = e.colors ?? Kc, m = b.length < c.length && b.length >= 2 ? Ge.scale(b).mode("lch").colors(c.length) : b, v = typeof e.directLabelling == "string" ? e.directLabelling : e.directLabelling ? bt.Auto : bt.Off, y = !!v && !(v === bt.Auto && e.legend === !0), A = (e.showValues ?? !0) && !y ? f.map((K, te) => `(${e.displayAsPercentage ? `${Math.round(g[te])}%` : String(K)})`) : [], w = e.legend !== !1 && !y, L = $t(i).width, O = 350, F = e.legendPosition ?? "top", I = L > 0 && L < O && (F === "left" || F === "right") ? "top" : F, J = e.legendAnchor ?? "start", H = A.length > 0 ? c.map((K, te) => `${K} ${A[te]}`) : c, D = Math.max(0, L - 50 - 20), j = w ? ya(H, I, D) : { width: 0, height: 0 }, q = w ? j.height + 15 : 0, ae = {};
3609
+ if (w && I === "top" && (ae.top = q), w && I === "bottom" && (ae.bottom = 24 + q), w && I === "left" && (ae.left = 50 + j.width + 10), w && I === "right" && (ae.right = 20 + j.width + 10), y) {
3610
+ const K = $t(i), te = 20, ke = K.width - 2 * te, me = (K.height > 0 ? K.height : 400) - 2 * te, Ce = Math.min(ke, me) / 2, we = Xc(c, Ce);
3611
+ ae.left = (ae.left ?? te) + we.left, ae.right = (ae.right ?? te) + we.right, ae.top = (ae.top ?? te) + we.top, ae.bottom = (ae.bottom ?? te) + we.bottom;
3612
+ }
3613
+ const { chartArea: fe, width: ne, height: N, margin: Y } = Gt(i, ae), R = Math.min(ne, N) / 2, ie = R * r, he = p.scaleOrdinal().domain(c).range(m), ve = p.pie().sort(null), ce = p.arc().innerRadius(ie).outerRadius(R), ue = p.select(fe).append("g").attr("transform", `translate(${ne / 2},${N / 2})`), Se = ve(f), ye = Se.map((K, te) => ({
3614
+ label: c[te],
3615
+ arc: K,
3616
+ color: he(c[te])
3615
3617
  })), ge = $a(t), xe = ue.append("g").node();
3616
3618
  Ga(ge, {
3617
3619
  role: "mark-per-category",
3618
3620
  parent: xe,
3619
3621
  selector: ".bc-arc",
3620
3622
  data: ye,
3621
- key: (J) => J.label,
3622
- insert: (J) => J.append("path").attr("class", "bc-arc"),
3623
- attrs: (J) => ({
3624
- d: ce(J.arc) ?? "",
3625
- fill: J.color
3623
+ key: (K) => K.label,
3624
+ insert: (K) => K.append("path").attr("class", "bc-arc"),
3625
+ attrs: (K) => ({
3626
+ d: ce(K.arc) ?? "",
3627
+ fill: K.color
3626
3628
  })
3627
3629
  });
3628
3630
  const pe = new ef(ue);
3629
3631
  if (e.tooltips && pe.use(ma()), pe.draw(ye), (Me = e.annotations) != null && Me.length) {
3630
- const J = e.annotations.filter((ae) => ae.kind === "free");
3631
- J.length && _a(J, {
3632
- scaleX: p.scaleBand().domain([]).range([0, se]),
3633
- scaleY: p.scaleLinear().domain([0, 1]).range([F, 0]),
3632
+ const K = e.annotations.filter((te) => te.kind === "free");
3633
+ K.length && _a(K, {
3634
+ scaleX: p.scaleBand().domain([]).range([0, ne]),
3635
+ scaleY: p.scaleLinear().domain([0, 1]).range([N, 0]),
3634
3636
  data: [],
3635
- width: se,
3636
- height: F,
3637
+ width: ne,
3638
+ height: N,
3637
3639
  backgroundColor: Ft(t),
3638
3640
  transition: n,
3639
3641
  priorAnnotations: o
3640
3642
  }).postDraw({ base: p.select(fe) }, void 0);
3641
3643
  }
3642
3644
  if (y) {
3643
- const J = Se.map((Ce, we) => ({
3645
+ const K = Se.map((Ce, we) => ({
3644
3646
  label: c[we],
3645
3647
  value: Ce.data,
3646
3648
  startAngle: Ce.startAngle,
@@ -3650,16 +3652,16 @@ function Li(t, a, e, r, n = !1) {
3650
3652
  displayAsPercentage: e.displayAsPercentage,
3651
3653
  showLabel: e.showLabels ?? !0,
3652
3654
  showValue: e.showValues ?? !0
3653
- })), ae = ue, ke = Ft(t), me = { outerRadius: R, innerRadius: ie, bgColor: ke };
3654
- v === bt.Inside ? Si(ae, J, me) : v === bt.Auto ? qc(ae, J, me) : Ai(ae, J, me);
3655
+ })), te = ue, ke = Ft(t), me = { outerRadius: R, innerRadius: ie, bgColor: ke };
3656
+ v === bt.Inside ? Si(te, K, me) : v === bt.Auto ? qc(te, K, me) : Ai(te, K, me);
3655
3657
  }
3656
3658
  if (e.showTotal && r > 0 && !e.displayAsPercentage) {
3657
- const J = String(d);
3658
- ue.append("text").attr("class", "bc-arc-total-label").attr("text-anchor", "middle").attr("dy", "-0.3em").attr("font-size", "11px").attr("fill", "var(--bc-text-color, #555)").attr("opacity", 0.7).text("Total"), ue.append("text").attr("class", "bc-arc-total-value").attr("text-anchor", "middle").attr("dy", "1em").attr("font-size", "18px").attr("font-weight", "bold").attr("fill", "var(--bc-text-color, #555)").text(J);
3659
+ const K = String(d);
3660
+ ue.append("text").attr("class", "bc-arc-total-label").attr("text-anchor", "middle").attr("dy", "-0.3em").attr("font-size", "11px").attr("fill", "var(--bc-text-color, #555)").attr("opacity", 0.7).text("Total"), ue.append("text").attr("class", "bc-arc-total-value").attr("text-anchor", "middle").attr("dy", "1em").attr("font-size", "18px").attr("font-weight", "bold").attr("fill", "var(--bc-text-color, #555)").text(K);
3659
3661
  }
3660
3662
  if (w) {
3661
- let J = 0, ae = 0;
3662
- H === "top" ? ae = -(K.height + 10) : H === "bottom" ? ae = F + 25 : H === "left" ? J = -(K.width + 10) : H === "right" && (J = se + 10), ba(fe, c, m, ae, H, j, se, F, J, A, { left: Y.left, right: Y.right });
3663
+ let K = 0, te = 0;
3664
+ I === "top" ? te = -(j.height + 10) : I === "bottom" ? te = N + 25 : I === "left" ? K = -(j.width + 10) : I === "right" && (K = ne + 10), ba(fe, c, m, te, I, J, ne, N, K, A, { left: Y.left, right: Y.right });
3663
3665
  }
3664
3666
  Rt(t, { chartType: r > 0 ? "donut" : "pie" }), s && (Nt(ue.node()), It(t, s));
3665
3667
  }
@@ -3732,7 +3734,7 @@ class rf extends ct {
3732
3734
  }
3733
3735
  }
3734
3736
  function nf(t, a, e = {}, r = !1) {
3735
- var xe, pe, Me, J, ae, ke, me, Ce, we, Ne, Oe, Q, Z;
3737
+ var xe, pe, Me, K, te, ke, me, Ce, we, Ne, Oe, Q, Z;
3736
3738
  Ht(r), Mr(t);
3737
3739
  let n = [], s = [], o = [], i = null, c = null, f, d;
3738
3740
  const g = Vt.for(t);
@@ -3740,27 +3742,27 @@ function nf(t, a, e = {}, r = !1) {
3740
3742
  const S = Yt(t);
3741
3743
  d = S == null ? void 0 : S.margin, g.detach(), (S == null ? void 0 : S.chartType) === "area" ? (n = Array.from(t.querySelectorAll(".bc-frame .bc-area")), s = Array.from(t.querySelectorAll(".bc-frame .bc-line")), o = Array.from(t.querySelectorAll(".bc-frame .bc-dot")), i = t.querySelector(".bc-frame .bc-symbols")) : S && (c = Bt(t)), f = /* @__PURE__ */ new Map();
3742
3744
  for (const T of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
3743
- for (const [O, z] of Mt(T))
3744
- f.set(O, z);
3745
+ for (const [P, z] of Mt(T))
3746
+ f.set(P, z);
3745
3747
  t.replaceChildren();
3746
3748
  }
3747
- const { body: b } = _t(t, e.frame), m = $t(b).width, v = wa(a.values, (xe = e.verticalAxis) == null ? void 0 : xe.range, (pe = e.verticalAxis) == null ? void 0 : pe.numberFormat, (Me = e.verticalAxis) == null ? void 0 : Me.scaleType), y = ea(m, (J = e.verticalAxis) == null ? void 0 : J.labelPosition, (ae = e.horizontalAxis) == null ? void 0 : ae.labelPosition, (ke = e.verticalAxis) == null ? void 0 : ke.direction, v), { chartArea: x, width: A, height: w, margin: $ } = Gt(b, y), P = Kt(d, $), D = Lr(a.labels, (me = e.horizontalAxis) == null ? void 0 : me.range), H = D.map((S) => a.labels[S]), j = D.map((S) => a.values[S]), _ = H.map((S, T) => ({
3749
+ const { body: b } = _t(t, e.frame), m = $t(b).width, v = wa(a.values, (xe = e.verticalAxis) == null ? void 0 : xe.range, (pe = e.verticalAxis) == null ? void 0 : pe.numberFormat, (Me = e.verticalAxis) == null ? void 0 : Me.scaleType), y = ea(m, (K = e.verticalAxis) == null ? void 0 : K.labelPosition, (te = e.horizontalAxis) == null ? void 0 : te.labelPosition, (ke = e.verticalAxis) == null ? void 0 : ke.direction, v), { chartArea: x, width: A, height: w, margin: L } = Gt(b, y), O = Kt(d, L), F = Lr(a.labels, (me = e.horizontalAxis) == null ? void 0 : me.range), I = F.map((S) => a.labels[S]), J = F.map((S) => a.values[S]), H = I.map((S, T) => ({
3748
3750
  label: S,
3749
- value: j[T]
3750
- })), B = p.scalePoint().domain(H).range([0, A]).padding(e.edgePadding ? 0.6 : 0), K = B, X = (S) => B(S.label) ?? 0, te = ((Ce = e.verticalAxis) == null ? void 0 : Ce.scaleType) === "log", [fe, se] = Va(j, (we = e.verticalAxis) == null ? void 0 : we.range, (Ne = e.verticalAxis) == null ? void 0 : Ne.scaleType), F = te ? p.scaleSymlog().domain([fe, se]).nice().range([w, 0]) : p.scaleLinear().domain([fe, se]).nice().range([w, 0]), Y = F.domain(), R = Y[0] < 0 && Y[1] > 0 ? F(0) : void 0;
3751
- g.attach(x, P), g.update({
3752
- vertical: { scale: F, height: w, options: { ...e.verticalAxis, gridWidth: A, topPadding: $.top } },
3753
- horizontal: { scale: K, height: w, options: { ...e.horizontalAxis, width: A, zeroY: R } }
3751
+ value: J[T]
3752
+ })), D = p.scalePoint().domain(I).range([0, A]).padding(e.edgePadding ? 0.6 : 0), j = D, q = (S) => D(S.label) ?? 0, ae = ((Ce = e.verticalAxis) == null ? void 0 : Ce.scaleType) === "log", [fe, ne] = Va(J, (we = e.verticalAxis) == null ? void 0 : we.range, (Ne = e.verticalAxis) == null ? void 0 : Ne.scaleType), N = ae ? p.scaleSymlog().domain([fe, ne]).nice().range([w, 0]) : p.scaleLinear().domain([fe, ne]).nice().range([w, 0]), Y = N.domain(), R = Y[0] < 0 && Y[1] > 0 ? N(0) : void 0;
3753
+ g.attach(x, O), g.update({
3754
+ vertical: { scale: N, height: w, options: { ...e.verticalAxis, gridWidth: A, topPadding: L.top } },
3755
+ horizontal: { scale: j, height: w, options: { ...e.horizontalAxis, width: A, zeroY: R } }
3754
3756
  });
3755
3757
  const ie = x.ownerSVGElement, he = ta(ie, t, "plot", { x: 0, y: 0, width: A, height: w }), ve = p.select(x).append("g").attr("clip-path", `url(#${he})`), ce = ve.node(), ue = ((Oe = e.colors) == null ? void 0 : Oe[0]) ?? $i, Se = Aa(e.interpolation ?? "monotoneX"), ye = e.lineSymbols, ge = new rf(p.select(ce));
3756
- if (ge.config({ xPos: X, y: F, color: ue, curve: Se, areaFillOpacity: e.areaFillOpacity ?? 0.25, height: w }), s.length > 0 || n.length > 0 || o.length > 0) {
3757
- const S = (P == null ? void 0 : P.dx) ?? 0, T = (P == null ? void 0 : P.dy) ?? 0, O = ce.querySelectorAll(":scope > g");
3758
- O[0] && vt(O[0], n, S, T), O[1] && vt(O[1], s, S, T), O[2] && vt(O[2], o, S, T);
3759
- }
3760
- if (e.valueLabels && ge.use(bi({ position: e.valueLabelPosition, orientation: st.Vertical })), ge.draw(_), (Q = e.annotations) != null && Q.length && $r(x, e.annotations, { scaleX: K, scaleY: F, data: _, width: A, height: w, backgroundColor: Ft(t), transition: r, priorAnnotations: f }), p.select(ce).selectAll(".bc-dot").attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none"), e.tooltips || e.crosshair) {
3761
- const S = _.map((T) => ({
3762
- cx: X(T),
3763
- cy: F(T.value),
3758
+ if (ge.config({ xPos: q, y: N, color: ue, curve: Se, areaFillOpacity: e.areaFillOpacity ?? 0.25, height: w }), s.length > 0 || n.length > 0 || o.length > 0) {
3759
+ const S = (O == null ? void 0 : O.dx) ?? 0, T = (O == null ? void 0 : O.dy) ?? 0, P = ce.querySelectorAll(":scope > g");
3760
+ P[0] && vt(P[0], n, S, T), P[1] && vt(P[1], s, S, T), P[2] && vt(P[2], o, S, T);
3761
+ }
3762
+ if (e.valueLabels && ge.use(bi({ position: e.valueLabelPosition, orientation: st.Vertical })), ge.draw(H), (Q = e.annotations) != null && Q.length && $r(x, e.annotations, { scaleX: j, scaleY: N, data: H, width: A, height: w, backgroundColor: Ft(t), transition: r, priorAnnotations: f }), p.select(ce).selectAll(".bc-dot").attr("fill-opacity", 0).attr("stroke-opacity", 0).attr("pointer-events", "none"), e.tooltips || e.crosshair) {
3763
+ const S = H.map((T) => ({
3764
+ cx: q(T),
3765
+ cy: N(T.value),
3764
3766
  label: T.label,
3765
3767
  value: T.value,
3766
3768
  color: ue
@@ -3779,16 +3781,16 @@ function nf(t, a, e = {}, r = !1) {
3779
3781
  });
3780
3782
  }
3781
3783
  if (ye) {
3782
- const S = _.map((O, z) => ({
3783
- cx: X(O),
3784
- cy: F(O.value),
3784
+ const S = H.map((P, z) => ({
3785
+ cx: q(P),
3786
+ cy: N(P.value),
3785
3787
  color: ue,
3786
3788
  index: z
3787
3789
  }));
3788
3790
  let T;
3789
- i ? (x.appendChild(i), T = p.select(i)) : T = p.select(x).append("g").attr("class", "bc-symbols"), hn(T, S, _.length, ye, r);
3791
+ i ? (x.appendChild(i), T = p.select(i)) : T = p.select(x).append("g").attr("class", "bc-symbols"), hn(T, S, H.length, ye, r);
3790
3792
  }
3791
- Rt(t, { chartType: "area", margin: $ }), c && (Nt(ve.node()), It(t, c));
3793
+ Rt(t, { chartType: "area", margin: L }), c && (Nt(ve.node()), It(t, c));
3792
3794
  }
3793
3795
  function bn(t) {
3794
3796
  const a = t.series ?? [];
@@ -3893,47 +3895,47 @@ function of(t, a, e = {}, r = !1) {
3893
3895
  const M = b.map((le) => n.labels[le]), oe = (n.series ?? []).map((le) => ({ ...le, values: b.map((re) => le.values[re]) }));
3894
3896
  n = { labels: M, values: b.map((le) => n.values[le]), series: oe };
3895
3897
  }
3896
- const m = n.series ?? [], v = m.filter((M) => !Ma(M.name, e.seriesOverrides)), y = e.colors ?? Mi, x = v.map((M) => M.name), A = e.seriesOverrides, w = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", $ = w ? "direct" : e.legend !== !1 ? "legend" : "none", P = x.filter((M) => ha(M, $, A) === "direct"), D = e.legend !== !1 && !w, H = $t(g).width, j = 350, _ = e.legendPosition ?? "top", B = H > 0 && H < j && (_ === "left" || _ === "right") ? "top" : _, K = e.legendAnchor ?? "start", X = e.stacked !== !1, te = e.stackPercent === !0 || e.stackMode === va.Percent, fe = e.areaSortMode ?? lt.None, se = e.areaLines !== !1, F = [...v];
3898
+ const m = n.series ?? [], v = m.filter((M) => !Ma(M.name, e.seriesOverrides)), y = e.colors ?? Mi, x = v.map((M) => M.name), A = e.seriesOverrides, w = e.directLabelling === !0 || e.directLabelling === "auto" && e.legend !== !0 || !!e.directLabelling && e.directLabelling !== "auto", L = w ? "direct" : e.legend !== !1 ? "legend" : "none", O = x.filter((M) => ha(M, L, A) === "direct"), F = e.legend !== !1 && !w, I = $t(g).width, J = 350, H = e.legendPosition ?? "top", D = I > 0 && I < J && (H === "left" || H === "right") ? "top" : H, j = e.legendAnchor ?? "start", q = e.stacked !== !1, ae = e.stackPercent === !0 || e.stackMode === va.Percent, fe = e.areaSortMode ?? lt.None, ne = e.areaLines !== !1, N = [...v];
3897
3899
  if (fe !== lt.None) {
3898
- const M = new Map(F.map((oe) => [oe.name, oe.values.reduce((le, re) => le + re, 0)]));
3899
- F.sort((oe, le) => {
3900
+ const M = new Map(N.map((oe) => [oe.name, oe.values.reduce((le, re) => le + re, 0)]));
3901
+ N.sort((oe, le) => {
3900
3902
  const re = (M.get(oe.name) ?? 0) - (M.get(le.name) ?? 0);
3901
3903
  return fe === lt.Ascending ? re : -re;
3902
3904
  });
3903
3905
  }
3904
- const Y = { labels: n.labels, values: n.values, series: F }, R = te ? mn(Y) : bn(Y);
3906
+ const Y = { labels: n.labels, values: n.values, series: N }, R = ae ? mn(Y) : bn(Y);
3905
3907
  let ie = 0;
3906
- if (X)
3908
+ if (q)
3907
3909
  for (const M of R)
3908
3910
  for (const oe of M)
3909
3911
  oe[1] > ie && (ie = oe[1]);
3910
3912
  else
3911
- for (const M of F)
3913
+ for (const M of N)
3912
3914
  for (const oe of M.values)
3913
3915
  oe > ie && (ie = oe);
3914
- te && (ie = 100);
3915
- const he = [0, ie], ve = ((Xe = e.verticalAxis) == null ? void 0 : Xe.numberFormat) ?? (te ? "|d|%" : void 0), ce = wa(he, (Qe = e.verticalAxis) == null ? void 0 : Qe.range, ve, (Ue = e.verticalAxis) == null ? void 0 : Ue.scaleType), ue = ea(H, (Re = e.verticalAxis) == null ? void 0 : Re.labelPosition, (ft = e.horizontalAxis) == null ? void 0 : ft.labelPosition, (mt = e.verticalAxis) == null ? void 0 : mt.direction, ce), Se = P.length > 0 ? gi(P) : 0, ye = ue.top != null, ge = Math.max(0, H - (ue.left ?? 50) - (ue.right ?? 20) - Se), xe = D ? ya(x, B, ge) : { width: 0, height: 0 }, pe = D ? xe.height + 15 : 0, Me = { ...ue };
3916
- if (D && B === "top") {
3916
+ ae && (ie = 100);
3917
+ const he = [0, ie], ve = ((Xe = e.verticalAxis) == null ? void 0 : Xe.numberFormat) ?? (ae ? "|d|%" : void 0), ce = wa(he, (Qe = e.verticalAxis) == null ? void 0 : Qe.range, ve, (Ue = e.verticalAxis) == null ? void 0 : Ue.scaleType), ue = ea(I, (Re = e.verticalAxis) == null ? void 0 : Re.labelPosition, (ft = e.horizontalAxis) == null ? void 0 : ft.labelPosition, (mt = e.verticalAxis) == null ? void 0 : mt.direction, ce), Se = O.length > 0 ? gi(O) : 0, ye = ue.top != null, ge = Math.max(0, I - (ue.left ?? 50) - (ue.right ?? 20) - Se), xe = F ? ya(x, D, ge) : { width: 0, height: 0 }, pe = F ? xe.height + 15 : 0, Me = { ...ue };
3918
+ if (F && D === "top") {
3917
3919
  const M = ye ? 15 : 0;
3918
3920
  Me.top = pe + M;
3919
3921
  }
3920
- D && B === "bottom" && (Me.bottom = (Me.bottom ?? 24) + pe), D && B === "left" && (Me.left = (Me.left ?? 50) + xe.width + 10), D && B === "right" && (Me.right = (Me.right ?? 20) + xe.width + 10), Se > 0 && (Me.right = (Me.right ?? 20) + Se);
3921
- const { chartArea: J, width: ae, height: ke, margin: me } = Gt(g, Me), Ce = Kt(f, me), we = p.scalePoint().domain(n.labels).range([0, ae]).padding(e.edgePadding ? 0.6 : 0), Ne = we, Oe = (M) => we(n.labels[M]) ?? 0, Q = p.scaleLinear().domain([0, ie]).nice().range([ke, 0]);
3922
- d.attach(J, Ce), d.update({
3922
+ F && D === "bottom" && (Me.bottom = (Me.bottom ?? 24) + pe), F && D === "left" && (Me.left = (Me.left ?? 50) + xe.width + 10), F && D === "right" && (Me.right = (Me.right ?? 20) + xe.width + 10), Se > 0 && (Me.right = (Me.right ?? 20) + Se);
3923
+ const { chartArea: K, width: te, height: ke, margin: me } = Gt(g, Me), Ce = Kt(f, me), we = p.scalePoint().domain(n.labels).range([0, te]).padding(e.edgePadding ? 0.6 : 0), Ne = we, Oe = (M) => we(n.labels[M]) ?? 0, Q = p.scaleLinear().domain([0, ie]).nice().range([ke, 0]);
3924
+ d.attach(K, Ce), d.update({
3923
3925
  vertical: {
3924
3926
  scale: Q,
3925
3927
  height: ke,
3926
- options: { ...e.verticalAxis, numberFormat: ve, gridWidth: ae, topPadding: me.top }
3928
+ options: { ...e.verticalAxis, numberFormat: ve, gridWidth: te, topPadding: me.top }
3927
3929
  },
3928
- horizontal: { scale: Ne, height: ke, options: { ...e.horizontalAxis, width: ae } }
3930
+ horizontal: { scale: Ne, height: ke, options: { ...e.horizontalAxis, width: te } }
3929
3931
  });
3930
- const Z = J.ownerSVGElement, S = ta(Z, t, "plot", { x: 0, y: 0, width: ae, height: ke }), T = p.select(J).append("g").attr("clip-path", `url(#${S})`), O = T.node(), z = Aa(e.interpolation ?? "monotoneX"), I = R.map((M) => {
3932
+ const Z = K.ownerSVGElement, S = ta(Z, t, "plot", { x: 0, y: 0, width: te, height: ke }), T = p.select(K).append("g").attr("clip-path", `url(#${S})`), P = T.node(), z = Aa(e.interpolation ?? "monotoneX"), V = R.map((M) => {
3931
3933
  const oe = m.findIndex((re) => re.name === M.key);
3932
3934
  let le;
3933
- if (X)
3935
+ if (q)
3934
3936
  le = Array.from(M).map((re) => [Q(re[0]), Q(re[1])]);
3935
3937
  else {
3936
- const re = F.find((Te) => Te.name === M.key);
3938
+ const re = N.find((Te) => Te.name === M.key);
3937
3939
  le = ((re == null ? void 0 : re.values) ?? []).map((Te) => [Q(0), Q(Te)]);
3938
3940
  }
3939
3941
  return {
@@ -3941,15 +3943,15 @@ function of(t, a, e = {}, r = !1) {
3941
3943
  points: le,
3942
3944
  colorIndex: oe >= 0 ? oe : 0
3943
3945
  };
3944
- }), C = new Set((e.highlights ?? []).map((M) => M.target)), U = C.size > 0, E = e.areaFillOpacity != null ? e.areaFillOpacity : 0.85, W = new sf(p.select(O));
3946
+ }), C = new Set((e.highlights ?? []).map((M) => M.target)), U = C.size > 0, E = e.areaFillOpacity != null ? e.areaFillOpacity : 0.85, W = new sf(p.select(P));
3945
3947
  if (W.config({ xPos: Oe, colors: y, curve: z, areaFillOpacity: E, highlightTargets: C }), s.length > 0 || o.length > 0) {
3946
- const M = (Ce == null ? void 0 : Ce.dx) ?? 0, oe = (Ce == null ? void 0 : Ce.dy) ?? 0, le = O.querySelectorAll(":scope > g");
3948
+ const M = (Ce == null ? void 0 : Ce.dx) ?? 0, oe = (Ce == null ? void 0 : Ce.dy) ?? 0, le = P.querySelectorAll(":scope > g");
3947
3949
  le[0] && vt(le[0], s, M, oe), le[1] && vt(le[1], o, M, oe);
3948
3950
  }
3949
- if (W.draw(I), p.select(O).selectAll(".bc-area").each(function(M) {
3951
+ if (W.draw(V), p.select(P).selectAll(".bc-area").each(function(M) {
3950
3952
  const oe = M, le = qe(oe.name, oe.colorIndex, y, A), re = r ? p.select(this).transition().duration(Ee()) : p.select(this);
3951
3953
  re.attr("fill", le), U && re.attr("opacity", C.has(oe.name) ? E : 0.3);
3952
- }), se || p.select(O).selectAll(".bc-line").attr("display", "none"), p.select(O).selectAll(".bc-line").each(function(M) {
3954
+ }), ne || p.select(P).selectAll(".bc-line").attr("display", "none"), p.select(P).selectAll(".bc-line").each(function(M) {
3953
3955
  const oe = M, le = qe(oe.name, oe.colorIndex, y, A), re = pi(oe.name, e.interpolation ?? "monotoneX", A), Te = r ? p.select(this).transition().duration(Ee()) : p.select(this);
3954
3956
  if (Te.attr("stroke", le), U && Te.attr("opacity", C.has(oe.name) ? 1 : 0.3), re !== (e.interpolation ?? "monotoneX")) {
3955
3957
  const je = Aa(re), Ot = p.line().curve(je).x((it, Je) => Oe(Je)).y((it) => it[1]);
@@ -3963,7 +3965,7 @@ function of(t, a, e = {}, r = !1) {
3963
3965
  value: ((re = v[0]) == null ? void 0 : re.values[le]) ?? 0
3964
3966
  };
3965
3967
  });
3966
- $r(J, e.annotations, { scaleX: Ne, scaleY: Q, data: M, width: ae, height: ke, backgroundColor: Ft(t), transition: r, priorAnnotations: c });
3968
+ $r(K, e.annotations, { scaleX: Ne, scaleY: Q, data: M, width: te, height: ke, backgroundColor: Ft(t), transition: r, priorAnnotations: c });
3967
3969
  }
3968
3970
  if (e.tooltips || e.crosshair) {
3969
3971
  const M = [];
@@ -3980,8 +3982,8 @@ function of(t, a, e = {}, r = !1) {
3980
3982
  color: qe(oe.key, le, y, A)
3981
3983
  });
3982
3984
  });
3983
- }), Cr(J, {
3984
- width: ae,
3985
+ }), Cr(K, {
3986
+ width: te,
3985
3987
  height: ke,
3986
3988
  points: M,
3987
3989
  tooltip: e.tooltips,
@@ -3996,7 +3998,7 @@ function of(t, a, e = {}, r = !1) {
3996
3998
  const Ae = n.labels.length - 1, Pe = Oe(Ae) + 6, Be = [];
3997
3999
  if (v.forEach((M, oe) => {
3998
4000
  var it;
3999
- if (ha(M.name, $, A) !== "direct")
4001
+ if (ha(M.name, L, A) !== "direct")
4000
4002
  return;
4001
4003
  const re = R.find((Je) => Je.key === M.name);
4002
4004
  if (!re)
@@ -4007,21 +4009,21 @@ function of(t, a, e = {}, r = !1) {
4007
4009
  Be.sort((re, Te) => re.naturalY - Te.naturalY);
4008
4010
  const M = Be.map((re) => re.naturalY), le = pn(M, 0, ke, 14);
4009
4011
  Be.forEach((re, Te) => {
4010
- p.select(J).append("text").attr("class", "bc-direct-label").attr("data-series", re.index).attr("x", Pe).attr("y", le[Te]).attr("dy", "0.35em").attr("font-size", "11px").attr("fill", qe(re.name, re.index, y, A)).text(re.text);
4012
+ p.select(K).append("text").attr("class", "bc-direct-label").attr("data-series", re.index).attr("x", Pe).attr("y", le[Te]).attr("dy", "0.35em").attr("font-size", "11px").attr("fill", qe(re.name, re.index, y, A)).text(re.text);
4011
4013
  });
4012
4014
  }
4013
- const Ye = x.filter((M) => ha(M, $, A) === "legend");
4014
- if (D && Ye.length > 0) {
4015
+ const Ye = x.filter((M) => ha(M, L, A) === "legend");
4016
+ if (F && Ye.length > 0) {
4015
4017
  const M = Ye.map((re) => {
4016
4018
  const Te = m.findIndex((je) => je.name === re);
4017
4019
  return qe(re, Te, y, A);
4018
4020
  });
4019
4021
  let oe = 0, le = 0;
4020
- if (B === "top") {
4022
+ if (D === "top") {
4021
4023
  const re = ye ? 15 : 0;
4022
4024
  le = -(xe.height + 10 + re);
4023
- } else B === "bottom" ? le = ke + 25 : B === "left" ? oe = -(xe.width + 10) : B === "right" && (oe = ae + 10);
4024
- ba(J, Ye, M, le, B, K, ae, ke, oe, [], { left: me.left, right: me.right });
4025
+ } else D === "bottom" ? le = ke + 25 : D === "left" ? oe = -(xe.width + 10) : D === "right" && (oe = te + 10);
4026
+ ba(K, Ye, M, le, D, j, te, ke, oe, [], { left: me.left, right: me.right });
4025
4027
  }
4026
4028
  Rt(t, { chartType: "area-stacked", margin: me }), i && (Nt(T.node()), It(t, i));
4027
4029
  }
@@ -4080,80 +4082,80 @@ function cf(t, a, e) {
4080
4082
  return r;
4081
4083
  }
4082
4084
  function ff(t, a, e = {}, r = !1) {
4083
- var Ne, Oe, Q, Z, S, T, O, z;
4085
+ var Ne, Oe, Q, Z, S, T, P, z;
4084
4086
  Ht(r);
4085
4087
  let n = [], s = null, o, i;
4086
4088
  const c = Vt.for(t);
4087
4089
  if (r) {
4088
- const I = Yt(t);
4089
- i = I == null ? void 0 : I.margin, c.detach(), (I == null ? void 0 : I.chartType) === "column-stacked" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")) : I && (s = Bt(t)), o = /* @__PURE__ */ new Map();
4090
+ const V = Yt(t);
4091
+ i = V == null ? void 0 : V.margin, c.detach(), (V == null ? void 0 : V.chartType) === "column-stacked" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")) : V && (s = Bt(t)), o = /* @__PURE__ */ new Map();
4090
4092
  for (const C of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))
4091
4093
  for (const [U, E] of Mt(C))
4092
4094
  o.set(U, E);
4093
4095
  t.replaceChildren();
4094
4096
  }
4095
- const { body: f } = _t(t, e.frame), d = a.series ?? [], g = d.filter((I) => !Ma(I.name, e.seriesOverrides)), b = g.map((I) => I.name), m = e.colors ?? Ci, v = e.seriesOverrides, y = e.legend !== !1, x = $t(f).width, A = 350, w = e.legendPosition ?? "top", $ = x > 0 && x < A && (w === "left" || w === "right") ? "top" : w, P = e.legendAnchor ?? "start", D = { labels: a.labels, values: a.values, series: g }, H = e.stackMode === va.Percent, j = H ? mn(D) : bn(D), _ = cf(j, a.labels, d), B = H ? 100 : p.max(_, (I) => I.y1) ?? 0, X = wa([0, B], (Ne = e.verticalAxis) == null ? void 0 : Ne.range, (Oe = e.verticalAxis) == null ? void 0 : Oe.numberFormat, (Q = e.verticalAxis) == null ? void 0 : Q.scaleType), te = ea(x, (Z = e.verticalAxis) == null ? void 0 : Z.labelPosition, (S = e.horizontalAxis) == null ? void 0 : S.labelPosition, (T = e.verticalAxis) == null ? void 0 : T.direction, X), fe = Math.max(0, x - (te.left ?? 50) - (te.right ?? 20)), se = sn(a.labels, fe, e.horizontalAxis);
4096
- se !== void 0 && (te.bottom = se);
4097
- const F = te.top != null, Y = Math.max(0, x - (te.left ?? 50) - (te.right ?? 20)), R = y ? ya(b, $, Y) : { width: 0, height: 0 }, ie = y ? R.height + 15 : 0, he = { ...te };
4098
- if (y && $ === "top") {
4099
- const I = F ? 15 : 0;
4100
- he.top = ie + I;
4097
+ const { body: f } = _t(t, e.frame), d = a.series ?? [], g = d.filter((V) => !Ma(V.name, e.seriesOverrides)), b = g.map((V) => V.name), m = e.colors ?? Ci, v = e.seriesOverrides, y = e.legend !== !1, x = $t(f).width, A = 350, w = e.legendPosition ?? "top", L = x > 0 && x < A && (w === "left" || w === "right") ? "top" : w, O = e.legendAnchor ?? "start", F = { labels: a.labels, values: a.values, series: g }, I = e.stackMode === va.Percent, J = I ? mn(F) : bn(F), H = cf(J, a.labels, d), D = I ? 100 : p.max(H, (V) => V.y1) ?? 0, q = wa([0, D], (Ne = e.verticalAxis) == null ? void 0 : Ne.range, (Oe = e.verticalAxis) == null ? void 0 : Oe.numberFormat, (Q = e.verticalAxis) == null ? void 0 : Q.scaleType), ae = ea(x, (Z = e.verticalAxis) == null ? void 0 : Z.labelPosition, (S = e.horizontalAxis) == null ? void 0 : S.labelPosition, (T = e.verticalAxis) == null ? void 0 : T.direction, q), fe = Math.max(0, x - (ae.left ?? 50) - (ae.right ?? 20)), ne = sn(a.labels, fe, e.horizontalAxis);
4098
+ ne !== void 0 && (ae.bottom = ne);
4099
+ const N = ae.top != null, Y = Math.max(0, x - (ae.left ?? 50) - (ae.right ?? 20)), R = y ? ya(b, L, Y) : { width: 0, height: 0 }, ie = y ? R.height + 15 : 0, he = { ...ae };
4100
+ if (y && L === "top") {
4101
+ const V = N ? 15 : 0;
4102
+ he.top = ie + V;
4101
4103
  }
4102
- y && $ === "bottom" && (he.bottom = (he.bottom ?? 24) + ie), y && $ === "left" && (he.left = (he.left ?? 50) + R.width + 10), y && $ === "right" && (he.right = (he.right ?? 20) + R.width + 10);
4104
+ y && L === "bottom" && (he.bottom = (he.bottom ?? 24) + ie), y && L === "left" && (he.left = (he.left ?? 50) + R.width + 10), y && L === "right" && (he.right = (he.right ?? 20) + R.width + 10);
4103
4105
  const { chartArea: ve, width: ce, height: ue, margin: Se } = Gt(f, he), ye = Kt(i, Se);
4104
4106
  let ge = a.labels;
4105
4107
  if (e.sortMode === "total") {
4106
- const I = a.labels.map((C, U) => ({
4108
+ const V = a.labels.map((C, U) => ({
4107
4109
  label: C,
4108
4110
  index: U,
4109
4111
  total: g.reduce((E, W) => E + (W.values[U] ?? 0), 0)
4110
4112
  }));
4111
- I.sort((C, U) => U.total - C.total), ge = I.map((C) => C.label);
4113
+ V.sort((C, U) => U.total - C.total), ge = V.map((C) => C.label);
4112
4114
  }
4113
- const xe = p.scaleBand().domain(ge).range([0, ce]).padding(ka(e.barGap)), pe = p.scaleLinear().domain([0, B]).nice().range([ue, 0]);
4115
+ const xe = p.scaleBand().domain(ge).range([0, ce]).padding(ka(e.barGap)), pe = p.scaleLinear().domain([0, D]).nice().range([ue, 0]);
4114
4116
  c.attach(ve, ye), c.update({
4115
4117
  vertical: { scale: pe, height: ue, options: { ...e.verticalAxis, gridWidth: ce, topPadding: Se.top } },
4116
4118
  horizontal: { scale: xe, height: ue, options: { ...e.horizontalAxis, width: ce } }
4117
4119
  });
4118
- const Me = ve.ownerSVGElement, J = ta(Me, t, "bars", { x: 0, y: 0, width: ce, height: ue }), ae = p.select(ve).append("g").attr("clip-path", `url(#${J})`), ke = ge === a.labels ? _ : ge.flatMap((I) => _.filter((C) => C.label === I)), me = new lf(ae);
4120
+ const Me = ve.ownerSVGElement, K = ta(Me, t, "bars", { x: 0, y: 0, width: ce, height: ue }), te = p.select(ve).append("g").attr("clip-path", `url(#${K})`), ke = ge === a.labels ? H : ge.flatMap((V) => H.filter((C) => C.label === V)), me = new lf(te);
4119
4121
  if (me.config({ x: xe, y: pe, colors: m }), n.length > 0) {
4120
- const I = ae.node().querySelector("g");
4121
- vt(I, n, (ye == null ? void 0 : ye.dx) ?? 0, (ye == null ? void 0 : ye.dy) ?? 0);
4122
+ const V = te.node().querySelector("g");
4123
+ vt(V, n, (ye == null ? void 0 : ye.dx) ?? 0, (ye == null ? void 0 : ye.dy) ?? 0);
4122
4124
  }
4123
- if (e.tooltips && me.use(ma({ numberFormat: (O = e.verticalAxis) == null ? void 0 : O.numberFormat })), e.crosshair && me.use(La({
4125
+ if (e.tooltips && me.use(ma({ numberFormat: (P = e.verticalAxis) == null ? void 0 : P.numberFormat })), e.crosshair && me.use(La({
4124
4126
  width: ce,
4125
4127
  height: ue,
4126
4128
  direction: e.crosshairDirection,
4127
4129
  style: e.crosshairStyle,
4128
4130
  color: e.crosshairColor
4129
4131
  })), (z = e.annotations) != null && z.length) {
4130
- const I = a.labels.map((C, U) => ({
4132
+ const V = a.labels.map((C, U) => ({
4131
4133
  label: C,
4132
4134
  value: g.reduce((E, W) => E + (W.values[U] ?? 0), 0)
4133
4135
  }));
4134
- me.use(_a(e.annotations, { scaleX: xe, scaleY: pe, data: I, width: ce, height: ue, backgroundColor: Ft(t), transition: r, priorAnnotations: o }));
4136
+ me.use(_a(e.annotations, { scaleX: xe, scaleY: pe, data: V, width: ce, height: ue, backgroundColor: Ft(t), transition: r, priorAnnotations: o }));
4135
4137
  }
4136
- me.draw(ke), Rt(t, { chartType: "column-stacked", margin: Se }), s && (Nt(ae.node()), It(t, s)), p.select(ve).selectAll(".bc-bar-stacked").each(function(I) {
4137
- const C = I, U = qe(C.seriesName, C.seriesIndex, m, v), E = Ka(C.seriesName, v), W = r ? p.select(this).transition().duration(Ee()) : p.select(this);
4138
+ me.draw(ke), Rt(t, { chartType: "column-stacked", margin: Se }), s && (Nt(te.node()), It(t, s)), p.select(ve).selectAll(".bc-bar-stacked").each(function(V) {
4139
+ const C = V, U = qe(C.seriesName, C.seriesIndex, m, v), E = Ka(C.seriesName, v), W = r ? p.select(this).transition().duration(Ee()) : p.select(this);
4138
4140
  W.attr("fill", U), E < 1 && W.attr("fill-opacity", E);
4139
4141
  });
4140
4142
  const Ce = e.valueLabels ?? !1, we = p.select(ve).append("g").attr("class", "bc-value-labels");
4141
- if (ke.forEach((I) => {
4142
- if (!Ha(I.seriesName, Ce, v))
4143
+ if (ke.forEach((V) => {
4144
+ if (!Ha(V.seriesName, Ce, v))
4143
4145
  return;
4144
- const C = (xe(I.label) ?? 0) + xe.bandwidth() / 2, U = pe(I.y0) - (pe(I.y0) - pe(I.y1)) / 2;
4145
- we.append("text").attr("class", "bc-value-label").attr("data-series", I.seriesName).attr("x", C).attr("y", U).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", "currentColor").text(H ? `${Math.round(I.value)}%` : String(Math.round(I.value * 100) / 100));
4146
+ const C = (xe(V.label) ?? 0) + xe.bandwidth() / 2, U = pe(V.y0) - (pe(V.y0) - pe(V.y1)) / 2;
4147
+ we.append("text").attr("class", "bc-value-label").attr("data-series", V.seriesName).attr("x", C).attr("y", U).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", "currentColor").text(I ? `${Math.round(V.value)}%` : String(Math.round(V.value * 100) / 100));
4146
4148
  }), y && b.length > 0) {
4147
- const I = b.map((E) => {
4149
+ const V = b.map((E) => {
4148
4150
  const W = d.findIndex((Ae) => Ae.name === E);
4149
4151
  return qe(E, W, m, v);
4150
4152
  });
4151
4153
  let C = 0, U = 0;
4152
- if ($ === "top") {
4153
- const E = F ? 15 : 0;
4154
+ if (L === "top") {
4155
+ const E = N ? 15 : 0;
4154
4156
  U = -(R.height + 10 + E);
4155
- } else $ === "bottom" ? U = ue + 25 : $ === "left" ? C = -(R.width + 10) : $ === "right" && (C = ce + 10);
4156
- ba(ve, b, I, U, $, P, ce, ue, C, [], { left: Se.left, right: Se.right });
4157
+ } else L === "bottom" ? U = ue + 25 : L === "left" ? C = -(R.width + 10) : L === "right" && (C = ce + 10);
4158
+ ba(ve, b, V, U, L, O, ce, ue, C, [], { left: Se.left, right: Se.right });
4157
4159
  }
4158
4160
  }
4159
4161
  const Oi = [
@@ -4211,7 +4213,7 @@ function uf(t, a, e) {
4211
4213
  return r;
4212
4214
  }
4213
4215
  function hf(t, a, e = {}, r = !1) {
4214
- var S, T, O, z, I, C, U;
4216
+ var S, T, P, z, V, C, U;
4215
4217
  Ht(r);
4216
4218
  let n = [], s = null, o, i;
4217
4219
  const c = Vt.for(t);
@@ -4223,12 +4225,12 @@ function hf(t, a, e = {}, r = !1) {
4223
4225
  o.set(Ae, Pe);
4224
4226
  t.replaceChildren();
4225
4227
  }
4226
- const { body: f } = _t(t, e.frame), d = a.series ?? [], g = d.filter((E) => !Ma(E.name, e.seriesOverrides)), b = g.map((E) => E.name), m = e.colors ?? Oi, v = e.seriesOverrides, y = e.legend !== !1, x = $t(f).width, A = 350, w = e.legendPosition ?? "top", $ = x > 0 && x < A && (w === "left" || w === "right") ? "top" : w, P = e.legendAnchor ?? "start", D = { labels: a.labels, values: a.values, series: g }, H = e.stackMode === va.Percent, j = H ? mn(D) : bn(D), _ = uf(j, a.labels, d), B = H ? 100 : p.max(_, (E) => E.y1) ?? 0, K = e.categoryLabelLine === !0, X = Sr(a.labels), te = K ? He.Off : (S = e.verticalAxis) == null ? void 0 : S.labelPosition, fe = ea(x, te, (T = e.horizontalAxis) == null ? void 0 : T.labelPosition, (O = e.verticalAxis) == null ? void 0 : O.direction, X, (z = e.horizontalAxis) == null ? void 0 : z.showAxis), se = fe.top != null, F = Math.max(0, x - (fe.left ?? 50) - (fe.right ?? 20)), Y = y ? ya(b, $, F) : { width: 0, height: 0 }, R = y ? Y.height + 15 : 0, ie = { ...fe };
4227
- if (y && $ === "top") {
4228
- const E = se ? 15 : 0;
4228
+ const { body: f } = _t(t, e.frame), d = a.series ?? [], g = d.filter((E) => !Ma(E.name, e.seriesOverrides)), b = g.map((E) => E.name), m = e.colors ?? Oi, v = e.seriesOverrides, y = e.legend !== !1, x = $t(f).width, A = 350, w = e.legendPosition ?? "top", L = x > 0 && x < A && (w === "left" || w === "right") ? "top" : w, O = e.legendAnchor ?? "start", F = { labels: a.labels, values: a.values, series: g }, I = e.stackMode === va.Percent, J = I ? mn(F) : bn(F), H = uf(J, a.labels, d), D = I ? 100 : p.max(H, (E) => E.y1) ?? 0, j = e.categoryLabelLine === !0, q = Sr(a.labels), ae = j ? He.Off : (S = e.verticalAxis) == null ? void 0 : S.labelPosition, fe = ea(x, ae, (T = e.horizontalAxis) == null ? void 0 : T.labelPosition, (P = e.verticalAxis) == null ? void 0 : P.direction, q, (z = e.horizontalAxis) == null ? void 0 : z.showAxis), ne = fe.top != null, N = Math.max(0, x - (fe.left ?? 50) - (fe.right ?? 20)), Y = y ? ya(b, L, N) : { width: 0, height: 0 }, R = y ? Y.height + 15 : 0, ie = { ...fe };
4229
+ if (y && L === "top") {
4230
+ const E = ne ? 15 : 0;
4229
4231
  ie.top = R + E;
4230
4232
  }
4231
- y && $ === "bottom" && (ie.bottom = (ie.bottom ?? 24) + R), y && $ === "left" && (ie.left = (ie.left ?? 50) + Y.width + 10), y && $ === "right" && (ie.right = (ie.right ?? 20) + Y.width + 10);
4233
+ y && L === "bottom" && (ie.bottom = (ie.bottom ?? 24) + R), y && L === "left" && (ie.left = (ie.left ?? 50) + Y.width + 10), y && L === "right" && (ie.right = (ie.right ?? 20) + Y.width + 10);
4232
4234
  const { chartArea: he, width: ve, height: ce, margin: ue } = Gt(f, ie), Se = Kt(i, ue);
4233
4235
  let ye = a.labels;
4234
4236
  if (e.sortMode === "total") {
@@ -4239,7 +4241,7 @@ function hf(t, a, e = {}, r = !1) {
4239
4241
  }));
4240
4242
  E.sort((W, Ae) => Ae.total - W.total), ye = E.map((W) => W.label);
4241
4243
  }
4242
- const ge = p.scaleLinear().domain([0, B]).nice().range([0, ve]), xe = p.scaleBand().domain(ye).range([0, ce]).padding(ka(e.barGap));
4244
+ const ge = p.scaleLinear().domain([0, D]).nice().range([0, ve]), xe = p.scaleBand().domain(ye).range([0, ce]).padding(ka(e.barGap));
4243
4245
  c.attach(he, Se), c.update({
4244
4246
  horizontal: { scale: ge, height: ce, options: { ...e.horizontalAxis, width: ve } },
4245
4247
  vertical: {
@@ -4247,15 +4249,15 @@ function hf(t, a, e = {}, r = !1) {
4247
4249
  height: ce,
4248
4250
  options: {
4249
4251
  ...e.verticalAxis,
4250
- labelPosition: K ? He.Off : (I = e.verticalAxis) == null ? void 0 : I.labelPosition,
4252
+ labelPosition: j ? He.Off : (V = e.verticalAxis) == null ? void 0 : V.labelPosition,
4251
4253
  topPadding: ue.top
4252
4254
  }
4253
4255
  },
4254
4256
  order: "horizontal-first"
4255
4257
  });
4256
- const pe = he.ownerSVGElement, Me = ta(pe, t, "bars", { x: 0, y: 0, width: ve, height: ce }), J = p.select(he).append("g").attr("clip-path", `url(#${Me})`), ae = ye === a.labels ? _ : ye.flatMap((E) => _.filter((W) => W.label === E)), ke = K ? xs : 0, me = new df(J);
4258
+ const pe = he.ownerSVGElement, Me = ta(pe, t, "bars", { x: 0, y: 0, width: ve, height: ce }), K = p.select(he).append("g").attr("clip-path", `url(#${Me})`), te = ye === a.labels ? H : ye.flatMap((E) => H.filter((W) => W.label === E)), ke = j ? xs : 0, me = new df(K);
4257
4259
  if (me.config({ x: ge, y: xe, colors: m, categoryLabelOffset: ke }), n.length > 0) {
4258
- const E = J.node().querySelector("g");
4260
+ const E = K.node().querySelector("g");
4259
4261
  vt(E, n, (Se == null ? void 0 : Se.dx) ?? 0, (Se == null ? void 0 : Se.dy) ?? 0);
4260
4262
  }
4261
4263
  if (e.tooltips && me.use(ma({ numberFormat: (C = e.verticalAxis) == null ? void 0 : C.numberFormat })), e.crosshair && me.use(La({
@@ -4272,10 +4274,10 @@ function hf(t, a, e = {}, r = !1) {
4272
4274
  }));
4273
4275
  me.use(_a(e.annotations, { scaleX: xe, scaleY: ge, data: E, width: ve, height: ce, backgroundColor: Ft(t), orientation: st.Horizontal, transition: r, priorAnnotations: o }));
4274
4276
  }
4275
- if (me.draw(ae), Rt(t, { chartType: "bar-stacked", margin: ue }), s && (Nt(J.node()), It(t, s)), p.select(he).selectAll(".bc-bar-stacked").each(function(E) {
4277
+ if (me.draw(te), Rt(t, { chartType: "bar-stacked", margin: ue }), s && (Nt(K.node()), It(t, s)), p.select(he).selectAll(".bc-bar-stacked").each(function(E) {
4276
4278
  const W = E, Ae = qe(W.seriesName, W.seriesIndex, m, v), Pe = Ka(W.seriesName, v), Be = r ? p.select(this).transition().duration(Ee()) : p.select(this);
4277
4279
  Be.attr("fill", Ae), Pe < 1 && Be.attr("fill-opacity", Pe);
4278
- }), K) {
4280
+ }), j) {
4279
4281
  const E = p.select(he).append("g").attr("class", "bc-category-labels");
4280
4282
  for (const W of ye) {
4281
4283
  const Ae = xe(W) ?? 0;
@@ -4284,7 +4286,7 @@ function hf(t, a, e = {}, r = !1) {
4284
4286
  }
4285
4287
  const Ce = e.valueLabels ?? !1, we = e.valueLabelPosition ?? ze.Auto, Ne = /* @__PURE__ */ new Set(), Oe = /* @__PURE__ */ new Map();
4286
4288
  for (const E of ye) {
4287
- const W = ae.filter((Ae) => Ae.label === E).sort((Ae, Pe) => Ae.y1 - Pe.y1);
4289
+ const W = te.filter((Ae) => Ae.label === E).sort((Ae, Pe) => Ae.y1 - Pe.y1);
4288
4290
  if (W.length > 0) {
4289
4291
  const Ae = W[W.length - 1];
4290
4292
  Ne.add(Ae.label + "\0" + Ae.seriesName);
@@ -4295,10 +4297,10 @@ function hf(t, a, e = {}, r = !1) {
4295
4297
  }
4296
4298
  }
4297
4299
  const Q = /* @__PURE__ */ new Map(), Z = p.select(he).append("g").attr("class", "bc-value-labels");
4298
- if (ae.forEach((E) => {
4300
+ if (te.forEach((E) => {
4299
4301
  if (!Ha(E.seriesName, Ce, v))
4300
4302
  return;
4301
- const W = H ? `${Math.round(E.value)}%` : String(Math.round(E.value * 100) / 100), Ae = ge(E.y1) - ge(E.y0), Pe = W.length * 6.5 + 8, Be = Ae >= Pe, Ye = (xe(E.label) ?? 0) + ke + (xe.bandwidth() - ke) / 2, We = qe(E.seriesName, E.seriesIndex, m, v), Xe = Ne.has(E.label + "\0" + E.seriesName), Qe = we === ze.Outside || we === ze.Auto && !Be && Xe, Ue = () => {
4303
+ const W = I ? `${Math.round(E.value)}%` : String(Math.round(E.value * 100) / 100), Ae = ge(E.y1) - ge(E.y0), Pe = W.length * 6.5 + 8, Be = Ae >= Pe, Ye = (xe(E.label) ?? 0) + ke + (xe.bandwidth() - ke) / 2, We = qe(E.seriesName, E.seriesIndex, m, v), Xe = Ne.has(E.label + "\0" + E.seriesName), Qe = we === ze.Outside || we === ze.Auto && !Be && Xe, Ue = () => {
4302
4304
  const Re = ge(E.y0) + Ae / 2;
4303
4305
  Z.append("text").attr("class", "bc-value-label").attr("data-series", E.seriesName).attr("opacity", 0).attr("x", Re).attr("y", Ye).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", Et(We)).text(W);
4304
4306
  };
@@ -4321,11 +4323,11 @@ function hf(t, a, e = {}, r = !1) {
4321
4323
  return qe(Pe, Be, m, v);
4322
4324
  });
4323
4325
  let W = 0, Ae = 0;
4324
- if ($ === "top") {
4325
- const Pe = se ? 15 : 0;
4326
+ if (L === "top") {
4327
+ const Pe = ne ? 15 : 0;
4326
4328
  Ae = -(Y.height + 10 + Pe);
4327
- } else $ === "bottom" ? Ae = ce + 25 : $ === "left" ? W = -(Y.width + 10) : $ === "right" && (W = ve + 10);
4328
- ba(he, b, E, Ae, $, P, ve, ce, W, [], { left: ue.left, right: ue.right });
4329
+ } else L === "bottom" ? Ae = ce + 25 : L === "left" ? W = -(Y.width + 10) : L === "right" && (W = ve + 10);
4330
+ ba(he, b, E, Ae, L, O, ve, ce, W, [], { left: ue.left, right: ue.right });
4329
4331
  }
4330
4332
  }
4331
4333
  const Pi = [
@@ -4408,40 +4410,40 @@ function mf(t, a, e = {}, r = !1) {
4408
4410
  const Q = Yt(t);
4409
4411
  o = Q == null ? void 0 : Q.margin, i.detach(), (Q == null ? void 0 : Q.chartType) === "bar-split" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-split")) : Q && (s = Bt(t)), t.replaceChildren();
4410
4412
  }
4411
- const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((Q) => !Ma(Q.name, e.seriesOverrides)), g = d.map((Q) => Q.name), b = e.colors ?? Pi, m = e.seriesOverrides, v = e.legend !== !1, y = $t(c).width, x = 350, A = e.legendPosition ?? "top", w = y > 0 && y < x && (A === "left" || A === "right") ? "top" : A, $ = e.legendAnchor ?? "start", P = e.categoryLabelLine === !0, D = Sr(a.labels), H = P ? He.Off : (ke = e.verticalAxis) == null ? void 0 : ke.labelPosition, j = ea(
4413
+ const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((Q) => !Ma(Q.name, e.seriesOverrides)), g = d.map((Q) => Q.name), b = e.colors ?? Pi, m = e.seriesOverrides, v = e.legend !== !1, y = $t(c).width, x = 350, A = e.legendPosition ?? "top", w = y > 0 && y < x && (A === "left" || A === "right") ? "top" : A, L = e.legendAnchor ?? "start", O = e.categoryLabelLine === !0, F = Sr(a.labels), I = O ? He.Off : (ke = e.verticalAxis) == null ? void 0 : ke.labelPosition, J = ea(
4412
4414
  y,
4413
- H,
4415
+ I,
4414
4416
  (me = e.horizontalAxis) == null ? void 0 : me.labelPosition,
4415
4417
  (Ce = e.verticalAxis) == null ? void 0 : Ce.direction,
4416
- D,
4418
+ F,
4417
4419
  (we = e.horizontalAxis) == null ? void 0 : we.showAxis
4418
4420
  );
4419
- j.top = (j.top ?? 12) + pr;
4420
- const _ = Math.max(0, y - (j.left ?? 50) - (j.right ?? 20)), B = v ? ya(g, w, _) : { width: 0, height: 0 }, K = v ? B.height + 15 : 0, X = { ...j };
4421
- v && w === "top" && (X.top = K + pr), v && w === "bottom" && (X.bottom = (X.bottom ?? 24) + K), v && w === "left" && (X.left = (X.left ?? 50) + B.width + 10), v && w === "right" && (X.right = (X.right ?? 20) + B.width + 10);
4422
- const { chartArea: te, width: fe, height: se, margin: F } = Gt(c, X), Y = Kt(o, F);
4421
+ J.top = (J.top ?? 12) + pr;
4422
+ const H = Math.max(0, y - (J.left ?? 50) - (J.right ?? 20)), D = v ? ya(g, w, H) : { width: 0, height: 0 }, j = v ? D.height + 15 : 0, q = { ...J };
4423
+ v && w === "top" && (q.top = j + pr), v && w === "bottom" && (q.bottom = (q.bottom ?? 24) + j), v && w === "left" && (q.left = (q.left ?? 50) + D.width + 10), v && w === "right" && (q.right = (q.right ?? 20) + D.width + 10);
4424
+ const { chartArea: ae, width: fe, height: ne, margin: N } = Gt(c, q), Y = Kt(o, N);
4423
4425
  let R = a.labels;
4424
4426
  if (e.sortMode === "total") {
4425
4427
  const Q = a.labels.map((Z, S) => ({
4426
4428
  label: Z,
4427
- total: d.reduce((T, O) => T + (O.values[S] ?? 0), 0)
4429
+ total: d.reduce((T, P) => T + (P.values[S] ?? 0), 0)
4428
4430
  }));
4429
4431
  Q.sort((Z, S) => S.total - Z.total), R = Q.map((Z) => Z.label);
4430
4432
  }
4431
- const ie = p.scaleBand().domain(R).range([0, se]).padding(ka(e.barGap)), he = P ? ws : 0;
4432
- i.attach(te, Y), i.update({
4433
+ const ie = p.scaleBand().domain(R).range([0, ne]).padding(ka(e.barGap)), he = O ? ws : 0;
4434
+ i.attach(ae, Y), i.update({
4433
4435
  vertical: {
4434
4436
  scale: ie,
4435
- height: se,
4437
+ height: ne,
4436
4438
  options: {
4437
4439
  ...e.verticalAxis,
4438
- labelPosition: P ? He.Off : (Ne = e.verticalAxis) == null ? void 0 : Ne.labelPosition,
4439
- topPadding: F.top
4440
+ labelPosition: O ? He.Off : (Ne = e.verticalAxis) == null ? void 0 : Ne.labelPosition,
4441
+ topPadding: N.top
4440
4442
  }
4441
4443
  },
4442
4444
  order: "horizontal-first"
4443
4445
  });
4444
- const ve = e.sharedScale === !0, ce = pf(d, f, fe, ve), ue = te.ownerSVGElement, Se = ta(ue, t, "bars", { x: 0, y: 0, width: fe, height: se }), ye = p.select(te).append("g").attr("clip-path", `url(#${Se})`), ge = p.select(te).append("g").attr("class", "bc-split-headers");
4446
+ const ve = e.sharedScale === !0, ce = pf(d, f, fe, ve), ue = ae.ownerSVGElement, Se = ta(ue, t, "bars", { x: 0, y: 0, width: fe, height: ne }), ye = p.select(ae).append("g").attr("clip-path", `url(#${Se})`), ge = p.select(ae).append("g").attr("class", "bc-split-headers");
4445
4447
  for (const Q of ce)
4446
4448
  ge.append("text").attr("class", "bc-split-header").attr("x", Q.xOffset + Q.panelWidth / 2).attr("y", -pr / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", "11px").attr("font-weight", "600").attr("fill", "currentColor").text(Q.seriesName);
4447
4449
  const xe = bf(ce, R, a.labels, f), pe = new gf(ye);
@@ -4451,44 +4453,44 @@ function mf(t, a, e = {}, r = !1) {
4451
4453
  }
4452
4454
  if (e.tooltips && pe.use(ma({ numberFormat: (Oe = e.verticalAxis) == null ? void 0 : Oe.numberFormat })), e.crosshair && pe.use(La({
4453
4455
  width: fe,
4454
- height: se,
4456
+ height: ne,
4455
4457
  direction: e.crosshairDirection,
4456
4458
  style: e.crosshairStyle,
4457
4459
  color: e.crosshairColor,
4458
4460
  orientation: st.Horizontal
4459
- })), pe.draw(xe), Rt(t, { chartType: "bar-split", margin: F }), s && (Nt(ye.node()), It(t, s)), p.select(te).selectAll(".bc-bar-split").each(function(Q) {
4460
- const Z = Q, S = qe(Z.seriesName, Z.seriesIndex, b, m), T = Ka(Z.seriesName, m), O = r ? p.select(this).transition().duration(Ee()) : p.select(this);
4461
- O.attr("fill", S), T < 1 && O.attr("fill-opacity", T);
4462
- }), P) {
4463
- const Q = p.select(te).append("g").attr("class", "bc-category-labels");
4461
+ })), pe.draw(xe), Rt(t, { chartType: "bar-split", margin: N }), s && (Nt(ye.node()), It(t, s)), p.select(ae).selectAll(".bc-bar-split").each(function(Q) {
4462
+ const Z = Q, S = qe(Z.seriesName, Z.seriesIndex, b, m), T = Ka(Z.seriesName, m), P = r ? p.select(this).transition().duration(Ee()) : p.select(this);
4463
+ P.attr("fill", S), T < 1 && P.attr("fill-opacity", T);
4464
+ }), O) {
4465
+ const Q = p.select(ae).append("g").attr("class", "bc-category-labels");
4464
4466
  for (const Z of R) {
4465
4467
  const S = ie(Z) ?? 0;
4466
4468
  Q.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", S + ws / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(Z);
4467
4469
  }
4468
4470
  }
4469
- const Me = e.valueLabels ?? !0, J = e.valueLabelPosition ?? ze.Auto, ae = p.select(te).append("g").attr("class", "bc-value-labels");
4471
+ const Me = e.valueLabels ?? !0, K = e.valueLabelPosition ?? ze.Auto, te = p.select(ae).append("g").attr("class", "bc-value-labels");
4470
4472
  if (xe.forEach((Q) => {
4471
4473
  if (!Ha(Q.seriesName, Me, m))
4472
4474
  return;
4473
4475
  const Z = ce.find((W) => W.seriesName === Q.seriesName);
4474
4476
  if (!Z)
4475
4477
  return;
4476
- const S = qe(Q.seriesName, Q.seriesIndex, b, m), T = Q.xPos + Q.barWidth, O = Math.max(0, ie.bandwidth() - he), z = (ie(Q.label) ?? 0) + he + O / 2, I = J === ze.Inside || J === ze.Auto && Q.barWidth > 30;
4478
+ const S = qe(Q.seriesName, Q.seriesIndex, b, m), T = Q.xPos + Q.barWidth, P = Math.max(0, ie.bandwidth() - he), z = (ie(Q.label) ?? 0) + he + P / 2, V = K === ze.Inside || K === ze.Auto && Q.barWidth > 30;
4477
4479
  let C, U, E;
4478
- if (I)
4480
+ if (V)
4479
4481
  C = T - 4, U = "end", E = Et(S);
4480
4482
  else {
4481
4483
  const W = T + 4, Ae = Z.xOffset + Z.panelWidth;
4482
4484
  W + 20 > Ae ? (C = Q.xPos - 4, U = "end") : (C = W, U = "start"), E = "currentColor";
4483
4485
  }
4484
- ae.append("text").attr("class", "bc-value-label").attr("data-series", Q.seriesName).attr("x", C).attr("y", z).attr("text-anchor", U).attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", E).text(String(Q.value));
4486
+ te.append("text").attr("class", "bc-value-label").attr("data-series", Q.seriesName).attr("x", C).attr("y", z).attr("text-anchor", U).attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", E).text(String(Q.value));
4485
4487
  }), v && g.length > 0) {
4486
4488
  const Q = g.map((T) => {
4487
- const O = f.findIndex((z) => z.name === T);
4488
- return qe(T, O, b, m);
4489
+ const P = f.findIndex((z) => z.name === T);
4490
+ return qe(T, P, b, m);
4489
4491
  });
4490
4492
  let Z = 0, S = 0;
4491
- w === "top" ? S = -(B.height + 10 + pr) : w === "bottom" ? S = se + 25 : w === "left" ? Z = -(B.width + 10) : w === "right" && (Z = fe + 10), ba(te, g, Q, S, w, $, fe, se, Z, [], { left: F.left, right: F.right });
4493
+ w === "top" ? S = -(D.height + 10 + pr) : w === "bottom" ? S = ne + 25 : w === "left" ? Z = -(D.width + 10) : w === "right" && (Z = fe + 10), ba(ae, g, Q, S, w, L, fe, ne, Z, [], { left: N.left, right: N.right });
4492
4494
  }
4493
4495
  }
4494
4496
  const an = [
@@ -4536,39 +4538,39 @@ function vf(t, a, e = {}, r = !1) {
4536
4538
  const Z = Yt(t);
4537
4539
  o = Z == null ? void 0 : Z.margin, i.detach(), (Z == null ? void 0 : Z.chartType) === "bar-grouped" ? n = Array.from(t.querySelectorAll(".bc-frame .bc-bar-grouped")) : Z && (s = Bt(t)), t.replaceChildren();
4538
4540
  }
4539
- const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((Z) => !Ma(Z.name, e.seriesOverrides)), g = d.map((Z) => Z.name), b = e.colors ?? an, m = e.seriesOverrides, v = e.legend !== !1, y = $t(c).width, x = 350, A = e.legendPosition ?? "top", w = y > 0 && y < x && (A === "left" || A === "right") ? "top" : A, $ = e.legendAnchor ?? "start", P = e.categoryLabelLine === !0, D = Sr(a.labels), H = P ? He.Off : (me = e.verticalAxis) == null ? void 0 : me.labelPosition, j = ea(
4541
+ const { body: c } = _t(t, e.frame), f = a.series ?? [], d = f.filter((Z) => !Ma(Z.name, e.seriesOverrides)), g = d.map((Z) => Z.name), b = e.colors ?? an, m = e.seriesOverrides, v = e.legend !== !1, y = $t(c).width, x = 350, A = e.legendPosition ?? "top", w = y > 0 && y < x && (A === "left" || A === "right") ? "top" : A, L = e.legendAnchor ?? "start", O = e.categoryLabelLine === !0, F = Sr(a.labels), I = O ? He.Off : (me = e.verticalAxis) == null ? void 0 : me.labelPosition, J = ea(
4540
4542
  y,
4541
- H,
4543
+ I,
4542
4544
  (Ce = e.horizontalAxis) == null ? void 0 : Ce.labelPosition,
4543
4545
  (we = e.verticalAxis) == null ? void 0 : we.direction,
4544
- D,
4546
+ F,
4545
4547
  (Ne = e.horizontalAxis) == null ? void 0 : Ne.showAxis
4546
- ), _ = Math.max(0, y - (j.left ?? 50) - (j.right ?? 20)), B = v ? ya(g, w, _) : { width: 0, height: 0 }, K = v ? B.height + 15 : 0, X = { ...j };
4547
- v && w === "top" && (X.top = K), v && w === "bottom" && (X.bottom = (X.bottom ?? 24) + K), v && w === "left" && (X.left = (X.left ?? 50) + B.width + 10), v && w === "right" && (X.right = (X.right ?? 20) + B.width + 10);
4548
- const { chartArea: te, width: fe, height: se, margin: F } = Gt(c, X), Y = Kt(o, F);
4548
+ ), H = Math.max(0, y - (J.left ?? 50) - (J.right ?? 20)), D = v ? ya(g, w, H) : { width: 0, height: 0 }, j = v ? D.height + 15 : 0, q = { ...J };
4549
+ v && w === "top" && (q.top = j), v && w === "bottom" && (q.bottom = (q.bottom ?? 24) + j), v && w === "left" && (q.left = (q.left ?? 50) + D.width + 10), v && w === "right" && (q.right = (q.right ?? 20) + D.width + 10);
4550
+ const { chartArea: ae, width: fe, height: ne, margin: N } = Gt(c, q), Y = Kt(o, N);
4549
4551
  let R = a.labels;
4550
4552
  if (e.sortMode === "total") {
4551
4553
  const Z = a.labels.map((S, T) => ({
4552
4554
  label: S,
4553
- total: d.reduce((O, z) => O + (z.values[T] ?? 0), 0)
4555
+ total: d.reduce((P, z) => P + (z.values[T] ?? 0), 0)
4554
4556
  }));
4555
4557
  Z.sort((S, T) => T.total - S.total), R = Z.map((S) => S.label);
4556
4558
  }
4557
- const ie = p.scaleBand().domain(R).range([0, se]).paddingInner(ka(e.barGap)).paddingOuter(0.05), he = P ? Ss : 0, ve = Math.max(0, ie.bandwidth() - he), ce = p.scaleBand().domain(g).range([0, ve]).padding(0.05), ue = p.max(d.flatMap((Z) => Z.values)) ?? 0, Se = p.scaleLinear().domain([0, ue]).nice().range([0, fe]);
4558
- i.attach(te, Y), i.update({
4559
+ const ie = p.scaleBand().domain(R).range([0, ne]).paddingInner(ka(e.barGap)).paddingOuter(0.05), he = O ? Ss : 0, ve = Math.max(0, ie.bandwidth() - he), ce = p.scaleBand().domain(g).range([0, ve]).padding(0.05), ue = p.max(d.flatMap((Z) => Z.values)) ?? 0, Se = p.scaleLinear().domain([0, ue]).nice().range([0, fe]);
4560
+ i.attach(ae, Y), i.update({
4559
4561
  vertical: {
4560
4562
  scale: ie,
4561
- height: se,
4563
+ height: ne,
4562
4564
  options: {
4563
4565
  ...e.verticalAxis,
4564
- labelPosition: P ? He.Off : (Oe = e.verticalAxis) == null ? void 0 : Oe.labelPosition,
4565
- topPadding: F.top
4566
+ labelPosition: O ? He.Off : (Oe = e.verticalAxis) == null ? void 0 : Oe.labelPosition,
4567
+ topPadding: N.top
4566
4568
  }
4567
4569
  },
4568
- horizontal: { scale: Se, height: se, options: { ...e.horizontalAxis, width: fe } },
4570
+ horizontal: { scale: Se, height: ne, options: { ...e.horizontalAxis, width: fe } },
4569
4571
  order: "horizontal-first"
4570
4572
  });
4571
- const ye = te.ownerSVGElement, ge = ta(ye, t, "bars", { x: 0, y: 0, width: fe, height: se }), xe = p.select(te).append("g").attr("clip-path", `url(#${ge})`);
4573
+ const ye = ae.ownerSVGElement, ge = ta(ye, t, "bars", { x: 0, y: 0, width: fe, height: ne }), xe = p.select(ae).append("g").attr("clip-path", `url(#${ge})`);
4572
4574
  if (e.barBackground) {
4573
4575
  const Z = (e.colors ?? an)[0];
4574
4576
  xe.selectAll(".bc-bar-bg").data(R, (S) => S).enter().append("rect").attr("class", "bc-bar-bg").attr("x", 0).attr("y", (S) => (ie(S) ?? 0) + he).attr("width", fe).attr("height", ie.bandwidth() - he).attr("fill", Z).attr("opacity", 0.18);
@@ -4584,11 +4586,11 @@ function vf(t, a, e = {}, r = !1) {
4584
4586
  for (const Z of R) {
4585
4587
  const S = a.labels.indexOf(Z);
4586
4588
  for (const T of d) {
4587
- const O = f.findIndex((z) => z.name === T.name);
4589
+ const P = f.findIndex((z) => z.name === T.name);
4588
4590
  pe.push({
4589
4591
  label: Z,
4590
4592
  seriesName: T.name,
4591
- seriesIndex: O,
4593
+ seriesIndex: P,
4592
4594
  value: S >= 0 ? T.values[S] ?? 0 : 0
4593
4595
  });
4594
4596
  }
@@ -4600,35 +4602,35 @@ function vf(t, a, e = {}, r = !1) {
4600
4602
  }
4601
4603
  if (e.tooltips && Me.use(ma({ numberFormat: (Q = e.verticalAxis) == null ? void 0 : Q.numberFormat })), e.crosshair && Me.use(La({
4602
4604
  width: fe,
4603
- height: se,
4605
+ height: ne,
4604
4606
  direction: e.crosshairDirection,
4605
4607
  style: e.crosshairStyle,
4606
4608
  color: e.crosshairColor,
4607
4609
  orientation: st.Horizontal
4608
- })), Me.draw(pe), Rt(t, { chartType: "bar-grouped", margin: F }), s && (Nt(xe.node()), It(t, s)), p.select(te).selectAll(".bc-bar-grouped").each(function(Z) {
4609
- const S = Z, T = qe(S.seriesName, S.seriesIndex, b, m), O = Ka(S.seriesName, m), z = r ? p.select(this).transition().duration(Ee()) : p.select(this);
4610
- z.attr("fill", T), O < 1 && z.attr("fill-opacity", O);
4611
- }), P) {
4612
- const Z = p.select(te).append("g").attr("class", "bc-category-labels");
4610
+ })), Me.draw(pe), Rt(t, { chartType: "bar-grouped", margin: N }), s && (Nt(xe.node()), It(t, s)), p.select(ae).selectAll(".bc-bar-grouped").each(function(Z) {
4611
+ const S = Z, T = qe(S.seriesName, S.seriesIndex, b, m), P = Ka(S.seriesName, m), z = r ? p.select(this).transition().duration(Ee()) : p.select(this);
4612
+ z.attr("fill", T), P < 1 && z.attr("fill-opacity", P);
4613
+ }), O) {
4614
+ const Z = p.select(ae).append("g").attr("class", "bc-category-labels");
4613
4615
  for (const S of R) {
4614
4616
  const T = ie(S) ?? 0;
4615
4617
  Z.append("text").attr("class", "bc-category-label").attr("x", 2).attr("y", T + Ss / 2).attr("text-anchor", "start").attr("dominant-baseline", "central").attr("font-size", "10px").attr("font-weight", "600").attr("fill", "currentColor").text(S);
4616
4618
  }
4617
4619
  }
4618
- const J = e.valueLabels ?? !0, ae = e.valueLabelPosition ?? ze.Auto, ke = p.select(te).append("g").attr("class", "bc-value-labels");
4620
+ const K = e.valueLabels ?? !0, te = e.valueLabelPosition ?? ze.Auto, ke = p.select(ae).append("g").attr("class", "bc-value-labels");
4619
4621
  if (pe.forEach((Z) => {
4620
- if (!Ha(Z.seriesName, J, m))
4622
+ if (!Ha(Z.seriesName, K, m))
4621
4623
  return;
4622
- const S = qe(Z.seriesName, Z.seriesIndex, b, m), T = Math.max(0, Se(Z.value) - Se(0)), O = Se(0) + T, z = (ie(Z.label) ?? 0) + he + (ce(Z.seriesName) ?? 0) + ce.bandwidth() / 2, I = ae === ze.Inside || ae === ze.Auto && T > 30;
4624
+ const S = qe(Z.seriesName, Z.seriesIndex, b, m), T = Math.max(0, Se(Z.value) - Se(0)), P = Se(0) + T, z = (ie(Z.label) ?? 0) + he + (ce(Z.seriesName) ?? 0) + ce.bandwidth() / 2, V = te === ze.Inside || te === ze.Auto && T > 30;
4623
4625
  let C, U, E;
4624
- I ? (C = O - 4, U = "end", E = Et(S)) : (C = O + 4, U = "start", E = "currentColor"), ke.append("text").attr("class", "bc-value-label").attr("data-series", Z.seriesName).attr("x", C).attr("y", z).attr("text-anchor", U).attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", E).text(String(Z.value));
4626
+ V ? (C = P - 4, U = "end", E = Et(S)) : (C = P + 4, U = "start", E = "currentColor"), ke.append("text").attr("class", "bc-value-label").attr("data-series", Z.seriesName).attr("x", C).attr("y", z).attr("text-anchor", U).attr("dominant-baseline", "central").attr("font-size", "11px").attr("fill", E).text(String(Z.value));
4625
4627
  }), v && g.length > 0) {
4626
- const Z = g.map((O) => {
4627
- const z = f.findIndex((I) => I.name === O);
4628
- return qe(O, z, b, m);
4628
+ const Z = g.map((P) => {
4629
+ const z = f.findIndex((V) => V.name === P);
4630
+ return qe(P, z, b, m);
4629
4631
  });
4630
4632
  let S = 0, T = 0;
4631
- w === "top" ? T = -(B.height + 10) : w === "bottom" ? T = se + 25 : w === "left" ? S = -(B.width + 10) : w === "right" && (S = fe + 10), ba(te, g, Z, T, w, $, fe, se, S, [], { left: F.left, right: F.right });
4633
+ w === "top" ? T = -(D.height + 10) : w === "bottom" ? T = ne + 25 : w === "left" ? S = -(D.width + 10) : w === "right" && (S = fe + 10), ba(ae, g, Z, T, w, L, fe, ne, S, [], { left: N.left, right: N.right });
4632
4634
  }
4633
4635
  }
4634
4636
  const Or = /* @__PURE__ */ new Map();
@@ -5293,34 +5295,34 @@ xa.buildMessage = function(t, a) {
5293
5295
  };
5294
5296
  function nd(t, a) {
5295
5297
  a = a !== void 0 ? a : {};
5296
- var e = {}, r = a.grammarSource, n = { Chart: Fn }, s = Fn, o = "chart", i = "{", c = "}", f = "data", d = "=", g = ",", b = " ", m = "colorize", v = "highlight", y = "areafill", x = "annotation", A = "range", w = "note", $ = "series", P = "scene", D = "step", H = "transform", j = "hide_annotation", _ = "hide_range", B = "hide_note", K = "show_annotation", X = "show_range", te = "show_note", fe = "%", se = "-", F = ".", Y = '"', R = "\\", ie = "n", he = "r", ve = "t", ce = "u", ue = "//", Se = "/*", ye = "*/", ge = /^[^\t\n\r{}=]/, xe = /^[a-zA-Z_#]/, pe = /^[a-zA-Z0-9_#\-]/, Me = /^[0-9]/, J = /^[eE]/, ae = /^[+\-]/, ke = /^[^"\\]/, me = /^[0-9a-fA-F]/, Ce = /^[^\n]/, we = /^[ \t\n\r]/, Ne = Ie("chart", !1), Oe = Ie("{", !1), Q = Ie("}", !1), Z = Ie("data", !1), S = Ie("=", !1), T = Ie(",", !1), O = Ie(" ", !1), z = aa([" ", `
5297
- `, "\r", "{", "}", "="], !0, !1), I = Ie("colorize", !1), C = Ie("highlight", !1), U = Ie("areafill", !1), E = Ie("annotation", !1), W = Ie("range", !1), Ae = Ie("note", !1), Pe = Ie("series", !1), Be = Ie("scene", !1), Ye = Ie("step", !1), We = Ie("transform", !1), Xe = Ie("hide_annotation", !1), Qe = Ie("hide_range", !1), Ue = Ie("hide_note", !1), Re = Ie("show_annotation", !1), ft = Ie("show_range", !1), mt = Ie("show_note", !1), at = Ie("%", !1), Ct = ir("identifier"), M = aa([["a", "z"], ["A", "Z"], "_", "#"], !1, !1), oe = aa([["a", "z"], ["A", "Z"], ["0", "9"], "_", "#", "-"], !1, !1), le = Ie("-", !1), re = Ie(".", !1), Te = aa([["0", "9"]], !1, !1), je = aa(["e", "E"], !1, !1), Ot = aa(["+", "-"], !1, !1), it = ir("string"), Je = Ie('"', !1), Pt = Ie("\\", !1), na = aa(['"', "\\"], !0, !1), fa = Ie("n", !1), Ra = Ie("r", !1), ne = Ie("t", !1), Le = Ie("u", !1), Fe = aa([["0", "9"], ["a", "f"], ["A", "F"]], !1, !1), Ve = Zo(), rt = Ie("//", !1), nt = aa([`
5298
+ var e = {}, r = a.grammarSource, n = { Chart: Fn }, s = Fn, o = "chart", i = "{", c = "}", f = "data", d = "=", g = ",", b = " ", m = "colorize", v = "highlight", y = "areafill", x = "annotation", A = "range", w = "note", L = "series", O = "scene", F = "step", I = "transform", J = "hide_annotation", H = "hide_range", D = "hide_note", j = "show_annotation", q = "show_range", ae = "show_note", fe = "%", ne = "-", N = ".", Y = '"', R = "\\", ie = "n", he = "r", ve = "t", ce = "u", ue = "//", Se = "/*", ye = "*/", ge = /^[^\t\n\r{}=]/, xe = /^[a-zA-Z_#]/, pe = /^[a-zA-Z0-9_#\-]/, Me = /^[0-9]/, K = /^[eE]/, te = /^[+\-]/, ke = /^[^"\\]/, me = /^[0-9a-fA-F]/, Ce = /^[^\n]/, we = /^[ \t\n\r]/, Ne = Ie("chart", !1), Oe = Ie("{", !1), Q = Ie("}", !1), Z = Ie("data", !1), S = Ie("=", !1), T = Ie(",", !1), P = Ie(" ", !1), z = aa([" ", `
5299
+ `, "\r", "{", "}", "="], !0, !1), V = Ie("colorize", !1), C = Ie("highlight", !1), U = Ie("areafill", !1), E = Ie("annotation", !1), W = Ie("range", !1), Ae = Ie("note", !1), Pe = Ie("series", !1), Be = Ie("scene", !1), Ye = Ie("step", !1), We = Ie("transform", !1), Xe = Ie("hide_annotation", !1), Qe = Ie("hide_range", !1), Ue = Ie("hide_note", !1), Re = Ie("show_annotation", !1), ft = Ie("show_range", !1), mt = Ie("show_note", !1), at = Ie("%", !1), Ct = ir("identifier"), M = aa([["a", "z"], ["A", "Z"], "_", "#"], !1, !1), oe = aa([["a", "z"], ["A", "Z"], ["0", "9"], "_", "#", "-"], !1, !1), le = Ie("-", !1), re = Ie(".", !1), Te = aa([["0", "9"]], !1, !1), je = aa(["e", "E"], !1, !1), Ot = aa(["+", "-"], !1, !1), it = ir("string"), Je = Ie('"', !1), Pt = Ie("\\", !1), na = aa(['"', "\\"], !0, !1), fa = Ie("n", !1), Ra = Ie("r", !1), se = Ie("t", !1), Le = Ie("u", !1), Fe = aa([["0", "9"], ["a", "f"], ["A", "F"]], !1, !1), Ve = Zo(), rt = Ie("//", !1), nt = aa([`
5298
5300
  `], !0, !1), Wt = Ie("/*", !1), da = Ie("*/", !1), Oa = ir("whitespace"), qt = aa([" ", " ", `
5299
5301
  `, "\r"], !1, !1), qr = ir("optional whitespace"), lo = function(l, h) {
5300
- const L = td(h);
5302
+ const $ = td(h);
5301
5303
  return {
5302
5304
  type: "chart",
5303
5305
  chartType: l,
5304
- properties: L.properties,
5305
- data: L.data,
5306
- colorizes: L.colorizes,
5307
- highlights: L.highlights,
5308
- areaFills: L.areaFills,
5309
- annotations: L.annotations,
5310
- annotationVisibility: L.annotationVisibility,
5311
- series: L.series,
5312
- scenes: L.scenes,
5313
- transforms: L.transforms
5306
+ properties: $.properties,
5307
+ data: $.data,
5308
+ colorizes: $.colorizes,
5309
+ highlights: $.highlights,
5310
+ areaFills: $.areaFills,
5311
+ annotations: $.annotations,
5312
+ annotationVisibility: $.annotationVisibility,
5313
+ series: $.series,
5314
+ scenes: $.scenes,
5315
+ transforms: $.transforms
5314
5316
  };
5315
5317
  }, co = function(l) {
5316
5318
  return l;
5317
5319
  }, fo = function(l) {
5318
5320
  return { type: "data", entries: l };
5319
- }, Dn = function(l, h, L) {
5320
- return L;
5321
- }, uo = function(l, h, L) {
5322
- const k = [h, ...L];
5323
- return { type: "property", key: l, value: k[0].value, isPercentage: !1, values: k.map((N) => N.value) };
5321
+ }, Dn = function(l, h, $) {
5322
+ return $;
5323
+ }, uo = function(l, h, $) {
5324
+ const k = [h, ...$];
5325
+ return { type: "property", key: l, value: k[0].value, isPercentage: !1, values: k.map((B) => B.value) };
5324
5326
  }, ho = function(l) {
5325
5327
  return l;
5326
5328
  }, go = function(l, h) {
@@ -5333,8 +5335,8 @@ function nd(t, a) {
5333
5335
  return { type: "colorize", target: l, properties: h, fromHighlight: !0 };
5334
5336
  }, yo = function(l) {
5335
5337
  return { type: "highlight", target: l, properties: [] };
5336
- }, vo = function(l, h, L) {
5337
- return { type: "areafill", from: l, to: h, properties: L };
5338
+ }, vo = function(l, h, $) {
5339
+ return { type: "areafill", from: l, to: h, properties: $ };
5338
5340
  }, xo = function(l, h) {
5339
5341
  return { type: "annotation", kind: "point", target: l, properties: h };
5340
5342
  }, Ao = function(l) {
@@ -5344,19 +5346,19 @@ function nd(t, a) {
5344
5346
  }, So = function(l, h) {
5345
5347
  return { type: "series", name: l, properties: h };
5346
5348
  }, ko = function(l, h) {
5347
- const L = ad(h);
5349
+ const $ = ad(h);
5348
5350
  return {
5349
5351
  type: "scene",
5350
5352
  name: l ?? null,
5351
- properties: L.properties,
5352
- data: L.data,
5353
- colorizes: L.colorizes,
5354
- highlights: L.highlights,
5355
- areaFills: L.areaFills,
5356
- annotations: L.annotations,
5357
- annotationVisibility: L.annotationVisibility,
5358
- series: L.series,
5359
- transforms: L.transforms
5353
+ properties: $.properties,
5354
+ data: $.data,
5355
+ colorizes: $.colorizes,
5356
+ highlights: $.highlights,
5357
+ areaFills: $.areaFills,
5358
+ annotations: $.annotations,
5359
+ annotationVisibility: $.annotationVisibility,
5360
+ series: $.series,
5361
+ transforms: $.transforms
5360
5362
  };
5361
5363
  }, Lo = function(l, h) {
5362
5364
  return { type: "transform", transformType: l, properties: h };
@@ -5407,7 +5409,7 @@ function nd(t, a) {
5407
5409
  return String.fromCharCode(parseInt(l, 16));
5408
5410
  }, Uo = function(l) {
5409
5411
  jo("Unknown escape sequence \\" + l);
5410
- }, u = a.peg$currPos | 0, De = u, Pa = [{ line: 1, column: 1 }], Xt = u, sr = a.peg$maxFailExpected || [], V = a.peg$silentFails | 0, Wa;
5412
+ }, u = a.peg$currPos | 0, De = u, Pa = [{ line: 1, column: 1 }], Xt = u, sr = a.peg$maxFailExpected || [], _ = a.peg$silentFails | 0, Wa;
5411
5413
  if (a.startRule) {
5412
5414
  if (!(a.startRule in n))
5413
5415
  throw new Error(`Can't start parsing from rule "` + a.startRule + '".');
@@ -5419,8 +5421,8 @@ function nd(t, a) {
5419
5421
  function Ie(l, h) {
5420
5422
  return { type: "literal", text: l, ignoreCase: h };
5421
5423
  }
5422
- function aa(l, h, L) {
5423
- return { type: "class", parts: l, inverted: h, ignoreCase: L };
5424
+ function aa(l, h, $) {
5425
+ return { type: "class", parts: l, inverted: h, ignoreCase: $ };
5424
5426
  }
5425
5427
  function Zo() {
5426
5428
  return { type: "any" };
@@ -5432,23 +5434,23 @@ function nd(t, a) {
5432
5434
  return { type: "other", description: l };
5433
5435
  }
5434
5436
  function En(l) {
5435
- var h = Pa[l], L;
5437
+ var h = Pa[l], $;
5436
5438
  if (h)
5437
5439
  return h;
5438
5440
  if (l >= Pa.length)
5439
- L = Pa.length - 1;
5441
+ $ = Pa.length - 1;
5440
5442
  else
5441
- for (L = l; !Pa[--L]; )
5443
+ for ($ = l; !Pa[--$]; )
5442
5444
  ;
5443
- for (h = Pa[L], h = {
5445
+ for (h = Pa[$], h = {
5444
5446
  line: h.line,
5445
5447
  column: h.column
5446
- }; L < l; )
5447
- t.charCodeAt(L) === 10 ? (h.line++, h.column = 1) : h.column++, L++;
5448
+ }; $ < l; )
5449
+ t.charCodeAt($) === 10 ? (h.line++, h.column = 1) : h.column++, $++;
5448
5450
  return Pa[l] = h, h;
5449
5451
  }
5450
- function Xr(l, h, L) {
5451
- var k = En(l), N = En(h), G = {
5452
+ function Xr(l, h, $) {
5453
+ var k = En(l), B = En(h), G = {
5452
5454
  source: r,
5453
5455
  start: {
5454
5456
  offset: l,
@@ -5457,35 +5459,35 @@ function nd(t, a) {
5457
5459
  },
5458
5460
  end: {
5459
5461
  offset: h,
5460
- line: N.line,
5461
- column: N.column
5462
+ line: B.line,
5463
+ column: B.column
5462
5464
  }
5463
5465
  };
5464
5466
  return G;
5465
5467
  }
5466
- function q(l) {
5468
+ function X(l) {
5467
5469
  u < Xt || (u > Xt && (Xt = u, sr = []), sr.push(l));
5468
5470
  }
5469
5471
  function Jo(l, h) {
5470
5472
  return new xa(l, null, null, h);
5471
5473
  }
5472
- function Ko(l, h, L) {
5474
+ function Ko(l, h, $) {
5473
5475
  return new xa(
5474
5476
  xa.buildMessage(l, h),
5475
5477
  l,
5476
5478
  h,
5477
- L
5479
+ $
5478
5480
  );
5479
5481
  }
5480
5482
  function Fn() {
5481
- var l, h, L, k, N, G, ee, be;
5482
- if (l = u, $e(), t.substr(u, 5) === o ? (h = o, u += 5) : (h = e, V === 0 && q(Ne)), h !== e)
5483
- if (L = ht(), L !== e)
5483
+ var l, h, $, k, B, G, ee, be;
5484
+ if (l = u, $e(), t.substr(u, 5) === o ? (h = o, u += 5) : (h = e, _ === 0 && X(Ne)), h !== e)
5485
+ if ($ = ht(), $ !== e)
5484
5486
  if (k = lr(), k !== e)
5485
- if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
5487
+ if ($e(), t.charCodeAt(u) === 123 ? (B = i, u++) : (B = e, _ === 0 && X(Oe)), B !== e) {
5486
5488
  for ($e(), G = [], ee = Nn(); ee !== e; )
5487
5489
  G.push(ee), ee = Nn();
5488
- ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? ($e(), De = l, l = lo(k, G)) : (u = l, l = e);
5490
+ ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, _ === 0 && X(Q)), be !== e ? ($e(), De = l, l = lo(k, G)) : (u = l, l = e);
5489
5491
  } else
5490
5492
  u = l, l = e;
5491
5493
  else
@@ -5501,12 +5503,12 @@ function nd(t, a) {
5501
5503
  return l = u, $e(), h = Bn(), h === e && (h = _n(), h === e && (h = Gn(), h === e && (h = Hn(), h === e && (h = Rn(), h === e && (h = Wn(), h === e && (h = Yn(), h === e && (h = Un(), h === e && (h = jn(), h === e && (h = Zn(), h === e && (h = Qn(), h === e && (h = Jn(), h === e && (h = Kn(), h === e && (h = qn(), h === e && (h = tl(), h === e && (h = Xn(), h === e && (h = or())))))))))))))))), h !== e ? ($e(), De = l, l = co(h)) : (u = l, l = e), l;
5502
5504
  }
5503
5505
  function Bn() {
5504
- var l, h, L, k, N, G;
5505
- if (l = u, t.substr(u, 4) === f ? (h = f, u += 4) : (h = e, V === 0 && q(Z)), h !== e)
5506
- if ($e(), t.charCodeAt(u) === 123 ? (L = i, u++) : (L = e, V === 0 && q(Oe)), L !== e) {
5507
- for ($e(), k = [], N = Vn(), N === e && (N = In()); N !== e; )
5508
- k.push(N), N = Vn(), N === e && (N = In());
5509
- N = $e(), t.charCodeAt(u) === 125 ? (G = c, u++) : (G = e, V === 0 && q(Q)), G !== e ? (De = l, l = fo(k)) : (u = l, l = e);
5506
+ var l, h, $, k, B, G;
5507
+ if (l = u, t.substr(u, 4) === f ? (h = f, u += 4) : (h = e, _ === 0 && X(Z)), h !== e)
5508
+ if ($e(), t.charCodeAt(u) === 123 ? ($ = i, u++) : ($ = e, _ === 0 && X(Oe)), $ !== e) {
5509
+ for ($e(), k = [], B = Vn(), B === e && (B = In()); B !== e; )
5510
+ k.push(B), B = Vn(), B === e && (B = In());
5511
+ B = $e(), t.charCodeAt(u) === 125 ? (G = c, u++) : (G = e, _ === 0 && X(Q)), G !== e ? (De = l, l = fo(k)) : (u = l, l = e);
5510
5512
  } else
5511
5513
  u = l, l = e;
5512
5514
  else
@@ -5514,16 +5516,16 @@ function nd(t, a) {
5514
5516
  return l;
5515
5517
  }
5516
5518
  function In() {
5517
- var l, h, L, k, N, G, ee, be;
5519
+ var l, h, $, k, B, G, ee, be;
5518
5520
  if (l = u, $e(), h = ts(), h !== e)
5519
- if ($e(), t.charCodeAt(u) === 61 ? (L = d, u++) : (L = e, V === 0 && q(S)), L !== e)
5521
+ if ($e(), t.charCodeAt(u) === 61 ? ($ = d, u++) : ($ = e, _ === 0 && X(S)), $ !== e)
5520
5522
  if ($e(), k = qa(), k !== e) {
5521
- if (N = [], G = u, t.charCodeAt(u) === 44 ? (ee = g, u++) : (ee = e, V === 0 && q(T)), ee !== e ? ($e(), be = qa(), be !== e ? (De = G, G = Dn(h, k, be)) : (u = G, G = e)) : (u = G, G = e), G !== e)
5523
+ if (B = [], G = u, t.charCodeAt(u) === 44 ? (ee = g, u++) : (ee = e, _ === 0 && X(T)), ee !== e ? ($e(), be = qa(), be !== e ? (De = G, G = Dn(h, k, be)) : (u = G, G = e)) : (u = G, G = e), G !== e)
5522
5524
  for (; G !== e; )
5523
- N.push(G), G = u, t.charCodeAt(u) === 44 ? (ee = g, u++) : (ee = e, V === 0 && q(T)), ee !== e ? ($e(), be = qa(), be !== e ? (De = G, G = Dn(h, k, be)) : (u = G, G = e)) : (u = G, G = e);
5525
+ B.push(G), G = u, t.charCodeAt(u) === 44 ? (ee = g, u++) : (ee = e, _ === 0 && X(T)), ee !== e ? ($e(), be = qa(), be !== e ? (De = G, G = Dn(h, k, be)) : (u = G, G = e)) : (u = G, G = e);
5524
5526
  else
5525
- N = e;
5526
- N !== e ? (G = $e(), De = l, l = uo(h, k, N)) : (u = l, l = e);
5527
+ B = e;
5528
+ B !== e ? (G = $e(), De = l, l = uo(h, k, B)) : (u = l, l = e);
5527
5529
  } else
5528
5530
  u = l, l = e;
5529
5531
  else
@@ -5533,27 +5535,27 @@ function nd(t, a) {
5533
5535
  return l === e && (l = u, $e(), h = or(), h !== e ? ($e(), De = l, l = ho(h)) : (u = l, l = e)), l;
5534
5536
  }
5535
5537
  function Vn() {
5536
- var l, h, L, k;
5537
- return l = u, $e(), h = el(), h !== e ? (t.charCodeAt(u) === 9 ? (L = b, u++) : (L = e, V === 0 && q(O)), L !== e ? ($e(), k = qa(), k !== e ? ($e(), De = l, l = go(h, k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5538
+ var l, h, $, k;
5539
+ return l = u, $e(), h = el(), h !== e ? (t.charCodeAt(u) === 9 ? ($ = b, u++) : ($ = e, _ === 0 && X(P)), $ !== e ? ($e(), k = qa(), k !== e ? ($e(), De = l, l = go(h, k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5538
5540
  }
5539
5541
  function el() {
5540
- var l, h, L, k;
5541
- if (l = u, h = u, L = [], k = t.charAt(u), ge.test(k) ? u++ : (k = e, V === 0 && q(z)), k !== e)
5542
+ var l, h, $, k;
5543
+ if (l = u, h = u, $ = [], k = t.charAt(u), ge.test(k) ? u++ : (k = e, _ === 0 && X(z)), k !== e)
5542
5544
  for (; k !== e; )
5543
- L.push(k), k = t.charAt(u), ge.test(k) ? u++ : (k = e, V === 0 && q(z));
5545
+ $.push(k), k = t.charAt(u), ge.test(k) ? u++ : (k = e, _ === 0 && X(z));
5544
5546
  else
5545
- L = e;
5546
- return L !== e ? h = t.substring(h, u) : h = L, h !== e && (De = l, h = po(h)), l = h, l;
5547
+ $ = e;
5548
+ return $ !== e ? h = t.substring(h, u) : h = $, h !== e && (De = l, h = po(h)), l = h, l;
5547
5549
  }
5548
5550
  function _n() {
5549
- var l, h, L, k, N, G, ee, be;
5550
- if (l = u, t.substr(u, 8) === m ? (h = m, u += 8) : (h = e, V === 0 && q(I)), h !== e)
5551
- if (L = ht(), L !== e)
5551
+ var l, h, $, k, B, G, ee, be;
5552
+ if (l = u, t.substr(u, 8) === m ? (h = m, u += 8) : (h = e, _ === 0 && X(V)), h !== e)
5553
+ if ($ = ht(), $ !== e)
5552
5554
  if (k = ut(), k !== e)
5553
- if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
5555
+ if ($e(), t.charCodeAt(u) === 123 ? (B = i, u++) : (B = e, _ === 0 && X(Oe)), B !== e) {
5554
5556
  for ($e(), G = [], ee = dt(); ee !== e; )
5555
5557
  G.push(ee), ee = dt();
5556
- ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = bo(k, G)) : (u = l, l = e);
5558
+ ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, _ === 0 && X(Q)), be !== e ? (De = l, l = bo(k, G)) : (u = l, l = e);
5557
5559
  } else
5558
5560
  u = l, l = e;
5559
5561
  else
@@ -5565,14 +5567,14 @@ function nd(t, a) {
5565
5567
  return l;
5566
5568
  }
5567
5569
  function Gn() {
5568
- var l, h, L, k, N, G, ee, be;
5569
- if (l = u, t.substr(u, 9) === v ? (h = v, u += 9) : (h = e, V === 0 && q(C)), h !== e)
5570
- if (L = ht(), L !== e)
5570
+ var l, h, $, k, B, G, ee, be;
5571
+ if (l = u, t.substr(u, 9) === v ? (h = v, u += 9) : (h = e, _ === 0 && X(C)), h !== e)
5572
+ if ($ = ht(), $ !== e)
5571
5573
  if (k = ut(), k !== e)
5572
- if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
5574
+ if ($e(), t.charCodeAt(u) === 123 ? (B = i, u++) : (B = e, _ === 0 && X(Oe)), B !== e) {
5573
5575
  for ($e(), G = [], ee = dt(); ee !== e; )
5574
5576
  G.push(ee), ee = dt();
5575
- ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = mo(k, G)) : (u = l, l = e);
5577
+ ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, _ === 0 && X(Q)), be !== e ? (De = l, l = mo(k, G)) : (u = l, l = e);
5576
5578
  } else
5577
5579
  u = l, l = e;
5578
5580
  else
@@ -5581,19 +5583,19 @@ function nd(t, a) {
5581
5583
  u = l, l = e;
5582
5584
  else
5583
5585
  u = l, l = e;
5584
- return l === e && (l = u, t.substr(u, 9) === v ? (h = v, u += 9) : (h = e, V === 0 && q(C)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = yo(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e)), l;
5586
+ return l === e && (l = u, t.substr(u, 9) === v ? (h = v, u += 9) : (h = e, _ === 0 && X(C)), h !== e ? ($ = ht(), $ !== e ? (k = ut(), k !== e ? (De = l, l = yo(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e)), l;
5585
5587
  }
5586
5588
  function Hn() {
5587
- var l, h, L, k, N, G, ee, be, Lt, Ke;
5588
- if (l = u, t.substr(u, 8) === y ? (h = y, u += 8) : (h = e, V === 0 && q(U)), h !== e)
5589
- if (L = ht(), L !== e)
5589
+ var l, h, $, k, B, G, ee, be, Lt, Ke;
5590
+ if (l = u, t.substr(u, 8) === y ? (h = y, u += 8) : (h = e, _ === 0 && X(U)), h !== e)
5591
+ if ($ = ht(), $ !== e)
5590
5592
  if (k = ut(), k !== e)
5591
- if (N = ht(), N !== e)
5593
+ if (B = ht(), B !== e)
5592
5594
  if (G = ut(), G !== e)
5593
- if ($e(), t.charCodeAt(u) === 123 ? (ee = i, u++) : (ee = e, V === 0 && q(Oe)), ee !== e) {
5595
+ if ($e(), t.charCodeAt(u) === 123 ? (ee = i, u++) : (ee = e, _ === 0 && X(Oe)), ee !== e) {
5594
5596
  for ($e(), be = [], Lt = dt(); Lt !== e; )
5595
5597
  be.push(Lt), Lt = dt();
5596
- Lt = $e(), t.charCodeAt(u) === 125 ? (Ke = c, u++) : (Ke = e, V === 0 && q(Q)), Ke !== e ? (De = l, l = vo(k, G, be)) : (u = l, l = e);
5598
+ Lt = $e(), t.charCodeAt(u) === 125 ? (Ke = c, u++) : (Ke = e, _ === 0 && X(Q)), Ke !== e ? (De = l, l = vo(k, G, be)) : (u = l, l = e);
5597
5599
  } else
5598
5600
  u = l, l = e;
5599
5601
  else
@@ -5609,14 +5611,14 @@ function nd(t, a) {
5609
5611
  return l;
5610
5612
  }
5611
5613
  function Yn() {
5612
- var l, h, L, k, N, G, ee, be;
5613
- if (l = u, t.substr(u, 10) === x ? (h = x, u += 10) : (h = e, V === 0 && q(E)), h !== e)
5614
- if (L = ht(), L !== e)
5614
+ var l, h, $, k, B, G, ee, be;
5615
+ if (l = u, t.substr(u, 10) === x ? (h = x, u += 10) : (h = e, _ === 0 && X(E)), h !== e)
5616
+ if ($ = ht(), $ !== e)
5615
5617
  if (k = ut(), k !== e)
5616
- if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
5618
+ if ($e(), t.charCodeAt(u) === 123 ? (B = i, u++) : (B = e, _ === 0 && X(Oe)), B !== e) {
5617
5619
  for ($e(), G = [], ee = dt(); ee !== e; )
5618
5620
  G.push(ee), ee = dt();
5619
- ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = xo(k, G)) : (u = l, l = e);
5621
+ ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, _ === 0 && X(Q)), be !== e ? (De = l, l = xo(k, G)) : (u = l, l = e);
5620
5622
  } else
5621
5623
  u = l, l = e;
5622
5624
  else
@@ -5628,12 +5630,12 @@ function nd(t, a) {
5628
5630
  return l;
5629
5631
  }
5630
5632
  function Rn() {
5631
- var l, h, L, k, N, G;
5632
- if (l = u, t.substr(u, 5) === A ? (h = A, u += 5) : (h = e, V === 0 && q(W)), h !== e)
5633
- if ($e(), t.charCodeAt(u) === 123 ? (L = i, u++) : (L = e, V === 0 && q(Oe)), L !== e) {
5634
- for ($e(), k = [], N = dt(); N !== e; )
5635
- k.push(N), N = dt();
5636
- N = $e(), t.charCodeAt(u) === 125 ? (G = c, u++) : (G = e, V === 0 && q(Q)), G !== e ? (De = l, l = Ao(k)) : (u = l, l = e);
5633
+ var l, h, $, k, B, G;
5634
+ if (l = u, t.substr(u, 5) === A ? (h = A, u += 5) : (h = e, _ === 0 && X(W)), h !== e)
5635
+ if ($e(), t.charCodeAt(u) === 123 ? ($ = i, u++) : ($ = e, _ === 0 && X(Oe)), $ !== e) {
5636
+ for ($e(), k = [], B = dt(); B !== e; )
5637
+ k.push(B), B = dt();
5638
+ B = $e(), t.charCodeAt(u) === 125 ? (G = c, u++) : (G = e, _ === 0 && X(Q)), G !== e ? (De = l, l = Ao(k)) : (u = l, l = e);
5637
5639
  } else
5638
5640
  u = l, l = e;
5639
5641
  else
@@ -5641,12 +5643,12 @@ function nd(t, a) {
5641
5643
  return l;
5642
5644
  }
5643
5645
  function Wn() {
5644
- var l, h, L, k, N, G;
5645
- if (l = u, t.substr(u, 4) === w ? (h = w, u += 4) : (h = e, V === 0 && q(Ae)), h !== e)
5646
- if ($e(), t.charCodeAt(u) === 123 ? (L = i, u++) : (L = e, V === 0 && q(Oe)), L !== e) {
5647
- for ($e(), k = [], N = dt(); N !== e; )
5648
- k.push(N), N = dt();
5649
- N = $e(), t.charCodeAt(u) === 125 ? (G = c, u++) : (G = e, V === 0 && q(Q)), G !== e ? (De = l, l = wo(k)) : (u = l, l = e);
5646
+ var l, h, $, k, B, G;
5647
+ if (l = u, t.substr(u, 4) === w ? (h = w, u += 4) : (h = e, _ === 0 && X(Ae)), h !== e)
5648
+ if ($e(), t.charCodeAt(u) === 123 ? ($ = i, u++) : ($ = e, _ === 0 && X(Oe)), $ !== e) {
5649
+ for ($e(), k = [], B = dt(); B !== e; )
5650
+ k.push(B), B = dt();
5651
+ B = $e(), t.charCodeAt(u) === 125 ? (G = c, u++) : (G = e, _ === 0 && X(Q)), G !== e ? (De = l, l = wo(k)) : (u = l, l = e);
5650
5652
  } else
5651
5653
  u = l, l = e;
5652
5654
  else
@@ -5654,14 +5656,14 @@ function nd(t, a) {
5654
5656
  return l;
5655
5657
  }
5656
5658
  function qn() {
5657
- var l, h, L, k, N, G, ee, be;
5658
- if (l = u, t.substr(u, 6) === $ ? (h = $, u += 6) : (h = e, V === 0 && q(Pe)), h !== e)
5659
- if (L = ht(), L !== e)
5659
+ var l, h, $, k, B, G, ee, be;
5660
+ if (l = u, t.substr(u, 6) === L ? (h = L, u += 6) : (h = e, _ === 0 && X(Pe)), h !== e)
5661
+ if ($ = ht(), $ !== e)
5660
5662
  if (k = ut(), k !== e)
5661
- if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
5663
+ if ($e(), t.charCodeAt(u) === 123 ? (B = i, u++) : (B = e, _ === 0 && X(Oe)), B !== e) {
5662
5664
  for ($e(), G = [], ee = dt(); ee !== e; )
5663
5665
  G.push(ee), ee = dt();
5664
- ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = So(k, G)) : (u = l, l = e);
5666
+ ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, _ === 0 && X(Q)), be !== e ? (De = l, l = So(k, G)) : (u = l, l = e);
5665
5667
  } else
5666
5668
  u = l, l = e;
5667
5669
  else
@@ -5673,13 +5675,13 @@ function nd(t, a) {
5673
5675
  return l;
5674
5676
  }
5675
5677
  function tl() {
5676
- var l, h, L, k, N, G, ee, be;
5677
- if (l = u, t.substr(u, 5) === P ? (h = P, u += 5) : (h = e, V === 0 && q(Be)), h === e && (t.substr(u, 4) === D ? (h = D, u += 4) : (h = e, V === 0 && q(Ye))), h !== e)
5678
- if (L = ht(), L !== e)
5679
- if (k = ut(), k === e && (k = null), $e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
5678
+ var l, h, $, k, B, G, ee, be;
5679
+ if (l = u, t.substr(u, 5) === O ? (h = O, u += 5) : (h = e, _ === 0 && X(Be)), h === e && (t.substr(u, 4) === F ? (h = F, u += 4) : (h = e, _ === 0 && X(Ye))), h !== e)
5680
+ if ($ = ht(), $ !== e)
5681
+ if (k = ut(), k === e && (k = null), $e(), t.charCodeAt(u) === 123 ? (B = i, u++) : (B = e, _ === 0 && X(Oe)), B !== e) {
5680
5682
  for ($e(), G = [], ee = es(); ee !== e; )
5681
5683
  G.push(ee), ee = es();
5682
- ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = ko(k, G)) : (u = l, l = e);
5684
+ ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, _ === 0 && X(Q)), be !== e ? (De = l, l = ko(k, G)) : (u = l, l = e);
5683
5685
  } else
5684
5686
  u = l, l = e;
5685
5687
  else
@@ -5689,14 +5691,14 @@ function nd(t, a) {
5689
5691
  return l;
5690
5692
  }
5691
5693
  function Xn() {
5692
- var l, h, L, k, N, G, ee, be;
5693
- if (l = u, t.substr(u, 9) === H ? (h = H, u += 9) : (h = e, V === 0 && q(We)), h !== e)
5694
- if (L = ht(), L !== e)
5694
+ var l, h, $, k, B, G, ee, be;
5695
+ if (l = u, t.substr(u, 9) === I ? (h = I, u += 9) : (h = e, _ === 0 && X(We)), h !== e)
5696
+ if ($ = ht(), $ !== e)
5695
5697
  if (k = lr(), k !== e)
5696
- if ($e(), t.charCodeAt(u) === 123 ? (N = i, u++) : (N = e, V === 0 && q(Oe)), N !== e) {
5698
+ if ($e(), t.charCodeAt(u) === 123 ? (B = i, u++) : (B = e, _ === 0 && X(Oe)), B !== e) {
5697
5699
  for ($e(), G = [], ee = dt(); ee !== e; )
5698
5700
  G.push(ee), ee = dt();
5699
- ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, V === 0 && q(Q)), be !== e ? (De = l, l = Lo(k, G)) : (u = l, l = e);
5701
+ ee = $e(), t.charCodeAt(u) === 125 ? (be = c, u++) : (be = e, _ === 0 && X(Q)), be !== e ? (De = l, l = Lo(k, G)) : (u = l, l = e);
5700
5702
  } else
5701
5703
  u = l, l = e;
5702
5704
  else
@@ -5708,28 +5710,28 @@ function nd(t, a) {
5708
5710
  return l;
5709
5711
  }
5710
5712
  function Un() {
5711
- var l, h, L, k;
5712
- return l = u, t.substr(u, 15) === j ? (h = j, u += 15) : (h = e, V === 0 && q(Xe)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = $o(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5713
+ var l, h, $, k;
5714
+ return l = u, t.substr(u, 15) === J ? (h = J, u += 15) : (h = e, _ === 0 && X(Xe)), h !== e ? ($ = ht(), $ !== e ? (k = ut(), k !== e ? (De = l, l = $o(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5713
5715
  }
5714
5716
  function jn() {
5715
- var l, h, L, k;
5716
- return l = u, t.substr(u, 10) === _ ? (h = _, u += 10) : (h = e, V === 0 && q(Qe)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = Mo(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5717
+ var l, h, $, k;
5718
+ return l = u, t.substr(u, 10) === H ? (h = H, u += 10) : (h = e, _ === 0 && X(Qe)), h !== e ? ($ = ht(), $ !== e ? (k = ut(), k !== e ? (De = l, l = Mo(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5717
5719
  }
5718
5720
  function Zn() {
5719
- var l, h, L, k;
5720
- return l = u, t.substr(u, 9) === B ? (h = B, u += 9) : (h = e, V === 0 && q(Ue)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = Co(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5721
+ var l, h, $, k;
5722
+ return l = u, t.substr(u, 9) === D ? (h = D, u += 9) : (h = e, _ === 0 && X(Ue)), h !== e ? ($ = ht(), $ !== e ? (k = ut(), k !== e ? (De = l, l = Co(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5721
5723
  }
5722
5724
  function Qn() {
5723
- var l, h, L, k;
5724
- return l = u, t.substr(u, 15) === K ? (h = K, u += 15) : (h = e, V === 0 && q(Re)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = Oo(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5725
+ var l, h, $, k;
5726
+ return l = u, t.substr(u, 15) === j ? (h = j, u += 15) : (h = e, _ === 0 && X(Re)), h !== e ? ($ = ht(), $ !== e ? (k = ut(), k !== e ? (De = l, l = Oo(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5725
5727
  }
5726
5728
  function Jn() {
5727
- var l, h, L, k;
5728
- return l = u, t.substr(u, 10) === X ? (h = X, u += 10) : (h = e, V === 0 && q(ft)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = Po(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5729
+ var l, h, $, k;
5730
+ return l = u, t.substr(u, 10) === q ? (h = q, u += 10) : (h = e, _ === 0 && X(ft)), h !== e ? ($ = ht(), $ !== e ? (k = ut(), k !== e ? (De = l, l = Po(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5729
5731
  }
5730
5732
  function Kn() {
5731
- var l, h, L, k;
5732
- return l = u, t.substr(u, 9) === te ? (h = te, u += 9) : (h = e, V === 0 && q(mt)), h !== e ? (L = ht(), L !== e ? (k = ut(), k !== e ? (De = l, l = To(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5733
+ var l, h, $, k;
5734
+ return l = u, t.substr(u, 9) === ae ? (h = ae, u += 9) : (h = e, _ === 0 && X(mt)), h !== e ? ($ = ht(), $ !== e ? (k = ut(), k !== e ? (De = l, l = To(k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5733
5735
  }
5734
5736
  function es() {
5735
5737
  var l, h;
@@ -5740,126 +5742,126 @@ function nd(t, a) {
5740
5742
  return l = u, $e(), h = or(), h !== e ? ($e(), De = l, l = Do(h)) : (u = l, l = e), l;
5741
5743
  }
5742
5744
  function or() {
5743
- var l, h, L, k;
5744
- return l = u, h = ts(), h !== e ? ($e(), t.charCodeAt(u) === 61 ? (L = d, u++) : (L = e, V === 0 && q(S)), L !== e ? ($e(), k = qa(), k !== e ? (De = l, l = Eo(h, k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5745
+ var l, h, $, k;
5746
+ return l = u, h = ts(), h !== e ? ($e(), t.charCodeAt(u) === 61 ? ($ = d, u++) : ($ = e, _ === 0 && X(S)), $ !== e ? ($e(), k = qa(), k !== e ? (De = l, l = Eo(h, k)) : (u = l, l = e)) : (u = l, l = e)) : (u = l, l = e), l;
5745
5747
  }
5746
5748
  function ts() {
5747
5749
  var l;
5748
5750
  return l = ut(), l === e && (l = lr()), l;
5749
5751
  }
5750
5752
  function qa() {
5751
- var l, h, L;
5752
- return l = u, h = as(), h !== e ? (t.charCodeAt(u) === 37 ? (L = fe, u++) : (L = e, V === 0 && q(at)), L !== e ? (De = l, l = Fo(h)) : (u = l, l = e)) : (u = l, l = e), l === e && (l = u, h = as(), h !== e && (De = l, h = No(h)), l = h, l === e && (l = u, h = ut(), h !== e && (De = l, h = Bo(h)), l = h, l === e && (l = u, h = lr(), h !== e && (De = l, h = Io(h)), l = h))), l;
5753
+ var l, h, $;
5754
+ return l = u, h = as(), h !== e ? (t.charCodeAt(u) === 37 ? ($ = fe, u++) : ($ = e, _ === 0 && X(at)), $ !== e ? (De = l, l = Fo(h)) : (u = l, l = e)) : (u = l, l = e), l === e && (l = u, h = as(), h !== e && (De = l, h = No(h)), l = h, l === e && (l = u, h = ut(), h !== e && (De = l, h = Bo(h)), l = h, l === e && (l = u, h = lr(), h !== e && (De = l, h = Io(h)), l = h))), l;
5753
5755
  }
5754
5756
  function lr() {
5755
- var l, h, L, k, N;
5756
- if (V++, l = u, h = u, L = t.charAt(u), xe.test(L) ? u++ : (L = e, V === 0 && q(M)), L !== e) {
5757
- for (k = [], N = t.charAt(u), pe.test(N) ? u++ : (N = e, V === 0 && q(oe)); N !== e; )
5758
- k.push(N), N = t.charAt(u), pe.test(N) ? u++ : (N = e, V === 0 && q(oe));
5759
- L = [L, k], h = L;
5757
+ var l, h, $, k, B;
5758
+ if (_++, l = u, h = u, $ = t.charAt(u), xe.test($) ? u++ : ($ = e, _ === 0 && X(M)), $ !== e) {
5759
+ for (k = [], B = t.charAt(u), pe.test(B) ? u++ : (B = e, _ === 0 && X(oe)); B !== e; )
5760
+ k.push(B), B = t.charAt(u), pe.test(B) ? u++ : (B = e, _ === 0 && X(oe));
5761
+ $ = [$, k], h = $;
5760
5762
  } else
5761
5763
  u = h, h = e;
5762
- return h !== e ? l = t.substring(l, u) : l = h, V--, l === e && (h = e, V === 0 && q(Ct)), l;
5764
+ return h !== e ? l = t.substring(l, u) : l = h, _--, l === e && (h = e, _ === 0 && X(Ct)), l;
5763
5765
  }
5764
5766
  function as() {
5765
- var l, h, L, k, N, G, ee, be, Lt, Ke;
5766
- if (l = u, h = u, L = u, t.charCodeAt(u) === 45 ? (k = se, u++) : (k = e, V === 0 && q(le)), k === e && (k = null), N = u, t.charCodeAt(u) === 46 ? (G = F, u++) : (G = e, V === 0 && q(re)), G !== e) {
5767
- if (ee = [], be = t.charAt(u), Me.test(be) ? u++ : (be = e, V === 0 && q(Te)), be !== e)
5767
+ var l, h, $, k, B, G, ee, be, Lt, Ke;
5768
+ if (l = u, h = u, $ = u, t.charCodeAt(u) === 45 ? (k = ne, u++) : (k = e, _ === 0 && X(le)), k === e && (k = null), B = u, t.charCodeAt(u) === 46 ? (G = N, u++) : (G = e, _ === 0 && X(re)), G !== e) {
5769
+ if (ee = [], be = t.charAt(u), Me.test(be) ? u++ : (be = e, _ === 0 && X(Te)), be !== e)
5768
5770
  for (; be !== e; )
5769
- ee.push(be), be = t.charAt(u), Me.test(be) ? u++ : (be = e, V === 0 && q(Te));
5771
+ ee.push(be), be = t.charAt(u), Me.test(be) ? u++ : (be = e, _ === 0 && X(Te));
5770
5772
  else
5771
5773
  ee = e;
5772
- ee !== e ? (G = [G, ee], N = G) : (u = N, N = e);
5774
+ ee !== e ? (G = [G, ee], B = G) : (u = B, B = e);
5773
5775
  } else
5774
- u = N, N = e;
5775
- if (N === e) {
5776
- if (N = u, G = [], ee = t.charAt(u), Me.test(ee) ? u++ : (ee = e, V === 0 && q(Te)), ee !== e)
5776
+ u = B, B = e;
5777
+ if (B === e) {
5778
+ if (B = u, G = [], ee = t.charAt(u), Me.test(ee) ? u++ : (ee = e, _ === 0 && X(Te)), ee !== e)
5777
5779
  for (; ee !== e; )
5778
- G.push(ee), ee = t.charAt(u), Me.test(ee) ? u++ : (ee = e, V === 0 && q(Te));
5780
+ G.push(ee), ee = t.charAt(u), Me.test(ee) ? u++ : (ee = e, _ === 0 && X(Te));
5779
5781
  else
5780
5782
  G = e;
5781
5783
  if (G !== e) {
5782
- if (ee = u, t.charCodeAt(u) === 46 ? (be = F, u++) : (be = e, V === 0 && q(re)), be !== e) {
5783
- for (Lt = [], Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, V === 0 && q(Te)); Ke !== e; )
5784
- Lt.push(Ke), Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, V === 0 && q(Te));
5784
+ if (ee = u, t.charCodeAt(u) === 46 ? (be = N, u++) : (be = e, _ === 0 && X(re)), be !== e) {
5785
+ for (Lt = [], Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, _ === 0 && X(Te)); Ke !== e; )
5786
+ Lt.push(Ke), Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, _ === 0 && X(Te));
5785
5787
  be = [be, Lt], ee = be;
5786
5788
  } else
5787
5789
  u = ee, ee = e;
5788
- ee === e && (ee = null), G = [G, ee], N = G;
5790
+ ee === e && (ee = null), G = [G, ee], B = G;
5789
5791
  } else
5790
- u = N, N = e;
5792
+ u = B, B = e;
5791
5793
  }
5792
- if (N !== e) {
5793
- if (G = u, ee = t.charAt(u), J.test(ee) ? u++ : (ee = e, V === 0 && q(je)), ee !== e) {
5794
- if (be = t.charAt(u), ae.test(be) ? u++ : (be = e, V === 0 && q(Ot)), be === e && (be = null), Lt = [], Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, V === 0 && q(Te)), Ke !== e)
5794
+ if (B !== e) {
5795
+ if (G = u, ee = t.charAt(u), K.test(ee) ? u++ : (ee = e, _ === 0 && X(je)), ee !== e) {
5796
+ if (be = t.charAt(u), te.test(be) ? u++ : (be = e, _ === 0 && X(Ot)), be === e && (be = null), Lt = [], Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, _ === 0 && X(Te)), Ke !== e)
5795
5797
  for (; Ke !== e; )
5796
- Lt.push(Ke), Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, V === 0 && q(Te));
5798
+ Lt.push(Ke), Ke = t.charAt(u), Me.test(Ke) ? u++ : (Ke = e, _ === 0 && X(Te));
5797
5799
  else
5798
5800
  Lt = e;
5799
5801
  Lt !== e ? (ee = [ee, be, Lt], G = ee) : (u = G, G = e);
5800
5802
  } else
5801
5803
  u = G, G = e;
5802
- G === e && (G = null), k = [k, N, G], L = k;
5804
+ G === e && (G = null), k = [k, B, G], $ = k;
5803
5805
  } else
5804
- u = L, L = e;
5805
- return L !== e ? h = t.substring(h, u) : h = L, h !== e && (De = l, h = Vo(h)), l = h, l;
5806
+ u = $, $ = e;
5807
+ return $ !== e ? h = t.substring(h, u) : h = $, h !== e && (De = l, h = Vo(h)), l = h, l;
5806
5808
  }
5807
5809
  function ut() {
5808
- var l, h, L, k;
5809
- if (V++, l = u, t.charCodeAt(u) === 34 ? (h = Y, u++) : (h = e, V === 0 && q(Je)), h !== e) {
5810
- for (L = [], k = rs(); k !== e; )
5811
- L.push(k), k = rs();
5812
- t.charCodeAt(u) === 34 ? (k = Y, u++) : (k = e, V === 0 && q(Je)), k !== e ? (De = l, l = _o(L)) : (u = l, l = e);
5810
+ var l, h, $, k;
5811
+ if (_++, l = u, t.charCodeAt(u) === 34 ? (h = Y, u++) : (h = e, _ === 0 && X(Je)), h !== e) {
5812
+ for ($ = [], k = rs(); k !== e; )
5813
+ $.push(k), k = rs();
5814
+ t.charCodeAt(u) === 34 ? (k = Y, u++) : (k = e, _ === 0 && X(Je)), k !== e ? (De = l, l = _o($)) : (u = l, l = e);
5813
5815
  } else
5814
5816
  u = l, l = e;
5815
- return V--, l === e && (h = e, V === 0 && q(it)), l;
5817
+ return _--, l === e && (h = e, _ === 0 && X(it)), l;
5816
5818
  }
5817
5819
  function rs() {
5818
- var l, h, L;
5819
- return l = u, t.charCodeAt(u) === 92 ? (h = R, u++) : (h = e, V === 0 && q(Pt)), h !== e ? (L = al(), L !== e ? (De = l, l = Go(L)) : (u = l, l = e)) : (u = l, l = e), l === e && (l = t.charAt(u), ke.test(l) ? u++ : (l = e, V === 0 && q(na))), l;
5820
+ var l, h, $;
5821
+ return l = u, t.charCodeAt(u) === 92 ? (h = R, u++) : (h = e, _ === 0 && X(Pt)), h !== e ? ($ = al(), $ !== e ? (De = l, l = Go($)) : (u = l, l = e)) : (u = l, l = e), l === e && (l = t.charAt(u), ke.test(l) ? u++ : (l = e, _ === 0 && X(na))), l;
5820
5822
  }
5821
5823
  function al() {
5822
- var l, h, L, k, N, G, ee, be;
5823
- return l = u, t.charCodeAt(u) === 34 ? (h = Y, u++) : (h = e, V === 0 && q(Je)), h !== e && (De = l, h = Ho()), l = h, l === e && (l = u, t.charCodeAt(u) === 92 ? (h = R, u++) : (h = e, V === 0 && q(Pt)), h !== e && (De = l, h = Yo()), l = h, l === e && (l = u, t.charCodeAt(u) === 110 ? (h = ie, u++) : (h = e, V === 0 && q(fa)), h !== e && (De = l, h = Ro()), l = h, l === e && (l = u, t.charCodeAt(u) === 114 ? (h = he, u++) : (h = e, V === 0 && q(Ra)), h !== e && (De = l, h = Wo()), l = h, l === e && (l = u, t.charCodeAt(u) === 116 ? (h = ve, u++) : (h = e, V === 0 && q(ne)), h !== e && (De = l, h = qo()), l = h, l === e && (l = u, t.charCodeAt(u) === 117 ? (h = ce, u++) : (h = e, V === 0 && q(Le)), h !== e ? (L = u, k = u, N = t.charAt(u), me.test(N) ? u++ : (N = e, V === 0 && q(Fe)), N !== e ? (G = t.charAt(u), me.test(G) ? u++ : (G = e, V === 0 && q(Fe)), G !== e ? (ee = t.charAt(u), me.test(ee) ? u++ : (ee = e, V === 0 && q(Fe)), ee !== e ? (be = t.charAt(u), me.test(be) ? u++ : (be = e, V === 0 && q(Fe)), be !== e ? (N = [N, G, ee, be], k = N) : (u = k, k = e)) : (u = k, k = e)) : (u = k, k = e)) : (u = k, k = e), k !== e ? L = t.substring(L, u) : L = k, L !== e ? (De = l, l = Xo(L)) : (u = l, l = e)) : (u = l, l = e), l === e && (l = u, t.length > u ? (h = t.charAt(u), u++) : (h = e, V === 0 && q(Ve)), h !== e && (De = l, h = Uo(h)), l = h)))))), l;
5824
+ var l, h, $, k, B, G, ee, be;
5825
+ return l = u, t.charCodeAt(u) === 34 ? (h = Y, u++) : (h = e, _ === 0 && X(Je)), h !== e && (De = l, h = Ho()), l = h, l === e && (l = u, t.charCodeAt(u) === 92 ? (h = R, u++) : (h = e, _ === 0 && X(Pt)), h !== e && (De = l, h = Yo()), l = h, l === e && (l = u, t.charCodeAt(u) === 110 ? (h = ie, u++) : (h = e, _ === 0 && X(fa)), h !== e && (De = l, h = Ro()), l = h, l === e && (l = u, t.charCodeAt(u) === 114 ? (h = he, u++) : (h = e, _ === 0 && X(Ra)), h !== e && (De = l, h = Wo()), l = h, l === e && (l = u, t.charCodeAt(u) === 116 ? (h = ve, u++) : (h = e, _ === 0 && X(se)), h !== e && (De = l, h = qo()), l = h, l === e && (l = u, t.charCodeAt(u) === 117 ? (h = ce, u++) : (h = e, _ === 0 && X(Le)), h !== e ? ($ = u, k = u, B = t.charAt(u), me.test(B) ? u++ : (B = e, _ === 0 && X(Fe)), B !== e ? (G = t.charAt(u), me.test(G) ? u++ : (G = e, _ === 0 && X(Fe)), G !== e ? (ee = t.charAt(u), me.test(ee) ? u++ : (ee = e, _ === 0 && X(Fe)), ee !== e ? (be = t.charAt(u), me.test(be) ? u++ : (be = e, _ === 0 && X(Fe)), be !== e ? (B = [B, G, ee, be], k = B) : (u = k, k = e)) : (u = k, k = e)) : (u = k, k = e)) : (u = k, k = e), k !== e ? $ = t.substring($, u) : $ = k, $ !== e ? (De = l, l = Xo($)) : (u = l, l = e)) : (u = l, l = e), l === e && (l = u, t.length > u ? (h = t.charAt(u), u++) : (h = e, _ === 0 && X(Ve)), h !== e && (De = l, h = Uo(h)), l = h)))))), l;
5824
5826
  }
5825
5827
  function cr() {
5826
5828
  var l;
5827
5829
  return l = rl(), l === e && (l = nl()), l;
5828
5830
  }
5829
5831
  function rl() {
5830
- var l, h, L, k;
5831
- if (l = u, t.substr(u, 2) === ue ? (h = ue, u += 2) : (h = e, V === 0 && q(rt)), h !== e) {
5832
- for (L = [], k = t.charAt(u), Ce.test(k) ? u++ : (k = e, V === 0 && q(nt)); k !== e; )
5833
- L.push(k), k = t.charAt(u), Ce.test(k) ? u++ : (k = e, V === 0 && q(nt));
5834
- h = [h, L], l = h;
5832
+ var l, h, $, k;
5833
+ if (l = u, t.substr(u, 2) === ue ? (h = ue, u += 2) : (h = e, _ === 0 && X(rt)), h !== e) {
5834
+ for ($ = [], k = t.charAt(u), Ce.test(k) ? u++ : (k = e, _ === 0 && X(nt)); k !== e; )
5835
+ $.push(k), k = t.charAt(u), Ce.test(k) ? u++ : (k = e, _ === 0 && X(nt));
5836
+ h = [h, $], l = h;
5835
5837
  } else
5836
5838
  u = l, l = e;
5837
5839
  return l;
5838
5840
  }
5839
5841
  function nl() {
5840
- var l, h, L, k, N, G;
5841
- if (l = u, t.substr(u, 2) === Se ? (h = Se, u += 2) : (h = e, V === 0 && q(Wt)), h !== e) {
5842
- for (L = [], k = u, N = u, V++, t.substr(u, 2) === ye ? (G = ye, u += 2) : (G = e, V === 0 && q(da)), V--, G === e ? N = void 0 : (u = N, N = e), N !== e ? (t.length > u ? (G = t.charAt(u), u++) : (G = e, V === 0 && q(Ve)), G !== e ? (N = [N, G], k = N) : (u = k, k = e)) : (u = k, k = e); k !== e; )
5843
- L.push(k), k = u, N = u, V++, t.substr(u, 2) === ye ? (G = ye, u += 2) : (G = e, V === 0 && q(da)), V--, G === e ? N = void 0 : (u = N, N = e), N !== e ? (t.length > u ? (G = t.charAt(u), u++) : (G = e, V === 0 && q(Ve)), G !== e ? (N = [N, G], k = N) : (u = k, k = e)) : (u = k, k = e);
5844
- t.substr(u, 2) === ye ? (k = ye, u += 2) : (k = e, V === 0 && q(da)), k !== e ? (h = [h, L, k], l = h) : (u = l, l = e);
5842
+ var l, h, $, k, B, G;
5843
+ if (l = u, t.substr(u, 2) === Se ? (h = Se, u += 2) : (h = e, _ === 0 && X(Wt)), h !== e) {
5844
+ for ($ = [], k = u, B = u, _++, t.substr(u, 2) === ye ? (G = ye, u += 2) : (G = e, _ === 0 && X(da)), _--, G === e ? B = void 0 : (u = B, B = e), B !== e ? (t.length > u ? (G = t.charAt(u), u++) : (G = e, _ === 0 && X(Ve)), G !== e ? (B = [B, G], k = B) : (u = k, k = e)) : (u = k, k = e); k !== e; )
5845
+ $.push(k), k = u, B = u, _++, t.substr(u, 2) === ye ? (G = ye, u += 2) : (G = e, _ === 0 && X(da)), _--, G === e ? B = void 0 : (u = B, B = e), B !== e ? (t.length > u ? (G = t.charAt(u), u++) : (G = e, _ === 0 && X(Ve)), G !== e ? (B = [B, G], k = B) : (u = k, k = e)) : (u = k, k = e);
5846
+ t.substr(u, 2) === ye ? (k = ye, u += 2) : (k = e, _ === 0 && X(da)), k !== e ? (h = [h, $, k], l = h) : (u = l, l = e);
5845
5847
  } else
5846
5848
  u = l, l = e;
5847
5849
  return l;
5848
5850
  }
5849
5851
  function ht() {
5850
5852
  var l, h;
5851
- if (V++, l = [], h = t.charAt(u), we.test(h) ? u++ : (h = e, V === 0 && q(qt)), h === e && (h = cr()), h !== e)
5853
+ if (_++, l = [], h = t.charAt(u), we.test(h) ? u++ : (h = e, _ === 0 && X(qt)), h === e && (h = cr()), h !== e)
5852
5854
  for (; h !== e; )
5853
- l.push(h), h = t.charAt(u), we.test(h) ? u++ : (h = e, V === 0 && q(qt)), h === e && (h = cr());
5855
+ l.push(h), h = t.charAt(u), we.test(h) ? u++ : (h = e, _ === 0 && X(qt)), h === e && (h = cr());
5854
5856
  else
5855
5857
  l = e;
5856
- return V--, l === e && (h = e, V === 0 && q(Oa)), l;
5858
+ return _--, l === e && (h = e, _ === 0 && X(Oa)), l;
5857
5859
  }
5858
5860
  function $e() {
5859
5861
  var l, h;
5860
- for (V++, l = [], h = t.charAt(u), we.test(h) ? u++ : (h = e, V === 0 && q(qt)), h === e && (h = cr()); h !== e; )
5861
- l.push(h), h = t.charAt(u), we.test(h) ? u++ : (h = e, V === 0 && q(qt)), h === e && (h = cr());
5862
- return V--, h = e, V === 0 && q(qr), l;
5862
+ for (_++, l = [], h = t.charAt(u), we.test(h) ? u++ : (h = e, _ === 0 && X(qt)), h === e && (h = cr()); h !== e; )
5863
+ l.push(h), h = t.charAt(u), we.test(h) ? u++ : (h = e, _ === 0 && X(qt)), h === e && (h = cr());
5864
+ return _--, h = e, _ === 0 && X(qr), l;
5863
5865
  }
5864
5866
  if (Wa = s(), a.peg$library)
5865
5867
  return (
@@ -5874,7 +5876,7 @@ function nd(t, a) {
5874
5876
  );
5875
5877
  if (Wa !== e && u === t.length)
5876
5878
  return Wa;
5877
- throw Wa !== e && u < t.length && q(Qo()), Ko(
5879
+ throw Wa !== e && u < t.length && X(Qo()), Ko(
5878
5880
  sr,
5879
5881
  Xt < t.length ? t.charAt(Xt) : null,
5880
5882
  Xt < t.length ? Xr(Xt, Xt + 1) : Xr(Xt, Xt)
@@ -6896,10 +6898,10 @@ function Ed(t, a) {
6896
6898
  };
6897
6899
  if (a == null || !t.scenes || a < 0 || a >= t.scenes.length)
6898
6900
  return r;
6899
- const n = Dd(t.scenes, a, t.chartType), s = n.chartType ?? t.chartType, o = n.data ? Qi(to(n.data)) : r.data, i = Object.keys(n.chartTypeOptions).length > 0 ? Cs(s, { ...e, ...n.chartTypeOptions }) : e, c = n.colorizes.length > 0 ? ao(n.colorizes) : n.data ? [] : r.colorizes, f = a != null ? ro(n.highlights) : r.highlights, d = n.areaFills.length > 0 ? no(n.areaFills) : r.areaFills, g = n.annotations.length > 0 ? so(n.annotations) : [], b = [...r.annotations, ...g], m = n.hiddenAnnotationIds.size > 0 ? b.filter(($) => !$.id || !n.hiddenAnnotationIds.has($.id)) : b, v = n.seriesOverrides.length > 0 ? io(n.seriesOverrides) : r.seriesOverrides, y = Td(n.transforms, r.sortMode, `scene ${a}`), x = ["title", "description", "source", "sourceUrl", "byline", "note"], A = {};
6900
- for (const $ of x) {
6901
- const P = n.properties.get($);
6902
- typeof P == "string" && (A[$] = P);
6901
+ const n = Dd(t.scenes, a, t.chartType), s = n.chartType ?? t.chartType, o = n.data ? Qi(to(n.data)) : r.data, i = Object.keys(n.chartTypeOptions).length > 0 ? Cs(s, { ...e, ...n.chartTypeOptions }) : e, c = n.colorizes.length > 0 ? ao(n.colorizes) : n.data ? [] : r.colorizes, f = a != null ? ro(n.highlights) : r.highlights, d = n.areaFills.length > 0 ? no(n.areaFills) : r.areaFills, g = n.annotations.length > 0 ? so(n.annotations) : [], b = [...r.annotations, ...g], m = n.hiddenAnnotationIds.size > 0 ? b.filter((L) => !L.id || !n.hiddenAnnotationIds.has(L.id)) : b, v = n.seriesOverrides.length > 0 ? io(n.seriesOverrides) : r.seriesOverrides, y = Td(n.transforms, r.sortMode, `scene ${a}`), x = ["title", "description", "source", "sourceUrl", "byline", "note"], A = {};
6902
+ for (const L of x) {
6903
+ const O = n.properties.get(L);
6904
+ typeof O == "string" && (A[L] = O);
6903
6905
  }
6904
6906
  const w = Object.keys(A).length > 0 ? { ...r.frame, ...A } : r.frame;
6905
6907
  return {