@carbon/charts 1.23.15 → 1.23.17

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 (31) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/a11y-ePqvrObQ.mjs.map +1 -1
  3. package/dist/{angle-utils-Re7uVv7K.mjs → angle-utils-BWFhuTnR.mjs} +49 -54
  4. package/dist/{angle-utils-Re7uVv7K.mjs.map → angle-utils-BWFhuTnR.mjs.map} +1 -1
  5. package/dist/{array-CLq6Q40W.mjs → array-4CiuhqlQ.mjs} +2 -2
  6. package/dist/{array-CLq6Q40W.mjs.map → array-4CiuhqlQ.mjs.map} +1 -1
  7. package/dist/axis-scales-CPuwbFQf.mjs.map +1 -1
  8. package/dist/{choropleth-DvuP75LI.mjs → choropleth-CUIYpDaf.mjs} +483 -506
  9. package/dist/choropleth-CUIYpDaf.mjs.map +1 -0
  10. package/dist/{color-scale-utils-BPsvYA85.mjs → color-scale-utils-DCBFJmbg.mjs} +1152 -1161
  11. package/dist/{color-scale-utils-BPsvYA85.mjs.map → color-scale-utils-DCBFJmbg.mjs.map} +1 -1
  12. package/dist/components/index.mjs +1 -1
  13. package/dist/{index-Ciju2yyn.mjs → index-BILVb6NZ.mjs} +442 -447
  14. package/dist/{index-Ciju2yyn.mjs.map → index-BILVb6NZ.mjs.map} +1 -1
  15. package/dist/index.d.cts +21 -0
  16. package/dist/index.mjs +62 -63
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/model/index.mjs +22 -22
  19. package/dist/model/index.mjs.map +1 -1
  20. package/dist/services/index.mjs +3 -3
  21. package/dist/styles.css +96 -0
  22. package/dist/styles.css.map +1 -1
  23. package/dist/styles.min.css +1 -1
  24. package/dist/styles.min.css.map +1 -1
  25. package/dist/umd/bundle.umd.cjs +14 -14
  26. package/dist/umd/bundle.umd.cjs.map +1 -1
  27. package/dist/umd/bundle.umd.js +14 -14
  28. package/package.json +24 -25
  29. package/styles.css +96 -0
  30. package/styles.min.css +1 -1
  31. package/dist/choropleth-DvuP75LI.mjs.map +0 -1
