@overdoser/react-toolkit 0.0.7 → 0.0.8

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.
package/index.js CHANGED
@@ -1,47 +1,47 @@
1
- import { forwardRef as $e, createElement as cn, useState as Se, useCallback as he, useMemo as ke, useEffect as Be, useRef as te, useId as ze, createContext as jt, useContext as ft, cloneElement as ln, useImperativeHandle as sn, useLayoutEffect as an } from "react";
2
- import { jsxs as H, jsx as s, Fragment as Ye } from "react/jsx-runtime";
3
- import { FormProvider as dn, useFormContext as un, useController as hn } from "react-hook-form";
4
- import { createPortal as mn } from "react-dom";
5
- function Xt(e) {
1
+ import { forwardRef as $e, createElement as ln, useState as Se, useCallback as he, useMemo as ke, useEffect as Be, useRef as ne, useId as ze, isValidElement as sn, cloneElement as jt, createContext as Xt, useContext as ft, useImperativeHandle as an, useLayoutEffect as dn } from "react";
2
+ import { jsxs as H, jsx as s, Fragment as Ve } from "react/jsx-runtime";
3
+ import { FormProvider as un, useFormContext as hn, useController as mn } from "react-hook-form";
4
+ import { createPortal as fn } from "react-dom";
5
+ function Ut(e) {
6
6
  var t, n, r = "";
7
7
  if (typeof e == "string" || typeof e == "number") r += e;
8
8
  else if (typeof e == "object") if (Array.isArray(e)) {
9
9
  var o = e.length;
10
- for (t = 0; t < o; t++) e[t] && (n = Xt(e[t])) && (r && (r += " "), r += n);
10
+ for (t = 0; t < o; t++) e[t] && (n = Ut(e[t])) && (r && (r += " "), r += n);
11
11
  } else for (n in e) e[n] && (r && (r += " "), r += n);
12
12
  return r;
13
13
  }
14
14
  function f() {
15
- for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Xt(e)) && (r && (r += " "), r += t);
15
+ for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Ut(e)) && (r && (r += " "), r += t);
16
16
  return r;
17
17
  }
