@hybridcore/ui 1.6.30 → 1.6.32

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.
@@ -1,51 +1,47 @@
1
- import { R as S, A as E } from "../../../AnimatedTheme-ktdO3Bel.js";
2
- import { useThemeProps as L, useTheme as j } from "@mui/material";
3
- import q from "dayjs";
1
+ import { R as C, A as S } from "../../../AnimatedTheme-ktdO3Bel.js";
2
+ import { useThemeProps as E, useTheme as L } from "@mui/material";
3
+ import I from "dayjs";
4
4
  import T from "lodash";
5
- import { useId as B, useRef as H, useEffect as I } from "react";
6
- import { applyValueFormat as W, colorSetFromPalette as O } from "../_common/utils.js";
7
- import { c as n, p as o } from "../../../Entity-BJCuhdq_.js";
8
- import { P as V, a as N } from "../../../PieSeries-CMH0Z7pz.js";
9
- const Z = (b) => {
10
- const g = L({ props: b, name: "HCNestedPie" }), {
5
+ import { useId as j, useRef as q, useEffect as B } from "react";
6
+ import { applyValueFormat as H, applyInterfaceColors as W, colorSetFromPalette as O } from "../_common/utils.js";
7
+ import { P as V, a as A } from "../../../PieSeries-CMH0Z7pz.js";
8
+ import { p as o, c as X } from "../../../Entity-BJCuhdq_.js";
9
+ const ee = (N) => {
10
+ const f = E({ props: N, name: "HCNestedPie" }), {
11
11
  dimensions: a,
12
12
  values: r,
13
- data: d,
14
- initDelay: x = 0,
15
- colors: v,
13
+ data: u,
14
+ initDelay: b = 0,
15
+ colors: h,
16
16
  sx: k,
17
17
  ...w
18
- } = g, i = j(), y = `hc-nested-pie-${B().replace(/:/g, "")}`, m = H(null);
19
- let c = null;
20
- a.length < 2 ? c = "NestedPie requires at least 2 dimensions" : r.length < 1 && (c = "NestedPie requires at least 1 value"), I(() => {
21
- if (c) return;
22
- let p;
23
- return p = setTimeout(() => {
24
- var Y;
25
- const e = S.new(y);
26
- m.current = e, W(e, (Y = r == null ? void 0 : r[0]) == null ? void 0 : Y.format), e.setThemes([E.new(e)]), e.interfaceColors.setAll({
27
- text: n(i.palette.text.primary),
28
- grid: n(i.palette.divider),
29
- stroke: n(i.palette.divider)
30
- });
31
- const f = e.container.children.push(
18
+ } = f, g = L(), v = `hc-nested-pie-${j().replace(/:/g, "")}`, n = q(null);
19
+ let i = null;
20
+ a.length < 2 ? i = "NestedPie requires at least 2 dimensions" : r.length < 1 && (i = "NestedPie requires at least 1 value"), B(() => {
21
+ if (i) return;
22
+ let d;
23
+ return d = setTimeout(() => {
24
+ var y;
25
+ const e = C.new(v);
26
+ n.current = e, H(e, (y = r == null ? void 0 : r[0]) == null ? void 0 : y.format), e.setThemes([S.new(e)]), W(e, g);
27
+ const m = e.container.children.push(
32
28
  V.new(e, {
33
29
  layout: e.verticalLayout,
34
30
  radius: o(100)
35
31
  })
36
32
  );
37
- a[0].type === "date" && d.forEach((s) => {
33
+ a[0].type === "date" && u.forEach((s) => {
38
34
  let l = "YYYY";
39
- a[0].value.includes("month") ? l = "MMM YYYY" : a[0].value.includes("day") && (l = "DD MMM YYYY"), s[a[0].value] = q(s[a[0].value]).format(
35
+ a[0].value.includes("month") ? l = "MMM YYYY" : a[0].value.includes("day") && (l = "DD MMM YYYY"), s[a[0].value] = I(s[a[0].value]).format(
40
36
  l
41
37
  );
42
38
  });
43
- const h = T.orderBy(d, (s) => s[a[0].value]);
39
+ const p = T.orderBy(u, (s) => s[a[0].value]);
44
40
  a.forEach((s, l) => {
45
- const A = e.interfaceColors.get("background");
41
+ const Y = e.interfaceColors.get("background");
46
42
  if (l === 0) {
47
- const t = f.series.push(
48
- N.new(e, {
43
+ const t = m.series.push(
44
+ A.new(e, {
49
45
  valueField: r[0].dataFieldName,
50
46
  categoryField: s.value,
51
47
  alignLabels: !1,
@@ -59,47 +55,47 @@ const Z = (b) => {
59
55
  textType: "radial",
60
56
  centerX: o(100)
61
57
  }), t.slices.template.setAll({
62
- stroke: A,
58
+ stroke: Y,
63
59
  strokeWidth: 2,
64
- fill: n(11184810),
60
+ fill: X(11184810),
65
61
  tooltipText: "{category}: {valuePercentTotal.formatNumber('0.00')}% ({value})"
66
62
  }), t.slices.template.states.create("hover", { scale: 0.95 }), a.length > 1) {
67
- const u = [], F = T.groupBy(h, s.value);
63
+ const c = [], F = T.groupBy(p, s.value);
68
64
  Object.keys(F).forEach((P) => {
69
- const M = F[P].reduce((R, C) => R + C[r[0].dataFieldName], 0);
70
- u.push({
65
+ const D = F[P].reduce((M, R) => M + R[r[0].dataFieldName], 0);
66
+ c.push({
71
67
  [s.value]: P,
72
- [r[0].dataFieldName]: M
68
+ [r[0].dataFieldName]: D
73
69
  });
74
- }), t.data.setAll(u);
70
+ }), t.data.setAll(c);
75
71
  } else
76
- t.data.setAll(h);
72
+ t.data.setAll(p);
77
73
  } else if (l === 1) {
78
- const t = f.series.push(
79
- N.new(e, {
74
+ const t = m.series.push(
75
+ A.new(e, {
80
76
  valueField: r[0].dataFieldName,
81
77
  categoryField: s.value,
82
78
  alignLabels: !0,
83
79
  innerRadius: o(80),
84
80
  radius: o(100)
85
81
  })
86
- ), u = O(e, v);
87
- t.set("colors", u), t.slices.template.setAll({
88
- stroke: A,
82
+ ), c = O(e, h);
83
+ t.set("colors", c), t.slices.template.setAll({
84
+ stroke: Y,
89
85
  strokeWidth: 2,
90
86
  templateField: "settings",
91
87
  tooltipText: "{category}: {valuePercentTotal.formatNumber('0.00')}% ({value})"
92
- }), t.labels.template.setAll({ text: "{category}" }), t.data.setAll(h);
88
+ }), t.labels.template.setAll({ text: "{category}" }), t.data.setAll(p);
93
89
  }
94
- }), f.appear(1e3, 100);
95
- }, x), () => {
90
+ }), m.appear(1e3, 100);
91
+ }, b), () => {
96
92
  var e;
97
- p && clearTimeout(p), (e = m.current) == null || e.dispose(), m.current = null;
93
+ d && clearTimeout(d), (e = n.current) == null || e.dispose(), n.current = null;
98
94
  };
99
- }, [d, a, r, i.palette.mode, v]);
100
- const D = { ...g };
101
- return { chartId: y, ownerState: D, sx: k, error: c, other: w };
95
+ }, [u, a, r, g.palette.mode, h]);
96
+ const x = { ...f };
97
+ return { chartId: v, ownerState: x, sx: k, error: i, other: w };
102
98
  };
103
99
  export {
104
- Z as useNestedPieLogic
100
+ ee as useNestedPieLogic
105
101
  };
@@ -1,15 +1,15 @@
1
- import { R as X, A as I } from "../../../AnimatedTheme-ktdO3Bel.js";
2
- import { useThemeProps as ee } from "@mui/material";
3
- import te from "dayjs";
4
- import { useId as re, useRef as ne, useEffect as ie } from "react";
5
- import { applyValueFormat as se, colorSetFromPalette as oe } from "../_common/utils.js";
1
+ import { R as Q, A as X } from "../../../AnimatedTheme-ktdO3Bel.js";
2
+ import { useThemeProps as ee, useTheme as te } from "@mui/material";
3
+ import re from "dayjs";
4
+ import { useId as ne, useRef as se, useEffect as ie } from "react";
5
+ import { applyValueFormat as oe, applyInterfaceColors as ae, colorSetFromPalette as ue } from "../_common/utils.js";
6
6
  import { Z as U } from "../../../ZoomableContainer-Ca_pDVYQ.js";
7
- import { M as ae, m as ue, e as le, b as q } from "../../../Entity-BJCuhdq_.js";
8
- import { C as $, G as A, a as ce, b as he } from "../../../Tooltip-vyZRZWih.js";
7
+ import { M as le, m as ce, e as he, b as q } from "../../../Entity-BJCuhdq_.js";
8
+ import { C as $, G as A, a as fe, b as de } from "../../../Tooltip-vyZRZWih.js";
9
9
  import { B as O } from "../../../Button-BLY4PVJC.js";
10
- import { H as J } from "../../../Hierarchy-CEOK8Gzh.js";
11
- import { C as fe } from "../../../Circle-BnfBNKBD.js";
12
- import { o as de, c as z, a as me } from "../../../constant-BiOGvlZc.js";
10
+ import { H as I } from "../../../Hierarchy-CEOK8Gzh.js";
11
+ import { C as me } from "../../../Circle-BnfBNKBD.js";
12
+ import { o as pe, c as z, a as ge } from "../../../constant-BiOGvlZc.js";
13
13
  class j extends $ {
14
14
  constructor() {
15
15
  super(...arguments), Object.defineProperty(this, "homeButton", {
@@ -58,7 +58,7 @@ class j extends $ {
58
58
  n == r.get("minZoomLevel") ? this.minusButton.set("disabled", !0) : this.minusButton.set("disabled", !1), n == r.get("maxZoomLevel") ? this.plusButton.set("disabled", !0) : this.plusButton.set("disabled", !1);
59
59
  })), this.root.events.once("frameended", () => {
60
60
  r.get("scale") == r.get("minZoomLevel") && this.minusButton.set("disabled", !0);
61
- })), this._disposer = new ae([
61
+ })), this._disposer = new le([
62
62
  this.plusButton.events.on("click", () => {
63
63
  r.zoomIn();
64
64
  }),
@@ -84,146 +84,146 @@ Object.defineProperty(j, "classNames", {
84
84
  writable: !0,
85
85
  value: $.classNames.concat([j.className])
86
86
  });
87
- const pe = 1664525, ge = 1013904223, E = 4294967296;
88
- function ye() {
87
+ const ye = 1664525, xe = 1013904223, E = 4294967296;
88
+ function be() {
89
89
  let t = 1;
90
- return () => (t = (pe * t + ge) % E) / E;
90
+ return () => (t = (ye * t + xe) % E) / E;
91
91
  }
92
- function xe(t) {
92
+ function ve(t) {
93
93
  return typeof t == "object" && "length" in t ? t : Array.from(t);
94
94
  }
95
- function be(t, r) {
96
- let e = t.length, n, i;
95
+ function _e(t, r) {
96
+ let e = t.length, n, s;
97
97
  for (; e; )
98
- i = r() * e-- | 0, n = t[e], t[e] = t[i], t[i] = n;
98
+ s = r() * e-- | 0, n = t[e], t[e] = t[s], t[s] = n;
99
99
  return t;
100
100
  }
101
- function ve(t, r) {
102
- for (var e = 0, n = (t = be(Array.from(t), r)).length, i = [], s, a; e < n; )
103
- s = t[e], a && K(a, s) ? ++e : (a = we(i = _e(i, s)), e = 0);
101
+ function we(t, r) {
102
+ for (var e = 0, n = (t = _e(Array.from(t), r)).length, s = [], i, a; e < n; )
103
+ i = t[e], a && J(a, i) ? ++e : (a = Pe(s = ke(s, i)), e = 0);
104
104
  return a;
105
105
  }
106
- function _e(t, r) {
106
+ function ke(t, r) {
107
107
  var e, n;
108
108
  if (L(r, t)) return [r];
109
109
  for (e = 0; e < t.length; ++e)
110
- if (D(r, t[e]) && L(_(t[e], r), t))
110
+ if (D(r, t[e]) && L(w(t[e], r), t))
111
111
  return [t[e], r];
112
112
  for (e = 0; e < t.length - 1; ++e)
113
113
  for (n = e + 1; n < t.length; ++n)
114
- if (D(_(t[e], t[n]), r) && D(_(t[e], r), t[n]) && D(_(t[n], r), t[e]) && L(Q(t[e], t[n], r), t))
114
+ if (D(w(t[e], t[n]), r) && D(w(t[e], r), t[n]) && D(w(t[n], r), t[e]) && L(K(t[e], t[n], r), t))
115
115
  return [t[e], t[n], r];
116
116
  throw new Error();
117
117
  }
118
118
  function D(t, r) {
119
- var e = t.r - r.r, n = r.x - t.x, i = r.y - t.y;
120
- return e < 0 || e * e < n * n + i * i;
119
+ var e = t.r - r.r, n = r.x - t.x, s = r.y - t.y;
120
+ return e < 0 || e * e < n * n + s * s;
121
121
  }
122
- function K(t, r) {
123
- var e = t.r - r.r + Math.max(t.r, r.r, 1) * 1e-9, n = r.x - t.x, i = r.y - t.y;
124
- return e > 0 && e * e > n * n + i * i;
122
+ function J(t, r) {
123
+ var e = t.r - r.r + Math.max(t.r, r.r, 1) * 1e-9, n = r.x - t.x, s = r.y - t.y;
124
+ return e > 0 && e * e > n * n + s * s;
125
125
  }
126
126
  function L(t, r) {
127
127
  for (var e = 0; e < r.length; ++e)
128
- if (!K(t, r[e]))
128
+ if (!J(t, r[e]))
129
129
  return !1;
130
130
  return !0;
131
131
  }
132
- function we(t) {
132
+ function Pe(t) {
133
133
  switch (t.length) {
134
134
  case 1:
135
- return ke(t[0]);
135
+ return Ne(t[0]);
136
136
  case 2:
137
- return _(t[0], t[1]);
137
+ return w(t[0], t[1]);
138
138
  case 3:
139
- return Q(t[0], t[1], t[2]);
139
+ return K(t[0], t[1], t[2]);
140
140
  }
141
141
  }
142
- function ke(t) {
142
+ function Ne(t) {
143
143
  return {
144
144
  x: t.x,
145
145
  y: t.y,
146
146
  r: t.r
147
147
  };
148
148
  }
149
- function _(t, r) {
150
- var e = t.x, n = t.y, i = t.r, s = r.x, a = r.y, l = r.r, o = s - e, u = a - n, c = l - i, h = Math.sqrt(o * o + u * u);
149
+ function w(t, r) {
150
+ var e = t.x, n = t.y, s = t.r, i = r.x, a = r.y, l = r.r, o = i - e, u = a - n, c = l - s, f = Math.sqrt(o * o + u * u);
151
151
  return {
152
- x: (e + s + o / h * c) / 2,
153
- y: (n + a + u / h * c) / 2,
154
- r: (h + i + l) / 2
152
+ x: (e + i + o / f * c) / 2,
153
+ y: (n + a + u / f * c) / 2,
154
+ r: (f + s + l) / 2
155
155
  };
156
156
  }
157
- function Q(t, r, e) {
158
- var n = t.x, i = t.y, s = t.r, a = r.x, l = r.y, o = r.r, u = e.x, c = e.y, h = e.r, d = n - a, m = n - u, b = i - l, p = i - c, f = o - s, y = h - s, x = n * n + i * i - s * s, w = x - a * a - l * l + o * o, v = x - u * u - c * c + h * h, g = m * b - d * p, k = (b * v - p * w) / (g * 2) - n, P = (p * f - b * y) / g, N = (m * w - d * v) / (g * 2) - i, M = (d * y - m * f) / g, H = P * P + M * M - 1, C = 2 * (s + k * P + N * M), Z = k * k + N * N - s * s, Y = -(Math.abs(H) > 1e-6 ? (C + Math.sqrt(C * C - 4 * H * Z)) / (2 * H) : Z / C);
157
+ function K(t, r, e) {
158
+ var n = t.x, s = t.y, i = t.r, a = r.x, l = r.y, o = r.r, u = e.x, c = e.y, f = e.r, d = n - a, p = n - u, m = s - l, _ = s - c, x = o - i, h = f - i, b = n * n + s * s - i * i, v = b - a * a - l * l + o * o, k = b - u * u - c * c + f * f, g = p * m - d * _, y = (m * k - _ * v) / (g * 2) - n, P = (_ * x - m * h) / g, N = (p * v - d * k) / (g * 2) - s, M = (d * h - p * x) / g, H = P * P + M * M - 1, C = 2 * (i + y * P + N * M), Z = y * y + N * N - i * i, Y = -(Math.abs(H) > 1e-6 ? (C + Math.sqrt(C * C - 4 * H * Z)) / (2 * H) : Z / C);
159
159
  return {
160
- x: n + k + P * Y,
161
- y: i + N + M * Y,
160
+ x: n + y + P * Y,
161
+ y: s + N + M * Y,
162
162
  r: Y
163
163
  };
164
164
  }
165
165
  function F(t, r, e) {
166
- var n = t.x - r.x, i, s, a = t.y - r.y, l, o, u = n * n + a * a;
167
- u ? (s = r.r + e.r, s *= s, o = t.r + e.r, o *= o, s > o ? (i = (u + o - s) / (2 * u), l = Math.sqrt(Math.max(0, o / u - i * i)), e.x = t.x - i * n - l * a, e.y = t.y - i * a + l * n) : (i = (u + s - o) / (2 * u), l = Math.sqrt(Math.max(0, s / u - i * i)), e.x = r.x + i * n - l * a, e.y = r.y + i * a + l * n)) : (e.x = r.x + e.r, e.y = r.y);
166
+ var n = t.x - r.x, s, i, a = t.y - r.y, l, o, u = n * n + a * a;
167
+ u ? (i = r.r + e.r, i *= i, o = t.r + e.r, o *= o, i > o ? (s = (u + o - i) / (2 * u), l = Math.sqrt(Math.max(0, o / u - s * s)), e.x = t.x - s * n - l * a, e.y = t.y - s * a + l * n) : (s = (u + i - o) / (2 * u), l = Math.sqrt(Math.max(0, i / u - s * s)), e.x = r.x + s * n - l * a, e.y = r.y + s * a + l * n)) : (e.x = r.x + e.r, e.y = r.y);
168
168
  }
169
169
  function W(t, r) {
170
- var e = t.r + r.r - 1e-6, n = r.x - t.x, i = r.y - t.y;
171
- return e > 0 && e * e > n * n + i * i;
170
+ var e = t.r + r.r - 1e-6, n = r.x - t.x, s = r.y - t.y;
171
+ return e > 0 && e * e > n * n + s * s;
172
172
  }
173
173
  function V(t) {
174
- var r = t._, e = t.next._, n = r.r + e.r, i = (r.x * e.r + e.x * r.r) / n, s = (r.y * e.r + e.y * r.r) / n;
175
- return i * i + s * s;
174
+ var r = t._, e = t.next._, n = r.r + e.r, s = (r.x * e.r + e.x * r.r) / n, i = (r.y * e.r + e.y * r.r) / n;
175
+ return s * s + i * i;
176
176
  }
177
177
  function T(t) {
178
178
  this._ = t, this.next = null, this.previous = null;
179
179
  }
180
- function Pe(t, r) {
181
- if (!(s = (t = xe(t)).length)) return 0;
182
- var e, n, i, s, a, l, o, u, c, h, d;
183
- if (e = t[0], e.x = 0, e.y = 0, !(s > 1)) return e.r;
184
- if (n = t[1], e.x = -n.r, n.x = e.r, n.y = 0, !(s > 2)) return e.r + n.r;
185
- F(n, e, i = t[2]), e = new T(e), n = new T(n), i = new T(i), e.next = i.previous = n, n.next = e.previous = i, i.next = n.previous = e;
186
- e: for (o = 3; o < s; ++o) {
187
- F(e._, n._, i = t[o]), i = new T(i), u = n.next, c = e.previous, h = n._.r, d = e._.r;
180
+ function Me(t, r) {
181
+ if (!(i = (t = ve(t)).length)) return 0;
182
+ var e, n, s, i, a, l, o, u, c, f, d;
183
+ if (e = t[0], e.x = 0, e.y = 0, !(i > 1)) return e.r;
184
+ if (n = t[1], e.x = -n.r, n.x = e.r, n.y = 0, !(i > 2)) return e.r + n.r;
185
+ F(n, e, s = t[2]), e = new T(e), n = new T(n), s = new T(s), e.next = s.previous = n, n.next = e.previous = s, s.next = n.previous = e;
186
+ e: for (o = 3; o < i; ++o) {
187
+ F(e._, n._, s = t[o]), s = new T(s), u = n.next, c = e.previous, f = n._.r, d = e._.r;
188
188
  do
189
- if (h <= d) {
190
- if (W(u._, i._)) {
189
+ if (f <= d) {
190
+ if (W(u._, s._)) {
191
191
  n = u, e.next = n, n.previous = e, --o;
192
192
  continue e;
193
193
  }
194
- h += u._.r, u = u.next;
194
+ f += u._.r, u = u.next;
195
195
  } else {
196
- if (W(c._, i._)) {
196
+ if (W(c._, s._)) {
197
197
  e = c, e.next = n, n.previous = e, --o;
198
198
  continue e;
199
199
  }
200
200
  d += c._.r, c = c.previous;
201
201
  }
202
202
  while (u !== c.next);
203
- for (i.previous = e, i.next = n, e.next = n.previous = n = i, a = V(e); (i = i.next) !== n; )
204
- (l = V(i)) < a && (e = i, a = l);
203
+ for (s.previous = e, s.next = n, e.next = n.previous = n = s, a = V(e); (s = s.next) !== n; )
204
+ (l = V(s)) < a && (e = s, a = l);
205
205
  n = e.next;
206
206
  }
207
- for (e = [n._], i = n; (i = i.next) !== n; ) e.push(i._);
208
- for (i = ve(e, r), o = 0; o < s; ++o) e = t[o], e.x -= i.x, e.y -= i.y;
209
- return i.r;
207
+ for (e = [n._], s = n; (s = s.next) !== n; ) e.push(s._);
208
+ for (s = we(e, r), o = 0; o < i; ++o) e = t[o], e.x -= s.x, e.y -= s.y;
209
+ return s.r;
210
210
  }
211
- function Ne(t) {
211
+ function Ce(t) {
212
212
  return Math.sqrt(t.value);
213
213
  }
214
- function Me() {
214
+ function De() {
215
215
  var t = null, r = 1, e = 1, n = z;
216
- function i(s) {
217
- const a = ye();
218
- return s.x = r / 2, s.y = e / 2, t ? s.eachBefore(B(t)).eachAfter(S(n, 0.5, a)).eachBefore(G(1)) : s.eachBefore(B(Ne)).eachAfter(S(z, 1, a)).eachAfter(S(n, s.r / Math.min(r, e), a)).eachBefore(G(Math.min(r, e) / (2 * s.r))), s;
216
+ function s(i) {
217
+ const a = be();
218
+ return i.x = r / 2, i.y = e / 2, t ? i.eachBefore(B(t)).eachAfter(S(n, 0.5, a)).eachBefore(G(1)) : i.eachBefore(B(Ce)).eachAfter(S(z, 1, a)).eachAfter(S(n, i.r / Math.min(r, e), a)).eachBefore(G(Math.min(r, e) / (2 * i.r))), i;
219
219
  }
220
- return i.radius = function(s) {
221
- return arguments.length ? (t = de(s), i) : t;
222
- }, i.size = function(s) {
223
- return arguments.length ? (r = +s[0], e = +s[1], i) : [r, e];
224
- }, i.padding = function(s) {
225
- return arguments.length ? (n = typeof s == "function" ? s : me(+s), i) : n;
226
- }, i;
220
+ return s.radius = function(i) {
221
+ return arguments.length ? (t = pe(i), s) : t;
222
+ }, s.size = function(i) {
223
+ return arguments.length ? (r = +i[0], e = +i[1], s) : [r, e];
224
+ }, s.padding = function(i) {
225
+ return arguments.length ? (n = typeof i == "function" ? i : ge(+i), s) : n;
226
+ }, s;
227
227
  }
228
228
  function B(t) {
229
229
  return function(r) {
@@ -232,10 +232,10 @@ function B(t) {
232
232
  }
233
233
  function S(t, r, e) {
234
234
  return function(n) {
235
- if (i = n.children) {
236
- var i, s, a = i.length, l = t(n) * r || 0, o;
237
- if (l) for (s = 0; s < a; ++s) i[s].r += l;
238
- if (o = Pe(i, e), l) for (s = 0; s < a; ++s) i[s].r -= l;
235
+ if (s = n.children) {
236
+ var s, i, a = s.length, l = t(n) * r || 0, o;
237
+ if (l) for (i = 0; i < a; ++i) s[i].r += l;
238
+ if (o = Me(s, e), l) for (i = 0; i < a; ++i) s[i].r -= l;
239
239
  n.r = o + l;
240
240
  }
241
241
  };
@@ -246,7 +246,7 @@ function G(t) {
246
246
  r.r *= t, e && (r.x = e.x + t * r.x, r.y = e.y + t * r.y);
247
247
  };
248
248
  }
249
- class R extends J {
249
+ class R extends I {
250
250
  constructor() {
251
251
  super(...arguments), Object.defineProperty(this, "_tag", {
252
252
  enumerable: !0,
@@ -257,7 +257,7 @@ class R extends J {
257
257
  enumerable: !0,
258
258
  configurable: !0,
259
259
  writable: !0,
260
- value: Me()
260
+ value: De()
261
261
  }), Object.defineProperty(this, "_packData", {
262
262
  enumerable: !0,
263
263
  configurable: !0,
@@ -267,8 +267,8 @@ class R extends J {
267
267
  enumerable: !0,
268
268
  configurable: !0,
269
269
  writable: !0,
270
- value: this.addDisposer(new ce(he.new({}), () => fe._new(this._root, {
271
- themeTags: ue(this.circles.template.get("themeTags", []), [this._tag, "shape"])
270
+ value: this.addDisposer(new fe(de.new({}), () => me._new(this._root, {
271
+ themeTags: ce(this.circles.template.get("themeTags", []), [this._tag, "shape"])
272
272
  }, [this.circles.template])))
273
273
  });
274
274
  }
@@ -286,19 +286,19 @@ class R extends J {
286
286
  }
287
287
  _updateNode(r) {
288
288
  super._updateNode(r);
289
- const e = r.get("node"), n = r.get("circle"), i = r.get("d3HierarchyNode"), s = this.getPrivate("scaleR", 1), a = i.x * s, l = i.y * s, o = i.r * s, u = this.get("animationDuration", 0), c = this.get("animationEasing");
289
+ const e = r.get("node"), n = r.get("circle"), s = r.get("d3HierarchyNode"), i = this.getPrivate("scaleR", 1), a = s.x * i, l = s.y * i, o = s.r * i, u = this.get("animationDuration", 0), c = this.get("animationEasing");
290
290
  if (e.animate({ key: "x", to: a, duration: u, easing: c }), e.animate({ key: "y", to: l, duration: u, easing: c }), n) {
291
- const h = r.get("fill"), d = r.get("fillPattern");
292
- n.animate({ key: "radius", to: o, duration: u, easing: c }), n._setDefault("fill", h), n._setDefault("fillPattern", d), n._setDefault("stroke", h);
291
+ const f = r.get("fill"), d = r.get("fillPattern");
292
+ n.animate({ key: "radius", to: o, duration: u, easing: c }), n._setDefault("fill", f), n._setDefault("fillPattern", d), n._setDefault("stroke", f);
293
293
  }
294
294
  }
295
295
  _updateNodesScale(r) {
296
296
  const e = r.data.dataItem;
297
297
  if (e) {
298
- const n = e.get("node"), i = e.get("circle"), s = this.getPrivate("scaleR", 1), a = r.x * s, l = r.y * s, o = r.r * s;
299
- n.setAll({ x: a, y: l }), i.set("radius", o);
298
+ const n = e.get("node"), s = e.get("circle"), i = this.getPrivate("scaleR", 1), a = r.x * i, l = r.y * i, o = r.r * i;
299
+ n.setAll({ x: a, y: l }), s.set("radius", o);
300
300
  const u = r.children;
301
- u && le(u, (c) => {
301
+ u && he(u, (c) => {
302
302
  this._updateNodesScale(c);
303
303
  });
304
304
  }
@@ -309,20 +309,20 @@ class R extends J {
309
309
  makeNode(r) {
310
310
  const e = super.makeNode(r), n = e.children.moveValue(this.circles.make(), 0);
311
311
  e.setPrivate("tooltipTarget", n), this.circles.push(n), r.setRaw("circle", n);
312
- const i = r.get("label");
312
+ const s = r.get("label");
313
313
  return n.on("radius", () => {
314
- const s = n.get("radius", this.width()) * 2;
315
- i.setAll({ maxWidth: s, maxHeight: s });
314
+ const i = n.get("radius", this.width()) * 2;
315
+ s.setAll({ maxWidth: i, maxHeight: i });
316
316
  }), e;
317
317
  }
318
318
  _zoom(r) {
319
319
  const e = r.get("d3HierarchyNode");
320
- let n = e.x, i = e.y, s = e.r, a = Math.min(this.innerWidth(), this.innerHeight()) / (s * 2);
320
+ let n = e.x, s = e.y, i = e.r, a = Math.min(this.innerWidth(), this.innerHeight()) / (i * 2);
321
321
  const l = this.get("animationEasing");
322
322
  let o = this.get("animationDuration", 0);
323
323
  this.inited || (o = 0), this.animatePrivate({ key: "scaleR", to: a, duration: o, easing: l });
324
324
  const u = this.nodesContainer;
325
- u.animate({ key: "x", from: u.x(), to: this.width() / 2 - n * a, duration: o, easing: l }), u.animate({ key: "y", from: u.y(), to: this.height() / 2 - i * a, duration: o, easing: l });
325
+ u.animate({ key: "x", from: u.x(), to: this.width() / 2 - n * a, duration: o, easing: l }), u.animate({ key: "y", from: u.y(), to: this.height() / 2 - s * a, duration: o, easing: l });
326
326
  }
327
327
  }
328
328
  Object.defineProperty(R, "className", {
@@ -335,10 +335,10 @@ Object.defineProperty(R, "classNames", {
335
335
  enumerable: !0,
336
336
  configurable: !0,
337
337
  writable: !0,
338
- value: J.classNames.concat([R.className])
338
+ value: I.classNames.concat([R.className])
339
339
  });
340
- function Ce(t, r) {
341
- const e = te(t);
340
+ function Te(t, r) {
341
+ const e = re(t);
342
342
  switch (r) {
343
343
  case "millisecond":
344
344
  return e.format("HH:mm:ss.SSS");
@@ -360,27 +360,27 @@ function Ce(t, r) {
360
360
  return e.format();
361
361
  }
362
362
  }
363
- const ze = (t) => {
364
- const r = ee({ props: t, name: "HCPackedCircles" }), {
365
- dimensions: e,
366
- values: n,
363
+ const Fe = (t) => {
364
+ const r = ee({ props: t, name: "HCPackedCircles" }), e = te(), {
365
+ dimensions: n,
366
+ values: s,
367
367
  data: i,
368
- initDelay: s = 0,
369
- baseInterval: a = { timeUnit: "year", count: 1 },
370
- colors: l,
371
- sx: o,
372
- ...u
373
- } = r, h = `hc-packed-circles-${re().replace(/:/g, "")}`, d = ne(null);
368
+ initDelay: a = 0,
369
+ baseInterval: l = { timeUnit: "year", count: 1 },
370
+ colors: o,
371
+ sx: u,
372
+ ...c
373
+ } = r, d = `hc-packed-circles-${ne().replace(/:/g, "")}`, p = se(null);
374
374
  let m = null;
375
- e.length < 1 ? m = "PackedCircles requires at least 1 dimension" : n.length < 1 && (m = "PackedCircles requires at least 1 value"), ie(() => {
375
+ n.length < 1 ? m = "PackedCircles requires at least 1 dimension" : s.length < 1 && (m = "PackedCircles requires at least 1 value"), ie(() => {
376
376
  if (m) return;
377
- let p;
378
- return p = setTimeout(() => {
379
- var v;
380
- const f = X.new(h);
381
- d.current = f, se(f, (v = n == null ? void 0 : n[0]) == null ? void 0 : v.format), f.setThemes([I.new(f)]);
382
- const y = f.container.children.push(
383
- U.new(f, {
377
+ let x;
378
+ return x = setTimeout(() => {
379
+ var g;
380
+ const h = Q.new(d);
381
+ p.current = h, oe(h, (g = s == null ? void 0 : s[0]) == null ? void 0 : g.format), h.setThemes([X.new(h)]), ae(h, e);
382
+ const b = h.container.children.push(
383
+ U.new(h, {
384
384
  width: q,
385
385
  height: q,
386
386
  // Off by default for the same reason the XY charts set `wheelX`/`wheelY`
@@ -390,33 +390,33 @@ const ze = (t) => {
390
390
  pinchZoom: !0
391
391
  })
392
392
  );
393
- y.children.push(
394
- j.new(f, { target: y })
393
+ b.children.push(
394
+ j.new(h, { target: b })
395
395
  );
396
- const x = y.contents.children.push(
397
- R.new(f, {
396
+ const v = b.contents.children.push(
397
+ R.new(h, {
398
398
  maskContent: !1,
399
399
  topDepth: 1,
400
- valueField: n[0].dataFieldName,
401
- categoryField: e[0].value,
400
+ valueField: s[0].dataFieldName,
401
+ categoryField: n[0].value,
402
402
  childDataField: "children"
403
403
  })
404
- ), w = oe(f, l);
405
- x.set("colors", w), e[0].type === "date" && i.forEach((g) => {
406
- g[e[0].value] = Ce(
407
- g[e[0].value],
408
- a.timeUnit
404
+ ), k = ue(h, o);
405
+ v.set("colors", k), n[0].type === "date" && i.forEach((y) => {
406
+ y[n[0].value] = Te(
407
+ y[n[0].value],
408
+ l.timeUnit
409
409
  );
410
- }), x.data.setAll([{ name: "Root", children: i }]), x.appear(1e3, 100);
411
- }, s), () => {
412
- var f;
413
- p && clearTimeout(p), (f = d.current) == null || f.dispose(), d.current = null;
410
+ }), v.data.setAll([{ name: "Root", children: i }]), v.appear(1e3, 100);
411
+ }, a), () => {
412
+ var h;
413
+ x && clearTimeout(x), (h = p.current) == null || h.dispose(), p.current = null;
414
414
  };
415
- }, [i, e, n, l]);
416
- const b = { ...r };
417
- return { chartId: h, ownerState: b, sx: o, error: m, other: u };
415
+ }, [i, n, s, o, e.palette.mode]);
416
+ const _ = { ...r };
417
+ return { chartId: d, ownerState: _, sx: u, error: m, other: c };
418
418
  };
419
419
  export {
420
- Ce as formatTimeLabel,
421
- ze as usePackedCirclesLogic
420
+ Te as formatTimeLabel,
421
+ Fe as usePackedCirclesLogic
422
422
  };