@@ -1,18 +1,18 @@
1
- import { a3 as Lt, aC as Nt, aD as Ct, aE as It, aF as ut, aG as Zt, aH as Ft, aI as zt, a0 as Vt, aJ as Ht, aK as Yt, aL as Xt, aM as Gt, _ as $t, W as Ut, ax as q, aN as Kt, aO as qt, n as j, g as c, F as W, aP as T, aQ as M, aR as E, aS as jt, aT as ft, aU as mt, h as J, ar as Wt, ao as Jt, ad as dt, ai as Qt, H as ti } from "./color-scale-utils-BPsvYA85.mjs";
2
- import { z as ii, A as O, e as Q, S as A, D as ei, s as ni, v as si, x as oi, y as ai, u as ri } from "./angle-utils-Re7uVv7K.mjs";
3
- import { $ as w, e as _, i as C, S as m } from "./axis-scales-CPuwbFQf.mjs";
4
- function pt(i) {
1
+ import { a3 as Lt, aC as Nt, aD as Ct, aE as It, aF as ut, aG as Zt, aH as Ft, aI as zt, a0 as Vt, aJ as Ht, aK as Yt, aL as Xt, aM as Gt, _ as $t, W as Ut, ax as q, aN as Kt, aO as qt, n as j, g as c, F as W, aP as v, aQ as M, aR as E, aS as jt, aT as ft, aU as pt, h as J, ar as Wt, ao as Jt, ad as mt, ai as Qt, H as ti } from "./color-scale-utils-DCBFJmbg.mjs";
2
+ import { z as ii, A, e as Q, S as O, D as ni, s as si, v as ei, x as oi, y as ai, u as ri } from "./angle-utils-BWFhuTnR.mjs";
3
+ import { $ as w, e as _, i as C, S as p } from "./axis-scales-CPuwbFQf.mjs";
4
+ function dt(i) {
5
5
  var t = i == null ? 0 : i.length;
6
6
  return t ? Lt(i, 1) : [];
7
7
  }
8
8
  function hi(i) {
9
- return Nt(Ct(i, void 0, pt), i + "");
9
+ return Nt(Ct(i, void 0, dt), i + "");
10
10
  }
11
- function ci(i, t, e) {
12
- var n = -1, s = i.length;
13
- t < 0 && (t = -t > s ? 0 : s + t), e = e > s ? s : e, e < 0 && (e += s), s = t > e ? 0 : e - t >>> 0, t >>>= 0;
14
- for (var o = Array(s); ++n < s; )
15
- o[n] = i[n + t];
11
+ function ci(i, t, n) {
12
+ var s = -1, e = i.length;
13
+ t < 0 && (t = -t > e ? 0 : e + t), n = n > e ? e : n, n < 0 && (n += e), e = t > n ? 0 : n - t >>> 0, t >>>= 0;
14
+ for (var o = Array(e); ++s < e; )
15
+ o[s] = i[s + t];
16
16
  return o;
17
17
  }
18
18
  function li(i, t) {
@@ -24,17 +24,17 @@ function _i(i, t) {
24
24
  function ui(i) {
25
25
  return zt(i) ? void 0 : i;
26
26
  }
27
- var fi = 1, mi = 2, di = 4, pi = hi(function(i, t) {
28
- var e = {};
27
+ var fi = 1, pi = 2, mi = 4, di = hi(function(i, t) {
28
+ var n = {};
29
29
  if (i == null)
30
- return e;
31
- var n = !1;
30
+ return n;
31
+ var s = !1;
32
32
  t = Vt(t, function(o) {
33
- return o = ut(o, i), n || (n = o.length > 1), o;
34
- }), Ht(i, Yt(i), e), n && (e = Xt(e, fi | mi | di, ui));
35
- for (var s = t.length; s--; )
36
- _i(e, t[s]);
37
- return e;
33
+ return o = ut(o, i), s || (s = o.length > 1), o;
34
+ }), Ht(i, Yt(i), n), s && (n = Xt(n, fi | pi | mi, ui));
35
+ for (var e = t.length; e--; )
36
+ _i(n, t[e]);
37
+ return n;
38
38
  });
39
39
  function tt(i) {
40
40
  return Math.log(i);
@@ -57,69 +57,69 @@ function vi(i) {
57
57
  function Ti(i) {
58
58
  return i === Math.E ? Math.log : i === 10 && Math.log10 || i === 2 && Math.log2 || (i = Math.log(i), (t) => Math.log(t) / i);
59
59
  }
60
- function et(i) {
61
- return (t, e) => -i(-t, e);
60
+ function nt(i) {
61
+ return (t, n) => -i(-t, n);
62
62
  }
63
63
  function Di(i) {
64
- const t = i(tt, it), e = t.domain;
65
- let n = 10, s, o;
64
+ const t = i(tt, it), n = t.domain;
65
+ let s = 10, e, o;
66
66
  function a() {
67
- return s = Ti(n), o = vi(n), e()[0] < 0 ? (s = et(s), o = et(o), i(xi, gi)) : i(tt, it), t;
67
+ return e = Ti(s), o = vi(s), n()[0] < 0 ? (e = nt(e), o = nt(o), i(xi, gi)) : i(tt, it), t;
68
68
  }
69
69
  return t.base = function(r) {
70
- return arguments.length ? (n = +r, a()) : n;
70
+ return arguments.length ? (s = +r, a()) : s;
71
71
  }, t.domain = function(r) {
72
- return arguments.length ? (e(r), a()) : e();
72
+ return arguments.length ? (n(r), a()) : n();
73
73
  }, t.ticks = (r) => {
74
- const h = e();
74
+ const h = n();
75
75
  let l = h[0], f = h[h.length - 1];
76
76
  const y = f < l;
77
77
  y && ([l, f] = [f, l]);
78
- let p = s(l), v = s(f), g, d;
78
+ let d = e(l), T = e(f), g, m;
79
79
  const D = r == null ? 10 : +r;
80
80
  let u = [];
81
- if (!(n % 1) && v - p < D) {
82
- if (p = Math.floor(p), v = Math.ceil(v), l > 0) {
83
- for (; p <= v; ++p)
84
- for (g = 1; g < n; ++g)
85
- if (d = p < 0 ? g / o(-p) : g * o(p), !(d < l)) {
86
- if (d > f) break;
87
- u.push(d);
81
+ if (!(s % 1) && T - d < D) {
82
+ if (d = Math.floor(d), T = Math.ceil(T), l > 0) {
83
+ for (; d <= T; ++d)
84
+ for (g = 1; g < s; ++g)
85
+ if (m = d < 0 ? g / o(-d) : g * o(d), !(m < l)) {
86
+ if (m > f) break;
87
+ u.push(m);
88
88
  }
89
- } else for (; p <= v; ++p)
90
- for (g = n - 1; g >= 1; --g)
91
- if (d = p > 0 ? g / o(-p) : g * o(p), !(d < l)) {
92
- if (d > f) break;
93
- u.push(d);
89
+ } else for (; d <= T; ++d)
90
+ for (g = s - 1; g >= 1; --g)
91
+ if (m = d > 0 ? g / o(-d) : g * o(d), !(m < l)) {
92
+ if (m > f) break;
93
+ u.push(m);
94
94
  }
95
95
  u.length * 2 < D && (u = q(l, f, D));
96
96
  } else
97
- u = q(p, v, Math.min(v - p, D)).map(o);
97
+ u = q(d, T, Math.min(T - d, D)).map(o);
98
98
  return y ? u.reverse() : u;
99
99
  }, t.tickFormat = (r, h) => {
100
- if (r == null && (r = 10), h == null && (h = n === 10 ? "s" : ","), typeof h != "function" && (!(n % 1) && (h = Kt(h)).precision == null && (h.trim = !0), h = qt(h)), r === 1 / 0) return h;
101
- const l = Math.max(1, n * r / t.ticks().length);
100
+ if (r == null && (r = 10), h == null && (h = s === 10 ? "s" : ","), typeof h != "function" && (!(s % 1) && (h = Kt(h)).precision == null && (h.trim = !0), h = qt(h)), r === 1 / 0) return h;
101
+ const l = Math.max(1, s * r / t.ticks().length);
102
102
  return (f) => {
103
- let y = f / o(Math.round(s(f)));
104
- return y * n < n - 0.5 && (y *= n), y <= l ? h(f) : "";
103
+ let y = f / o(Math.round(e(f)));
104
+ return y * s < s - 0.5 && (y *= s), y <= l ? h(f) : "";
105
105
  };
106
- }, t.nice = () => e(ii(e(), {
107
- floor: (r) => o(Math.floor(s(r))),
108
- ceil: (r) => o(Math.ceil(s(r)))
106
+ }, t.nice = () => n(ii(n(), {
107
+ floor: (r) => o(Math.floor(e(r))),
108
+ ceil: (r) => o(Math.ceil(e(r)))
109
109
  })), t;
110
110
  }
111
111
  function xt() {
112
112
  const i = Di(Gt()).domain([1, 10]);
113
113
  return i.copy = () => $t(i, xt()).base(i.base()), Ut.apply(i, arguments), i;
114
114
  }
115
- function k(i, t, e) {
115
+ function k(i, t, n) {
116
116
  i._context.bezierCurveTo(
117
117
  (2 * i._x0 + i._x1) / 3,
118
118
  (2 * i._y0 + i._y1) / 3,
119
119
  (i._x0 + 2 * i._x1) / 3,
120
120
  (i._y0 + 2 * i._y1) / 3,
121
121
  (i._x0 + 4 * i._x1 + t) / 6,
122
- (i._y0 + 4 * i._y1 + e) / 6
122
+ (i._y0 + 4 * i._y1 + n) / 6
123
123
  );
124
124
  }
125
125
  function L(i) {
@@ -164,15 +164,15 @@ L.prototype = {
164
164
  this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = t;
165
165
  }
166
166
  };
167
- function Ai(i) {
167
+ function Oi(i) {
168
168
  return new L(i);
169
169
  }
170
170
  function gt(i) {
171
171
  this._context = i;
172
172
  }
173
173
  gt.prototype = {
174
- areaStart: O,
175
- areaEnd: O,
174
+ areaStart: A,
175
+ areaEnd: A,
176
176
  lineStart: function() {
177
177
  this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN, this._point = 0;
178
178
  },
@@ -210,7 +210,7 @@ gt.prototype = {
210
210
  this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = t;
211
211
  }
212
212
  };
213
- function Oi(i) {
213
+ function Ai(i) {
214
214
  return new gt(i);
215
215
  }
216
216
  function yt(i) {
@@ -239,8 +239,8 @@ yt.prototype = {
239
239
  break;
240
240
  case 2:
241
241
  this._point = 3;
242
- var e = (this._x0 + 4 * this._x1 + i) / 6, n = (this._y0 + 4 * this._y1 + t) / 6;
243
- this._line ? this._context.lineTo(e, n) : this._context.moveTo(e, n);
242
+ var n = (this._x0 + 4 * this._x1 + i) / 6, s = (this._y0 + 4 * this._y1 + t) / 6;
243
+ this._line ? this._context.lineTo(n, s) : this._context.moveTo(n, s);
244
244
  break;
245
245
  case 3:
246
246
  this._point = 4;
@@ -263,12 +263,12 @@ vt.prototype = {
263
263
  this._x = [], this._y = [], this._basis.lineStart();
264
264
  },
265
265
  lineEnd: function() {
266
- var i = this._x, t = this._y, e = i.length - 1;
267
- if (e > 0)
268
- for (var n = i[0], s = t[0], o = i[e] - n, a = t[e] - s, r = -1, h; ++r <= e; )
269
- h = r / e, this._basis.point(
270
- this._beta * i[r] + (1 - this._beta) * (n + h * o),
271
- this._beta * t[r] + (1 - this._beta) * (s + h * a)
266
+ var i = this._x, t = this._y, n = i.length - 1;
267
+ if (n > 0)
268
+ for (var s = i[0], e = t[0], o = i[n] - s, a = t[n] - e, r = -1, h; ++r <= n; )
269
+ h = r / n, this._basis.point(
270
+ this._beta * i[r] + (1 - this._beta) * (s + h * o),
271
+ this._beta * t[r] + (1 - this._beta) * (e + h * a)
272
272
  );
273
273
  this._x = this._y = null, this._basis.lineEnd();
274
274
  },
@@ -277,19 +277,19 @@ vt.prototype = {
277
277
  }
278
278
  };
279
279
  const bi = function i(t) {
280
- function e(n) {
281
- return t === 1 ? new L(n) : new vt(n, t);
280
+ function n(s) {
281
+ return t === 1 ? new L(s) : new vt(s, t);
282
282
  }
283
- return e.beta = function(n) {
284
- return i(+n);
285
- }, e;
283
+ return n.beta = function(s) {
284
+ return i(+s);
285
+ }, n;
286
286
  }(0.85);
287
- function R(i, t, e) {
287
+ function R(i, t, n) {
288
288
  i._context.bezierCurveTo(
289
289
  i._x1 + i._k * (i._x2 - i._x0),
290
290
  i._y1 + i._k * (i._y2 - i._y0),
291
291
  i._x2 + i._k * (i._x1 - t),
292
- i._y2 + i._k * (i._y1 - e),
292
+ i._y2 + i._k * (i._y1 - n),
293
293
  i._x2,
294
294
  i._y2
295
295
  );
@@ -337,19 +337,19 @@ z.prototype = {
337
337
  }
338
338
  };
339
339
  const Si = function i(t) {
340
- function e(n) {
341
- return new z(n, t);
340
+ function n(s) {
341
+ return new z(s, t);
342
342
  }
343
- return e.tension = function(n) {
344
- return i(+n);
345
- }, e;
343
+ return n.tension = function(s) {
344
+ return i(+s);
345
+ }, n;
346
346
  }(0);
347
347
  function V(i, t) {
348
348
  this._context = i, this._k = (1 - t) / 6;
349
349
  }
350
350
  V.prototype = {
351
- areaStart: O,
352
- areaEnd: O,
351
+ areaStart: A,
352
+ areaEnd: A,
353
353
  lineStart: function() {
354
354
  this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._point = 0;
355
355
  },
@@ -388,12 +388,12 @@ V.prototype = {
388
388
  }
389
389
  };
390
390
  const Pi = function i(t) {
391
- function e(n) {
392
- return new V(n, t);
391
+ function n(s) {
392
+ return new V(s, t);
393
393
  }
394
- return e.tension = function(n) {
395
- return i(+n);
396
- }, e;
394
+ return n.tension = function(s) {
395
+ return i(+s);
396
+ }, n;
397
397
  }(0);
398
398
  function H(i, t) {
399
399
  this._context = i, this._k = (1 - t) / 6;
@@ -433,24 +433,24 @@ H.prototype = {
433
433
  }
434
434
  };
435
435
  const Ei = function i(t) {
436
- function e(n) {
437
- return new H(n, t);
436
+ function n(s) {
437
+ return new H(s, t);
438
438
  }
439
- return e.tension = function(n) {
440
- return i(+n);
441
- }, e;
439
+ return n.tension = function(s) {
440
+ return i(+s);
441
+ }, n;
442
442
  }(0);
443
- function Y(i, t, e) {
444
- var n = i._x1, s = i._y1, o = i._x2, a = i._y2;
443
+ function Y(i, t, n) {
444
+ var s = i._x1, e = i._y1, o = i._x2, a = i._y2;
445
445
  if (i._l01_a > Q) {
446
446
  var r = 2 * i._l01_2a + 3 * i._l01_a * i._l12_a + i._l12_2a, h = 3 * i._l01_a * (i._l01_a + i._l12_a);
447
- n = (n * r - i._x0 * i._l12_2a + i._x2 * i._l01_2a) / h, s = (s * r - i._y0 * i._l12_2a + i._y2 * i._l01_2a) / h;
447
+ s = (s * r - i._x0 * i._l12_2a + i._x2 * i._l01_2a) / h, e = (e * r - i._y0 * i._l12_2a + i._y2 * i._l01_2a) / h;
448
448
  }
449
449
  if (i._l23_a > Q) {
450
450
  var l = 2 * i._l23_2a + 3 * i._l23_a * i._l12_a + i._l12_2a, f = 3 * i._l23_a * (i._l23_a + i._l12_a);
451
- o = (o * l + i._x1 * i._l23_2a - t * i._l12_2a) / f, a = (a * l + i._y1 * i._l23_2a - e * i._l12_2a) / f;
451
+ o = (o * l + i._x1 * i._l23_2a - t * i._l12_2a) / f, a = (a * l + i._y1 * i._l23_2a - n * i._l12_2a) / f;
452
452
  }
453
- i._context.bezierCurveTo(n, s, o, a, i._x2, i._y2);
453
+ i._context.bezierCurveTo(s, e, o, a, i._x2, i._y2);
454
454
  }
455
455
  function Tt(i, t) {
456
456
  this._context = i, this._alpha = t;
@@ -478,8 +478,8 @@ Tt.prototype = {
478
478
  },
479
479
  point: function(i, t) {
480
480
  if (i = +i, t = +t, this._point) {
481
- var e = this._x2 - i, n = this._y2 - t;
482
- this._l23_a = Math.sqrt(this._l23_2a = Math.pow(e * e + n * n, this._alpha));
481
+ var n = this._x2 - i, s = this._y2 - t;
482
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(n * n + s * s, this._alpha));
483
483
  }
484
484
  switch (this._point) {
485
485
  case 0:
@@ -499,19 +499,19 @@ Tt.prototype = {
499
499
  }
500
500
  };
501
501
  const wi = function i(t) {
502
- function e(n) {
503
- return t ? new Tt(n, t) : new z(n, 0);
502
+ function n(s) {
503
+ return t ? new Tt(s, t) : new z(s, 0);
504
504
  }
505
- return e.alpha = function(n) {
506
- return i(+n);
507
- }, e;
505
+ return n.alpha = function(s) {
506
+ return i(+s);
507
+ }, n;
508
508
  }(0.5);
509
509
  function Dt(i, t) {
510
510
  this._context = i, this._alpha = t;
511
511
  }
512
512
  Dt.prototype = {
513
- areaStart: O,
514
- areaEnd: O,
513
+ areaStart: A,
514
+ areaEnd: A,
515
515
  lineStart: function() {
516
516
  this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
517
517
  },
@@ -533,8 +533,8 @@ Dt.prototype = {
533
533
  },
534
534
  point: function(i, t) {
535
535
  if (i = +i, t = +t, this._point) {
536
- var e = this._x2 - i, n = this._y2 - t;
537
- this._l23_a = Math.sqrt(this._l23_2a = Math.pow(e * e + n * n, this._alpha));
536
+ var n = this._x2 - i, s = this._y2 - t;
537
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(n * n + s * s, this._alpha));
538
538
  }
539
539
  switch (this._point) {
540
540
  case 0:
@@ -554,17 +554,17 @@ Dt.prototype = {
554
554
  }
555
555
  };
556
556
  const ki = function i(t) {
557
- function e(n) {
558
- return t ? new Dt(n, t) : new V(n, 0);
557
+ function n(s) {
558
+ return t ? new Dt(s, t) : new V(s, 0);
559
559
  }
560
- return e.alpha = function(n) {
561
- return i(+n);
562
- }, e;
560
+ return n.alpha = function(s) {
561
+ return i(+s);
562
+ }, n;
563
563
  }(0.5);
564
- function At(i, t) {
564
+ function Ot(i, t) {
565
565
  this._context = i, this._alpha = t;
566
566
  }
567
- At.prototype = {
567
+ Ot.prototype = {
568
568
  areaStart: function() {
569
569
  this._line = 0;
570
570
  },
@@ -579,8 +579,8 @@ At.prototype = {
579
579
  },
580
580
  point: function(i, t) {
581
581
  if (i = +i, t = +t, this._point) {
582
- var e = this._x2 - i, n = this._y2 - t;
583
- this._l23_a = Math.sqrt(this._l23_2a = Math.pow(e * e + n * n, this._alpha));
582
+ var n = this._x2 - i, s = this._y2 - t;
583
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(n * n + s * s, this._alpha));
584
584
  }
585
585
  switch (this._point) {
586
586
  case 0:
@@ -603,27 +603,27 @@ At.prototype = {
603
603
  }
604
604
  };
605
605
  const Ri = function i(t) {
606
- function e(n) {
607
- return t ? new At(n, t) : new H(n, 0);
606
+ function n(s) {
607
+ return t ? new Ot(s, t) : new H(s, 0);
608
608
  }
609
- return e.alpha = function(n) {
610
- return i(+n);
611
- }, e;
609
+ return n.alpha = function(s) {
610
+ return i(+s);
611
+ }, n;
612
612
  }(0.5);
613
- function nt(i) {
613
+ function st(i) {
614
614
  return i < 0 ? -1 : 1;
615
615
  }
616
- function st(i, t, e) {
617
- var n = i._x1 - i._x0, s = t - i._x1, o = (i._y1 - i._y0) / (n || s < 0 && -0), a = (e - i._y1) / (s || n < 0 && -0), r = (o * s + a * n) / (n + s);
618
- return (nt(o) + nt(a)) * Math.min(Math.abs(o), Math.abs(a), 0.5 * Math.abs(r)) || 0;
616
+ function et(i, t, n) {
617
+ var s = i._x1 - i._x0, e = t - i._x1, o = (i._y1 - i._y0) / (s || e < 0 && -0), a = (n - i._y1) / (e || s < 0 && -0), r = (o * e + a * s) / (s + e);
618
+ return (st(o) + st(a)) * Math.min(Math.abs(o), Math.abs(a), 0.5 * Math.abs(r)) || 0;
619
619
  }
620
620
  function ot(i, t) {
621
- var e = i._x1 - i._x0;
622
- return e ? (3 * (i._y1 - i._y0) / e - t) / 2 : t;
621
+ var n = i._x1 - i._x0;
622
+ return n ? (3 * (i._y1 - i._y0) / n - t) / 2 : t;
623
623
  }
624
- function I(i, t, e) {
625
- var n = i._x0, s = i._y0, o = i._x1, a = i._y1, r = (o - n) / 3;
626
- i._context.bezierCurveTo(n + r, s + r * t, o - r, a - r * e, o, a);
624
+ function I(i, t, n) {
625
+ var s = i._x0, e = i._y0, o = i._x1, a = i._y1, r = (o - s) / 3;
626
+ i._context.bezierCurveTo(s + r, e + r * t, o - r, a - r * n, o, a);
627
627
  }
628
628
  function B(i) {
629
629
  this._context = i;
@@ -650,7 +650,7 @@ B.prototype = {
650
650
  (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
651
651
  },
652
652
  point: function(i, t) {
653
- var e = NaN;
653
+ var n = NaN;
654
654
  if (i = +i, t = +t, !(i === this._x1 && t === this._y1)) {
655
655
  switch (this._point) {
656
656
  case 0:
@@ -660,20 +660,20 @@ B.prototype = {
660
660
  this._point = 2;
661
661
  break;
662
662
  case 2:
663
- this._point = 3, I(this, ot(this, e = st(this, i, t)), e);
663
+ this._point = 3, I(this, ot(this, n = et(this, i, t)), n);
664
664
  break;
665
665
  default:
666
- I(this, this._t0, e = st(this, i, t));
666
+ I(this, this._t0, n = et(this, i, t));
667
667
  break;
668
668
  }
669
- this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = t, this._t0 = e;
669
+ this._x0 = this._x1, this._x1 = i, this._y0 = this._y1, this._y1 = t, this._t0 = n;
670
670
  }
671
671
  }
672
672
  };
673
- function Ot(i) {
673
+ function At(i) {
674
674
  this._context = new Mt(i);
675
675
  }
676
- (Ot.prototype = Object.create(B.prototype)).point = function(i, t) {
676
+ (At.prototype = Object.create(B.prototype)).point = function(i, t) {
677
677
  B.prototype.point.call(this, t, i);
678
678
  };
679
679
  function Mt(i) {
@@ -689,15 +689,15 @@ Mt.prototype = {
689
689
  lineTo: function(i, t) {
690
690
  this._context.lineTo(t, i);
691
691
  },
692
- bezierCurveTo: function(i, t, e, n, s, o) {
693
- this._context.bezierCurveTo(t, i, n, e, o, s);
692
+ bezierCurveTo: function(i, t, n, s, e, o) {
693
+ this._context.bezierCurveTo(t, i, s, n, o, e);
694
694
  }
695
695
  };
696
696
  function Bi(i) {
697
697
  return new B(i);
698
698
  }
699
699
  function Li(i) {
700
- return new Ot(i);
700
+ return new At(i);
701
701
  }
702
702
  function bt(i) {
703
703
  this._context = i;
@@ -713,26 +713,26 @@ bt.prototype = {
713
713
  this._x = [], this._y = [];
714
714
  },
715
715
  lineEnd: function() {
716
- var i = this._x, t = this._y, e = i.length;
717
- if (e)
718
- if (this._line ? this._context.lineTo(i[0], t[0]) : this._context.moveTo(i[0], t[0]), e === 2)
716
+ var i = this._x, t = this._y, n = i.length;
717
+ if (n)
718
+ if (this._line ? this._context.lineTo(i[0], t[0]) : this._context.moveTo(i[0], t[0]), n === 2)
719
719
  this._context.lineTo(i[1], t[1]);
720
720
  else
721
- for (var n = at(i), s = at(t), o = 0, a = 1; a < e; ++o, ++a)
722
- this._context.bezierCurveTo(n[0][o], s[0][o], n[1][o], s[1][o], i[a], t[a]);
723
- (this._line || this._line !== 0 && e === 1) && this._context.closePath(), this._line = 1 - this._line, this._x = this._y = null;
721
+ for (var s = at(i), e = at(t), o = 0, a = 1; a < n; ++o, ++a)
722
+ this._context.bezierCurveTo(s[0][o], e[0][o], s[1][o], e[1][o], i[a], t[a]);
723
+ (this._line || this._line !== 0 && n === 1) && this._context.closePath(), this._line = 1 - this._line, this._x = this._y = null;
724
724
  },
725
725
  point: function(i, t) {
726
726
  this._x.push(+i), this._y.push(+t);
727
727
  }
728
728
  };
729
729
  function at(i) {
730
- var t, e = i.length - 1, n, s = new Array(e), o = new Array(e), a = new Array(e);
731
- for (s[0] = 0, o[0] = 2, a[0] = i[0] + 2 * i[1], t = 1; t < e - 1; ++t) s[t] = 1, o[t] = 4, a[t] = 4 * i[t] + 2 * i[t + 1];
732
- for (s[e - 1] = 2, o[e - 1] = 7, a[e - 1] = 8 * i[e - 1] + i[e], t = 1; t < e; ++t) n = s[t] / o[t - 1], o[t] -= n, a[t] -= n * a[t - 1];
733
- for (s[e - 1] = a[e - 1] / o[e - 1], t = e - 2; t >= 0; --t) s[t] = (a[t] - s[t + 1]) / o[t];
734
- for (o[e - 1] = (i[e] + s[e - 1]) / 2, t = 0; t < e - 1; ++t) o[t] = 2 * i[t + 1] - s[t + 1];
735
- return [s, o];
730
+ var t, n = i.length - 1, s, e = new Array(n), o = new Array(n), a = new Array(n);
731
+ for (e[0] = 0, o[0] = 2, a[0] = i[0] + 2 * i[1], t = 1; t < n - 1; ++t) e[t] = 1, o[t] = 4, a[t] = 4 * i[t] + 2 * i[t + 1];
732
+ for (e[n - 1] = 2, o[n - 1] = 7, a[n - 1] = 8 * i[n - 1] + i[n], t = 1; t < n; ++t) s = e[t] / o[t - 1], o[t] -= s, a[t] -= s * a[t - 1];
733
+ for (e[n - 1] = a[n - 1] / o[n - 1], t = n - 2; t >= 0; --t) e[t] = (a[t] - e[t + 1]) / o[t];
734
+ for (o[n - 1] = (i[n] + e[n - 1]) / 2, t = 0; t < n - 1; ++t) o[t] = 2 * i[t + 1] - e[t + 1];
735
+ return [e, o];
736
736
  }
737
737
  function Ni(i) {
738
738
  return new bt(i);
@@ -765,8 +765,8 @@ N.prototype = {
765
765
  if (this._t <= 0)
766
766
  this._context.lineTo(this._x, t), this._context.lineTo(i, t);
767
767
  else {
768
- var e = this._x * (1 - this._t) + i * this._t;
769
- this._context.lineTo(e, this._y), this._context.lineTo(e, t);
768
+ var n = this._x * (1 - this._t) + i * this._t;
769
+ this._context.lineTo(n, this._y), this._context.lineTo(n, t);
770
770
  }
771
771
  break;
772
772
  }
@@ -783,91 +783,90 @@ function Ii(i) {
783
783
  function Zi(i) {
784
784
  return new N(i, 1);
785
785
  }
786
- class ne extends A {
786
+ class en extends O {
787
787
  /**
788
788
  * focal: object to zoom into
789
789
  * canvasElements: all the elements to translate and zoom on the chart area
790
790
  * zoomSettings: object containing duration, easing and zoomlevel for the zoom behaviours
791
791
  * */
792
- zoomIn(t, e, n) {
793
- let s, o, a;
794
- const r = n || j;
795
- t && (s = t.x, o = t.y, a = 2);
796
- const { width: h, height: l } = ei.getSVGElementSize(this.services.domUtils.getHolder(), {
792
+ zoomIn(t, n, s) {
793
+ let e, o, a;
794
+ const r = s || j;
795
+ t && (e = t.x, o = t.y, a = 2);
796
+ const { width: h, height: l } = ni.getSVGElementSize(this.services.domUtils.getHolder(), {
797
797
  useClientDimensions: !0
798
798
  });
799
- e.transition().duration(r.duration).ease(r.ease).attr(
799
+ n.transition().duration(r.duration).ease(r.ease).attr(
800
800
  "transform",
801
- `translate(${h / 2}, ${l / 2}) scale(${a}) translate(${-s},${-o})`
801
+ `translate(${h / 2}, ${l / 2}) scale(${a}) translate(${-e},${-o})`
802
802
  ), this.services.events.dispatchEvent(w.CanvasZoom.CANVAS_ZOOM_IN, {
803
- element: ni(t)
803
+ element: si(t)
804
804
  });
805
805
  }
806
- zoomOut(t, e) {
807
- const n = e || j;
808
- t.transition().duration(n.duration).ease(n.ease).attr("transform", ""), this.services.events.dispatchEvent(w.CanvasZoom.CANVAS_ZOOM_OUT);
806
+ zoomOut(t, n) {
807
+ const s = n || j;
808
+ t.transition().duration(s.duration).ease(s.ease).attr("transform", ""), this.services.events.dispatchEvent(w.CanvasZoom.CANVAS_ZOOM_OUT);
809
809
  }
810
810
  }
811
- class se extends A {
811
+ class on extends O {
812
812
  init() {
813
813
  this.documentFragment = document.createDocumentFragment();
814
814
  }
815
- addEventListener(t, e) {
816
- this.documentFragment.addEventListener(t, e);
815
+ addEventListener(t, n) {
816
+ this.documentFragment.addEventListener(t, n);
817
817
  }
818
- removeEventListener(t, e) {
819
- this.documentFragment.removeEventListener(t, e);
818
+ removeEventListener(t, n) {
819
+ this.documentFragment.removeEventListener(t, n);
820
820
  }
821
- dispatchEvent(t, e) {
822
- let n;
823
- e ? n = new CustomEvent(t, {
824
- detail: e
825
- }) : (n = document.createEvent("Event"), n.initEvent(t, !1, !0)), this.documentFragment.dispatchEvent(n);
821
+ dispatchEvent(t, n) {
822
+ let s;
823
+ n ? s = new CustomEvent(t, {
824
+ detail: n
825
+ }) : (s = document.createEvent("Event"), s.initEvent(t, !1, !0)), this.documentFragment.dispatchEvent(s);
826
826
  }
827
827
  }
828
- class oe extends A {
829
- constructor(t, e) {
830
- super(t, e);
828
+ class an extends O {
829
+ constructor(t, n) {
830
+ super(t, n);
831
831
  }
832
- downloadCSV(t, e) {
833
- const n = document.createElement("a"), s = "text/csv;encoding:utf-8";
832
+ downloadCSV(t, n) {
833
+ const s = document.createElement("a"), e = "text/csv;encoding:utf-8";
834
834
  if (navigator.msSaveBlob)
835
835
  navigator.msSaveBlob(
836
836
  new Blob([t], {
837
- type: s
837
+ type: e
838
838
  }),
839
- e
839
+ n
840
840
  );
841
- else if (URL && "download" in n) {
841
+ else if (URL && "download" in s) {
842
842
  const o = URL.createObjectURL(
843
843
  new Blob([t], {
844
- type: s
844
+ type: e
845
845
  })
846
846
  );
847
- n.href = o, n.setAttribute("download", e), document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(o);
847
+ s.href = o, s.setAttribute("download", n), document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(o);
848
848
  } else
849
849
  location.href = `data:application/octet-stream,${encodeURIComponent(t)}`;
850
850
  }
851
- downloadImage(t, e) {
852
- const n = document.createElement("a");
853
- n.download = e, n.href = t, document.body.appendChild(n), n.click(), document.body.removeChild(n);
851
+ downloadImage(t, n) {
852
+ const s = document.createElement("a");
853
+ s.download = n, s.href = t, document.body.appendChild(s), s.click(), document.body.removeChild(s);
854
854
  }
855
855
  }
856
- class ae extends A {
856
+ class rn extends O {
857
857
  constructor() {
858
858
  super(...arguments), this.pendingTransitions = {};
859
859
  }
860
860
  init() {
861
- var t;
862
- (t = this.services.events) == null || t.addEventListener(w.Model.UPDATE, () => {
861
+ this.services.events?.addEventListener(w.Model.UPDATE, () => {
863
862
  this.pendingTransitions = {};
864
863
  });
865
864
  }
866
- setupTransition({ transition: t, name: e, animate: n }) {
865
+ setupTransition({ transition: t, name: n, animate: s }) {
867
866
  return this.pendingTransitions[t._id] = t, t.on("end interrupt cancel", () => {
868
867
  delete this.pendingTransitions[t._id];
869
- }), this.model.getOptions().animations === !1 || n === !1 ? t.duration(0) : t.duration(
870
- c(W, e, "duration") || W.default.duration
868
+ }), this.model.getOptions().animations === !1 || s === !1 ? t.duration(0) : t.duration(
869
+ c(W, n, "duration") || W.default.duration
871
870
  );
872
871
  }
873
872
  getPendingTransitions() {
@@ -875,157 +874,157 @@ class ae extends A {
875
874
  }
876
875
  }
877
876
  function S(i, t) {
878
- const e = +T(i) - +T(t);
879
- return e < 0 ? -1 : e > 0 ? 1 : e;
877
+ const n = +v(i) - +v(t);
878
+ return n < 0 ? -1 : n > 0 ? 1 : n;
880
879
  }
881
- function Fi(i, t, e) {
882
- const [n, s] = M(
883
- e == null ? void 0 : e.in,
880
+ function Fi(i, t, n) {
881
+ const [s, e] = M(
882
+ n?.in,
884
883
  i,
885
884
  t
886
885
  );
887
- return n.getFullYear() - s.getFullYear();
886
+ return s.getFullYear() - e.getFullYear();
888
887
  }
889
- function zi(i, t, e) {
890
- const [n, s] = M(
891
- e == null ? void 0 : e.in,
888
+ function zi(i, t, n) {
889
+ const [s, e] = M(
890
+ n?.in,
892
891
  i,
893
892
  t
894
- ), o = S(n, s), a = Math.abs(Fi(n, s));
895
- n.setFullYear(1584), s.setFullYear(1584);
896
- const r = S(n, s) === -o, h = o * (a - +r);
893
+ ), o = S(s, e), a = Math.abs(Fi(s, e));
894
+ s.setFullYear(1584), e.setFullYear(1584);
895
+ const r = S(s, e) === -o, h = o * (a - +r);
897
896
  return h === 0 ? 0 : h;
898
897
  }
899
- function X(i, t, e) {
900
- const n = T(i, e == null ? void 0 : e.in);
898
+ function X(i, t, n) {
899
+ const s = v(i, n?.in);
901
900
  if (isNaN(t)) return E(i, NaN);
902
901
  if (!t)
903
- return n;
904
- const s = n.getDate(), o = E(i, n.getTime());
905
- o.setMonth(n.getMonth() + t + 1, 0);
902
+ return s;
903
+ const e = s.getDate(), o = E(i, s.getTime());
904
+ o.setMonth(s.getMonth() + t + 1, 0);
906
905
  const a = o.getDate();
907
- return s >= a ? o : (n.setFullYear(
906
+ return e >= a ? o : (s.setFullYear(
908
907
  o.getFullYear(),
909
908
  o.getMonth(),
910
- s
911
- ), n);
909
+ e
910
+ ), s);
912
911
  }
913
- function St(i, t, e) {
914
- return X(i, t * 12, e);
912
+ function St(i, t, n) {
913
+ return X(i, t * 12, n);
915
914
  }
916
- function Vi(i, t, e) {
917
- return St(i, -t, e);
915
+ function Vi(i, t, n) {
916
+ return St(i, -t, n);
918
917
  }
919
- function Hi(i, t, e) {
920
- const [n, s] = M(
921
- e == null ? void 0 : e.in,
918
+ function Hi(i, t, n) {
919
+ const [s, e] = M(
920
+ n?.in,
922
921
  i,
923
922
  t
924
- ), o = n.getFullYear() - s.getFullYear(), a = n.getMonth() - s.getMonth();
923
+ ), o = s.getFullYear() - e.getFullYear(), a = s.getMonth() - e.getMonth();
925
924
  return o * 12 + a;
926
925
  }
927
926
  function Yi(i, t) {
928
- const e = T(i, t == null ? void 0 : t.in);
929
- return e.setHours(23, 59, 59, 999), e;
927
+ const n = v(i, t?.in);
928
+ return n.setHours(23, 59, 59, 999), n;
930
929
  }
931
930
  function Xi(i, t) {
932
- const e = T(i, t == null ? void 0 : t.in), n = e.getMonth();
933
- return e.setFullYear(e.getFullYear(), n + 1, 0), e.setHours(23, 59, 59, 999), e;
931
+ const n = v(i, t?.in), s = n.getMonth();
932
+ return n.setFullYear(n.getFullYear(), s + 1, 0), n.setHours(23, 59, 59, 999), n;
934
933
  }
935
934
  function Gi(i, t) {
936
- const e = T(i, t == null ? void 0 : t.in);
937
- return +Yi(e, t) == +Xi(e, t);
935
+ const n = v(i, t?.in);
936
+ return +Yi(n, t) == +Xi(n, t);
938
937
  }
939
- function $i(i, t, e) {
940
- const [n, s, o] = M(
941
- e == null ? void 0 : e.in,
938
+ function $i(i, t, n) {
939
+ const [s, e, o] = M(
940
+ n?.in,
942
941
  i,
943
942
  i,
944
943
  t
945
- ), a = S(s, o), r = Math.abs(
946
- Hi(s, o)
944
+ ), a = S(e, o), r = Math.abs(
945
+ Hi(e, o)
947
946
  );
948
947
  if (r < 1) return 0;
949
- s.getMonth() === 1 && s.getDate() > 27 && s.setDate(30), s.setMonth(s.getMonth() - a * r);
950
- let h = S(s, o) === -a;
951
- Gi(n) && r === 1 && S(n, o) === 1 && (h = !1);
948
+ e.getMonth() === 1 && e.getDate() > 27 && e.setDate(30), e.setMonth(e.getMonth() - a * r);
949
+ let h = S(e, o) === -a;
950
+ Gi(s) && r === 1 && S(s, o) === 1 && (h = !1);
952
951
  const l = a * (r - +h);
953
952
  return l === 0 ? 0 : l;
954
953
  }
955
- function Ui(i, t, e) {
956
- return X(i, -t, e);
954
+ function Ui(i, t, n) {
955
+ return X(i, -t, n);
957
956
  }
958
- function Ki(i, t, e) {
959
- const [n, s] = M(
960
- e == null ? void 0 : e.in,
957
+ function Ki(i, t, n) {
958
+ const [s, e] = M(
959
+ n?.in,
961
960
  i,
962
961
  t
963
- ), o = rt(n, s), a = Math.abs(
964
- jt(n, s)
962
+ ), o = rt(s, e), a = Math.abs(
963
+ jt(s, e)
965
964
  );
966
- n.setDate(n.getDate() - o * a);
967
- const r = +(rt(n, s) === -o), h = o * (a - r);
965
+ s.setDate(s.getDate() - o * a);
966
+ const r = +(rt(s, e) === -o), h = o * (a - r);
968
967
  return h === 0 ? 0 : h;
969
968
  }
970
969
  function rt(i, t) {
971
- const e = i.getFullYear() - t.getFullYear() || i.getMonth() - t.getMonth() || i.getDate() - t.getDate() || i.getHours() - t.getHours() || i.getMinutes() - t.getMinutes() || i.getSeconds() - t.getSeconds() || i.getMilliseconds() - t.getMilliseconds();
972
- return e < 0 ? -1 : e > 0 ? 1 : e;
970
+ const n = i.getFullYear() - t.getFullYear() || i.getMonth() - t.getMonth() || i.getDate() - t.getDate() || i.getHours() - t.getHours() || i.getMinutes() - t.getMinutes() || i.getSeconds() - t.getSeconds() || i.getMilliseconds() - t.getMilliseconds();
971
+ return n < 0 ? -1 : n > 0 ? 1 : n;
973
972
  }
974
- function Pt(i, t, e) {
975
- const n = T(i, e == null ? void 0 : e.in);
976
- return isNaN(t) ? E(i, NaN) : (t && n.setDate(n.getDate() + t), n);
973
+ function Pt(i, t, n) {
974
+ const s = v(i, n?.in);
975
+ return isNaN(t) ? E(i, NaN) : (t && s.setDate(s.getDate() + t), s);
977
976
  }
978
- function qi(i, t, e) {
979
- return Pt(i, -t, e);
977
+ function qi(i, t, n) {
978
+ return Pt(i, -t, n);
980
979
  }
981
980
  function G(i) {
982
981
  return (t) => {
983
- const n = (i ? Math[i] : Math.trunc)(t);
984
- return n === 0 ? 0 : n;
982
+ const s = (i ? Math[i] : Math.trunc)(t);
983
+ return s === 0 ? 0 : s;
985
984
  };
986
985
  }
987
- function ji(i, t, e) {
988
- const [n, s] = M(
989
- e == null ? void 0 : e.in,
986
+ function ji(i, t, n) {
987
+ const [s, e] = M(
988
+ n?.in,
990
989
  i,
991
990
  t
992
- ), o = (+n - +s) / ft;
993
- return G(e == null ? void 0 : e.roundingMethod)(o);
991
+ ), o = (+s - +e) / ft;
992
+ return G(n?.roundingMethod)(o);
994
993
  }
995
- function Et(i, t, e) {
996
- return E(i, +T(i) + t);
994
+ function Et(i, t, n) {
995
+ return E(i, +v(i) + t);
997
996
  }
998
- function wt(i, t, e) {
997
+ function wt(i, t, n) {
999
998
  return Et(i, t * ft);
1000
999
  }
1001
- function Wi(i, t, e) {
1000
+ function Wi(i, t, n) {
1002
1001
  return wt(i, -t);
1003
1002
  }
1004
1003
  function kt(i, t) {
1005
- return +T(i) - +T(t);
1004
+ return +v(i) - +v(t);
1006
1005
  }
1007
- function ht(i, t, e) {
1008
- const n = kt(i, t) / mt;
1009
- return G(e == null ? void 0 : e.roundingMethod)(n);
1006
+ function ht(i, t, n) {
1007
+ const s = kt(i, t) / pt;
1008
+ return G(n?.roundingMethod)(s);
1010
1009
  }
1011
- function Z(i, t, e) {
1012
- const n = T(i, e == null ? void 0 : e.in);
1013
- return n.setTime(n.getTime() + t * mt), n;
1010
+ function Z(i, t, n) {
1011
+ const s = v(i, n?.in);
1012
+ return s.setTime(s.getTime() + t * pt), s;
1014
1013
  }
1015
- function ct(i, t, e) {
1016
- return Z(i, -t, e);
1014
+ function ct(i, t, n) {
1015
+ return Z(i, -t, n);
1017
1016
  }
1018
- function lt(i, t, e) {
1019
- const n = kt(i, t) / 1e3;
1020
- return G(e == null ? void 0 : e.roundingMethod)(n);
1017
+ function lt(i, t, n) {
1018
+ const s = kt(i, t) / 1e3;
1019
+ return G(n?.roundingMethod)(s);
1021
1020
  }
1022
- function F(i, t, e) {
1021
+ function F(i, t, n) {
1023
1022
  return Et(i, t * 1e3);
1024
1023
  }
1025
- function _t(i, t, e) {
1024
+ function _t(i, t, n) {
1026
1025
  return F(i, -t);
1027
1026
  }
1028
- class re extends A {
1027
+ class hn extends O {
1029
1028
  constructor() {
1030
1029
  super(...arguments), this.scaleTypes = {
1031
1030
  top: null,
@@ -1042,17 +1041,17 @@ class re extends A {
1042
1041
  }
1043
1042
  getDomainAxisPosition({ datum: t = null } = {}) {
1044
1043
  if (this.dualAxes && t) {
1045
- const e = this.model.getOptions(), { groupMapsTo: n } = e.data, s = c(e, "axes", this.secondaryDomainAxisPosition), o = t[n];
1046
- if (s != null && s.correspondingDatasets && s.correspondingDatasets.includes(o))
1044
+ const n = this.model.getOptions(), { groupMapsTo: s } = n.data, e = c(n, "axes", this.secondaryDomainAxisPosition), o = t[s];
1045
+ if (e?.correspondingDatasets && e.correspondingDatasets.includes(o))
1047
1046
  return this.secondaryDomainAxisPosition;
1048
1047
  }
1049
1048
  return this.domainAxisPosition;
1050
1049
  }
1051
- getRangeAxisPosition({ datum: t = null, groups: e = null } = {}) {
1050
+ getRangeAxisPosition({ datum: t = null, groups: n = null } = {}) {
1052
1051
  if (this.dualAxes) {
1053
- const n = this.model.getOptions(), { groupMapsTo: s } = n.data, o = c(n, "axes", this.secondaryRangeAxisPosition);
1052
+ const s = this.model.getOptions(), { groupMapsTo: e } = s.data, o = c(s, "axes", this.secondaryRangeAxisPosition);
1054
1053
  let a;
1055
- if (t !== null ? a = t[s] : e && e.length > 0 && (a = e[0]), o != null && o.correspondingDatasets && o.correspondingDatasets.includes(a))
1054
+ if (t !== null ? a = t[e] : n && n.length > 0 && (a = n[0]), o?.correspondingDatasets && o.correspondingDatasets.includes(a))
1056
1055
  return this.secondaryRangeAxisPosition;
1057
1056
  }
1058
1057
  return this.rangeAxisPosition;
@@ -1069,8 +1068,8 @@ class re extends A {
1069
1068
  return this.getAxisOptions(t);
1070
1069
  }
1071
1070
  getScaleLabel(t) {
1072
- const n = this.getAxisOptions(t).title;
1073
- return n || (t === _.BOTTOM || t === _.TOP ? "x-value" : "y-value");
1071
+ const s = this.getAxisOptions(t).title;
1072
+ return s || (t === _.BOTTOM || t === _.TOP ? "x-value" : "y-value");
1074
1073
  }
1075
1074
  getDomainLabel() {
1076
1075
  return this.getScaleLabel(this.getDomainAxisPosition());
@@ -1080,17 +1079,17 @@ class re extends A {
1080
1079
  }
1081
1080
  update() {
1082
1081
  this.determineAxisDuality(), this.findDomainAndRangeAxes(), this.determineOrientation(), Object.keys(_).map(
1083
- (e) => _[e]
1084
- ).forEach((e) => {
1085
- this.scales[e] = this.createScale(e);
1082
+ (n) => _[n]
1083
+ ).forEach((n) => {
1084
+ this.scales[n] = this.createScale(n);
1086
1085
  });
1087
1086
  }
1088
1087
  findDomainAndRangeAxes() {
1089
- const t = this.findVerticalAxesPositions(), e = this.findHorizontalAxesPositions(), n = this.findDomainAndRangeAxesPositions(
1088
+ const t = this.findVerticalAxesPositions(), n = this.findHorizontalAxesPositions(), s = this.findDomainAndRangeAxesPositions(
1090
1089
  t,
1091
- e
1090
+ n
1092
1091
  );
1093
- this.domainAxisPosition = n.primaryDomainAxisPosition, this.rangeAxisPosition = n.primaryRangeAxisPosition, this.isDualAxes() && (this.secondaryDomainAxisPosition = n.secondaryDomainAxisPosition, this.secondaryRangeAxisPosition = n.secondaryRangeAxisPosition);
1092
+ this.domainAxisPosition = s.primaryDomainAxisPosition, this.rangeAxisPosition = s.primaryRangeAxisPosition, this.isDualAxes() && (this.secondaryDomainAxisPosition = s.secondaryDomainAxisPosition, this.secondaryRangeAxisPosition = s.secondaryRangeAxisPosition);
1094
1093
  }
1095
1094
  determineOrientation() {
1096
1095
  (this.rangeAxisPosition === _.LEFT || this.rangeAxisPosition === _.RIGHT) && (this.domainAxisPosition === _.BOTTOM || this.domainAxisPosition === _.TOP) ? this.orientation = C.VERTICAL : this.orientation = C.HORIZONTAL;
@@ -1101,19 +1100,18 @@ class re extends A {
1101
1100
  // if any of the axes objects have correspondingDatasets [] asserted we flag the chart as dual axes
1102
1101
  // it does not count as dual axes if it just has another axis turned on but is not actually using it to map a dataset
1103
1102
  determineAxisDuality() {
1104
- var n, s, o, a;
1105
- const t = this.model.getOptions(), e = c(t, "axes");
1106
- ((n = e[_.LEFT]) != null && n.correspondingDatasets && e[_.RIGHT] || (s = e[_.RIGHT]) != null && s.correspondingDatasets && e[_.LEFT] || (o = e[_.TOP]) != null && o.correspondingDatasets && e[_.BOTTOM] || (a = e[_.BOTTOM]) != null && a.correspondingDatasets && e[_.TOP]) && (this.dualAxes = !0);
1103
+ const t = this.model.getOptions(), n = c(t, "axes");
1104
+ (n[_.LEFT]?.correspondingDatasets && n[_.RIGHT] || n[_.RIGHT]?.correspondingDatasets && n[_.LEFT] || n[_.TOP]?.correspondingDatasets && n[_.BOTTOM] || n[_.BOTTOM]?.correspondingDatasets && n[_.TOP]) && (this.dualAxes = !0);
1107
1105
  }
1108
1106
  getCustomDomainValuesByposition(t) {
1109
- const e = c(this.model.getOptions(), "axes", t, "domain");
1110
- if (e && !Array.isArray(e))
1107
+ const n = c(this.model.getOptions(), "axes", t, "domain");
1108
+ if (n && !Array.isArray(n))
1111
1109
  throw new Error(`Domain in ${t} axis is not a valid array`);
1112
- if (Array.isArray(e) && (this.scaleTypes[t] === m.LINEAR || this.scaleTypes[t] === m.TIME) && e.length !== 2)
1110
+ if (Array.isArray(n) && (this.scaleTypes[t] === p.LINEAR || this.scaleTypes[t] === p.TIME) && n.length !== 2)
1113
1111
  throw new Error(
1114
1112
  `There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`
1115
1113
  );
1116
- return e;
1114
+ return n;
1117
1115
  }
1118
1116
  getOrientation() {
1119
1117
  return this.orientation;
@@ -1142,14 +1140,14 @@ class re extends A {
1142
1140
  getMainXAxisPosition() {
1143
1141
  const t = [_.BOTTOM, _.TOP];
1144
1142
  return [this.domainAxisPosition, this.rangeAxisPosition].find(
1145
- (e) => t.indexOf(e) > -1
1143
+ (n) => t.indexOf(n) > -1
1146
1144
  );
1147
1145
  }
1148
1146
  // Find the main y-axis out of the 2 y-axis on the chart (when 2D axis is used)
1149
1147
  getMainYAxisPosition() {
1150
1148
  const t = [_.LEFT, _.RIGHT];
1151
1149
  return [this.domainAxisPosition, this.rangeAxisPosition].find(
1152
- (e) => t.indexOf(e) > -1
1150
+ (n) => t.indexOf(n) > -1
1153
1151
  );
1154
1152
  }
1155
1153
  getMainXScale() {
@@ -1158,14 +1156,14 @@ class re extends A {
1158
1156
  getMainYScale() {
1159
1157
  return this.scales[this.getMainYAxisPosition()];
1160
1158
  }
1161
- getValueFromScale(t, e, n, s) {
1162
- const o = this.model.getOptions(), r = c(o, "axes")[n], { mapsTo: h } = r, l = c(s, h) !== null ? s[h] : s;
1159
+ getValueFromScale(t, n, s, e) {
1160
+ const o = this.model.getOptions(), r = c(o, "axes")[s], { mapsTo: h } = r, l = c(e, h) !== null ? e[h] : e;
1163
1161
  let f;
1164
- switch (e) {
1165
- case m.LABELS:
1162
+ switch (n) {
1163
+ case p.LABELS:
1166
1164
  f = t(l) + t.step() / 2;
1167
1165
  break;
1168
- case m.TIME:
1166
+ case p.TIME:
1169
1167
  f = t(new Date(l));
1170
1168
  break;
1171
1169
  default:
@@ -1174,27 +1172,27 @@ class re extends A {
1174
1172
  return f;
1175
1173
  }
1176
1174
  getBoundedScaledValues(t) {
1177
- const { bounds: e } = this.model.getOptions(), n = this.getRangeAxisPosition({ datum: t }), s = this.scales[n], o = this.model.getOptions(), r = c(o, "axes")[n], { mapsTo: h } = r, l = t[h] !== void 0 ? t[h] : t;
1175
+ const { bounds: n } = this.model.getOptions(), s = this.getRangeAxisPosition({ datum: t }), e = this.scales[s], o = this.model.getOptions(), r = c(o, "axes")[s], { mapsTo: h } = r, l = t[h] !== void 0 ? t[h] : t;
1178
1176
  return [
1179
- s(
1180
- c(t, e.upperBoundMapsTo) !== null ? t[e.upperBoundMapsTo] : l
1177
+ e(
1178
+ c(t, n.upperBoundMapsTo) !== null ? t[n.upperBoundMapsTo] : l
1181
1179
  ),
1182
- s(
1183
- c(t, e.lowerBoundMapsTo) !== null ? t[e.lowerBoundMapsTo] : l
1180
+ e(
1181
+ c(t, n.lowerBoundMapsTo) !== null ? t[n.lowerBoundMapsTo] : l
1184
1182
  )
1185
1183
  ];
1186
1184
  }
1187
- getValueThroughAxisPosition(t, e) {
1188
- const n = this.scaleTypes[t], s = this.scales[t];
1189
- return this.getValueFromScale(s, n, t, e);
1185
+ getValueThroughAxisPosition(t, n) {
1186
+ const s = this.scaleTypes[t], e = this.scales[t];
1187
+ return this.getValueFromScale(e, s, t, n);
1190
1188
  }
1191
1189
  getDomainValue(t) {
1192
- const e = this.getDomainAxisPosition({ datum: t });
1193
- return this.getValueThroughAxisPosition(e, t);
1190
+ const n = this.getDomainAxisPosition({ datum: t });
1191
+ return this.getValueThroughAxisPosition(n, t);
1194
1192
  }
1195
1193
  getRangeValue(t) {
1196
- const e = this.getRangeAxisPosition({ datum: t });
1197
- return this.getValueThroughAxisPosition(e, t);
1194
+ const n = this.getRangeAxisPosition({ datum: t });
1195
+ return this.getValueThroughAxisPosition(n, t);
1198
1196
  }
1199
1197
  getMainXScaleType() {
1200
1198
  return this.getScaleTypeByPosition(this.getMainXAxisPosition());
@@ -1203,76 +1201,76 @@ class re extends A {
1203
1201
  return this.getScaleTypeByPosition(this.getMainYAxisPosition());
1204
1202
  }
1205
1203
  getDomainIdentifier(t) {
1206
- const e = this.model.getOptions();
1207
- return c(e, "axes", this.getDomainAxisPosition({ datum: t }), "mapsTo");
1204
+ const n = this.model.getOptions();
1205
+ return c(n, "axes", this.getDomainAxisPosition({ datum: t }), "mapsTo");
1208
1206
  }
1209
1207
  getRangeIdentifier(t) {
1210
- const e = this.model.getOptions();
1211
- return c(e, "axes", this.getRangeAxisPosition({ datum: t }), "mapsTo");
1212
- }
1213
- extendsDomain(t, e) {
1214
- const n = this.model.getOptions(), s = c(n, "axes", t);
1215
- if (s.scaleType === m.TIME) {
1216
- const o = c(n, "timeScale", "addSpaceOnEdges");
1217
- return Ji(e, o);
1208
+ const n = this.model.getOptions();
1209
+ return c(n, "axes", this.getRangeAxisPosition({ datum: t }), "mapsTo");
1210
+ }
1211
+ extendsDomain(t, n) {
1212
+ const s = this.model.getOptions(), e = c(s, "axes", t);
1213
+ if (e.scaleType === p.TIME) {
1214
+ const o = c(s, "timeScale", "addSpaceOnEdges");
1215
+ return Ji(n, o);
1218
1216
  } else
1219
- return Qi(e, J.paddingRatio, s.scaleType);
1217
+ return Qi(n, J.paddingRatio, e.scaleType);
1220
1218
  }
1221
1219
  findVerticalAxesPositions() {
1222
- const t = this.model.getOptions(), e = c(t, "axes"), n = this.isDualAxes();
1223
- return c(e, _.LEFT) === null && c(e, _.RIGHT) !== null || c(e, _.RIGHT, "main") === !0 || n && c(e, _.LEFT, "correspondingDatasets") ? {
1220
+ const t = this.model.getOptions(), n = c(t, "axes"), s = this.isDualAxes();
1221
+ return c(n, _.LEFT) === null && c(n, _.RIGHT) !== null || c(n, _.RIGHT, "main") === !0 || s && c(n, _.LEFT, "correspondingDatasets") ? {
1224
1222
  primary: _.RIGHT,
1225
1223
  secondary: _.LEFT
1226
1224
  } : { primary: _.LEFT, secondary: _.RIGHT };
1227
1225
  }
1228
1226
  findHorizontalAxesPositions() {
1229
- const t = this.model.getOptions(), e = c(t, "axes"), n = this.isDualAxes();
1230
- return c(e, _.BOTTOM) === null && c(e, _.TOP) !== null || c(e, _.TOP, "main") === !0 || n && c(e, _.BOTTOM, "correspondingDatasets") ? {
1227
+ const t = this.model.getOptions(), n = c(t, "axes"), s = this.isDualAxes();
1228
+ return c(n, _.BOTTOM) === null && c(n, _.TOP) !== null || c(n, _.TOP, "main") === !0 || s && c(n, _.BOTTOM, "correspondingDatasets") ? {
1231
1229
  primary: _.TOP,
1232
1230
  secondary: _.BOTTOM
1233
1231
  } : { primary: _.BOTTOM, secondary: _.TOP };
1234
1232
  }
1235
- findDomainAndRangeAxesPositions(t, e) {
1236
- const n = this.model.getOptions(), s = c(n, "axes", t.primary), o = c(n, "axes", e.primary), a = s.scaleType || m.LINEAR, r = o.scaleType || m.LINEAR, h = {
1233
+ findDomainAndRangeAxesPositions(t, n) {
1234
+ const s = this.model.getOptions(), e = c(s, "axes", t.primary), o = c(s, "axes", n.primary), a = e.scaleType || p.LINEAR, r = o.scaleType || p.LINEAR, h = {
1237
1235
  primaryDomainAxisPosition: null,
1238
1236
  secondaryDomainAxisPosition: null,
1239
1237
  primaryRangeAxisPosition: null,
1240
1238
  secondaryRangeAxisPosition: null
1241
1239
  };
1242
- return h.primaryDomainAxisPosition = e.primary, h.primaryRangeAxisPosition = t.primary, h.secondaryDomainAxisPosition = e.secondary, h.secondaryRangeAxisPosition = t.secondary, (!(r === m.LABELS || r === m.TIME) && a === m.LABELS || a === m.TIME) && (h.primaryDomainAxisPosition = t.primary, h.primaryRangeAxisPosition = e.primary, h.secondaryDomainAxisPosition = t.secondary, h.secondaryRangeAxisPosition = e.secondary), h;
1240
+ return h.primaryDomainAxisPosition = n.primary, h.primaryRangeAxisPosition = t.primary, h.secondaryDomainAxisPosition = n.secondary, h.secondaryRangeAxisPosition = t.secondary, (!(r === p.LABELS || r === p.TIME) && a === p.LABELS || a === p.TIME) && (h.primaryDomainAxisPosition = t.primary, h.primaryRangeAxisPosition = n.primary, h.secondaryDomainAxisPosition = t.secondary, h.secondaryRangeAxisPosition = n.secondary), h;
1243
1241
  }
1244
1242
  getScaleDomain(t) {
1245
- const e = this.model.getOptions(), n = c(e, "axes", t), s = c(e, "bounds"), { includeZero: o } = n, a = c(n, "scaleType") || m.LINEAR;
1243
+ const n = this.model.getOptions(), s = c(n, "axes", t), e = c(n, "bounds"), { includeZero: o } = s, a = c(s, "scaleType") || p.LINEAR;
1246
1244
  if (this.model.isDataEmpty())
1247
1245
  return [];
1248
- if (n.binned) {
1246
+ if (s.binned) {
1249
1247
  const { bins: u } = this.model.getBinConfigurations();
1250
1248
  return [0, Wt(u, (x) => x.length)];
1251
- } else if (n.limitDomainToBins) {
1249
+ } else if (s.limitDomainToBins) {
1252
1250
  const { bins: u } = this.model.getBinConfigurations(), x = this.model.getStackKeys({ bins: u });
1253
1251
  return [x[0].split(":")[0], x[x.length - 1].split(":")[1]];
1254
1252
  }
1255
- const r = this.model.getDisplayData(), { extendLinearDomainBy: h, mapsTo: l, percentage: f, thresholds: y } = n, { reference: p, compareTo: v } = J.ratio;
1256
- if (n.domain)
1257
- return a === m.LABELS ? n.domain : (a === m.TIME && (n.domain = n.domain.map(
1253
+ const r = this.model.getDisplayData(), { extendLinearDomainBy: h, mapsTo: l, percentage: f, thresholds: y } = s, { reference: d, compareTo: T } = J.ratio;
1254
+ if (s.domain)
1255
+ return a === p.LABELS ? s.domain : (a === p.TIME && (s.domain = s.domain.map(
1258
1256
  (u) => u.getTime === void 0 ? new Date(u) : u
1259
- )), this.extendsDomain(t, n.domain));
1257
+ )), this.extendsDomain(t, s.domain));
1260
1258
  if (f)
1261
1259
  return [0, 100];
1262
- if (n && a === m.LABELS)
1260
+ if (s && a === p.LABELS)
1263
1261
  return Jt(r.map((u) => u[l]));
1264
- let g, d;
1262
+ let g, m;
1265
1263
  const D = this.model.getDataGroupNames();
1266
- if (a === m.LABELS_RATIO)
1267
- return r.map((u) => `${u[p]}/${u[v]}`);
1268
- if (a === m.TIME)
1269
- d = r.map((u) => +new Date(u[l]));
1270
- else if (s && e.axes)
1271
- d = [], r.forEach((u) => {
1272
- d.push(u[l]), u[s.upperBoundMapsTo] && d.push(u[s.upperBoundMapsTo]), u[s.lowerBoundMapsTo] && d.push(u[s.lowerBoundMapsTo]);
1264
+ if (a === p.LABELS_RATIO)
1265
+ return r.map((u) => `${u[d]}/${u[T]}`);
1266
+ if (a === p.TIME)
1267
+ m = r.map((u) => +new Date(u[l]));
1268
+ else if (e && n.axes)
1269
+ m = [], r.forEach((u) => {
1270
+ m.push(u[l]), u[e.upperBoundMapsTo] && m.push(u[e.upperBoundMapsTo]), u[e.lowerBoundMapsTo] && m.push(u[e.lowerBoundMapsTo]);
1273
1271
  });
1274
- else if (n.stacked === !0 && D && t === this.getRangeAxisPosition()) {
1275
- const { groupMapsTo: u } = e.data, x = this.model.getDataValuesGroupedByKeys({
1272
+ else if (s.stacked === !0 && D && t === this.getRangeAxisPosition()) {
1273
+ const { groupMapsTo: u } = n.data, x = this.model.getDataValuesGroupedByKeys({
1276
1274
  groups: D
1277
1275
  }), Rt = r.filter(
1278
1276
  (b) => !D.includes(b[u])
@@ -1280,84 +1278,84 @@ class re extends A {
1280
1278
  x.forEach((b) => {
1281
1279
  const { ...Bt } = b;
1282
1280
  let U = 0, K = 0;
1283
- Object.values(pi(Bt, "sharedStackKey")).forEach((P) => {
1281
+ Object.values(di(Bt, "sharedStackKey")).forEach((P) => {
1284
1282
  isNaN(P) || (P < 0 ? K += P : U += P);
1285
1283
  }), $.push([K, U]);
1286
- }), d = [
1287
- ...pt($),
1284
+ }), m = [
1285
+ ...dt($),
1288
1286
  ...Rt.map((b) => b[l])
1289
1287
  ];
1290
1288
  } else
1291
- d = [], r.forEach((u) => {
1289
+ m = [], r.forEach((u) => {
1292
1290
  const x = u[l];
1293
- Array.isArray(x) && x.length === 2 ? (d.push(x[0]), d.push(x[1])) : (h && d.push(Math.max(u[l], u[h])), d.push(x));
1291
+ Array.isArray(x) && x.length === 2 ? (m.push(x[0]), m.push(x[1])) : (h && m.push(Math.max(u[l], u[h])), m.push(x));
1294
1292
  });
1295
- return a !== m.TIME && a !== m.LOG && o && d.push(0), y && y.length > 0 && y.forEach((u) => {
1293
+ return a !== p.TIME && a !== p.LOG && o && m.push(0), y && y.length > 0 && y.forEach((u) => {
1296
1294
  const x = c(u, "value");
1297
- x !== null && d.push(x);
1298
- }), g = dt(d), g = this.extendsDomain(t, g), g;
1295
+ x !== null && m.push(x);
1296
+ }), g = mt(m), g = this.extendsDomain(t, g), g;
1299
1297
  }
1300
1298
  createScale(t) {
1301
- const e = this.model.getOptions(), n = c(e, "axes", t);
1302
- if (!n)
1299
+ const n = this.model.getOptions(), s = c(n, "axes", t);
1300
+ if (!s)
1303
1301
  return null;
1304
- const s = c(n, "scaleType") || m.LINEAR;
1305
- this.scaleTypes[t] = s;
1302
+ const e = c(s, "scaleType") || p.LINEAR;
1303
+ this.scaleTypes[t] = e;
1306
1304
  let o;
1307
- return s === m.TIME ? o = si() : s === m.LOG ? o = xt().base(n.base || 10) : s === m.LABELS || s === m.LABELS_RATIO ? o = oi() : o = Qt(), o.domain(this.getScaleDomain(t)), o;
1305
+ return e === p.TIME ? o = ei() : e === p.LOG ? o = xt().base(s.base || 10) : e === p.LABELS || e === p.LABELS_RATIO ? o = oi() : o = Qt(), o.domain(this.getScaleDomain(t)), o;
1308
1306
  }
1309
1307
  getDomainLowerBound(t) {
1310
- let e, n = 0;
1311
- return this.getOrientation() === C.VERTICAL ? e = this.getMainYScale().domain() : e = this.getMainXScale().domain(), c(this.model.getOptions(), "axes", t, "includeZero") === !1 && e[0] > 0 && e[1] > 0 && (n = e[0]), n;
1308
+ let n, s = 0;
1309
+ return this.getOrientation() === C.VERTICAL ? n = this.getMainYScale().domain() : n = this.getMainXScale().domain(), c(this.model.getOptions(), "axes", t, "includeZero") === !1 && n[0] > 0 && n[1] > 0 && (s = n[0]), s;
1312
1310
  }
1313
1311
  getHighestDomainThreshold() {
1314
- const t = c(this.model.getOptions(), "axes"), e = this.getDomainAxisPosition(), { thresholds: n } = t[e];
1315
- if (!Array.isArray(n) || Array.isArray(n) && !n.length)
1312
+ const t = c(this.model.getOptions(), "axes"), n = this.getDomainAxisPosition(), { thresholds: s } = t[n];
1313
+ if (!Array.isArray(s) || Array.isArray(s) && !s.length)
1316
1314
  return null;
1317
- const s = this.getDomainScale(), o = n.sort((r, h) => h.value - r.value)[0];
1318
- return this.getScaleTypeByPosition(e) === m.TIME && (typeof o.value == "string" || o.value.getTime === void 0) && (o.value = new Date(o.value)), {
1315
+ const e = this.getDomainScale(), o = s.sort((r, h) => h.value - r.value)[0];
1316
+ return this.getScaleTypeByPosition(n) === p.TIME && (typeof o.value == "string" || o.value.getTime === void 0) && (o.value = new Date(o.value)), {
1319
1317
  threshold: o,
1320
- scaleValue: s(o.value)
1318
+ scaleValue: e(o.value)
1321
1319
  };
1322
1320
  }
1323
1321
  getHighestRangeThreshold() {
1324
- const t = c(this.model.getOptions(), "axes"), e = this.getRangeAxisPosition(), { thresholds: n } = t[e];
1325
- if (!Array.isArray(n) || Array.isArray(n) && !n.length)
1322
+ const t = c(this.model.getOptions(), "axes"), n = this.getRangeAxisPosition(), { thresholds: s } = t[n];
1323
+ if (!Array.isArray(s) || Array.isArray(s) && !s.length)
1326
1324
  return null;
1327
- const s = this.getRangeScale(), o = n.sort((a, r) => r.value - a.value)[0];
1325
+ const e = this.getRangeScale(), o = s.sort((a, r) => r.value - a.value)[0];
1328
1326
  return {
1329
1327
  threshold: o,
1330
- scaleValue: s(o.value)
1328
+ scaleValue: e(o.value)
1331
1329
  };
1332
1330
  }
1333
1331
  }
1334
1332
  function Ji(i, t) {
1335
- const e = new Date(i[0]), n = new Date(i[1]);
1336
- return zi(n, e) > 1 ? [Vi(e, t), St(n, t)] : $i(n, e) > 1 ? [Ui(e, t), X(n, t)] : Ki(n, e) > 1 ? [qi(e, t), Pt(n, t)] : ji(n, e) > 1 ? [Wi(e, t), wt(n, t)] : ht(n, e) > 30 ? [
1337
- ct(e, t * 30),
1338
- Z(n, t * 30)
1339
- ] : ht(n, e) > 1 ? [ct(e, t), Z(n, t)] : lt(n, e) > 15 ? [
1340
- _t(e, t * 15),
1341
- F(n, t * 15)
1342
- ] : lt(n, e) > 1 ? [_t(e, t), F(n, t)] : [e, n];
1343
- }
1344
- function Qi([i, t], e, n) {
1345
- const o = (t - i) * e, a = t <= 0 && t + o > 0 ? 0 : t + o;
1333
+ const n = new Date(i[0]), s = new Date(i[1]);
1334
+ return zi(s, n) > 1 ? [Vi(n, t), St(s, t)] : $i(s, n) > 1 ? [Ui(n, t), X(s, t)] : Ki(s, n) > 1 ? [qi(n, t), Pt(s, t)] : ji(s, n) > 1 ? [Wi(n, t), wt(s, t)] : ht(s, n) > 30 ? [
1335
+ ct(n, t * 30),
1336
+ Z(s, t * 30)
1337
+ ] : ht(s, n) > 1 ? [ct(n, t), Z(s, t)] : lt(s, n) > 15 ? [
1338
+ _t(n, t * 15),
1339
+ F(s, t * 15)
1340
+ ] : lt(s, n) > 1 ? [_t(n, t), F(s, t)] : [n, s];
1341
+ }
1342
+ function Qi([i, t], n, s) {
1343
+ const o = (t - i) * n, a = t <= 0 && t + o > 0 ? 0 : t + o;
1346
1344
  let r = i >= 0 && i - o < 0 ? 0 : i - o;
1347
- if (n === m.LOG && r <= 0) {
1345
+ if (s === p.LOG && r <= 0) {
1348
1346
  if (i <= 0)
1349
1347
  throw Error("Data must have values greater than 0 if log scale type is used.");
1350
1348
  r = i;
1351
1349
  }
1352
1350
  return [r, a];
1353
1351
  }
1354
- class he extends A {
1352
+ class cn extends O {
1355
1353
  constructor() {
1356
1354
  super(...arguments), this.curveTypes = {
1357
1355
  curveLinear: ri,
1358
1356
  curveLinearClosed: ai,
1359
- curveBasis: Ai,
1360
- curveBasisClosed: Oi,
1357
+ curveBasis: Oi,
1358
+ curveBasisClosed: Ai,
1361
1359
  curveBasisOpen: Mi,
1362
1360
  curveBundle: bi,
1363
1361
  curveCardinal: Si,
@@ -1376,28 +1374,28 @@ class he extends A {
1376
1374
  }
1377
1375
  getD3Curve() {
1378
1376
  let t = "curveLinear";
1379
- const e = this.model.getOptions().curve;
1380
- if (e && (typeof e == "string" ? t = e : t = e.name), this.curveTypes[t]) {
1381
- let n = this.curveTypes[t];
1382
- return e && Object.keys(e).forEach((s) => {
1383
- n[s] && (n = n[s](e[s]));
1384
- }), n;
1377
+ const n = this.model.getOptions().curve;
1378
+ if (n && (typeof n == "string" ? t = n : t = n.name), this.curveTypes[t]) {
1379
+ let s = this.curveTypes[t];
1380
+ return n && Object.keys(n).forEach((e) => {
1381
+ s[e] && (s = s[e](n[e]));
1382
+ }), s;
1385
1383
  }
1386
1384
  return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`), this.curveTypes.curveLinear;
1387
1385
  }
1388
1386
  }
1389
- class ce extends A {
1387
+ class ln extends O {
1390
1388
  isZoomBarEnabled() {
1391
1389
  if (!this.services.cartesianScales || !c(this.model.getOptions(), "zoomBar", "top", "enabled"))
1392
1390
  return !1;
1393
1391
  this.services.cartesianScales.findDomainAndRangeAxes();
1394
- const t = this.services.cartesianScales.getMainXAxisPosition(), e = c(
1392
+ const t = this.services.cartesianScales.getMainXAxisPosition(), n = c(
1395
1393
  this.model.getOptions(),
1396
1394
  "axes",
1397
1395
  t,
1398
1396
  "scaleType"
1399
1397
  );
1400
- return t === _.BOTTOM && e === m.TIME;
1398
+ return t === _.BOTTOM && n === p.TIME;
1401
1399
  }
1402
1400
  // get display data for zoom bar
1403
1401
  // basically it's sum of value grouped by time
@@ -1407,83 +1405,80 @@ class ce extends A {
1407
1405
  }
1408
1406
  getDefaultZoomBarDomain(t) {
1409
1407
  if (!this.services.zoom) throw new Error("Services zoom not defined");
1410
- const e = t || this.services.zoom.getZoomBarData(), { cartesianScales: n } = this.services;
1411
- if (!n) throw new Error("Services cartesianScales undefined");
1412
- const s = n.getMainXAxisPosition(), o = n.getDomainIdentifier(), a = c(this.model.getOptions(), "axes", s, "domain");
1408
+ const n = t || this.services.zoom.getZoomBarData(), { cartesianScales: s } = this.services;
1409
+ if (!s) throw new Error("Services cartesianScales undefined");
1410
+ const e = s.getMainXAxisPosition(), o = s.getDomainIdentifier(), a = c(this.model.getOptions(), "axes", e, "domain");
1413
1411
  if (Array.isArray(a) && a.length === 2)
1414
1412
  return a;
1415
- if (!s) throw new Error("Not defined: mainXAxisPosition");
1416
- return n.extendsDomain(
1417
- s,
1418
- dt(e, (r) => r[o])
1413
+ if (!e) throw new Error("Not defined: mainXAxisPosition");
1414
+ return s.extendsDomain(
1415
+ e,
1416
+ mt(n, (r) => r[o])
1419
1417
  );
1420
1418
  }
1421
- handleDomainChange(t, e = { dispatchEvent: !0 }) {
1422
- var n;
1423
- this.model.set({ zoomDomain: t }, { animate: !1 }), e.dispatchEvent && ((n = this.services.events) == null || n.dispatchEvent(w.ZoomDomain.CHANGE, {
1419
+ handleDomainChange(t, n = { dispatchEvent: !0 }) {
1420
+ this.model.set({ zoomDomain: t }, { animate: !1 }), n.dispatchEvent && this.services.events?.dispatchEvent(w.ZoomDomain.CHANGE, {
1424
1421
  newDomain: t
1425
- }));
1422
+ });
1426
1423
  }
1427
1424
  getZoomRatio() {
1428
1425
  return c(this.model.getOptions(), "zoomBar", "zoomRatio");
1429
1426
  }
1430
1427
  // filter out data not inside zoom domain
1431
1428
  // to get better range value for axis label
1432
- filterDataForRangeAxis(t, e) {
1433
- var a;
1434
- const n = this.model.get("zoomDomain"), s = Object.assign(
1429
+ filterDataForRangeAxis(t, n) {
1430
+ const s = this.model.get("zoomDomain"), e = Object.assign(
1435
1431
  { stacked: !1 },
1436
1432
  // default configs
1437
- e
1433
+ n
1438
1434
  ), o = c(this.model.getOptions(), "zoomBar", "updateRangeAxis");
1439
- if (this.isZoomBarEnabled() && o && n) {
1440
- const r = s.stacked ? "sharedStackKey" : (a = this.services.cartesianScales) == null ? void 0 : a.getDomainIdentifier(), h = t.filter(
1441
- (l) => new Date(l[r]) >= n[0] && new Date(l[r]) <= n[1]
1435
+ if (this.isZoomBarEnabled() && o && s) {
1436
+ const a = e.stacked ? "sharedStackKey" : this.services.cartesianScales?.getDomainIdentifier(), r = t.filter(
1437
+ (h) => new Date(h[a]) >= s[0] && new Date(h[a]) <= s[1]
1442
1438
  );
1443
- if (h.length > 0)
1444
- return h;
1439
+ if (r.length > 0)
1440
+ return r;
1445
1441
  }
1446
1442
  return t;
1447
1443
  }
1448
1444
  zoomIn(t = this.getZoomRatio()) {
1449
- var v;
1450
- const e = this.model.get("zoomDomain"), n = ti.handleWidth, s = (v = this.services.cartesianScales) == null ? void 0 : v.getMainXScale().copy();
1451
- s.domain(this.getDefaultZoomBarDomain());
1452
- const o = s(e[0]), a = s(e[1]);
1453
- if (a - o < n + 1)
1445
+ const n = this.model.get("zoomDomain"), s = ti.handleWidth, e = this.services.cartesianScales?.getMainXScale().copy();
1446
+ e.domain(this.getDefaultZoomBarDomain());
1447
+ const o = e(n[0]), a = e(n[1]);
1448
+ if (a - o < s + 1)
1454
1449
  return;
1455
- const r = s.range(), h = a - o, l = Math.min((r[1] - r[0]) / 2 * (t / 2), h / 2);
1450
+ const r = e.range(), h = a - o, l = Math.min((r[1] - r[0]) / 2 * (t / 2), h / 2);
1456
1451
  let f = o + l, y = a - l;
1457
- f >= y && (f = o + h / 2 - n / 2, y = a - h / 2 + n / 2);
1458
- const p = [s.invert(f), s.invert(y)];
1459
- (e[0].valueOf() !== p[0].valueOf() || e[1].valueOf() !== p[1].valueOf()) && this.handleDomainChange(p);
1452
+ f >= y && (f = o + h / 2 - s / 2, y = a - h / 2 + s / 2);
1453
+ const d = [e.invert(f), e.invert(y)];
1454
+ (n[0].valueOf() !== d[0].valueOf() || n[1].valueOf() !== d[1].valueOf()) && this.handleDomainChange(d);
1460
1455
  }
1461
1456
  zoomOut(t = this.getZoomRatio()) {
1462
- const e = this.model.get("zoomDomain");
1457
+ const n = this.model.get("zoomDomain");
1463
1458
  if (!this.services.cartesianScales) throw new Error("Services cartesianScales undefined");
1464
- const n = this.services.cartesianScales.getMainXScale().copy();
1465
- n.domain(this.getDefaultZoomBarDomain());
1466
- const s = n(e[0]), o = n(e[1]), a = n.range(), r = (a[1] - a[0]) / 2 * (t / 2), h = Math.max(s - r, a[0]), l = Math.min(o + r, a[1]), f = [n.invert(h), n.invert(l)];
1467
- (e[0].valueOf() !== f[0].valueOf() || e[1].valueOf() !== f[1].valueOf()) && this.handleDomainChange(f);
1459
+ const s = this.services.cartesianScales.getMainXScale().copy();
1460
+ s.domain(this.getDefaultZoomBarDomain());
1461
+ const e = s(n[0]), o = s(n[1]), a = s.range(), r = (a[1] - a[0]) / 2 * (t / 2), h = Math.max(e - r, a[0]), l = Math.min(o + r, a[1]), f = [s.invert(h), s.invert(l)];
1462
+ (n[0].valueOf() !== f[0].valueOf() || n[1].valueOf() !== f[1].valueOf()) && this.handleDomainChange(f);
1468
1463
  }
1469
1464
  resetZoomDomain() {
1470
- const t = this.model.get("zoomDomain"), e = this.getDefaultZoomBarDomain();
1471
- (t[0].valueOf() !== e[0].valueOf() || t[1].valueOf() !== e[1].valueOf()) && this.handleDomainChange(e);
1465
+ const t = this.model.get("zoomDomain"), n = this.getDefaultZoomBarDomain();
1466
+ (t[0].valueOf() !== n[0].valueOf() || t[1].valueOf() !== n[1].valueOf()) && this.handleDomainChange(n);
1472
1467
  }
1473
1468
  // check if current zoom domain is already the min zoom domain
1474
1469
  // when toolbar is rendered, we don't render chart yet
1475
1470
  // don't depend on scale range
1476
1471
  isMinZoomDomain() {
1477
- const t = this.model.get("zoomDomain"), e = this.getDefaultZoomBarDomain();
1478
- if (!t || !e)
1472
+ const t = this.model.get("zoomDomain"), n = this.getDefaultZoomBarDomain();
1473
+ if (!t || !n)
1479
1474
  return !1;
1480
- const n = t[1].valueOf() - t[0].valueOf(), s = e[1].valueOf() - e[0].valueOf(), o = c(this.model.getOptions(), "zoomBar", "minZoomRatio");
1481
- return n / s < o;
1475
+ const s = t[1].valueOf() - t[0].valueOf(), e = n[1].valueOf() - n[0].valueOf(), o = c(this.model.getOptions(), "zoomBar", "minZoomRatio");
1476
+ return s / e < o;
1482
1477
  }
1483
1478
  // check if current zoom domain is already the max zoom domain
1484
1479
  isMaxZoomDomain() {
1485
- const t = this.model.get("zoomDomain"), e = this.getDefaultZoomBarDomain();
1486
- return !!(t && e && t[0].valueOf() === e[0].valueOf() && t[1].valueOf() === e[1].valueOf());
1480
+ const t = this.model.get("zoomDomain"), n = this.getDefaultZoomBarDomain();
1481
+ return !!(t && n && t[0].valueOf() === n[0].valueOf() && t[1].valueOf() === n[1].valueOf());
1487
1482
  }
1488
1483
  isEmptyState() {
1489
1484
  return this.getZoomBarData().length === 0;
@@ -1496,14 +1491,14 @@ class ce extends A {
1496
1491
  }
1497
1492
  }
1498
1493
  export {
1499
- ne as C,
1500
- se as E,
1501
- oe as F,
1502
- ae as T,
1503
- ce as Z,
1504
- he as a,
1494
+ en as C,
1495
+ on as E,
1496
+ an as F,
1497
+ rn as T,
1498
+ ln as Z,
1499
+ cn as a,
1505
1500
  ci as b,
1506
- re as c,
1507
- pt as f
1501
+ hn as c,
1502
+ dt as f
1508
1503
  };
1509
- //# sourceMappingURL=index-Ciju2yyn.mjs.map
1504
+ //# sourceMappingURL=index-BILVb6NZ.mjs.map