@overdoser/react-toolkit 0.0.13 → 0.0.14
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/components/Chart/TradingChart.d.ts +8 -3
- package/components/Chart/trading/period.d.ts +3 -0
- package/components/Chart/trading/types.d.ts +5 -1
- package/index.js +753 -741
- package/llms.txt +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { forwardRef as
|
|
2
|
-
import { jsxs as
|
|
1
|
+
import { forwardRef as Ne, createElement as an, useState as Re, useCallback as pe, useMemo as ke, useEffect as Le, useLayoutEffect as zt, useRef as oe, useId as Ue, isValidElement as dn, cloneElement as jt, createContext as _t, useContext as ft, useImperativeHandle as un } from "react";
|
|
2
|
+
import { jsxs as z, jsx as s, Fragment as ze } from "react/jsx-runtime";
|
|
3
3
|
import { createPortal as pt } from "react-dom";
|
|
4
4
|
import { FormProvider as hn, useFormContext as mn, useController as fn } from "react-hook-form";
|
|
5
|
-
function
|
|
5
|
+
function Yt(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 =
|
|
10
|
+
for (t = 0; t < o; t++) e[t] && (n = Yt(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 m() {
|
|
15
|
-
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t =
|
|
15
|
+
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Yt(e)) && (r && (r += " "), r += t);
|
|
16
16
|
return r;
|
|
17
17
|
}
|
|
18
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", Rn = "crk-shimmer-8iQSU", Sn = "crk-loadingShimmer-BVvFw", Tn = "crk-shimmerSweep-uiZ01", Cn = "crk-dots-U8wss", An = "crk-loadingDots-eKv64", Bn = "crk-dot-Owuk1", In = "crk-dotBounce-FwdcC", Dn = "crk-loadingBorder-9ULFw", En = "crk-borderSpin-EJ2gW", Be = {
|
|
@@ -41,7 +41,7 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
41
41
|
dots: Be.loadingDots,
|
|
42
42
|
shimmer: Be.loadingShimmer,
|
|
43
43
|
border: Be.loadingBorder
|
|
44
|
-
},
|
|
44
|
+
}, Ut = Ne(
|
|
45
45
|
({
|
|
46
46
|
variant: e = "primary",
|
|
47
47
|
size: t = "md",
|
|
@@ -55,7 +55,7 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
55
55
|
style: h,
|
|
56
56
|
children: u,
|
|
57
57
|
...d
|
|
58
|
-
}, f) => /* @__PURE__ */
|
|
58
|
+
}, f) => /* @__PURE__ */ z(
|
|
59
59
|
"button",
|
|
60
60
|
{
|
|
61
61
|
ref: f,
|
|
@@ -77,7 +77,7 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
77
77
|
children: [
|
|
78
78
|
/* @__PURE__ */ s("div", { className: m(Be.shimmer, l?.shimmer) }),
|
|
79
79
|
/* @__PURE__ */ s("span", { className: m(Be.content, l?.content), children: u }),
|
|
80
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ z("span", { className: m(Be.dots, l?.dots), "aria-hidden": "true", children: [
|
|
81
81
|
/* @__PURE__ */ s("span", { className: m(Be.dot, l?.dot) }),
|
|
82
82
|
/* @__PURE__ */ s("span", { className: m(Be.dot, l?.dot) }),
|
|
83
83
|
/* @__PURE__ */ s("span", { className: m(Be.dot, l?.dot) })
|
|
@@ -86,14 +86,14 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
86
86
|
}
|
|
87
87
|
)
|
|
88
88
|
);
|
|
89
|
-
|
|
89
|
+
Ut.displayName = "Button";
|
|
90
90
|
const Wn = "crk-root-2j4Vp", Hn = "crk-muted-vReNc", On = "crk-danger-ugf9r", Fn = "crk-srOnly-LGQgs", $t = {
|
|
91
91
|
root: Wn,
|
|
92
92
|
default: "crk-default-3TBlr",
|
|
93
93
|
muted: Hn,
|
|
94
94
|
danger: On,
|
|
95
95
|
srOnly: Fn
|
|
96
|
-
},
|
|
96
|
+
}, Xn = Ne(
|
|
97
97
|
({
|
|
98
98
|
variant: e = "default",
|
|
99
99
|
external: t = !1,
|
|
@@ -101,7 +101,7 @@ const Wn = "crk-root-2j4Vp", Hn = "crk-muted-vReNc", On = "crk-danger-ugf9r", Fn
|
|
|
101
101
|
style: r,
|
|
102
102
|
children: o,
|
|
103
103
|
...c
|
|
104
|
-
}, i) => /* @__PURE__ */
|
|
104
|
+
}, i) => /* @__PURE__ */ z(
|
|
105
105
|
"a",
|
|
106
106
|
{
|
|
107
107
|
ref: i,
|
|
@@ -119,13 +119,13 @@ const Wn = "crk-root-2j4Vp", Hn = "crk-muted-vReNc", On = "crk-danger-ugf9r", Fn
|
|
|
119
119
|
}
|
|
120
120
|
)
|
|
121
121
|
);
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
root:
|
|
125
|
-
h1:
|
|
122
|
+
Xn.displayName = "Link";
|
|
123
|
+
const zn = "crk-root-U-oiq", jn = "crk-h1-Aivwz", _n = "crk-h2-CV8Oo", Yn = "crk-h3-lrbrK", Un = "crk-h4--jkC1", Vn = "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-", ir = "crk-success-w8PpD", cr = "crk-align-left-3AGYw", lr = "crk-align-center-h-x--", sr = "crk-align-right-IXFhK", ar = "crk-truncate-eqr85", Ye = {
|
|
124
|
+
root: zn,
|
|
125
|
+
h1: jn,
|
|
126
126
|
h2: _n,
|
|
127
|
-
h3:
|
|
128
|
-
h4:
|
|
127
|
+
h3: Yn,
|
|
128
|
+
h4: Un,
|
|
129
129
|
h5: Vn,
|
|
130
130
|
h6: qn,
|
|
131
131
|
p: Gn,
|
|
@@ -144,7 +144,7 @@ const jn = "crk-root-U-oiq", Xn = "crk-h1-Aivwz", _n = "crk-h2-CV8Oo", Un = "crk
|
|
|
144
144
|
alignCenter: lr,
|
|
145
145
|
alignRight: sr,
|
|
146
146
|
truncate: ar
|
|
147
|
-
}, dr =
|
|
147
|
+
}, dr = Ne(
|
|
148
148
|
({
|
|
149
149
|
variant: e = "p",
|
|
150
150
|
weight: t,
|
|
@@ -160,12 +160,12 @@ const jn = "crk-root-U-oiq", Xn = "crk-h1-Aivwz", _n = "crk-h2-CV8Oo", Un = "crk
|
|
|
160
160
|
{
|
|
161
161
|
ref: h,
|
|
162
162
|
className: m(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
t &&
|
|
166
|
-
n &&
|
|
167
|
-
r &&
|
|
168
|
-
o &&
|
|
163
|
+
Ye.root,
|
|
164
|
+
Ye[e],
|
|
165
|
+
t && Ye[t],
|
|
166
|
+
n && Ye[n],
|
|
167
|
+
r && Ye[`align-${r}`],
|
|
168
|
+
o && Ye.truncate,
|
|
169
169
|
c
|
|
170
170
|
),
|
|
171
171
|
style: i,
|
|
@@ -184,7 +184,7 @@ const ur = "crk-root-PVrgx", hr = "crk-unordered-FhCWT", mr = "crk-item-TfW82",
|
|
|
184
184
|
sm: gr,
|
|
185
185
|
md: yr,
|
|
186
186
|
lg: vr
|
|
187
|
-
}, br =
|
|
187
|
+
}, br = Ne(
|
|
188
188
|
({
|
|
189
189
|
variant: e = "unordered",
|
|
190
190
|
spacing: t = "md",
|
|
@@ -209,7 +209,7 @@ const ur = "crk-root-PVrgx", hr = "crk-unordered-FhCWT", mr = "crk-item-TfW82",
|
|
|
209
209
|
)
|
|
210
210
|
);
|
|
211
211
|
br.displayName = "List";
|
|
212
|
-
const xr =
|
|
212
|
+
const xr = Ne(
|
|
213
213
|
({ className: e, style: t, children: n, ...r }, o) => /* @__PURE__ */ s(
|
|
214
214
|
"li",
|
|
215
215
|
{
|
|
@@ -222,7 +222,7 @@ const xr = $e(
|
|
|
222
222
|
)
|
|
223
223
|
);
|
|
224
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", Rr = "crk-sortArrowActive-yhWrO", Sr = "crk-sortIndex-HGoca", Tr = "crk-row-H0wL1", Cr = "crk-cell-ZfnbG", Ar = "crk-emptyRow-AoPfj", Br = "crk-emptyCell-99-7C", Ir = "crk-striped-6Qckq", Dr = "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",
|
|
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", Rr = "crk-sortArrowActive-yhWrO", Sr = "crk-sortIndex-HGoca", Tr = "crk-row-H0wL1", Cr = "crk-cell-ZfnbG", Ar = "crk-emptyRow-AoPfj", Br = "crk-emptyCell-99-7C", Ir = "crk-striped-6Qckq", Dr = "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", Xr = "crk-pageButton-1PX-g", zr = "crk-pageButtonActive--D7Q7", jr = "crk-pageEllipsis-en59J", ve = {
|
|
226
226
|
wrapper: kr,
|
|
227
227
|
root: Mr,
|
|
228
228
|
headerCell: wr,
|
|
@@ -243,15 +243,15 @@ const kr = "crk-wrapper-zxjMt", Mr = "crk-root-Gf85-", wr = "crk-headerCell-ePPZ
|
|
|
243
243
|
paginatorText: Hr,
|
|
244
244
|
pageSizeSelect: Or,
|
|
245
245
|
paginatorNav: Fr,
|
|
246
|
-
pageButton:
|
|
247
|
-
pageButtonActive:
|
|
248
|
-
pageEllipsis:
|
|
246
|
+
pageButton: Xr,
|
|
247
|
+
pageButtonActive: zr,
|
|
248
|
+
pageEllipsis: jr
|
|
249
249
|
};
|
|
250
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
|
|
254
|
-
const [n, r] =
|
|
253
|
+
function Yr(e, t = []) {
|
|
254
|
+
const [n, r] = Re(t), o = pe((a) => {
|
|
255
255
|
r((h) => {
|
|
256
256
|
const u = h.find((d) => d.key === a);
|
|
257
257
|
return u ? u.direction === "asc" ? [{ key: a, direction: "desc" }] : [] : [{ key: a, direction: "asc" }];
|
|
@@ -279,8 +279,8 @@ function Ur(e, t = []) {
|
|
|
279
279
|
return 0;
|
|
280
280
|
}), [e, n]), sortConfig: n, requestSort: o, requestMultiSort: c, resetSort: i };
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
return /* @__PURE__ */
|
|
282
|
+
function Ur({ direction: e, sortIndex: t }) {
|
|
283
|
+
return /* @__PURE__ */ z("span", { className: ve.sortIndicator, "aria-hidden": "true", children: [
|
|
284
284
|
/* @__PURE__ */ s("span", { className: m(ve.sortArrow, e === "asc" && ve.sortArrowActive), children: "▲" }),
|
|
285
285
|
/* @__PURE__ */ s("span", { className: m(ve.sortArrow, e === "desc" && ve.sortArrowActive), children: "▼" }),
|
|
286
286
|
t !== void 0 && t >= 0 && /* @__PURE__ */ s("span", { className: ve.sortIndex, children: t + 1 })
|
|
@@ -306,8 +306,8 @@ function Vr({
|
|
|
306
306
|
}
|
|
307
307
|
return u;
|
|
308
308
|
}, [e, i]);
|
|
309
|
-
return /* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ z("nav", { className: m(ve.paginator, c?.paginator), "aria-label": "Table pagination", children: [
|
|
310
|
+
/* @__PURE__ */ z("div", { className: ve.paginatorInfo, children: [
|
|
311
311
|
/* @__PURE__ */ s("span", { className: ve.paginatorText, children: n > 0 ? `${l}–${a} of ${n}` : "No results" }),
|
|
312
312
|
r.length > 1 && /* @__PURE__ */ s(
|
|
313
313
|
"select",
|
|
@@ -316,14 +316,14 @@ function Vr({
|
|
|
316
316
|
value: t,
|
|
317
317
|
onChange: (u) => o(1, Number(u.target.value)),
|
|
318
318
|
"aria-label": "Rows per page",
|
|
319
|
-
children: r.map((u) => /* @__PURE__ */
|
|
319
|
+
children: r.map((u) => /* @__PURE__ */ z("option", { value: u, children: [
|
|
320
320
|
u,
|
|
321
321
|
" / page"
|
|
322
322
|
] }, u))
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
] }),
|
|
326
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ z("div", { className: ve.paginatorNav, children: [
|
|
327
327
|
/* @__PURE__ */ s(
|
|
328
328
|
"button",
|
|
329
329
|
{
|
|
@@ -383,29 +383,29 @@ function qr({
|
|
|
383
383
|
}) {
|
|
384
384
|
const R = r !== void 0, {
|
|
385
385
|
sortedData: w,
|
|
386
|
-
sortConfig:
|
|
386
|
+
sortConfig: Q,
|
|
387
387
|
requestSort: W,
|
|
388
|
-
requestMultiSort:
|
|
389
|
-
} =
|
|
390
|
-
if (!L || R) return
|
|
388
|
+
requestMultiSort: D
|
|
389
|
+
} = Yr(e, n), Z = R ? n ?? [] : Q, T = R ? e : w, $ = ke(() => {
|
|
390
|
+
if (!L || R) return T;
|
|
391
391
|
const S = (L.page - 1) * L.pageSize;
|
|
392
|
-
return
|
|
393
|
-
}, [
|
|
392
|
+
return T.slice(S, S + L.pageSize);
|
|
393
|
+
}, [T, L, R]), ie = L?.totalRows ?? T.length, ne = pe(
|
|
394
394
|
(S, re) => {
|
|
395
395
|
const F = o && (re.ctrlKey || re.metaKey);
|
|
396
396
|
if (R)
|
|
397
397
|
if (F) {
|
|
398
|
-
const
|
|
399
|
-
let
|
|
400
|
-
|
|
401
|
-
(
|
|
402
|
-
) :
|
|
398
|
+
const j = Z.findIndex((X) => X.key === S);
|
|
399
|
+
let C;
|
|
400
|
+
j === -1 ? C = [...Z, { key: S, direction: "asc" }] : Z[j].direction === "asc" ? C = Z.map(
|
|
401
|
+
(X, se) => se === j ? { key: S, direction: "desc" } : X
|
|
402
|
+
) : C = Z.filter((X, se) => se !== j), r(C);
|
|
403
403
|
} else {
|
|
404
|
-
const
|
|
405
|
-
|
|
404
|
+
const j = Z.find((C) => C.key === S);
|
|
405
|
+
j ? j.direction === "asc" ? r([{ key: S, direction: "desc" }]) : r([]) : r([{ key: S, direction: "asc" }]);
|
|
406
406
|
}
|
|
407
407
|
else
|
|
408
|
-
F ?
|
|
408
|
+
F ? D(S) : W(S);
|
|
409
409
|
},
|
|
410
410
|
[
|
|
411
411
|
R,
|
|
@@ -413,15 +413,15 @@ function qr({
|
|
|
413
413
|
Z,
|
|
414
414
|
r,
|
|
415
415
|
W,
|
|
416
|
-
|
|
416
|
+
D
|
|
417
417
|
]
|
|
418
|
-
), V = (S) => Z.find((F) => F.key === S)?.direction,
|
|
418
|
+
), V = (S) => Z.find((F) => F.key === S)?.direction, ue = (S) => {
|
|
419
419
|
if (Z.length <= 1) return;
|
|
420
420
|
const re = Z.findIndex((F) => F.key === S);
|
|
421
421
|
return re >= 0 ? re : void 0;
|
|
422
422
|
};
|
|
423
|
-
return /* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ z("div", { className: m(ve.wrapper, b?.wrapper), children: [
|
|
424
|
+
/* @__PURE__ */ z(
|
|
425
425
|
"table",
|
|
426
426
|
{
|
|
427
427
|
className: m(
|
|
@@ -434,7 +434,7 @@ function qr({
|
|
|
434
434
|
),
|
|
435
435
|
style: h,
|
|
436
436
|
children: [
|
|
437
|
-
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((S) => /* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((S) => /* @__PURE__ */ z(
|
|
438
438
|
"th",
|
|
439
439
|
{
|
|
440
440
|
className: m(
|
|
@@ -451,10 +451,10 @@ function qr({
|
|
|
451
451
|
children: [
|
|
452
452
|
S.header,
|
|
453
453
|
S.sortable && /* @__PURE__ */ s(
|
|
454
|
-
|
|
454
|
+
Ur,
|
|
455
455
|
{
|
|
456
456
|
direction: V(S.key),
|
|
457
|
-
sortIndex:
|
|
457
|
+
sortIndex: ue(S.key)
|
|
458
458
|
}
|
|
459
459
|
)
|
|
460
460
|
]
|
|
@@ -462,20 +462,20 @@ function qr({
|
|
|
462
462
|
S.key
|
|
463
463
|
)) }) }),
|
|
464
464
|
/* @__PURE__ */ s("tbody", { children: $.length === 0 ? /* @__PURE__ */ s("tr", { className: ve.emptyRow, children: /* @__PURE__ */ s("td", { className: m(ve.emptyCell, b?.emptyCell), colSpan: t.length, children: p }) }) : $.map((S, re) => {
|
|
465
|
-
const F = u ? String(S[u]) : re,
|
|
465
|
+
const F = u ? String(S[u]) : re, j = typeof d == "function" ? d(S, re) : d, C = typeof f == "function" ? f(S, re) : f;
|
|
466
466
|
return /* @__PURE__ */ s(
|
|
467
467
|
"tr",
|
|
468
468
|
{
|
|
469
|
-
className: m(ve.row, b?.row,
|
|
470
|
-
style:
|
|
471
|
-
children: t.map((
|
|
469
|
+
className: m(ve.row, b?.row, j),
|
|
470
|
+
style: C,
|
|
471
|
+
children: t.map((X) => /* @__PURE__ */ s(
|
|
472
472
|
"td",
|
|
473
473
|
{
|
|
474
474
|
className: m(ve.cell, b?.cell),
|
|
475
|
-
style: { textAlign:
|
|
476
|
-
children:
|
|
475
|
+
style: { textAlign: X.align },
|
|
476
|
+
children: X.render ? X.render(S[X.key], S, re) : S[X.key]
|
|
477
477
|
},
|
|
478
|
-
|
|
478
|
+
X.key
|
|
479
479
|
))
|
|
480
480
|
},
|
|
481
481
|
F
|
|
@@ -494,7 +494,7 @@ function qr({
|
|
|
494
494
|
)
|
|
495
495
|
] });
|
|
496
496
|
}
|
|
497
|
-
const El = 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", io = "crk-alignLeft-buCDJ", co = "crk-alignRight-05P9w", lo = "crk-item-f-Rhh", so = "crk-itemDisabled-L-d6i", ao = "crk-itemSelected-Fwmuo",
|
|
497
|
+
const El = 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", io = "crk-alignLeft-buCDJ", co = "crk-alignRight-05P9w", lo = "crk-item-f-Rhh", so = "crk-itemDisabled-L-d6i", ao = "crk-itemSelected-Fwmuo", we = {
|
|
498
498
|
root: Gr,
|
|
499
499
|
fullWidth: Zr,
|
|
500
500
|
trigger: Kr,
|
|
@@ -519,7 +519,7 @@ function St(e, t = !0) {
|
|
|
519
519
|
},
|
|
520
520
|
[e]
|
|
521
521
|
);
|
|
522
|
-
|
|
522
|
+
Le(() => {
|
|
523
523
|
if (t)
|
|
524
524
|
return document.addEventListener("keydown", n), () => {
|
|
525
525
|
document.removeEventListener("keydown", n);
|
|
@@ -527,8 +527,8 @@ function St(e, t = !0) {
|
|
|
527
527
|
}, [t, n]);
|
|
528
528
|
}
|
|
529
529
|
function Tt(e, t) {
|
|
530
|
-
const [n, r] =
|
|
531
|
-
return
|
|
530
|
+
const [n, r] = Re({ top: 0, left: 0, width: 0 });
|
|
531
|
+
return zt(() => {
|
|
532
532
|
if (!t) return;
|
|
533
533
|
const o = () => {
|
|
534
534
|
const c = e.current;
|
|
@@ -542,7 +542,7 @@ function Tt(e, t) {
|
|
|
542
542
|
};
|
|
543
543
|
}, [t, e]), n;
|
|
544
544
|
}
|
|
545
|
-
const Vt =
|
|
545
|
+
const Vt = Ne(
|
|
546
546
|
({
|
|
547
547
|
trigger: e,
|
|
548
548
|
children: t,
|
|
@@ -561,104 +561,104 @@ const Vt = $e(
|
|
|
561
561
|
portal: L = !0,
|
|
562
562
|
classes: b
|
|
563
563
|
}, R) => {
|
|
564
|
-
const [w,
|
|
565
|
-
|
|
566
|
-
w &&
|
|
564
|
+
const [w, Q] = Re(!1), W = oe(null), D = oe(null), Z = oe(null), T = Ue();
|
|
565
|
+
Le(() => {
|
|
566
|
+
w && D.current && D.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
|
|
567
567
|
}, [w]);
|
|
568
568
|
const $ = pe(() => {
|
|
569
|
-
|
|
569
|
+
Q(!1), l?.(), Z.current?.focus();
|
|
570
570
|
}, [l]), ie = pe(() => {
|
|
571
|
-
|
|
572
|
-
const
|
|
573
|
-
return
|
|
571
|
+
Q((C) => {
|
|
572
|
+
const X = !C;
|
|
573
|
+
return X ? i?.() : l?.(), X;
|
|
574
574
|
});
|
|
575
575
|
}, [i, l]), ne = pe(
|
|
576
|
-
(
|
|
577
|
-
d?.(
|
|
576
|
+
(C) => {
|
|
577
|
+
d?.(C), $();
|
|
578
578
|
},
|
|
579
579
|
[d, $]
|
|
580
580
|
);
|
|
581
|
-
|
|
581
|
+
Le(() => {
|
|
582
582
|
if (!w) return;
|
|
583
|
-
const
|
|
584
|
-
const
|
|
585
|
-
W.current?.contains(
|
|
583
|
+
const C = (X) => {
|
|
584
|
+
const se = X.target;
|
|
585
|
+
W.current?.contains(se) || D.current?.contains(se) || $();
|
|
586
586
|
};
|
|
587
|
-
return document.addEventListener("mousedown",
|
|
587
|
+
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
588
588
|
}, [w, $]), St(
|
|
589
589
|
{
|
|
590
590
|
Escape: () => $()
|
|
591
591
|
},
|
|
592
592
|
w
|
|
593
593
|
);
|
|
594
|
-
const V = Tt(Z, w && L),
|
|
594
|
+
const V = Tt(Z, w && L), ue = a?.find((C) => C.value === u)?.label, S = a ? ue || h : e, re = a && !ue, F = a ? a.map((C) => /* @__PURE__ */ s(
|
|
595
595
|
"button",
|
|
596
596
|
{
|
|
597
597
|
type: "button",
|
|
598
598
|
role: "menuitem",
|
|
599
599
|
className: m(
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
600
|
+
we.item,
|
|
601
|
+
C.disabled && we.itemDisabled,
|
|
602
|
+
C.value === u && we.itemSelected,
|
|
603
603
|
b?.item
|
|
604
604
|
),
|
|
605
|
-
disabled:
|
|
606
|
-
onClick: () => ne(
|
|
607
|
-
children:
|
|
605
|
+
disabled: C.disabled,
|
|
606
|
+
onClick: () => ne(C.value),
|
|
607
|
+
children: C.label
|
|
608
608
|
},
|
|
609
|
-
|
|
610
|
-
)) : t,
|
|
609
|
+
C.value
|
|
610
|
+
)) : t, j = (C) => /* @__PURE__ */ s(
|
|
611
611
|
"div",
|
|
612
612
|
{
|
|
613
|
-
ref:
|
|
614
|
-
id:
|
|
613
|
+
ref: D,
|
|
614
|
+
id: T,
|
|
615
615
|
className: m(
|
|
616
|
-
|
|
617
|
-
w &&
|
|
618
|
-
n === "left" ?
|
|
619
|
-
!L && p &&
|
|
616
|
+
we.menu,
|
|
617
|
+
w && we.menuOpen,
|
|
618
|
+
n === "left" ? we.alignLeft : we.alignRight,
|
|
619
|
+
!L && p && we.fullWidth,
|
|
620
620
|
b?.menu
|
|
621
621
|
),
|
|
622
|
-
style:
|
|
622
|
+
style: C,
|
|
623
623
|
role: "menu",
|
|
624
624
|
children: F
|
|
625
625
|
}
|
|
626
626
|
);
|
|
627
|
-
return /* @__PURE__ */
|
|
627
|
+
return /* @__PURE__ */ z(
|
|
628
628
|
"div",
|
|
629
629
|
{
|
|
630
630
|
ref: R,
|
|
631
|
-
className: m(
|
|
631
|
+
className: m(we.root, p && we.fullWidth, b?.root, r),
|
|
632
632
|
style: o,
|
|
633
633
|
children: [
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ z("div", { ref: W, style: p ? { width: "100%" } : void 0, children: [
|
|
635
|
+
/* @__PURE__ */ z(
|
|
636
636
|
"button",
|
|
637
637
|
{
|
|
638
638
|
ref: Z,
|
|
639
639
|
id: c,
|
|
640
640
|
type: "button",
|
|
641
641
|
className: m(
|
|
642
|
-
|
|
643
|
-
w &&
|
|
644
|
-
f &&
|
|
645
|
-
p &&
|
|
642
|
+
we.trigger,
|
|
643
|
+
w && we.triggerOpen,
|
|
644
|
+
f && we.triggerError,
|
|
645
|
+
p && we.fullWidth,
|
|
646
646
|
b?.trigger
|
|
647
647
|
),
|
|
648
648
|
onClick: ie,
|
|
649
649
|
"aria-expanded": w,
|
|
650
650
|
"aria-haspopup": "menu",
|
|
651
|
-
"aria-controls": w ?
|
|
651
|
+
"aria-controls": w ? T : void 0,
|
|
652
652
|
children: [
|
|
653
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
654
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
653
|
+
/* @__PURE__ */ s("span", { className: m(we.triggerLabel, re && we.placeholder, b?.triggerLabel), children: S }),
|
|
654
|
+
/* @__PURE__ */ s("span", { className: m(we.chevron, b?.chevron), "aria-hidden": "true" })
|
|
655
655
|
]
|
|
656
656
|
}
|
|
657
657
|
),
|
|
658
|
-
!L &&
|
|
658
|
+
!L && j()
|
|
659
659
|
] }),
|
|
660
660
|
L && w && typeof document < "u" && pt(
|
|
661
|
-
|
|
661
|
+
j({
|
|
662
662
|
position: "fixed",
|
|
663
663
|
top: V.top + 4,
|
|
664
664
|
left: n === "right" ? void 0 : V.left,
|
|
@@ -674,7 +674,7 @@ const Vt = $e(
|
|
|
674
674
|
}
|
|
675
675
|
);
|
|
676
676
|
Vt.displayName = "Dropdown";
|
|
677
|
-
const uo =
|
|
677
|
+
const uo = Ne(
|
|
678
678
|
({
|
|
679
679
|
disabled: e = !1,
|
|
680
680
|
className: t,
|
|
@@ -687,8 +687,8 @@ const uo = $e(
|
|
|
687
687
|
type: "button",
|
|
688
688
|
role: "menuitem",
|
|
689
689
|
className: m(
|
|
690
|
-
|
|
691
|
-
e &&
|
|
690
|
+
we.item,
|
|
691
|
+
e && we.itemDisabled,
|
|
692
692
|
t
|
|
693
693
|
),
|
|
694
694
|
disabled: e,
|
|
@@ -709,7 +709,7 @@ const ho = "crk-root-8H-L9", mo = "crk-trigger-Zn1nQ", fo = "crk-popover-rvS3X",
|
|
|
709
709
|
right: bo
|
|
710
710
|
};
|
|
711
711
|
function xo(e, t, n = !0) {
|
|
712
|
-
|
|
712
|
+
Le(() => {
|
|
713
713
|
if (!n) return;
|
|
714
714
|
const r = (o) => {
|
|
715
715
|
!e.current || e.current.contains(o.target) || t();
|
|
@@ -725,7 +725,7 @@ function ko(...e) {
|
|
|
725
725
|
n && (typeof n == "function" ? n(t) : n.current = t);
|
|
726
726
|
};
|
|
727
727
|
}
|
|
728
|
-
const qt =
|
|
728
|
+
const qt = Ne(
|
|
729
729
|
({
|
|
730
730
|
trigger: e,
|
|
731
731
|
asChild: t = !1,
|
|
@@ -737,38 +737,38 @@ const qt = $e(
|
|
|
737
737
|
className: l,
|
|
738
738
|
style: a
|
|
739
739
|
}, h) => {
|
|
740
|
-
const [u, d] =
|
|
741
|
-
(
|
|
742
|
-
R || d(
|
|
740
|
+
const [u, d] = Re(!1), f = oe(null), p = oe(null), L = oe(null), b = Ue(), R = o !== void 0, w = R ? o : u, Q = pe(
|
|
741
|
+
(T) => {
|
|
742
|
+
R || d(T), c?.(T);
|
|
743
743
|
},
|
|
744
744
|
[R, c]
|
|
745
745
|
), W = pe(() => {
|
|
746
|
-
|
|
747
|
-
}, [
|
|
748
|
-
|
|
749
|
-
}, [w,
|
|
746
|
+
Q(!1), L.current?.focus();
|
|
747
|
+
}, [Q]), D = pe(() => {
|
|
748
|
+
Q(!w);
|
|
749
|
+
}, [w, Q]);
|
|
750
750
|
xo(f, W, w), St(
|
|
751
751
|
{
|
|
752
752
|
Escape: () => W()
|
|
753
753
|
},
|
|
754
754
|
w
|
|
755
|
-
),
|
|
755
|
+
), Le(() => {
|
|
756
756
|
if (w && p.current) {
|
|
757
|
-
const
|
|
757
|
+
const T = p.current.querySelector(
|
|
758
758
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
759
759
|
);
|
|
760
|
-
|
|
760
|
+
T ? T.focus() : p.current.focus();
|
|
761
761
|
}
|
|
762
762
|
}, [w]);
|
|
763
763
|
let Z;
|
|
764
764
|
if (t && dn(e)) {
|
|
765
|
-
const
|
|
766
|
-
Z =
|
|
765
|
+
const T = e, $ = T.ref;
|
|
766
|
+
Z = jt(T, {
|
|
767
767
|
ref: ko(L, $),
|
|
768
768
|
onClick: (ie) => {
|
|
769
|
-
|
|
769
|
+
T.props.onClick?.(ie), D();
|
|
770
770
|
},
|
|
771
|
-
className: m(
|
|
771
|
+
className: m(T.props.className, i?.trigger),
|
|
772
772
|
"aria-expanded": w,
|
|
773
773
|
"aria-haspopup": "dialog",
|
|
774
774
|
"aria-controls": w ? b : void 0
|
|
@@ -780,7 +780,7 @@ const qt = $e(
|
|
|
780
780
|
ref: L,
|
|
781
781
|
type: "button",
|
|
782
782
|
className: m(at.trigger, i?.trigger),
|
|
783
|
-
onClick:
|
|
783
|
+
onClick: D,
|
|
784
784
|
"aria-expanded": w,
|
|
785
785
|
"aria-haspopup": "dialog",
|
|
786
786
|
"aria-controls": w ? b : void 0,
|
|
@@ -793,7 +793,7 @@ const qt = $e(
|
|
|
793
793
|
ref: h,
|
|
794
794
|
className: m(at.root, i?.root, l),
|
|
795
795
|
style: a,
|
|
796
|
-
children: /* @__PURE__ */
|
|
796
|
+
children: /* @__PURE__ */ z("div", { ref: f, children: [
|
|
797
797
|
Z,
|
|
798
798
|
w && /* @__PURE__ */ s(
|
|
799
799
|
"div",
|
|
@@ -837,7 +837,7 @@ function Mo(e, t) {
|
|
|
837
837
|
},
|
|
838
838
|
[e]
|
|
839
839
|
);
|
|
840
|
-
|
|
840
|
+
Le(() => {
|
|
841
841
|
if (!t || !e.current)
|
|
842
842
|
return;
|
|
843
843
|
n.current = document.activeElement;
|
|
@@ -847,7 +847,7 @@ function Mo(e, t) {
|
|
|
847
847
|
};
|
|
848
848
|
}, [t, e, r]);
|
|
849
849
|
}
|
|
850
|
-
const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yNG-7", Lo = "crk-modalIn-xFUwm", Ro = "crk-sm--xyY9", So = "crk-md-ETTfh", To = "crk-lg-5DBb7", Co = "crk-fullscreen-b4jQ-", Ao = "crk-header-NS30G", Bo = "crk-headerWithClose-4davm", Io = "crk-closeButton-JX-aq", Do = "crk-body-3zIj9", Eo = "crk-footer-Oyz-R",
|
|
850
|
+
const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yNG-7", Lo = "crk-modalIn-xFUwm", Ro = "crk-sm--xyY9", So = "crk-md-ETTfh", To = "crk-lg-5DBb7", Co = "crk-fullscreen-b4jQ-", Ao = "crk-header-NS30G", Bo = "crk-headerWithClose-4davm", Io = "crk-closeButton-JX-aq", Do = "crk-body-3zIj9", Eo = "crk-footer-Oyz-R", Xe = {
|
|
851
851
|
backdrop: wo,
|
|
852
852
|
backdropIn: $o,
|
|
853
853
|
modal: No,
|
|
@@ -863,11 +863,11 @@ const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yN
|
|
|
863
863
|
footer: Eo
|
|
864
864
|
}, gt = _t({ classes: {}, titleId: "" }), Gt = ({ children: e, className: t, style: n, onClose: r }) => {
|
|
865
865
|
const { classes: o, titleId: c } = ft(gt);
|
|
866
|
-
return /* @__PURE__ */
|
|
866
|
+
return /* @__PURE__ */ z(
|
|
867
867
|
"div",
|
|
868
868
|
{
|
|
869
869
|
id: c,
|
|
870
|
-
className: m(
|
|
870
|
+
className: m(Xe.header, r && Xe.headerWithClose, o.header, t),
|
|
871
871
|
style: n,
|
|
872
872
|
children: [
|
|
873
873
|
e,
|
|
@@ -875,7 +875,7 @@ const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yN
|
|
|
875
875
|
"button",
|
|
876
876
|
{
|
|
877
877
|
type: "button",
|
|
878
|
-
className: m(
|
|
878
|
+
className: m(Xe.closeButton, o.closeButton),
|
|
879
879
|
onClick: r,
|
|
880
880
|
"aria-label": "Close",
|
|
881
881
|
children: "×"
|
|
@@ -888,15 +888,15 @@ const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yN
|
|
|
888
888
|
Gt.displayName = "Modal.Header";
|
|
889
889
|
const Zt = ({ children: e, className: t, style: n }) => {
|
|
890
890
|
const { classes: r } = ft(gt);
|
|
891
|
-
return /* @__PURE__ */ s("div", { className: m(
|
|
891
|
+
return /* @__PURE__ */ s("div", { className: m(Xe.body, r.body, t), style: n, children: e });
|
|
892
892
|
};
|
|
893
893
|
Zt.displayName = "Modal.Body";
|
|
894
894
|
const Kt = ({ children: e, className: t, style: n }) => {
|
|
895
895
|
const { classes: r } = ft(gt);
|
|
896
|
-
return /* @__PURE__ */ s("div", { className: m(
|
|
896
|
+
return /* @__PURE__ */ s("div", { className: m(Xe.footer, r.footer, t), style: n, children: e });
|
|
897
897
|
};
|
|
898
898
|
Kt.displayName = "Modal.Footer";
|
|
899
|
-
const yt =
|
|
899
|
+
const yt = Ne(
|
|
900
900
|
({
|
|
901
901
|
open: e,
|
|
902
902
|
onClose: t,
|
|
@@ -910,7 +910,7 @@ const yt = $e(
|
|
|
910
910
|
"aria-label": h,
|
|
911
911
|
"aria-labelledby": u
|
|
912
912
|
}, d) => {
|
|
913
|
-
const f = oe(null), p = d ?? f, L =
|
|
913
|
+
const f = oe(null), p = d ?? f, L = Ue(), b = u ?? `${L}-title`;
|
|
914
914
|
Mo(p, e);
|
|
915
915
|
const R = ke(
|
|
916
916
|
() => ({
|
|
@@ -920,28 +920,28 @@ const yt = $e(
|
|
|
920
920
|
}),
|
|
921
921
|
[r, t]
|
|
922
922
|
);
|
|
923
|
-
St(R, e),
|
|
923
|
+
St(R, e), Le(() => {
|
|
924
924
|
if (!e) return;
|
|
925
|
-
const
|
|
925
|
+
const Q = document.body.style.overflow;
|
|
926
926
|
return document.body.style.overflow = "hidden", () => {
|
|
927
|
-
document.body.style.overflow =
|
|
927
|
+
document.body.style.overflow = Q;
|
|
928
928
|
};
|
|
929
929
|
}, [e]);
|
|
930
|
-
const w = (
|
|
931
|
-
n &&
|
|
930
|
+
const w = (Q) => {
|
|
931
|
+
n && Q.target === Q.currentTarget && t();
|
|
932
932
|
};
|
|
933
933
|
return e ? pt(
|
|
934
934
|
/* @__PURE__ */ s(
|
|
935
935
|
"div",
|
|
936
936
|
{
|
|
937
|
-
className: m(
|
|
937
|
+
className: m(Xe.backdrop, c?.backdrop),
|
|
938
938
|
onClick: w,
|
|
939
939
|
role: "presentation",
|
|
940
940
|
children: /* @__PURE__ */ s(
|
|
941
941
|
"div",
|
|
942
942
|
{
|
|
943
943
|
ref: p,
|
|
944
|
-
className: m(
|
|
944
|
+
className: m(Xe.modal, Xe[o], c?.modal, i),
|
|
945
945
|
style: l,
|
|
946
946
|
role: "dialog",
|
|
947
947
|
"aria-modal": "true",
|
|
@@ -960,17 +960,17 @@ yt.displayName = "Modal";
|
|
|
960
960
|
yt.Header = Gt;
|
|
961
961
|
yt.Body = Zt;
|
|
962
962
|
yt.Footer = Kt;
|
|
963
|
-
const Po = "crk-root-jHIIP", Wo = "crk-formErrors-eh-OP", Ho = "crk-formError-XEuWv", Oo = "crk-field-OUlYz", Fo = "crk-label-udkR7",
|
|
963
|
+
const Po = "crk-root-jHIIP", Wo = "crk-formErrors-eh-OP", Ho = "crk-formError-XEuWv", Oo = "crk-field-OUlYz", Fo = "crk-label-udkR7", Xo = "crk-labelError-LOgKi", zo = "crk-required-IYiA2", jo = "crk-error-yFZXm", _o = "crk-helperText-Dm-rb", Yo = "crk-row-nNbx-", We = {
|
|
964
964
|
root: Po,
|
|
965
965
|
formErrors: Wo,
|
|
966
966
|
formError: Ho,
|
|
967
967
|
field: Oo,
|
|
968
968
|
label: Fo,
|
|
969
|
-
labelError:
|
|
970
|
-
required:
|
|
971
|
-
error:
|
|
969
|
+
labelError: Xo,
|
|
970
|
+
required: zo,
|
|
971
|
+
error: jo,
|
|
972
972
|
helperText: _o,
|
|
973
|
-
row:
|
|
973
|
+
row: Yo
|
|
974
974
|
};
|
|
975
975
|
function Pl({
|
|
976
976
|
form: e,
|
|
@@ -981,7 +981,7 @@ function Pl({
|
|
|
981
981
|
children: c
|
|
982
982
|
}) {
|
|
983
983
|
const i = n && n.length > 0;
|
|
984
|
-
return /* @__PURE__ */ s(hn, { ...e, children: /* @__PURE__ */
|
|
984
|
+
return /* @__PURE__ */ s(hn, { ...e, children: /* @__PURE__ */ z(
|
|
985
985
|
"form",
|
|
986
986
|
{
|
|
987
987
|
onSubmit: e.handleSubmit(t),
|
|
@@ -994,7 +994,7 @@ function Pl({
|
|
|
994
994
|
}
|
|
995
995
|
) });
|
|
996
996
|
}
|
|
997
|
-
const
|
|
997
|
+
const Uo = /* @__PURE__ */ new Set([
|
|
998
998
|
"Select",
|
|
999
999
|
"NativeSelect",
|
|
1000
1000
|
"SearchableSelect",
|
|
@@ -1012,27 +1012,27 @@ function Wl({
|
|
|
1012
1012
|
style: l,
|
|
1013
1013
|
children: a
|
|
1014
1014
|
}) {
|
|
1015
|
-
const { control: h } = mn(), { field: u, fieldState: d } = fn({ name: e, control: h, rules: o }), f = a.type, p = typeof f == "string" ? "" : f?.displayName ?? f?.name ?? "", L =
|
|
1015
|
+
const { control: h } = mn(), { field: u, fieldState: d } = fn({ name: e, control: h, rules: o }), f = a.type, p = typeof f == "string" ? "" : f?.displayName ?? f?.name ?? "", L = Uo.has(p), { ref: b, ...R } = u, w = oe(b);
|
|
1016
1016
|
w.current = b;
|
|
1017
|
-
const
|
|
1017
|
+
const Q = pe(
|
|
1018
1018
|
(W) => {
|
|
1019
1019
|
if (W) {
|
|
1020
|
-
const
|
|
1021
|
-
w.current(
|
|
1020
|
+
const D = W.matches("input, select, textarea, button, [tabindex]") ? W : W.querySelector('input, select, textarea, button, [tabindex]:not([tabindex="-1"])');
|
|
1021
|
+
w.current(D ?? W);
|
|
1022
1022
|
} else
|
|
1023
1023
|
w.current(null);
|
|
1024
1024
|
},
|
|
1025
1025
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1026
1026
|
[]
|
|
1027
1027
|
);
|
|
1028
|
-
return /* @__PURE__ */
|
|
1029
|
-
t && /* @__PURE__ */
|
|
1028
|
+
return /* @__PURE__ */ z("div", { className: m(We.field, c?.field, i), style: l, children: [
|
|
1029
|
+
t && /* @__PURE__ */ z("label", { className: m(We.label, d.error && We.labelError, c?.label), htmlFor: e, children: [
|
|
1030
1030
|
t,
|
|
1031
1031
|
r && /* @__PURE__ */ s("span", { className: We.required, children: "*" })
|
|
1032
1032
|
] }),
|
|
1033
|
-
|
|
1033
|
+
jt(a, {
|
|
1034
1034
|
...R,
|
|
1035
|
-
ref:
|
|
1035
|
+
ref: Q,
|
|
1036
1036
|
id: e,
|
|
1037
1037
|
error: !!d.error,
|
|
1038
1038
|
"aria-invalid": d.error ? !0 : void 0,
|
|
@@ -1064,7 +1064,7 @@ const Vo = "crk-root-rSgdy", qo = "crk-wrapper-GHy8V", Go = "crk-sm-DptM5", Zo =
|
|
|
1064
1064
|
suffix: ei,
|
|
1065
1065
|
hasPrefix: ti,
|
|
1066
1066
|
hasSuffix: ni
|
|
1067
|
-
}, ri =
|
|
1067
|
+
}, ri = Ne(
|
|
1068
1068
|
({
|
|
1069
1069
|
inputSize: e = "md",
|
|
1070
1070
|
error: t = !1,
|
|
@@ -1092,7 +1092,7 @@ const Vo = "crk-root-rSgdy", qo = "crk-wrapper-GHy8V", Go = "crk-sm-DptM5", Zo =
|
|
|
1092
1092
|
...l
|
|
1093
1093
|
}
|
|
1094
1094
|
);
|
|
1095
|
-
return n || r ? /* @__PURE__ */
|
|
1095
|
+
return n || r ? /* @__PURE__ */ z(
|
|
1096
1096
|
"div",
|
|
1097
1097
|
{
|
|
1098
1098
|
className: m(Pe.wrapper, Pe[e], t && Pe.error, o?.wrapper, c),
|
|
@@ -1140,7 +1140,7 @@ const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "
|
|
|
1140
1140
|
multiSearch: Ii,
|
|
1141
1141
|
arrowMulti: Di,
|
|
1142
1142
|
itemCheck: Ei
|
|
1143
|
-
}, Qt =
|
|
1143
|
+
}, Qt = Ne(
|
|
1144
1144
|
({
|
|
1145
1145
|
inputSize: e = "md",
|
|
1146
1146
|
error: t = !1,
|
|
@@ -1154,8 +1154,8 @@ const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "
|
|
|
1154
1154
|
searchPlaceholder: h,
|
|
1155
1155
|
onValueChange: u,
|
|
1156
1156
|
...d
|
|
1157
|
-
}, f) => /* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1157
|
+
}, f) => /* @__PURE__ */ z("div", { className: m(P.wrapper, P[e], t && P.error, o?.wrapper, c), style: i, children: [
|
|
1158
|
+
/* @__PURE__ */ z(
|
|
1159
1159
|
"select",
|
|
1160
1160
|
{
|
|
1161
1161
|
ref: f,
|
|
@@ -1171,7 +1171,7 @@ const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "
|
|
|
1171
1171
|
] })
|
|
1172
1172
|
);
|
|
1173
1173
|
Qt.displayName = "NativeSelect";
|
|
1174
|
-
const Jt =
|
|
1174
|
+
const Jt = Ne(
|
|
1175
1175
|
({
|
|
1176
1176
|
inputSize: e = "md",
|
|
1177
1177
|
error: t = !1,
|
|
@@ -1188,15 +1188,15 @@ const Jt = $e(
|
|
|
1188
1188
|
onValueChange: f,
|
|
1189
1189
|
portal: p = !0
|
|
1190
1190
|
}, L) => {
|
|
1191
|
-
const [b, R] =
|
|
1192
|
-
|
|
1191
|
+
const [b, R] = Re(!1), [w, Q] = Re(""), [W, D] = Re(0), Z = oe(null), T = oe(null), $ = oe(null), ie = oe(null), ne = oe(null), V = Ue(), ue = Tt($, b && p), S = oe(null), re = L ?? S, F = oe(!1);
|
|
1192
|
+
Le(() => {
|
|
1193
1193
|
F.current && !b && $.current?.focus(), F.current = b;
|
|
1194
1194
|
}, [b]);
|
|
1195
|
-
const
|
|
1196
|
-
R(!1),
|
|
1197
|
-
}, []),
|
|
1198
|
-
a || (R(!0),
|
|
1199
|
-
}, [a]),
|
|
1195
|
+
const j = pe(() => {
|
|
1196
|
+
R(!1), Q(""), D(0);
|
|
1197
|
+
}, []), C = pe(() => {
|
|
1198
|
+
a || (R(!0), Q(""), D(0), setTimeout(() => T.current?.focus(), 0));
|
|
1199
|
+
}, [a]), X = pe(
|
|
1200
1200
|
(N) => {
|
|
1201
1201
|
if (f?.(N), re.current) {
|
|
1202
1202
|
Object.getOwnPropertyDescriptor(
|
|
@@ -1206,18 +1206,18 @@ const Jt = $e(
|
|
|
1206
1206
|
const v = new Event("change", { bubbles: !0 });
|
|
1207
1207
|
re.current.dispatchEvent(v), d?.(v);
|
|
1208
1208
|
}
|
|
1209
|
-
|
|
1209
|
+
j();
|
|
1210
1210
|
},
|
|
1211
|
-
[f, d, re,
|
|
1212
|
-
),
|
|
1211
|
+
[f, d, re, j]
|
|
1212
|
+
), se = ke(() => {
|
|
1213
1213
|
if (!w) return n;
|
|
1214
1214
|
const N = w.toLowerCase();
|
|
1215
1215
|
return n.filter((y) => y.label.toLowerCase().includes(N));
|
|
1216
1216
|
}, [n, w]);
|
|
1217
|
-
|
|
1218
|
-
const N =
|
|
1219
|
-
|
|
1220
|
-
}, [
|
|
1217
|
+
Le(() => {
|
|
1218
|
+
const N = se.findIndex((y) => !y.disabled);
|
|
1219
|
+
D(N >= 0 ? N : 0);
|
|
1220
|
+
}, [se]), Le(() => {
|
|
1221
1221
|
if (!b) return;
|
|
1222
1222
|
const N = ne.current;
|
|
1223
1223
|
if (!N) return;
|
|
@@ -1225,36 +1225,36 @@ const Jt = $e(
|
|
|
1225
1225
|
}, [W, b]);
|
|
1226
1226
|
const me = pe(
|
|
1227
1227
|
(N) => {
|
|
1228
|
-
const y =
|
|
1228
|
+
const y = se.map((v, A) => v.disabled ? -1 : A).filter((v) => v >= 0);
|
|
1229
1229
|
if (y.length !== 0)
|
|
1230
1230
|
if (N.key === "ArrowDown")
|
|
1231
|
-
N.preventDefault(),
|
|
1232
|
-
const
|
|
1233
|
-
return
|
|
1231
|
+
N.preventDefault(), D((v) => {
|
|
1232
|
+
const A = y.indexOf(v);
|
|
1233
|
+
return A < y.length - 1 ? y[A + 1] : y[0];
|
|
1234
1234
|
});
|
|
1235
1235
|
else if (N.key === "ArrowUp")
|
|
1236
|
-
N.preventDefault(),
|
|
1237
|
-
const
|
|
1238
|
-
return
|
|
1236
|
+
N.preventDefault(), D((v) => {
|
|
1237
|
+
const A = y.indexOf(v);
|
|
1238
|
+
return A > 0 ? y[A - 1] : y[y.length - 1];
|
|
1239
1239
|
});
|
|
1240
1240
|
else if (N.key === "Enter") {
|
|
1241
1241
|
N.preventDefault();
|
|
1242
|
-
const v =
|
|
1243
|
-
v && !v.disabled &&
|
|
1244
|
-
} else N.key === "Escape" && (N.preventDefault(),
|
|
1242
|
+
const v = se[W];
|
|
1243
|
+
v && !v.disabled && X(v.value);
|
|
1244
|
+
} else N.key === "Escape" && (N.preventDefault(), j());
|
|
1245
1245
|
},
|
|
1246
|
-
[
|
|
1246
|
+
[se, W, X, j]
|
|
1247
1247
|
);
|
|
1248
|
-
|
|
1248
|
+
Le(() => {
|
|
1249
1249
|
if (!b) return;
|
|
1250
1250
|
const N = (y) => {
|
|
1251
1251
|
const v = y.target;
|
|
1252
|
-
Z.current?.contains(v) || ie.current?.contains(v) ||
|
|
1252
|
+
Z.current?.contains(v) || ie.current?.contains(v) || j();
|
|
1253
1253
|
};
|
|
1254
1254
|
return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
1255
|
-
}, [b,
|
|
1256
|
-
const K = n.find((N) => N.value === l)?.label, H =
|
|
1257
|
-
return /* @__PURE__ */
|
|
1255
|
+
}, [b, j]);
|
|
1256
|
+
const K = n.find((N) => N.value === l)?.label, H = se.filter((N) => !N.disabled);
|
|
1257
|
+
return /* @__PURE__ */ z(
|
|
1258
1258
|
"div",
|
|
1259
1259
|
{
|
|
1260
1260
|
ref: Z,
|
|
@@ -1283,7 +1283,7 @@ const Jt = $e(
|
|
|
1283
1283
|
children: n.map((N) => /* @__PURE__ */ s("option", { value: N.value, children: N.label }, N.value))
|
|
1284
1284
|
}
|
|
1285
1285
|
),
|
|
1286
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ z(
|
|
1287
1287
|
"button",
|
|
1288
1288
|
{
|
|
1289
1289
|
ref: $,
|
|
@@ -1298,7 +1298,7 @@ const Jt = $e(
|
|
|
1298
1298
|
b && P.visuallyHidden,
|
|
1299
1299
|
o?.root
|
|
1300
1300
|
),
|
|
1301
|
-
onClick:
|
|
1301
|
+
onClick: C,
|
|
1302
1302
|
disabled: a,
|
|
1303
1303
|
"aria-expanded": b,
|
|
1304
1304
|
"aria-haspopup": "listbox",
|
|
@@ -1312,7 +1312,7 @@ const Jt = $e(
|
|
|
1312
1312
|
b && /* @__PURE__ */ s(
|
|
1313
1313
|
"input",
|
|
1314
1314
|
{
|
|
1315
|
-
ref:
|
|
1315
|
+
ref: T,
|
|
1316
1316
|
type: "text",
|
|
1317
1317
|
role: "combobox",
|
|
1318
1318
|
className: m(
|
|
@@ -1326,21 +1326,21 @@ const Jt = $e(
|
|
|
1326
1326
|
),
|
|
1327
1327
|
placeholder: K || r,
|
|
1328
1328
|
value: w,
|
|
1329
|
-
onChange: (N) =>
|
|
1329
|
+
onChange: (N) => Q(N.target.value),
|
|
1330
1330
|
onKeyDown: me,
|
|
1331
1331
|
"aria-expanded": !0,
|
|
1332
1332
|
"aria-haspopup": "listbox",
|
|
1333
1333
|
"aria-controls": V,
|
|
1334
|
-
"aria-activedescendant": H.length > 0 ? `select-option-${
|
|
1334
|
+
"aria-activedescendant": H.length > 0 ? `select-option-${se[W]?.value}` : void 0
|
|
1335
1335
|
}
|
|
1336
1336
|
),
|
|
1337
1337
|
b && (() => {
|
|
1338
1338
|
const N = p ? {
|
|
1339
1339
|
position: "fixed",
|
|
1340
|
-
top:
|
|
1341
|
-
left:
|
|
1340
|
+
top: ue.top + 4,
|
|
1341
|
+
left: ue.left,
|
|
1342
1342
|
right: "auto",
|
|
1343
|
-
width:
|
|
1343
|
+
width: ue.width,
|
|
1344
1344
|
zIndex: "var(--crk-z-floating)"
|
|
1345
1345
|
} : void 0, y = /* @__PURE__ */ s(
|
|
1346
1346
|
"div",
|
|
@@ -1350,7 +1350,7 @@ const Jt = $e(
|
|
|
1350
1350
|
className: m(P.menu, o?.menu),
|
|
1351
1351
|
style: N,
|
|
1352
1352
|
role: "listbox",
|
|
1353
|
-
children: /* @__PURE__ */ s("div", { className: P.menuItems, ref: ne, children:
|
|
1353
|
+
children: /* @__PURE__ */ s("div", { className: P.menuItems, ref: ne, children: se.length === 0 ? /* @__PURE__ */ s("div", { className: P.noResults, children: "No results" }) : se.map((v, A) => /* @__PURE__ */ s(
|
|
1354
1354
|
"button",
|
|
1355
1355
|
{
|
|
1356
1356
|
id: `select-option-${v.value}`,
|
|
@@ -1361,12 +1361,12 @@ const Jt = $e(
|
|
|
1361
1361
|
P.item,
|
|
1362
1362
|
v.disabled && P.itemDisabled,
|
|
1363
1363
|
v.value === l && P.itemSelected,
|
|
1364
|
-
|
|
1364
|
+
A === W && P.itemHighlighted,
|
|
1365
1365
|
o?.item
|
|
1366
1366
|
),
|
|
1367
1367
|
disabled: v.disabled,
|
|
1368
|
-
onClick: () =>
|
|
1369
|
-
onMouseEnter: () =>
|
|
1368
|
+
onClick: () => X(v.value),
|
|
1369
|
+
onMouseEnter: () => D(A),
|
|
1370
1370
|
children: v.content ?? v.label
|
|
1371
1371
|
},
|
|
1372
1372
|
v.value
|
|
@@ -1381,7 +1381,7 @@ const Jt = $e(
|
|
|
1381
1381
|
}
|
|
1382
1382
|
);
|
|
1383
1383
|
Jt.displayName = "SearchableSelect";
|
|
1384
|
-
const en =
|
|
1384
|
+
const en = Ne(
|
|
1385
1385
|
({
|
|
1386
1386
|
inputSize: e = "md",
|
|
1387
1387
|
error: t = !1,
|
|
@@ -1401,11 +1401,11 @@ const en = $e(
|
|
|
1401
1401
|
onCreate: b,
|
|
1402
1402
|
createLabel: R,
|
|
1403
1403
|
portal: w = !0
|
|
1404
|
-
},
|
|
1405
|
-
const W = Array.isArray(l) ? l : l ? [l] : [], [
|
|
1404
|
+
}, Q) => {
|
|
1405
|
+
const W = Array.isArray(l) ? l : l ? [l] : [], [D, Z] = Re(!1), [T, $] = Re(""), [ie, ne] = Re(0), V = oe(null), ue = oe(null), S = oe(null), re = oe(null), F = oe(null), j = Ue(), C = Tt(F, D && w), X = oe(null), se = Q ?? X, me = pe(() => {
|
|
1406
1406
|
Z(!1), $(""), ne(0);
|
|
1407
1407
|
}, []), K = pe(() => {
|
|
1408
|
-
a || (Z(!0), $(""), ne(0), setTimeout(() =>
|
|
1408
|
+
a || (Z(!0), $(""), ne(0), setTimeout(() => ue.current?.focus(), 0));
|
|
1409
1409
|
}, [a]), H = pe(
|
|
1410
1410
|
(k) => {
|
|
1411
1411
|
const G = W.includes(k) ? W.filter((O) => O !== k) : [...W, k];
|
|
@@ -1418,66 +1418,66 @@ const en = $e(
|
|
|
1418
1418
|
},
|
|
1419
1419
|
[W, d]
|
|
1420
1420
|
), y = ke(() => {
|
|
1421
|
-
if (!
|
|
1422
|
-
const k =
|
|
1421
|
+
if (!T) return n;
|
|
1422
|
+
const k = T.toLowerCase();
|
|
1423
1423
|
return n.filter((G) => G.label.toLowerCase().includes(k));
|
|
1424
|
-
}, [n,
|
|
1424
|
+
}, [n, T]), v = T.trim(), A = L && v.length > 0 && !n.some(
|
|
1425
1425
|
(k) => k.label.toLowerCase() === v.toLowerCase() || k.value === v
|
|
1426
1426
|
) && !W.includes(v), _ = pe(() => {
|
|
1427
1427
|
v && (W.includes(v) || (b?.(v), d?.([...W, v]), p ? me() : f && $("")));
|
|
1428
1428
|
}, [v, W, b, d, p, me, f]);
|
|
1429
|
-
|
|
1429
|
+
Le(() => {
|
|
1430
1430
|
const k = y.findIndex((G) => !G.disabled);
|
|
1431
1431
|
ne(k >= 0 ? k : 0);
|
|
1432
|
-
}, [y]),
|
|
1433
|
-
if (!
|
|
1432
|
+
}, [y]), Le(() => {
|
|
1433
|
+
if (!D) return;
|
|
1434
1434
|
const k = re.current;
|
|
1435
1435
|
if (!k) return;
|
|
1436
1436
|
k.querySelectorAll('[role="option"]')[ie]?.scrollIntoView?.({ block: "nearest" });
|
|
1437
|
-
}, [ie,
|
|
1438
|
-
const q = y.length,
|
|
1437
|
+
}, [ie, D]);
|
|
1438
|
+
const q = y.length, Y = pe(
|
|
1439
1439
|
(k) => {
|
|
1440
|
-
const G = y.map((O,
|
|
1441
|
-
if (
|
|
1440
|
+
const G = y.map((O, de) => O.disabled ? -1 : de).filter((O) => O >= 0);
|
|
1441
|
+
if (A && G.push(q), k.key === "Backspace" && T === "" && W.length > 0) {
|
|
1442
1442
|
k.preventDefault(), d?.(W.slice(0, -1));
|
|
1443
1443
|
return;
|
|
1444
1444
|
}
|
|
1445
1445
|
if (G.length !== 0)
|
|
1446
1446
|
if (k.key === "ArrowDown") {
|
|
1447
|
-
if (k.preventDefault(), !
|
|
1447
|
+
if (k.preventDefault(), !D) {
|
|
1448
1448
|
K();
|
|
1449
1449
|
return;
|
|
1450
1450
|
}
|
|
1451
1451
|
ne((O) => {
|
|
1452
|
-
const
|
|
1453
|
-
return
|
|
1452
|
+
const de = G.indexOf(O);
|
|
1453
|
+
return de < G.length - 1 ? G[de + 1] : G[0];
|
|
1454
1454
|
});
|
|
1455
1455
|
} else if (k.key === "ArrowUp")
|
|
1456
1456
|
k.preventDefault(), ne((O) => {
|
|
1457
|
-
const
|
|
1458
|
-
return
|
|
1457
|
+
const de = G.indexOf(O);
|
|
1458
|
+
return de > 0 ? G[de - 1] : G[G.length - 1];
|
|
1459
1459
|
});
|
|
1460
1460
|
else if (k.key === "Enter") {
|
|
1461
|
-
if (k.preventDefault(),
|
|
1461
|
+
if (k.preventDefault(), A && ie === q) {
|
|
1462
1462
|
_();
|
|
1463
1463
|
return;
|
|
1464
1464
|
}
|
|
1465
1465
|
const O = y[ie];
|
|
1466
|
-
O && !O.disabled ? H(O.value) :
|
|
1466
|
+
O && !O.disabled ? H(O.value) : A && _();
|
|
1467
1467
|
} else k.key === "Escape" && (k.preventDefault(), me());
|
|
1468
1468
|
},
|
|
1469
|
-
[y, ie, H, me,
|
|
1469
|
+
[y, ie, H, me, T, W, d, D, K, A, _, q]
|
|
1470
1470
|
);
|
|
1471
|
-
|
|
1472
|
-
if (!
|
|
1471
|
+
Le(() => {
|
|
1472
|
+
if (!D) return;
|
|
1473
1473
|
const k = (G) => {
|
|
1474
1474
|
const O = G.target;
|
|
1475
1475
|
V.current?.contains(O) || S.current?.contains(O) || me();
|
|
1476
1476
|
};
|
|
1477
1477
|
return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
|
|
1478
|
-
}, [
|
|
1479
|
-
const
|
|
1480
|
-
return /* @__PURE__ */
|
|
1478
|
+
}, [D, me]);
|
|
1479
|
+
const J = W.map((k) => n.find((O) => O.value === k) ?? { value: k, label: k });
|
|
1480
|
+
return /* @__PURE__ */ z(
|
|
1481
1481
|
"div",
|
|
1482
1482
|
{
|
|
1483
1483
|
ref: V,
|
|
@@ -1495,7 +1495,7 @@ const en = $e(
|
|
|
1495
1495
|
/* @__PURE__ */ s(
|
|
1496
1496
|
"select",
|
|
1497
1497
|
{
|
|
1498
|
-
ref:
|
|
1498
|
+
ref: se,
|
|
1499
1499
|
className: P.hiddenSelect,
|
|
1500
1500
|
multiple: !0,
|
|
1501
1501
|
value: W,
|
|
@@ -1507,27 +1507,27 @@ const en = $e(
|
|
|
1507
1507
|
children: n.map((k) => /* @__PURE__ */ s("option", { value: k.value, children: k.label }, k.value))
|
|
1508
1508
|
}
|
|
1509
1509
|
),
|
|
1510
|
-
/* @__PURE__ */
|
|
1510
|
+
/* @__PURE__ */ z(
|
|
1511
1511
|
"div",
|
|
1512
1512
|
{
|
|
1513
1513
|
ref: F,
|
|
1514
1514
|
className: m(
|
|
1515
1515
|
P.multiTrigger,
|
|
1516
1516
|
P[e],
|
|
1517
|
-
|
|
1517
|
+
D && P.triggerOpen,
|
|
1518
1518
|
t && P.error,
|
|
1519
1519
|
a && P.multiTriggerDisabled,
|
|
1520
1520
|
o?.root
|
|
1521
1521
|
),
|
|
1522
1522
|
onClick: () => {
|
|
1523
|
-
|
|
1523
|
+
D ? ue.current?.focus() : K();
|
|
1524
1524
|
},
|
|
1525
1525
|
role: "combobox",
|
|
1526
|
-
"aria-expanded":
|
|
1526
|
+
"aria-expanded": D,
|
|
1527
1527
|
"aria-haspopup": "listbox",
|
|
1528
|
-
"aria-controls":
|
|
1528
|
+
"aria-controls": D ? j : void 0,
|
|
1529
1529
|
children: [
|
|
1530
|
-
|
|
1530
|
+
J.map((k) => /* @__PURE__ */ z("span", { className: m(P.chip, o?.chip), children: [
|
|
1531
1531
|
/* @__PURE__ */ s("span", { className: P.chipLabel, children: k.content ?? k.label }),
|
|
1532
1532
|
/* @__PURE__ */ s(
|
|
1533
1533
|
"button",
|
|
@@ -1544,16 +1544,16 @@ const en = $e(
|
|
|
1544
1544
|
/* @__PURE__ */ s(
|
|
1545
1545
|
"input",
|
|
1546
1546
|
{
|
|
1547
|
-
ref:
|
|
1547
|
+
ref: ue,
|
|
1548
1548
|
id: h,
|
|
1549
1549
|
type: "text",
|
|
1550
1550
|
className: P.multiSearch,
|
|
1551
1551
|
placeholder: W.length === 0 ? r : "",
|
|
1552
|
-
value:
|
|
1552
|
+
value: T,
|
|
1553
1553
|
onChange: (k) => {
|
|
1554
|
-
$(k.target.value),
|
|
1554
|
+
$(k.target.value), D || K();
|
|
1555
1555
|
},
|
|
1556
|
-
onKeyDown:
|
|
1556
|
+
onKeyDown: Y,
|
|
1557
1557
|
disabled: a,
|
|
1558
1558
|
"aria-label": "Search options"
|
|
1559
1559
|
}
|
|
@@ -1562,28 +1562,28 @@ const en = $e(
|
|
|
1562
1562
|
]
|
|
1563
1563
|
}
|
|
1564
1564
|
),
|
|
1565
|
-
|
|
1565
|
+
D && (() => {
|
|
1566
1566
|
const k = w ? {
|
|
1567
1567
|
position: "fixed",
|
|
1568
|
-
top:
|
|
1569
|
-
left:
|
|
1568
|
+
top: C.top + 4,
|
|
1569
|
+
left: C.left,
|
|
1570
1570
|
right: "auto",
|
|
1571
|
-
width:
|
|
1571
|
+
width: C.width,
|
|
1572
1572
|
zIndex: "var(--crk-z-floating)"
|
|
1573
1573
|
} : void 0, G = /* @__PURE__ */ s(
|
|
1574
1574
|
"div",
|
|
1575
1575
|
{
|
|
1576
|
-
id:
|
|
1576
|
+
id: j,
|
|
1577
1577
|
ref: S,
|
|
1578
1578
|
className: m(P.menu, o?.menu),
|
|
1579
1579
|
style: k,
|
|
1580
1580
|
role: "listbox",
|
|
1581
1581
|
"aria-multiselectable": "true",
|
|
1582
|
-
children: /* @__PURE__ */
|
|
1583
|
-
y.length === 0 && !
|
|
1584
|
-
y.map((O,
|
|
1582
|
+
children: /* @__PURE__ */ z("div", { className: P.menuItems, ref: re, children: [
|
|
1583
|
+
y.length === 0 && !A && /* @__PURE__ */ s("div", { className: P.noResults, children: "No results" }),
|
|
1584
|
+
y.map((O, de) => {
|
|
1585
1585
|
const ge = W.includes(O.value);
|
|
1586
|
-
return /* @__PURE__ */
|
|
1586
|
+
return /* @__PURE__ */ z(
|
|
1587
1587
|
"button",
|
|
1588
1588
|
{
|
|
1589
1589
|
id: `select-option-${O.value}`,
|
|
@@ -1594,12 +1594,12 @@ const en = $e(
|
|
|
1594
1594
|
P.item,
|
|
1595
1595
|
O.disabled && P.itemDisabled,
|
|
1596
1596
|
ge && P.itemSelected,
|
|
1597
|
-
|
|
1597
|
+
de === ie && P.itemHighlighted,
|
|
1598
1598
|
o?.item
|
|
1599
1599
|
),
|
|
1600
1600
|
disabled: O.disabled,
|
|
1601
1601
|
onClick: () => H(O.value),
|
|
1602
|
-
onMouseEnter: () => ne(
|
|
1602
|
+
onMouseEnter: () => ne(de),
|
|
1603
1603
|
children: [
|
|
1604
1604
|
ge && /* @__PURE__ */ s("span", { className: P.itemCheck, "aria-hidden": "true" }),
|
|
1605
1605
|
O.content ?? O.label
|
|
@@ -1608,7 +1608,7 @@ const en = $e(
|
|
|
1608
1608
|
O.value
|
|
1609
1609
|
);
|
|
1610
1610
|
}),
|
|
1611
|
-
|
|
1611
|
+
A && /* @__PURE__ */ s(
|
|
1612
1612
|
"button",
|
|
1613
1613
|
{
|
|
1614
1614
|
type: "button",
|
|
@@ -1621,7 +1621,7 @@ const en = $e(
|
|
|
1621
1621
|
),
|
|
1622
1622
|
onClick: _,
|
|
1623
1623
|
onMouseEnter: () => ne(q),
|
|
1624
|
-
children: R ? R(v) : /* @__PURE__ */
|
|
1624
|
+
children: R ? R(v) : /* @__PURE__ */ z(ze, { children: [
|
|
1625
1625
|
"Create “",
|
|
1626
1626
|
/* @__PURE__ */ s("strong", { children: v }),
|
|
1627
1627
|
"”"
|
|
@@ -1640,7 +1640,7 @@ const en = $e(
|
|
|
1640
1640
|
}
|
|
1641
1641
|
);
|
|
1642
1642
|
en.displayName = "MultiSelect";
|
|
1643
|
-
const Pi =
|
|
1643
|
+
const Pi = Ne(
|
|
1644
1644
|
(e, t) => e.multiple ? /* @__PURE__ */ s(en, { ref: t, ...e }) : e.searchable ? /* @__PURE__ */ s(Jt, { ref: t, ...e }) : /* @__PURE__ */ s(Qt, { ref: t, ...e })
|
|
1645
1645
|
);
|
|
1646
1646
|
Pi.displayName = "Select";
|
|
@@ -1649,7 +1649,7 @@ const Wi = "crk-root-61cKD", Hi = "crk-input-bAjPU", Oi = "crk-label-W9IeS", Fi
|
|
|
1649
1649
|
input: Hi,
|
|
1650
1650
|
label: Oi,
|
|
1651
1651
|
indeterminate: Fi
|
|
1652
|
-
},
|
|
1652
|
+
}, Xi = Ne(
|
|
1653
1653
|
({
|
|
1654
1654
|
label: e,
|
|
1655
1655
|
indeterminate: t = !1,
|
|
@@ -1659,9 +1659,9 @@ const Wi = "crk-root-61cKD", Hi = "crk-input-bAjPU", Oi = "crk-label-W9IeS", Fi
|
|
|
1659
1659
|
...c
|
|
1660
1660
|
}, i) => {
|
|
1661
1661
|
const l = oe(null);
|
|
1662
|
-
return
|
|
1662
|
+
return Le(() => {
|
|
1663
1663
|
l.current && (l.current.indeterminate = t);
|
|
1664
|
-
}, [t]), /* @__PURE__ */
|
|
1664
|
+
}, [t]), /* @__PURE__ */ z(
|
|
1665
1665
|
"label",
|
|
1666
1666
|
{
|
|
1667
1667
|
className: m(dt.root, t && dt.indeterminate, n?.root, r),
|
|
@@ -1684,13 +1684,13 @@ const Wi = "crk-root-61cKD", Hi = "crk-input-bAjPU", Oi = "crk-label-W9IeS", Fi
|
|
|
1684
1684
|
);
|
|
1685
1685
|
}
|
|
1686
1686
|
);
|
|
1687
|
-
|
|
1688
|
-
const
|
|
1689
|
-
group:
|
|
1690
|
-
root:
|
|
1687
|
+
Xi.displayName = "Checkbox";
|
|
1688
|
+
const zi = "crk-group-NNwCD", ji = "crk-root-7fGik", _i = "crk-input-43PQW", Yi = "crk-label-aW30x", ht = {
|
|
1689
|
+
group: zi,
|
|
1690
|
+
root: ji,
|
|
1691
1691
|
input: _i,
|
|
1692
|
-
label:
|
|
1693
|
-
}, tn = _t(null),
|
|
1692
|
+
label: Yi
|
|
1693
|
+
}, tn = _t(null), Ui = ({
|
|
1694
1694
|
name: e,
|
|
1695
1695
|
value: t,
|
|
1696
1696
|
onChange: n,
|
|
@@ -1715,8 +1715,8 @@ const ji = "crk-group-NNwCD", Xi = "crk-root-7fGik", _i = "crk-input-43PQW", Ui
|
|
|
1715
1715
|
children: c
|
|
1716
1716
|
}
|
|
1717
1717
|
) });
|
|
1718
|
-
|
|
1719
|
-
const Vi =
|
|
1718
|
+
Ui.displayName = "RadioGroup";
|
|
1719
|
+
const Vi = Ne(
|
|
1720
1720
|
({
|
|
1721
1721
|
label: e,
|
|
1722
1722
|
value: t,
|
|
@@ -1731,7 +1731,7 @@ const Vi = $e(
|
|
|
1731
1731
|
const u = ft(tn), d = u?.name ?? l, f = u ? u.value === t : i, p = (L) => {
|
|
1732
1732
|
u?.onChange?.(t), c?.(L);
|
|
1733
1733
|
};
|
|
1734
|
-
return /* @__PURE__ */
|
|
1734
|
+
return /* @__PURE__ */ z("label", { className: m(ht.root, n?.root, r), style: o, children: [
|
|
1735
1735
|
/* @__PURE__ */ s(
|
|
1736
1736
|
"input",
|
|
1737
1737
|
{
|
|
@@ -1766,7 +1766,7 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1766
1766
|
vertical: "resizeVertical",
|
|
1767
1767
|
horizontal: "resizeHorizontal",
|
|
1768
1768
|
both: "resizeBoth"
|
|
1769
|
-
}, ic =
|
|
1769
|
+
}, ic = Ne(
|
|
1770
1770
|
({
|
|
1771
1771
|
inputSize: e = "md",
|
|
1772
1772
|
error: t = !1,
|
|
@@ -1781,7 +1781,7 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1781
1781
|
const p = h.current;
|
|
1782
1782
|
p && (p.style.height = "auto", p.style.height = `${p.scrollHeight}px`);
|
|
1783
1783
|
}, []), d = l.value ?? "";
|
|
1784
|
-
|
|
1784
|
+
Le(() => {
|
|
1785
1785
|
r && u();
|
|
1786
1786
|
}, [r, u, d]);
|
|
1787
1787
|
const f = pe(
|
|
@@ -1813,8 +1813,8 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1813
1813
|
);
|
|
1814
1814
|
ic.displayName = "Textarea";
|
|
1815
1815
|
function cc(e, t = { width: 600, height: 300 }) {
|
|
1816
|
-
const [n, r] =
|
|
1817
|
-
return
|
|
1816
|
+
const [n, r] = Re(t), o = oe(t);
|
|
1817
|
+
return Le(() => {
|
|
1818
1818
|
const c = e.current;
|
|
1819
1819
|
if (!c || typeof ResizeObserver > "u") return;
|
|
1820
1820
|
const i = (h, u) => {
|
|
@@ -1860,19 +1860,19 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1860
1860
|
empty: Bc,
|
|
1861
1861
|
sparkline: Ic,
|
|
1862
1862
|
tradingHeader: Dc
|
|
1863
|
-
}, Ve =
|
|
1863
|
+
}, Ve = Ne(
|
|
1864
1864
|
({ aspectRatio: e = 16 / 9, height: t, className: n, style: r, classes: o, legend: c, overlay: i, children: l }, a) => {
|
|
1865
1865
|
const h = oe(null);
|
|
1866
1866
|
un(a, () => h.current);
|
|
1867
1867
|
const { width: u } = cc(h), d = Math.max(0, u), f = t ?? Math.round(d / e);
|
|
1868
|
-
return /* @__PURE__ */
|
|
1868
|
+
return /* @__PURE__ */ z(
|
|
1869
1869
|
"div",
|
|
1870
1870
|
{
|
|
1871
1871
|
ref: h,
|
|
1872
1872
|
className: m(M.root, o?.root, n),
|
|
1873
1873
|
style: r,
|
|
1874
1874
|
children: [
|
|
1875
|
-
/* @__PURE__ */
|
|
1875
|
+
/* @__PURE__ */ z("div", { className: M.canvas, style: { height: f || void 0 }, children: [
|
|
1876
1876
|
d > 0 && f > 0 && /* @__PURE__ */ s(
|
|
1877
1877
|
"svg",
|
|
1878
1878
|
{
|
|
@@ -1897,7 +1897,7 @@ function vt({ config: e, order: t, classes: n }) {
|
|
|
1897
1897
|
const r = t ?? Object.keys(e);
|
|
1898
1898
|
return /* @__PURE__ */ s("div", { className: m(M.legend, n?.legend), role: "list", children: r.map((o) => {
|
|
1899
1899
|
const c = e[o];
|
|
1900
|
-
return c ? /* @__PURE__ */
|
|
1900
|
+
return c ? /* @__PURE__ */ z("div", { className: m(M.legendItem, n?.legendItem), role: "listitem", children: [
|
|
1901
1901
|
c.icon ? /* @__PURE__ */ s(
|
|
1902
1902
|
"span",
|
|
1903
1903
|
{
|
|
@@ -1938,14 +1938,14 @@ function et({
|
|
|
1938
1938
|
className: m(M.tooltip, h?.tooltip),
|
|
1939
1939
|
style: { left: f, top: p, width: u },
|
|
1940
1940
|
role: "tooltip",
|
|
1941
|
-
children: c ? c(e) : /* @__PURE__ */
|
|
1941
|
+
children: c ? c(e) : /* @__PURE__ */ z(ze, { children: [
|
|
1942
1942
|
l && e[l] !== void 0 && /* @__PURE__ */ s("div", { className: M.tooltipTitle, children: String(e[l]) }),
|
|
1943
1943
|
/* @__PURE__ */ s("div", { className: M.tooltipRows, children: Object.entries(o).map(([L, b]) => {
|
|
1944
1944
|
const R = e[L];
|
|
1945
1945
|
if (R == null) return null;
|
|
1946
|
-
const w = typeof R == "number" ? i(R) : String(R),
|
|
1947
|
-
return /* @__PURE__ */
|
|
1948
|
-
/* @__PURE__ */ s("span", { className: M.legendSwatch, style: { background:
|
|
1946
|
+
const w = typeof R == "number" ? i(R) : String(R), Q = a?.(L) ?? b.color;
|
|
1947
|
+
return /* @__PURE__ */ z("div", { className: M.tooltipRow, children: [
|
|
1948
|
+
/* @__PURE__ */ s("span", { className: M.legendSwatch, style: { background: Q }, "aria-hidden": "true" }),
|
|
1949
1949
|
/* @__PURE__ */ s("span", { className: M.tooltipLabel, children: b.label }),
|
|
1950
1950
|
/* @__PURE__ */ s("span", { className: M.tooltipValue, children: w })
|
|
1951
1951
|
] }, L);
|
|
@@ -1955,7 +1955,7 @@ function et({
|
|
|
1955
1955
|
);
|
|
1956
1956
|
}
|
|
1957
1957
|
function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes: c }) {
|
|
1958
|
-
return /* @__PURE__ */ s("g", { className: m(M.axis, c?.axis), children: e.map(({ value: i, y: l }) => /* @__PURE__ */
|
|
1958
|
+
return /* @__PURE__ */ s("g", { className: m(M.axis, c?.axis), children: e.map(({ value: i, y: l }) => /* @__PURE__ */ z("g", { children: [
|
|
1959
1959
|
o && /* @__PURE__ */ s(
|
|
1960
1960
|
"line",
|
|
1961
1961
|
{
|
|
@@ -2005,7 +2005,7 @@ function Je(e, t) {
|
|
|
2005
2005
|
const [n, r] = e, [o, c] = t, i = r - n || 1, l = c - o, a = (h) => o + (h - n) / i * l;
|
|
2006
2006
|
return a.invert = (h) => n + (h - o) / l * i, a;
|
|
2007
2007
|
}
|
|
2008
|
-
function
|
|
2008
|
+
function je(e, t, n = 0.2) {
|
|
2009
2009
|
const [r, o] = t, i = (o - r) / Math.max(1, e.length), l = i * (1 - n), a = /* @__PURE__ */ new Map();
|
|
2010
2010
|
for (let u = 0; u < e.length; u++) a.set(e[u], u);
|
|
2011
2011
|
const h = (u) => {
|
|
@@ -2068,17 +2068,17 @@ function Ol({
|
|
|
2068
2068
|
showLegend: b = !0,
|
|
2069
2069
|
showTooltip: R = !0,
|
|
2070
2070
|
yTickCount: w = 5,
|
|
2071
|
-
yFormat:
|
|
2071
|
+
yFormat: Q,
|
|
2072
2072
|
xFormat: W,
|
|
2073
|
-
valueFormat:
|
|
2073
|
+
valueFormat: D,
|
|
2074
2074
|
renderTooltip: Z,
|
|
2075
|
-
margin:
|
|
2075
|
+
margin: T,
|
|
2076
2076
|
emptyMessage: $ = "No data",
|
|
2077
2077
|
className: ie,
|
|
2078
2078
|
style: ne,
|
|
2079
2079
|
classes: V
|
|
2080
2080
|
}) {
|
|
2081
|
-
const
|
|
2081
|
+
const ue = { ...Ec, ...T }, S = ke(() => Object.keys(n), [n]), [re, F] = Re(null), j = oe(null), C = f ?? re, X = (me, K) => {
|
|
2082
2082
|
if (l) {
|
|
2083
2083
|
const H = e[K]?.[l];
|
|
2084
2084
|
if (typeof H == "string") return H;
|
|
@@ -2086,128 +2086,128 @@ function Ol({
|
|
|
2086
2086
|
return n[me]?.color ?? "var(--crk-chart-1)";
|
|
2087
2087
|
};
|
|
2088
2088
|
if (e.length === 0)
|
|
2089
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2090
|
-
const
|
|
2089
|
+
return /* @__PURE__ */ s("div", { ref: j, className: m(M.root, V?.root, ie), style: ne, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: $ }) }) });
|
|
2090
|
+
const se = R && C !== null ? /* @__PURE__ */ s(
|
|
2091
2091
|
et,
|
|
2092
2092
|
{
|
|
2093
|
-
row: e[
|
|
2094
|
-
x: Hc(e, t,
|
|
2093
|
+
row: e[C],
|
|
2094
|
+
x: Hc(e, t, ue, C, j),
|
|
2095
2095
|
y: 16,
|
|
2096
|
-
containerWidth:
|
|
2096
|
+
containerWidth: j.current?.getBoundingClientRect().width ?? 0,
|
|
2097
2097
|
config: n,
|
|
2098
|
-
render: Z ? () => Z(e[
|
|
2099
|
-
valueFormat:
|
|
2098
|
+
render: Z ? () => Z(e[C]) : void 0,
|
|
2099
|
+
valueFormat: D,
|
|
2100
2100
|
titleKey: t,
|
|
2101
|
-
resolveColor: l ? (me) =>
|
|
2101
|
+
resolveColor: l ? (me) => X(me, C) : void 0,
|
|
2102
2102
|
classes: V
|
|
2103
2103
|
}
|
|
2104
2104
|
) : null;
|
|
2105
2105
|
return /* @__PURE__ */ s(
|
|
2106
2106
|
Ve,
|
|
2107
2107
|
{
|
|
2108
|
-
ref:
|
|
2108
|
+
ref: j,
|
|
2109
2109
|
aspectRatio: r,
|
|
2110
2110
|
height: o,
|
|
2111
2111
|
className: ie,
|
|
2112
2112
|
style: ne,
|
|
2113
2113
|
classes: V,
|
|
2114
2114
|
legend: b ? /* @__PURE__ */ s(vt, { config: n, classes: V }) : void 0,
|
|
2115
|
-
overlay:
|
|
2115
|
+
overlay: se,
|
|
2116
2116
|
children: ({ width: me, height: K }) => {
|
|
2117
|
-
const H =
|
|
2117
|
+
const H = ue.left, N = me - ue.right, y = ue.top, v = K - ue.bottom, A = Math.max(0, N - H), _ = Math.max(0, v - y), q = e.map((g) => String(g[t])), Y = je(q, [H, N], 0), J = [];
|
|
2118
2118
|
for (const g of S)
|
|
2119
2119
|
for (const x of e) {
|
|
2120
|
-
const
|
|
2121
|
-
typeof
|
|
2120
|
+
const ee = x[g];
|
|
2121
|
+
typeof ee == "number" && J.push(ee);
|
|
2122
2122
|
}
|
|
2123
|
-
const [k, G] = bt(
|
|
2124
|
-
return /* @__PURE__ */
|
|
2123
|
+
const [k, G] = bt(J), O = Math.min(0, k), de = qe(O, G, w), ge = Je([de[0], de[de.length - 1]], [v, y]), be = de.map((g) => ({ value: g, y: ge(g) })), Se = Wc(q).map((g) => ({ label: g, x: Y(g) }));
|
|
2124
|
+
return /* @__PURE__ */ z(ze, { children: [
|
|
2125
2125
|
/* @__PURE__ */ s(
|
|
2126
2126
|
nn,
|
|
2127
2127
|
{
|
|
2128
2128
|
ticks: be,
|
|
2129
2129
|
x: H,
|
|
2130
|
-
plotWidth:
|
|
2131
|
-
format:
|
|
2130
|
+
plotWidth: A,
|
|
2131
|
+
format: Q,
|
|
2132
2132
|
showGrid: L,
|
|
2133
2133
|
classes: V
|
|
2134
2134
|
}
|
|
2135
2135
|
),
|
|
2136
|
-
/* @__PURE__ */ s(rn, { ticks:
|
|
2136
|
+
/* @__PURE__ */ s(rn, { ticks: Se, y: v, format: W, classes: V }),
|
|
2137
2137
|
S.map((g) => {
|
|
2138
|
-
const x = n[g],
|
|
2139
|
-
const I =
|
|
2140
|
-
return { x:
|
|
2138
|
+
const x = n[g], ee = e.map((E, U) => {
|
|
2139
|
+
const I = E[g], fe = typeof I == "number" ? I : 0;
|
|
2140
|
+
return { x: Y(q[U]), y: ge(fe), value: fe, row: E };
|
|
2141
2141
|
});
|
|
2142
|
-
return /* @__PURE__ */
|
|
2142
|
+
return /* @__PURE__ */ z("g", { className: m(M.series, V?.series), children: [
|
|
2143
2143
|
/* @__PURE__ */ s(
|
|
2144
2144
|
"path",
|
|
2145
2145
|
{
|
|
2146
2146
|
className: m(M.linePath),
|
|
2147
|
-
d: Pc(
|
|
2147
|
+
d: Pc(ee, c),
|
|
2148
2148
|
stroke: x.color
|
|
2149
2149
|
}
|
|
2150
2150
|
),
|
|
2151
|
-
i &&
|
|
2152
|
-
const I =
|
|
2151
|
+
i && ee.map((E, U) => {
|
|
2152
|
+
const I = X(g, U), fe = C === U, ce = f !== void 0 && !fe, B = p ? () => p({ row: E.row, value: E.value, seriesKey: g, index: U }) : void 0;
|
|
2153
2153
|
return a ? /* @__PURE__ */ s(
|
|
2154
2154
|
"g",
|
|
2155
2155
|
{
|
|
2156
|
-
onClick:
|
|
2157
|
-
style:
|
|
2158
|
-
opacity:
|
|
2156
|
+
onClick: B,
|
|
2157
|
+
style: B ? { cursor: "pointer" } : void 0,
|
|
2158
|
+
opacity: ce ? 0.45 : 1,
|
|
2159
2159
|
children: a({
|
|
2160
|
-
row:
|
|
2161
|
-
value:
|
|
2160
|
+
row: E.row,
|
|
2161
|
+
value: E.value,
|
|
2162
2162
|
seriesKey: g,
|
|
2163
|
-
index:
|
|
2164
|
-
x:
|
|
2165
|
-
y:
|
|
2163
|
+
index: U,
|
|
2164
|
+
x: E.x,
|
|
2165
|
+
y: E.y,
|
|
2166
2166
|
color: I,
|
|
2167
2167
|
active: fe
|
|
2168
2168
|
})
|
|
2169
2169
|
},
|
|
2170
|
-
`${g}-${
|
|
2170
|
+
`${g}-${U}`
|
|
2171
2171
|
) : /* @__PURE__ */ s(
|
|
2172
2172
|
"circle",
|
|
2173
2173
|
{
|
|
2174
2174
|
className: m(M.point, V?.point),
|
|
2175
|
-
cx:
|
|
2176
|
-
cy:
|
|
2175
|
+
cx: E.x,
|
|
2176
|
+
cy: E.y,
|
|
2177
2177
|
r: fe ? 5 : 3.5,
|
|
2178
2178
|
fill: I,
|
|
2179
|
-
onClick:
|
|
2180
|
-
style:
|
|
2181
|
-
opacity:
|
|
2179
|
+
onClick: B,
|
|
2180
|
+
style: B ? { cursor: "pointer" } : void 0,
|
|
2181
|
+
opacity: ce ? 0.45 : 1
|
|
2182
2182
|
},
|
|
2183
|
-
`${g}-${
|
|
2183
|
+
`${g}-${U}`
|
|
2184
2184
|
);
|
|
2185
2185
|
}),
|
|
2186
|
-
(h || d) &&
|
|
2187
|
-
const I = d ? d({ row:
|
|
2186
|
+
(h || d) && ee.map((E, U) => {
|
|
2187
|
+
const I = d ? d({ row: E.row, value: E.value, seriesKey: g, index: U }) : h ? D ? D(E.value) : String(E.value) : null;
|
|
2188
2188
|
if (I == null) return null;
|
|
2189
|
-
const fe = 10,
|
|
2189
|
+
const fe = 10, ce = u === "top" ? E.y - fe : E.y + fe + 4;
|
|
2190
2190
|
return /* @__PURE__ */ s(
|
|
2191
2191
|
"text",
|
|
2192
2192
|
{
|
|
2193
2193
|
className: m(M.axisLabel),
|
|
2194
|
-
x:
|
|
2195
|
-
y:
|
|
2194
|
+
x: E.x,
|
|
2195
|
+
y: ce,
|
|
2196
2196
|
textAnchor: "middle",
|
|
2197
2197
|
dominantBaseline: u === "top" ? "auto" : "middle",
|
|
2198
2198
|
children: I
|
|
2199
2199
|
},
|
|
2200
|
-
`label-${g}-${
|
|
2200
|
+
`label-${g}-${U}`
|
|
2201
2201
|
);
|
|
2202
2202
|
})
|
|
2203
2203
|
] }, g);
|
|
2204
2204
|
}),
|
|
2205
|
-
|
|
2205
|
+
C !== null && /* @__PURE__ */ s(
|
|
2206
2206
|
"line",
|
|
2207
2207
|
{
|
|
2208
2208
|
className: M.cursorLine,
|
|
2209
|
-
x1:
|
|
2210
|
-
x2:
|
|
2209
|
+
x1: Y(q[C]),
|
|
2210
|
+
x2: Y(q[C]),
|
|
2211
2211
|
y1: y,
|
|
2212
2212
|
y2: v
|
|
2213
2213
|
}
|
|
@@ -2218,22 +2218,22 @@ function Ol({
|
|
|
2218
2218
|
className: M.interactionLayer,
|
|
2219
2219
|
x: H,
|
|
2220
2220
|
y,
|
|
2221
|
-
width:
|
|
2221
|
+
width: A,
|
|
2222
2222
|
height: _,
|
|
2223
2223
|
onMouseMove: (g) => {
|
|
2224
|
-
const x = g.currentTarget.getBoundingClientRect(),
|
|
2224
|
+
const x = g.currentTarget.getBoundingClientRect(), ee = g.clientX - x.left + H, E = Y.step(), U = Math.max(
|
|
2225
2225
|
0,
|
|
2226
|
-
Math.min(e.length - 1, Math.round((
|
|
2226
|
+
Math.min(e.length - 1, Math.round((ee - H - E / 2) / E))
|
|
2227
2227
|
);
|
|
2228
|
-
F(
|
|
2228
|
+
F(U);
|
|
2229
2229
|
},
|
|
2230
2230
|
onMouseLeave: () => F(null),
|
|
2231
2231
|
onClick: p ? (g) => {
|
|
2232
|
-
const x = g.currentTarget.getBoundingClientRect(),
|
|
2232
|
+
const x = g.currentTarget.getBoundingClientRect(), ee = g.clientX - x.left + H, E = Y.step(), U = Math.max(
|
|
2233
2233
|
0,
|
|
2234
|
-
Math.min(e.length - 1, Math.round((
|
|
2235
|
-
), I = S[0], fe = e[
|
|
2236
|
-
p({ row: e[
|
|
2234
|
+
Math.min(e.length - 1, Math.round((ee - H - E / 2) / E))
|
|
2235
|
+
), I = S[0], fe = e[U][I], ce = typeof fe == "number" ? fe : 0;
|
|
2236
|
+
p({ row: e[U], value: ce, seriesKey: I, index: U });
|
|
2237
2237
|
} : void 0,
|
|
2238
2238
|
style: p ? { cursor: "pointer" } : void 0
|
|
2239
2239
|
}
|
|
@@ -2247,7 +2247,7 @@ function Hc(e, t, n, r, o) {
|
|
|
2247
2247
|
const c = o.current;
|
|
2248
2248
|
if (!c) return 0;
|
|
2249
2249
|
const i = c.getBoundingClientRect().width, l = e.map((h) => String(h[t]));
|
|
2250
|
-
return
|
|
2250
|
+
return je(l, [n.left, i - n.right], 0)(l[r]);
|
|
2251
2251
|
}
|
|
2252
2252
|
const Oc = { top: 12, right: 16, bottom: 28, left: 48 };
|
|
2253
2253
|
function Rt(e, t) {
|
|
@@ -2302,11 +2302,11 @@ function Fl({
|
|
|
2302
2302
|
yFormat: b,
|
|
2303
2303
|
xFormat: R,
|
|
2304
2304
|
valueFormat: w,
|
|
2305
|
-
renderTooltip:
|
|
2305
|
+
renderTooltip: Q,
|
|
2306
2306
|
margin: W,
|
|
2307
|
-
emptyMessage:
|
|
2307
|
+
emptyMessage: D = "No data",
|
|
2308
2308
|
className: Z,
|
|
2309
|
-
style:
|
|
2309
|
+
style: T,
|
|
2310
2310
|
classes: $
|
|
2311
2311
|
}) {
|
|
2312
2312
|
const ie = ke(
|
|
@@ -2316,42 +2316,42 @@ function Fl({
|
|
|
2316
2316
|
...W
|
|
2317
2317
|
}),
|
|
2318
2318
|
[W, d]
|
|
2319
|
-
), ne = ke(() => Object.keys(n), [n]), V = i && ne.length > 0,
|
|
2319
|
+
), ne = ke(() => Object.keys(n), [n]), V = i && ne.length > 0, ue = V && l === "expand", [S, re] = Re(null), F = oe(null), j = Ue();
|
|
2320
2320
|
if (e.length === 0)
|
|
2321
|
-
return /* @__PURE__ */ s("div", { ref: F, className: m(M.root, $?.root, Z), style:
|
|
2322
|
-
const
|
|
2321
|
+
return /* @__PURE__ */ s("div", { ref: F, className: m(M.root, $?.root, Z), style: T, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: D }) }) });
|
|
2322
|
+
const C = ke(() => {
|
|
2323
2323
|
const H = ne.map(() => []), N = ne.map(() => []);
|
|
2324
2324
|
for (let y = 0; y < e.length; y++) {
|
|
2325
2325
|
let v = 0;
|
|
2326
|
-
if (
|
|
2326
|
+
if (ue) {
|
|
2327
2327
|
for (const _ of ne) {
|
|
2328
2328
|
const q = e[y][_];
|
|
2329
2329
|
typeof q == "number" && q > 0 && (v += q);
|
|
2330
2330
|
}
|
|
2331
2331
|
v === 0 && (v = 1);
|
|
2332
2332
|
}
|
|
2333
|
-
let
|
|
2333
|
+
let A = 0;
|
|
2334
2334
|
for (let _ = 0; _ < ne.length; _++) {
|
|
2335
|
-
const q = ne[_],
|
|
2335
|
+
const q = ne[_], Y = e[y][q], J = typeof Y == "number" ? Y : 0;
|
|
2336
2336
|
if (V) {
|
|
2337
|
-
const k =
|
|
2338
|
-
N[_][y] =
|
|
2337
|
+
const k = ue ? J / v : J;
|
|
2338
|
+
N[_][y] = A, A += k, H[_][y] = A;
|
|
2339
2339
|
} else
|
|
2340
|
-
N[_][y] = 0, H[_][y] =
|
|
2340
|
+
N[_][y] = 0, H[_][y] = J;
|
|
2341
2341
|
}
|
|
2342
2342
|
}
|
|
2343
2343
|
return { tops: H, bottoms: N };
|
|
2344
|
-
}, [e, ne, V,
|
|
2345
|
-
if (
|
|
2344
|
+
}, [e, ne, V, ue]), { tops: X, bottoms: se } = C, [me, K] = ke(() => {
|
|
2345
|
+
if (ue) return [0, 1];
|
|
2346
2346
|
let H = 0, N = 0;
|
|
2347
|
-
for (const y of
|
|
2347
|
+
for (const y of X)
|
|
2348
2348
|
for (const v of y)
|
|
2349
2349
|
v < H && (H = v), v > N && (N = v);
|
|
2350
|
-
for (const y of
|
|
2350
|
+
for (const y of se)
|
|
2351
2351
|
for (const v of y)
|
|
2352
2352
|
v < H && (H = v);
|
|
2353
2353
|
return [Math.min(0, H), N];
|
|
2354
|
-
}, [
|
|
2354
|
+
}, [X, se, ue]);
|
|
2355
2355
|
return /* @__PURE__ */ s(
|
|
2356
2356
|
Ve,
|
|
2357
2357
|
{
|
|
@@ -2359,30 +2359,30 @@ function Fl({
|
|
|
2359
2359
|
aspectRatio: r,
|
|
2360
2360
|
height: o,
|
|
2361
2361
|
className: Z,
|
|
2362
|
-
style:
|
|
2362
|
+
style: T,
|
|
2363
2363
|
classes: $,
|
|
2364
2364
|
legend: f ? /* @__PURE__ */ s(vt, { config: n, classes: $ }) : void 0,
|
|
2365
2365
|
overlay: p && S !== null ? /* @__PURE__ */ s(
|
|
2366
2366
|
et,
|
|
2367
2367
|
{
|
|
2368
2368
|
row: e[S],
|
|
2369
|
-
x:
|
|
2369
|
+
x: Xc(e, t, ie, S, F),
|
|
2370
2370
|
y: 16,
|
|
2371
2371
|
containerWidth: F.current?.getBoundingClientRect().width ?? 0,
|
|
2372
2372
|
config: n,
|
|
2373
|
-
render:
|
|
2374
|
-
valueFormat:
|
|
2373
|
+
render: Q ? () => Q(e[S]) : void 0,
|
|
2374
|
+
valueFormat: ue ? (H) => `${Math.round(H * 100)}%` : w,
|
|
2375
2375
|
titleKey: t,
|
|
2376
2376
|
classes: $
|
|
2377
2377
|
}
|
|
2378
2378
|
) : null,
|
|
2379
2379
|
children: ({ width: H, height: N }) => {
|
|
2380
|
-
const y = ie.left, v = H - ie.right,
|
|
2381
|
-
return /* @__PURE__ */
|
|
2382
|
-
a && /* @__PURE__ */ s("defs", { children: ne.map((g) => /* @__PURE__ */
|
|
2380
|
+
const y = ie.left, v = H - ie.right, A = ie.top, _ = N - ie.bottom, q = Math.max(0, v - y), Y = Math.max(0, _ - A), J = e.map((g) => String(g[t])), k = je(J, [y, v], 0), G = ue ? [0, 0.25, 0.5, 0.75, 1] : qe(me, K, L), O = Je([G[0], G[G.length - 1]], [_, A]), de = O(0), ge = G.map((g) => ({ value: g, y: O(g) })), Ce = Fc(J).map((g) => ({ label: g, x: k(g) })), Se = ue ? (g) => `${Math.round(g * 100)}%` : b;
|
|
2381
|
+
return /* @__PURE__ */ z(ze, { children: [
|
|
2382
|
+
a && /* @__PURE__ */ s("defs", { children: ne.map((g) => /* @__PURE__ */ z(
|
|
2383
2383
|
"linearGradient",
|
|
2384
2384
|
{
|
|
2385
|
-
id: `${
|
|
2385
|
+
id: `${j}-${g}`,
|
|
2386
2386
|
x1: "0",
|
|
2387
2387
|
y1: "0",
|
|
2388
2388
|
x2: "0",
|
|
@@ -2400,7 +2400,7 @@ function Fl({
|
|
|
2400
2400
|
ticks: ge,
|
|
2401
2401
|
x: y,
|
|
2402
2402
|
plotWidth: q,
|
|
2403
|
-
format:
|
|
2403
|
+
format: Se,
|
|
2404
2404
|
showGrid: h,
|
|
2405
2405
|
classes: $
|
|
2406
2406
|
}
|
|
@@ -2417,31 +2417,31 @@ function Fl({
|
|
|
2417
2417
|
)) }),
|
|
2418
2418
|
u && /* @__PURE__ */ s(rn, { ticks: Ce, y: _, format: R, classes: $ }),
|
|
2419
2419
|
ne.map((g, x) => {
|
|
2420
|
-
const
|
|
2421
|
-
x: k(
|
|
2422
|
-
y: O(
|
|
2423
|
-
})),
|
|
2424
|
-
return /* @__PURE__ */
|
|
2420
|
+
const ee = n[g], E = e.map((ce, B) => ({
|
|
2421
|
+
x: k(J[B]),
|
|
2422
|
+
y: O(X[x][B])
|
|
2423
|
+
})), U = a ? `url(#${j}-${g})` : ee.color, I = a ? 1 : 0.18, fe = V ? Dt(E, se[x].map((ce) => O(ce)), c) : Dt(E, de, c);
|
|
2424
|
+
return /* @__PURE__ */ z("g", { className: m(M.series, $?.series), children: [
|
|
2425
2425
|
/* @__PURE__ */ s(
|
|
2426
2426
|
"path",
|
|
2427
2427
|
{
|
|
2428
2428
|
className: M.areaPath,
|
|
2429
2429
|
d: fe,
|
|
2430
|
-
fill:
|
|
2430
|
+
fill: U,
|
|
2431
2431
|
fillOpacity: I
|
|
2432
2432
|
}
|
|
2433
2433
|
),
|
|
2434
|
-
/* @__PURE__ */ s("path", { className: M.linePath, d: Rt(
|
|
2435
|
-
!V &&
|
|
2434
|
+
/* @__PURE__ */ s("path", { className: M.linePath, d: Rt(E, c), stroke: ee.color }),
|
|
2435
|
+
!V && E.map((ce, B) => /* @__PURE__ */ s(
|
|
2436
2436
|
"circle",
|
|
2437
2437
|
{
|
|
2438
2438
|
className: m(M.point, $?.point),
|
|
2439
|
-
cx:
|
|
2440
|
-
cy:
|
|
2441
|
-
r: S ===
|
|
2442
|
-
fill:
|
|
2439
|
+
cx: ce.x,
|
|
2440
|
+
cy: ce.y,
|
|
2441
|
+
r: S === B ? 5 : 3,
|
|
2442
|
+
fill: ee.color
|
|
2443
2443
|
},
|
|
2444
|
-
`${g}-${
|
|
2444
|
+
`${g}-${B}`
|
|
2445
2445
|
))
|
|
2446
2446
|
] }, g);
|
|
2447
2447
|
}),
|
|
@@ -2449,9 +2449,9 @@ function Fl({
|
|
|
2449
2449
|
"line",
|
|
2450
2450
|
{
|
|
2451
2451
|
className: M.cursorLine,
|
|
2452
|
-
x1: k(
|
|
2453
|
-
x2: k(
|
|
2454
|
-
y1:
|
|
2452
|
+
x1: k(J[S]),
|
|
2453
|
+
x2: k(J[S]),
|
|
2454
|
+
y1: A,
|
|
2455
2455
|
y2: _
|
|
2456
2456
|
}
|
|
2457
2457
|
),
|
|
@@ -2460,12 +2460,12 @@ function Fl({
|
|
|
2460
2460
|
{
|
|
2461
2461
|
className: M.interactionLayer,
|
|
2462
2462
|
x: y,
|
|
2463
|
-
y:
|
|
2463
|
+
y: A,
|
|
2464
2464
|
width: q,
|
|
2465
|
-
height:
|
|
2465
|
+
height: Y,
|
|
2466
2466
|
onMouseMove: (g) => {
|
|
2467
|
-
const x = g.currentTarget.getBoundingClientRect(),
|
|
2468
|
-
re(
|
|
2467
|
+
const x = g.currentTarget.getBoundingClientRect(), ee = g.clientX - x.left + y, E = k.step(), U = Math.max(0, Math.min(e.length - 1, Math.round((ee - y - E / 2) / E)));
|
|
2468
|
+
re(U);
|
|
2469
2469
|
},
|
|
2470
2470
|
onMouseLeave: () => re(null)
|
|
2471
2471
|
}
|
|
@@ -2475,25 +2475,25 @@ function Fl({
|
|
|
2475
2475
|
}
|
|
2476
2476
|
);
|
|
2477
2477
|
}
|
|
2478
|
-
function
|
|
2478
|
+
function Xc(e, t, n, r, o) {
|
|
2479
2479
|
const c = o.current;
|
|
2480
2480
|
if (!c) return 0;
|
|
2481
2481
|
const i = c.getBoundingClientRect().width, l = e.map((h) => String(h[t]));
|
|
2482
|
-
return
|
|
2482
|
+
return je(l, [n.left, i - n.right], 0)(l[r]);
|
|
2483
2483
|
}
|
|
2484
|
-
const
|
|
2484
|
+
const zc = [
|
|
2485
2485
|
"var(--crk-chart-1)",
|
|
2486
2486
|
"var(--crk-chart-2)",
|
|
2487
2487
|
"var(--crk-chart-3)",
|
|
2488
2488
|
"var(--crk-chart-4)",
|
|
2489
2489
|
"var(--crk-chart-5)"
|
|
2490
|
-
],
|
|
2491
|
-
function
|
|
2490
|
+
], jc = { top: 12, right: 16, bottom: 28, left: 48 }, _c = { top: 12, right: 16, bottom: 28, left: 72 };
|
|
2491
|
+
function Yc(e, t = 8) {
|
|
2492
2492
|
if (e.length <= t) return e;
|
|
2493
2493
|
const n = Math.ceil(e.length / t);
|
|
2494
2494
|
return e.filter((r, o) => o % n === 0);
|
|
2495
2495
|
}
|
|
2496
|
-
function
|
|
2496
|
+
function Xl({
|
|
2497
2497
|
data: e,
|
|
2498
2498
|
xKey: t,
|
|
2499
2499
|
config: n,
|
|
@@ -2511,59 +2511,59 @@ function zl({
|
|
|
2511
2511
|
valuePosition: L = "outside",
|
|
2512
2512
|
renderLabel: b,
|
|
2513
2513
|
colorBy: R = "series",
|
|
2514
|
-
colors: w =
|
|
2515
|
-
negativeColor:
|
|
2514
|
+
colors: w = zc,
|
|
2515
|
+
negativeColor: Q,
|
|
2516
2516
|
activeIndex: W,
|
|
2517
|
-
onBarClick:
|
|
2517
|
+
onBarClick: D,
|
|
2518
2518
|
yTickCount: Z = 5,
|
|
2519
|
-
yFormat:
|
|
2519
|
+
yFormat: T,
|
|
2520
2520
|
xFormat: $,
|
|
2521
2521
|
valueFormat: ie,
|
|
2522
2522
|
renderTooltip: ne,
|
|
2523
2523
|
margin: V,
|
|
2524
|
-
emptyMessage:
|
|
2524
|
+
emptyMessage: ue = "No data",
|
|
2525
2525
|
className: S,
|
|
2526
2526
|
style: re,
|
|
2527
2527
|
classes: F
|
|
2528
2528
|
}) {
|
|
2529
|
-
const
|
|
2529
|
+
const j = r === "horizontal", C = { ...j ? _c : jc, ...V }, X = ke(() => Object.keys(n), [n]), se = o && X.length > 1, [me, K] = Re(null), H = oe(null);
|
|
2530
2530
|
if (e.length === 0)
|
|
2531
|
-
return /* @__PURE__ */ s("div", { ref: H, className: m(M.root, F?.root, S), style: re, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: i ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children:
|
|
2531
|
+
return /* @__PURE__ */ s("div", { ref: H, className: m(M.root, F?.root, S), style: re, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: i ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: ue }) }) });
|
|
2532
2532
|
const N = e.map((k) => String(k[t])), y = W ?? me, v = ke(() => {
|
|
2533
|
-
if (
|
|
2534
|
-
let
|
|
2533
|
+
if (se) {
|
|
2534
|
+
let de = 0, ge = 0;
|
|
2535
2535
|
for (const be of e) {
|
|
2536
|
-
let Ce = 0,
|
|
2537
|
-
for (const g of
|
|
2536
|
+
let Ce = 0, Se = 0;
|
|
2537
|
+
for (const g of X) {
|
|
2538
2538
|
const x = be[g];
|
|
2539
|
-
typeof x == "number" && (x >= 0 ? Ce += x :
|
|
2539
|
+
typeof x == "number" && (x >= 0 ? Ce += x : Se += x);
|
|
2540
2540
|
}
|
|
2541
|
-
Ce >
|
|
2541
|
+
Ce > de && (de = Ce), Se < ge && (ge = Se);
|
|
2542
2542
|
}
|
|
2543
|
-
return [ge,
|
|
2543
|
+
return [ge, de];
|
|
2544
2544
|
}
|
|
2545
2545
|
const k = [];
|
|
2546
|
-
for (const
|
|
2547
|
-
for (const ge of
|
|
2548
|
-
const be =
|
|
2546
|
+
for (const de of e)
|
|
2547
|
+
for (const ge of X) {
|
|
2548
|
+
const be = de[ge];
|
|
2549
2549
|
typeof be == "number" && k.push(be);
|
|
2550
2550
|
}
|
|
2551
2551
|
const [G, O] = bt(k);
|
|
2552
2552
|
return [Math.min(0, G), Math.max(0, O)];
|
|
2553
|
-
}, [e,
|
|
2553
|
+
}, [e, X, se]), A = qe(v[0], v[1], Z), _ = A[0], q = A[A.length - 1], Y = (k, G) => R === "index" ? w[G % w.length] : n[k]?.color ?? w[0], J = f && y !== null && e[y] ? /* @__PURE__ */ s(
|
|
2554
2554
|
et,
|
|
2555
2555
|
{
|
|
2556
2556
|
row: e[y],
|
|
2557
|
-
x: Vc(e, t,
|
|
2558
|
-
y:
|
|
2557
|
+
x: Vc(e, t, C, y, H, j, l),
|
|
2558
|
+
y: j ? qc(e, t, C, y, H, l) : 16,
|
|
2559
2559
|
containerWidth: H.current?.getBoundingClientRect().width ?? 0,
|
|
2560
2560
|
config: n,
|
|
2561
2561
|
render: ne ? () => ne(e[y]) : void 0,
|
|
2562
2562
|
valueFormat: ie,
|
|
2563
2563
|
titleKey: t,
|
|
2564
2564
|
resolveColor: (k) => {
|
|
2565
|
-
const G = e[y][k], O =
|
|
2566
|
-
return typeof G != "number" ? O :
|
|
2565
|
+
const G = e[y][k], O = Y(k, y);
|
|
2566
|
+
return typeof G != "number" ? O : Q !== void 0 && G < 0 ? Q : O;
|
|
2567
2567
|
},
|
|
2568
2568
|
classes: F
|
|
2569
2569
|
}
|
|
@@ -2578,106 +2578,106 @@ function zl({
|
|
|
2578
2578
|
style: re,
|
|
2579
2579
|
classes: F,
|
|
2580
2580
|
legend: d ? /* @__PURE__ */ s(vt, { config: n, classes: F }) : void 0,
|
|
2581
|
-
overlay:
|
|
2581
|
+
overlay: J,
|
|
2582
2582
|
children: ({ width: k, height: G }) => {
|
|
2583
|
-
const O =
|
|
2584
|
-
value:
|
|
2585
|
-
pos:
|
|
2586
|
-
})), ye =
|
|
2587
|
-
return /* @__PURE__ */
|
|
2588
|
-
u && /* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children:
|
|
2589
|
-
({ value:
|
|
2583
|
+
const O = C.left, de = k - C.right, ge = C.top, be = G - C.bottom, Ce = Math.max(0, de - O), Se = Math.max(0, be - ge), x = je(N, j ? [ge, be] : [O, de], l), ee = x.bandWidth(), U = Je([_, q], j ? [O, de] : [be, ge]), I = U(0), fe = se ? 1 : Math.max(1, X.length), ce = ee / fe, B = ce * (1 - a), le = A.map((te) => ({
|
|
2584
|
+
value: te,
|
|
2585
|
+
pos: U(te)
|
|
2586
|
+
})), ye = Yc(N);
|
|
2587
|
+
return /* @__PURE__ */ z(ze, { children: [
|
|
2588
|
+
u && /* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: le.map(
|
|
2589
|
+
({ value: te, pos: ae }) => j ? /* @__PURE__ */ s(
|
|
2590
2590
|
"line",
|
|
2591
2591
|
{
|
|
2592
2592
|
className: m(M.gridLine, F?.grid),
|
|
2593
|
-
x1:
|
|
2594
|
-
x2:
|
|
2593
|
+
x1: ae,
|
|
2594
|
+
x2: ae,
|
|
2595
2595
|
y1: ge,
|
|
2596
2596
|
y2: be
|
|
2597
2597
|
},
|
|
2598
|
-
`g-${
|
|
2598
|
+
`g-${te}`
|
|
2599
2599
|
) : /* @__PURE__ */ s(
|
|
2600
2600
|
"line",
|
|
2601
2601
|
{
|
|
2602
2602
|
className: m(M.gridLine, F?.grid),
|
|
2603
2603
|
x1: O,
|
|
2604
|
-
x2:
|
|
2605
|
-
y1:
|
|
2606
|
-
y2:
|
|
2604
|
+
x2: de,
|
|
2605
|
+
y1: ae,
|
|
2606
|
+
y2: ae
|
|
2607
2607
|
},
|
|
2608
|
-
`g-${
|
|
2608
|
+
`g-${te}`
|
|
2609
2609
|
)
|
|
2610
2610
|
) }),
|
|
2611
|
-
/* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children:
|
|
2612
|
-
const Ae =
|
|
2613
|
-
return
|
|
2611
|
+
/* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: le.map(({ value: te, pos: ae }) => {
|
|
2612
|
+
const Ae = T ? T(te) : String(te);
|
|
2613
|
+
return j ? /* @__PURE__ */ s(
|
|
2614
2614
|
"text",
|
|
2615
2615
|
{
|
|
2616
2616
|
className: m(M.axisLabel, F?.axisLabel),
|
|
2617
|
-
x:
|
|
2617
|
+
x: ae,
|
|
2618
2618
|
y: be + 16,
|
|
2619
2619
|
textAnchor: "middle",
|
|
2620
2620
|
children: Ae
|
|
2621
2621
|
},
|
|
2622
|
-
`vt-${
|
|
2622
|
+
`vt-${te}`
|
|
2623
2623
|
) : /* @__PURE__ */ s(
|
|
2624
2624
|
"text",
|
|
2625
2625
|
{
|
|
2626
2626
|
className: m(M.axisLabel, F?.axisLabel),
|
|
2627
2627
|
x: O - 8,
|
|
2628
|
-
y:
|
|
2628
|
+
y: ae,
|
|
2629
2629
|
textAnchor: "end",
|
|
2630
2630
|
dominantBaseline: "middle",
|
|
2631
2631
|
children: Ae
|
|
2632
2632
|
},
|
|
2633
|
-
`vt-${
|
|
2633
|
+
`vt-${te}`
|
|
2634
2634
|
);
|
|
2635
2635
|
}) }),
|
|
2636
|
-
/* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: ye.map((
|
|
2637
|
-
const
|
|
2638
|
-
return
|
|
2636
|
+
/* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: ye.map((te) => {
|
|
2637
|
+
const ae = x(te), Ae = $ ? $(te) : te;
|
|
2638
|
+
return j ? /* @__PURE__ */ s(
|
|
2639
2639
|
"text",
|
|
2640
2640
|
{
|
|
2641
2641
|
className: m(M.axisLabel, F?.axisLabel),
|
|
2642
2642
|
x: O - 8,
|
|
2643
|
-
y:
|
|
2643
|
+
y: ae,
|
|
2644
2644
|
textAnchor: "end",
|
|
2645
2645
|
dominantBaseline: "middle",
|
|
2646
2646
|
children: Ae
|
|
2647
2647
|
},
|
|
2648
|
-
`c-${
|
|
2648
|
+
`c-${te}`
|
|
2649
2649
|
) : /* @__PURE__ */ s(
|
|
2650
2650
|
"text",
|
|
2651
2651
|
{
|
|
2652
2652
|
className: m(M.axisLabel, F?.axisLabel),
|
|
2653
|
-
x:
|
|
2653
|
+
x: ae,
|
|
2654
2654
|
y: be + 16,
|
|
2655
2655
|
textAnchor: "middle",
|
|
2656
2656
|
children: Ae
|
|
2657
2657
|
},
|
|
2658
|
-
`c-${
|
|
2658
|
+
`c-${te}`
|
|
2659
2659
|
);
|
|
2660
2660
|
}) }),
|
|
2661
|
-
e.map((
|
|
2662
|
-
const De = x(N[
|
|
2663
|
-
let xe = 0,
|
|
2664
|
-
return /* @__PURE__ */ s("g", { className: m(M.series, F?.series), children:
|
|
2665
|
-
const Ge =
|
|
2661
|
+
e.map((te, ae) => {
|
|
2662
|
+
const De = x(N[ae]) - ee / 2;
|
|
2663
|
+
let xe = 0, he = 0;
|
|
2664
|
+
return /* @__PURE__ */ s("g", { className: m(M.series, F?.series), children: X.map((Ie, He) => {
|
|
2665
|
+
const Ge = te[Ie];
|
|
2666
2666
|
if (typeof Ge != "number") return null;
|
|
2667
|
-
const Ee = Ge, xt =
|
|
2667
|
+
const Ee = Ge, xt = Y(Ie, ae), kt = Q !== void 0 && Ee < 0 ? Q : xt, Oe = W !== void 0 ? W === ae : me === ae, tt = W !== void 0 && !Oe;
|
|
2668
2668
|
let nt, _e;
|
|
2669
|
-
|
|
2670
|
-
const rt =
|
|
2669
|
+
se ? Ee >= 0 ? (nt = xe, _e = xe + Ee, xe = _e) : (nt = he, _e = he + Ee, he = _e) : (nt = 0, _e = Ee);
|
|
2670
|
+
const rt = U(nt), ot = U(_e), Bt = se ? (ee - B) / 2 : He * ce + (ce - B) / 2;
|
|
2671
2671
|
let it = 0, ct = 0, lt = 0, st = 0;
|
|
2672
|
-
if (
|
|
2672
|
+
if (j) {
|
|
2673
2673
|
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2674
|
-
it = Ze, lt = wt - Ze, ct = De + Bt, st =
|
|
2674
|
+
it = Ze, lt = wt - Ze, ct = De + Bt, st = B;
|
|
2675
2675
|
} else {
|
|
2676
2676
|
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2677
|
-
it = De + Bt, lt =
|
|
2677
|
+
it = De + Bt, lt = B, ct = Ze, st = wt - Ze;
|
|
2678
2678
|
}
|
|
2679
|
-
const Mt = b ? b({ row:
|
|
2680
|
-
isHorizontal:
|
|
2679
|
+
const Mt = b ? b({ row: te, value: Ee, seriesKey: Ie, index: ae }) : p ? ie ? ie(Ee) : String(Ee) : null, Fe = Uc({
|
|
2680
|
+
isHorizontal: j,
|
|
2681
2681
|
valuePosition: L,
|
|
2682
2682
|
x: it,
|
|
2683
2683
|
y: ct,
|
|
@@ -2685,7 +2685,7 @@ function zl({
|
|
|
2685
2685
|
rectH: st,
|
|
2686
2686
|
value: Ee
|
|
2687
2687
|
});
|
|
2688
|
-
return /* @__PURE__ */
|
|
2688
|
+
return /* @__PURE__ */ z("g", { children: [
|
|
2689
2689
|
/* @__PURE__ */ s(
|
|
2690
2690
|
"rect",
|
|
2691
2691
|
{
|
|
@@ -2702,8 +2702,8 @@ function zl({
|
|
|
2702
2702
|
ry: h,
|
|
2703
2703
|
fill: kt,
|
|
2704
2704
|
opacity: tt ? 0.35 : 1,
|
|
2705
|
-
onClick:
|
|
2706
|
-
style:
|
|
2705
|
+
onClick: D ? () => D({ row: te, value: Ee, seriesKey: Ie, index: ae }) : void 0,
|
|
2706
|
+
style: D ? { cursor: "pointer" } : void 0
|
|
2707
2707
|
}
|
|
2708
2708
|
),
|
|
2709
2709
|
Mt != null && /* @__PURE__ */ s(
|
|
@@ -2723,16 +2723,16 @@ function zl({
|
|
|
2723
2723
|
}
|
|
2724
2724
|
)
|
|
2725
2725
|
] }, Ie);
|
|
2726
|
-
}) }, `group-${
|
|
2726
|
+
}) }, `group-${ae}`);
|
|
2727
2727
|
}),
|
|
2728
2728
|
_ < 0 && q > 0 && /* @__PURE__ */ s(
|
|
2729
2729
|
"line",
|
|
2730
2730
|
{
|
|
2731
2731
|
className: m(M.gridLine),
|
|
2732
|
-
x1:
|
|
2733
|
-
x2:
|
|
2734
|
-
y1:
|
|
2735
|
-
y2:
|
|
2732
|
+
x1: j ? I : O,
|
|
2733
|
+
x2: j ? I : de,
|
|
2734
|
+
y1: j ? ge : I,
|
|
2735
|
+
y2: j ? be : I,
|
|
2736
2736
|
opacity: 0.9
|
|
2737
2737
|
}
|
|
2738
2738
|
),
|
|
@@ -2743,11 +2743,11 @@ function zl({
|
|
|
2743
2743
|
x: O,
|
|
2744
2744
|
y: ge,
|
|
2745
2745
|
width: Ce,
|
|
2746
|
-
height:
|
|
2747
|
-
onMouseMove: (
|
|
2748
|
-
const
|
|
2746
|
+
height: Se,
|
|
2747
|
+
onMouseMove: (te) => {
|
|
2748
|
+
const ae = te.currentTarget.getBoundingClientRect(), Ae = te.clientX - ae.left + O, De = te.clientY - ae.top + ge, xe = x.step(), he = j ? De - ge : Ae - O, Ie = Math.max(
|
|
2749
2749
|
0,
|
|
2750
|
-
Math.min(e.length - 1, Math.round((
|
|
2750
|
+
Math.min(e.length - 1, Math.round((he - xe / 2) / xe))
|
|
2751
2751
|
);
|
|
2752
2752
|
K(Ie);
|
|
2753
2753
|
},
|
|
@@ -2759,7 +2759,7 @@ function zl({
|
|
|
2759
2759
|
}
|
|
2760
2760
|
);
|
|
2761
2761
|
}
|
|
2762
|
-
function
|
|
2762
|
+
function Uc({
|
|
2763
2763
|
isHorizontal: e,
|
|
2764
2764
|
valuePosition: t,
|
|
2765
2765
|
x: n,
|
|
@@ -2815,13 +2815,13 @@ function Vc(e, t, n, r, o, c, i) {
|
|
|
2815
2815
|
const l = o.current;
|
|
2816
2816
|
if (!l) return 0;
|
|
2817
2817
|
const a = l.getBoundingClientRect(), h = e.map((d) => String(d[t]));
|
|
2818
|
-
return c ? a.width / 2 :
|
|
2818
|
+
return c ? a.width / 2 : je(h, [n.left, a.width - n.right], i)(h[r]);
|
|
2819
2819
|
}
|
|
2820
2820
|
function qc(e, t, n, r, o, c) {
|
|
2821
2821
|
const i = o.current;
|
|
2822
2822
|
if (!i) return 16;
|
|
2823
2823
|
const l = i.getBoundingClientRect(), a = e.map((u) => String(u[t]));
|
|
2824
|
-
return
|
|
2824
|
+
return je(a, [n.top, l.height - n.bottom], c)(a[r]);
|
|
2825
2825
|
}
|
|
2826
2826
|
const Gc = [
|
|
2827
2827
|
"var(--crk-chart-1)",
|
|
@@ -2873,7 +2873,7 @@ function Pt(e, t, n, r, o) {
|
|
|
2873
2873
|
const i = ((r + o) / 2 - 90) * Math.PI / 180;
|
|
2874
2874
|
return { x: e + n * Math.cos(i), y: t + n * Math.sin(i) };
|
|
2875
2875
|
}
|
|
2876
|
-
function
|
|
2876
|
+
function zl({
|
|
2877
2877
|
data: e,
|
|
2878
2878
|
valueKey: t,
|
|
2879
2879
|
nameKey: n,
|
|
@@ -2892,23 +2892,23 @@ function jl({
|
|
|
2892
2892
|
renderLabel: b,
|
|
2893
2893
|
centerLabel: R,
|
|
2894
2894
|
activeIndex: w,
|
|
2895
|
-
onSliceClick:
|
|
2895
|
+
onSliceClick: Q,
|
|
2896
2896
|
showLegend: W = !0,
|
|
2897
|
-
showTooltip:
|
|
2897
|
+
showTooltip: D = !0,
|
|
2898
2898
|
valueFormat: Z,
|
|
2899
|
-
renderTooltip:
|
|
2899
|
+
renderTooltip: T,
|
|
2900
2900
|
emptyMessage: $ = "No data",
|
|
2901
2901
|
className: ie,
|
|
2902
2902
|
style: ne,
|
|
2903
2903
|
classes: V
|
|
2904
2904
|
}) {
|
|
2905
|
-
const [
|
|
2905
|
+
const [ue, S] = Re(null), re = oe(null), F = w ?? ue, j = (K) => {
|
|
2906
2906
|
if (r) {
|
|
2907
2907
|
const H = e[K]?.[r];
|
|
2908
2908
|
if (typeof H == "string") return H;
|
|
2909
2909
|
}
|
|
2910
2910
|
return o[K % o.length];
|
|
2911
|
-
},
|
|
2911
|
+
}, C = ke(() => {
|
|
2912
2912
|
let K = 0;
|
|
2913
2913
|
for (const H of e) {
|
|
2914
2914
|
const N = H[t];
|
|
@@ -2916,37 +2916,37 @@ function jl({
|
|
|
2916
2916
|
}
|
|
2917
2917
|
return K;
|
|
2918
2918
|
}, [e, t]);
|
|
2919
|
-
if (e.length === 0 ||
|
|
2919
|
+
if (e.length === 0 || C === 0)
|
|
2920
2920
|
return /* @__PURE__ */ s("div", { ref: re, className: m(M.root, V?.root, ie), style: ne, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: i ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: $ }) }) });
|
|
2921
|
-
const
|
|
2921
|
+
const X = ke(() => {
|
|
2922
2922
|
const K = [];
|
|
2923
2923
|
let H = 0;
|
|
2924
2924
|
for (let N = 0; N < e.length; N++) {
|
|
2925
|
-
const y = e[N], v = y[t],
|
|
2926
|
-
if (
|
|
2927
|
-
const _ =
|
|
2928
|
-
K.push({ index: N, row: y, value:
|
|
2925
|
+
const y = e[N], v = y[t], A = typeof v == "number" && v > 0 ? v : 0;
|
|
2926
|
+
if (A === 0) continue;
|
|
2927
|
+
const _ = A / C, q = _ * 360;
|
|
2928
|
+
K.push({ index: N, row: y, value: A, start: H, end: H + q, fraction: _ }), H += q;
|
|
2929
2929
|
}
|
|
2930
2930
|
return K;
|
|
2931
|
-
}, [e, t,
|
|
2931
|
+
}, [e, t, C]), se = W ? /* @__PURE__ */ s("div", { className: m(M.legend, V?.legend), role: "list", children: X.map((K) => /* @__PURE__ */ z("div", { className: m(M.legendItem, V?.legendItem), role: "listitem", children: [
|
|
2932
2932
|
/* @__PURE__ */ s(
|
|
2933
2933
|
"span",
|
|
2934
2934
|
{
|
|
2935
2935
|
className: M.legendSwatch,
|
|
2936
|
-
style: { background:
|
|
2936
|
+
style: { background: j(K.index) },
|
|
2937
2937
|
"aria-hidden": "true"
|
|
2938
2938
|
}
|
|
2939
2939
|
),
|
|
2940
2940
|
/* @__PURE__ */ s("span", { className: M.legendLabel, children: String(K.row[n]) })
|
|
2941
2941
|
] }, K.index)) }) : void 0, me = ke(() => {
|
|
2942
2942
|
const K = {};
|
|
2943
|
-
for (const H of
|
|
2943
|
+
for (const H of X)
|
|
2944
2944
|
K[H.index.toString()] = {
|
|
2945
2945
|
label: String(H.row[n]),
|
|
2946
|
-
color:
|
|
2946
|
+
color: j(H.index)
|
|
2947
2947
|
};
|
|
2948
2948
|
return K;
|
|
2949
|
-
}, [
|
|
2949
|
+
}, [X]);
|
|
2950
2950
|
return /* @__PURE__ */ s(
|
|
2951
2951
|
Ve,
|
|
2952
2952
|
{
|
|
@@ -2956,8 +2956,8 @@ function jl({
|
|
|
2956
2956
|
className: ie,
|
|
2957
2957
|
style: ne,
|
|
2958
2958
|
classes: V,
|
|
2959
|
-
legend:
|
|
2960
|
-
overlay:
|
|
2959
|
+
legend: se,
|
|
2960
|
+
overlay: D && F !== null && e[F] ? /* @__PURE__ */ s(
|
|
2961
2961
|
et,
|
|
2962
2962
|
{
|
|
2963
2963
|
row: { [F.toString()]: e[F][t] },
|
|
@@ -2965,17 +2965,17 @@ function jl({
|
|
|
2965
2965
|
y: 16,
|
|
2966
2966
|
containerWidth: re.current?.getBoundingClientRect().width ?? 0,
|
|
2967
2967
|
config: { [F.toString()]: me[F.toString()] },
|
|
2968
|
-
render:
|
|
2968
|
+
render: T ? () => T(e[F]) : void 0,
|
|
2969
2969
|
valueFormat: Z,
|
|
2970
2970
|
titleKey: void 0,
|
|
2971
2971
|
classes: V
|
|
2972
2972
|
}
|
|
2973
2973
|
) : null,
|
|
2974
2974
|
children: ({ width: K, height: H }) => {
|
|
2975
|
-
const N = K / 2, y = H / 2, v = Math.min(K, H) / 2 - 4,
|
|
2976
|
-
return /* @__PURE__ */
|
|
2977
|
-
/* @__PURE__ */ s("g", { children:
|
|
2978
|
-
const
|
|
2975
|
+
const N = K / 2, y = H / 2, v = Math.min(K, H) / 2 - 4, A = Et(a, v), _ = Math.min(A - 1, Et(l, v)), q = Math.max(4, A * 0.06);
|
|
2976
|
+
return /* @__PURE__ */ z(ze, { children: [
|
|
2977
|
+
/* @__PURE__ */ s("g", { children: X.map((Y) => {
|
|
2978
|
+
const J = d / 2, k = Math.min(Y.end, Y.start + J), G = Math.max(Y.start, Y.end - J), O = j(Y.index), de = F === Y.index, ge = w !== void 0 && !de, be = de && w !== void 0 ? A + q : A, Ce = Zc(N, y, be, _, k, G), Se = Q ? () => Q({ row: Y.row, value: Y.value, index: Y.index }) : void 0;
|
|
2979
2979
|
return /* @__PURE__ */ s(
|
|
2980
2980
|
"path",
|
|
2981
2981
|
{
|
|
@@ -2984,24 +2984,24 @@ function jl({
|
|
|
2984
2984
|
stroke: h > 0 ? u : "none",
|
|
2985
2985
|
strokeWidth: h,
|
|
2986
2986
|
opacity: ge ? 0.45 : 1,
|
|
2987
|
-
onMouseEnter: () => S(
|
|
2987
|
+
onMouseEnter: () => S(Y.index),
|
|
2988
2988
|
onMouseLeave: () => S(null),
|
|
2989
|
-
onClick:
|
|
2990
|
-
style:
|
|
2989
|
+
onClick: Se,
|
|
2990
|
+
style: Se ? { cursor: "pointer" } : void 0
|
|
2991
2991
|
},
|
|
2992
|
-
|
|
2992
|
+
Y.index
|
|
2993
2993
|
);
|
|
2994
2994
|
}) }),
|
|
2995
|
-
(f || b) &&
|
|
2996
|
-
const
|
|
2997
|
-
if (
|
|
2998
|
-
const k = p === "inside", G = Math.max(16,
|
|
2995
|
+
(f || b) && X.map((Y) => {
|
|
2996
|
+
const J = b ? b({ row: Y.row, value: Y.value, fraction: Y.fraction, index: Y.index }) : f ? `${String(Y.row[n])} ${Z ? Z(Y.value) : Math.round(Y.fraction * 100) + "%"}` : null;
|
|
2997
|
+
if (J == null) return null;
|
|
2998
|
+
const k = p === "inside", G = Math.max(16, A * 0.12), O = k ? (A + _) / 2 : A + G, de = Pt(N, y, O, Y.start, Y.end), ge = k ? "middle" : de.x < N - 1 ? "end" : de.x > N + 1 ? "start" : "middle";
|
|
2999
2999
|
let be = null;
|
|
3000
3000
|
if (!k && L) {
|
|
3001
|
-
const Ce = Pt(N, y,
|
|
3002
|
-
be = { x1: Ce.x, y1: Ce.y, x2:
|
|
3001
|
+
const Ce = Pt(N, y, A, Y.start, Y.end), Se = 4, g = ge === "end" ? Se : ge === "start" ? -Se : 0;
|
|
3002
|
+
be = { x1: Ce.x, y1: Ce.y, x2: de.x + g, y2: de.y };
|
|
3003
3003
|
}
|
|
3004
|
-
return /* @__PURE__ */
|
|
3004
|
+
return /* @__PURE__ */ z("g", { children: [
|
|
3005
3005
|
be && /* @__PURE__ */ s(
|
|
3006
3006
|
"line",
|
|
3007
3007
|
{
|
|
@@ -3009,7 +3009,7 @@ function jl({
|
|
|
3009
3009
|
y1: be.y1,
|
|
3010
3010
|
x2: be.x2,
|
|
3011
3011
|
y2: be.y2,
|
|
3012
|
-
stroke:
|
|
3012
|
+
stroke: j(Y.index),
|
|
3013
3013
|
strokeWidth: 1,
|
|
3014
3014
|
opacity: 0.7
|
|
3015
3015
|
}
|
|
@@ -3017,18 +3017,18 @@ function jl({
|
|
|
3017
3017
|
/* @__PURE__ */ s(
|
|
3018
3018
|
"text",
|
|
3019
3019
|
{
|
|
3020
|
-
x:
|
|
3021
|
-
y:
|
|
3020
|
+
x: de.x,
|
|
3021
|
+
y: de.y,
|
|
3022
3022
|
className: m(
|
|
3023
3023
|
M.axisLabel,
|
|
3024
3024
|
k && M.barLabelInside
|
|
3025
3025
|
),
|
|
3026
3026
|
textAnchor: ge,
|
|
3027
3027
|
dominantBaseline: "middle",
|
|
3028
|
-
children:
|
|
3028
|
+
children: J
|
|
3029
3029
|
}
|
|
3030
3030
|
)
|
|
3031
|
-
] }, `label-${
|
|
3031
|
+
] }, `label-${Y.index}`);
|
|
3032
3032
|
}),
|
|
3033
3033
|
R !== void 0 && /* @__PURE__ */ s(
|
|
3034
3034
|
"foreignObject",
|
|
@@ -3072,7 +3072,7 @@ function Kc(e, t, n, r) {
|
|
|
3072
3072
|
return `${c.x},${c.y}`;
|
|
3073
3073
|
}).join(" ");
|
|
3074
3074
|
}
|
|
3075
|
-
function
|
|
3075
|
+
function jl({
|
|
3076
3076
|
data: e,
|
|
3077
3077
|
axisKey: t,
|
|
3078
3078
|
config: n,
|
|
@@ -3091,29 +3091,29 @@ function Xl({
|
|
|
3091
3091
|
axisFormat: b,
|
|
3092
3092
|
valueFormat: R,
|
|
3093
3093
|
renderTooltip: w,
|
|
3094
|
-
showLegend:
|
|
3094
|
+
showLegend: Q = !0,
|
|
3095
3095
|
showTooltip: W = !0,
|
|
3096
|
-
emptyMessage:
|
|
3096
|
+
emptyMessage: D = "No data",
|
|
3097
3097
|
className: Z,
|
|
3098
|
-
style:
|
|
3098
|
+
style: T,
|
|
3099
3099
|
classes: $
|
|
3100
3100
|
}) {
|
|
3101
|
-
const [ie, ne] =
|
|
3101
|
+
const [ie, ne] = Re(null), V = oe(null), ue = ke(() => Object.keys(n), [n]);
|
|
3102
3102
|
if (e.length === 0)
|
|
3103
|
-
return /* @__PURE__ */ s("div", { ref: V, className: m(M.root, $?.root, Z), style:
|
|
3103
|
+
return /* @__PURE__ */ s("div", { ref: V, className: m(M.root, $?.root, Z), style: T, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: D }) }) });
|
|
3104
3104
|
const S = ke(
|
|
3105
|
-
() => e.map((
|
|
3105
|
+
() => e.map((C, X) => X / e.length * 360),
|
|
3106
3106
|
[e]
|
|
3107
3107
|
), re = ke(() => {
|
|
3108
|
-
const
|
|
3109
|
-
for (const
|
|
3108
|
+
const C = [];
|
|
3109
|
+
for (const se of ue)
|
|
3110
3110
|
for (const me of e) {
|
|
3111
|
-
const K = me[
|
|
3112
|
-
typeof K == "number" &&
|
|
3111
|
+
const K = me[se];
|
|
3112
|
+
typeof K == "number" && C.push(K);
|
|
3113
3113
|
}
|
|
3114
|
-
const [,
|
|
3115
|
-
return Math.max(1,
|
|
3116
|
-
}, [e,
|
|
3114
|
+
const [, X] = bt(C);
|
|
3115
|
+
return Math.max(1, X);
|
|
3116
|
+
}, [e, ue]), F = ke(() => qe(0, re, u).filter((X) => X > 0), [re, u]), j = F[F.length - 1] ?? re;
|
|
3117
3117
|
return /* @__PURE__ */ s(
|
|
3118
3118
|
Ve,
|
|
3119
3119
|
{
|
|
@@ -3121,9 +3121,9 @@ function Xl({
|
|
|
3121
3121
|
aspectRatio: r,
|
|
3122
3122
|
height: o,
|
|
3123
3123
|
className: Z,
|
|
3124
|
-
style:
|
|
3124
|
+
style: T,
|
|
3125
3125
|
classes: $,
|
|
3126
|
-
legend:
|
|
3126
|
+
legend: Q ? /* @__PURE__ */ s(vt, { config: n, classes: $ }) : void 0,
|
|
3127
3127
|
overlay: W && ie !== null ? /* @__PURE__ */ s(
|
|
3128
3128
|
et,
|
|
3129
3129
|
{
|
|
@@ -3138,9 +3138,9 @@ function Xl({
|
|
|
3138
3138
|
classes: $
|
|
3139
3139
|
}
|
|
3140
3140
|
) : null,
|
|
3141
|
-
children: ({ width:
|
|
3142
|
-
const
|
|
3143
|
-
return /* @__PURE__ */
|
|
3141
|
+
children: ({ width: C, height: X }) => {
|
|
3142
|
+
const se = a ? 32 : 8, me = C / 2, K = X / 2, H = Math.max(0, Math.min(C, X) / 2 - se), N = (y) => Math.max(0, y) / j * H;
|
|
3143
|
+
return /* @__PURE__ */ z(ze, { children: [
|
|
3144
3144
|
i && F.map((y) => {
|
|
3145
3145
|
const v = N(y);
|
|
3146
3146
|
return c === "circle" ? /* @__PURE__ */ s(
|
|
@@ -3164,15 +3164,15 @@ function Xl({
|
|
|
3164
3164
|
);
|
|
3165
3165
|
}),
|
|
3166
3166
|
l && S.map((y, v) => {
|
|
3167
|
-
const
|
|
3167
|
+
const A = mt(me, K, H, y);
|
|
3168
3168
|
return /* @__PURE__ */ s(
|
|
3169
3169
|
"line",
|
|
3170
3170
|
{
|
|
3171
3171
|
className: m(M.gridLine, $?.grid),
|
|
3172
3172
|
x1: me,
|
|
3173
3173
|
y1: K,
|
|
3174
|
-
x2:
|
|
3175
|
-
y2:
|
|
3174
|
+
x2: A.x,
|
|
3175
|
+
y2: A.y
|
|
3176
3176
|
},
|
|
3177
3177
|
`spoke-${v}`
|
|
3178
3178
|
);
|
|
@@ -3193,17 +3193,17 @@ function Xl({
|
|
|
3193
3193
|
);
|
|
3194
3194
|
}),
|
|
3195
3195
|
a && e.map((y, v) => {
|
|
3196
|
-
const
|
|
3196
|
+
const A = S[v], _ = mt(me, K, H + 14, A), q = _.x < me - 1 ? "end" : _.x > me + 1 ? "start" : "middle";
|
|
3197
3197
|
if (L)
|
|
3198
3198
|
return /* @__PURE__ */ s("g", { children: L({
|
|
3199
3199
|
row: y,
|
|
3200
3200
|
index: v,
|
|
3201
|
-
angle:
|
|
3201
|
+
angle: A,
|
|
3202
3202
|
x: _.x,
|
|
3203
3203
|
y: _.y,
|
|
3204
3204
|
textAnchor: q
|
|
3205
3205
|
}) }, `label-${v}`);
|
|
3206
|
-
const
|
|
3206
|
+
const Y = String(y[t]), J = b ? b(Y) : Y;
|
|
3207
3207
|
return /* @__PURE__ */ s(
|
|
3208
3208
|
"text",
|
|
3209
3209
|
{
|
|
@@ -3212,17 +3212,17 @@ function Xl({
|
|
|
3212
3212
|
y: _.y,
|
|
3213
3213
|
textAnchor: q,
|
|
3214
3214
|
dominantBaseline: "middle",
|
|
3215
|
-
children:
|
|
3215
|
+
children: J
|
|
3216
3216
|
},
|
|
3217
3217
|
`label-${v}`
|
|
3218
3218
|
);
|
|
3219
3219
|
}),
|
|
3220
|
-
|
|
3221
|
-
const v = n[y],
|
|
3222
|
-
const
|
|
3223
|
-
return mt(me, K, G, S[
|
|
3224
|
-
}), _ =
|
|
3225
|
-
return /* @__PURE__ */
|
|
3220
|
+
ue.map((y) => {
|
|
3221
|
+
const v = n[y], A = e.map((q, Y) => {
|
|
3222
|
+
const J = q[y], G = N(typeof J == "number" ? J : 0);
|
|
3223
|
+
return mt(me, K, G, S[Y]);
|
|
3224
|
+
}), _ = A.map((q) => `${q.x},${q.y}`).join(" ");
|
|
3225
|
+
return /* @__PURE__ */ z("g", { className: m(M.series, $?.series), children: [
|
|
3226
3226
|
/* @__PURE__ */ s(
|
|
3227
3227
|
"polygon",
|
|
3228
3228
|
{
|
|
@@ -3235,16 +3235,16 @@ function Xl({
|
|
|
3235
3235
|
strokeLinecap: "round"
|
|
3236
3236
|
}
|
|
3237
3237
|
),
|
|
3238
|
-
d &&
|
|
3238
|
+
d && A.map((q, Y) => /* @__PURE__ */ s(
|
|
3239
3239
|
"circle",
|
|
3240
3240
|
{
|
|
3241
3241
|
className: m(M.point, $?.point),
|
|
3242
3242
|
cx: q.x,
|
|
3243
3243
|
cy: q.y,
|
|
3244
|
-
r: ie ===
|
|
3244
|
+
r: ie === Y ? 5 : 3.5,
|
|
3245
3245
|
fill: v.color
|
|
3246
3246
|
},
|
|
3247
|
-
`${y}-${
|
|
3247
|
+
`${y}-${Y}`
|
|
3248
3248
|
))
|
|
3249
3249
|
] }, y);
|
|
3250
3250
|
}),
|
|
@@ -3254,15 +3254,15 @@ function Xl({
|
|
|
3254
3254
|
className: M.interactionLayer,
|
|
3255
3255
|
x: 0,
|
|
3256
3256
|
y: 0,
|
|
3257
|
-
width:
|
|
3258
|
-
height:
|
|
3257
|
+
width: C,
|
|
3258
|
+
height: X,
|
|
3259
3259
|
onMouseMove: (y) => {
|
|
3260
|
-
const v = y.currentTarget.getBoundingClientRect(),
|
|
3261
|
-
if (
|
|
3262
|
-
let q = Math.atan2(_,
|
|
3260
|
+
const v = y.currentTarget.getBoundingClientRect(), A = y.clientX - v.left - me, _ = y.clientY - v.top - K;
|
|
3261
|
+
if (A === 0 && _ === 0) return;
|
|
3262
|
+
let q = Math.atan2(_, A) * 180 / Math.PI + 90;
|
|
3263
3263
|
q < 0 && (q += 360), q >= 360 && (q -= 360);
|
|
3264
|
-
const
|
|
3265
|
-
ne(
|
|
3264
|
+
const Y = 360 / e.length, J = Math.round(q / Y) % e.length;
|
|
3265
|
+
ne(J);
|
|
3266
3266
|
},
|
|
3267
3267
|
onMouseLeave: () => ne(null)
|
|
3268
3268
|
}
|
|
@@ -3333,36 +3333,42 @@ function Wt(e, t) {
|
|
|
3333
3333
|
function _l(e) {
|
|
3334
3334
|
return e.map((t) => typeof t.volume == "number" ? t.volume : null);
|
|
3335
3335
|
}
|
|
3336
|
-
const
|
|
3336
|
+
const Me = 86400;
|
|
3337
3337
|
function on(e) {
|
|
3338
3338
|
switch (e) {
|
|
3339
3339
|
case "1D":
|
|
3340
|
-
return
|
|
3340
|
+
return Me;
|
|
3341
3341
|
case "5D":
|
|
3342
|
-
return 5 *
|
|
3342
|
+
return 5 * Me;
|
|
3343
3343
|
case "1M":
|
|
3344
|
-
return 30 *
|
|
3344
|
+
return 30 * Me;
|
|
3345
3345
|
case "3M":
|
|
3346
|
-
return 90 *
|
|
3346
|
+
return 90 * Me;
|
|
3347
3347
|
case "6M":
|
|
3348
|
-
return 180 *
|
|
3348
|
+
return 180 * Me;
|
|
3349
3349
|
case "1Y":
|
|
3350
|
-
return 365 *
|
|
3350
|
+
return 365 * Me;
|
|
3351
3351
|
case "5Y":
|
|
3352
|
-
return 5 * 365 *
|
|
3352
|
+
return 5 * 365 * Me;
|
|
3353
|
+
case "10Y":
|
|
3354
|
+
return 10 * 365 * Me;
|
|
3355
|
+
case "20Y":
|
|
3356
|
+
return 20 * 365 * Me;
|
|
3357
|
+
case "MAX":
|
|
3358
|
+
return 100 * 365 * Me;
|
|
3353
3359
|
}
|
|
3354
3360
|
const t = /^(\d+)\s*([dDwWmMyYhH])$/.exec(e);
|
|
3355
3361
|
if (t) {
|
|
3356
3362
|
const n = Number(t[1]), r = t[2].toLowerCase();
|
|
3357
3363
|
if (r === "h") return n * 3600;
|
|
3358
|
-
if (r === "d") return n *
|
|
3359
|
-
if (r === "w") return n * 7 *
|
|
3360
|
-
if (r === "m") return n * 30 *
|
|
3361
|
-
if (r === "y") return n * 365 *
|
|
3364
|
+
if (r === "d") return n * Me;
|
|
3365
|
+
if (r === "w") return n * 7 * Me;
|
|
3366
|
+
if (r === "m") return n * 30 * Me;
|
|
3367
|
+
if (r === "y") return n * 365 * Me;
|
|
3362
3368
|
}
|
|
3363
|
-
return 30 *
|
|
3369
|
+
return 30 * Me;
|
|
3364
3370
|
}
|
|
3365
|
-
function
|
|
3371
|
+
function Yl(e) {
|
|
3366
3372
|
switch (e) {
|
|
3367
3373
|
case "1D":
|
|
3368
3374
|
return "5";
|
|
@@ -3378,11 +3384,17 @@ function Ul(e) {
|
|
|
3378
3384
|
return "D";
|
|
3379
3385
|
case "5Y":
|
|
3380
3386
|
return "W";
|
|
3387
|
+
case "10Y":
|
|
3388
|
+
return "W";
|
|
3389
|
+
case "20Y":
|
|
3390
|
+
return "M";
|
|
3391
|
+
case "MAX":
|
|
3392
|
+
return "M";
|
|
3381
3393
|
}
|
|
3382
3394
|
const t = on(e);
|
|
3383
|
-
return t >= 3 * 365 *
|
|
3395
|
+
return t >= 3 * 365 * Me ? "W" : t >= 180 * Me ? "D" : t >= 60 * Me ? "240" : t >= 14 * Me ? "60" : t >= 3 * Me ? "15" : "5";
|
|
3384
3396
|
}
|
|
3385
|
-
function
|
|
3397
|
+
function Ul(e) {
|
|
3386
3398
|
if (e === "W" || e === "M") return "5Y";
|
|
3387
3399
|
if (e === "D") return "1Y";
|
|
3388
3400
|
const t = Number(e);
|
|
@@ -3408,13 +3420,13 @@ function Vl({
|
|
|
3408
3420
|
showConfigPanel: b = !0,
|
|
3409
3421
|
onCrosshair: R,
|
|
3410
3422
|
onVisibleRangeChange: w,
|
|
3411
|
-
className:
|
|
3423
|
+
className: Q,
|
|
3412
3424
|
style: W
|
|
3413
3425
|
}) {
|
|
3414
|
-
const
|
|
3415
|
-
}),
|
|
3416
|
-
|
|
3417
|
-
const [
|
|
3426
|
+
const D = oe(null), Z = oe(null), T = oe([]), $ = oe({ from: 0, to: 0 }), ie = oe(null), ne = oe(null), V = oe(!1), ue = oe(null), S = oe(null), re = oe(1), F = oe({ width: 0, height: 0 }), j = oe(() => {
|
|
3427
|
+
}), C = oe(R), X = oe(w);
|
|
3428
|
+
C.current = R, X.current = w;
|
|
3429
|
+
const [se, me] = Re(null), [K, H] = Re(p), N = f ?? K, y = pe(
|
|
3418
3430
|
(g) => {
|
|
3419
3431
|
f === void 0 && H(g), L?.(g);
|
|
3420
3432
|
},
|
|
@@ -3422,188 +3434,188 @@ function Vl({
|
|
|
3422
3434
|
), v = ke(
|
|
3423
3435
|
() => ({ up: h, down: u, line: d }),
|
|
3424
3436
|
[h, u, d]
|
|
3425
|
-
),
|
|
3437
|
+
), A = c, _ = A.some((g) => g.type === "rsi"), q = A.some((g) => g.type === "volume"), Y = pe(() => {
|
|
3426
3438
|
const g = Z.current;
|
|
3427
3439
|
if (!g) return;
|
|
3428
3440
|
const x = g.getContext("2d");
|
|
3429
3441
|
if (!x) return;
|
|
3430
|
-
const { width:
|
|
3431
|
-
if (
|
|
3432
|
-
const
|
|
3433
|
-
x.save(), x.setTransform(1, 0, 0, 1, 0, 0), x.clearRect(0, 0, g.width, g.height), x.scale(
|
|
3434
|
-
const I = pl(
|
|
3435
|
-
if (
|
|
3436
|
-
gl(x,
|
|
3442
|
+
const { width: ee, height: E } = F.current;
|
|
3443
|
+
if (ee === 0 || E === 0) return;
|
|
3444
|
+
const U = re.current;
|
|
3445
|
+
x.save(), x.setTransform(1, 0, 0, 1, 0, 0), x.clearRect(0, 0, g.width, g.height), x.scale(U, U);
|
|
3446
|
+
const I = pl(D.current, v), fe = ln(D.current), ce = T.current;
|
|
3447
|
+
if (ce.length === 0) {
|
|
3448
|
+
gl(x, ee, E, I), x.restore();
|
|
3437
3449
|
return;
|
|
3438
3450
|
}
|
|
3439
|
-
const
|
|
3440
|
-
$.current = { from:
|
|
3441
|
-
const
|
|
3442
|
-
const Ie = ye -
|
|
3443
|
-
return
|
|
3444
|
-
}, Ae =
|
|
3445
|
-
Lt(x,
|
|
3446
|
-
for (let
|
|
3447
|
-
const Ie =
|
|
3448
|
-
He && kl(x, He, Ie,
|
|
3451
|
+
const B = Nt(ee, E, _, q), { from: le, to: ye } = hl($.current, ce.length);
|
|
3452
|
+
$.current = { from: le, to: ye };
|
|
3453
|
+
const te = ce.slice(Math.max(0, Math.floor(le)), Math.min(ce.length, Math.ceil(ye) + 1)), ae = (he) => {
|
|
3454
|
+
const Ie = ye - le + 1, He = B.plotWidth / Ie;
|
|
3455
|
+
return B.plotLeft + (he - le + 0.5) * He;
|
|
3456
|
+
}, Ae = B.plotWidth / (ye - le + 1), De = A.map((he) => ml(he, ce)).filter((he) => he !== null).map((he) => ({ ...he, color: fe(he.color) })), xe = cn(B.main, te, De, le, ye);
|
|
3457
|
+
Lt(x, B.plotLeft, B.plotRight, xe, I), yl(x, B, xe, i, I), x.save(), x.beginPath(), x.rect(B.plotLeft, xe.paneTop, B.plotWidth, xe.paneHeight), x.clip();
|
|
3458
|
+
for (let he = 0; he < A.length; he++) {
|
|
3459
|
+
const Ie = A[he], He = De[he];
|
|
3460
|
+
He && kl(x, He, Ie, ce, le, ye, ae, xe);
|
|
3449
3461
|
}
|
|
3450
|
-
if (o === "candle" ? vl(x,
|
|
3451
|
-
const
|
|
3452
|
-
Lt(x,
|
|
3462
|
+
if (o === "candle" ? vl(x, ce, le, ye, ae, Ae, xe, { up: I.up, down: I.down }) : o === "bar" ? bl(x, ce, le, ye, ae, Ae, xe, { up: I.up, down: I.down }) : xl(x, ce, le, ye, ae, xe, I.line, o === "area"), x.restore(), B.volume) {
|
|
3463
|
+
const he = fl(B.volume, ce, le, ye);
|
|
3464
|
+
Lt(x, B.plotLeft, B.plotRight, he, I, !0), Ft(x, B, B.volume, "Volume", I), x.save(), x.beginPath(), x.rect(B.plotLeft, he.paneTop, B.plotWidth, he.paneHeight), x.clip(), Ml(x, ce, le, ye, ae, Ae, he, { up: I.up, down: I.down }), x.restore();
|
|
3453
3465
|
}
|
|
3454
|
-
if (
|
|
3455
|
-
const
|
|
3456
|
-
paneTop:
|
|
3457
|
-
paneBottom:
|
|
3458
|
-
paneHeight:
|
|
3466
|
+
if (B.rsi) {
|
|
3467
|
+
const he = A.find((tt) => tt.type === "rsi"), Ie = he && he.type === "rsi" ? he.period ?? 14 : 14, He = he && he.type === "rsi" ? he.overbought ?? 70 : 70, Ge = he && he.type === "rsi" ? he.oversold ?? 30 : 30, Ee = (he && he.type === "rsi" ? he.color : void 0) ?? "var(--crk-chart-5)", xt = fe(Ee), kt = tl(ce, Ie), Oe = {
|
|
3468
|
+
paneTop: B.rsi.top,
|
|
3469
|
+
paneBottom: B.rsi.bottom,
|
|
3470
|
+
paneHeight: B.rsi.height,
|
|
3459
3471
|
priceMin: 0,
|
|
3460
3472
|
priceMax: 100,
|
|
3461
3473
|
ticks: [Ge, 50, He]
|
|
3462
3474
|
};
|
|
3463
|
-
Lt(x,
|
|
3475
|
+
Lt(x, B.plotLeft, B.plotRight, Oe, I, !0), Ft(x, B, B.rsi, `RSI ${Ie}`, I), x.save(), x.beginPath(), x.rect(B.plotLeft, Oe.paneTop, B.plotWidth, Oe.paneHeight), x.clip(), Qe(x, kt, le, ye, ae, Oe, xt), x.restore(), wl(x, B, Oe, He, Ge, I);
|
|
3464
3476
|
}
|
|
3465
|
-
$l(x,
|
|
3466
|
-
}, [o,
|
|
3467
|
-
|
|
3468
|
-
const
|
|
3477
|
+
$l(x, B, ce, le, ye, n, I), ie.current && Nl(x, B, ie.current, ce, le, ye, ae, i, xe, N, I), x.restore();
|
|
3478
|
+
}, [o, A, _, q, i, v, n, N]);
|
|
3479
|
+
j.current = Y;
|
|
3480
|
+
const J = pe(() => {
|
|
3469
3481
|
if (S.current === null) {
|
|
3470
3482
|
if (typeof requestAnimationFrame > "u") {
|
|
3471
|
-
|
|
3483
|
+
j.current();
|
|
3472
3484
|
return;
|
|
3473
3485
|
}
|
|
3474
3486
|
S.current = requestAnimationFrame(() => {
|
|
3475
|
-
S.current = null,
|
|
3487
|
+
S.current = null, j.current();
|
|
3476
3488
|
});
|
|
3477
3489
|
}
|
|
3478
3490
|
}, []);
|
|
3479
|
-
|
|
3480
|
-
const g =
|
|
3491
|
+
zt(() => {
|
|
3492
|
+
const g = D.current;
|
|
3481
3493
|
if (!g) return;
|
|
3482
3494
|
const x = () => {
|
|
3483
|
-
const
|
|
3484
|
-
re.current =
|
|
3495
|
+
const E = g.getBoundingClientRect(), U = typeof window < "u" && window.devicePixelRatio || 1;
|
|
3496
|
+
re.current = U, F.current = { width: E.width, height: E.height };
|
|
3485
3497
|
const I = Z.current;
|
|
3486
|
-
I && (I.width = Math.round(
|
|
3498
|
+
I && (I.width = Math.round(E.width * U), I.height = Math.round(E.height * U), I.style.width = `${E.width}px`, I.style.height = `${E.height}px`), J();
|
|
3487
3499
|
};
|
|
3488
3500
|
if (x(), typeof ResizeObserver > "u") return;
|
|
3489
|
-
const
|
|
3490
|
-
return
|
|
3491
|
-
}, [
|
|
3501
|
+
const ee = new ResizeObserver(x);
|
|
3502
|
+
return ee.observe(g), () => ee.disconnect();
|
|
3503
|
+
}, [J]), Le(() => {
|
|
3492
3504
|
let g = !1;
|
|
3493
|
-
const x = Math.floor(Date.now() / 1e3),
|
|
3494
|
-
|
|
3505
|
+
const x = Math.floor(Date.now() / 1e3), ee = Xt(n), E = r === "MAX", U = r !== void 0 ? on(r) : ee * l, I = r !== void 0 ? Math.max(10, Math.ceil(U / ee)) : l, fe = E ? 0 : x - U;
|
|
3506
|
+
T.current = [], $.current = { from: 0, to: 0 }, J(), e.getBars({ symbol: t, resolution: n, from: fe, to: x, countBack: I }).then((B) => {
|
|
3495
3507
|
if (g) return;
|
|
3496
|
-
const
|
|
3497
|
-
|
|
3498
|
-
const
|
|
3508
|
+
const le = [...B].sort((te, ae) => te.time - ae.time);
|
|
3509
|
+
T.current = le;
|
|
3510
|
+
const ye = le.length - 1;
|
|
3499
3511
|
if (r !== void 0)
|
|
3500
|
-
$.current = { from: 0, to:
|
|
3512
|
+
$.current = { from: 0, to: ye };
|
|
3501
3513
|
else {
|
|
3502
|
-
const
|
|
3514
|
+
const te = Math.min(le.length, Math.min(200, l));
|
|
3503
3515
|
$.current = {
|
|
3504
|
-
from: Math.max(0,
|
|
3505
|
-
to:
|
|
3516
|
+
from: Math.max(0, ye - te + 1),
|
|
3517
|
+
to: ye
|
|
3506
3518
|
};
|
|
3507
3519
|
}
|
|
3508
|
-
|
|
3520
|
+
X.current?.($.current, le), J();
|
|
3509
3521
|
}).catch(() => {
|
|
3510
3522
|
});
|
|
3511
|
-
const
|
|
3523
|
+
const ce = e.subscribeBars({
|
|
3512
3524
|
symbol: t,
|
|
3513
3525
|
resolution: n,
|
|
3514
|
-
onTick: (
|
|
3526
|
+
onTick: (B) => {
|
|
3515
3527
|
if (g) return;
|
|
3516
|
-
const
|
|
3517
|
-
if (
|
|
3518
|
-
|
|
3519
|
-
else if (!
|
|
3520
|
-
|
|
3521
|
-
const
|
|
3522
|
-
|
|
3528
|
+
const le = T.current, ye = le[le.length - 1];
|
|
3529
|
+
if (ye && ye.time === B.time)
|
|
3530
|
+
le[le.length - 1] = B;
|
|
3531
|
+
else if (!ye || B.time > ye.time) {
|
|
3532
|
+
le.push(B);
|
|
3533
|
+
const te = $.current;
|
|
3534
|
+
te.to >= le.length - 2 && ($.current = { from: te.from + 1, to: te.to + 1 });
|
|
3523
3535
|
}
|
|
3524
|
-
|
|
3536
|
+
J();
|
|
3525
3537
|
}
|
|
3526
3538
|
});
|
|
3527
|
-
return
|
|
3528
|
-
g = !0,
|
|
3539
|
+
return ue.current = ce, () => {
|
|
3540
|
+
g = !0, ue.current !== null && (e.unsubscribeBars(ue.current), ue.current = null);
|
|
3529
3541
|
};
|
|
3530
3542
|
}, [e, t, n, r, l]);
|
|
3531
3543
|
const k = pe((g) => {
|
|
3532
|
-
me(g),
|
|
3544
|
+
me(g), C.current?.(g);
|
|
3533
3545
|
}, []), G = pe((g) => {
|
|
3534
3546
|
g.currentTarget.setPointerCapture(g.pointerId);
|
|
3535
3547
|
const x = $.current;
|
|
3536
3548
|
ne.current = { startX: g.clientX, from: x.from, to: x.to };
|
|
3537
3549
|
}, []), O = pe(
|
|
3538
3550
|
(g) => {
|
|
3539
|
-
const x = g.currentTarget.getBoundingClientRect(),
|
|
3540
|
-
if (ie.current = { x:
|
|
3541
|
-
const { startX: fe, from:
|
|
3542
|
-
let De =
|
|
3543
|
-
const
|
|
3544
|
-
De < 0 && (
|
|
3551
|
+
const x = g.currentTarget.getBoundingClientRect(), ee = g.clientX - x.left, E = g.clientY - x.top;
|
|
3552
|
+
if (ie.current = { x: ee, y: E }, ne.current) {
|
|
3553
|
+
const { startX: fe, from: ce, to: B } = ne.current, { width: le } = F.current, ye = Math.max(1, le - Ct), te = B - ce + 1, ae = ye / te, Ae = -(g.clientX - fe) / ae;
|
|
3554
|
+
let De = ce + Ae, xe = B + Ae;
|
|
3555
|
+
const he = T.current.length;
|
|
3556
|
+
De < 0 && (Se(), De = 0, xe = te - 1), xe > he - 1 && (xe = he - 1, De = xe - te + 1), $.current = { from: De, to: xe }, X.current?.($.current, T.current);
|
|
3545
3557
|
}
|
|
3546
|
-
const
|
|
3547
|
-
if (
|
|
3548
|
-
const fe = I.to - I.from + 1,
|
|
3549
|
-
k({ barIndex: ye, bar:
|
|
3558
|
+
const U = Nt(x.width, x.height, _, q), I = $.current;
|
|
3559
|
+
if (ee >= U.plotLeft && ee <= U.plotRight) {
|
|
3560
|
+
const fe = I.to - I.from + 1, ce = U.plotWidth / fe, B = Math.round(I.from + (ee - U.plotLeft) / ce - 0.5), le = T.current, ye = Math.max(0, Math.min(le.length - 1, B)), te = le[ye] ?? null, ae = Ll(E, U, le, I.from, I.to);
|
|
3561
|
+
k({ barIndex: ye, bar: te, priceAtCursor: ae });
|
|
3550
3562
|
} else
|
|
3551
3563
|
k(null);
|
|
3552
|
-
|
|
3564
|
+
J();
|
|
3553
3565
|
},
|
|
3554
|
-
[_, q,
|
|
3555
|
-
),
|
|
3566
|
+
[_, q, J, k]
|
|
3567
|
+
), de = pe((g) => {
|
|
3556
3568
|
g.currentTarget.releasePointerCapture(g.pointerId), ne.current = null;
|
|
3557
3569
|
}, []), ge = pe(() => {
|
|
3558
|
-
ie.current = null, ne.current = null, k(null),
|
|
3559
|
-
}, [
|
|
3570
|
+
ie.current = null, ne.current = null, k(null), J();
|
|
3571
|
+
}, [J, k]), be = pe(
|
|
3560
3572
|
(g) => {
|
|
3561
3573
|
g.preventDefault();
|
|
3562
|
-
const x = g.currentTarget.getBoundingClientRect(),
|
|
3574
|
+
const x = g.currentTarget.getBoundingClientRect(), ee = g.clientX - x.left, E = Nt(x.width, x.height, _, q), U = $.current, I = T.current;
|
|
3563
3575
|
if (I.length === 0) return;
|
|
3564
|
-
const fe =
|
|
3565
|
-
|
|
3566
|
-
Math.min(I.length,
|
|
3567
|
-
),
|
|
3568
|
-
let
|
|
3569
|
-
|
|
3576
|
+
const fe = U.to - U.from + 1, ce = g.deltaY > 0 ? 1 + Ot : 1 / (1 + Ot), B = Math.max(
|
|
3577
|
+
E.plotWidth / cl,
|
|
3578
|
+
Math.min(I.length, E.plotWidth / il, fe * ce)
|
|
3579
|
+
), le = U.from + (ee - E.plotLeft) / (E.plotWidth / fe), ye = (le - U.from) / fe;
|
|
3580
|
+
let te = le - ye * B, ae = te + B - 1;
|
|
3581
|
+
te < 0 && (te = 0, ae = B - 1), ae > I.length - 1 && (ae = I.length - 1, te = ae - B + 1), $.current = { from: te, to: ae }, X.current?.($.current, I), J();
|
|
3570
3582
|
},
|
|
3571
|
-
[_, q,
|
|
3583
|
+
[_, q, J]
|
|
3572
3584
|
), Ce = pe(
|
|
3573
3585
|
(g) => {
|
|
3574
|
-
const x = $.current,
|
|
3575
|
-
if (
|
|
3576
|
-
let
|
|
3577
|
-
if (g.key === "ArrowLeft")
|
|
3578
|
-
else if (g.key === "ArrowRight")
|
|
3586
|
+
const x = $.current, ee = x.to - x.from + 1, E = T.current;
|
|
3587
|
+
if (E.length === 0) return;
|
|
3588
|
+
let U = 0;
|
|
3589
|
+
if (g.key === "ArrowLeft") U = -Math.max(1, Math.floor(ee * 0.1));
|
|
3590
|
+
else if (g.key === "ArrowRight") U = Math.max(1, Math.floor(ee * 0.1));
|
|
3579
3591
|
else return;
|
|
3580
3592
|
g.preventDefault();
|
|
3581
|
-
let I = x.from +
|
|
3582
|
-
I < 0 && (I = 0, fe =
|
|
3593
|
+
let I = x.from + U, fe = x.to + U;
|
|
3594
|
+
I < 0 && (I = 0, fe = ee - 1), fe > E.length - 1 && (fe = E.length - 1, I = fe - ee + 1), $.current = { from: I, to: fe }, X.current?.($.current, E), J();
|
|
3583
3595
|
},
|
|
3584
|
-
[
|
|
3585
|
-
),
|
|
3596
|
+
[J]
|
|
3597
|
+
), Se = pe(() => {
|
|
3586
3598
|
if (V.current) return;
|
|
3587
|
-
const g =
|
|
3599
|
+
const g = T.current;
|
|
3588
3600
|
if (g.length === 0) return;
|
|
3589
3601
|
V.current = !0;
|
|
3590
|
-
const x =
|
|
3591
|
-
e.getBars({ symbol: t, resolution: n, from:
|
|
3602
|
+
const x = Xt(n), ee = g[0].time, E = ee - x * l, U = ee - x;
|
|
3603
|
+
e.getBars({ symbol: t, resolution: n, from: E, to: U, countBack: l }).then((I) => {
|
|
3592
3604
|
if (I.length === 0) {
|
|
3593
3605
|
V.current = !1;
|
|
3594
3606
|
return;
|
|
3595
3607
|
}
|
|
3596
|
-
const
|
|
3597
|
-
|
|
3608
|
+
const ce = [...I].sort((le, ye) => le.time - ye.time).filter((le) => le.time < ee), B = $.current;
|
|
3609
|
+
T.current = [...ce, ...g], $.current = { from: B.from + ce.length, to: B.to + ce.length }, V.current = !1, J();
|
|
3598
3610
|
}).catch(() => {
|
|
3599
3611
|
V.current = !1;
|
|
3600
3612
|
});
|
|
3601
|
-
}, [e, t, n, l,
|
|
3602
|
-
return /* @__PURE__ */
|
|
3613
|
+
}, [e, t, n, l, J]);
|
|
3614
|
+
return /* @__PURE__ */ z(
|
|
3603
3615
|
"div",
|
|
3604
3616
|
{
|
|
3605
|
-
ref:
|
|
3606
|
-
className: m(M.root,
|
|
3617
|
+
ref: D,
|
|
3618
|
+
className: m(M.root, Q),
|
|
3607
3619
|
style: { ...W, height: a, position: "relative" },
|
|
3608
3620
|
tabIndex: 0,
|
|
3609
3621
|
role: "figure",
|
|
@@ -3617,13 +3629,13 @@ function Vl({
|
|
|
3617
3629
|
className: M.svg,
|
|
3618
3630
|
onPointerDown: G,
|
|
3619
3631
|
onPointerMove: O,
|
|
3620
|
-
onPointerUp:
|
|
3632
|
+
onPointerUp: de,
|
|
3621
3633
|
onPointerLeave: ge,
|
|
3622
3634
|
onWheel: be,
|
|
3623
3635
|
style: { cursor: ne.current ? "grabbing" : "crosshair", touchAction: "none" }
|
|
3624
3636
|
}
|
|
3625
3637
|
),
|
|
3626
|
-
/* @__PURE__ */
|
|
3638
|
+
/* @__PURE__ */ z(
|
|
3627
3639
|
"div",
|
|
3628
3640
|
{
|
|
3629
3641
|
className: M.tradingHeader,
|
|
@@ -3639,19 +3651,19 @@ function Vl({
|
|
|
3639
3651
|
gap: 8
|
|
3640
3652
|
},
|
|
3641
3653
|
children: [
|
|
3642
|
-
/* @__PURE__ */
|
|
3654
|
+
/* @__PURE__ */ z("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 }, children: [
|
|
3643
3655
|
/* @__PURE__ */ s("strong", { children: t }),
|
|
3644
3656
|
/* @__PURE__ */ s("span", { style: { color: "var(--crk-color-text-muted)" }, children: n }),
|
|
3645
|
-
|
|
3657
|
+
se?.bar && /* @__PURE__ */ z("span", { style: { color: "var(--crk-color-text-muted)", whiteSpace: "nowrap" }, children: [
|
|
3646
3658
|
"O ",
|
|
3647
|
-
|
|
3659
|
+
se.bar.open.toFixed(i),
|
|
3648
3660
|
" · H ",
|
|
3649
|
-
|
|
3661
|
+
se.bar.high.toFixed(i),
|
|
3650
3662
|
" · L",
|
|
3651
3663
|
" ",
|
|
3652
|
-
|
|
3664
|
+
se.bar.low.toFixed(i),
|
|
3653
3665
|
" · C ",
|
|
3654
|
-
|
|
3666
|
+
se.bar.close.toFixed(i)
|
|
3655
3667
|
] })
|
|
3656
3668
|
] }),
|
|
3657
3669
|
b && /* @__PURE__ */ s("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ s(
|
|
@@ -3660,7 +3672,7 @@ function Vl({
|
|
|
3660
3672
|
position: "bottom",
|
|
3661
3673
|
asChild: !0,
|
|
3662
3674
|
trigger: /* @__PURE__ */ s(
|
|
3663
|
-
|
|
3675
|
+
Ut,
|
|
3664
3676
|
{
|
|
3665
3677
|
variant: "ghost",
|
|
3666
3678
|
size: "sm",
|
|
@@ -3699,7 +3711,7 @@ function dl({
|
|
|
3699
3711
|
timezone: e,
|
|
3700
3712
|
onTimezoneChange: t
|
|
3701
3713
|
}) {
|
|
3702
|
-
return /* @__PURE__ */
|
|
3714
|
+
return /* @__PURE__ */ z("div", { style: { minWidth: 220, padding: 4 }, children: [
|
|
3703
3715
|
/* @__PURE__ */ s(
|
|
3704
3716
|
"div",
|
|
3705
3717
|
{
|
|
@@ -3711,7 +3723,7 @@ function dl({
|
|
|
3711
3723
|
children: "Settings"
|
|
3712
3724
|
}
|
|
3713
3725
|
),
|
|
3714
|
-
/* @__PURE__ */
|
|
3726
|
+
/* @__PURE__ */ z("label", { style: { display: "flex", flexDirection: "column", gap: 4, padding: "4px" }, children: [
|
|
3715
3727
|
/* @__PURE__ */ s("span", { style: { fontSize: "var(--crk-font-size-xs)", color: "var(--crk-color-text-muted)" }, children: "Timezone" }),
|
|
3716
3728
|
/* @__PURE__ */ s(
|
|
3717
3729
|
Vt,
|
|
@@ -3725,7 +3737,7 @@ function dl({
|
|
|
3725
3737
|
] });
|
|
3726
3738
|
}
|
|
3727
3739
|
function ul() {
|
|
3728
|
-
return /* @__PURE__ */
|
|
3740
|
+
return /* @__PURE__ */ z(
|
|
3729
3741
|
"svg",
|
|
3730
3742
|
{
|
|
3731
3743
|
viewBox: "0 0 24 24",
|
|
@@ -3805,7 +3817,7 @@ function fl(e, t, n, r) {
|
|
|
3805
3817
|
const l = qe(0, o || 1, 3), a = Math.max(l[l.length - 1], o);
|
|
3806
3818
|
return { paneTop: e.top, paneBottom: e.bottom, paneHeight: e.height, priceMin: 0, priceMax: a, ticks: l };
|
|
3807
3819
|
}
|
|
3808
|
-
function
|
|
3820
|
+
function $e(e, t) {
|
|
3809
3821
|
const n = (e - t.priceMin) / (t.priceMax - t.priceMin || 1);
|
|
3810
3822
|
return t.paneBottom - n * t.paneHeight;
|
|
3811
3823
|
}
|
|
@@ -3845,7 +3857,7 @@ function gl(e, t, n, r) {
|
|
|
3845
3857
|
function Lt(e, t, n, r, o, c = !1) {
|
|
3846
3858
|
e.strokeStyle = o.grid, e.lineWidth = 1, e.beginPath();
|
|
3847
3859
|
for (const i of r.ticks) {
|
|
3848
|
-
const l = Math.round(
|
|
3860
|
+
const l = Math.round($e(i, r)) + 0.5;
|
|
3849
3861
|
e.moveTo(t, l), e.lineTo(n, l);
|
|
3850
3862
|
}
|
|
3851
3863
|
e.stroke();
|
|
@@ -3853,35 +3865,35 @@ function Lt(e, t, n, r, o, c = !1) {
|
|
|
3853
3865
|
function yl(e, t, n, r, o) {
|
|
3854
3866
|
e.fillStyle = o.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle";
|
|
3855
3867
|
for (const c of n.ticks) {
|
|
3856
|
-
const i =
|
|
3868
|
+
const i = $e(c, n);
|
|
3857
3869
|
e.fillText(c.toFixed(r), t.plotRight + 6, i);
|
|
3858
3870
|
}
|
|
3859
3871
|
}
|
|
3860
3872
|
function vl(e, t, n, r, o, c, i, l) {
|
|
3861
3873
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(1, c * 0.7);
|
|
3862
3874
|
for (let d = a; d <= h; d++) {
|
|
3863
|
-
const f = t[d], p = o(d), L =
|
|
3875
|
+
const f = t[d], p = o(d), L = $e(f.open, i), b = $e(f.close, i), R = $e(f.high, i), w = $e(f.low, i), W = f.close >= f.open ? l.up : l.down;
|
|
3864
3876
|
e.strokeStyle = W, e.fillStyle = W, e.beginPath();
|
|
3865
|
-
const
|
|
3866
|
-
e.moveTo(
|
|
3867
|
-
const Z = Math.min(L, b),
|
|
3868
|
-
e.fillRect(Math.round(p - u / 2), Math.round(Z), Math.round(u), Math.round(
|
|
3877
|
+
const D = Math.round(p) + 0.5;
|
|
3878
|
+
e.moveTo(D, R), e.lineTo(D, w), e.stroke();
|
|
3879
|
+
const Z = Math.min(L, b), T = Math.max(1, Math.abs(b - L));
|
|
3880
|
+
e.fillRect(Math.round(p - u / 2), Math.round(Z), Math.round(u), Math.round(T));
|
|
3869
3881
|
}
|
|
3870
3882
|
}
|
|
3871
3883
|
function bl(e, t, n, r, o, c, i, l) {
|
|
3872
3884
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(2, Math.min(c * 0.4, 8));
|
|
3873
3885
|
e.lineWidth = Math.max(1, Math.min(2, c * 0.18)), e.lineCap = "butt";
|
|
3874
3886
|
for (let d = a; d <= h; d++) {
|
|
3875
|
-
const f = t[d], p = Math.round(o(d)) + 0.5, L =
|
|
3876
|
-
e.strokeStyle =
|
|
3887
|
+
const f = t[d], p = Math.round(o(d)) + 0.5, L = $e(f.high, i), b = $e(f.low, i), R = $e(f.open, i), w = $e(f.close, i), Q = f.close >= f.open;
|
|
3888
|
+
e.strokeStyle = Q ? l.up : l.down, e.beginPath(), e.moveTo(p, L), e.lineTo(p, b), e.moveTo(p - u, R), e.lineTo(p, R), e.moveTo(p, w), e.lineTo(p + u, w), e.stroke();
|
|
3877
3889
|
}
|
|
3878
3890
|
}
|
|
3879
3891
|
function xl(e, t, n, r, o, c, i, l) {
|
|
3880
3892
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r));
|
|
3881
3893
|
if (!(h <= a)) {
|
|
3882
|
-
e.strokeStyle = i, e.lineWidth = 1.5, e.beginPath(), e.moveTo(o(a),
|
|
3894
|
+
e.strokeStyle = i, e.lineWidth = 1.5, e.beginPath(), e.moveTo(o(a), $e(t[a].close, c));
|
|
3883
3895
|
for (let u = a + 1; u <= h; u++)
|
|
3884
|
-
e.lineTo(o(u),
|
|
3896
|
+
e.lineTo(o(u), $e(t[u].close, c));
|
|
3885
3897
|
e.stroke(), l && (e.globalAlpha = 0.18, e.fillStyle = i, e.lineTo(o(h), c.paneBottom), e.lineTo(o(a), c.paneBottom), e.closePath(), e.fill(), e.globalAlpha = 1);
|
|
3886
3898
|
}
|
|
3887
3899
|
}
|
|
@@ -3896,12 +3908,12 @@ function kl(e, t, n, r, o, c, i, l) {
|
|
|
3896
3908
|
for (let d = a; d <= h; d++) {
|
|
3897
3909
|
const f = t.upper[d];
|
|
3898
3910
|
if (f == null) continue;
|
|
3899
|
-
const p = i(d), L =
|
|
3911
|
+
const p = i(d), L = $e(f, l);
|
|
3900
3912
|
u ? e.lineTo(p, L) : (e.moveTo(p, L), u = !0);
|
|
3901
3913
|
}
|
|
3902
3914
|
for (let d = h; d >= a; d--) {
|
|
3903
3915
|
const f = t.lower[d];
|
|
3904
|
-
f != null && e.lineTo(i(d),
|
|
3916
|
+
f != null && e.lineTo(i(d), $e(f, l));
|
|
3905
3917
|
}
|
|
3906
3918
|
e.closePath(), e.fill(), e.globalAlpha = 1, Qe(e, t.upper, o, c, i, l, t.color), Qe(e, t.lower, o, c, i, l, t.color), Qe(e, t.middle, o, c, i, l, t.color);
|
|
3907
3919
|
}
|
|
@@ -3915,7 +3927,7 @@ function Qe(e, t, n, r, o, c, i) {
|
|
|
3915
3927
|
l = !1;
|
|
3916
3928
|
continue;
|
|
3917
3929
|
}
|
|
3918
|
-
const f = o(u), p =
|
|
3930
|
+
const f = o(u), p = $e(d, c);
|
|
3919
3931
|
l ? e.lineTo(f, p) : (e.moveTo(f, p), l = !0);
|
|
3920
3932
|
}
|
|
3921
3933
|
e.stroke();
|
|
@@ -3927,7 +3939,7 @@ function Ml(e, t, n, r, o, c, i, l) {
|
|
|
3927
3939
|
if (p === 0) continue;
|
|
3928
3940
|
const L = f.close >= f.open;
|
|
3929
3941
|
e.fillStyle = L ? l.up : l.down, e.globalAlpha = 0.55;
|
|
3930
|
-
const b =
|
|
3942
|
+
const b = $e(p, i), R = i.paneBottom - b;
|
|
3931
3943
|
e.fillRect(Math.round(o(d) - u / 2), Math.round(b), Math.round(u), Math.round(R));
|
|
3932
3944
|
}
|
|
3933
3945
|
e.globalAlpha = 1;
|
|
@@ -3935,10 +3947,10 @@ function Ml(e, t, n, r, o, c, i, l) {
|
|
|
3935
3947
|
function wl(e, t, n, r, o, c) {
|
|
3936
3948
|
e.strokeStyle = c.grid, e.setLineDash([3, 3]), e.beginPath();
|
|
3937
3949
|
for (const i of [r, o]) {
|
|
3938
|
-
const l = Math.round(
|
|
3950
|
+
const l = Math.round($e(i, n)) + 0.5;
|
|
3939
3951
|
e.moveTo(t.plotLeft, l), e.lineTo(t.plotRight, l);
|
|
3940
3952
|
}
|
|
3941
|
-
e.stroke(), e.setLineDash([]), e.fillStyle = c.axis, e.font = "10px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(String(r), t.plotRight + 6,
|
|
3953
|
+
e.stroke(), e.setLineDash([]), e.fillStyle = c.axis, e.font = "10px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(String(r), t.plotRight + 6, $e(r, n)), e.fillText(String(o), t.plotRight + 6, $e(o, n));
|
|
3942
3954
|
}
|
|
3943
3955
|
function Ft(e, t, n, r, o) {
|
|
3944
3956
|
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);
|
|
@@ -3962,11 +3974,11 @@ function Nl(e, t, n, r, o, c, i, l, a, h, u) {
|
|
|
3962
3974
|
if (r[b]) {
|
|
3963
3975
|
const w = sn(r[b].time, h);
|
|
3964
3976
|
e.font = "11px system-ui, sans-serif", e.textBaseline = "middle";
|
|
3965
|
-
const
|
|
3977
|
+
const D = e.measureText(w).width + 8 * 2, Z = At, T = Math.max(
|
|
3966
3978
|
t.plotLeft,
|
|
3967
|
-
Math.min(t.plotRight -
|
|
3979
|
+
Math.min(t.plotRight - D, R - D / 2)
|
|
3968
3980
|
), $ = t.plotBottom;
|
|
3969
|
-
e.fillStyle = u.text, e.fillRect(
|
|
3981
|
+
e.fillStyle = u.text, e.fillRect(T, $, D, Z), e.fillStyle = u.bg, e.textAlign = "center", e.fillText(w, T + D / 2, $ + Z / 2);
|
|
3970
3982
|
}
|
|
3971
3983
|
e.restore();
|
|
3972
3984
|
}
|
|
@@ -4009,7 +4021,7 @@ function Sl(e) {
|
|
|
4009
4021
|
function Te(e) {
|
|
4010
4022
|
return e < 10 ? `0${e}` : String(e);
|
|
4011
4023
|
}
|
|
4012
|
-
function
|
|
4024
|
+
function Xt(e) {
|
|
4013
4025
|
if (e === "D") return 86400;
|
|
4014
4026
|
if (e === "W") return 86400 * 7;
|
|
4015
4027
|
if (e === "M") return 86400 * 30;
|
|
@@ -4036,7 +4048,7 @@ function Tl(e, t) {
|
|
|
4036
4048
|
}
|
|
4037
4049
|
return n;
|
|
4038
4050
|
}
|
|
4039
|
-
const Cl =
|
|
4051
|
+
const Cl = Ne(
|
|
4040
4052
|
({
|
|
4041
4053
|
data: e,
|
|
4042
4054
|
width: t = 80,
|
|
@@ -4052,10 +4064,10 @@ const Cl = $e(
|
|
|
4052
4064
|
}, d) => {
|
|
4053
4065
|
const { line: f, area: p, last: L } = ke(() => {
|
|
4054
4066
|
if (e.length === 0) return { line: "", area: "", last: null };
|
|
4055
|
-
const b = o, R = Math.max(1, t - b * 2), w = Math.max(1, n - b * 2), [
|
|
4056
|
-
return { line: $, area: ie, last:
|
|
4067
|
+
const b = o, R = Math.max(1, t - b * 2), w = Math.max(1, n - b * 2), [Q, W] = bt(e), D = Je([0, Math.max(1, e.length - 1)], [b, b + R]), Z = Je([Q, W], [b + w, b]), T = e.map((ne, V) => ({ x: D(V), y: Z(ne) })), $ = Tl(T, c), ie = i ? `${$} L ${T[T.length - 1].x} ${b + w} L ${T[0].x} ${b + w} Z` : "";
|
|
4068
|
+
return { line: $, area: ie, last: T[T.length - 1] };
|
|
4057
4069
|
}, [e, t, n, o, c, i]);
|
|
4058
|
-
return /* @__PURE__ */
|
|
4070
|
+
return /* @__PURE__ */ z(
|
|
4059
4071
|
"svg",
|
|
4060
4072
|
{
|
|
4061
4073
|
ref: d,
|
|
@@ -4088,9 +4100,9 @@ const Cl = $e(
|
|
|
4088
4100
|
Cl.displayName = "Sparkline";
|
|
4089
4101
|
export {
|
|
4090
4102
|
Fl as AreaChart,
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4103
|
+
Xl as BarChart,
|
|
4104
|
+
Ut as Button,
|
|
4105
|
+
Xi as Checkbox,
|
|
4094
4106
|
Vt as Dropdown,
|
|
4095
4107
|
uo as DropdownItem,
|
|
4096
4108
|
Pl as Form,
|
|
@@ -4098,15 +4110,15 @@ export {
|
|
|
4098
4110
|
Hl as FormRow,
|
|
4099
4111
|
ri as Input,
|
|
4100
4112
|
Ol as LineChart,
|
|
4101
|
-
|
|
4113
|
+
Xn as Link,
|
|
4102
4114
|
br as List,
|
|
4103
4115
|
xr as ListItem,
|
|
4104
4116
|
yt as Modal,
|
|
4105
|
-
|
|
4117
|
+
zl as PieChart,
|
|
4106
4118
|
qt as Popover,
|
|
4107
|
-
|
|
4119
|
+
jl as RadarChart,
|
|
4108
4120
|
Vi as Radio,
|
|
4109
|
-
|
|
4121
|
+
Ui as RadioGroup,
|
|
4110
4122
|
Pi as Select,
|
|
4111
4123
|
Cl as Sparkline,
|
|
4112
4124
|
El as Table,
|
|
@@ -4119,11 +4131,11 @@ export {
|
|
|
4119
4131
|
on as periodToSeconds,
|
|
4120
4132
|
tl as rsi,
|
|
4121
4133
|
Qc as sma,
|
|
4122
|
-
|
|
4123
|
-
|
|
4134
|
+
Ul as suggestPeriodForResolution,
|
|
4135
|
+
Yl as suggestResolutionForPeriod,
|
|
4124
4136
|
xo as useClickOutside,
|
|
4125
4137
|
Mo as useFocusTrap,
|
|
4126
4138
|
St as useKeyboard,
|
|
4127
|
-
|
|
4139
|
+
Yr as useTableSort,
|
|
4128
4140
|
_l as volumeSeries
|
|
4129
4141
|
};
|