18
- const fn = "crk-root-8RX49", pn = "crk-loading-QfItr", gn = "crk-primary-st6yY", yn = "crk-secondary-j-3rj", vn = "crk-danger-Hxs5n", bn = "crk-ghost-kQ0A8", xn = "crk-sm-RXFPY", kn = "crk-md-nDnOD", Mn = "crk-lg-qD-Qh", wn = "crk-fullWidth-AHpSl", $n = "crk-iconOnly-FNrSu", Nn = "crk-content-PpYVU", Ln = "crk-shimmer-8iQSU", Sn = "crk-loadingShimmer-BVvFw", Tn = "crk-shimmerSweep-uiZ01", Rn = "crk-dots-U8wss", Cn = "crk-loadingDots-eKv64", An = "crk-dot-Owuk1", Bn = "crk-dotBounce-FwdcC", Dn = "crk-loadingBorder-9ULFw", In = "crk-borderSpin-EJ2gW", Ae = {
19
- root: fn,
20
- loading: pn,
21
- primary: gn,
22
- secondary: yn,
23
- danger: vn,
24
- ghost: bn,
25
- sm: xn,
26
- md: kn,
27
- lg: Mn,
28
- fullWidth: wn,
29
- iconOnly: $n,
30
- content: Nn,
31
- shimmer: Ln,
32
- loadingShimmer: Sn,
33
- shimmerSweep: Tn,
34
- dots: Rn,
35
- loadingDots: Cn,
36
- dot: An,
37
- dotBounce: Bn,
38
- loadingBorder: Dn,
39
- borderSpin: In
40
- }, En = {
18
+ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY", vn = "crk-secondary-j-3rj", bn = "crk-danger-Hxs5n", xn = "crk-ghost-kQ0A8", kn = "crk-sm-RXFPY", Mn = "crk-md-nDnOD", wn = "crk-lg-qD-Qh", $n = "crk-fullWidth-AHpSl", Nn = "crk-iconOnly-FNrSu", Ln = "crk-content-PpYVU", Sn = "crk-shimmer-8iQSU", Tn = "crk-loadingShimmer-BVvFw", Rn = "crk-shimmerSweep-uiZ01", Cn = "crk-dots-U8wss", An = "crk-loadingDots-eKv64", Bn = "crk-dot-Owuk1", Dn = "crk-dotBounce-FwdcC", In = "crk-loadingBorder-9ULFw", En = "crk-borderSpin-EJ2gW", Ae = {
19
+ root: pn,
20
+ loading: gn,
21
+ primary: yn,
22
+ secondary: vn,
23
+ danger: bn,
24
+ ghost: xn,
25
+ sm: kn,
26
+ md: Mn,
27
+ lg: wn,
28
+ fullWidth: $n,
29
+ iconOnly: Nn,
30
+ content: Ln,
31
+ shimmer: Sn,
32
+ loadingShimmer: Tn,
33
+ shimmerSweep: Rn,
34
+ dots: Cn,
35
+ loadingDots: An,
36
+ dot: Bn,
37
+ dotBounce: Dn,
38
+ loadingBorder: In,
39
+ borderSpin: En
40
+ }, Pn = {
41
41
  dots: Ae.loadingDots,
42
42
  shimmer: Ae.loadingShimmer,
43
43
  border: Ae.loadingBorder
44
- }, Ut = $e(
44
+ }, _t = $e(
45
45
  ({
46
46
  variant: e = "primary",
47
47
  size: t = "md",
@@ -53,8 +53,8 @@ const fn = "crk-root-8RX49", pn = "crk-loading-QfItr", gn = "crk-primary-st6yY",
53
53
  classes: l,
54
54
  className: a,
55
55
  style: h,
56
- children: u,
57
- ...d
56
+ children: d,
57
+ ...u
58
58
  }, m) => /* @__PURE__ */ H(
59
59
  "button",
60
60
  {
@@ -66,17 +66,17 @@ const fn = "crk-root-8RX49", pn = "crk-loading-QfItr", gn = "crk-primary-st6yY",
66
66
  o && Ae.fullWidth,
67
67
  i && Ae.iconOnly,
68
68
  n && Ae.loading,
69
- n && En[r],
69
+ n && Pn[r],
70
70
  l?.root,
71
71
  a
72
72
  ),
73
73
  style: h,
74
74
  disabled: c || n,
75
75
  "aria-busy": n || void 0,
76
- ...d,
76
+ ...u,
77
77
  children: [
78
78
  /* @__PURE__ */ s("div", { className: f(Ae.shimmer, l?.shimmer) }),
79
- /* @__PURE__ */ s("span", { className: f(Ae.content, l?.content), children: u }),
79
+ /* @__PURE__ */ s("span", { className: f(Ae.content, l?.content), children: d }),
80
80
  /* @__PURE__ */ H("span", { className: f(Ae.dots, l?.dots), "aria-hidden": "true", children: [
81
81
  /* @__PURE__ */ s("span", { className: f(Ae.dot, l?.dot) }),
82
82
  /* @__PURE__ */ s("span", { className: f(Ae.dot, l?.dot) }),
@@ -86,14 +86,14 @@ const fn = "crk-root-8RX49", pn = "crk-loading-QfItr", gn = "crk-primary-st6yY",
86
86
  }
87
87
  )
88
88
  );
89
- Ut.displayName = "Button";
90
- const Pn = "crk-root-2j4Vp", Wn = "crk-muted-vReNc", Hn = "crk-danger-ugf9r", On = "crk-srOnly-LGQgs", $t = {
91
- root: Pn,
89
+ _t.displayName = "Button";
90
+ const Wn = "crk-root-2j4Vp", Hn = "crk-muted-vReNc", On = "crk-danger-ugf9r", Fn = "crk-srOnly-LGQgs", $t = {
91
+ root: Wn,
92
92
  default: "crk-default-3TBlr",
93
- muted: Wn,
94
- danger: Hn,
95
- srOnly: On
96
- }, Fn = $e(
93
+ muted: Hn,
94
+ danger: On,
95
+ srOnly: Fn
96
+ }, jn = $e(
97
97
  ({
98
98
  variant: e = "default",
99
99
  external: t = !1,
@@ -119,32 +119,32 @@ const Pn = "crk-root-2j4Vp", Wn = "crk-muted-vReNc", Hn = "crk-danger-ugf9r", On
119
119
  }
120
120
  )
121
121
  );
122
- Fn.displayName = "Link";
123
- const jn = "crk-root-U-oiq", Xn = "crk-h1-Aivwz", Un = "crk-h2-CV8Oo", _n = "crk-h3-lrbrK", zn = "crk-h4--jkC1", Yn = "crk-h5-GnQvD", Vn = "crk-h6-MKlIN", qn = "crk-p-FzRtm", Gn = "crk-span-NZvLx", Zn = "crk-label-Cwi6a", Kn = "crk-normal-7AeZz", Qn = "crk-medium-36OXr", Jn = "crk-semibold-oQixc", er = "crk-bold-bk4b4", tr = "crk-muted-itOSW", nr = "crk-primary-rp36t", rr = "crk-danger-SyOy-", or = "crk-success-w8PpD", cr = "crk-align-left-3AGYw", ir = "crk-align-center-h-x--", lr = "crk-align-right-IXFhK", sr = "crk-truncate-eqr85", _e = {
124
- root: jn,
125
- h1: Xn,
126
- h2: Un,
127
- h3: _n,
128
- h4: zn,
122
+ jn.displayName = "Link";
123
+ const Xn = "crk-root-U-oiq", Un = "crk-h1-Aivwz", _n = "crk-h2-CV8Oo", zn = "crk-h3-lrbrK", Vn = "crk-h4--jkC1", Yn = "crk-h5-GnQvD", qn = "crk-h6-MKlIN", Gn = "crk-p-FzRtm", Zn = "crk-span-NZvLx", Kn = "crk-label-Cwi6a", Qn = "crk-normal-7AeZz", Jn = "crk-medium-36OXr", er = "crk-semibold-oQixc", tr = "crk-bold-bk4b4", nr = "crk-muted-itOSW", rr = "crk-primary-rp36t", or = "crk-danger-SyOy-", cr = "crk-success-w8PpD", ir = "crk-align-left-3AGYw", lr = "crk-align-center-h-x--", sr = "crk-align-right-IXFhK", ar = "crk-truncate-eqr85", _e = {
124
+ root: Xn,
125
+ h1: Un,
126
+ h2: _n,
127
+ h3: zn,
128
+ h4: Vn,
129
129
  h5: Yn,
130
- h6: Vn,
131
- p: qn,
132
- span: Gn,
133
- label: Zn,
134
- normal: Kn,
135
- medium: Qn,
136
- semibold: Jn,
137
- bold: er,
130
+ h6: qn,
131
+ p: Gn,
132
+ span: Zn,
133
+ label: Kn,
134
+ normal: Qn,
135
+ medium: Jn,
136
+ semibold: er,
137
+ bold: tr,
138
138
  default: "crk-default-79lKR",
139
- muted: tr,
140
- primary: nr,
141
- danger: rr,
142
- success: or,
143
- alignLeft: cr,
144
- alignCenter: ir,
145
- alignRight: lr,
146
- truncate: sr
147
- }, ar = $e(
139
+ muted: nr,
140
+ primary: rr,
141
+ danger: or,
142
+ success: cr,
143
+ alignLeft: ir,
144
+ alignCenter: lr,
145
+ alignRight: sr,
146
+ truncate: ar
147
+ }, dr = $e(
148
148
  ({
149
149
  variant: e = "p",
150
150
  weight: t,
@@ -155,7 +155,7 @@ const jn = "crk-root-U-oiq", Xn = "crk-h1-Aivwz", Un = "crk-h2-CV8Oo", _n = "crk
155
155
  style: c,
156
156
  children: l,
157
157
  ...a
158
- }, h) => cn(
158
+ }, h) => ln(
159
159
  e,
160
160
  {
161
161
  ref: h,
@@ -174,17 +174,17 @@ const jn = "crk-root-U-oiq", Xn = "crk-h1-Aivwz", Un = "crk-h2-CV8Oo", _n = "crk
174
174
  l
175
175
  )
176
176
  );
177
- ar.displayName = "Typography";
178
- const dr = "crk-root-PVrgx", ur = "crk-unordered-FhCWT", hr = "crk-item-TfW82", mr = "crk-ordered-8x4YC", fr = "crk-none-f03Kx", pr = "crk-sm-Rg4Mv", gr = "crk-md-X4Icb", yr = "crk-lg-JjNKZ", ut = {
179
- root: dr,
180
- unordered: ur,
181
- item: hr,
182
- ordered: mr,
183
- none: fr,
184
- sm: pr,
185
- md: gr,
186
- lg: yr
187
- }, vr = $e(
177
+ dr.displayName = "Typography";
178
+ const ur = "crk-root-PVrgx", hr = "crk-unordered-FhCWT", mr = "crk-item-TfW82", fr = "crk-ordered-8x4YC", pr = "crk-none-f03Kx", gr = "crk-sm-Rg4Mv", yr = "crk-md-X4Icb", vr = "crk-lg-JjNKZ", ut = {
179
+ root: ur,
180
+ unordered: hr,
181
+ item: mr,
182
+ ordered: fr,
183
+ none: pr,
184
+ sm: gr,
185
+ md: yr,
186
+ lg: vr
187
+ }, br = $e(
188
188
  ({
189
189
  variant: e = "unordered",
190
190
  spacing: t = "md",
@@ -208,8 +208,8 @@ const dr = "crk-root-PVrgx", ur = "crk-unordered-FhCWT", hr = "crk-item-TfW82",
208
208
  }
209
209
  )
210
210
  );
211
- vr.displayName = "List";
212
- const br = $e(
211
+ br.displayName = "List";
212
+ const xr = $e(
213
213
  ({ className: e, style: t, children: n, ...r }, o) => /* @__PURE__ */ s(
214
214
  "li",
215
215
  {
@@ -221,65 +221,65 @@ const br = $e(
221
221
  }
222
222
  )
223
223
  );
224
- br.displayName = "ListItem";
225
- const xr = "crk-wrapper-zxjMt", kr = "crk-root-Gf85-", Mr = "crk-headerCell-ePPZW", wr = "crk-headerCellSortable-NMybk", $r = "crk-sortIndicator-WGD2S", Nr = "crk-sortArrow-1-ok4", Lr = "crk-sortArrowActive-yhWrO", Sr = "crk-sortIndex-HGoca", Tr = "crk-row-H0wL1", Rr = "crk-cell-ZfnbG", Cr = "crk-emptyRow-AoPfj", Ar = "crk-emptyCell-99-7C", Br = "crk-striped-6Qckq", Dr = "crk-hoverable-ljU9B", Ir = "crk-compact-2-UWr", Er = "crk-paginator-UlYIY", Pr = "crk-paginatorInfo-BVca4", Wr = "crk-paginatorText-sqWS0", Hr = "crk-pageSizeSelect-yhqJQ", Or = "crk-paginatorNav-MDSui", Fr = "crk-pageButton-1PX-g", jr = "crk-pageButtonActive--D7Q7", Xr = "crk-pageEllipsis-en59J", ye = {
226
- wrapper: xr,
227
- root: kr,
228
- headerCell: Mr,
229
- headerCellSortable: wr,
230
- sortIndicator: $r,
231
- sortArrow: Nr,
232
- sortArrowActive: Lr,
233
- sortIndex: Sr,
234
- row: Tr,
235
- cell: Rr,
236
- emptyRow: Cr,
237
- emptyCell: Ar,
238
- striped: Br,
239
- hoverable: Dr,
240
- compact: Ir,
241
- paginator: Er,
242
- paginatorInfo: Pr,
243
- paginatorText: Wr,
244
- pageSizeSelect: Hr,
245
- paginatorNav: Or,
246
- pageButton: Fr,
247
- pageButtonActive: jr,
248
- pageEllipsis: Xr
224
+ xr.displayName = "ListItem";
225
+ const kr = "crk-wrapper-zxjMt", Mr = "crk-root-Gf85-", wr = "crk-headerCell-ePPZW", $r = "crk-headerCellSortable-NMybk", Nr = "crk-sortIndicator-WGD2S", Lr = "crk-sortArrow-1-ok4", Sr = "crk-sortArrowActive-yhWrO", Tr = "crk-sortIndex-HGoca", Rr = "crk-row-H0wL1", Cr = "crk-cell-ZfnbG", Ar = "crk-emptyRow-AoPfj", Br = "crk-emptyCell-99-7C", Dr = "crk-striped-6Qckq", Ir = "crk-hoverable-ljU9B", Er = "crk-compact-2-UWr", Pr = "crk-paginator-UlYIY", Wr = "crk-paginatorInfo-BVca4", Hr = "crk-paginatorText-sqWS0", Or = "crk-pageSizeSelect-yhqJQ", Fr = "crk-paginatorNav-MDSui", jr = "crk-pageButton-1PX-g", Xr = "crk-pageButtonActive--D7Q7", Ur = "crk-pageEllipsis-en59J", ye = {
226
+ wrapper: kr,
227
+ root: Mr,
228
+ headerCell: wr,
229
+ headerCellSortable: $r,
230
+ sortIndicator: Nr,
231
+ sortArrow: Lr,
232
+ sortArrowActive: Sr,
233
+ sortIndex: Tr,
234
+ row: Rr,
235
+ cell: Cr,
236
+ emptyRow: Ar,
237
+ emptyCell: Br,
238
+ striped: Dr,
239
+ hoverable: Ir,
240
+ compact: Er,
241
+ paginator: Pr,
242
+ paginatorInfo: Wr,
243
+ paginatorText: Hr,
244
+ pageSizeSelect: Or,
245
+ paginatorNav: Fr,
246
+ pageButton: jr,
247
+ pageButtonActive: Xr,
248
+ pageEllipsis: Ur
249
249
  };
250
- function Ur(e, t) {
250
+ function _r(e, t) {
251
251
  return e == null && t == null ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t));
252
252
  }
253
- function _r(e, t = []) {
253
+ function zr(e, t = []) {
254
254
  const [n, r] = Se(t), o = he((a) => {
255
255
  r((h) => {
256
- const u = h.find((d) => d.key === a);
257
- return u ? u.direction === "asc" ? [{ key: a, direction: "desc" }] : [] : [{ key: a, direction: "asc" }];
256
+ const d = h.find((u) => u.key === a);
257
+ return d ? d.direction === "asc" ? [{ key: a, direction: "desc" }] : [] : [{ key: a, direction: "asc" }];
258
258
  });
259
259
  }, []), i = he((a) => {
260
260
  r((h) => {
261
- const u = h.findIndex((m) => m.key === a);
262
- if (u === -1)
261
+ const d = h.findIndex((m) => m.key === a);
262
+ if (d === -1)
263
263
  return [...h, { key: a, direction: "asc" }];
264
- if (h[u].direction === "asc") {
264
+ if (h[d].direction === "asc") {
265
265
  const m = [...h];
266
- return m[u] = { key: a, direction: "desc" }, m;
266
+ return m[d] = { key: a, direction: "desc" }, m;
267
267
  }
268
- return h.filter((m, p) => p !== u);
268
+ return h.filter((m, p) => p !== d);
269
269
  });
270
270
  }, []), c = he(() => {
271
271
  r([]);
272
272
  }, []);
273
273
  return { sortedData: ke(() => n.length === 0 ? e : [...e].sort((a, h) => {
274
- for (const { key: u, direction: d } of n) {
275
- const m = Ur(a[u], h[u]);
274
+ for (const { key: d, direction: u } of n) {
275
+ const m = _r(a[d], h[d]);
276
276
  if (m !== 0)
277
- return d === "asc" ? m : -m;
277
+ return u === "asc" ? m : -m;
278
278
  }
279
279
  return 0;
280
280
  }), [e, n]), sortConfig: n, requestSort: o, requestMultiSort: i, resetSort: c };
281
281
  }
282
- function zr({ direction: e, sortIndex: t }) {
282
+ function Vr({ direction: e, sortIndex: t }) {
283
283
  return /* @__PURE__ */ H("span", { className: ye.sortIndicator, "aria-hidden": "true", children: [
284
284
  /* @__PURE__ */ s("span", { className: f(ye.sortArrow, e === "asc" && ye.sortArrowActive), children: "▲" }),
285
285
  /* @__PURE__ */ s("span", { className: f(ye.sortArrow, e === "desc" && ye.sortArrowActive), children: "▼" }),
@@ -295,16 +295,16 @@ function Yr({
295
295
  paginatorClasses: i
296
296
  }) {
297
297
  const c = Math.max(1, Math.ceil(n / t)), l = (e - 1) * t + 1, a = Math.min(e * t, n), h = ke(() => {
298
- const u = [];
298
+ const d = [];
299
299
  if (c <= 7)
300
- for (let d = 1; d <= c; d++) u.push(d);
300
+ for (let u = 1; u <= c; u++) d.push(u);
301
301
  else {
302
- u.push(1), e > 3 && u.push("ellipsis");
303
- for (let d = Math.max(2, e - 1); d <= Math.min(c - 1, e + 1); d++)
304
- u.push(d);
305
- e < c - 2 && u.push("ellipsis"), u.push(c);
302
+ d.push(1), e > 3 && d.push("ellipsis");
303
+ for (let u = Math.max(2, e - 1); u <= Math.min(c - 1, e + 1); u++)
304
+ d.push(u);
305
+ e < c - 2 && d.push("ellipsis"), d.push(c);
306
306
  }
307
- return u;
307
+ return d;
308
308
  }, [e, c]);
309
309
  return /* @__PURE__ */ H("nav", { className: f(ye.paginator, i?.paginator), "aria-label": "Table pagination", children: [
310
310
  /* @__PURE__ */ H("div", { className: ye.paginatorInfo, children: [
@@ -314,12 +314,12 @@ function Yr({
314
314
  {
315
315
  className: ye.pageSizeSelect,
316
316
  value: t,
317
- onChange: (u) => o(1, Number(u.target.value)),
317
+ onChange: (d) => o(1, Number(d.target.value)),
318
318
  "aria-label": "Rows per page",
319
- children: r.map((u) => /* @__PURE__ */ H("option", { value: u, children: [
320
- u,
319
+ children: r.map((d) => /* @__PURE__ */ H("option", { value: d, children: [
320
+ d,
321
321
  " / page"
322
- ] }, u))
322
+ ] }, d))
323
323
  }
324
324
  )
325
325
  ] }),
@@ -336,17 +336,17 @@ function Yr({
336
336
  }
337
337
  ),
338
338
  h.map(
339
- (u, d) => u === "ellipsis" ? /* @__PURE__ */ s("span", { className: ye.pageEllipsis, children: "…" }, `ellipsis-${d}`) : /* @__PURE__ */ s(
339
+ (d, u) => d === "ellipsis" ? /* @__PURE__ */ s("span", { className: ye.pageEllipsis, children: "…" }, `ellipsis-${u}`) : /* @__PURE__ */ s(
340
340
  "button",
341
341
  {
342
342
  type: "button",
343
- className: f(ye.pageButton, u === e && ye.pageButtonActive, i?.pageButton),
344
- onClick: () => o(u, t),
345
- "aria-label": `Page ${u}`,
346
- "aria-current": u === e ? "page" : void 0,
347
- children: u
343
+ className: f(ye.pageButton, d === e && ye.pageButtonActive, i?.pageButton),
344
+ onClick: () => o(d, t),
345
+ "aria-label": `Page ${d}`,
346
+ "aria-current": d === e ? "page" : void 0,
347
+ children: d
348
348
  },
349
- u
349
+ d
350
350
  )
351
351
  ),
352
352
  /* @__PURE__ */ s(
@@ -363,7 +363,7 @@ function Yr({
363
363
  ] })
364
364
  ] });
365
365
  }
366
- function Vr({
366
+ function qr({
367
367
  data: e,
368
368
  columns: t,
369
369
  sortConfig: n,
@@ -374,48 +374,48 @@ function Vr({
374
374
  compact: l = !1,
375
375
  className: a,
376
376
  style: h,
377
- rowKey: u,
378
- emptyMessage: d = "No data",
377
+ rowKey: d,
378
+ emptyMessage: u = "No data",
379
379
  pagination: m,
380
380
  classes: p
381
381
  }) {
382
382
  const y = r !== void 0, {
383
- sortedData: $,
384
- sortConfig: k,
385
- requestSort: R,
386
- requestMultiSort: X
387
- } = _r(e, n), E = y ? n ?? [] : k, W = y ? e : $, ae = ke(() => {
388
- if (!m || y) return W;
389
- const w = (m.page - 1) * m.pageSize;
390
- return W.slice(w, w + m.pageSize);
391
- }, [W, m, y]), _ = m?.totalRows ?? W.length, C = he(
392
- (w, q) => {
393
- const D = o && (q.ctrlKey || q.metaKey);
383
+ sortedData: w,
384
+ sortConfig: N,
385
+ requestSort: S,
386
+ requestMultiSort: O
387
+ } = zr(e, n), P = y ? n ?? [] : N, U = y ? e : w, re = ke(() => {
388
+ if (!m || y) return U;
389
+ const M = (m.page - 1) * m.pageSize;
390
+ return U.slice(M, M + m.pageSize);
391
+ }, [U, m, y]), D = m?.totalRows ?? U.length, C = he(
392
+ (M, q) => {
393
+ const I = o && (q.ctrlKey || q.metaKey);
394
394
  if (y)
395
- if (D) {
396
- const Q = E.findIndex((P) => P.key === w);
397
- let O;
398
- Q === -1 ? O = [...E, { key: w, direction: "asc" }] : E[Q].direction === "asc" ? O = E.map(
399
- (P, ee) => ee === Q ? { key: w, direction: "desc" } : P
400
- ) : O = E.filter((P, ee) => ee !== Q), r(O);
395
+ if (I) {
396
+ const Q = P.findIndex((W) => W.key === M);
397
+ let F;
398
+ Q === -1 ? F = [...P, { key: M, direction: "asc" }] : P[Q].direction === "asc" ? F = P.map(
399
+ (W, te) => te === Q ? { key: M, direction: "desc" } : W
400
+ ) : F = P.filter((W, te) => te !== Q), r(F);
401
401
  } else {
402
- const Q = E.find((O) => O.key === w);
403
- Q ? Q.direction === "asc" ? r([{ key: w, direction: "desc" }]) : r([]) : r([{ key: w, direction: "asc" }]);
402
+ const Q = P.find((F) => F.key === M);
403
+ Q ? Q.direction === "asc" ? r([{ key: M, direction: "desc" }]) : r([]) : r([{ key: M, direction: "asc" }]);
404
404
  }
405
405
  else
406
- D ? X(w) : R(w);
406
+ I ? O(M) : S(M);
407
407
  },
408
408
  [
409
409
  y,
410
410
  o,
411
- E,
411
+ P,
412
412
  r,
413
- R,
414
- X
413
+ S,
414
+ O
415
415
  ]
416
- ), oe = (w) => E.find((D) => D.key === w)?.direction, le = (w) => {
417
- if (E.length <= 1) return;
418
- const q = E.findIndex((D) => D.key === w);
416
+ ), ee = (M) => P.find((I) => I.key === M)?.direction, se = (M) => {
417
+ if (P.length <= 1) return;
418
+ const q = P.findIndex((I) => I.key === M);
419
419
  return q >= 0 ? q : void 0;
420
420
  };
421
421
  return /* @__PURE__ */ H("div", { className: f(ye.wrapper, p?.wrapper), children: [
@@ -432,44 +432,44 @@ function Vr({
432
432
  ),
433
433
  style: h,
434
434
  children: [
435
- /* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((w) => /* @__PURE__ */ H(
435
+ /* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((M) => /* @__PURE__ */ H(
436
436
  "th",
437
437
  {
438
438
  className: f(
439
439
  ye.headerCell,
440
- w.sortable && ye.headerCellSortable,
440
+ M.sortable && ye.headerCellSortable,
441
441
  p?.headerCell
442
442
  ),
443
443
  style: {
444
- width: w.width,
445
- textAlign: w.align
444
+ width: M.width,
445
+ textAlign: M.align
446
446
  },
447
- onClick: w.sortable ? (q) => C(w.key, q) : void 0,
448
- "aria-sort": w.sortable ? oe(w.key) === "asc" ? "ascending" : oe(w.key) === "desc" ? "descending" : "none" : void 0,
447
+ onClick: M.sortable ? (q) => C(M.key, q) : void 0,
448
+ "aria-sort": M.sortable ? ee(M.key) === "asc" ? "ascending" : ee(M.key) === "desc" ? "descending" : "none" : void 0,
449
449
  children: [
450
- w.header,
451
- w.sortable && /* @__PURE__ */ s(
452
- zr,
450
+ M.header,
451
+ M.sortable && /* @__PURE__ */ s(
452
+ Vr,
453
453
  {
454
- direction: oe(w.key),
455
- sortIndex: le(w.key)
454
+ direction: ee(M.key),
455
+ sortIndex: se(M.key)
456
456
  }
457
457
  )
458
458
  ]
459
459
  },
460
- w.key
460
+ M.key
461
461
  )) }) }),
462
- /* @__PURE__ */ s("tbody", { children: ae.length === 0 ? /* @__PURE__ */ s("tr", { className: ye.emptyRow, children: /* @__PURE__ */ s("td", { className: f(ye.emptyCell, p?.emptyCell), colSpan: t.length, children: d }) }) : ae.map((w, q) => {
463
- const D = u ? String(w[u]) : q;
462
+ /* @__PURE__ */ s("tbody", { children: re.length === 0 ? /* @__PURE__ */ s("tr", { className: ye.emptyRow, children: /* @__PURE__ */ s("td", { className: f(ye.emptyCell, p?.emptyCell), colSpan: t.length, children: u }) }) : re.map((M, q) => {
463
+ const I = d ? String(M[d]) : q;
464
464
  return /* @__PURE__ */ s("tr", { className: f(ye.row, p?.row), children: t.map((Q) => /* @__PURE__ */ s(
465
465
  "td",
466
466
  {
467
467
  className: f(ye.cell, p?.cell),
468
468
  style: { textAlign: Q.align },
469
- children: Q.render ? Q.render(w[Q.key], w, q) : w[Q.key]
469
+ children: Q.render ? Q.render(M[Q.key], M, q) : M[Q.key]
470
470
  },
471
471
  Q.key
472
- )) }, D);
472
+ )) }, I);
473
473
  }) })
474
474
  ]
475
475
  }
@@ -478,28 +478,28 @@ function Vr({
478
478
  Yr,
479
479
  {
480
480
  ...m,
481
- totalRows: _,
481
+ totalRows: D,
482
482
  paginatorClasses: { paginator: p?.paginator, pageButton: p?.pageButton }
483
483
  }
484
484
  )
485
485
  ] });
486
486
  }
487
- const Al = Vr, qr = "crk-root-an8Cf", Gr = "crk-fullWidth-S-uVk", Zr = "crk-trigger-LwPaD", Kr = "crk-triggerOpen-U4pa9", Qr = "crk-triggerLabel-QLITs", Jr = "crk-triggerError-3jlu1", eo = "crk-placeholder-fWdch", to = "crk-chevron-jmDNe", no = "crk-menu-fxnKL", ro = "crk-menuOpen-HF-Y1", oo = "crk-alignLeft-buCDJ", co = "crk-alignRight-05P9w", io = "crk-item-f-Rhh", lo = "crk-itemDisabled-L-d6i", so = "crk-itemSelected-Fwmuo", Me = {
488
- root: qr,
489
- fullWidth: Gr,
490
- trigger: Zr,
491
- triggerOpen: Kr,
492
- triggerLabel: Qr,
493
- triggerError: Jr,
494
- placeholder: eo,
495
- chevron: to,
496
- menu: no,
497
- menuOpen: ro,
498
- alignLeft: oo,
499
- alignRight: co,
500
- item: io,
501
- itemDisabled: lo,
502
- itemSelected: so
487
+ const Il = qr, Gr = "crk-root-an8Cf", Zr = "crk-fullWidth-S-uVk", Kr = "crk-trigger-LwPaD", Qr = "crk-triggerOpen-U4pa9", Jr = "crk-triggerLabel-QLITs", eo = "crk-triggerError-3jlu1", to = "crk-placeholder-fWdch", no = "crk-chevron-jmDNe", ro = "crk-menu-fxnKL", oo = "crk-menuOpen-HF-Y1", co = "crk-alignLeft-buCDJ", io = "crk-alignRight-05P9w", lo = "crk-item-f-Rhh", so = "crk-itemDisabled-L-d6i", ao = "crk-itemSelected-Fwmuo", Me = {
488
+ root: Gr,
489
+ fullWidth: Zr,
490
+ trigger: Kr,
491
+ triggerOpen: Qr,
492
+ triggerLabel: Jr,
493
+ triggerError: eo,
494
+ placeholder: to,
495
+ chevron: no,
496
+ menu: ro,
497
+ menuOpen: oo,
498
+ alignLeft: co,
499
+ alignRight: io,
500
+ item: lo,
501
+ itemDisabled: so,
502
+ itemSelected: ao
503
503
  };
504
504
  function pt(e, t, n = !0) {
505
505
  Be(() => {
@@ -527,7 +527,7 @@ function Tt(e, t = !0) {
527
527
  };
528
528
  }, [t, n]);
529
529
  }
530
- const _t = $e(
530
+ const zt = $e(
531
531
  ({
532
532
  trigger: e,
533
533
  children: t,
@@ -539,62 +539,62 @@ const _t = $e(
539
539
  onClose: l,
540
540
  options: a,
541
541
  placeholder: h = "Select...",
542
- value: u,
543
- onChange: d,
542
+ value: d,
543
+ onChange: u,
544
544
  error: m = !1,
545
545
  fullWidth: p = !0,
546
546
  classes: y
547
- }, $) => {
548
- const [k, R] = Se(!1), X = te(null), E = te(null), W = te(null), ae = ze();
547
+ }, w) => {
548
+ const [N, S] = Se(!1), O = ne(null), P = ne(null), U = ne(null), re = ze();
549
549
  Be(() => {
550
- k && E.current && E.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
551
- }, [k]);
552
- const _ = he(() => {
553
- R(!1), l?.(), W.current?.focus();
550
+ N && P.current && P.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
551
+ }, [N]);
552
+ const D = he(() => {
553
+ S(!1), l?.(), U.current?.focus();
554
554
  }, [l]), C = he(() => {
555
- R((D) => {
556
- const Q = !D;
555
+ S((I) => {
556
+ const Q = !I;
557
557
  return Q ? c?.() : l?.(), Q;
558
558
  });
559
- }, [c, l]), oe = he(
560
- (D) => {
561
- d?.(D), _();
559
+ }, [c, l]), ee = he(
560
+ (I) => {
561
+ u?.(I), D();
562
562
  },
563
- [d, _]
563
+ [u, D]
564
564
  );
565
- pt(X, _, k), Tt(
565
+ pt(O, D, N), Tt(
566
566
  {
567
- Escape: () => _()
567
+ Escape: () => D()
568
568
  },
569
- k
569
+ N
570
570
  );
571
- const le = a?.find((D) => D.value === u)?.label, w = a ? le || h : e, q = a && !le;
571
+ const se = a?.find((I) => I.value === d)?.label, M = a ? se || h : e, q = a && !se;
572
572
  return /* @__PURE__ */ s(
573
573
  "div",
574
574
  {
575
- ref: $,
575
+ ref: w,
576
576
  className: f(Me.root, p && Me.fullWidth, y?.root, r),
577
577
  style: o,
578
- children: /* @__PURE__ */ H("div", { ref: X, style: p ? { width: "100%" } : void 0, children: [
578
+ children: /* @__PURE__ */ H("div", { ref: O, style: p ? { width: "100%" } : void 0, children: [
579
579
  /* @__PURE__ */ H(
580
580
  "button",
581
581
  {
582
- ref: W,
582
+ ref: U,
583
583
  id: i,
584
584
  type: "button",
585
585
  className: f(
586
586
  Me.trigger,
587
- k && Me.triggerOpen,
587
+ N && Me.triggerOpen,
588
588
  m && Me.triggerError,
589
589
  p && Me.fullWidth,
590
590
  y?.trigger
591
591
  ),
592
592
  onClick: C,
593
- "aria-expanded": k,
593
+ "aria-expanded": N,
594
594
  "aria-haspopup": "menu",
595
- "aria-controls": k ? ae : void 0,
595
+ "aria-controls": N ? re : void 0,
596
596
  children: [
597
- /* @__PURE__ */ s("span", { className: f(Me.triggerLabel, q && Me.placeholder, y?.triggerLabel), children: w }),
597
+ /* @__PURE__ */ s("span", { className: f(Me.triggerLabel, q && Me.placeholder, y?.triggerLabel), children: M }),
598
598
  /* @__PURE__ */ s("span", { className: f(Me.chevron, y?.chevron), "aria-hidden": "true" })
599
599
  ]
600
600
  }
@@ -602,32 +602,32 @@ const _t = $e(
602
602
  /* @__PURE__ */ s(
603
603
  "div",
604
604
  {
605
- ref: E,
606
- id: ae,
605
+ ref: P,
606
+ id: re,
607
607
  className: f(
608
608
  Me.menu,
609
- k && Me.menuOpen,
609
+ N && Me.menuOpen,
610
610
  n === "left" ? Me.alignLeft : Me.alignRight,
611
611
  p && Me.fullWidth,
612
612
  y?.menu
613
613
  ),
614
614
  role: "menu",
615
- children: a ? a.map((D) => /* @__PURE__ */ s(
615
+ children: a ? a.map((I) => /* @__PURE__ */ s(
616
616
  "button",
617
617
  {
618
618
  type: "button",
619
619
  role: "menuitem",
620
620
  className: f(
621
621
  Me.item,
622
- D.disabled && Me.itemDisabled,
623
- D.value === u && Me.itemSelected,
622
+ I.disabled && Me.itemDisabled,
623
+ I.value === d && Me.itemSelected,
624
624
  y?.item
625
625
  ),
626
- disabled: D.disabled,
627
- onClick: () => oe(D.value),
628
- children: D.label
626
+ disabled: I.disabled,
627
+ onClick: () => ee(I.value),
628
+ children: I.label
629
629
  },
630
- D.value
630
+ I.value
631
631
  )) : t
632
632
  }
633
633
  )
@@ -636,8 +636,8 @@ const _t = $e(
636
636
  );
637
637
  }
638
638
  );
639
- _t.displayName = "Dropdown";
640
- const ao = $e(
639
+ zt.displayName = "Dropdown";
640
+ const uo = $e(
641
641
  ({
642
642
  disabled: e = !1,
643
643
  className: t,
@@ -660,78 +660,102 @@ const ao = $e(
660
660
  }
661
661
  )
662
662
  );
663
- ao.displayName = "DropdownItem";
664
- const uo = "crk-root-8H-L9", ho = "crk-trigger-Zn1nQ", mo = "crk-popover-rvS3X", fo = "crk-popoverFade-hj41M", po = "crk-bottom-lawQw", go = "crk-top-rqvC6", yo = "crk-left-J6exv", vo = "crk-right-3y20l", at = {
665
- root: uo,
666
- trigger: ho,
667
- popover: mo,
668
- popoverFade: fo,
669
- bottom: po,
670
- top: go,
671
- left: yo,
672
- right: vo
673
- }, zt = $e(
663
+ uo.displayName = "DropdownItem";
664
+ const ho = "crk-root-8H-L9", mo = "crk-trigger-Zn1nQ", fo = "crk-popover-rvS3X", po = "crk-popoverFade-hj41M", go = "crk-bottom-lawQw", yo = "crk-top-rqvC6", vo = "crk-left-J6exv", bo = "crk-right-3y20l", at = {
665
+ root: ho,
666
+ trigger: mo,
667
+ popover: fo,
668
+ popoverFade: po,
669
+ bottom: go,
670
+ top: yo,
671
+ left: vo,
672
+ right: bo
673
+ };
674
+ function xo(...e) {
675
+ return (t) => {
676
+ for (const n of e)
677
+ n && (typeof n == "function" ? n(t) : n.current = t);
678
+ };
679
+ }
680
+ const Vt = $e(
674
681
  ({
675
682
  trigger: e,
676
- content: t,
677
- position: n = "bottom",
678
- open: r,
679
- onOpenChange: o,
680
- classes: i,
681
- className: c,
682
- style: l
683
- }, a) => {
684
- const [h, u] = Se(!1), d = te(null), m = te(null), p = te(null), y = ze(), $ = r !== void 0, k = $ ? r : h, R = he(
685
- (W) => {
686
- $ || u(W), o?.(W);
683
+ asChild: t = !1,
684
+ content: n,
685
+ position: r = "bottom",
686
+ open: o,
687
+ onOpenChange: i,
688
+ classes: c,
689
+ className: l,
690
+ style: a
691
+ }, h) => {
692
+ const [d, u] = Se(!1), m = ne(null), p = ne(null), y = ne(null), w = ze(), N = o !== void 0, S = N ? o : d, O = he(
693
+ (D) => {
694
+ N || u(D), i?.(D);
687
695
  },
688
- [$, o]
689
- ), X = he(() => {
690
- R(!1), p.current?.focus();
691
- }, [R]), E = he(() => {
692
- R(!k);
693
- }, [k, R]);
694
- return pt(d, X, k), Tt(
696
+ [N, i]
697
+ ), P = he(() => {
698
+ O(!1), y.current?.focus();
699
+ }, [O]), U = he(() => {
700
+ O(!S);
701
+ }, [S, O]);
702
+ pt(m, P, S), Tt(
695
703
  {
696
- Escape: () => X()
704
+ Escape: () => P()
697
705
  },
698
- k
706
+ S
699
707
  ), Be(() => {
700
- if (k && m.current) {
701
- const W = m.current.querySelector(
708
+ if (S && p.current) {
709
+ const D = p.current.querySelector(
702
710
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
703
711
  );
704
- W ? W.focus() : m.current.focus();
712
+ D ? D.focus() : p.current.focus();
705
713
  }
706
- }, [k]), /* @__PURE__ */ s(
714
+ }, [S]);
715
+ let re;
716
+ if (t && sn(e)) {
717
+ const D = e, C = D.ref;
718
+ re = jt(D, {
719
+ ref: xo(y, C),
720
+ onClick: (ee) => {
721
+ D.props.onClick?.(ee), U();
722
+ },
723
+ className: f(D.props.className, c?.trigger),
724
+ "aria-expanded": S,
725
+ "aria-haspopup": "dialog",
726
+ "aria-controls": S ? w : void 0
727
+ });
728
+ } else
729
+ re = /* @__PURE__ */ s(
730
+ "button",
731
+ {
732
+ ref: y,
733
+ type: "button",
734
+ className: f(at.trigger, c?.trigger),
735
+ onClick: U,
736
+ "aria-expanded": S,
737
+ "aria-haspopup": "dialog",
738
+ "aria-controls": S ? w : void 0,
739
+ children: e
740
+ }
741
+ );
742
+ return /* @__PURE__ */ s(
707
743
  "div",
708
744
  {
709
- ref: a,
710
- className: f(at.root, i?.root, c),
711
- style: l,
712
- children: /* @__PURE__ */ H("div", { ref: d, children: [
713
- /* @__PURE__ */ s(
714
- "button",
715
- {
716
- ref: p,
717
- type: "button",
718
- className: f(at.trigger, i?.trigger),
719
- onClick: E,
720
- "aria-expanded": k,
721
- "aria-haspopup": "dialog",
722
- "aria-controls": k ? y : void 0,
723
- children: e
724
- }
725
- ),
726
- k && /* @__PURE__ */ s(
745
+ ref: h,
746
+ className: f(at.root, c?.root, l),
747
+ style: a,
748
+ children: /* @__PURE__ */ H("div", { ref: m, children: [
749
+ re,
750
+ S && /* @__PURE__ */ s(
727
751
  "div",
728
752
  {
729
- ref: m,
730
- id: y,
753
+ ref: p,
754
+ id: w,
731
755
  role: "dialog",
732
756
  tabIndex: -1,
733
- className: f(at.popover, at[n], i?.popover),
734
- children: t
757
+ className: f(at.popover, at[r], c?.popover),
758
+ children: n
735
759
  }
736
760
  )
737
761
  ] })
@@ -739,7 +763,7 @@ const uo = "crk-root-8H-L9", ho = "crk-trigger-Zn1nQ", mo = "crk-popover-rvS3X",
739
763
  );
740
764
  }
741
765
  );
742
- zt.displayName = "Popover";
766
+ Vt.displayName = "Popover";
743
767
  const Bt = [
744
768
  'input:not([disabled]):not([type="hidden"])',
745
769
  "button:not([disabled])",
@@ -748,8 +772,8 @@ const Bt = [
748
772
  "a[href]",
749
773
  '[tabindex]:not([tabindex="-1"])'
750
774
  ].join(", ");
751
- function bo(e, t) {
752
- const n = te(null), r = he(
775
+ function ko(e, t) {
776
+ const n = ne(null), r = he(
753
777
  (o) => {
754
778
  if (o.key !== "Tab" || !e.current)
755
779
  return;
@@ -775,21 +799,21 @@ function bo(e, t) {
775
799
  };
776
800
  }, [t, e, r]);
777
801
  }
778
- const xo = "crk-backdrop-jYpTA", ko = "crk-backdropIn-x5Z-A", Mo = "crk-modal-yNG-7", wo = "crk-modalIn-xFUwm", $o = "crk-sm--xyY9", No = "crk-md-ETTfh", Lo = "crk-lg-5DBb7", So = "crk-fullscreen-b4jQ-", To = "crk-header-NS30G", Ro = "crk-headerWithClose-4davm", Co = "crk-closeButton-JX-aq", Ao = "crk-body-3zIj9", Bo = "crk-footer-Oyz-R", je = {
779
- backdrop: xo,
780
- backdropIn: ko,
781
- modal: Mo,
782
- modalIn: wo,
783
- sm: $o,
784
- md: No,
785
- lg: Lo,
786
- fullscreen: So,
787
- header: To,
788
- headerWithClose: Ro,
789
- closeButton: Co,
790
- body: Ao,
791
- footer: Bo
792
- }, gt = jt({ classes: {}, titleId: "" }), Yt = ({ children: e, className: t, style: n, onClose: r }) => {
802
+ const Mo = "crk-backdrop-jYpTA", wo = "crk-backdropIn-x5Z-A", $o = "crk-modal-yNG-7", No = "crk-modalIn-xFUwm", Lo = "crk-sm--xyY9", So = "crk-md-ETTfh", To = "crk-lg-5DBb7", Ro = "crk-fullscreen-b4jQ-", Co = "crk-header-NS30G", Ao = "crk-headerWithClose-4davm", Bo = "crk-closeButton-JX-aq", Do = "crk-body-3zIj9", Io = "crk-footer-Oyz-R", je = {
803
+ backdrop: Mo,
804
+ backdropIn: wo,
805
+ modal: $o,
806
+ modalIn: No,
807
+ sm: Lo,
808
+ md: So,
809
+ lg: To,
810
+ fullscreen: Ro,
811
+ header: Co,
812
+ headerWithClose: Ao,
813
+ closeButton: Bo,
814
+ body: Do,
815
+ footer: Io
816
+ }, gt = Xt({ classes: {}, titleId: "" }), Yt = ({ children: e, className: t, style: n, onClose: r }) => {
793
817
  const { classes: o, titleId: i } = ft(gt);
794
818
  return /* @__PURE__ */ H(
795
819
  "div",
@@ -814,16 +838,16 @@ const xo = "crk-backdrop-jYpTA", ko = "crk-backdropIn-x5Z-A", Mo = "crk-modal-yN
814
838
  );
815
839
  };
816
840
  Yt.displayName = "Modal.Header";
817
- const Vt = ({ children: e, className: t, style: n }) => {
841
+ const qt = ({ children: e, className: t, style: n }) => {
818
842
  const { classes: r } = ft(gt);
819
843
  return /* @__PURE__ */ s("div", { className: f(je.body, r.body, t), style: n, children: e });
820
844
  };
821
- Vt.displayName = "Modal.Body";
822
- const qt = ({ children: e, className: t, style: n }) => {
845
+ qt.displayName = "Modal.Body";
846
+ const Gt = ({ children: e, className: t, style: n }) => {
823
847
  const { classes: r } = ft(gt);
824
848
  return /* @__PURE__ */ s("div", { className: f(je.footer, r.footer, t), style: n, children: e });
825
849
  };
826
- qt.displayName = "Modal.Footer";
850
+ Gt.displayName = "Modal.Footer";
827
851
  const yt = $e(
828
852
  ({
829
853
  open: e,
@@ -836,11 +860,11 @@ const yt = $e(
836
860
  style: l,
837
861
  children: a,
838
862
  "aria-label": h,
839
- "aria-labelledby": u
840
- }, d) => {
841
- const m = te(null), p = d ?? m, y = ze(), $ = u ?? `${y}-title`;
842
- bo(p, e);
843
- const k = ke(
863
+ "aria-labelledby": d
864
+ }, u) => {
865
+ const m = ne(null), p = u ?? m, y = ze(), w = d ?? `${y}-title`;
866
+ ko(p, e);
867
+ const N = ke(
844
868
  () => ({
845
869
  Escape: () => {
846
870
  r && t();
@@ -848,22 +872,22 @@ const yt = $e(
848
872
  }),
849
873
  [r, t]
850
874
  );
851
- Tt(k, e), Be(() => {
875
+ Tt(N, e), Be(() => {
852
876
  if (!e) return;
853
- const X = document.body.style.overflow;
877
+ const O = document.body.style.overflow;
854
878
  return document.body.style.overflow = "hidden", () => {
855
- document.body.style.overflow = X;
879
+ document.body.style.overflow = O;
856
880
  };
857
881
  }, [e]);
858
- const R = (X) => {
859
- n && X.target === X.currentTarget && t();
882
+ const S = (O) => {
883
+ n && O.target === O.currentTarget && t();
860
884
  };
861
- return e ? mn(
885
+ return e ? fn(
862
886
  /* @__PURE__ */ s(
863
887
  "div",
864
888
  {
865
889
  className: f(je.backdrop, i?.backdrop),
866
- onClick: R,
890
+ onClick: S,
867
891
  role: "presentation",
868
892
  children: /* @__PURE__ */ s(
869
893
  "div",
@@ -874,8 +898,8 @@ const yt = $e(
874
898
  role: "dialog",
875
899
  "aria-modal": "true",
876
900
  "aria-label": h,
877
- "aria-labelledby": h ? void 0 : $,
878
- children: /* @__PURE__ */ s(gt.Provider, { value: { classes: i ?? {}, titleId: $ }, children: a })
901
+ "aria-labelledby": h ? void 0 : w,
902
+ children: /* @__PURE__ */ s(gt.Provider, { value: { classes: i ?? {}, titleId: w }, children: a })
879
903
  }
880
904
  )
881
905
  }
@@ -886,21 +910,21 @@ const yt = $e(
886
910
  );
887
911
  yt.displayName = "Modal";
888
912
  yt.Header = Yt;
889
- yt.Body = Vt;
890
- yt.Footer = qt;
891
- const Do = "crk-root-jHIIP", Io = "crk-formErrors-eh-OP", Eo = "crk-formError-XEuWv", Po = "crk-field-OUlYz", Wo = "crk-label-udkR7", Ho = "crk-labelError-LOgKi", Oo = "crk-required-IYiA2", Fo = "crk-error-yFZXm", jo = "crk-helperText-Dm-rb", Xo = "crk-row-nNbx-", We = {
892
- root: Do,
893
- formErrors: Io,
894
- formError: Eo,
895
- field: Po,
896
- label: Wo,
897
- labelError: Ho,
898
- required: Oo,
899
- error: Fo,
900
- helperText: jo,
901
- row: Xo
913
+ yt.Body = qt;
914
+ yt.Footer = Gt;
915
+ const Eo = "crk-root-jHIIP", Po = "crk-formErrors-eh-OP", Wo = "crk-formError-XEuWv", Ho = "crk-field-OUlYz", Oo = "crk-label-udkR7", Fo = "crk-labelError-LOgKi", jo = "crk-required-IYiA2", Xo = "crk-error-yFZXm", Uo = "crk-helperText-Dm-rb", _o = "crk-row-nNbx-", We = {
916
+ root: Eo,
917
+ formErrors: Po,
918
+ formError: Wo,
919
+ field: Ho,
920
+ label: Oo,
921
+ labelError: Fo,
922
+ required: jo,
923
+ error: Xo,
924
+ helperText: Uo,
925
+ row: _o
902
926
  };
903
- function Bl({
927
+ function El({
904
928
  form: e,
905
929
  onSubmit: t,
906
930
  errors: n,
@@ -909,7 +933,7 @@ function Bl({
909
933
  children: i
910
934
  }) {
911
935
  const c = n && n.length > 0;
912
- return /* @__PURE__ */ s(dn, { ...e, children: /* @__PURE__ */ H(
936
+ return /* @__PURE__ */ s(un, { ...e, children: /* @__PURE__ */ H(
913
937
  "form",
914
938
  {
915
939
  onSubmit: e.handleSubmit(t),
@@ -922,14 +946,14 @@ function Bl({
922
946
  }
923
947
  ) });
924
948
  }
925
- const Uo = /* @__PURE__ */ new Set([
949
+ const zo = /* @__PURE__ */ new Set([
926
950
  "Select",
927
951
  "NativeSelect",
928
952
  "SearchableSelect",
929
953
  "MultiSelect",
930
954
  "Dropdown"
931
955
  ]);
932
- function Dl({
956
+ function Pl({
933
957
  name: e,
934
958
  label: t,
935
959
  helperText: n,
@@ -940,59 +964,59 @@ function Dl({
940
964
  style: l,
941
965
  children: a
942
966
  }) {
943
- const { control: h } = un(), { field: u, fieldState: d } = hn({ name: e, control: h, rules: o }), m = a.type, p = typeof m == "string" ? "" : m?.displayName ?? m?.name ?? "", y = Uo.has(p), { ref: $, ...k } = u, R = te($);
944
- R.current = $;
945
- const X = he(
946
- (E) => {
947
- if (E) {
948
- const W = E.matches("input, select, textarea, button, [tabindex]") ? E : E.querySelector('input, select, textarea, button, [tabindex]:not([tabindex="-1"])');
949
- R.current(W ?? E);
967
+ const { control: h } = hn(), { field: d, fieldState: u } = mn({ name: e, control: h, rules: o }), m = a.type, p = typeof m == "string" ? "" : m?.displayName ?? m?.name ?? "", y = zo.has(p), { ref: w, ...N } = d, S = ne(w);
968
+ S.current = w;
969
+ const O = he(
970
+ (P) => {
971
+ if (P) {
972
+ const U = P.matches("input, select, textarea, button, [tabindex]") ? P : P.querySelector('input, select, textarea, button, [tabindex]:not([tabindex="-1"])');
973
+ S.current(U ?? P);
950
974
  } else
951
- R.current(null);
975
+ S.current(null);
952
976
  },
953
977
  // eslint-disable-next-line react-hooks/exhaustive-deps
954
978
  []
955
979
  );
956
980
  return /* @__PURE__ */ H("div", { className: f(We.field, i?.field, c), style: l, children: [
957
- t && /* @__PURE__ */ H("label", { className: f(We.label, d.error && We.labelError, i?.label), htmlFor: e, children: [
981
+ t && /* @__PURE__ */ H("label", { className: f(We.label, u.error && We.labelError, i?.label), htmlFor: e, children: [
958
982
  t,
959
983
  r && /* @__PURE__ */ s("span", { className: We.required, children: "*" })
960
984
  ] }),
961
- ln(a, {
962
- ...k,
963
- ref: X,
985
+ jt(a, {
986
+ ...N,
987
+ ref: O,
964
988
  id: e,
965
- error: !!d.error,
966
- "aria-invalid": d.error ? !0 : void 0,
967
- "aria-describedby": d.error?.message ? `${e}-error` : n ? `${e}-helper` : void 0,
989
+ error: !!u.error,
990
+ "aria-invalid": u.error ? !0 : void 0,
991
+ "aria-describedby": u.error?.message ? `${e}-error` : n ? `${e}-helper` : void 0,
968
992
  // Bridge for custom components that use onValueChange/onValuesChange (Select, Dropdown).
969
993
  // Skip for native-input wrappers (Input, Textarea, Checkbox, Radio) so the unknown
970
994
  // handler doesn't leak onto the DOM and trip React's "Unknown event handler" warning.
971
995
  ...y && {
972
- onValueChange: k.onChange,
973
- onValuesChange: k.onChange
996
+ onValueChange: N.onChange,
997
+ onValuesChange: N.onChange
974
998
  },
975
999
  // Bridge for Checkbox (expects checked, not value)
976
- checked: typeof k.value == "boolean" ? k.value : void 0
1000
+ checked: typeof N.value == "boolean" ? N.value : void 0
977
1001
  }),
978
- d.error?.message ? /* @__PURE__ */ s("span", { id: `${e}-error`, className: f(We.error, i?.error), role: "alert", children: d.error.message }) : n ? /* @__PURE__ */ s("span", { id: `${e}-helper`, className: f(We.helperText, i?.helperText), children: n }) : null
1002
+ u.error?.message ? /* @__PURE__ */ s("span", { id: `${e}-error`, className: f(We.error, i?.error), role: "alert", children: u.error.message }) : n ? /* @__PURE__ */ s("span", { id: `${e}-helper`, className: f(We.helperText, i?.helperText), children: n }) : null
979
1003
  ] });
980
1004
  }
981
- function Il({ children: e, className: t, style: n }) {
1005
+ function Wl({ children: e, className: t, style: n }) {
982
1006
  return /* @__PURE__ */ s("div", { className: f(We.row, t), style: n, children: e });
983
1007
  }
984
- const _o = "crk-root-rSgdy", zo = "crk-wrapper-GHy8V", Yo = "crk-sm-DptM5", Vo = "crk-md-F4B0G", qo = "crk-lg-pBxwX", Go = "crk-error-fucxe", Zo = "crk-prefix-w53Md", Ko = "crk-suffix-fcNgR", Qo = "crk-hasPrefix--bqPD", Jo = "crk-hasSuffix-zO0nX", Pe = {
985
- root: _o,
986
- wrapper: zo,
987
- sm: Yo,
988
- md: Vo,
989
- lg: qo,
990
- error: Go,
991
- prefix: Zo,
992
- suffix: Ko,
993
- hasPrefix: Qo,
994
- hasSuffix: Jo
995
- }, ec = $e(
1008
+ const Vo = "crk-root-rSgdy", Yo = "crk-wrapper-GHy8V", qo = "crk-sm-DptM5", Go = "crk-md-F4B0G", Zo = "crk-lg-pBxwX", Ko = "crk-error-fucxe", Qo = "crk-prefix-w53Md", Jo = "crk-suffix-fcNgR", ec = "crk-hasPrefix--bqPD", tc = "crk-hasSuffix-zO0nX", Pe = {
1009
+ root: Vo,
1010
+ wrapper: Yo,
1011
+ sm: qo,
1012
+ md: Go,
1013
+ lg: Zo,
1014
+ error: Ko,
1015
+ prefix: Qo,
1016
+ suffix: Jo,
1017
+ hasPrefix: ec,
1018
+ hasSuffix: tc
1019
+ }, nc = $e(
996
1020
  ({
997
1021
  inputSize: e = "md",
998
1022
  error: t = !1,
@@ -1034,41 +1058,41 @@ const _o = "crk-root-rSgdy", zo = "crk-wrapper-GHy8V", Yo = "crk-sm-DptM5", Vo =
1034
1058
  ) : h;
1035
1059
  }
1036
1060
  );
1037
- ec.displayName = "Input";
1038
- const tc = "crk-wrapper-SP2JE", nc = "crk-sm-DqshL", rc = "crk-md-j4AKI", oc = "crk-lg-24Xd3", cc = "crk-root-Uu9Ah", ic = "crk-error-9oRU6", lc = "crk-arrow-WU8ZW", sc = "crk-searchableWrapper-7AL4l", ac = "crk-hiddenSelect-s3DEx", dc = "crk-searchableTrigger-m-GWV", uc = "crk-triggerOpen-Lo8-j", hc = "crk-triggerLabel-5rETZ", mc = "crk-placeholder-teBBh", fc = "crk-arrowInline-m-roG", pc = "crk-disabled-pcSeq", gc = "crk-visuallyHidden-2tTD5", yc = "crk-menu--i-je", vc = "crk-menuEnter-vJjLV", bc = "crk-menuItems-VrZnE", xc = "crk-item-fU3XI", kc = "crk-itemHighlighted-MvR41", Mc = "crk-itemDisabled-KTUO8", wc = "crk-itemSelected-42-BG", $c = "crk-noResults-uicSW", Nc = "crk-multiTrigger-Pd3wJ", Lc = "crk-multiTriggerDisabled-9ajge", Sc = "crk-chip-TuYUB", Tc = "crk-chipLabel-H4JWu", Rc = "crk-chipRemove-Lfk0R", Cc = "crk-multiSearch-OrVeS", Ac = "crk-arrowMulti-Nh9Hr", Bc = "crk-itemCheck-DPB5A", I = {
1039
- wrapper: tc,
1040
- sm: nc,
1041
- md: rc,
1042
- lg: oc,
1043
- root: cc,
1044
- error: ic,
1045
- arrow: lc,
1046
- searchableWrapper: sc,
1047
- hiddenSelect: ac,
1048
- searchableTrigger: dc,
1049
- triggerOpen: uc,
1050
- triggerLabel: hc,
1051
- placeholder: mc,
1052
- arrowInline: fc,
1053
- disabled: pc,
1054
- visuallyHidden: gc,
1055
- menu: yc,
1056
- menuEnter: vc,
1057
- menuItems: bc,
1058
- item: xc,
1059
- itemHighlighted: kc,
1060
- itemDisabled: Mc,
1061
- itemSelected: wc,
1062
- noResults: $c,
1063
- multiTrigger: Nc,
1064
- multiTriggerDisabled: Lc,
1065
- chip: Sc,
1066
- chipLabel: Tc,
1067
- chipRemove: Rc,
1068
- multiSearch: Cc,
1069
- arrowMulti: Ac,
1070
- itemCheck: Bc
1071
- }, Gt = $e(
1061
+ nc.displayName = "Input";
1062
+ const rc = "crk-wrapper-SP2JE", oc = "crk-sm-DqshL", cc = "crk-md-j4AKI", ic = "crk-lg-24Xd3", lc = "crk-root-Uu9Ah", sc = "crk-error-9oRU6", ac = "crk-arrow-WU8ZW", dc = "crk-searchableWrapper-7AL4l", uc = "crk-hiddenSelect-s3DEx", hc = "crk-searchableTrigger-m-GWV", mc = "crk-triggerOpen-Lo8-j", fc = "crk-triggerLabel-5rETZ", pc = "crk-placeholder-teBBh", gc = "crk-arrowInline-m-roG", yc = "crk-disabled-pcSeq", vc = "crk-visuallyHidden-2tTD5", bc = "crk-menu--i-je", xc = "crk-menuEnter-vJjLV", kc = "crk-menuItems-VrZnE", Mc = "crk-item-fU3XI", wc = "crk-itemHighlighted-MvR41", $c = "crk-itemDisabled-KTUO8", Nc = "crk-itemSelected-42-BG", Lc = "crk-noResults-uicSW", Sc = "crk-multiTrigger-Pd3wJ", Tc = "crk-multiTriggerDisabled-9ajge", Rc = "crk-chip-TuYUB", Cc = "crk-chipLabel-H4JWu", Ac = "crk-chipRemove-Lfk0R", Bc = "crk-multiSearch-OrVeS", Dc = "crk-arrowMulti-Nh9Hr", Ic = "crk-itemCheck-DPB5A", E = {
1063
+ wrapper: rc,
1064
+ sm: oc,
1065
+ md: cc,
1066
+ lg: ic,
1067
+ root: lc,
1068
+ error: sc,
1069
+ arrow: ac,
1070
+ searchableWrapper: dc,
1071
+ hiddenSelect: uc,
1072
+ searchableTrigger: hc,
1073
+ triggerOpen: mc,
1074
+ triggerLabel: fc,
1075
+ placeholder: pc,
1076
+ arrowInline: gc,
1077
+ disabled: yc,
1078
+ visuallyHidden: vc,
1079
+ menu: bc,
1080
+ menuEnter: xc,
1081
+ menuItems: kc,
1082
+ item: Mc,
1083
+ itemHighlighted: wc,
1084
+ itemDisabled: $c,
1085
+ itemSelected: Nc,
1086
+ noResults: Lc,
1087
+ multiTrigger: Sc,
1088
+ multiTriggerDisabled: Tc,
1089
+ chip: Rc,
1090
+ chipLabel: Cc,
1091
+ chipRemove: Ac,
1092
+ multiSearch: Bc,
1093
+ arrowMulti: Dc,
1094
+ itemCheck: Ic
1095
+ }, Zt = $e(
1072
1096
  ({
1073
1097
  inputSize: e = "md",
1074
1098
  error: t = !1,
@@ -1080,26 +1104,26 @@ const tc = "crk-wrapper-SP2JE", nc = "crk-sm-DqshL", rc = "crk-md-j4AKI", oc = "
1080
1104
  children: l,
1081
1105
  searchable: a,
1082
1106
  searchPlaceholder: h,
1083
- onValueChange: u,
1084
- ...d
1085
- }, m) => /* @__PURE__ */ H("div", { className: f(I.wrapper, I[e], t && I.error, o?.wrapper, i), style: c, children: [
1107
+ onValueChange: d,
1108
+ ...u
1109
+ }, m) => /* @__PURE__ */ H("div", { className: f(E.wrapper, E[e], t && E.error, o?.wrapper, i), style: c, children: [
1086
1110
  /* @__PURE__ */ H(
1087
1111
  "select",
1088
1112
  {
1089
1113
  ref: m,
1090
- className: f(I.root, I[e], t && I.error, o?.root),
1091
- ...d,
1114
+ className: f(E.root, E[e], t && E.error, o?.root),
1115
+ ...u,
1092
1116
  children: [
1093
1117
  r && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: r }),
1094
1118
  n ? n.map((p) => /* @__PURE__ */ s("option", { value: p.value, disabled: p.disabled, children: p.label }, p.value)) : l
1095
1119
  ]
1096
1120
  }
1097
1121
  ),
1098
- /* @__PURE__ */ s("span", { className: f(I.arrow, o?.arrow) })
1122
+ /* @__PURE__ */ s("span", { className: f(E.arrow, o?.arrow) })
1099
1123
  ] })
1100
1124
  );
1101
- Gt.displayName = "NativeSelect";
1102
- const Zt = $e(
1125
+ Zt.displayName = "NativeSelect";
1126
+ const Kt = $e(
1103
1127
  ({
1104
1128
  inputSize: e = "md",
1105
1129
  error: t = !1,
@@ -1111,79 +1135,79 @@ const Zt = $e(
1111
1135
  value: l,
1112
1136
  disabled: a,
1113
1137
  id: h,
1114
- searchPlaceholder: u = "Search...",
1115
- onChange: d,
1138
+ searchPlaceholder: d = "Search...",
1139
+ onChange: u,
1116
1140
  onValueChange: m
1117
1141
  }, p) => {
1118
- const [y, $] = Se(!1), [k, R] = Se(""), [X, E] = Se(0), W = te(null), ae = te(null), _ = te(null), C = te(null), oe = ze(), le = te(null), w = p ?? le, q = te(!1);
1142
+ const [y, w] = Se(!1), [N, S] = Se(""), [O, P] = Se(0), U = ne(null), re = ne(null), D = ne(null), C = ne(null), ee = ze(), se = ne(null), M = p ?? se, q = ne(!1);
1119
1143
  Be(() => {
1120
- q.current && !y && _.current?.focus(), q.current = y;
1144
+ q.current && !y && D.current?.focus(), q.current = y;
1121
1145
  }, [y]);
1122
- const D = he(() => {
1123
- $(!1), R(""), E(0);
1146
+ const I = he(() => {
1147
+ w(!1), S(""), P(0);
1124
1148
  }, []), Q = he(() => {
1125
- a || ($(!0), R(""), E(0), setTimeout(() => ae.current?.focus(), 0));
1126
- }, [a]), O = he(
1149
+ a || (w(!0), S(""), P(0), setTimeout(() => re.current?.focus(), 0));
1150
+ }, [a]), F = he(
1127
1151
  (v) => {
1128
- if (m?.(v), w.current) {
1152
+ if (m?.(v), M.current) {
1129
1153
  Object.getOwnPropertyDescriptor(
1130
1154
  HTMLSelectElement.prototype,
1131
1155
  "value"
1132
- )?.set?.call(w.current, v);
1133
- const N = new Event("change", { bubbles: !0 });
1134
- w.current.dispatchEvent(N), d?.(N);
1156
+ )?.set?.call(M.current, v);
1157
+ const $ = new Event("change", { bubbles: !0 });
1158
+ M.current.dispatchEvent($), u?.($);
1135
1159
  }
1136
- D();
1160
+ I();
1137
1161
  },
1138
- [m, d, w, D]
1139
- ), P = ke(() => {
1140
- if (!k) return n;
1141
- const v = k.toLowerCase();
1142
- return n.filter((M) => M.label.toLowerCase().includes(v));
1143
- }, [n, k]);
1162
+ [m, u, M, I]
1163
+ ), W = ke(() => {
1164
+ if (!N) return n;
1165
+ const v = N.toLowerCase();
1166
+ return n.filter((k) => k.label.toLowerCase().includes(v));
1167
+ }, [n, N]);
1144
1168
  Be(() => {
1145
- const v = P.findIndex((M) => !M.disabled);
1146
- E(v >= 0 ? v : 0);
1147
- }, [P]), Be(() => {
1169
+ const v = W.findIndex((k) => !k.disabled);
1170
+ P(v >= 0 ? v : 0);
1171
+ }, [W]), Be(() => {
1148
1172
  if (!y) return;
1149
1173
  const v = C.current;
1150
1174
  if (!v) return;
1151
- v.querySelectorAll('[role="option"]')[X]?.scrollIntoView?.({ block: "nearest" });
1152
- }, [X, y]);
1153
- const ee = he(
1175
+ v.querySelectorAll('[role="option"]')[O]?.scrollIntoView?.({ block: "nearest" });
1176
+ }, [O, y]);
1177
+ const te = he(
1154
1178
  (v) => {
1155
- const M = P.map((N, z) => N.disabled ? -1 : z).filter((N) => N >= 0);
1156
- if (M.length !== 0)
1179
+ const k = W.map(($, z) => $.disabled ? -1 : z).filter(($) => $ >= 0);
1180
+ if (k.length !== 0)
1157
1181
  if (v.key === "ArrowDown")
1158
- v.preventDefault(), E((N) => {
1159
- const z = M.indexOf(N);
1160
- return z < M.length - 1 ? M[z + 1] : M[0];
1182
+ v.preventDefault(), P(($) => {
1183
+ const z = k.indexOf($);
1184
+ return z < k.length - 1 ? k[z + 1] : k[0];
1161
1185
  });
1162
1186
  else if (v.key === "ArrowUp")
1163
- v.preventDefault(), E((N) => {
1164
- const z = M.indexOf(N);
1165
- return z > 0 ? M[z - 1] : M[M.length - 1];
1187
+ v.preventDefault(), P(($) => {
1188
+ const z = k.indexOf($);
1189
+ return z > 0 ? k[z - 1] : k[k.length - 1];
1166
1190
  });
1167
1191
  else if (v.key === "Enter") {
1168
1192
  v.preventDefault();
1169
- const N = P[X];
1170
- N && !N.disabled && O(N.value);
1171
- } else v.key === "Escape" && (v.preventDefault(), D());
1193
+ const $ = W[O];
1194
+ $ && !$.disabled && F($.value);
1195
+ } else v.key === "Escape" && (v.preventDefault(), I());
1172
1196
  },
1173
- [P, X, O, D]
1197
+ [W, O, F, I]
1174
1198
  );
1175
- pt(W, D, y);
1176
- const ne = n.find((v) => v.value === l)?.label, L = P.filter((v) => !v.disabled);
1199
+ pt(U, I, y);
1200
+ const oe = n.find((v) => v.value === l)?.label, L = W.filter((v) => !v.disabled);
1177
1201
  return /* @__PURE__ */ H(
1178
1202
  "div",
1179
1203
  {
1180
- ref: W,
1204
+ ref: U,
1181
1205
  className: f(
1182
- I.wrapper,
1183
- I.searchableWrapper,
1184
- I[e],
1185
- t && I.error,
1186
- a && I.disabled,
1206
+ E.wrapper,
1207
+ E.searchableWrapper,
1208
+ E[e],
1209
+ t && E.error,
1210
+ a && E.disabled,
1187
1211
  o?.wrapper,
1188
1212
  i
1189
1213
  ),
@@ -1192,8 +1216,8 @@ const Zt = $e(
1192
1216
  /* @__PURE__ */ s(
1193
1217
  "select",
1194
1218
  {
1195
- ref: w,
1196
- className: I.hiddenSelect,
1219
+ ref: M,
1220
+ className: E.hiddenSelect,
1197
1221
  value: l ?? "",
1198
1222
  disabled: a,
1199
1223
  tabIndex: -1,
@@ -1206,55 +1230,55 @@ const Zt = $e(
1206
1230
  /* @__PURE__ */ H(
1207
1231
  "button",
1208
1232
  {
1209
- ref: _,
1233
+ ref: D,
1210
1234
  id: h,
1211
1235
  type: "button",
1212
1236
  className: f(
1213
- I.root,
1214
- I.searchableTrigger,
1215
- I[e],
1216
- y && I.triggerOpen,
1217
- t && I.error,
1218
- y && I.visuallyHidden,
1237
+ E.root,
1238
+ E.searchableTrigger,
1239
+ E[e],
1240
+ y && E.triggerOpen,
1241
+ t && E.error,
1242
+ y && E.visuallyHidden,
1219
1243
  o?.root
1220
1244
  ),
1221
1245
  onClick: Q,
1222
1246
  disabled: a,
1223
1247
  "aria-expanded": y,
1224
1248
  "aria-haspopup": "listbox",
1225
- "aria-controls": y ? oe : void 0,
1249
+ "aria-controls": y ? ee : void 0,
1226
1250
  children: [
1227
- /* @__PURE__ */ s("span", { className: f(I.triggerLabel, !ne && I.placeholder), children: ne || r }),
1228
- /* @__PURE__ */ s("span", { className: f(I.arrow, I.arrowInline, o?.arrow) })
1251
+ /* @__PURE__ */ s("span", { className: f(E.triggerLabel, !oe && E.placeholder), children: oe || r }),
1252
+ /* @__PURE__ */ s("span", { className: f(E.arrow, E.arrowInline, o?.arrow) })
1229
1253
  ]
1230
1254
  }
1231
1255
  ),
1232
1256
  y && /* @__PURE__ */ s(
1233
1257
  "input",
1234
1258
  {
1235
- ref: ae,
1259
+ ref: re,
1236
1260
  type: "text",
1237
1261
  role: "combobox",
1238
1262
  className: f(
1239
- I.root,
1240
- I.searchableTrigger,
1241
- I[e],
1242
- I.triggerOpen,
1243
- t && I.error,
1263
+ E.root,
1264
+ E.searchableTrigger,
1265
+ E[e],
1266
+ E.triggerOpen,
1267
+ t && E.error,
1244
1268
  o?.root,
1245
1269
  o?.search
1246
1270
  ),
1247
- placeholder: ne || r,
1248
- value: k,
1249
- onChange: (v) => R(v.target.value),
1250
- onKeyDown: ee,
1271
+ placeholder: oe || r,
1272
+ value: N,
1273
+ onChange: (v) => S(v.target.value),
1274
+ onKeyDown: te,
1251
1275
  "aria-expanded": !0,
1252
1276
  "aria-haspopup": "listbox",
1253
- "aria-controls": oe,
1254
- "aria-activedescendant": L.length > 0 ? `select-option-${P[X]?.value}` : void 0
1277
+ "aria-controls": ee,
1278
+ "aria-activedescendant": L.length > 0 ? `select-option-${W[O]?.value}` : void 0
1255
1279
  }
1256
1280
  ),
1257
- y && /* @__PURE__ */ s("div", { id: oe, className: f(I.menu, o?.menu), role: "listbox", children: /* @__PURE__ */ s("div", { className: I.menuItems, ref: C, children: P.length === 0 ? /* @__PURE__ */ s("div", { className: I.noResults, children: "No results" }) : P.map((v, M) => /* @__PURE__ */ s(
1281
+ y && /* @__PURE__ */ s("div", { id: ee, className: f(E.menu, o?.menu), role: "listbox", children: /* @__PURE__ */ s("div", { className: E.menuItems, ref: C, children: W.length === 0 ? /* @__PURE__ */ s("div", { className: E.noResults, children: "No results" }) : W.map((v, k) => /* @__PURE__ */ s(
1258
1282
  "button",
1259
1283
  {
1260
1284
  id: `select-option-${v.value}`,
@@ -1262,15 +1286,15 @@ const Zt = $e(
1262
1286
  role: "option",
1263
1287
  "aria-selected": v.value === l,
1264
1288
  className: f(
1265
- I.item,
1266
- v.disabled && I.itemDisabled,
1267
- v.value === l && I.itemSelected,
1268
- M === X && I.itemHighlighted,
1289
+ E.item,
1290
+ v.disabled && E.itemDisabled,
1291
+ v.value === l && E.itemSelected,
1292
+ k === O && E.itemHighlighted,
1269
1293
  o?.item
1270
1294
  ),
1271
1295
  disabled: v.disabled,
1272
- onClick: () => O(v.value),
1273
- onMouseEnter: () => E(M),
1296
+ onClick: () => F(v.value),
1297
+ onMouseEnter: () => P(k),
1274
1298
  children: v.content ?? v.label
1275
1299
  },
1276
1300
  v.value
@@ -1280,8 +1304,8 @@ const Zt = $e(
1280
1304
  );
1281
1305
  }
1282
1306
  );
1283
- Zt.displayName = "SearchableSelect";
1284
- const Kt = $e(
1307
+ Kt.displayName = "SearchableSelect";
1308
+ const Qt = $e(
1285
1309
  ({
1286
1310
  inputSize: e = "md",
1287
1311
  error: t = !1,
@@ -1293,81 +1317,81 @@ const Kt = $e(
1293
1317
  value: l,
1294
1318
  disabled: a,
1295
1319
  id: h,
1296
- searchPlaceholder: u,
1297
- onValuesChange: d,
1320
+ searchPlaceholder: d,
1321
+ onValuesChange: u,
1298
1322
  clearSearchOnSelect: m = !0
1299
1323
  }, p) => {
1300
- const y = Array.isArray(l) ? l : l ? [l] : [], [$, k] = Se(!1), [R, X] = Se(""), [E, W] = Se(0), ae = te(null), _ = te(null), C = te(null), oe = ze(), le = te(null), w = p ?? le, q = he(() => {
1301
- k(!1), X(""), W(0);
1302
- }, []), D = he(() => {
1303
- a || (k(!0), X(""), W(0), setTimeout(() => _.current?.focus(), 0));
1324
+ const y = Array.isArray(l) ? l : l ? [l] : [], [w, N] = Se(!1), [S, O] = Se(""), [P, U] = Se(0), re = ne(null), D = ne(null), C = ne(null), ee = ze(), se = ne(null), M = p ?? se, q = he(() => {
1325
+ N(!1), O(""), U(0);
1326
+ }, []), I = he(() => {
1327
+ a || (N(!0), O(""), U(0), setTimeout(() => D.current?.focus(), 0));
1304
1328
  }, [a]), Q = he(
1305
1329
  (L) => {
1306
- const v = y.includes(L) ? y.filter((M) => M !== L) : [...y, L];
1307
- d?.(v), m && X("");
1330
+ const v = y.includes(L) ? y.filter((k) => k !== L) : [...y, L];
1331
+ u?.(v), m && O("");
1308
1332
  },
1309
- [y, d, m]
1310
- ), O = he(
1333
+ [y, u, m]
1334
+ ), F = he(
1311
1335
  (L, v) => {
1312
- v.stopPropagation(), d?.(y.filter((M) => M !== L));
1336
+ v.stopPropagation(), u?.(y.filter((k) => k !== L));
1313
1337
  },
1314
- [y, d]
1315
- ), P = ke(() => {
1316
- if (!R) return n;
1317
- const L = R.toLowerCase();
1338
+ [y, u]
1339
+ ), W = ke(() => {
1340
+ if (!S) return n;
1341
+ const L = S.toLowerCase();
1318
1342
  return n.filter((v) => v.label.toLowerCase().includes(L));
1319
- }, [n, R]);
1343
+ }, [n, S]);
1320
1344
  Be(() => {
1321
- const L = P.findIndex((v) => !v.disabled);
1322
- W(L >= 0 ? L : 0);
1323
- }, [P]), Be(() => {
1324
- if (!$) return;
1345
+ const L = W.findIndex((v) => !v.disabled);
1346
+ U(L >= 0 ? L : 0);
1347
+ }, [W]), Be(() => {
1348
+ if (!w) return;
1325
1349
  const L = C.current;
1326
1350
  if (!L) return;
1327
- L.querySelectorAll('[role="option"]')[E]?.scrollIntoView?.({ block: "nearest" });
1328
- }, [E, $]);
1329
- const ee = he(
1351
+ L.querySelectorAll('[role="option"]')[P]?.scrollIntoView?.({ block: "nearest" });
1352
+ }, [P, w]);
1353
+ const te = he(
1330
1354
  (L) => {
1331
- const v = P.map((M, N) => M.disabled ? -1 : N).filter((M) => M >= 0);
1332
- if (L.key === "Backspace" && R === "" && y.length > 0) {
1333
- L.preventDefault(), d?.(y.slice(0, -1));
1355
+ const v = W.map((k, $) => k.disabled ? -1 : $).filter((k) => k >= 0);
1356
+ if (L.key === "Backspace" && S === "" && y.length > 0) {
1357
+ L.preventDefault(), u?.(y.slice(0, -1));
1334
1358
  return;
1335
1359
  }
1336
1360
  if (v.length !== 0)
1337
1361
  if (L.key === "ArrowDown") {
1338
- if (L.preventDefault(), !$) {
1339
- D();
1362
+ if (L.preventDefault(), !w) {
1363
+ I();
1340
1364
  return;
1341
1365
  }
1342
- W((M) => {
1343
- const N = v.indexOf(M);
1344
- return N < v.length - 1 ? v[N + 1] : v[0];
1366
+ U((k) => {
1367
+ const $ = v.indexOf(k);
1368
+ return $ < v.length - 1 ? v[$ + 1] : v[0];
1345
1369
  });
1346
1370
  } else if (L.key === "ArrowUp")
1347
- L.preventDefault(), W((M) => {
1348
- const N = v.indexOf(M);
1349
- return N > 0 ? v[N - 1] : v[v.length - 1];
1371
+ L.preventDefault(), U((k) => {
1372
+ const $ = v.indexOf(k);
1373
+ return $ > 0 ? v[$ - 1] : v[v.length - 1];
1350
1374
  });
1351
1375
  else if (L.key === "Enter") {
1352
1376
  L.preventDefault();
1353
- const M = P[E];
1354
- M && !M.disabled && Q(M.value);
1377
+ const k = W[P];
1378
+ k && !k.disabled && Q(k.value);
1355
1379
  } else L.key === "Escape" && (L.preventDefault(), q());
1356
1380
  },
1357
- [P, E, Q, q, R, y, d, $, D]
1381
+ [W, P, Q, q, S, y, u, w, I]
1358
1382
  );
1359
- pt(ae, q, $);
1360
- const ne = y.map((L) => n.find((v) => v.value === L)).filter((L) => !!L);
1383
+ pt(re, q, w);
1384
+ const oe = y.map((L) => n.find((v) => v.value === L)).filter((L) => !!L);
1361
1385
  return /* @__PURE__ */ H(
1362
1386
  "div",
1363
1387
  {
1364
- ref: ae,
1388
+ ref: re,
1365
1389
  className: f(
1366
- I.wrapper,
1367
- I.searchableWrapper,
1368
- I[e],
1369
- t && I.error,
1370
- a && I.disabled,
1390
+ E.wrapper,
1391
+ E.searchableWrapper,
1392
+ E[e],
1393
+ t && E.error,
1394
+ a && E.disabled,
1371
1395
  o?.wrapper,
1372
1396
  i
1373
1397
  ),
@@ -1376,8 +1400,8 @@ const Kt = $e(
1376
1400
  /* @__PURE__ */ s(
1377
1401
  "select",
1378
1402
  {
1379
- ref: w,
1380
- className: I.hiddenSelect,
1403
+ ref: M,
1404
+ className: E.hiddenSelect,
1381
1405
  multiple: !0,
1382
1406
  value: y,
1383
1407
  disabled: a,
@@ -1392,29 +1416,29 @@ const Kt = $e(
1392
1416
  "div",
1393
1417
  {
1394
1418
  className: f(
1395
- I.multiTrigger,
1396
- I[e],
1397
- $ && I.triggerOpen,
1398
- t && I.error,
1399
- a && I.multiTriggerDisabled,
1419
+ E.multiTrigger,
1420
+ E[e],
1421
+ w && E.triggerOpen,
1422
+ t && E.error,
1423
+ a && E.multiTriggerDisabled,
1400
1424
  o?.root
1401
1425
  ),
1402
1426
  onClick: () => {
1403
- $ ? _.current?.focus() : D();
1427
+ w ? D.current?.focus() : I();
1404
1428
  },
1405
1429
  role: "combobox",
1406
- "aria-expanded": $,
1430
+ "aria-expanded": w,
1407
1431
  "aria-haspopup": "listbox",
1408
- "aria-controls": $ ? oe : void 0,
1432
+ "aria-controls": w ? ee : void 0,
1409
1433
  children: [
1410
- ne.map((L) => /* @__PURE__ */ H("span", { className: f(I.chip, o?.chip), children: [
1411
- /* @__PURE__ */ s("span", { className: I.chipLabel, children: L.content ?? L.label }),
1434
+ oe.map((L) => /* @__PURE__ */ H("span", { className: f(E.chip, o?.chip), children: [
1435
+ /* @__PURE__ */ s("span", { className: E.chipLabel, children: L.content ?? L.label }),
1412
1436
  /* @__PURE__ */ s(
1413
1437
  "button",
1414
1438
  {
1415
1439
  type: "button",
1416
- className: f(I.chipRemove, o?.chipRemove),
1417
- onClick: (v) => O(L.value, v),
1440
+ className: f(E.chipRemove, o?.chipRemove),
1441
+ onClick: (v) => F(L.value, v),
1418
1442
  "aria-label": `Remove ${L.label}`,
1419
1443
  tabIndex: -1,
1420
1444
  children: "×"
@@ -1424,45 +1448,45 @@ const Kt = $e(
1424
1448
  /* @__PURE__ */ s(
1425
1449
  "input",
1426
1450
  {
1427
- ref: _,
1451
+ ref: D,
1428
1452
  id: h,
1429
1453
  type: "text",
1430
- className: I.multiSearch,
1454
+ className: E.multiSearch,
1431
1455
  placeholder: y.length === 0 ? r : "",
1432
- value: R,
1456
+ value: S,
1433
1457
  onChange: (L) => {
1434
- X(L.target.value), $ || D();
1458
+ O(L.target.value), w || I();
1435
1459
  },
1436
- onKeyDown: ee,
1460
+ onKeyDown: te,
1437
1461
  disabled: a,
1438
1462
  "aria-label": "Search options"
1439
1463
  }
1440
1464
  ),
1441
- /* @__PURE__ */ s("span", { className: f(I.arrow, I.arrowMulti, o?.arrow) })
1465
+ /* @__PURE__ */ s("span", { className: f(E.arrow, E.arrowMulti, o?.arrow) })
1442
1466
  ]
1443
1467
  }
1444
1468
  ),
1445
- $ && /* @__PURE__ */ s("div", { id: oe, className: f(I.menu, o?.menu), role: "listbox", "aria-multiselectable": "true", children: /* @__PURE__ */ s("div", { className: I.menuItems, ref: C, children: P.length === 0 ? /* @__PURE__ */ s("div", { className: I.noResults, children: "No results" }) : P.map((L, v) => {
1446
- const M = y.includes(L.value);
1469
+ w && /* @__PURE__ */ s("div", { id: ee, className: f(E.menu, o?.menu), role: "listbox", "aria-multiselectable": "true", children: /* @__PURE__ */ s("div", { className: E.menuItems, ref: C, children: W.length === 0 ? /* @__PURE__ */ s("div", { className: E.noResults, children: "No results" }) : W.map((L, v) => {
1470
+ const k = y.includes(L.value);
1447
1471
  return /* @__PURE__ */ H(
1448
1472
  "button",
1449
1473
  {
1450
1474
  id: `select-option-${L.value}`,
1451
1475
  type: "button",
1452
1476
  role: "option",
1453
- "aria-selected": M,
1477
+ "aria-selected": k,
1454
1478
  className: f(
1455
- I.item,
1456
- L.disabled && I.itemDisabled,
1457
- M && I.itemSelected,
1458
- v === E && I.itemHighlighted,
1479
+ E.item,
1480
+ L.disabled && E.itemDisabled,
1481
+ k && E.itemSelected,
1482
+ v === P && E.itemHighlighted,
1459
1483
  o?.item
1460
1484
  ),
1461
1485
  disabled: L.disabled,
1462
1486
  onClick: () => Q(L.value),
1463
- onMouseEnter: () => W(v),
1487
+ onMouseEnter: () => U(v),
1464
1488
  children: [
1465
- M && /* @__PURE__ */ s("span", { className: I.itemCheck, "aria-hidden": "true" }),
1489
+ k && /* @__PURE__ */ s("span", { className: E.itemCheck, "aria-hidden": "true" }),
1466
1490
  L.content ?? L.label
1467
1491
  ]
1468
1492
  },
@@ -1474,17 +1498,17 @@ const Kt = $e(
1474
1498
  );
1475
1499
  }
1476
1500
  );
1477
- Kt.displayName = "MultiSelect";
1478
- const Dc = $e(
1479
- (e, t) => e.multiple ? /* @__PURE__ */ s(Kt, { ref: t, ...e }) : e.searchable ? /* @__PURE__ */ s(Zt, { ref: t, ...e }) : /* @__PURE__ */ s(Gt, { ref: t, ...e })
1501
+ Qt.displayName = "MultiSelect";
1502
+ const Ec = $e(
1503
+ (e, t) => e.multiple ? /* @__PURE__ */ s(Qt, { ref: t, ...e }) : e.searchable ? /* @__PURE__ */ s(Kt, { ref: t, ...e }) : /* @__PURE__ */ s(Zt, { ref: t, ...e })
1480
1504
  );
1481
- Dc.displayName = "Select";
1482
- const Ic = "crk-root-61cKD", Ec = "crk-input-bAjPU", Pc = "crk-label-W9IeS", Wc = "crk-indeterminate-mLarv", dt = {
1483
- root: Ic,
1484
- input: Ec,
1485
- label: Pc,
1486
- indeterminate: Wc
1487
- }, Hc = $e(
1505
+ Ec.displayName = "Select";
1506
+ const Pc = "crk-root-61cKD", Wc = "crk-input-bAjPU", Hc = "crk-label-W9IeS", Oc = "crk-indeterminate-mLarv", dt = {
1507
+ root: Pc,
1508
+ input: Wc,
1509
+ label: Hc,
1510
+ indeterminate: Oc
1511
+ }, Fc = $e(
1488
1512
  ({
1489
1513
  label: e,
1490
1514
  indeterminate: t = !1,
@@ -1493,7 +1517,7 @@ const Ic = "crk-root-61cKD", Ec = "crk-input-bAjPU", Pc = "crk-label-W9IeS", Wc
1493
1517
  style: o,
1494
1518
  ...i
1495
1519
  }, c) => {
1496
- const l = te(null);
1520
+ const l = ne(null);
1497
1521
  return Be(() => {
1498
1522
  l.current && (l.current.indeterminate = t);
1499
1523
  }, [t]), /* @__PURE__ */ H(
@@ -1519,13 +1543,13 @@ const Ic = "crk-root-61cKD", Ec = "crk-input-bAjPU", Pc = "crk-label-W9IeS", Wc
1519
1543
  );
1520
1544
  }
1521
1545
  );
1522
- Hc.displayName = "Checkbox";
1523
- const Oc = "crk-group-NNwCD", Fc = "crk-root-7fGik", jc = "crk-input-43PQW", Xc = "crk-label-aW30x", ht = {
1524
- group: Oc,
1525
- root: Fc,
1526
- input: jc,
1527
- label: Xc
1528
- }, Qt = jt(null), Uc = ({
1546
+ Fc.displayName = "Checkbox";
1547
+ const jc = "crk-group-NNwCD", Xc = "crk-root-7fGik", Uc = "crk-input-43PQW", _c = "crk-label-aW30x", ht = {
1548
+ group: jc,
1549
+ root: Xc,
1550
+ input: Uc,
1551
+ label: _c
1552
+ }, Jt = Xt(null), zc = ({
1529
1553
  name: e,
1530
1554
  value: t,
1531
1555
  onChange: n,
@@ -1536,7 +1560,7 @@ const Oc = "crk-group-NNwCD", Fc = "crk-root-7fGik", jc = "crk-input-43PQW", Xc
1536
1560
  "aria-label": l,
1537
1561
  "aria-labelledby": a,
1538
1562
  required: h
1539
- }) => /* @__PURE__ */ s(Qt.Provider, { value: { name: e, value: t, onChange: n }, children: /* @__PURE__ */ s(
1563
+ }) => /* @__PURE__ */ s(Jt.Provider, { value: { name: e, value: t, onChange: n }, children: /* @__PURE__ */ s(
1540
1564
  "div",
1541
1565
  {
1542
1566
  id: c,
@@ -1550,8 +1574,8 @@ const Oc = "crk-group-NNwCD", Fc = "crk-root-7fGik", jc = "crk-input-43PQW", Xc
1550
1574
  children: i
1551
1575
  }
1552
1576
  ) });
1553
- Uc.displayName = "RadioGroup";
1554
- const _c = $e(
1577
+ zc.displayName = "RadioGroup";
1578
+ const Vc = $e(
1555
1579
  ({
1556
1580
  label: e,
1557
1581
  value: t,
@@ -1563,8 +1587,8 @@ const _c = $e(
1563
1587
  name: l,
1564
1588
  ...a
1565
1589
  }, h) => {
1566
- const u = ft(Qt), d = u?.name ?? l, m = u ? u.value === t : c, p = (y) => {
1567
- u?.onChange?.(t), i?.(y);
1590
+ const d = ft(Jt), u = d?.name ?? l, m = d ? d.value === t : c, p = (y) => {
1591
+ d?.onChange?.(t), i?.(y);
1568
1592
  };
1569
1593
  return /* @__PURE__ */ H("label", { className: f(ht.root, n?.root, r), style: o, children: [
1570
1594
  /* @__PURE__ */ s(
@@ -1573,7 +1597,7 @@ const _c = $e(
1573
1597
  ref: h,
1574
1598
  type: "radio",
1575
1599
  className: f(ht.input, n?.input),
1576
- name: d,
1600
+ name: u,
1577
1601
  value: t,
1578
1602
  checked: m,
1579
1603
  onChange: p,
@@ -1584,24 +1608,24 @@ const _c = $e(
1584
1608
  ] });
1585
1609
  }
1586
1610
  );
1587
- _c.displayName = "Radio";
1588
- const zc = "crk-root-IGgdn", Yc = "crk-sm-N-5I2", Vc = "crk-md-bbyFl", qc = "crk-lg-Pd-Iq", Gc = "crk-error-fyu3i", Zc = "crk-resizeNone-SmNT4", Kc = "crk-resizeVertical-oi8vP", Qc = "crk-resizeHorizontal-riMLL", Jc = "crk-resizeBoth-NYSh4", ei = "crk-autoExpand-JWone", Ke = {
1589
- root: zc,
1590
- sm: Yc,
1591
- md: Vc,
1592
- lg: qc,
1593
- error: Gc,
1594
- resizeNone: Zc,
1595
- resizeVertical: Kc,
1596
- resizeHorizontal: Qc,
1597
- resizeBoth: Jc,
1598
- autoExpand: ei
1599
- }, ti = {
1611
+ Vc.displayName = "Radio";
1612
+ const Yc = "crk-root-IGgdn", qc = "crk-sm-N-5I2", Gc = "crk-md-bbyFl", Zc = "crk-lg-Pd-Iq", Kc = "crk-error-fyu3i", Qc = "crk-resizeNone-SmNT4", Jc = "crk-resizeVertical-oi8vP", ei = "crk-resizeHorizontal-riMLL", ti = "crk-resizeBoth-NYSh4", ni = "crk-autoExpand-JWone", Ke = {
1613
+ root: Yc,
1614
+ sm: qc,
1615
+ md: Gc,
1616
+ lg: Zc,
1617
+ error: Kc,
1618
+ resizeNone: Qc,
1619
+ resizeVertical: Jc,
1620
+ resizeHorizontal: ei,
1621
+ resizeBoth: ti,
1622
+ autoExpand: ni
1623
+ }, ri = {
1600
1624
  none: "resizeNone",
1601
1625
  vertical: "resizeVertical",
1602
1626
  horizontal: "resizeHorizontal",
1603
1627
  both: "resizeBoth"
1604
- }, ni = $e(
1628
+ }, oi = $e(
1605
1629
  ({
1606
1630
  inputSize: e = "md",
1607
1631
  error: t = !1,
@@ -1612,18 +1636,18 @@ const zc = "crk-root-IGgdn", Yc = "crk-sm-N-5I2", Vc = "crk-md-bbyFl", qc = "crk
1612
1636
  onChange: c,
1613
1637
  ...l
1614
1638
  }, a) => {
1615
- const h = te(null), u = he(() => {
1639
+ const h = ne(null), d = he(() => {
1616
1640
  const p = h.current;
1617
1641
  p && (p.style.height = "auto", p.style.height = `${p.scrollHeight}px`);
1618
- }, []), d = l.value ?? "";
1642
+ }, []), u = l.value ?? "";
1619
1643
  Be(() => {
1620
- r && u();
1621
- }, [r, u, d]);
1644
+ r && d();
1645
+ }, [r, d, u]);
1622
1646
  const m = he(
1623
1647
  (p) => {
1624
- r && u(), c?.(p);
1648
+ r && d(), c?.(p);
1625
1649
  },
1626
- [r, u, c]
1650
+ [r, d, c]
1627
1651
  );
1628
1652
  return /* @__PURE__ */ s(
1629
1653
  "textarea",
@@ -1635,7 +1659,7 @@ const zc = "crk-root-IGgdn", Yc = "crk-sm-N-5I2", Vc = "crk-md-bbyFl", qc = "crk
1635
1659
  Ke.root,
1636
1660
  Ke[e],
1637
1661
  t && Ke.error,
1638
- r ? Ke.autoExpand : Ke[ti[n]],
1662
+ r ? Ke.autoExpand : Ke[ri[n]],
1639
1663
  o
1640
1664
  ),
1641
1665
  style: i,
@@ -1646,60 +1670,60 @@ const zc = "crk-root-IGgdn", Yc = "crk-sm-N-5I2", Vc = "crk-md-bbyFl", qc = "crk
1646
1670
  );
1647
1671
  }
1648
1672
  );
1649
- ni.displayName = "Textarea";
1650
- function ri(e, t = { width: 600, height: 300 }) {
1651
- const [n, r] = Se(t), o = te(t);
1673
+ oi.displayName = "Textarea";
1674
+ function ci(e, t = { width: 600, height: 300 }) {
1675
+ const [n, r] = Se(t), o = ne(t);
1652
1676
  return Be(() => {
1653
1677
  const i = e.current;
1654
1678
  if (!i || typeof ResizeObserver > "u") return;
1655
- const c = (h, u) => {
1656
- const d = Math.max(0, Math.round(h)), m = Math.max(0, Math.round(u));
1657
- o.current.width === d && o.current.height === m || (o.current = { width: d, height: m }, r({ width: d, height: m }));
1679
+ const c = (h, d) => {
1680
+ const u = Math.max(0, Math.round(h)), m = Math.max(0, Math.round(d));
1681
+ o.current.width === u && o.current.height === m || (o.current = { width: u, height: m }, r({ width: u, height: m }));
1658
1682
  }, l = i.getBoundingClientRect();
1659
1683
  (l.width > 0 || l.height > 0) && c(l.width, l.height);
1660
1684
  const a = new ResizeObserver((h) => {
1661
- const u = h[0];
1662
- if (!u) return;
1663
- const d = u.contentRect;
1664
- c(d.width, d.height);
1685
+ const d = h[0];
1686
+ if (!d) return;
1687
+ const u = d.contentRect;
1688
+ c(u.width, u.height);
1665
1689
  });
1666
1690
  return a.observe(i), () => a.disconnect();
1667
1691
  }, [e]), n;
1668
1692
  }
1669
- const oi = "crk-root-uMSq0", ci = "crk-canvas-zhFr0", ii = "crk-svg-waPLB", li = "crk-gridLine-K2Gx9", si = "crk-axis-Zum8-", ai = "crk-axisLabel-Ilv3u", di = "crk-cursorLine-iNHim", ui = "crk-linePath-E4eYA", hi = "crk-areaPath-ZwMc6", mi = "crk-point-DTAoa", fi = "crk-bar-9sYbq", pi = "crk-barLabelInside-dlQh5", gi = "crk-activeBar-FJhPJ", yi = "crk-interactionLayer-dHNAG", vi = "crk-legend-JL6YI", bi = "crk-legendItem-rcdvO", xi = "crk-legendSwatch-eJBsF", ki = "crk-legendIcon-6gzcO", Mi = "crk-legendLabel-C-eu3", wi = "crk-tooltip-m55-N", $i = "crk-tooltipTitle-0EfoX", Ni = "crk-tooltipRows-MC0wM", Li = "crk-tooltipRow-ZQomr", Si = "crk-tooltipLabel-s4OKX", Ti = "crk-tooltipValue-iwj1s", Ri = "crk-empty-aa4vk", Ci = "crk-sparkline-3-eRc", Ai = "crk-tradingHeader-Pb9wS", x = {
1670
- root: oi,
1671
- canvas: ci,
1672
- svg: ii,
1673
- gridLine: li,
1674
- axis: si,
1675
- axisLabel: ai,
1676
- cursorLine: di,
1677
- linePath: ui,
1678
- areaPath: hi,
1679
- point: mi,
1680
- bar: fi,
1681
- barLabelInside: pi,
1682
- activeBar: gi,
1683
- interactionLayer: yi,
1684
- legend: vi,
1685
- legendItem: bi,
1686
- legendSwatch: xi,
1687
- legendIcon: ki,
1688
- legendLabel: Mi,
1689
- tooltip: wi,
1690
- tooltipTitle: $i,
1691
- tooltipRows: Ni,
1692
- tooltipRow: Li,
1693
- tooltipLabel: Si,
1694
- tooltipValue: Ti,
1695
- empty: Ri,
1696
- sparkline: Ci,
1697
- tradingHeader: Ai
1698
- }, Ve = $e(
1693
+ const ii = "crk-root-uMSq0", li = "crk-canvas-zhFr0", si = "crk-svg-waPLB", ai = "crk-gridLine-K2Gx9", di = "crk-axis-Zum8-", ui = "crk-axisLabel-Ilv3u", hi = "crk-cursorLine-iNHim", mi = "crk-linePath-E4eYA", fi = "crk-areaPath-ZwMc6", pi = "crk-point-DTAoa", gi = "crk-bar-9sYbq", yi = "crk-barLabelInside-dlQh5", vi = "crk-activeBar-FJhPJ", bi = "crk-interactionLayer-dHNAG", xi = "crk-legend-JL6YI", ki = "crk-legendItem-rcdvO", Mi = "crk-legendSwatch-eJBsF", wi = "crk-legendIcon-6gzcO", $i = "crk-legendLabel-C-eu3", Ni = "crk-tooltip-m55-N", Li = "crk-tooltipTitle-0EfoX", Si = "crk-tooltipRows-MC0wM", Ti = "crk-tooltipRow-ZQomr", Ri = "crk-tooltipLabel-s4OKX", Ci = "crk-tooltipValue-iwj1s", Ai = "crk-empty-aa4vk", Bi = "crk-sparkline-3-eRc", Di = "crk-tradingHeader-Pb9wS", x = {
1694
+ root: ii,
1695
+ canvas: li,
1696
+ svg: si,
1697
+ gridLine: ai,
1698
+ axis: di,
1699
+ axisLabel: ui,
1700
+ cursorLine: hi,
1701
+ linePath: mi,
1702
+ areaPath: fi,
1703
+ point: pi,
1704
+ bar: gi,
1705
+ barLabelInside: yi,
1706
+ activeBar: vi,
1707
+ interactionLayer: bi,
1708
+ legend: xi,
1709
+ legendItem: ki,
1710
+ legendSwatch: Mi,
1711
+ legendIcon: wi,
1712
+ legendLabel: $i,
1713
+ tooltip: Ni,
1714
+ tooltipTitle: Li,
1715
+ tooltipRows: Si,
1716
+ tooltipRow: Ti,
1717
+ tooltipLabel: Ri,
1718
+ tooltipValue: Ci,
1719
+ empty: Ai,
1720
+ sparkline: Bi,
1721
+ tradingHeader: Di
1722
+ }, Ye = $e(
1699
1723
  ({ aspectRatio: e = 16 / 9, height: t, className: n, style: r, classes: o, legend: i, overlay: c, children: l }, a) => {
1700
- const h = te(null);
1701
- sn(a, () => h.current);
1702
- const { width: u } = ri(h), d = Math.max(0, u), m = t ?? Math.round(d / e);
1724
+ const h = ne(null);
1725
+ an(a, () => h.current);
1726
+ const { width: d } = ci(h), u = Math.max(0, d), m = t ?? Math.round(u / e);
1703
1727
  return /* @__PURE__ */ H(
1704
1728
  "div",
1705
1729
  {
@@ -1708,15 +1732,15 @@ const oi = "crk-root-uMSq0", ci = "crk-canvas-zhFr0", ii = "crk-svg-waPLB", li =
1708
1732
  style: r,
1709
1733
  children: [
1710
1734
  /* @__PURE__ */ H("div", { className: x.canvas, style: { height: m || void 0 }, children: [
1711
- d > 0 && m > 0 && /* @__PURE__ */ s(
1735
+ u > 0 && m > 0 && /* @__PURE__ */ s(
1712
1736
  "svg",
1713
1737
  {
1714
1738
  className: f(x.svg, o?.svg),
1715
- width: d,
1739
+ width: u,
1716
1740
  height: m,
1717
- viewBox: `0 0 ${d} ${m}`,
1741
+ viewBox: `0 0 ${u} ${m}`,
1718
1742
  role: "img",
1719
- children: l({ width: d, height: m })
1743
+ children: l({ width: u, height: m })
1720
1744
  }
1721
1745
  ),
1722
1746
  c
@@ -1727,7 +1751,7 @@ const oi = "crk-root-uMSq0", ci = "crk-canvas-zhFr0", ii = "crk-svg-waPLB", li =
1727
1751
  );
1728
1752
  }
1729
1753
  );
1730
- Ve.displayName = "ChartContainer";
1754
+ Ye.displayName = "ChartContainer";
1731
1755
  function vt({ config: e, order: t, classes: n }) {
1732
1756
  const r = t ?? Object.keys(e);
1733
1757
  return /* @__PURE__ */ s("div", { className: f(x.legend, n?.legend), role: "list", children: r.map((o) => {
@@ -1766,30 +1790,30 @@ function et({
1766
1790
  classes: h
1767
1791
  }) {
1768
1792
  if (!e) return null;
1769
- const u = 180, m = t + u + 16 > r ? t - u - 12 : t + 12, p = Math.max(8, n - 16);
1793
+ const d = 180, m = t + d + 16 > r ? t - d - 12 : t + 12, p = Math.max(8, n - 16);
1770
1794
  return /* @__PURE__ */ s(
1771
1795
  "div",
1772
1796
  {
1773
1797
  className: f(x.tooltip, h?.tooltip),
1774
- style: { left: m, top: p, width: u },
1798
+ style: { left: m, top: p, width: d },
1775
1799
  role: "tooltip",
1776
- children: i ? i(e) : /* @__PURE__ */ H(Ye, { children: [
1800
+ children: i ? i(e) : /* @__PURE__ */ H(Ve, { children: [
1777
1801
  l && e[l] !== void 0 && /* @__PURE__ */ s("div", { className: x.tooltipTitle, children: String(e[l]) }),
1778
- /* @__PURE__ */ s("div", { className: x.tooltipRows, children: Object.entries(o).map(([y, $]) => {
1779
- const k = e[y];
1780
- if (k == null) return null;
1781
- const R = typeof k == "number" ? c(k) : String(k), X = a?.(y) ?? $.color;
1802
+ /* @__PURE__ */ s("div", { className: x.tooltipRows, children: Object.entries(o).map(([y, w]) => {
1803
+ const N = e[y];
1804
+ if (N == null) return null;
1805
+ const S = typeof N == "number" ? c(N) : String(N), O = a?.(y) ?? w.color;
1782
1806
  return /* @__PURE__ */ H("div", { className: x.tooltipRow, children: [
1783
- /* @__PURE__ */ s("span", { className: x.legendSwatch, style: { background: X }, "aria-hidden": "true" }),
1784
- /* @__PURE__ */ s("span", { className: x.tooltipLabel, children: $.label }),
1785
- /* @__PURE__ */ s("span", { className: x.tooltipValue, children: R })
1807
+ /* @__PURE__ */ s("span", { className: x.legendSwatch, style: { background: O }, "aria-hidden": "true" }),
1808
+ /* @__PURE__ */ s("span", { className: x.tooltipLabel, children: w.label }),
1809
+ /* @__PURE__ */ s("span", { className: x.tooltipValue, children: S })
1786
1810
  ] }, y);
1787
1811
  }) })
1788
1812
  ] })
1789
1813
  }
1790
1814
  );
1791
1815
  }
1792
- function Jt({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes: i }) {
1816
+ function en({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes: i }) {
1793
1817
  return /* @__PURE__ */ s("g", { className: f(x.axis, i?.axis), children: e.map(({ value: c, y: l }) => /* @__PURE__ */ H("g", { children: [
1794
1818
  o && /* @__PURE__ */ s(
1795
1819
  "line",
@@ -1814,7 +1838,7 @@ function Jt({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes
1814
1838
  )
1815
1839
  ] }, `y-${c}`)) });
1816
1840
  }
1817
- function en({ ticks: e, y: t, format: n, classes: r }) {
1841
+ function tn({ ticks: e, y: t, format: n, classes: r }) {
1818
1842
  return /* @__PURE__ */ s("g", { className: f(x.axis, r?.axis), children: e.map(({ label: o, x: i }) => /* @__PURE__ */ s(
1819
1843
  "text",
1820
1844
  {
@@ -1842,10 +1866,10 @@ function Je(e, t) {
1842
1866
  }
1843
1867
  function Xe(e, t, n = 0.2) {
1844
1868
  const [r, o] = t, c = (o - r) / Math.max(1, e.length), l = c * (1 - n), a = /* @__PURE__ */ new Map();
1845
- for (let u = 0; u < e.length; u++) a.set(e[u], u);
1846
- const h = (u) => {
1847
- const d = a.get(u);
1848
- return d === void 0 ? r : r + d * c + c / 2;
1869
+ for (let d = 0; d < e.length; d++) a.set(e[d], d);
1870
+ const h = (d) => {
1871
+ const u = a.get(d);
1872
+ return u === void 0 ? r : r + u * c + c / 2;
1849
1873
  };
1850
1874
  return h.bandWidth = () => l, h.step = () => c, h;
1851
1875
  }
@@ -1855,13 +1879,13 @@ function qe(e, t, n = 5) {
1855
1879
  const o = (t - e) / Math.max(1, n), i = Math.pow(10, Math.floor(Math.log10(o))), c = o / i;
1856
1880
  let l;
1857
1881
  c < 1.5 ? l = i : c < 3 ? l = 2 * i : c < 7 ? l = 5 * i : l = 10 * i;
1858
- const a = Math.floor(e / l) * l, h = Math.ceil(t / l) * l, u = [];
1859
- for (let d = a; d <= h + l / 2; d += l)
1860
- u.push(Number(d.toFixed(10)));
1861
- return u;
1882
+ const a = Math.floor(e / l) * l, h = Math.ceil(t / l) * l, d = [];
1883
+ for (let u = a; u <= h + l / 2; u += l)
1884
+ d.push(Number(u.toFixed(10)));
1885
+ return d;
1862
1886
  }
1863
- const Bi = { top: 12, right: 16, bottom: 28, left: 48 };
1864
- function Di(e, t) {
1887
+ const Ii = { top: 12, right: 16, bottom: 28, left: 48 };
1888
+ function Ei(e, t) {
1865
1889
  if (e.length === 0) return "";
1866
1890
  if (e.length === 1) return `M ${e[0].x} ${e[0].y}`;
1867
1891
  if (t === "linear")
@@ -1874,17 +1898,17 @@ function Di(e, t) {
1874
1898
  }
1875
1899
  let n = `M ${e[0].x} ${e[0].y}`;
1876
1900
  for (let r = 0; r < e.length - 1; r++) {
1877
- const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6, u = c.x - (l.x - i.x) / 6, d = c.y - (l.y - i.y) / 6;
1878
- n += ` C ${a} ${h}, ${u} ${d}, ${c.x} ${c.y}`;
1901
+ const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6, d = c.x - (l.x - i.x) / 6, u = c.y - (l.y - i.y) / 6;
1902
+ n += ` C ${a} ${h}, ${d} ${u}, ${c.x} ${c.y}`;
1879
1903
  }
1880
1904
  return n;
1881
1905
  }
1882
- function Ii(e, t = 8) {
1906
+ function Pi(e, t = 8) {
1883
1907
  if (e.length <= t) return e;
1884
1908
  const n = Math.ceil(e.length / t);
1885
1909
  return e.filter((r, o) => o % n === 0);
1886
1910
  }
1887
- function El({
1911
+ function Hl({
1888
1912
  data: e,
1889
1913
  xKey: t,
1890
1914
  config: n,
@@ -1895,180 +1919,180 @@ function El({
1895
1919
  dotColorKey: l,
1896
1920
  renderDot: a,
1897
1921
  showValues: h = !1,
1898
- valuePosition: u = "top",
1899
- renderLabel: d,
1922
+ valuePosition: d = "top",
1923
+ renderLabel: u,
1900
1924
  activeIndex: m,
1901
1925
  onPointClick: p,
1902
1926
  showGrid: y = !0,
1903
- showLegend: $ = !0,
1904
- showTooltip: k = !0,
1905
- yTickCount: R = 5,
1906
- yFormat: X,
1907
- xFormat: E,
1908
- valueFormat: W,
1909
- renderTooltip: ae,
1910
- margin: _,
1927
+ showLegend: w = !0,
1928
+ showTooltip: N = !0,
1929
+ yTickCount: S = 5,
1930
+ yFormat: O,
1931
+ xFormat: P,
1932
+ valueFormat: U,
1933
+ renderTooltip: re,
1934
+ margin: D,
1911
1935
  emptyMessage: C = "No data",
1912
- className: oe,
1913
- style: le,
1914
- classes: w
1936
+ className: ee,
1937
+ style: se,
1938
+ classes: M
1915
1939
  }) {
1916
- const q = { ...Bi, ..._ }, D = ke(() => Object.keys(n), [n]), [Q, O] = Se(null), P = te(null), ee = m ?? Q, ne = (v, M) => {
1940
+ const q = { ...Ii, ...D }, I = ke(() => Object.keys(n), [n]), [Q, F] = Se(null), W = ne(null), te = m ?? Q, oe = (v, k) => {
1917
1941
  if (l) {
1918
- const N = e[M]?.[l];
1919
- if (typeof N == "string") return N;
1942
+ const $ = e[k]?.[l];
1943
+ if (typeof $ == "string") return $;
1920
1944
  }
1921
1945
  return n[v]?.color ?? "var(--crk-chart-1)";
1922
1946
  };
1923
1947
  if (e.length === 0)
1924
- return /* @__PURE__ */ s("div", { ref: P, className: f(x.root, w?.root, oe), style: le, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: C }) }) });
1925
- const L = k && ee !== null ? /* @__PURE__ */ s(
1948
+ return /* @__PURE__ */ s("div", { ref: W, className: f(x.root, M?.root, ee), style: se, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: C }) }) });
1949
+ const L = N && te !== null ? /* @__PURE__ */ s(
1926
1950
  et,
1927
1951
  {
1928
- row: e[ee],
1929
- x: Ei(e, t, q, ee, P),
1952
+ row: e[te],
1953
+ x: Wi(e, t, q, te, W),
1930
1954
  y: 16,
1931
- containerWidth: P.current?.getBoundingClientRect().width ?? 0,
1955
+ containerWidth: W.current?.getBoundingClientRect().width ?? 0,
1932
1956
  config: n,
1933
- render: ae ? () => ae(e[ee]) : void 0,
1934
- valueFormat: W,
1957
+ render: re ? () => re(e[te]) : void 0,
1958
+ valueFormat: U,
1935
1959
  titleKey: t,
1936
- resolveColor: l ? (v) => ne(v, ee) : void 0,
1937
- classes: w
1960
+ resolveColor: l ? (v) => oe(v, te) : void 0,
1961
+ classes: M
1938
1962
  }
1939
1963
  ) : null;
1940
1964
  return /* @__PURE__ */ s(
1941
- Ve,
1965
+ Ye,
1942
1966
  {
1943
- ref: P,
1967
+ ref: W,
1944
1968
  aspectRatio: r,
1945
1969
  height: o,
1946
- className: oe,
1947
- style: le,
1948
- classes: w,
1949
- legend: $ ? /* @__PURE__ */ s(vt, { config: n, classes: w }) : void 0,
1970
+ className: ee,
1971
+ style: se,
1972
+ classes: M,
1973
+ legend: w ? /* @__PURE__ */ s(vt, { config: n, classes: M }) : void 0,
1950
1974
  overlay: L,
1951
- children: ({ width: v, height: M }) => {
1952
- const N = q.left, z = v - q.right, S = q.top, F = M - q.bottom, Y = Math.max(0, z - N), G = Math.max(0, F - S), Z = e.map((g) => String(g[t])), U = Xe(Z, [N, z], 0), J = [];
1953
- for (const g of D)
1975
+ children: ({ width: v, height: k }) => {
1976
+ const $ = q.left, z = v - q.right, T = q.top, j = k - q.bottom, V = Math.max(0, z - $), G = Math.max(0, j - T), Z = e.map((g) => String(g[t])), _ = Xe(Z, [$, z], 0), J = [];
1977
+ for (const g of I)
1954
1978
  for (const b of e) {
1955
1979
  const K = b[g];
1956
1980
  typeof K == "number" && J.push(K);
1957
1981
  }
1958
- const [ue, be] = bt(J), pe = Math.min(0, ue), fe = qe(pe, be, R), ge = Je([fe[0], fe[fe.length - 1]], [F, S]), ve = fe.map((g) => ({ value: g, y: ge(g) })), Ne = Ii(Z).map((g) => ({ label: g, x: U(g) }));
1959
- return /* @__PURE__ */ H(Ye, { children: [
1982
+ const [ue, be] = bt(J), pe = Math.min(0, ue), fe = qe(pe, be, S), ge = Je([fe[0], fe[fe.length - 1]], [j, T]), ve = fe.map((g) => ({ value: g, y: ge(g) })), Ne = Pi(Z).map((g) => ({ label: g, x: _(g) }));
1983
+ return /* @__PURE__ */ H(Ve, { children: [
1960
1984
  /* @__PURE__ */ s(
1961
- Jt,
1985
+ en,
1962
1986
  {
1963
1987
  ticks: ve,
1964
- x: N,
1965
- plotWidth: Y,
1966
- format: X,
1988
+ x: $,
1989
+ plotWidth: V,
1990
+ format: O,
1967
1991
  showGrid: y,
1968
- classes: w
1992
+ classes: M
1969
1993
  }
1970
1994
  ),
1971
- /* @__PURE__ */ s(en, { ticks: Ne, y: F, format: E, classes: w }),
1972
- D.map((g) => {
1973
- const b = n[g], K = e.map((B, j) => {
1995
+ /* @__PURE__ */ s(tn, { ticks: Ne, y: j, format: P, classes: M }),
1996
+ I.map((g) => {
1997
+ const b = n[g], K = e.map((B, X) => {
1974
1998
  const A = B[g], de = typeof A == "number" ? A : 0;
1975
- return { x: U(Z[j]), y: ge(de), value: de, row: B };
1999
+ return { x: _(Z[X]), y: ge(de), value: de, row: B };
1976
2000
  });
1977
- return /* @__PURE__ */ H("g", { className: f(x.series, w?.series), children: [
2001
+ return /* @__PURE__ */ H("g", { className: f(x.series, M?.series), children: [
1978
2002
  /* @__PURE__ */ s(
1979
2003
  "path",
1980
2004
  {
1981
2005
  className: f(x.linePath),
1982
- d: Di(K, i),
2006
+ d: Ei(K, i),
1983
2007
  stroke: b.color
1984
2008
  }
1985
2009
  ),
1986
- c && K.map((B, j) => {
1987
- const A = ne(g, j), de = ee === j, V = m !== void 0 && !de, T = p ? () => p({ row: B.row, value: B.value, seriesKey: g, index: j }) : void 0;
2010
+ c && K.map((B, X) => {
2011
+ const A = oe(g, X), de = te === X, Y = m !== void 0 && !de, R = p ? () => p({ row: B.row, value: B.value, seriesKey: g, index: X }) : void 0;
1988
2012
  return a ? /* @__PURE__ */ s(
1989
2013
  "g",
1990
2014
  {
1991
- onClick: T,
1992
- style: T ? { cursor: "pointer" } : void 0,
1993
- opacity: V ? 0.45 : 1,
2015
+ onClick: R,
2016
+ style: R ? { cursor: "pointer" } : void 0,
2017
+ opacity: Y ? 0.45 : 1,
1994
2018
  children: a({
1995
2019
  row: B.row,
1996
2020
  value: B.value,
1997
2021
  seriesKey: g,
1998
- index: j,
2022
+ index: X,
1999
2023
  x: B.x,
2000
2024
  y: B.y,
2001
2025
  color: A,
2002
2026
  active: de
2003
2027
  })
2004
2028
  },
2005
- `${g}-${j}`
2029
+ `${g}-${X}`
2006
2030
  ) : /* @__PURE__ */ s(
2007
2031
  "circle",
2008
2032
  {
2009
- className: f(x.point, w?.point),
2033
+ className: f(x.point, M?.point),
2010
2034
  cx: B.x,
2011
2035
  cy: B.y,
2012
2036
  r: de ? 5 : 3.5,
2013
2037
  fill: A,
2014
- onClick: T,
2015
- style: T ? { cursor: "pointer" } : void 0,
2016
- opacity: V ? 0.45 : 1
2038
+ onClick: R,
2039
+ style: R ? { cursor: "pointer" } : void 0,
2040
+ opacity: Y ? 0.45 : 1
2017
2041
  },
2018
- `${g}-${j}`
2042
+ `${g}-${X}`
2019
2043
  );
2020
2044
  }),
2021
- (h || d) && K.map((B, j) => {
2022
- const A = d ? d({ row: B.row, value: B.value, seriesKey: g, index: j }) : h ? W ? W(B.value) : String(B.value) : null;
2045
+ (h || u) && K.map((B, X) => {
2046
+ const A = u ? u({ row: B.row, value: B.value, seriesKey: g, index: X }) : h ? U ? U(B.value) : String(B.value) : null;
2023
2047
  if (A == null) return null;
2024
- const de = 10, V = u === "top" ? B.y - de : B.y + de + 4;
2048
+ const de = 10, Y = d === "top" ? B.y - de : B.y + de + 4;
2025
2049
  return /* @__PURE__ */ s(
2026
2050
  "text",
2027
2051
  {
2028
2052
  className: f(x.axisLabel),
2029
2053
  x: B.x,
2030
- y: V,
2054
+ y: Y,
2031
2055
  textAnchor: "middle",
2032
- dominantBaseline: u === "top" ? "auto" : "middle",
2056
+ dominantBaseline: d === "top" ? "auto" : "middle",
2033
2057
  children: A
2034
2058
  },
2035
- `label-${g}-${j}`
2059
+ `label-${g}-${X}`
2036
2060
  );
2037
2061
  })
2038
2062
  ] }, g);
2039
2063
  }),
2040
- ee !== null && /* @__PURE__ */ s(
2064
+ te !== null && /* @__PURE__ */ s(
2041
2065
  "line",
2042
2066
  {
2043
2067
  className: x.cursorLine,
2044
- x1: U(Z[ee]),
2045
- x2: U(Z[ee]),
2046
- y1: S,
2047
- y2: F
2068
+ x1: _(Z[te]),
2069
+ x2: _(Z[te]),
2070
+ y1: T,
2071
+ y2: j
2048
2072
  }
2049
2073
  ),
2050
2074
  /* @__PURE__ */ s(
2051
2075
  "rect",
2052
2076
  {
2053
2077
  className: x.interactionLayer,
2054
- x: N,
2055
- y: S,
2056
- width: Y,
2078
+ x: $,
2079
+ y: T,
2080
+ width: V,
2057
2081
  height: G,
2058
2082
  onMouseMove: (g) => {
2059
- const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left + N, B = U.step(), j = Math.max(
2083
+ const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left + $, B = _.step(), X = Math.max(
2060
2084
  0,
2061
- Math.min(e.length - 1, Math.round((K - N - B / 2) / B))
2085
+ Math.min(e.length - 1, Math.round((K - $ - B / 2) / B))
2062
2086
  );
2063
- O(j);
2087
+ F(X);
2064
2088
  },
2065
- onMouseLeave: () => O(null),
2089
+ onMouseLeave: () => F(null),
2066
2090
  onClick: p ? (g) => {
2067
- const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left + N, B = U.step(), j = Math.max(
2091
+ const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left + $, B = _.step(), X = Math.max(
2068
2092
  0,
2069
- Math.min(e.length - 1, Math.round((K - N - B / 2) / B))
2070
- ), A = D[0], de = e[j][A], V = typeof de == "number" ? de : 0;
2071
- p({ row: e[j], value: V, seriesKey: A, index: j });
2093
+ Math.min(e.length - 1, Math.round((K - $ - B / 2) / B))
2094
+ ), A = I[0], de = e[X][A], Y = typeof de == "number" ? de : 0;
2095
+ p({ row: e[X], value: Y, seriesKey: A, index: X });
2072
2096
  } : void 0,
2073
2097
  style: p ? { cursor: "pointer" } : void 0
2074
2098
  }
@@ -2078,13 +2102,13 @@ function El({
2078
2102
  }
2079
2103
  );
2080
2104
  }
2081
- function Ei(e, t, n, r, o) {
2105
+ function Wi(e, t, n, r, o) {
2082
2106
  const i = o.current;
2083
2107
  if (!i) return 0;
2084
2108
  const c = i.getBoundingClientRect().width, l = e.map((h) => String(h[t]));
2085
2109
  return Xe(l, [n.left, c - n.right], 0)(l[r]);
2086
2110
  }
2087
- const Pi = { top: 12, right: 16, bottom: 28, left: 48 };
2111
+ const Hi = { top: 12, right: 16, bottom: 28, left: 48 };
2088
2112
  function St(e, t) {
2089
2113
  if (e.length === 0) return "";
2090
2114
  if (e.length === 1) return `M ${e[0].x} ${e[0].y}`;
@@ -2098,8 +2122,8 @@ function St(e, t) {
2098
2122
  }
2099
2123
  let n = `M ${e[0].x} ${e[0].y}`;
2100
2124
  for (let r = 0; r < e.length - 1; r++) {
2101
- const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6, u = c.x - (l.x - i.x) / 6, d = c.y - (l.y - i.y) / 6;
2102
- n += ` C ${a} ${h}, ${u} ${d}, ${c.x} ${c.y}`;
2125
+ const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6, d = c.x - (l.x - i.x) / 6, u = c.y - (l.y - i.y) / 6;
2126
+ n += ` C ${a} ${h}, ${d} ${u}, ${c.x} ${c.y}`;
2103
2127
  }
2104
2128
  return n;
2105
2129
  }
@@ -2113,12 +2137,12 @@ function Dt(e, t, n) {
2113
2137
  const o = e.map((l, a) => ({ x: l.x, y: t[a] })).reverse(), c = St(o, n).replace(/^M /, "L ");
2114
2138
  return `${r} ${c} Z`;
2115
2139
  }
2116
- function Wi(e, t = 8) {
2140
+ function Oi(e, t = 8) {
2117
2141
  if (e.length <= t) return e;
2118
2142
  const n = Math.ceil(e.length / t);
2119
2143
  return e.filter((r, o) => o % n === 0);
2120
2144
  }
2121
- function Pl({
2145
+ function Ol({
2122
2146
  data: e,
2123
2147
  xKey: t,
2124
2148
  config: n,
@@ -2129,95 +2153,95 @@ function Pl({
2129
2153
  stackOffset: l = "none",
2130
2154
  fillGradient: a = !1,
2131
2155
  showGrid: h = !0,
2132
- showXAxis: u = !0,
2133
- showYAxis: d = !0,
2156
+ showXAxis: d = !0,
2157
+ showYAxis: u = !0,
2134
2158
  showLegend: m = !0,
2135
2159
  showTooltip: p = !0,
2136
2160
  yTickCount: y = 5,
2137
- yFormat: $,
2138
- xFormat: k,
2139
- valueFormat: R,
2140
- renderTooltip: X,
2141
- margin: E,
2142
- emptyMessage: W = "No data",
2143
- className: ae,
2144
- style: _,
2161
+ yFormat: w,
2162
+ xFormat: N,
2163
+ valueFormat: S,
2164
+ renderTooltip: O,
2165
+ margin: P,
2166
+ emptyMessage: U = "No data",
2167
+ className: re,
2168
+ style: D,
2145
2169
  classes: C
2146
2170
  }) {
2147
- const oe = ke(
2171
+ const ee = ke(
2148
2172
  () => ({
2149
- ...Pi,
2150
- ...d ? {} : { left: 16 },
2151
- ...E
2173
+ ...Hi,
2174
+ ...u ? {} : { left: 16 },
2175
+ ...P
2152
2176
  }),
2153
- [E, d]
2154
- ), le = ke(() => Object.keys(n), [n]), w = c && le.length > 0, q = w && l === "expand", [D, Q] = Se(null), O = te(null), P = ze();
2177
+ [P, u]
2178
+ ), se = ke(() => Object.keys(n), [n]), M = c && se.length > 0, q = M && l === "expand", [I, Q] = Se(null), F = ne(null), W = ze();
2155
2179
  if (e.length === 0)
2156
- return /* @__PURE__ */ s("div", { ref: O, className: f(x.root, C?.root, ae), style: _, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: W }) }) });
2157
- const ee = ke(() => {
2158
- const N = le.map(() => []), z = le.map(() => []);
2159
- for (let S = 0; S < e.length; S++) {
2160
- let F = 0;
2180
+ return /* @__PURE__ */ s("div", { ref: F, className: f(x.root, C?.root, re), style: D, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: U }) }) });
2181
+ const te = ke(() => {
2182
+ const $ = se.map(() => []), z = se.map(() => []);
2183
+ for (let T = 0; T < e.length; T++) {
2184
+ let j = 0;
2161
2185
  if (q) {
2162
- for (const G of le) {
2163
- const Z = e[S][G];
2164
- typeof Z == "number" && Z > 0 && (F += Z);
2186
+ for (const G of se) {
2187
+ const Z = e[T][G];
2188
+ typeof Z == "number" && Z > 0 && (j += Z);
2165
2189
  }
2166
- F === 0 && (F = 1);
2190
+ j === 0 && (j = 1);
2167
2191
  }
2168
- let Y = 0;
2169
- for (let G = 0; G < le.length; G++) {
2170
- const Z = le[G], U = e[S][Z], J = typeof U == "number" ? U : 0;
2171
- if (w) {
2172
- const ue = q ? J / F : J;
2173
- z[G][S] = Y, Y += ue, N[G][S] = Y;
2192
+ let V = 0;
2193
+ for (let G = 0; G < se.length; G++) {
2194
+ const Z = se[G], _ = e[T][Z], J = typeof _ == "number" ? _ : 0;
2195
+ if (M) {
2196
+ const ue = q ? J / j : J;
2197
+ z[G][T] = V, V += ue, $[G][T] = V;
2174
2198
  } else
2175
- z[G][S] = 0, N[G][S] = J;
2199
+ z[G][T] = 0, $[G][T] = J;
2176
2200
  }
2177
2201
  }
2178
- return { tops: N, bottoms: z };
2179
- }, [e, le, w, q]), { tops: ne, bottoms: L } = ee, [v, M] = ke(() => {
2202
+ return { tops: $, bottoms: z };
2203
+ }, [e, se, M, q]), { tops: oe, bottoms: L } = te, [v, k] = ke(() => {
2180
2204
  if (q) return [0, 1];
2181
- let N = 0, z = 0;
2182
- for (const S of ne)
2183
- for (const F of S)
2184
- F < N && (N = F), F > z && (z = F);
2185
- for (const S of L)
2186
- for (const F of S)
2187
- F < N && (N = F);
2188
- return [Math.min(0, N), z];
2189
- }, [ne, L, q]);
2205
+ let $ = 0, z = 0;
2206
+ for (const T of oe)
2207
+ for (const j of T)
2208
+ j < $ && ($ = j), j > z && (z = j);
2209
+ for (const T of L)
2210
+ for (const j of T)
2211
+ j < $ && ($ = j);
2212
+ return [Math.min(0, $), z];
2213
+ }, [oe, L, q]);
2190
2214
  return /* @__PURE__ */ s(
2191
- Ve,
2215
+ Ye,
2192
2216
  {
2193
- ref: O,
2217
+ ref: F,
2194
2218
  aspectRatio: r,
2195
2219
  height: o,
2196
- className: ae,
2197
- style: _,
2220
+ className: re,
2221
+ style: D,
2198
2222
  classes: C,
2199
2223
  legend: m ? /* @__PURE__ */ s(vt, { config: n, classes: C }) : void 0,
2200
- overlay: p && D !== null ? /* @__PURE__ */ s(
2224
+ overlay: p && I !== null ? /* @__PURE__ */ s(
2201
2225
  et,
2202
2226
  {
2203
- row: e[D],
2204
- x: Hi(e, t, oe, D, O),
2227
+ row: e[I],
2228
+ x: Fi(e, t, ee, I, F),
2205
2229
  y: 16,
2206
- containerWidth: O.current?.getBoundingClientRect().width ?? 0,
2230
+ containerWidth: F.current?.getBoundingClientRect().width ?? 0,
2207
2231
  config: n,
2208
- render: X ? () => X(e[D]) : void 0,
2209
- valueFormat: q ? (N) => `${Math.round(N * 100)}%` : R,
2232
+ render: O ? () => O(e[I]) : void 0,
2233
+ valueFormat: q ? ($) => `${Math.round($ * 100)}%` : S,
2210
2234
  titleKey: t,
2211
2235
  classes: C
2212
2236
  }
2213
2237
  ) : null,
2214
- children: ({ width: N, height: z }) => {
2215
- const S = oe.left, F = N - oe.right, Y = oe.top, G = z - oe.bottom, Z = Math.max(0, F - S), U = Math.max(0, G - Y), J = e.map((g) => String(g[t])), ue = Xe(J, [S, F], 0), be = q ? [0, 0.25, 0.5, 0.75, 1] : qe(v, M, y), pe = Je([be[0], be[be.length - 1]], [G, Y]), fe = pe(0), ge = be.map((g) => ({ value: g, y: pe(g) })), Re = Wi(J).map((g) => ({ label: g, x: ue(g) })), Ne = q ? (g) => `${Math.round(g * 100)}%` : $;
2216
- return /* @__PURE__ */ H(Ye, { children: [
2217
- a && /* @__PURE__ */ s("defs", { children: le.map((g) => /* @__PURE__ */ H(
2238
+ children: ({ width: $, height: z }) => {
2239
+ const T = ee.left, j = $ - ee.right, V = ee.top, G = z - ee.bottom, Z = Math.max(0, j - T), _ = Math.max(0, G - V), J = e.map((g) => String(g[t])), ue = Xe(J, [T, j], 0), be = q ? [0, 0.25, 0.5, 0.75, 1] : qe(v, k, y), pe = Je([be[0], be[be.length - 1]], [G, V]), fe = pe(0), ge = be.map((g) => ({ value: g, y: pe(g) })), Re = Oi(J).map((g) => ({ label: g, x: ue(g) })), Ne = q ? (g) => `${Math.round(g * 100)}%` : w;
2240
+ return /* @__PURE__ */ H(Ve, { children: [
2241
+ a && /* @__PURE__ */ s("defs", { children: se.map((g) => /* @__PURE__ */ H(
2218
2242
  "linearGradient",
2219
2243
  {
2220
- id: `${P}-${g}`,
2244
+ id: `${W}-${g}`,
2221
2245
  x1: "0",
2222
2246
  y1: "0",
2223
2247
  x2: "0",
@@ -2229,11 +2253,11 @@ function Pl({
2229
2253
  },
2230
2254
  g
2231
2255
  )) }),
2232
- d ? /* @__PURE__ */ s(
2233
- Jt,
2256
+ u ? /* @__PURE__ */ s(
2257
+ en,
2234
2258
  {
2235
2259
  ticks: ge,
2236
- x: S,
2260
+ x: T,
2237
2261
  plotWidth: Z,
2238
2262
  format: Ne,
2239
2263
  showGrid: h,
@@ -2243,50 +2267,50 @@ function Pl({
2243
2267
  "line",
2244
2268
  {
2245
2269
  className: f(x.gridLine, C?.grid),
2246
- x1: S,
2247
- x2: F,
2270
+ x1: T,
2271
+ x2: j,
2248
2272
  y1: b,
2249
2273
  y2: b
2250
2274
  },
2251
2275
  `grid-${g}`
2252
2276
  )) }),
2253
- u && /* @__PURE__ */ s(en, { ticks: Re, y: G, format: k, classes: C }),
2254
- le.map((g, b) => {
2255
- const K = n[g], B = e.map((V, T) => ({
2256
- x: ue(J[T]),
2257
- y: pe(ne[b][T])
2258
- })), j = a ? `url(#${P}-${g})` : K.color, A = a ? 1 : 0.18, de = w ? Dt(B, L[b].map((V) => pe(V)), i) : Dt(B, fe, i);
2277
+ d && /* @__PURE__ */ s(tn, { ticks: Re, y: G, format: N, classes: C }),
2278
+ se.map((g, b) => {
2279
+ const K = n[g], B = e.map((Y, R) => ({
2280
+ x: ue(J[R]),
2281
+ y: pe(oe[b][R])
2282
+ })), X = a ? `url(#${W}-${g})` : K.color, A = a ? 1 : 0.18, de = M ? Dt(B, L[b].map((Y) => pe(Y)), i) : Dt(B, fe, i);
2259
2283
  return /* @__PURE__ */ H("g", { className: f(x.series, C?.series), children: [
2260
2284
  /* @__PURE__ */ s(
2261
2285
  "path",
2262
2286
  {
2263
2287
  className: x.areaPath,
2264
2288
  d: de,
2265
- fill: j,
2289
+ fill: X,
2266
2290
  fillOpacity: A
2267
2291
  }
2268
2292
  ),
2269
2293
  /* @__PURE__ */ s("path", { className: x.linePath, d: St(B, i), stroke: K.color }),
2270
- !w && B.map((V, T) => /* @__PURE__ */ s(
2294
+ !M && B.map((Y, R) => /* @__PURE__ */ s(
2271
2295
  "circle",
2272
2296
  {
2273
2297
  className: f(x.point, C?.point),
2274
- cx: V.x,
2275
- cy: V.y,
2276
- r: D === T ? 5 : 3,
2298
+ cx: Y.x,
2299
+ cy: Y.y,
2300
+ r: I === R ? 5 : 3,
2277
2301
  fill: K.color
2278
2302
  },
2279
- `${g}-${T}`
2303
+ `${g}-${R}`
2280
2304
  ))
2281
2305
  ] }, g);
2282
2306
  }),
2283
- D !== null && /* @__PURE__ */ s(
2307
+ I !== null && /* @__PURE__ */ s(
2284
2308
  "line",
2285
2309
  {
2286
2310
  className: x.cursorLine,
2287
- x1: ue(J[D]),
2288
- x2: ue(J[D]),
2289
- y1: Y,
2311
+ x1: ue(J[I]),
2312
+ x2: ue(J[I]),
2313
+ y1: V,
2290
2314
  y2: G
2291
2315
  }
2292
2316
  ),
@@ -2294,13 +2318,13 @@ function Pl({
2294
2318
  "rect",
2295
2319
  {
2296
2320
  className: x.interactionLayer,
2297
- x: S,
2298
- y: Y,
2321
+ x: T,
2322
+ y: V,
2299
2323
  width: Z,
2300
- height: U,
2324
+ height: _,
2301
2325
  onMouseMove: (g) => {
2302
- const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left + S, B = ue.step(), j = Math.max(0, Math.min(e.length - 1, Math.round((K - S - B / 2) / B)));
2303
- Q(j);
2326
+ const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left + T, B = ue.step(), X = Math.max(0, Math.min(e.length - 1, Math.round((K - T - B / 2) / B)));
2327
+ Q(X);
2304
2328
  },
2305
2329
  onMouseLeave: () => Q(null)
2306
2330
  }
@@ -2310,25 +2334,25 @@ function Pl({
2310
2334
  }
2311
2335
  );
2312
2336
  }
2313
- function Hi(e, t, n, r, o) {
2337
+ function Fi(e, t, n, r, o) {
2314
2338
  const i = o.current;
2315
2339
  if (!i) return 0;
2316
2340
  const c = i.getBoundingClientRect().width, l = e.map((h) => String(h[t]));
2317
2341
  return Xe(l, [n.left, c - n.right], 0)(l[r]);
2318
2342
  }
2319
- const Oi = [
2343
+ const ji = [
2320
2344
  "var(--crk-chart-1)",
2321
2345
  "var(--crk-chart-2)",
2322
2346
  "var(--crk-chart-3)",
2323
2347
  "var(--crk-chart-4)",
2324
2348
  "var(--crk-chart-5)"
2325
- ], Fi = { top: 12, right: 16, bottom: 28, left: 48 }, ji = { top: 12, right: 16, bottom: 28, left: 72 };
2326
- function Xi(e, t = 8) {
2349
+ ], Xi = { top: 12, right: 16, bottom: 28, left: 48 }, Ui = { top: 12, right: 16, bottom: 28, left: 72 };
2350
+ function _i(e, t = 8) {
2327
2351
  if (e.length <= t) return e;
2328
2352
  const n = Math.ceil(e.length / t);
2329
2353
  return e.filter((r, o) => o % n === 0);
2330
2354
  }
2331
- function Wl({
2355
+ function Fl({
2332
2356
  data: e,
2333
2357
  xKey: t,
2334
2358
  config: n,
@@ -2339,37 +2363,37 @@ function Wl({
2339
2363
  groupPadding: l = 0.2,
2340
2364
  barPadding: a = 0.1,
2341
2365
  barRadius: h = 4,
2342
- showGrid: u = !0,
2343
- showLegend: d = !0,
2366
+ showGrid: d = !0,
2367
+ showLegend: u = !0,
2344
2368
  showTooltip: m = !0,
2345
2369
  showValues: p = !1,
2346
2370
  valuePosition: y = "outside",
2347
- renderLabel: $,
2348
- colorBy: k = "series",
2349
- colors: R = Oi,
2350
- negativeColor: X,
2351
- activeIndex: E,
2352
- onBarClick: W,
2353
- yTickCount: ae = 5,
2354
- yFormat: _,
2371
+ renderLabel: w,
2372
+ colorBy: N = "series",
2373
+ colors: S = ji,
2374
+ negativeColor: O,
2375
+ activeIndex: P,
2376
+ onBarClick: U,
2377
+ yTickCount: re = 5,
2378
+ yFormat: D,
2355
2379
  xFormat: C,
2356
- valueFormat: oe,
2357
- renderTooltip: le,
2358
- margin: w,
2380
+ valueFormat: ee,
2381
+ renderTooltip: se,
2382
+ margin: M,
2359
2383
  emptyMessage: q = "No data",
2360
- className: D,
2384
+ className: I,
2361
2385
  style: Q,
2362
- classes: O
2386
+ classes: F
2363
2387
  }) {
2364
- const P = r === "horizontal", ee = { ...P ? ji : Fi, ...w }, ne = ke(() => Object.keys(n), [n]), L = o && ne.length > 1, [v, M] = Se(null), N = te(null);
2388
+ const W = r === "horizontal", te = { ...W ? Ui : Xi, ...M }, oe = ke(() => Object.keys(n), [n]), L = o && oe.length > 1, [v, k] = Se(null), $ = ne(null);
2365
2389
  if (e.length === 0)
2366
- return /* @__PURE__ */ s("div", { ref: N, className: f(x.root, O?.root, D), style: Q, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: c ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: q }) }) });
2367
- const z = e.map((ue) => String(ue[t])), S = E ?? v, F = ke(() => {
2390
+ return /* @__PURE__ */ s("div", { ref: $, className: f(x.root, F?.root, I), style: Q, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: c ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: q }) }) });
2391
+ const z = e.map((ue) => String(ue[t])), T = P ?? v, j = ke(() => {
2368
2392
  if (L) {
2369
2393
  let fe = 0, ge = 0;
2370
2394
  for (const ve of e) {
2371
2395
  let Re = 0, Ne = 0;
2372
- for (const g of ne) {
2396
+ for (const g of oe) {
2373
2397
  const b = ve[g];
2374
2398
  typeof b == "number" && (b >= 0 ? Re += b : Ne += b);
2375
2399
  }
@@ -2379,140 +2403,140 @@ function Wl({
2379
2403
  }
2380
2404
  const ue = [];
2381
2405
  for (const fe of e)
2382
- for (const ge of ne) {
2406
+ for (const ge of oe) {
2383
2407
  const ve = fe[ge];
2384
2408
  typeof ve == "number" && ue.push(ve);
2385
2409
  }
2386
2410
  const [be, pe] = bt(ue);
2387
2411
  return [Math.min(0, be), Math.max(0, pe)];
2388
- }, [e, ne, L]), Y = qe(F[0], F[1], ae), G = Y[0], Z = Y[Y.length - 1], U = (ue, be) => k === "index" ? R[be % R.length] : n[ue]?.color ?? R[0], J = m && S !== null && e[S] ? /* @__PURE__ */ s(
2412
+ }, [e, oe, L]), V = qe(j[0], j[1], re), G = V[0], Z = V[V.length - 1], _ = (ue, be) => N === "index" ? S[be % S.length] : n[ue]?.color ?? S[0], J = m && T !== null && e[T] ? /* @__PURE__ */ s(
2389
2413
  et,
2390
2414
  {
2391
- row: e[S],
2392
- x: _i(e, t, ee, S, N, P, l),
2393
- y: P ? zi(e, t, ee, S, N, l) : 16,
2394
- containerWidth: N.current?.getBoundingClientRect().width ?? 0,
2415
+ row: e[T],
2416
+ x: Vi(e, t, te, T, $, W, l),
2417
+ y: W ? Yi(e, t, te, T, $, l) : 16,
2418
+ containerWidth: $.current?.getBoundingClientRect().width ?? 0,
2395
2419
  config: n,
2396
- render: le ? () => le(e[S]) : void 0,
2397
- valueFormat: oe,
2420
+ render: se ? () => se(e[T]) : void 0,
2421
+ valueFormat: ee,
2398
2422
  titleKey: t,
2399
2423
  resolveColor: (ue) => {
2400
- const be = e[S][ue], pe = U(ue, S);
2401
- return typeof be != "number" ? pe : X !== void 0 && be < 0 ? X : pe;
2424
+ const be = e[T][ue], pe = _(ue, T);
2425
+ return typeof be != "number" ? pe : O !== void 0 && be < 0 ? O : pe;
2402
2426
  },
2403
- classes: O
2427
+ classes: F
2404
2428
  }
2405
2429
  ) : null;
2406
2430
  return /* @__PURE__ */ s(
2407
- Ve,
2431
+ Ye,
2408
2432
  {
2409
- ref: N,
2433
+ ref: $,
2410
2434
  aspectRatio: i,
2411
2435
  height: c,
2412
- className: D,
2436
+ className: I,
2413
2437
  style: Q,
2414
- classes: O,
2415
- legend: d ? /* @__PURE__ */ s(vt, { config: n, classes: O }) : void 0,
2438
+ classes: F,
2439
+ legend: u ? /* @__PURE__ */ s(vt, { config: n, classes: F }) : void 0,
2416
2440
  overlay: J,
2417
2441
  children: ({ width: ue, height: be }) => {
2418
- const pe = ee.left, fe = ue - ee.right, ge = ee.top, ve = be - ee.bottom, Re = Math.max(0, fe - pe), Ne = Math.max(0, ve - ge), b = Xe(z, P ? [ge, ve] : [pe, fe], l), K = b.bandWidth(), j = Je([G, Z], P ? [pe, fe] : [ve, ge]), A = j(0), de = L ? 1 : Math.max(1, ne.length), V = K / de, T = V * (1 - a), ce = Y.map((re) => ({
2419
- value: re,
2420
- pos: j(re)
2421
- })), me = Xi(z);
2422
- return /* @__PURE__ */ H(Ye, { children: [
2423
- u && /* @__PURE__ */ s("g", { className: f(x.axis, O?.axis), children: ce.map(
2424
- ({ value: re, pos: se }) => P ? /* @__PURE__ */ s(
2442
+ const pe = te.left, fe = ue - te.right, ge = te.top, ve = be - te.bottom, Re = Math.max(0, fe - pe), Ne = Math.max(0, ve - ge), b = Xe(z, W ? [ge, ve] : [pe, fe], l), K = b.bandWidth(), X = Je([G, Z], W ? [pe, fe] : [ve, ge]), A = X(0), de = L ? 1 : Math.max(1, oe.length), Y = K / de, R = Y * (1 - a), ie = V.map((ce) => ({
2443
+ value: ce,
2444
+ pos: X(ce)
2445
+ })), me = _i(z);
2446
+ return /* @__PURE__ */ H(Ve, { children: [
2447
+ d && /* @__PURE__ */ s("g", { className: f(x.axis, F?.axis), children: ie.map(
2448
+ ({ value: ce, pos: ae }) => W ? /* @__PURE__ */ s(
2425
2449
  "line",
2426
2450
  {
2427
- className: f(x.gridLine, O?.grid),
2428
- x1: se,
2429
- x2: se,
2451
+ className: f(x.gridLine, F?.grid),
2452
+ x1: ae,
2453
+ x2: ae,
2430
2454
  y1: ge,
2431
2455
  y2: ve
2432
2456
  },
2433
- `g-${re}`
2457
+ `g-${ce}`
2434
2458
  ) : /* @__PURE__ */ s(
2435
2459
  "line",
2436
2460
  {
2437
- className: f(x.gridLine, O?.grid),
2461
+ className: f(x.gridLine, F?.grid),
2438
2462
  x1: pe,
2439
2463
  x2: fe,
2440
- y1: se,
2441
- y2: se
2464
+ y1: ae,
2465
+ y2: ae
2442
2466
  },
2443
- `g-${re}`
2467
+ `g-${ce}`
2444
2468
  )
2445
2469
  ) }),
2446
- /* @__PURE__ */ s("g", { className: f(x.axis, O?.axis), children: ce.map(({ value: re, pos: se }) => {
2447
- const Ce = _ ? _(re) : String(re);
2448
- return P ? /* @__PURE__ */ s(
2470
+ /* @__PURE__ */ s("g", { className: f(x.axis, F?.axis), children: ie.map(({ value: ce, pos: ae }) => {
2471
+ const Ce = D ? D(ce) : String(ce);
2472
+ return W ? /* @__PURE__ */ s(
2449
2473
  "text",
2450
2474
  {
2451
- className: f(x.axisLabel, O?.axisLabel),
2452
- x: se,
2475
+ className: f(x.axisLabel, F?.axisLabel),
2476
+ x: ae,
2453
2477
  y: ve + 16,
2454
2478
  textAnchor: "middle",
2455
2479
  children: Ce
2456
2480
  },
2457
- `vt-${re}`
2481
+ `vt-${ce}`
2458
2482
  ) : /* @__PURE__ */ s(
2459
2483
  "text",
2460
2484
  {
2461
- className: f(x.axisLabel, O?.axisLabel),
2485
+ className: f(x.axisLabel, F?.axisLabel),
2462
2486
  x: pe - 8,
2463
- y: se,
2487
+ y: ae,
2464
2488
  textAnchor: "end",
2465
2489
  dominantBaseline: "middle",
2466
2490
  children: Ce
2467
2491
  },
2468
- `vt-${re}`
2492
+ `vt-${ce}`
2469
2493
  );
2470
2494
  }) }),
2471
- /* @__PURE__ */ s("g", { className: f(x.axis, O?.axis), children: me.map((re) => {
2472
- const se = b(re), Ce = C ? C(re) : re;
2473
- return P ? /* @__PURE__ */ s(
2495
+ /* @__PURE__ */ s("g", { className: f(x.axis, F?.axis), children: me.map((ce) => {
2496
+ const ae = b(ce), Ce = C ? C(ce) : ce;
2497
+ return W ? /* @__PURE__ */ s(
2474
2498
  "text",
2475
2499
  {
2476
- className: f(x.axisLabel, O?.axisLabel),
2500
+ className: f(x.axisLabel, F?.axisLabel),
2477
2501
  x: pe - 8,
2478
- y: se,
2502
+ y: ae,
2479
2503
  textAnchor: "end",
2480
2504
  dominantBaseline: "middle",
2481
2505
  children: Ce
2482
2506
  },
2483
- `c-${re}`
2507
+ `c-${ce}`
2484
2508
  ) : /* @__PURE__ */ s(
2485
2509
  "text",
2486
2510
  {
2487
- className: f(x.axisLabel, O?.axisLabel),
2488
- x: se,
2511
+ className: f(x.axisLabel, F?.axisLabel),
2512
+ x: ae,
2489
2513
  y: ve + 16,
2490
2514
  textAnchor: "middle",
2491
2515
  children: Ce
2492
2516
  },
2493
- `c-${re}`
2517
+ `c-${ce}`
2494
2518
  );
2495
2519
  }) }),
2496
- e.map((re, se) => {
2497
- const Ie = b(z[se]) - K / 2;
2498
- let xe = 0, ie = 0;
2499
- return /* @__PURE__ */ s("g", { className: f(x.series, O?.series), children: ne.map((De, He) => {
2500
- const Ge = re[De];
2520
+ e.map((ce, ae) => {
2521
+ const Ie = b(z[ae]) - K / 2;
2522
+ let xe = 0, le = 0;
2523
+ return /* @__PURE__ */ s("g", { className: f(x.series, F?.series), children: oe.map((De, He) => {
2524
+ const Ge = ce[De];
2501
2525
  if (typeof Ge != "number") return null;
2502
- const Ee = Ge, xt = U(De, se), kt = X !== void 0 && Ee < 0 ? X : xt, Oe = E !== void 0 ? E === se : v === se, tt = E !== void 0 && !Oe;
2526
+ const Ee = Ge, xt = _(De, ae), kt = O !== void 0 && Ee < 0 ? O : xt, Oe = P !== void 0 ? P === ae : v === ae, tt = P !== void 0 && !Oe;
2503
2527
  let nt, Ue;
2504
- L ? Ee >= 0 ? (nt = xe, Ue = xe + Ee, xe = Ue) : (nt = ie, Ue = ie + Ee, ie = Ue) : (nt = 0, Ue = Ee);
2505
- const rt = j(nt), ot = j(Ue), At = L ? (K - T) / 2 : He * V + (V - T) / 2;
2528
+ L ? Ee >= 0 ? (nt = xe, Ue = xe + Ee, xe = Ue) : (nt = le, Ue = le + Ee, le = Ue) : (nt = 0, Ue = Ee);
2529
+ const rt = X(nt), ot = X(Ue), At = L ? (K - R) / 2 : He * Y + (Y - R) / 2;
2506
2530
  let ct = 0, it = 0, lt = 0, st = 0;
2507
- if (P) {
2531
+ if (W) {
2508
2532
  const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
2509
- ct = Ze, lt = wt - Ze, it = Ie + At, st = T;
2533
+ ct = Ze, lt = wt - Ze, it = Ie + At, st = R;
2510
2534
  } else {
2511
2535
  const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
2512
- ct = Ie + At, lt = T, it = Ze, st = wt - Ze;
2536
+ ct = Ie + At, lt = R, it = Ze, st = wt - Ze;
2513
2537
  }
2514
- const Mt = $ ? $({ row: re, value: Ee, seriesKey: De, index: se }) : p ? oe ? oe(Ee) : String(Ee) : null, Fe = Ui({
2515
- isHorizontal: P,
2538
+ const Mt = w ? w({ row: ce, value: Ee, seriesKey: De, index: ae }) : p ? ee ? ee(Ee) : String(Ee) : null, Fe = zi({
2539
+ isHorizontal: W,
2516
2540
  valuePosition: y,
2517
2541
  x: ct,
2518
2542
  y: it,
@@ -2527,7 +2551,7 @@ function Wl({
2527
2551
  className: f(
2528
2552
  x.bar,
2529
2553
  Oe && x.activeBar,
2530
- O?.point
2554
+ F?.point
2531
2555
  ),
2532
2556
  x: ct,
2533
2557
  y: it,
@@ -2537,8 +2561,8 @@ function Wl({
2537
2561
  ry: h,
2538
2562
  fill: kt,
2539
2563
  opacity: tt ? 0.35 : 1,
2540
- onClick: W ? () => W({ row: re, value: Ee, seriesKey: De, index: se }) : void 0,
2541
- style: W ? { cursor: "pointer" } : void 0
2564
+ onClick: U ? () => U({ row: ce, value: Ee, seriesKey: De, index: ae }) : void 0,
2565
+ style: U ? { cursor: "pointer" } : void 0
2542
2566
  }
2543
2567
  ),
2544
2568
  Mt != null && /* @__PURE__ */ s(
@@ -2558,16 +2582,16 @@ function Wl({
2558
2582
  }
2559
2583
  )
2560
2584
  ] }, De);
2561
- }) }, `group-${se}`);
2585
+ }) }, `group-${ae}`);
2562
2586
  }),
2563
2587
  G < 0 && Z > 0 && /* @__PURE__ */ s(
2564
2588
  "line",
2565
2589
  {
2566
2590
  className: f(x.gridLine),
2567
- x1: P ? A : pe,
2568
- x2: P ? A : fe,
2569
- y1: P ? ge : A,
2570
- y2: P ? ve : A,
2591
+ x1: W ? A : pe,
2592
+ x2: W ? A : fe,
2593
+ y1: W ? ge : A,
2594
+ y2: W ? ve : A,
2571
2595
  opacity: 0.9
2572
2596
  }
2573
2597
  ),
@@ -2579,14 +2603,14 @@ function Wl({
2579
2603
  y: ge,
2580
2604
  width: Re,
2581
2605
  height: Ne,
2582
- onMouseMove: (re) => {
2583
- const se = re.currentTarget.getBoundingClientRect(), Ce = re.clientX - se.left + pe, Ie = re.clientY - se.top + ge, xe = b.step(), ie = P ? Ie - ge : Ce - pe, De = Math.max(
2606
+ onMouseMove: (ce) => {
2607
+ const ae = ce.currentTarget.getBoundingClientRect(), Ce = ce.clientX - ae.left + pe, Ie = ce.clientY - ae.top + ge, xe = b.step(), le = W ? Ie - ge : Ce - pe, De = Math.max(
2584
2608
  0,
2585
- Math.min(e.length - 1, Math.round((ie - xe / 2) / xe))
2609
+ Math.min(e.length - 1, Math.round((le - xe / 2) / xe))
2586
2610
  );
2587
- M(De);
2611
+ k(De);
2588
2612
  },
2589
- onMouseLeave: () => M(null)
2613
+ onMouseLeave: () => k(null)
2590
2614
  }
2591
2615
  )
2592
2616
  ] });
@@ -2594,7 +2618,7 @@ function Wl({
2594
2618
  }
2595
2619
  );
2596
2620
  }
2597
- function Ui({
2621
+ function zi({
2598
2622
  isHorizontal: e,
2599
2623
  valuePosition: t,
2600
2624
  x: n,
@@ -2646,19 +2670,19 @@ function Ui({
2646
2670
  dominantBaseline: a ? "auto" : "middle"
2647
2671
  };
2648
2672
  }
2649
- function _i(e, t, n, r, o, i, c) {
2673
+ function Vi(e, t, n, r, o, i, c) {
2650
2674
  const l = o.current;
2651
2675
  if (!l) return 0;
2652
- const a = l.getBoundingClientRect(), h = e.map((d) => String(d[t]));
2676
+ const a = l.getBoundingClientRect(), h = e.map((u) => String(u[t]));
2653
2677
  return i ? a.width / 2 : Xe(h, [n.left, a.width - n.right], c)(h[r]);
2654
2678
  }
2655
- function zi(e, t, n, r, o, i) {
2679
+ function Yi(e, t, n, r, o, i) {
2656
2680
  const c = o.current;
2657
2681
  if (!c) return 16;
2658
- const l = c.getBoundingClientRect(), a = e.map((u) => String(u[t]));
2682
+ const l = c.getBoundingClientRect(), a = e.map((d) => String(d[t]));
2659
2683
  return Xe(a, [n.top, l.height - n.bottom], i)(a[r]);
2660
2684
  }
2661
- const Yi = [
2685
+ const qi = [
2662
2686
  "var(--crk-chart-1)",
2663
2687
  "var(--crk-chart-2)",
2664
2688
  "var(--crk-chart-3)",
@@ -2670,7 +2694,7 @@ function It(e, t) {
2670
2694
  const n = /^([\d.]+)%$/.exec(e);
2671
2695
  return n ? parseFloat(n[1]) / 100 * t : parseFloat(e) || 0;
2672
2696
  }
2673
- function Vi(e, t, n, r, o, i) {
2697
+ function Gi(e, t, n, r, o, i) {
2674
2698
  if (Math.abs(i - o) >= 360 - 1e-6)
2675
2699
  return r > 0 ? [
2676
2700
  `M ${e + n} ${t}`,
@@ -2686,21 +2710,21 @@ function Vi(e, t, n, r, o, i) {
2686
2710
  `A ${n} ${n} 0 1 1 ${e + n} ${t}`,
2687
2711
  "Z"
2688
2712
  ].join(" ");
2689
- const c = (o - 90) * Math.PI / 180, l = (i - 90) * Math.PI / 180, a = i - o > 180 ? 1 : 0, h = e + n * Math.cos(c), u = t + n * Math.sin(c), d = e + n * Math.cos(l), m = t + n * Math.sin(l);
2713
+ const c = (o - 90) * Math.PI / 180, l = (i - 90) * Math.PI / 180, a = i - o > 180 ? 1 : 0, h = e + n * Math.cos(c), d = t + n * Math.sin(c), u = e + n * Math.cos(l), m = t + n * Math.sin(l);
2690
2714
  if (r > 0) {
2691
- const p = e + r * Math.cos(l), y = t + r * Math.sin(l), $ = e + r * Math.cos(c), k = t + r * Math.sin(c);
2715
+ const p = e + r * Math.cos(l), y = t + r * Math.sin(l), w = e + r * Math.cos(c), N = t + r * Math.sin(c);
2692
2716
  return [
2693
- `M ${h} ${u}`,
2694
- `A ${n} ${n} 0 ${a} 1 ${d} ${m}`,
2717
+ `M ${h} ${d}`,
2718
+ `A ${n} ${n} 0 ${a} 1 ${u} ${m}`,
2695
2719
  `L ${p} ${y}`,
2696
- `A ${r} ${r} 0 ${a} 0 ${$} ${k}`,
2720
+ `A ${r} ${r} 0 ${a} 0 ${w} ${N}`,
2697
2721
  "Z"
2698
2722
  ].join(" ");
2699
2723
  }
2700
2724
  return [
2701
2725
  `M ${e} ${t}`,
2702
- `L ${h} ${u}`,
2703
- `A ${n} ${n} 0 ${a} 1 ${d} ${m}`,
2726
+ `L ${h} ${d}`,
2727
+ `A ${n} ${n} 0 ${a} 1 ${u} ${m}`,
2704
2728
  "Z"
2705
2729
  ].join(" ");
2706
2730
  }
@@ -2708,132 +2732,132 @@ function Et(e, t, n, r, o) {
2708
2732
  const c = ((r + o) / 2 - 90) * Math.PI / 180;
2709
2733
  return { x: e + n * Math.cos(c), y: t + n * Math.sin(c) };
2710
2734
  }
2711
- function Hl({
2735
+ function jl({
2712
2736
  data: e,
2713
2737
  valueKey: t,
2714
2738
  nameKey: n,
2715
2739
  colorKey: r,
2716
- colors: o = Yi,
2740
+ colors: o = qi,
2717
2741
  aspectRatio: i = 1,
2718
2742
  height: c,
2719
2743
  innerRadius: l = 0,
2720
2744
  outerRadius: a = "90%",
2721
2745
  strokeWidth: h = 2,
2722
- strokeColor: u = "var(--crk-color-bg)",
2723
- padAngle: d = 0,
2746
+ strokeColor: d = "var(--crk-color-bg)",
2747
+ padAngle: u = 0,
2724
2748
  showLabels: m = !1,
2725
2749
  valuePosition: p = "outside",
2726
2750
  showLabelLines: y = !0,
2727
- renderLabel: $,
2728
- centerLabel: k,
2729
- activeIndex: R,
2730
- onSliceClick: X,
2731
- showLegend: E = !0,
2732
- showTooltip: W = !0,
2733
- valueFormat: ae,
2734
- renderTooltip: _,
2751
+ renderLabel: w,
2752
+ centerLabel: N,
2753
+ activeIndex: S,
2754
+ onSliceClick: O,
2755
+ showLegend: P = !0,
2756
+ showTooltip: U = !0,
2757
+ valueFormat: re,
2758
+ renderTooltip: D,
2735
2759
  emptyMessage: C = "No data",
2736
- className: oe,
2737
- style: le,
2738
- classes: w
2760
+ className: ee,
2761
+ style: se,
2762
+ classes: M
2739
2763
  }) {
2740
- const [q, D] = Se(null), Q = te(null), O = R ?? q, P = (M) => {
2764
+ const [q, I] = Se(null), Q = ne(null), F = S ?? q, W = (k) => {
2741
2765
  if (r) {
2742
- const N = e[M]?.[r];
2743
- if (typeof N == "string") return N;
2766
+ const $ = e[k]?.[r];
2767
+ if (typeof $ == "string") return $;
2744
2768
  }
2745
- return o[M % o.length];
2746
- }, ee = ke(() => {
2747
- let M = 0;
2748
- for (const N of e) {
2749
- const z = N[t];
2750
- typeof z == "number" && z > 0 && (M += z);
2769
+ return o[k % o.length];
2770
+ }, te = ke(() => {
2771
+ let k = 0;
2772
+ for (const $ of e) {
2773
+ const z = $[t];
2774
+ typeof z == "number" && z > 0 && (k += z);
2751
2775
  }
2752
- return M;
2776
+ return k;
2753
2777
  }, [e, t]);
2754
- if (e.length === 0 || ee === 0)
2755
- return /* @__PURE__ */ s("div", { ref: Q, className: f(x.root, w?.root, oe), style: le, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: c ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: C }) }) });
2756
- const ne = ke(() => {
2757
- const M = [];
2758
- let N = 0;
2778
+ if (e.length === 0 || te === 0)
2779
+ return /* @__PURE__ */ s("div", { ref: Q, className: f(x.root, M?.root, ee), style: se, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: c ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: C }) }) });
2780
+ const oe = ke(() => {
2781
+ const k = [];
2782
+ let $ = 0;
2759
2783
  for (let z = 0; z < e.length; z++) {
2760
- const S = e[z], F = S[t], Y = typeof F == "number" && F > 0 ? F : 0;
2761
- if (Y === 0) continue;
2762
- const G = Y / ee, Z = G * 360;
2763
- M.push({ index: z, row: S, value: Y, start: N, end: N + Z, fraction: G }), N += Z;
2784
+ const T = e[z], j = T[t], V = typeof j == "number" && j > 0 ? j : 0;
2785
+ if (V === 0) continue;
2786
+ const G = V / te, Z = G * 360;
2787
+ k.push({ index: z, row: T, value: V, start: $, end: $ + Z, fraction: G }), $ += Z;
2764
2788
  }
2765
- return M;
2766
- }, [e, t, ee]), L = E ? /* @__PURE__ */ s("div", { className: f(x.legend, w?.legend), role: "list", children: ne.map((M) => /* @__PURE__ */ H("div", { className: f(x.legendItem, w?.legendItem), role: "listitem", children: [
2789
+ return k;
2790
+ }, [e, t, te]), L = P ? /* @__PURE__ */ s("div", { className: f(x.legend, M?.legend), role: "list", children: oe.map((k) => /* @__PURE__ */ H("div", { className: f(x.legendItem, M?.legendItem), role: "listitem", children: [
2767
2791
  /* @__PURE__ */ s(
2768
2792
  "span",
2769
2793
  {
2770
2794
  className: x.legendSwatch,
2771
- style: { background: P(M.index) },
2795
+ style: { background: W(k.index) },
2772
2796
  "aria-hidden": "true"
2773
2797
  }
2774
2798
  ),
2775
- /* @__PURE__ */ s("span", { className: x.legendLabel, children: String(M.row[n]) })
2776
- ] }, M.index)) }) : void 0, v = ke(() => {
2777
- const M = {};
2778
- for (const N of ne)
2779
- M[N.index.toString()] = {
2780
- label: String(N.row[n]),
2781
- color: P(N.index)
2799
+ /* @__PURE__ */ s("span", { className: x.legendLabel, children: String(k.row[n]) })
2800
+ ] }, k.index)) }) : void 0, v = ke(() => {
2801
+ const k = {};
2802
+ for (const $ of oe)
2803
+ k[$.index.toString()] = {
2804
+ label: String($.row[n]),
2805
+ color: W($.index)
2782
2806
  };
2783
- return M;
2784
- }, [ne]);
2807
+ return k;
2808
+ }, [oe]);
2785
2809
  return /* @__PURE__ */ s(
2786
- Ve,
2810
+ Ye,
2787
2811
  {
2788
2812
  ref: Q,
2789
2813
  aspectRatio: i,
2790
2814
  height: c,
2791
- className: oe,
2792
- style: le,
2793
- classes: w,
2815
+ className: ee,
2816
+ style: se,
2817
+ classes: M,
2794
2818
  legend: L,
2795
- overlay: W && O !== null && e[O] ? /* @__PURE__ */ s(
2819
+ overlay: U && F !== null && e[F] ? /* @__PURE__ */ s(
2796
2820
  et,
2797
2821
  {
2798
- row: { [O.toString()]: e[O][t] },
2822
+ row: { [F.toString()]: e[F][t] },
2799
2823
  x: Q.current ? Q.current.getBoundingClientRect().width / 2 : 0,
2800
2824
  y: 16,
2801
2825
  containerWidth: Q.current?.getBoundingClientRect().width ?? 0,
2802
- config: { [O.toString()]: v[O.toString()] },
2803
- render: _ ? () => _(e[O]) : void 0,
2804
- valueFormat: ae,
2826
+ config: { [F.toString()]: v[F.toString()] },
2827
+ render: D ? () => D(e[F]) : void 0,
2828
+ valueFormat: re,
2805
2829
  titleKey: void 0,
2806
- classes: w
2830
+ classes: M
2807
2831
  }
2808
2832
  ) : null,
2809
- children: ({ width: M, height: N }) => {
2810
- const z = M / 2, S = N / 2, F = Math.min(M, N) / 2 - 4, Y = It(a, F), G = Math.min(Y - 1, It(l, F)), Z = Math.max(4, Y * 0.06);
2811
- return /* @__PURE__ */ H(Ye, { children: [
2812
- /* @__PURE__ */ s("g", { children: ne.map((U) => {
2813
- const J = d / 2, ue = Math.min(U.end, U.start + J), be = Math.max(U.start, U.end - J), pe = P(U.index), fe = O === U.index, ge = R !== void 0 && !fe, ve = fe && R !== void 0 ? Y + Z : Y, Re = Vi(z, S, ve, G, ue, be), Ne = X ? () => X({ row: U.row, value: U.value, index: U.index }) : void 0;
2833
+ children: ({ width: k, height: $ }) => {
2834
+ const z = k / 2, T = $ / 2, j = Math.min(k, $) / 2 - 4, V = It(a, j), G = Math.min(V - 1, It(l, j)), Z = Math.max(4, V * 0.06);
2835
+ return /* @__PURE__ */ H(Ve, { children: [
2836
+ /* @__PURE__ */ s("g", { children: oe.map((_) => {
2837
+ const J = u / 2, ue = Math.min(_.end, _.start + J), be = Math.max(_.start, _.end - J), pe = W(_.index), fe = F === _.index, ge = S !== void 0 && !fe, ve = fe && S !== void 0 ? V + Z : V, Re = Gi(z, T, ve, G, ue, be), Ne = O ? () => O({ row: _.row, value: _.value, index: _.index }) : void 0;
2814
2838
  return /* @__PURE__ */ s(
2815
2839
  "path",
2816
2840
  {
2817
2841
  d: Re,
2818
2842
  fill: pe,
2819
- stroke: h > 0 ? u : "none",
2843
+ stroke: h > 0 ? d : "none",
2820
2844
  strokeWidth: h,
2821
2845
  opacity: ge ? 0.45 : 1,
2822
- onMouseEnter: () => D(U.index),
2823
- onMouseLeave: () => D(null),
2846
+ onMouseEnter: () => I(_.index),
2847
+ onMouseLeave: () => I(null),
2824
2848
  onClick: Ne,
2825
2849
  style: Ne ? { cursor: "pointer" } : void 0
2826
2850
  },
2827
- U.index
2851
+ _.index
2828
2852
  );
2829
2853
  }) }),
2830
- (m || $) && ne.map((U) => {
2831
- const J = $ ? $({ row: U.row, value: U.value, fraction: U.fraction, index: U.index }) : m ? `${String(U.row[n])} ${ae ? ae(U.value) : Math.round(U.fraction * 100) + "%"}` : null;
2854
+ (m || w) && oe.map((_) => {
2855
+ const J = w ? w({ row: _.row, value: _.value, fraction: _.fraction, index: _.index }) : m ? `${String(_.row[n])} ${re ? re(_.value) : Math.round(_.fraction * 100) + "%"}` : null;
2832
2856
  if (J == null) return null;
2833
- const ue = p === "inside", be = Math.max(16, Y * 0.12), pe = ue ? (Y + G) / 2 : Y + be, fe = Et(z, S, pe, U.start, U.end), ge = ue ? "middle" : fe.x < z - 1 ? "end" : fe.x > z + 1 ? "start" : "middle";
2857
+ const ue = p === "inside", be = Math.max(16, V * 0.12), pe = ue ? (V + G) / 2 : V + be, fe = Et(z, T, pe, _.start, _.end), ge = ue ? "middle" : fe.x < z - 1 ? "end" : fe.x > z + 1 ? "start" : "middle";
2834
2858
  let ve = null;
2835
2859
  if (!ue && y) {
2836
- const Re = Et(z, S, Y, U.start, U.end), Ne = 4, g = ge === "end" ? Ne : ge === "start" ? -Ne : 0;
2860
+ const Re = Et(z, T, V, _.start, _.end), Ne = 4, g = ge === "end" ? Ne : ge === "start" ? -Ne : 0;
2837
2861
  ve = { x1: Re.x, y1: Re.y, x2: fe.x + g, y2: fe.y };
2838
2862
  }
2839
2863
  return /* @__PURE__ */ H("g", { children: [
@@ -2844,7 +2868,7 @@ function Hl({
2844
2868
  y1: ve.y1,
2845
2869
  x2: ve.x2,
2846
2870
  y2: ve.y2,
2847
- stroke: P(U.index),
2871
+ stroke: W(_.index),
2848
2872
  strokeWidth: 1,
2849
2873
  opacity: 0.7
2850
2874
  }
@@ -2863,13 +2887,13 @@ function Hl({
2863
2887
  children: J
2864
2888
  }
2865
2889
  )
2866
- ] }, `label-${U.index}`);
2890
+ ] }, `label-${_.index}`);
2867
2891
  }),
2868
- k !== void 0 && /* @__PURE__ */ s(
2892
+ N !== void 0 && /* @__PURE__ */ s(
2869
2893
  "foreignObject",
2870
2894
  {
2871
2895
  x: z - G,
2872
- y: S - G,
2896
+ y: T - G,
2873
2897
  width: Math.max(0, G * 2),
2874
2898
  height: Math.max(0, G * 2),
2875
2899
  style: { pointerEvents: "none" },
@@ -2887,7 +2911,7 @@ function Hl({
2887
2911
  color: "var(--crk-color-text)",
2888
2912
  fontFamily: "var(--crk-font-family)"
2889
2913
  },
2890
- children: k
2914
+ children: N
2891
2915
  }
2892
2916
  )
2893
2917
  }
@@ -2901,13 +2925,13 @@ function mt(e, t, n, r) {
2901
2925
  const o = (r - 90) * Math.PI / 180;
2902
2926
  return { x: e + n * Math.cos(o), y: t + n * Math.sin(o) };
2903
2927
  }
2904
- function qi(e, t, n, r) {
2928
+ function Zi(e, t, n, r) {
2905
2929
  return r.map((o) => {
2906
2930
  const i = mt(e, t, n, o);
2907
2931
  return `${i.x},${i.y}`;
2908
2932
  }).join(" ");
2909
2933
  }
2910
- function Ol({
2934
+ function Xl({
2911
2935
  data: e,
2912
2936
  axisKey: t,
2913
2937
  config: n,
@@ -2918,127 +2942,127 @@ function Ol({
2918
2942
  showRadialLines: l = !0,
2919
2943
  showAxisLabels: a = !0,
2920
2944
  showRadiusAxis: h = !1,
2921
- levels: u = 5,
2922
- showPoints: d = !0,
2945
+ levels: d = 5,
2946
+ showPoints: u = !0,
2923
2947
  fillOpacity: m = 0.4,
2924
2948
  strokeWidth: p = 2,
2925
2949
  renderAxisLabel: y,
2926
- axisFormat: $,
2927
- valueFormat: k,
2928
- renderTooltip: R,
2929
- showLegend: X = !0,
2930
- showTooltip: E = !0,
2931
- emptyMessage: W = "No data",
2932
- className: ae,
2933
- style: _,
2950
+ axisFormat: w,
2951
+ valueFormat: N,
2952
+ renderTooltip: S,
2953
+ showLegend: O = !0,
2954
+ showTooltip: P = !0,
2955
+ emptyMessage: U = "No data",
2956
+ className: re,
2957
+ style: D,
2934
2958
  classes: C
2935
2959
  }) {
2936
- const [oe, le] = Se(null), w = te(null), q = ke(() => Object.keys(n), [n]);
2960
+ const [ee, se] = Se(null), M = ne(null), q = ke(() => Object.keys(n), [n]);
2937
2961
  if (e.length === 0)
2938
- return /* @__PURE__ */ s("div", { ref: w, className: f(x.root, C?.root, ae), style: _, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: W }) }) });
2939
- const D = ke(
2940
- () => e.map((ee, ne) => ne / e.length * 360),
2962
+ return /* @__PURE__ */ s("div", { ref: M, className: f(x.root, C?.root, re), style: D, children: /* @__PURE__ */ s("div", { className: x.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: x.empty, children: U }) }) });
2963
+ const I = ke(
2964
+ () => e.map((te, oe) => oe / e.length * 360),
2941
2965
  [e]
2942
2966
  ), Q = ke(() => {
2943
- const ee = [];
2967
+ const te = [];
2944
2968
  for (const L of q)
2945
2969
  for (const v of e) {
2946
- const M = v[L];
2947
- typeof M == "number" && ee.push(M);
2970
+ const k = v[L];
2971
+ typeof k == "number" && te.push(k);
2948
2972
  }
2949
- const [, ne] = bt(ee);
2950
- return Math.max(1, ne);
2951
- }, [e, q]), O = ke(() => qe(0, Q, u).filter((ne) => ne > 0), [Q, u]), P = O[O.length - 1] ?? Q;
2973
+ const [, oe] = bt(te);
2974
+ return Math.max(1, oe);
2975
+ }, [e, q]), F = ke(() => qe(0, Q, d).filter((oe) => oe > 0), [Q, d]), W = F[F.length - 1] ?? Q;
2952
2976
  return /* @__PURE__ */ s(
2953
- Ve,
2977
+ Ye,
2954
2978
  {
2955
- ref: w,
2979
+ ref: M,
2956
2980
  aspectRatio: r,
2957
2981
  height: o,
2958
- className: ae,
2959
- style: _,
2982
+ className: re,
2983
+ style: D,
2960
2984
  classes: C,
2961
- legend: X ? /* @__PURE__ */ s(vt, { config: n, classes: C }) : void 0,
2962
- overlay: E && oe !== null ? /* @__PURE__ */ s(
2985
+ legend: O ? /* @__PURE__ */ s(vt, { config: n, classes: C }) : void 0,
2986
+ overlay: P && ee !== null ? /* @__PURE__ */ s(
2963
2987
  et,
2964
2988
  {
2965
- row: e[oe],
2966
- x: (w.current?.getBoundingClientRect().width ?? 0) / 2,
2989
+ row: e[ee],
2990
+ x: (M.current?.getBoundingClientRect().width ?? 0) / 2,
2967
2991
  y: 16,
2968
- containerWidth: w.current?.getBoundingClientRect().width ?? 0,
2992
+ containerWidth: M.current?.getBoundingClientRect().width ?? 0,
2969
2993
  config: n,
2970
- render: R ? () => R(e[oe]) : void 0,
2971
- valueFormat: k,
2994
+ render: S ? () => S(e[ee]) : void 0,
2995
+ valueFormat: N,
2972
2996
  titleKey: t,
2973
2997
  classes: C
2974
2998
  }
2975
2999
  ) : null,
2976
- children: ({ width: ee, height: ne }) => {
2977
- const L = a ? 32 : 8, v = ee / 2, M = ne / 2, N = Math.max(0, Math.min(ee, ne) / 2 - L), z = (S) => Math.max(0, S) / P * N;
2978
- return /* @__PURE__ */ H(Ye, { children: [
2979
- c && O.map((S) => {
2980
- const F = z(S);
3000
+ children: ({ width: te, height: oe }) => {
3001
+ const L = a ? 32 : 8, v = te / 2, k = oe / 2, $ = Math.max(0, Math.min(te, oe) / 2 - L), z = (T) => Math.max(0, T) / W * $;
3002
+ return /* @__PURE__ */ H(Ve, { children: [
3003
+ c && F.map((T) => {
3004
+ const j = z(T);
2981
3005
  return i === "circle" ? /* @__PURE__ */ s(
2982
3006
  "circle",
2983
3007
  {
2984
3008
  className: f(x.gridLine, C?.grid),
2985
3009
  cx: v,
2986
- cy: M,
2987
- r: F,
3010
+ cy: k,
3011
+ r: j,
2988
3012
  fill: "none"
2989
3013
  },
2990
- `ring-${S}`
3014
+ `ring-${T}`
2991
3015
  ) : /* @__PURE__ */ s(
2992
3016
  "polygon",
2993
3017
  {
2994
3018
  className: f(x.gridLine, C?.grid),
2995
- points: qi(v, M, F, D),
3019
+ points: Zi(v, k, j, I),
2996
3020
  fill: "none"
2997
3021
  },
2998
- `ring-${S}`
3022
+ `ring-${T}`
2999
3023
  );
3000
3024
  }),
3001
- l && D.map((S, F) => {
3002
- const Y = mt(v, M, N, S);
3025
+ l && I.map((T, j) => {
3026
+ const V = mt(v, k, $, T);
3003
3027
  return /* @__PURE__ */ s(
3004
3028
  "line",
3005
3029
  {
3006
3030
  className: f(x.gridLine, C?.grid),
3007
3031
  x1: v,
3008
- y1: M,
3009
- x2: Y.x,
3010
- y2: Y.y
3032
+ y1: k,
3033
+ x2: V.x,
3034
+ y2: V.y
3011
3035
  },
3012
- `spoke-${F}`
3036
+ `spoke-${j}`
3013
3037
  );
3014
3038
  }),
3015
- h && O.map((S) => {
3016
- const F = z(S);
3039
+ h && F.map((T) => {
3040
+ const j = z(T);
3017
3041
  return /* @__PURE__ */ s(
3018
3042
  "text",
3019
3043
  {
3020
3044
  className: f(x.axisLabel, C?.axisLabel),
3021
3045
  x: v + 4,
3022
- y: M - F,
3046
+ y: k - j,
3023
3047
  textAnchor: "start",
3024
3048
  dominantBaseline: "middle",
3025
- children: k ? k(S) : S
3049
+ children: N ? N(T) : T
3026
3050
  },
3027
- `raxis-${S}`
3051
+ `raxis-${T}`
3028
3052
  );
3029
3053
  }),
3030
- a && e.map((S, F) => {
3031
- const Y = D[F], G = mt(v, M, N + 14, Y), Z = G.x < v - 1 ? "end" : G.x > v + 1 ? "start" : "middle";
3054
+ a && e.map((T, j) => {
3055
+ const V = I[j], G = mt(v, k, $ + 14, V), Z = G.x < v - 1 ? "end" : G.x > v + 1 ? "start" : "middle";
3032
3056
  if (y)
3033
3057
  return /* @__PURE__ */ s("g", { children: y({
3034
- row: S,
3035
- index: F,
3036
- angle: Y,
3058
+ row: T,
3059
+ index: j,
3060
+ angle: V,
3037
3061
  x: G.x,
3038
3062
  y: G.y,
3039
3063
  textAnchor: Z
3040
- }) }, `label-${F}`);
3041
- const U = String(S[t]), J = $ ? $(U) : U;
3064
+ }) }, `label-${j}`);
3065
+ const _ = String(T[t]), J = w ? w(_) : _;
3042
3066
  return /* @__PURE__ */ s(
3043
3067
  "text",
3044
3068
  {
@@ -3049,39 +3073,39 @@ function Ol({
3049
3073
  dominantBaseline: "middle",
3050
3074
  children: J
3051
3075
  },
3052
- `label-${F}`
3076
+ `label-${j}`
3053
3077
  );
3054
3078
  }),
3055
- q.map((S) => {
3056
- const F = n[S], Y = e.map((Z, U) => {
3057
- const J = Z[S], be = z(typeof J == "number" ? J : 0);
3058
- return mt(v, M, be, D[U]);
3059
- }), G = Y.map((Z) => `${Z.x},${Z.y}`).join(" ");
3079
+ q.map((T) => {
3080
+ const j = n[T], V = e.map((Z, _) => {
3081
+ const J = Z[T], be = z(typeof J == "number" ? J : 0);
3082
+ return mt(v, k, be, I[_]);
3083
+ }), G = V.map((Z) => `${Z.x},${Z.y}`).join(" ");
3060
3084
  return /* @__PURE__ */ H("g", { className: f(x.series, C?.series), children: [
3061
3085
  /* @__PURE__ */ s(
3062
3086
  "polygon",
3063
3087
  {
3064
3088
  points: G,
3065
- fill: F.color,
3089
+ fill: j.color,
3066
3090
  fillOpacity: m,
3067
- stroke: F.color,
3091
+ stroke: j.color,
3068
3092
  strokeWidth: p,
3069
3093
  strokeLinejoin: "round",
3070
3094
  strokeLinecap: "round"
3071
3095
  }
3072
3096
  ),
3073
- d && Y.map((Z, U) => /* @__PURE__ */ s(
3097
+ u && V.map((Z, _) => /* @__PURE__ */ s(
3074
3098
  "circle",
3075
3099
  {
3076
3100
  className: f(x.point, C?.point),
3077
3101
  cx: Z.x,
3078
3102
  cy: Z.y,
3079
- r: oe === U ? 5 : 3.5,
3080
- fill: F.color
3103
+ r: ee === _ ? 5 : 3.5,
3104
+ fill: j.color
3081
3105
  },
3082
- `${S}-${U}`
3106
+ `${T}-${_}`
3083
3107
  ))
3084
- ] }, S);
3108
+ ] }, T);
3085
3109
  }),
3086
3110
  /* @__PURE__ */ s(
3087
3111
  "rect",
@@ -3089,17 +3113,17 @@ function Ol({
3089
3113
  className: x.interactionLayer,
3090
3114
  x: 0,
3091
3115
  y: 0,
3092
- width: ee,
3093
- height: ne,
3094
- onMouseMove: (S) => {
3095
- const F = S.currentTarget.getBoundingClientRect(), Y = S.clientX - F.left - v, G = S.clientY - F.top - M;
3096
- if (Y === 0 && G === 0) return;
3097
- let Z = Math.atan2(G, Y) * 180 / Math.PI + 90;
3116
+ width: te,
3117
+ height: oe,
3118
+ onMouseMove: (T) => {
3119
+ const j = T.currentTarget.getBoundingClientRect(), V = T.clientX - j.left - v, G = T.clientY - j.top - k;
3120
+ if (V === 0 && G === 0) return;
3121
+ let Z = Math.atan2(G, V) * 180 / Math.PI + 90;
3098
3122
  Z < 0 && (Z += 360), Z >= 360 && (Z -= 360);
3099
- const U = 360 / e.length, J = Math.round(Z / U) % e.length;
3100
- le(J);
3123
+ const _ = 360 / e.length, J = Math.round(Z / _) % e.length;
3124
+ se(J);
3101
3125
  },
3102
- onMouseLeave: () => le(null)
3126
+ onMouseLeave: () => se(null)
3103
3127
  }
3104
3128
  )
3105
3129
  ] });
@@ -3107,7 +3131,7 @@ function Ol({
3107
3131
  }
3108
3132
  );
3109
3133
  }
3110
- function Gi(e, t) {
3134
+ function Ki(e, t) {
3111
3135
  const n = new Array(e.length).fill(null);
3112
3136
  if (t <= 0 || e.length < t) return n;
3113
3137
  let r = 0;
@@ -3117,7 +3141,7 @@ function Gi(e, t) {
3117
3141
  r += e[o].close - e[o - t].close, n[o] = r / t;
3118
3142
  return n;
3119
3143
  }
3120
- function Zi(e, t) {
3144
+ function Qi(e, t) {
3121
3145
  const n = new Array(e.length).fill(null);
3122
3146
  if (t <= 0 || e.length < t) return n;
3123
3147
  const r = 2 / (t + 1);
@@ -3129,25 +3153,25 @@ function Zi(e, t) {
3129
3153
  i = e[c].close * r + i * (1 - r), n[c] = i;
3130
3154
  return n;
3131
3155
  }
3132
- function Ki(e, t, n = 2) {
3156
+ function Ji(e, t, n = 2) {
3133
3157
  const r = e.length, o = new Array(r).fill(null), i = new Array(r).fill(null), c = new Array(r).fill(null);
3134
3158
  if (t <= 0 || r < t) return { middle: o, upper: i, lower: c };
3135
3159
  for (let l = t - 1; l < r; l++) {
3136
3160
  let a = 0;
3137
3161
  for (let m = l - t + 1; m <= l; m++) a += e[m].close;
3138
3162
  const h = a / t;
3139
- let u = 0;
3163
+ let d = 0;
3140
3164
  for (let m = l - t + 1; m <= l; m++) {
3141
3165
  const p = e[m].close - h;
3142
- u += p * p;
3166
+ d += p * p;
3143
3167
  }
3144
- u /= t;
3145
- const d = Math.sqrt(u);
3146
- o[l] = h, i[l] = h + n * d, c[l] = h - n * d;
3168
+ d /= t;
3169
+ const u = Math.sqrt(d);
3170
+ o[l] = h, i[l] = h + n * u, c[l] = h - n * u;
3147
3171
  }
3148
3172
  return { middle: o, upper: i, lower: c };
3149
3173
  }
3150
- function Qi(e, t = 14) {
3174
+ function el(e, t = 14) {
3151
3175
  const n = new Array(e.length).fill(null);
3152
3176
  if (e.length <= t) return n;
3153
3177
  let r = 0, o = 0;
@@ -3165,11 +3189,11 @@ function Qi(e, t = 14) {
3165
3189
  function Pt(e, t) {
3166
3190
  return t === 0 ? 100 : 100 - 100 / (1 + e / t);
3167
3191
  }
3168
- function Fl(e) {
3192
+ function Ul(e) {
3169
3193
  return e.map((t) => typeof t.volume == "number" ? t.volume : null);
3170
3194
  }
3171
3195
  const Le = 86400;
3172
- function tn(e) {
3196
+ function nn(e) {
3173
3197
  switch (e) {
3174
3198
  case "1D":
3175
3199
  return Le;
@@ -3197,7 +3221,7 @@ function tn(e) {
3197
3221
  }
3198
3222
  return 30 * Le;
3199
3223
  }
3200
- function jl(e) {
3224
+ function _l(e) {
3201
3225
  switch (e) {
3202
3226
  case "1D":
3203
3227
  return "5";
@@ -3214,147 +3238,147 @@ function jl(e) {
3214
3238
  case "5Y":
3215
3239
  return "W";
3216
3240
  }
3217
- const t = tn(e);
3241
+ const t = nn(e);
3218
3242
  return t >= 3 * 365 * Le ? "W" : t >= 180 * Le ? "D" : t >= 60 * Le ? "240" : t >= 14 * Le ? "60" : t >= 3 * Le ? "15" : "5";
3219
3243
  }
3220
- function Xl(e) {
3244
+ function zl(e) {
3221
3245
  if (e === "W" || e === "M") return "5Y";
3222
3246
  if (e === "D") return "1Y";
3223
3247
  const t = Number(e);
3224
3248
  return !Number.isFinite(t) || t >= 240 ? "3M" : t >= 60 ? "1M" : t >= 15 || t >= 5 ? "5D" : "1D";
3225
3249
  }
3226
- const Ji = 420, Rt = 64, Ct = 28, el = 28, Wt = { rsi: 0.18, volume: 0.14 }, tl = 1, nl = 40, Ht = 0.1, rl = 500, ol = [];
3227
- function Ul({
3250
+ const tl = 420, Rt = 64, Ct = 28, nl = 40, rl = 4, Wt = { rsi: 0.18, volume: 0.14 }, ol = 1, cl = 40, Ht = 0.1, il = 500, ll = [];
3251
+ function Vl({
3228
3252
  datafeed: e,
3229
3253
  symbol: t,
3230
3254
  resolution: n,
3231
3255
  period: r,
3232
3256
  seriesType: o = "candle",
3233
- indicators: i = ol,
3257
+ indicators: i = ll,
3234
3258
  precision: c = 2,
3235
- initialLookback: l = rl,
3236
- height: a = Ji,
3259
+ initialLookback: l = il,
3260
+ height: a = tl,
3237
3261
  upColor: h = "var(--crk-color-success)",
3238
- downColor: u = "var(--crk-color-danger)",
3239
- lineColor: d = "var(--crk-chart-1)",
3262
+ downColor: d = "var(--crk-color-danger)",
3263
+ lineColor: u = "var(--crk-chart-1)",
3240
3264
  timezone: m,
3241
3265
  defaultTimezone: p = "local",
3242
3266
  onTimezoneChange: y,
3243
- showConfigPanel: $ = !0,
3244
- onCrosshair: k,
3245
- onVisibleRangeChange: R,
3246
- className: X,
3247
- style: E
3267
+ showConfigPanel: w = !0,
3268
+ onCrosshair: N,
3269
+ onVisibleRangeChange: S,
3270
+ className: O,
3271
+ style: P
3248
3272
  }) {
3249
- const W = te(null), ae = te(null), _ = te([]), C = te({ from: 0, to: 0 }), oe = te(null), le = te(null), w = te(!1), q = te(null), D = te(null), Q = te(1), O = te({ width: 0, height: 0 }), P = te(() => {
3250
- }), ee = te(k), ne = te(R);
3251
- ee.current = k, ne.current = R;
3252
- const [L, v] = Se(null), [M, N] = Se(p), z = m ?? M, S = he(
3273
+ const U = ne(null), re = ne(null), D = ne([]), C = ne({ from: 0, to: 0 }), ee = ne(null), se = ne(null), M = ne(!1), q = ne(null), I = ne(null), Q = ne(1), F = ne({ width: 0, height: 0 }), W = ne(() => {
3274
+ }), te = ne(N), oe = ne(S);
3275
+ te.current = N, oe.current = S;
3276
+ const [L, v] = Se(null), [k, $] = Se(p), z = m ?? k, T = he(
3253
3277
  (g) => {
3254
- m === void 0 && N(g), y?.(g);
3278
+ m === void 0 && $(g), y?.(g);
3255
3279
  },
3256
3280
  [m, y]
3257
- ), F = ke(
3258
- () => ({ up: h, down: u, line: d }),
3259
- [h, u, d]
3260
- ), Y = i, G = Y.some((g) => g.type === "rsi"), Z = Y.some((g) => g.type === "volume"), U = he(() => {
3261
- const g = ae.current;
3281
+ ), j = ke(
3282
+ () => ({ up: h, down: d, line: u }),
3283
+ [h, d, u]
3284
+ ), V = i, G = V.some((g) => g.type === "rsi"), Z = V.some((g) => g.type === "volume"), _ = he(() => {
3285
+ const g = re.current;
3262
3286
  if (!g) return;
3263
3287
  const b = g.getContext("2d");
3264
3288
  if (!b) return;
3265
- const { width: K, height: B } = O.current;
3289
+ const { width: K, height: B } = F.current;
3266
3290
  if (K === 0 || B === 0) return;
3267
- const j = Q.current;
3268
- b.save(), b.setTransform(1, 0, 0, 1, 0, 0), b.clearRect(0, 0, g.width, g.height), b.scale(j, j);
3269
- const A = ul(W.current, F), de = rn(W.current), V = _.current;
3270
- if (V.length === 0) {
3271
- hl(b, K, B, A), b.restore();
3291
+ const X = Q.current;
3292
+ b.save(), b.setTransform(1, 0, 0, 1, 0, 0), b.clearRect(0, 0, g.width, g.height), b.scale(X, X);
3293
+ const A = fl(U.current, j), de = on(U.current), Y = D.current;
3294
+ if (Y.length === 0) {
3295
+ pl(b, K, B, A), b.restore();
3272
3296
  return;
3273
3297
  }
3274
- const T = Nt(K, B, G, Z), { from: ce, to: me } = sl(C.current, V.length);
3275
- C.current = { from: ce, to: me };
3276
- const re = V.slice(Math.max(0, Math.floor(ce)), Math.min(V.length, Math.ceil(me) + 1)), se = (ie) => {
3277
- const De = me - ce + 1, He = T.plotWidth / De;
3278
- return T.plotLeft + (ie - ce + 0.5) * He;
3279
- }, Ce = T.plotWidth / (me - ce + 1), Ie = Y.map((ie) => al(ie, V)).filter((ie) => ie !== null).map((ie) => ({ ...ie, color: de(ie.color) })), xe = nn(T.main, re, Ie, ce, me);
3280
- Lt(b, T.plotLeft, T.plotRight, xe, A), ml(b, T, xe, c, A), b.save(), b.beginPath(), b.rect(T.plotLeft, xe.paneTop, T.plotWidth, xe.paneHeight), b.clip();
3281
- for (let ie = 0; ie < Y.length; ie++) {
3282
- const De = Y[ie], He = Ie[ie];
3283
- He && yl(b, He, De, V, ce, me, se, xe);
3298
+ const R = Nt(K, B, G, Z), { from: ie, to: me } = ul(C.current, Y.length);
3299
+ C.current = { from: ie, to: me };
3300
+ const ce = Y.slice(Math.max(0, Math.floor(ie)), Math.min(Y.length, Math.ceil(me) + 1)), ae = (le) => {
3301
+ const De = me - ie + 1, He = R.plotWidth / De;
3302
+ return R.plotLeft + (le - ie + 0.5) * He;
3303
+ }, Ce = R.plotWidth / (me - ie + 1), Ie = V.map((le) => hl(le, Y)).filter((le) => le !== null).map((le) => ({ ...le, color: de(le.color) })), xe = rn(R.main, ce, Ie, ie, me);
3304
+ Lt(b, R.plotLeft, R.plotRight, xe, A), gl(b, R, xe, c, A), b.save(), b.beginPath(), b.rect(R.plotLeft, xe.paneTop, R.plotWidth, xe.paneHeight), b.clip();
3305
+ for (let le = 0; le < V.length; le++) {
3306
+ const De = V[le], He = Ie[le];
3307
+ He && xl(b, He, De, Y, ie, me, ae, xe);
3284
3308
  }
3285
- if (o === "candle" ? fl(b, V, ce, me, se, Ce, xe, { up: A.up, down: A.down }) : o === "bar" ? pl(b, V, ce, me, se, Ce, xe, { up: A.up, down: A.down }) : gl(b, V, ce, me, se, xe, A.line, o === "area"), b.restore(), T.volume) {
3286
- const ie = dl(T.volume, V, ce, me);
3287
- Lt(b, T.plotLeft, T.plotRight, ie, A, !0), Ot(b, T, T.volume, "Volume", A), b.save(), b.beginPath(), b.rect(T.plotLeft, ie.paneTop, T.plotWidth, ie.paneHeight), b.clip(), vl(b, V, ce, me, se, Ce, ie, { up: A.up, down: A.down }), b.restore();
3309
+ if (o === "candle" ? yl(b, Y, ie, me, ae, Ce, xe, { up: A.up, down: A.down }) : o === "bar" ? vl(b, Y, ie, me, ae, Ce, xe, { up: A.up, down: A.down }) : bl(b, Y, ie, me, ae, xe, A.line, o === "area"), b.restore(), R.volume) {
3310
+ const le = ml(R.volume, Y, ie, me);
3311
+ Lt(b, R.plotLeft, R.plotRight, le, A, !0), Ot(b, R, R.volume, "Volume", A), b.save(), b.beginPath(), b.rect(R.plotLeft, le.paneTop, R.plotWidth, le.paneHeight), b.clip(), kl(b, Y, ie, me, ae, Ce, le, { up: A.up, down: A.down }), b.restore();
3288
3312
  }
3289
- if (T.rsi) {
3290
- const ie = Y.find((tt) => tt.type === "rsi"), De = ie && ie.type === "rsi" ? ie.period ?? 14 : 14, He = ie && ie.type === "rsi" ? ie.overbought ?? 70 : 70, Ge = ie && ie.type === "rsi" ? ie.oversold ?? 30 : 30, Ee = (ie && ie.type === "rsi" ? ie.color : void 0) ?? "var(--crk-chart-5)", xt = de(Ee), kt = Qi(V, De), Oe = {
3291
- paneTop: T.rsi.top,
3292
- paneBottom: T.rsi.bottom,
3293
- paneHeight: T.rsi.height,
3313
+ if (R.rsi) {
3314
+ const le = V.find((tt) => tt.type === "rsi"), De = le && le.type === "rsi" ? le.period ?? 14 : 14, He = le && le.type === "rsi" ? le.overbought ?? 70 : 70, Ge = le && le.type === "rsi" ? le.oversold ?? 30 : 30, Ee = (le && le.type === "rsi" ? le.color : void 0) ?? "var(--crk-chart-5)", xt = de(Ee), kt = el(Y, De), Oe = {
3315
+ paneTop: R.rsi.top,
3316
+ paneBottom: R.rsi.bottom,
3317
+ paneHeight: R.rsi.height,
3294
3318
  priceMin: 0,
3295
3319
  priceMax: 100,
3296
3320
  ticks: [Ge, 50, He]
3297
3321
  };
3298
- Lt(b, T.plotLeft, T.plotRight, Oe, A, !0), Ot(b, T, T.rsi, `RSI ${De}`, A), b.save(), b.beginPath(), b.rect(T.plotLeft, Oe.paneTop, T.plotWidth, Oe.paneHeight), b.clip(), Qe(b, kt, ce, me, se, Oe, xt), b.restore(), bl(b, T, Oe, He, Ge, A);
3322
+ Lt(b, R.plotLeft, R.plotRight, Oe, A, !0), Ot(b, R, R.rsi, `RSI ${De}`, A), b.save(), b.beginPath(), b.rect(R.plotLeft, Oe.paneTop, R.plotWidth, Oe.paneHeight), b.clip(), Qe(b, kt, ie, me, ae, Oe, xt), b.restore(), Ml(b, R, Oe, He, Ge, A);
3299
3323
  }
3300
- xl(b, T, V, ce, me, n, A), oe.current && kl(b, T, oe.current, V, ce, me, se, c, xe, z, A), b.restore();
3301
- }, [o, Y, G, Z, c, F, n, z]);
3302
- P.current = U;
3324
+ wl(b, R, Y, ie, me, n, A), ee.current && $l(b, R, ee.current, Y, ie, me, ae, c, xe, z, A), b.restore();
3325
+ }, [o, V, G, Z, c, j, n, z]);
3326
+ W.current = _;
3303
3327
  const J = he(() => {
3304
- if (D.current === null) {
3328
+ if (I.current === null) {
3305
3329
  if (typeof requestAnimationFrame > "u") {
3306
- P.current();
3330
+ W.current();
3307
3331
  return;
3308
3332
  }
3309
- D.current = requestAnimationFrame(() => {
3310
- D.current = null, P.current();
3333
+ I.current = requestAnimationFrame(() => {
3334
+ I.current = null, W.current();
3311
3335
  });
3312
3336
  }
3313
3337
  }, []);
3314
- an(() => {
3315
- const g = W.current;
3338
+ dn(() => {
3339
+ const g = U.current;
3316
3340
  if (!g) return;
3317
3341
  const b = () => {
3318
- const B = g.getBoundingClientRect(), j = typeof window < "u" && window.devicePixelRatio || 1;
3319
- Q.current = j, O.current = { width: B.width, height: B.height };
3320
- const A = ae.current;
3321
- A && (A.width = Math.round(B.width * j), A.height = Math.round(B.height * j), A.style.width = `${B.width}px`, A.style.height = `${B.height}px`), J();
3342
+ const B = g.getBoundingClientRect(), X = typeof window < "u" && window.devicePixelRatio || 1;
3343
+ Q.current = X, F.current = { width: B.width, height: B.height };
3344
+ const A = re.current;
3345
+ A && (A.width = Math.round(B.width * X), A.height = Math.round(B.height * X), A.style.width = `${B.width}px`, A.style.height = `${B.height}px`), J();
3322
3346
  };
3323
3347
  if (b(), typeof ResizeObserver > "u") return;
3324
3348
  const K = new ResizeObserver(b);
3325
3349
  return K.observe(g), () => K.disconnect();
3326
3350
  }, [J]), Be(() => {
3327
3351
  let g = !1;
3328
- const b = Math.floor(Date.now() / 1e3), K = Ft(n), B = r !== void 0 ? tn(r) : K * l, j = r !== void 0 ? Math.max(10, Math.ceil(B / K)) : l, A = b - B;
3329
- _.current = [], C.current = { from: 0, to: 0 }, J(), e.getBars({ symbol: t, resolution: n, from: A, to: b, countBack: j }).then((V) => {
3352
+ const b = Math.floor(Date.now() / 1e3), K = Ft(n), B = r !== void 0 ? nn(r) : K * l, X = r !== void 0 ? Math.max(10, Math.ceil(B / K)) : l, A = b - B;
3353
+ D.current = [], C.current = { from: 0, to: 0 }, J(), e.getBars({ symbol: t, resolution: n, from: A, to: b, countBack: X }).then((Y) => {
3330
3354
  if (g) return;
3331
- const T = [...V].sort((me, re) => me.time - re.time);
3332
- _.current = T;
3333
- const ce = T.length - 1;
3355
+ const R = [...Y].sort((me, ce) => me.time - ce.time);
3356
+ D.current = R;
3357
+ const ie = R.length - 1;
3334
3358
  if (r !== void 0)
3335
- C.current = { from: 0, to: ce };
3359
+ C.current = { from: 0, to: ie };
3336
3360
  else {
3337
- const me = Math.min(T.length, Math.min(200, l));
3361
+ const me = Math.min(R.length, Math.min(200, l));
3338
3362
  C.current = {
3339
- from: Math.max(0, ce - me + 1),
3340
- to: ce
3363
+ from: Math.max(0, ie - me + 1),
3364
+ to: ie
3341
3365
  };
3342
3366
  }
3343
- ne.current?.(C.current, T), J();
3367
+ oe.current?.(C.current, R), J();
3344
3368
  }).catch(() => {
3345
3369
  });
3346
3370
  const de = e.subscribeBars({
3347
3371
  symbol: t,
3348
3372
  resolution: n,
3349
- onTick: (V) => {
3373
+ onTick: (Y) => {
3350
3374
  if (g) return;
3351
- const T = _.current, ce = T[T.length - 1];
3352
- if (ce && ce.time === V.time)
3353
- T[T.length - 1] = V;
3354
- else if (!ce || V.time > ce.time) {
3355
- T.push(V);
3375
+ const R = D.current, ie = R[R.length - 1];
3376
+ if (ie && ie.time === Y.time)
3377
+ R[R.length - 1] = Y;
3378
+ else if (!ie || Y.time > ie.time) {
3379
+ R.push(Y);
3356
3380
  const me = C.current;
3357
- me.to >= T.length - 2 && (C.current = { from: me.from + 1, to: me.to + 1 });
3381
+ me.to >= R.length - 2 && (C.current = { from: me.from + 1, to: me.to + 1 });
3358
3382
  }
3359
3383
  J();
3360
3384
  }
@@ -3364,82 +3388,82 @@ function Ul({
3364
3388
  };
3365
3389
  }, [e, t, n, r, l]);
3366
3390
  const ue = he((g) => {
3367
- v(g), ee.current?.(g);
3391
+ v(g), te.current?.(g);
3368
3392
  }, []), be = he((g) => {
3369
3393
  g.currentTarget.setPointerCapture(g.pointerId);
3370
3394
  const b = C.current;
3371
- le.current = { startX: g.clientX, from: b.from, to: b.to };
3395
+ se.current = { startX: g.clientX, from: b.from, to: b.to };
3372
3396
  }, []), pe = he(
3373
3397
  (g) => {
3374
3398
  const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left, B = g.clientY - b.top;
3375
- if (oe.current = { x: K, y: B }, le.current) {
3376
- const { startX: de, from: V, to: T } = le.current, { width: ce } = O.current, me = Math.max(1, ce - Rt), re = T - V + 1, se = me / re, Ce = -(g.clientX - de) / se;
3377
- let Ie = V + Ce, xe = T + Ce;
3378
- const ie = _.current.length;
3379
- Ie < 0 && (Ne(), Ie = 0, xe = re - 1), xe > ie - 1 && (xe = ie - 1, Ie = xe - re + 1), C.current = { from: Ie, to: xe }, ne.current?.(C.current, _.current);
3399
+ if (ee.current = { x: K, y: B }, se.current) {
3400
+ const { startX: de, from: Y, to: R } = se.current, { width: ie } = F.current, me = Math.max(1, ie - Rt), ce = R - Y + 1, ae = me / ce, Ce = -(g.clientX - de) / ae;
3401
+ let Ie = Y + Ce, xe = R + Ce;
3402
+ const le = D.current.length;
3403
+ Ie < 0 && (Ne(), Ie = 0, xe = ce - 1), xe > le - 1 && (xe = le - 1, Ie = xe - ce + 1), C.current = { from: Ie, to: xe }, oe.current?.(C.current, D.current);
3380
3404
  }
3381
- const j = Nt(b.width, b.height, G, Z), A = C.current;
3382
- if (K >= j.plotLeft && K <= j.plotRight) {
3383
- const de = A.to - A.from + 1, V = j.plotWidth / de, T = Math.round(A.from + (K - j.plotLeft) / V - 0.5), ce = _.current, me = Math.max(0, Math.min(ce.length - 1, T)), re = ce[me] ?? null, se = Ml(B, j, ce, A.from, A.to);
3384
- ue({ barIndex: me, bar: re, priceAtCursor: se });
3405
+ const X = Nt(b.width, b.height, G, Z), A = C.current;
3406
+ if (K >= X.plotLeft && K <= X.plotRight) {
3407
+ const de = A.to - A.from + 1, Y = X.plotWidth / de, R = Math.round(A.from + (K - X.plotLeft) / Y - 0.5), ie = D.current, me = Math.max(0, Math.min(ie.length - 1, R)), ce = ie[me] ?? null, ae = Nl(B, X, ie, A.from, A.to);
3408
+ ue({ barIndex: me, bar: ce, priceAtCursor: ae });
3385
3409
  } else
3386
3410
  ue(null);
3387
3411
  J();
3388
3412
  },
3389
3413
  [G, Z, J, ue]
3390
3414
  ), fe = he((g) => {
3391
- g.currentTarget.releasePointerCapture(g.pointerId), le.current = null;
3415
+ g.currentTarget.releasePointerCapture(g.pointerId), se.current = null;
3392
3416
  }, []), ge = he(() => {
3393
- oe.current = null, le.current = null, ue(null), J();
3417
+ ee.current = null, se.current = null, ue(null), J();
3394
3418
  }, [J, ue]), ve = he(
3395
3419
  (g) => {
3396
3420
  g.preventDefault();
3397
- const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left, B = Nt(b.width, b.height, G, Z), j = C.current, A = _.current;
3421
+ const b = g.currentTarget.getBoundingClientRect(), K = g.clientX - b.left, B = Nt(b.width, b.height, G, Z), X = C.current, A = D.current;
3398
3422
  if (A.length === 0) return;
3399
- const de = j.to - j.from + 1, V = g.deltaY > 0 ? 1 + Ht : 1 / (1 + Ht), T = Math.max(
3400
- B.plotWidth / nl,
3401
- Math.min(A.length, B.plotWidth / tl, de * V)
3402
- ), ce = j.from + (K - B.plotLeft) / (B.plotWidth / de), me = (ce - j.from) / de;
3403
- let re = ce - me * T, se = re + T - 1;
3404
- re < 0 && (re = 0, se = T - 1), se > A.length - 1 && (se = A.length - 1, re = se - T + 1), C.current = { from: re, to: se }, ne.current?.(C.current, A), J();
3423
+ const de = X.to - X.from + 1, Y = g.deltaY > 0 ? 1 + Ht : 1 / (1 + Ht), R = Math.max(
3424
+ B.plotWidth / cl,
3425
+ Math.min(A.length, B.plotWidth / ol, de * Y)
3426
+ ), ie = X.from + (K - B.plotLeft) / (B.plotWidth / de), me = (ie - X.from) / de;
3427
+ let ce = ie - me * R, ae = ce + R - 1;
3428
+ ce < 0 && (ce = 0, ae = R - 1), ae > A.length - 1 && (ae = A.length - 1, ce = ae - R + 1), C.current = { from: ce, to: ae }, oe.current?.(C.current, A), J();
3405
3429
  },
3406
3430
  [G, Z, J]
3407
3431
  ), Re = he(
3408
3432
  (g) => {
3409
- const b = C.current, K = b.to - b.from + 1, B = _.current;
3433
+ const b = C.current, K = b.to - b.from + 1, B = D.current;
3410
3434
  if (B.length === 0) return;
3411
- let j = 0;
3412
- if (g.key === "ArrowLeft") j = -Math.max(1, Math.floor(K * 0.1));
3413
- else if (g.key === "ArrowRight") j = Math.max(1, Math.floor(K * 0.1));
3435
+ let X = 0;
3436
+ if (g.key === "ArrowLeft") X = -Math.max(1, Math.floor(K * 0.1));
3437
+ else if (g.key === "ArrowRight") X = Math.max(1, Math.floor(K * 0.1));
3414
3438
  else return;
3415
3439
  g.preventDefault();
3416
- let A = b.from + j, de = b.to + j;
3417
- A < 0 && (A = 0, de = K - 1), de > B.length - 1 && (de = B.length - 1, A = de - K + 1), C.current = { from: A, to: de }, ne.current?.(C.current, B), J();
3440
+ let A = b.from + X, de = b.to + X;
3441
+ A < 0 && (A = 0, de = K - 1), de > B.length - 1 && (de = B.length - 1, A = de - K + 1), C.current = { from: A, to: de }, oe.current?.(C.current, B), J();
3418
3442
  },
3419
3443
  [J]
3420
3444
  ), Ne = he(() => {
3421
- if (w.current) return;
3422
- const g = _.current;
3445
+ if (M.current) return;
3446
+ const g = D.current;
3423
3447
  if (g.length === 0) return;
3424
- w.current = !0;
3425
- const b = Ft(n), K = g[0].time, B = K - b * l, j = K - b;
3426
- e.getBars({ symbol: t, resolution: n, from: B, to: j, countBack: l }).then((A) => {
3448
+ M.current = !0;
3449
+ const b = Ft(n), K = g[0].time, B = K - b * l, X = K - b;
3450
+ e.getBars({ symbol: t, resolution: n, from: B, to: X, countBack: l }).then((A) => {
3427
3451
  if (A.length === 0) {
3428
- w.current = !1;
3452
+ M.current = !1;
3429
3453
  return;
3430
3454
  }
3431
- const V = [...A].sort((ce, me) => ce.time - me.time).filter((ce) => ce.time < K), T = C.current;
3432
- _.current = [...V, ...g], C.current = { from: T.from + V.length, to: T.to + V.length }, w.current = !1, J();
3455
+ const Y = [...A].sort((ie, me) => ie.time - me.time).filter((ie) => ie.time < K), R = C.current;
3456
+ D.current = [...Y, ...g], C.current = { from: R.from + Y.length, to: R.to + Y.length }, M.current = !1, J();
3433
3457
  }).catch(() => {
3434
- w.current = !1;
3458
+ M.current = !1;
3435
3459
  });
3436
3460
  }, [e, t, n, l, J]);
3437
3461
  return /* @__PURE__ */ H(
3438
3462
  "div",
3439
3463
  {
3440
- ref: W,
3441
- className: f(x.root, X),
3442
- style: { ...E, height: a, position: "relative" },
3464
+ ref: U,
3465
+ className: f(x.root, O),
3466
+ style: { ...P, height: a, position: "relative" },
3443
3467
  tabIndex: 0,
3444
3468
  role: "figure",
3445
3469
  "aria-label": `${t} ${n} chart`,
@@ -3448,14 +3472,14 @@ function Ul({
3448
3472
  /* @__PURE__ */ s(
3449
3473
  "canvas",
3450
3474
  {
3451
- ref: ae,
3475
+ ref: re,
3452
3476
  className: x.svg,
3453
3477
  onPointerDown: be,
3454
3478
  onPointerMove: pe,
3455
3479
  onPointerUp: fe,
3456
3480
  onPointerLeave: ge,
3457
3481
  onWheel: ve,
3458
- style: { cursor: le.current ? "grabbing" : "crosshair", touchAction: "none" }
3482
+ style: { cursor: se.current ? "grabbing" : "crosshair", touchAction: "none" }
3459
3483
  }
3460
3484
  ),
3461
3485
  /* @__PURE__ */ H(
@@ -3464,7 +3488,7 @@ function Ul({
3464
3488
  className: x.tradingHeader,
3465
3489
  style: {
3466
3490
  position: "absolute",
3467
- top: 6,
3491
+ top: rl,
3468
3492
  left: 8,
3469
3493
  right: 8,
3470
3494
  pointerEvents: "none",
@@ -3489,25 +3513,26 @@ function Ul({
3489
3513
  L.bar.close.toFixed(c)
3490
3514
  ] })
3491
3515
  ] }),
3492
- $ && /* @__PURE__ */ s("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ s(
3493
- zt,
3516
+ w && /* @__PURE__ */ s("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ s(
3517
+ Vt,
3494
3518
  {
3495
3519
  position: "bottom",
3520
+ asChild: !0,
3496
3521
  trigger: /* @__PURE__ */ s(
3497
- Ut,
3522
+ _t,
3498
3523
  {
3499
3524
  variant: "ghost",
3500
3525
  size: "sm",
3501
3526
  iconOnly: !0,
3502
3527
  "aria-label": "Chart settings",
3503
- children: /* @__PURE__ */ s(ll, {})
3528
+ children: /* @__PURE__ */ s(dl, {})
3504
3529
  }
3505
3530
  ),
3506
3531
  content: /* @__PURE__ */ s(
3507
- il,
3532
+ al,
3508
3533
  {
3509
3534
  timezone: z,
3510
- onTimezoneChange: S
3535
+ onTimezoneChange: T
3511
3536
  }
3512
3537
  )
3513
3538
  }
@@ -3519,7 +3544,7 @@ function Ul({
3519
3544
  }
3520
3545
  );
3521
3546
  }
3522
- const cl = [
3547
+ const sl = [
3523
3548
  { value: "local", label: "Local time" },
3524
3549
  { value: "utc", label: "UTC" },
3525
3550
  { value: "America/New_York", label: "America / New York" },
@@ -3529,7 +3554,7 @@ const cl = [
3529
3554
  { value: "Asia/Tokyo", label: "Asia / Tokyo" },
3530
3555
  { value: "Asia/Singapore", label: "Asia / Singapore" }
3531
3556
  ];
3532
- function il({
3557
+ function al({
3533
3558
  timezone: e,
3534
3559
  onTimezoneChange: t
3535
3560
  }) {
@@ -3548,9 +3573,9 @@ function il({
3548
3573
  /* @__PURE__ */ H("label", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "4px" }, children: [
3549
3574
  /* @__PURE__ */ s("span", { style: { fontSize: "var(--crk-font-size-xs)", color: "var(--crk-color-text-muted)" }, children: "Timezone" }),
3550
3575
  /* @__PURE__ */ s(
3551
- _t,
3576
+ zt,
3552
3577
  {
3553
- options: cl.map((n) => ({ value: n.value, label: n.label })),
3578
+ options: sl.map((n) => ({ value: n.value, label: n.label })),
3554
3579
  value: e,
3555
3580
  onChange: (n) => t(n)
3556
3581
  }
@@ -3558,7 +3583,7 @@ function il({
3558
3583
  ] })
3559
3584
  ] });
3560
3585
  }
3561
- function ll() {
3586
+ function dl() {
3562
3587
  return /* @__PURE__ */ H(
3563
3588
  "svg",
3564
3589
  {
@@ -3577,14 +3602,14 @@ function ll() {
3577
3602
  );
3578
3603
  }
3579
3604
  function Nt(e, t, n, r) {
3580
- const i = Math.max(0, e - Rt), c = el, l = Math.max(c, t - Ct), a = Math.max(0, i - 0), h = Math.max(0, l - c);
3581
- let u = h, d = c;
3605
+ const i = Math.max(0, e - Rt), c = nl, l = Math.max(c, t - Ct), a = Math.max(0, i - 0), h = Math.max(0, l - c);
3606
+ let d = h, u = c;
3582
3607
  const m = { top: c, bottom: l, height: h };
3583
3608
  let p = null, y = null;
3584
- const $ = n ? Wt.rsi : 0, k = r ? Wt.volume : 0;
3585
- return u = h * (1 - $ - k), m.top = d, m.height = u, m.bottom = m.top + u, d = m.bottom, n && (p = { top: d, height: h * $, bottom: d + h * $ }, d = p.bottom), r && (y = { top: d, height: h * k, bottom: d + h * k }), { width: e, height: t, plotLeft: 0, plotRight: i, plotTop: c, plotBottom: l, plotWidth: a, plotHeight: h, main: m, rsi: p, volume: y };
3609
+ const w = n ? Wt.rsi : 0, N = r ? Wt.volume : 0;
3610
+ return d = h * (1 - w - N), m.top = u, m.height = d, m.bottom = m.top + d, u = m.bottom, n && (p = { top: u, height: h * w, bottom: u + h * w }, u = p.bottom), r && (y = { top: u, height: h * N, bottom: u + h * N }), { width: e, height: t, plotLeft: 0, plotRight: i, plotTop: c, plotBottom: l, plotWidth: a, plotHeight: h, main: m, rsi: p, volume: y };
3586
3611
  }
3587
- function sl(e, t) {
3612
+ function ul(e, t) {
3588
3613
  if (t === 0) return { from: 0, to: 0 };
3589
3614
  let { from: n, to: r } = e;
3590
3615
  if (r >= t) {
@@ -3593,13 +3618,13 @@ function sl(e, t) {
3593
3618
  }
3594
3619
  return n < 0 && (n = 0), r < n && (r = n), { from: n, to: r };
3595
3620
  }
3596
- function al(e, t) {
3621
+ function hl(e, t) {
3597
3622
  if (e.type === "sma")
3598
- return { kind: "line", values: Gi(t, e.period), color: e.color ?? "var(--crk-chart-2)" };
3623
+ return { kind: "line", values: Ki(t, e.period), color: e.color ?? "var(--crk-chart-2)" };
3599
3624
  if (e.type === "ema")
3600
- return { kind: "line", values: Zi(t, e.period), color: e.color ?? "var(--crk-chart-3)" };
3625
+ return { kind: "line", values: Qi(t, e.period), color: e.color ?? "var(--crk-chart-3)" };
3601
3626
  if (e.type === "bollinger") {
3602
- const n = Ki(t, e.period, e.stdDev ?? 2);
3627
+ const n = Ji(t, e.period, e.stdDev ?? 2);
3603
3628
  return {
3604
3629
  kind: "bollinger",
3605
3630
  middle: n.middle,
@@ -3611,30 +3636,30 @@ function al(e, t) {
3611
3636
  }
3612
3637
  return null;
3613
3638
  }
3614
- function nn(e, t, n, r, o) {
3639
+ function rn(e, t, n, r, o) {
3615
3640
  let i = 1 / 0, c = -1 / 0;
3616
- for (const d of t)
3617
- d.low < i && (i = d.low), d.high > c && (c = d.high);
3618
- for (const d of n) {
3619
- const m = d.kind === "line" ? [d.values] : [d.upper, d.lower];
3641
+ for (const u of t)
3642
+ u.low < i && (i = u.low), u.high > c && (c = u.high);
3643
+ for (const u of n) {
3644
+ const m = u.kind === "line" ? [u.values] : [u.upper, u.lower];
3620
3645
  for (const p of m) {
3621
- const y = Math.max(0, Math.floor(r)), $ = Math.min(p.length - 1, Math.ceil(o));
3622
- for (let k = y; k <= $; k++) {
3623
- const R = p[k];
3624
- R != null && (R < i && (i = R), R > c && (c = R));
3646
+ const y = Math.max(0, Math.floor(r)), w = Math.min(p.length - 1, Math.ceil(o));
3647
+ for (let N = y; N <= w; N++) {
3648
+ const S = p[N];
3649
+ S != null && (S < i && (i = S), S > c && (c = S));
3625
3650
  }
3626
3651
  }
3627
3652
  }
3628
3653
  (!isFinite(i) || !isFinite(c)) && (i = 0, c = 1);
3629
- const l = (c - i) * 0.08 || 1, a = qe(i - l, c + l, 5), h = Math.min(a[0], i), u = Math.max(a[a.length - 1], c);
3630
- return { paneTop: e.top, paneBottom: e.bottom, paneHeight: e.height, priceMin: h, priceMax: u, ticks: a };
3654
+ const l = (c - i) * 0.08 || 1, a = qe(i - l, c + l, 5), h = Math.min(a[0], i), d = Math.max(a[a.length - 1], c);
3655
+ return { paneTop: e.top, paneBottom: e.bottom, paneHeight: e.height, priceMin: h, priceMax: d, ticks: a };
3631
3656
  }
3632
- function dl(e, t, n, r) {
3657
+ function ml(e, t, n, r) {
3633
3658
  let o = 0;
3634
3659
  const i = Math.max(0, Math.floor(n)), c = Math.min(t.length - 1, Math.ceil(r));
3635
3660
  for (let h = i; h <= c; h++) {
3636
- const u = t[h].volume ?? 0;
3637
- u > o && (o = u);
3661
+ const d = t[h].volume ?? 0;
3662
+ d > o && (o = d);
3638
3663
  }
3639
3664
  const l = qe(0, o || 1, 3), a = Math.max(l[l.length - 1], o);
3640
3665
  return { paneTop: e.top, paneBottom: e.bottom, paneHeight: e.height, priceMin: 0, priceMax: a, ticks: l };
@@ -3643,7 +3668,7 @@ function we(e, t) {
3643
3668
  const n = (e - t.priceMin) / (t.priceMax - t.priceMin || 1);
3644
3669
  return t.paneBottom - n * t.paneHeight;
3645
3670
  }
3646
- function rn(e) {
3671
+ function on(e) {
3647
3672
  if (!e || typeof getComputedStyle > "u") return (o) => o;
3648
3673
  const t = getComputedStyle(e), n = /* @__PURE__ */ new Map(), r = (o) => {
3649
3674
  if (!o || !o.includes("var(")) return o;
@@ -3660,8 +3685,8 @@ function rn(e) {
3660
3685
  };
3661
3686
  return r;
3662
3687
  }
3663
- function ul(e, t) {
3664
- const n = rn(e);
3688
+ function fl(e, t) {
3689
+ const n = on(e);
3665
3690
  return {
3666
3691
  up: n(t.up),
3667
3692
  down: n(t.down),
@@ -3673,7 +3698,7 @@ function ul(e, t) {
3673
3698
  bg: n("var(--crk-color-bg)") || "#ffffff"
3674
3699
  };
3675
3700
  }
3676
- function hl(e, t, n, r) {
3701
+ function pl(e, t, n, r) {
3677
3702
  e.fillStyle = r.textMuted, e.font = "13px system-ui, sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText("Loading…", t / 2, n / 2);
3678
3703
  }
3679
3704
  function Lt(e, t, n, r, o, i = !1) {
@@ -3684,58 +3709,58 @@ function Lt(e, t, n, r, o, i = !1) {
3684
3709
  }
3685
3710
  e.stroke();
3686
3711
  }
3687
- function ml(e, t, n, r, o) {
3712
+ function gl(e, t, n, r, o) {
3688
3713
  e.fillStyle = o.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle";
3689
3714
  for (const i of n.ticks) {
3690
3715
  const c = we(i, n);
3691
3716
  e.fillText(i.toFixed(r), t.plotRight + 6, c);
3692
3717
  }
3693
3718
  }
3694
- function fl(e, t, n, r, o, i, c, l) {
3695
- const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(1, i * 0.7);
3696
- for (let d = a; d <= h; d++) {
3697
- const m = t[d], p = o(d), y = we(m.open, c), $ = we(m.close, c), k = we(m.high, c), R = we(m.low, c), E = m.close >= m.open ? l.up : l.down;
3698
- e.strokeStyle = E, e.fillStyle = E, e.beginPath();
3699
- const W = Math.round(p) + 0.5;
3700
- e.moveTo(W, k), e.lineTo(W, R), e.stroke();
3701
- const ae = Math.min(y, $), _ = Math.max(1, Math.abs($ - y));
3702
- e.fillRect(Math.round(p - u / 2), Math.round(ae), Math.round(u), Math.round(_));
3719
+ function yl(e, t, n, r, o, i, c, l) {
3720
+ const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), d = Math.max(1, i * 0.7);
3721
+ for (let u = a; u <= h; u++) {
3722
+ const m = t[u], p = o(u), y = we(m.open, c), w = we(m.close, c), N = we(m.high, c), S = we(m.low, c), P = m.close >= m.open ? l.up : l.down;
3723
+ e.strokeStyle = P, e.fillStyle = P, e.beginPath();
3724
+ const U = Math.round(p) + 0.5;
3725
+ e.moveTo(U, N), e.lineTo(U, S), e.stroke();
3726
+ const re = Math.min(y, w), D = Math.max(1, Math.abs(w - y));
3727
+ e.fillRect(Math.round(p - d / 2), Math.round(re), Math.round(d), Math.round(D));
3703
3728
  }
3704
3729
  }
3705
- function pl(e, t, n, r, o, i, c, l) {
3706
- const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(2, Math.min(i * 0.4, 8));
3730
+ function vl(e, t, n, r, o, i, c, l) {
3731
+ const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), d = Math.max(2, Math.min(i * 0.4, 8));
3707
3732
  e.lineWidth = Math.max(1, Math.min(2, i * 0.18)), e.lineCap = "butt";
3708
- for (let d = a; d <= h; d++) {
3709
- const m = t[d], p = Math.round(o(d)) + 0.5, y = we(m.high, c), $ = we(m.low, c), k = we(m.open, c), R = we(m.close, c), X = m.close >= m.open;
3710
- e.strokeStyle = X ? l.up : l.down, e.beginPath(), e.moveTo(p, y), e.lineTo(p, $), e.moveTo(p - u, k), e.lineTo(p, k), e.moveTo(p, R), e.lineTo(p + u, R), e.stroke();
3733
+ for (let u = a; u <= h; u++) {
3734
+ const m = t[u], p = Math.round(o(u)) + 0.5, y = we(m.high, c), w = we(m.low, c), N = we(m.open, c), S = we(m.close, c), O = m.close >= m.open;
3735
+ e.strokeStyle = O ? l.up : l.down, e.beginPath(), e.moveTo(p, y), e.lineTo(p, w), e.moveTo(p - d, N), e.lineTo(p, N), e.moveTo(p, S), e.lineTo(p + d, S), e.stroke();
3711
3736
  }
3712
3737
  }
3713
- function gl(e, t, n, r, o, i, c, l) {
3738
+ function bl(e, t, n, r, o, i, c, l) {
3714
3739
  const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r));
3715
3740
  if (!(h <= a)) {
3716
3741
  e.strokeStyle = c, e.lineWidth = 1.5, e.beginPath(), e.moveTo(o(a), we(t[a].close, i));
3717
- for (let u = a + 1; u <= h; u++)
3718
- e.lineTo(o(u), we(t[u].close, i));
3742
+ for (let d = a + 1; d <= h; d++)
3743
+ e.lineTo(o(d), we(t[d].close, i));
3719
3744
  e.stroke(), l && (e.globalAlpha = 0.18, e.fillStyle = c, e.lineTo(o(h), i.paneBottom), e.lineTo(o(a), i.paneBottom), e.closePath(), e.fill(), e.globalAlpha = 1);
3720
3745
  }
3721
3746
  }
3722
- function yl(e, t, n, r, o, i, c, l) {
3747
+ function xl(e, t, n, r, o, i, c, l) {
3723
3748
  if (t.kind === "line") {
3724
3749
  Qe(e, t.values, o, i, c, l, t.color);
3725
3750
  return;
3726
3751
  }
3727
3752
  const a = Math.max(0, Math.floor(o)), h = Math.min(r.length - 1, Math.ceil(i));
3728
3753
  e.globalAlpha = t.fillOpacity, e.fillStyle = t.color, e.beginPath();
3729
- let u = !1;
3730
- for (let d = a; d <= h; d++) {
3731
- const m = t.upper[d];
3754
+ let d = !1;
3755
+ for (let u = a; u <= h; u++) {
3756
+ const m = t.upper[u];
3732
3757
  if (m == null) continue;
3733
- const p = c(d), y = we(m, l);
3734
- u ? e.lineTo(p, y) : (e.moveTo(p, y), u = !0);
3758
+ const p = c(u), y = we(m, l);
3759
+ d ? e.lineTo(p, y) : (e.moveTo(p, y), d = !0);
3735
3760
  }
3736
- for (let d = h; d >= a; d--) {
3737
- const m = t.lower[d];
3738
- m != null && e.lineTo(c(d), we(m, l));
3761
+ for (let u = h; u >= a; u--) {
3762
+ const m = t.lower[u];
3763
+ m != null && e.lineTo(c(u), we(m, l));
3739
3764
  }
3740
3765
  e.closePath(), e.fill(), e.globalAlpha = 1, Qe(e, t.upper, o, i, c, l, t.color), Qe(e, t.lower, o, i, c, l, t.color), Qe(e, t.middle, o, i, c, l, t.color);
3741
3766
  }
@@ -3743,30 +3768,30 @@ function Qe(e, t, n, r, o, i, c) {
3743
3768
  e.strokeStyle = c, e.lineWidth = 1.25, e.beginPath();
3744
3769
  let l = !1;
3745
3770
  const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r));
3746
- for (let u = a; u <= h; u++) {
3747
- const d = t[u];
3748
- if (d == null) {
3771
+ for (let d = a; d <= h; d++) {
3772
+ const u = t[d];
3773
+ if (u == null) {
3749
3774
  l = !1;
3750
3775
  continue;
3751
3776
  }
3752
- const m = o(u), p = we(d, i);
3777
+ const m = o(d), p = we(u, i);
3753
3778
  l ? e.lineTo(m, p) : (e.moveTo(m, p), l = !0);
3754
3779
  }
3755
3780
  e.stroke();
3756
3781
  }
3757
- function vl(e, t, n, r, o, i, c, l) {
3758
- const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(1, i * 0.7);
3759
- for (let d = a; d <= h; d++) {
3760
- const m = t[d], p = m.volume ?? 0;
3782
+ function kl(e, t, n, r, o, i, c, l) {
3783
+ const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), d = Math.max(1, i * 0.7);
3784
+ for (let u = a; u <= h; u++) {
3785
+ const m = t[u], p = m.volume ?? 0;
3761
3786
  if (p === 0) continue;
3762
3787
  const y = m.close >= m.open;
3763
3788
  e.fillStyle = y ? l.up : l.down, e.globalAlpha = 0.55;
3764
- const $ = we(p, c), k = c.paneBottom - $;
3765
- e.fillRect(Math.round(o(d) - u / 2), Math.round($), Math.round(u), Math.round(k));
3789
+ const w = we(p, c), N = c.paneBottom - w;
3790
+ e.fillRect(Math.round(o(u) - d / 2), Math.round(w), Math.round(d), Math.round(N));
3766
3791
  }
3767
3792
  e.globalAlpha = 1;
3768
3793
  }
3769
- function bl(e, t, n, r, o, i) {
3794
+ function Ml(e, t, n, r, o, i) {
3770
3795
  e.strokeStyle = i.grid, e.setLineDash([3, 3]), e.beginPath();
3771
3796
  for (const c of [r, o]) {
3772
3797
  const l = Math.round(we(c, n)) + 0.5;
@@ -3777,45 +3802,45 @@ function bl(e, t, n, r, o, i) {
3777
3802
  function Ot(e, t, n, r, o) {
3778
3803
  e.fillStyle = o.textMuted, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "top", e.fillText(r, t.plotLeft + 6, n.top + 4);
3779
3804
  }
3780
- function xl(e, t, n, r, o, i, c) {
3805
+ function wl(e, t, n, r, o, i, c) {
3781
3806
  const l = o - r + 1, a = t.plotWidth / l, h = Math.max(1, Math.round(80 / a));
3782
3807
  e.fillStyle = c.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "center", e.textBaseline = "middle";
3783
- const u = Math.max(0, Math.floor(r)), d = Math.min(n.length - 1, Math.ceil(o)), m = t.plotBottom + Ct / 2;
3784
- for (let p = u; p <= d; p += h) {
3785
- const y = n[p], $ = t.plotLeft + (p - r + 0.5) * a;
3786
- e.fillText(wl(y.time, i), $, m);
3808
+ const d = Math.max(0, Math.floor(r)), u = Math.min(n.length - 1, Math.ceil(o)), m = t.plotBottom + Ct / 2;
3809
+ for (let p = d; p <= u; p += h) {
3810
+ const y = n[p], w = t.plotLeft + (p - r + 0.5) * a;
3811
+ e.fillText(Ll(y.time, i), w, m);
3787
3812
  }
3788
3813
  }
3789
- function kl(e, t, n, r, o, i, c, l, a, h, u) {
3814
+ function $l(e, t, n, r, o, i, c, l, a, h, d) {
3790
3815
  if (n.x < t.plotLeft || n.x > t.plotRight) return;
3791
- const d = i - o + 1, m = t.plotWidth / d, p = o + (n.x - t.plotLeft) / m - 0.5, y = Math.round(p), $ = Math.max(0, Math.min(r.length - 1, y)), k = c($);
3792
- if (e.save(), e.strokeStyle = u.textMuted, e.setLineDash([3, 3]), e.lineWidth = 1, e.beginPath(), e.moveTo(k + 0.5, t.plotTop), e.lineTo(k + 0.5, t.plotBottom), e.moveTo(t.plotLeft, n.y + 0.5), e.lineTo(t.plotRight, n.y + 0.5), e.stroke(), e.setLineDash([]), n.y >= a.paneTop && n.y <= a.paneBottom) {
3793
- const R = a.priceMax - (n.y - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
3794
- e.fillStyle = u.text, e.fillRect(t.plotRight, n.y - 9, Rt, 18), e.fillStyle = u.bg, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(R.toFixed(l), t.plotRight + 6, n.y);
3816
+ const u = i - o + 1, m = t.plotWidth / u, p = o + (n.x - t.plotLeft) / m - 0.5, y = Math.round(p), w = Math.max(0, Math.min(r.length - 1, y)), N = c(w);
3817
+ if (e.save(), e.strokeStyle = d.textMuted, e.setLineDash([3, 3]), e.lineWidth = 1, e.beginPath(), e.moveTo(N + 0.5, t.plotTop), e.lineTo(N + 0.5, t.plotBottom), e.moveTo(t.plotLeft, n.y + 0.5), e.lineTo(t.plotRight, n.y + 0.5), e.stroke(), e.setLineDash([]), n.y >= a.paneTop && n.y <= a.paneBottom) {
3818
+ const S = a.priceMax - (n.y - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
3819
+ e.fillStyle = d.text, e.fillRect(t.plotRight, n.y - 9, Rt, 18), e.fillStyle = d.bg, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(S.toFixed(l), t.plotRight + 6, n.y);
3795
3820
  }
3796
- if (r[$]) {
3797
- const R = on(r[$].time, h);
3821
+ if (r[w]) {
3822
+ const S = cn(r[w].time, h);
3798
3823
  e.font = "11px system-ui, sans-serif", e.textBaseline = "middle";
3799
- const W = e.measureText(R).width + 8 * 2, ae = Ct, _ = Math.max(
3824
+ const U = e.measureText(S).width + 8 * 2, re = Ct, D = Math.max(
3800
3825
  t.plotLeft,
3801
- Math.min(t.plotRight - W, k - W / 2)
3826
+ Math.min(t.plotRight - U, N - U / 2)
3802
3827
  ), C = t.plotBottom;
3803
- e.fillStyle = u.text, e.fillRect(_, C, W, ae), e.fillStyle = u.bg, e.textAlign = "center", e.fillText(R, _ + W / 2, C + ae / 2);
3828
+ e.fillStyle = d.text, e.fillRect(D, C, U, re), e.fillStyle = d.bg, e.textAlign = "center", e.fillText(S, D + U / 2, C + re / 2);
3804
3829
  }
3805
3830
  e.restore();
3806
3831
  }
3807
- function Ml(e, t, n, r, o, i, c) {
3808
- const l = n.slice(Math.max(0, Math.floor(r)), Math.min(n.length, Math.ceil(o) + 1)), a = nn(t.main, l, [], r, o);
3832
+ function Nl(e, t, n, r, o, i, c) {
3833
+ const l = n.slice(Math.max(0, Math.floor(r)), Math.min(n.length, Math.ceil(o) + 1)), a = rn(t.main, l, [], r, o);
3809
3834
  return e < a.paneTop || e > a.paneBottom ? null : a.priceMax - (e - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
3810
3835
  }
3811
- function wl(e, t) {
3836
+ function Ll(e, t) {
3812
3837
  const n = new Date(e * 1e3);
3813
3838
  return t === "D" || t === "W" || t === "M" ? `${n.getUTCFullYear()}-${Te(n.getUTCMonth() + 1)}-${Te(n.getUTCDate())}` : `${Te(n.getUTCHours())}:${Te(n.getUTCMinutes())}`;
3814
3839
  }
3815
- function on(e, t) {
3840
+ function cn(e, t) {
3816
3841
  const n = new Date(e * 1e3);
3817
3842
  if (t === "local")
3818
- return `${n.getFullYear()}-${Te(n.getMonth() + 1)}-${Te(n.getDate())} ${Te(n.getHours())}:${Te(n.getMinutes())}:${Te(n.getSeconds())} ${$l(n)}`;
3843
+ return `${n.getFullYear()}-${Te(n.getMonth() + 1)}-${Te(n.getDate())} ${Te(n.getHours())}:${Te(n.getMinutes())}:${Te(n.getSeconds())} ${Sl(n)}`;
3819
3844
  if (t === "utc")
3820
3845
  return `${n.getUTCFullYear()}-${Te(n.getUTCMonth() + 1)}-${Te(n.getUTCDate())} ${Te(n.getUTCHours())}:${Te(n.getUTCMinutes())}:${Te(n.getUTCSeconds())} UTC`;
3821
3846
  try {
@@ -3833,10 +3858,10 @@ function on(e, t) {
3833
3858
  }).formatToParts(n), i = (l) => o.find((a) => a.type === l)?.value ?? "", c = i("timeZoneName") || t;
3834
3859
  return `${i("year")}-${i("month")}-${i("day")} ${i("hour")}:${i("minute")}:${i("second")} ${c}`;
3835
3860
  } catch {
3836
- return on(e, "utc");
3861
+ return cn(e, "utc");
3837
3862
  }
3838
3863
  }
3839
- function $l(e) {
3864
+ function Sl(e) {
3840
3865
  const t = -e.getTimezoneOffset(), n = t >= 0 ? "+" : "-", r = Math.abs(t);
3841
3866
  return `${n}${Te(Math.floor(r / 60))}:${Te(r % 60)}`;
3842
3867
  }
@@ -3859,18 +3884,18 @@ function Ft(e) {
3859
3884
  }
3860
3885
  return 60;
3861
3886
  }
3862
- function Nl(e, t) {
3887
+ function Tl(e, t) {
3863
3888
  if (e.length === 0) return "";
3864
3889
  if (e.length === 1 || t === "linear")
3865
3890
  return e.map((r, o) => `${o === 0 ? "M" : "L"} ${r.x} ${r.y}`).join(" ");
3866
3891
  let n = `M ${e[0].x} ${e[0].y}`;
3867
3892
  for (let r = 0; r < e.length - 1; r++) {
3868
- const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6, u = c.x - (l.x - i.x) / 6, d = c.y - (l.y - i.y) / 6;
3869
- n += ` C ${a} ${h}, ${u} ${d}, ${c.x} ${c.y}`;
3893
+ const o = e[r - 1] ?? e[r], i = e[r], c = e[r + 1], l = e[r + 2] ?? c, a = i.x + (c.x - o.x) / 6, h = i.y + (c.y - o.y) / 6, d = c.x - (l.x - i.x) / 6, u = c.y - (l.y - i.y) / 6;
3894
+ n += ` C ${a} ${h}, ${d} ${u}, ${c.x} ${c.y}`;
3870
3895
  }
3871
3896
  return n;
3872
3897
  }
3873
- const Ll = $e(
3898
+ const Rl = $e(
3874
3899
  ({
3875
3900
  data: e,
3876
3901
  width: t = 80,
@@ -3882,19 +3907,19 @@ const Ll = $e(
3882
3907
  showLastPoint: l = !1,
3883
3908
  "aria-label": a,
3884
3909
  className: h,
3885
- style: u
3886
- }, d) => {
3910
+ style: d
3911
+ }, u) => {
3887
3912
  const { line: m, area: p, last: y } = ke(() => {
3888
3913
  if (e.length === 0) return { line: "", area: "", last: null };
3889
- const $ = o, k = Math.max(1, t - $ * 2), R = Math.max(1, n - $ * 2), [X, E] = bt(e), W = Je([0, Math.max(1, e.length - 1)], [$, $ + k]), ae = Je([X, E], [$ + R, $]), _ = e.map((le, w) => ({ x: W(w), y: ae(le) })), C = Nl(_, i), oe = c ? `${C} L ${_[_.length - 1].x} ${$ + R} L ${_[0].x} ${$ + R} Z` : "";
3890
- return { line: C, area: oe, last: _[_.length - 1] };
3914
+ const w = o, N = Math.max(1, t - w * 2), S = Math.max(1, n - w * 2), [O, P] = bt(e), U = Je([0, Math.max(1, e.length - 1)], [w, w + N]), re = Je([O, P], [w + S, w]), D = e.map((se, M) => ({ x: U(M), y: re(se) })), C = Tl(D, i), ee = c ? `${C} L ${D[D.length - 1].x} ${w + S} L ${D[0].x} ${w + S} Z` : "";
3915
+ return { line: C, area: ee, last: D[D.length - 1] };
3891
3916
  }, [e, t, n, o, i, c]);
3892
3917
  return /* @__PURE__ */ H(
3893
3918
  "svg",
3894
3919
  {
3895
- ref: d,
3920
+ ref: u,
3896
3921
  className: f(x.sparkline, h),
3897
- style: u,
3922
+ style: d,
3898
3923
  width: t,
3899
3924
  height: n,
3900
3925
  viewBox: `0 0 ${t} ${n}`,
@@ -3919,45 +3944,45 @@ const Ll = $e(
3919
3944
  );
3920
3945
  }
3921
3946
  );
3922
- Ll.displayName = "Sparkline";
3947
+ Rl.displayName = "Sparkline";
3923
3948
  export {
3924
- Pl as AreaChart,
3925
- Wl as BarChart,
3926
- Ut as Button,
3927
- Hc as Checkbox,
3928
- _t as Dropdown,
3929
- ao as DropdownItem,
3930
- Bl as Form,
3931
- Dl as FormField,
3932
- Il as FormRow,
3933
- ec as Input,
3934
- El as LineChart,
3935
- Fn as Link,
3936
- vr as List,
3937
- br as ListItem,
3949
+ Ol as AreaChart,
3950
+ Fl as BarChart,
3951
+ _t as Button,
3952
+ Fc as Checkbox,
3953
+ zt as Dropdown,
3954
+ uo as DropdownItem,
3955
+ El as Form,
3956
+ Pl as FormField,
3957
+ Wl as FormRow,
3958
+ nc as Input,
3959
+ Hl as LineChart,
3960
+ jn as Link,
3961
+ br as List,
3962
+ xr as ListItem,
3938
3963
  yt as Modal,
3939
- Hl as PieChart,
3940
- zt as Popover,
3941
- Ol as RadarChart,
3942
- _c as Radio,
3943
- Uc as RadioGroup,
3944
- Dc as Select,
3945
- Ll as Sparkline,
3946
- Al as Table,
3947
- ni as Textarea,
3948
- Ul as TradingChart,
3949
- ar as Typography,
3950
- Ki as bollinger,
3951
- Zi as ema,
3952
- on as formatCrosshairTime,
3953
- tn as periodToSeconds,
3954
- Qi as rsi,
3955
- Gi as sma,
3956
- Xl as suggestPeriodForResolution,
3957
- jl as suggestResolutionForPeriod,
3964
+ jl as PieChart,
3965
+ Vt as Popover,
3966
+ Xl as RadarChart,
3967
+ Vc as Radio,
3968
+ zc as RadioGroup,
3969
+ Ec as Select,
3970
+ Rl as Sparkline,
3971
+ Il as Table,
3972
+ oi as Textarea,
3973
+ Vl as TradingChart,
3974
+ dr as Typography,
3975
+ Ji as bollinger,
3976
+ Qi as ema,
3977
+ cn as formatCrosshairTime,
3978
+ nn as periodToSeconds,
3979
+ el as rsi,
3980
+ Ki as sma,
3981
+ zl as suggestPeriodForResolution,
3982
+ _l as suggestResolutionForPeriod,
3958
3983
  pt as useClickOutside,
3959
- bo as useFocusTrap,
3984
+ ko as useFocusTrap,
3960
3985
  Tt as useKeyboard,
3961
- _r as useTableSort,
3962
- Fl as volumeSeries
3986
+ zr as useTableSort,
3987
+ Ul as volumeSeries
3963
3988
  };