xedonium 0.2.0 → 0.3.0
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/README.md +15 -7
- package/dist/components/ActionMenu.d.ts +4 -1
- package/dist/components/AppShell.d.ts +1 -0
- package/dist/components/BodyText.d.ts +8 -0
- package/dist/components/Checkbox.d.ts +4 -1
- package/dist/components/Drawer.d.ts +6 -2
- package/dist/components/FloatingPanel.d.ts +21 -0
- package/dist/components/HelperText.d.ts +8 -0
- package/dist/components/Label.d.ts +12 -0
- package/dist/components/PageTitle.d.ts +8 -0
- package/dist/components/Popover.d.ts +6 -2
- package/dist/components/Select.d.ts +8 -2
- package/dist/components/Slider.d.ts +1 -1
- package/dist/components/TextLink.d.ts +13 -0
- package/dist/components/TimePicker.d.ts +10 -2
- package/dist/components/Tooltip.d.ts +2 -1
- package/dist/hooks/useDismissable.d.ts +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/styles.css +88 -0
- package/dist/utils/position.d.ts +14 -0
- package/dist/xedonium.cjs +12 -12
- package/dist/xedonium.js +1834 -1389
- package/package.json +6 -4
package/dist/xedonium.js
CHANGED
|
@@ -1,47 +1,117 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { createPortal as
|
|
4
|
-
const
|
|
5
|
-
const n =
|
|
6
|
-
|
|
1
|
+
import { jsxs as f, jsx as t, Fragment as re } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as A, useEffect as P, useId as O, useState as D, useLayoutEffect as ve, cloneElement as Ve, createContext as Xe, useContext as Je, Children as et, useMemo as je, useCallback as Fe, forwardRef as tt } from "react";
|
|
3
|
+
import { createPortal as ae } from "react-dom";
|
|
4
|
+
const V = (e, r, a) => {
|
|
5
|
+
const n = A(a);
|
|
6
|
+
P(() => {
|
|
7
|
+
n.current = a;
|
|
8
|
+
}), P(() => {
|
|
9
|
+
if (!e) return;
|
|
10
|
+
const s = Array.isArray(r) ? r : [r], l = (i) => {
|
|
11
|
+
s.some((c) => {
|
|
12
|
+
var u;
|
|
13
|
+
return (u = c.current) == null ? void 0 : u.contains(i.target);
|
|
14
|
+
}) || n.current("outside");
|
|
15
|
+
}, o = (i) => {
|
|
16
|
+
i.key === "Escape" && n.current("escape");
|
|
17
|
+
};
|
|
18
|
+
return document.addEventListener("mousedown", l), document.addEventListener("keydown", o), () => {
|
|
19
|
+
document.removeEventListener("mousedown", l), document.removeEventListener("keydown", o);
|
|
20
|
+
};
|
|
21
|
+
}, [e]);
|
|
22
|
+
}, K = 8, rt = { top: "bottom", bottom: "top", left: "right", right: "left" }, at = (e = "bottom") => {
|
|
23
|
+
const [r, a = "center"] = e.split("-");
|
|
24
|
+
return { side: r, align: a };
|
|
25
|
+
}, Ne = (e, r, a, n, s) => {
|
|
26
|
+
if (e === "top" || e === "bottom") {
|
|
27
|
+
const i = e === "bottom" ? a.bottom + s : a.top - s - n.height, c = r === "start" ? a.left : r === "end" ? a.right - n.width : a.left + a.width / 2 - n.width / 2;
|
|
28
|
+
return { top: i, left: c };
|
|
29
|
+
}
|
|
30
|
+
const l = e === "right" ? a.right + s : a.left - s - n.width;
|
|
31
|
+
return { top: r === "start" ? a.top : r === "end" ? a.bottom - n.height : a.top + a.height / 2 - n.height / 2, left: l };
|
|
32
|
+
}, J = (e, r, a, n, s) => e === "bottom" ? Math.max(0, r.bottom + n + a.height - (s.height - K)) : e === "top" ? Math.max(0, K - (r.top - n - a.height)) : e === "right" ? Math.max(0, r.right + n + a.width - (s.width - K)) : Math.max(0, K - (r.left - n - a.width)), Be = (e, r, { placement: a = "bottom", gap: n = 6, viewport: s } = {}) => {
|
|
33
|
+
const l = s ?? { width: document.documentElement.clientWidth, height: window.innerHeight }, { side: o, align: i } = at(a);
|
|
34
|
+
let c = o;
|
|
35
|
+
if (o === "auto") {
|
|
36
|
+
const v = ["bottom", "top", "right", "left"];
|
|
37
|
+
c = v.find((N) => J(N, e, r, n, l) === 0), c || (c = v.reduce(
|
|
38
|
+
(N, M) => J(M, e, r, n, l) < J(N, e, r, n, l) ? M : N
|
|
39
|
+
));
|
|
40
|
+
} else if (J(o, e, r, n, l) > 0) {
|
|
41
|
+
const v = rt[o];
|
|
42
|
+
J(v, e, r, n, l) < J(o, e, r, n, l) && (c = v);
|
|
43
|
+
}
|
|
44
|
+
const u = c === "top" || c === "bottom", b = (v) => u ? [v.left, v.left + r.width] : [v.top, v.top + r.height], d = u ? l.width : l.height, p = (v) => {
|
|
45
|
+
const [N, M] = b(v);
|
|
46
|
+
return Math.max(0, K - N) + Math.max(0, M - (d - K));
|
|
7
47
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
48
|
+
let m = i, g = Ne(c, i, e, r, n);
|
|
49
|
+
if ((i === "start" || i === "end") && p(g) > 0) {
|
|
50
|
+
const v = i === "start" ? "end" : "start", N = Ne(c, v, e, r, n);
|
|
51
|
+
p(N) < p(g) && (g = N, m = v);
|
|
52
|
+
}
|
|
53
|
+
const h = Math.min(Math.max(K, g.top), Math.max(K, l.height - K - r.height)), x = Math.min(Math.max(K, g.left), Math.max(K, l.width - K - r.width));
|
|
54
|
+
return { top: h, left: x, side: c, align: m };
|
|
55
|
+
}, nt = (e) => {
|
|
56
|
+
const r = e.getBoundingClientRect(), a = r.width * r.height;
|
|
57
|
+
if (a === 0) return !1;
|
|
58
|
+
let n = {
|
|
59
|
+
top: Math.max(r.top, 0),
|
|
60
|
+
left: Math.max(r.left, 0),
|
|
61
|
+
bottom: Math.min(r.bottom, window.innerHeight),
|
|
62
|
+
right: Math.min(r.right, document.documentElement.clientWidth)
|
|
63
|
+
};
|
|
64
|
+
for (let o = e.parentElement; o && o !== document.body; o = o.parentElement) {
|
|
65
|
+
const { overflowX: i, overflowY: c } = getComputedStyle(o);
|
|
66
|
+
if (i === "visible" && c === "visible") continue;
|
|
67
|
+
const u = o.getBoundingClientRect();
|
|
68
|
+
n = {
|
|
69
|
+
top: Math.max(n.top, u.top),
|
|
70
|
+
left: Math.max(n.left, u.left),
|
|
71
|
+
bottom: Math.min(n.bottom, u.bottom),
|
|
72
|
+
right: Math.min(n.right, u.right)
|
|
20
73
|
};
|
|
21
|
-
}
|
|
22
|
-
const
|
|
23
|
-
return
|
|
74
|
+
}
|
|
75
|
+
const s = Math.max(0, n.right - n.left), l = Math.max(0, n.bottom - n.top);
|
|
76
|
+
return s * l / a < 0.5;
|
|
77
|
+
}, lt = 6, Oe = ({ text: e, children: r, placement: a = "bottom", className: n = "" }) => {
|
|
78
|
+
const s = O(), l = A(null), o = A(null), [i, c] = D(!1), [u, b] = D(null), d = () => c(!0), p = () => {
|
|
79
|
+
c(!1), b(null);
|
|
80
|
+
};
|
|
81
|
+
if (ve(() => {
|
|
82
|
+
if (!i || !l.current || !o.current) return;
|
|
83
|
+
const g = l.current.getBoundingClientRect(), h = o.current.getBoundingClientRect(), { top: x, left: v } = Be(g, h, { placement: a, gap: lt });
|
|
84
|
+
b({ top: x, left: v });
|
|
85
|
+
}, [i, e, a]), P(() => {
|
|
86
|
+
if (!i) return;
|
|
87
|
+
const g = (h) => h.key === "Escape" && p();
|
|
88
|
+
return window.addEventListener("keydown", g), window.addEventListener("scroll", p, !0), window.addEventListener("resize", p), () => {
|
|
89
|
+
window.removeEventListener("keydown", g), window.removeEventListener("scroll", p, !0), window.removeEventListener("resize", p);
|
|
90
|
+
};
|
|
91
|
+
}, [i]), !e) return r;
|
|
92
|
+
const m = r.props["aria-label"] !== e;
|
|
93
|
+
return /* @__PURE__ */ f(
|
|
24
94
|
"span",
|
|
25
95
|
{
|
|
26
|
-
ref:
|
|
27
|
-
className: `inline-flex [&>:disabled]:pointer-events-none has-[>:disabled]:cursor-not-allowed ${
|
|
28
|
-
onMouseEnter:
|
|
29
|
-
onMouseLeave:
|
|
30
|
-
onFocus: (
|
|
31
|
-
onBlur:
|
|
32
|
-
onPointerDown:
|
|
96
|
+
ref: l,
|
|
97
|
+
className: `inline-flex [&>:disabled]:pointer-events-none has-[>:disabled]:cursor-not-allowed ${n}`,
|
|
98
|
+
onMouseEnter: d,
|
|
99
|
+
onMouseLeave: p,
|
|
100
|
+
onFocus: (g) => g.target.matches(":focus-visible") && d(),
|
|
101
|
+
onBlur: p,
|
|
102
|
+
onPointerDown: p,
|
|
33
103
|
children: [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/* @__PURE__ */
|
|
104
|
+
m ? Ve(r, { "aria-describedby": s }) : r,
|
|
105
|
+
m && /* @__PURE__ */ t("span", { id: s, hidden: !0, children: e }),
|
|
106
|
+
i && ae(
|
|
107
|
+
/* @__PURE__ */ t(
|
|
38
108
|
"div",
|
|
39
109
|
{
|
|
40
|
-
ref:
|
|
110
|
+
ref: o,
|
|
41
111
|
"aria-hidden": "true",
|
|
42
|
-
style: { top: (
|
|
112
|
+
style: { top: (u == null ? void 0 : u.top) ?? 0, left: (u == null ? void 0 : u.left) ?? 0, visibility: u ? "visible" : "hidden" },
|
|
43
113
|
className: "pointer-events-none fixed z-[var(--xd-z-tooltip,100)] w-max max-w-[16rem] border border-app-border bg-app-card px-2.5 py-1.5 text-xs normal-case tracking-normal text-app-text shadow-xl",
|
|
44
|
-
children:
|
|
114
|
+
children: e
|
|
45
115
|
}
|
|
46
116
|
),
|
|
47
117
|
document.body
|
|
@@ -49,118 +119,175 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
49
119
|
]
|
|
50
120
|
}
|
|
51
121
|
);
|
|
52
|
-
},
|
|
122
|
+
}, H = (e) => {
|
|
53
123
|
const {
|
|
54
124
|
onClick: r,
|
|
55
125
|
tooltip: a,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
126
|
+
tooltipPlacement: n,
|
|
127
|
+
variant: s = "default",
|
|
128
|
+
className: l = "",
|
|
129
|
+
children: o,
|
|
130
|
+
type: i = "button",
|
|
60
131
|
disabled: c = !1,
|
|
61
|
-
...
|
|
62
|
-
} =
|
|
132
|
+
...u
|
|
133
|
+
} = e, d = /* @__PURE__ */ t(
|
|
63
134
|
"button",
|
|
64
135
|
{
|
|
65
|
-
type:
|
|
136
|
+
type: i,
|
|
66
137
|
onClick: r,
|
|
67
138
|
disabled: c,
|
|
68
139
|
className: `text-xs font-semibold uppercase tracking-widest ${{
|
|
69
140
|
default: "bg-app-strong text-app-bg border border-app-strong hover:bg-app-text",
|
|
70
141
|
secondary: "bg-app-bg text-app-text border border-app-border hover:border-app-strong hover:text-app-text",
|
|
71
142
|
danger: "bg-red-500/10 text-red-700 dark:text-red-400 border border-red-500/30 hover:bg-red-500/20",
|
|
143
|
+
success: "bg-emerald-600 text-white border border-emerald-600 hover:bg-emerald-500 hover:border-emerald-500 dark:bg-emerald-500 dark:text-black dark:border-emerald-500 dark:hover:bg-emerald-400 dark:hover:border-emerald-400",
|
|
72
144
|
warning: "bg-amber-400 text-black border border-amber-400 hover:bg-amber-300 hover:border-amber-300"
|
|
73
|
-
}[
|
|
74
|
-
...
|
|
75
|
-
children:
|
|
145
|
+
}[s]} px-3 py-2 transition disabled:cursor-not-allowed disabled:opacity-50 ${l}`,
|
|
146
|
+
...u,
|
|
147
|
+
children: o
|
|
76
148
|
}
|
|
77
149
|
);
|
|
78
|
-
return a ? /* @__PURE__ */
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
150
|
+
return a ? /* @__PURE__ */ t(Oe, { text: a, placement: n, children: d }) : d;
|
|
151
|
+
}, X = ({
|
|
152
|
+
open: e,
|
|
153
|
+
anchorRef: r,
|
|
154
|
+
placement: a = "bottom-start",
|
|
155
|
+
gap: n = 4,
|
|
156
|
+
matchWidth: s = !1,
|
|
157
|
+
panelRef: l,
|
|
158
|
+
className: o = "",
|
|
159
|
+
style: i,
|
|
160
|
+
children: c,
|
|
161
|
+
...u
|
|
162
|
+
}) => {
|
|
163
|
+
const b = A(null), d = l ?? b, [p, m] = D(null);
|
|
164
|
+
return ve(() => {
|
|
165
|
+
if (!e) {
|
|
166
|
+
m(null);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const g = () => {
|
|
170
|
+
var M;
|
|
171
|
+
const x = (M = r.current) == null ? void 0 : M.getBoundingClientRect(), v = d.current;
|
|
172
|
+
if (!x || !v) return;
|
|
173
|
+
const N = {
|
|
174
|
+
...Be(x, { width: v.offsetWidth, height: v.offsetHeight }, { placement: a, gap: n }),
|
|
175
|
+
width: s ? x.width : void 0,
|
|
176
|
+
// the anchor was scrolled out of view: hide rather than hover over unrelated content
|
|
177
|
+
hidden: nt(r.current)
|
|
178
|
+
};
|
|
179
|
+
m(
|
|
180
|
+
(y) => y && y.top === N.top && y.left === N.left && y.width === N.width && y.hidden === N.hidden ? y : N
|
|
181
|
+
);
|
|
91
182
|
};
|
|
92
|
-
|
|
93
|
-
|
|
183
|
+
g(), window.addEventListener("scroll", g, !0), window.addEventListener("resize", g);
|
|
184
|
+
const h = typeof ResizeObserver > "u" ? null : new ResizeObserver(g);
|
|
185
|
+
return h && d.current && h.observe(d.current), () => {
|
|
186
|
+
window.removeEventListener("scroll", g, !0), window.removeEventListener("resize", g), h == null || h.disconnect();
|
|
94
187
|
};
|
|
95
|
-
}, [
|
|
96
|
-
|
|
97
|
-
|
|
188
|
+
}, [e, r, d, a, n, s]), e ? ae(
|
|
189
|
+
/* @__PURE__ */ t(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
ref: d,
|
|
193
|
+
...u,
|
|
194
|
+
style: {
|
|
195
|
+
position: "fixed",
|
|
196
|
+
top: (p == null ? void 0 : p.top) ?? 0,
|
|
197
|
+
left: (p == null ? void 0 : p.left) ?? 0,
|
|
198
|
+
minWidth: p == null ? void 0 : p.width,
|
|
199
|
+
// invisible (but focusable) until measured, so children can take focus on mount; also hidden while scrolled out
|
|
200
|
+
opacity: p && !p.hidden ? 1 : 0,
|
|
201
|
+
pointerEvents: p && !p.hidden ? void 0 : "none",
|
|
202
|
+
...i
|
|
203
|
+
},
|
|
204
|
+
className: `z-[var(--xd-z-popover,85)] ${o}`,
|
|
205
|
+
children: c
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
document.body
|
|
209
|
+
) : null;
|
|
210
|
+
}, st = {
|
|
211
|
+
default: "text-app-text hover:bg-app-bg",
|
|
212
|
+
warning: "text-amber-700 hover:bg-amber-400/10 dark:text-amber-400"
|
|
213
|
+
}, hr = ({ label: e, trigger: r, variant: a = "secondary", items: n, placement: s = "bottom-start", className: l = "" }) => {
|
|
214
|
+
const [o, i] = D(!1), c = A(null), u = A(null), b = O();
|
|
215
|
+
V(o, [c, u], (p) => {
|
|
216
|
+
var m, g;
|
|
217
|
+
i(!1), p === "escape" && ((g = (m = c.current) == null ? void 0 : m.querySelector("button")) == null || g.focus());
|
|
218
|
+
});
|
|
219
|
+
const d = (p) => {
|
|
220
|
+
i(!1), p.onClick();
|
|
98
221
|
};
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
222
|
+
return /* @__PURE__ */ f("div", { ref: c, className: `relative inline-block ${l}`, children: [
|
|
223
|
+
/* @__PURE__ */ t(
|
|
224
|
+
H,
|
|
102
225
|
{
|
|
103
|
-
onClick: () =>
|
|
226
|
+
onClick: () => i((p) => !p),
|
|
104
227
|
variant: a,
|
|
105
|
-
"aria-label":
|
|
228
|
+
"aria-label": e,
|
|
106
229
|
"aria-haspopup": "menu",
|
|
107
|
-
"aria-expanded":
|
|
108
|
-
"aria-controls":
|
|
230
|
+
"aria-expanded": o,
|
|
231
|
+
"aria-controls": o ? b : void 0,
|
|
109
232
|
children: r
|
|
110
233
|
}
|
|
111
234
|
),
|
|
112
|
-
|
|
113
|
-
|
|
235
|
+
/* @__PURE__ */ t(
|
|
236
|
+
X,
|
|
114
237
|
{
|
|
115
|
-
|
|
238
|
+
open: o,
|
|
239
|
+
anchorRef: c,
|
|
240
|
+
panelRef: u,
|
|
241
|
+
placement: s,
|
|
242
|
+
id: b,
|
|
116
243
|
role: "menu",
|
|
117
|
-
"aria-label":
|
|
118
|
-
className: "
|
|
119
|
-
children: n.map((
|
|
244
|
+
"aria-label": e,
|
|
245
|
+
className: "w-60 max-w-[calc(100vw-1rem)] overflow-hidden border border-app-border bg-app-card shadow-lg",
|
|
246
|
+
children: n.map((p) => /* @__PURE__ */ f(
|
|
120
247
|
"button",
|
|
121
248
|
{
|
|
122
249
|
type: "button",
|
|
123
250
|
role: "menuitem",
|
|
124
|
-
disabled:
|
|
125
|
-
"aria-haspopup":
|
|
126
|
-
onClick: () =>
|
|
127
|
-
className: `flex w-full items-center gap-2 border-b border-app-border bg-app-card px-3 py-2.5 text-left transition last:border-b-0 disabled:cursor-not-allowed disabled:opacity-50 ${
|
|
251
|
+
disabled: p.disabled,
|
|
252
|
+
"aria-haspopup": p.hasDialog ? "dialog" : void 0,
|
|
253
|
+
onClick: () => d(p),
|
|
254
|
+
className: `flex w-full items-center gap-2 border-b border-app-border bg-app-card px-3 py-2.5 text-left transition last:border-b-0 disabled:cursor-not-allowed disabled:opacity-50 ${st[p.tone || "default"]}`,
|
|
128
255
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
|
|
256
|
+
/* @__PURE__ */ f("span", { className: "min-w-0 flex-1", children: [
|
|
257
|
+
/* @__PURE__ */ t("span", { className: "block text-xs font-medium uppercase tracking-widest", children: p.label }),
|
|
258
|
+
p.description && /* @__PURE__ */ t("span", { className: "mt-0.5 block text-xs normal-case tracking-normal text-app-muted", children: p.description })
|
|
132
259
|
] }),
|
|
133
|
-
|
|
260
|
+
p.badge != null && /* @__PURE__ */ t("span", { className: "font-mono text-xs", children: p.badge })
|
|
134
261
|
]
|
|
135
262
|
},
|
|
136
|
-
|
|
263
|
+
p.key
|
|
137
264
|
))
|
|
138
265
|
}
|
|
139
266
|
)
|
|
140
267
|
] });
|
|
141
|
-
},
|
|
268
|
+
}, we = ({ className: e }) => /* @__PURE__ */ t(
|
|
142
269
|
"svg",
|
|
143
270
|
{
|
|
144
271
|
"aria-hidden": "true",
|
|
145
272
|
focusable: "false",
|
|
146
|
-
className:
|
|
273
|
+
className: e ?? "h-5 w-5 text-app-soft",
|
|
147
274
|
fill: "none",
|
|
148
275
|
viewBox: "0 0 24 24",
|
|
149
276
|
stroke: "currentColor",
|
|
150
277
|
strokeWidth: 1.5,
|
|
151
|
-
children: /* @__PURE__ */
|
|
278
|
+
children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
152
279
|
}
|
|
153
|
-
),
|
|
280
|
+
), ot = ({ className: e }) => /* @__PURE__ */ t(
|
|
154
281
|
"svg",
|
|
155
282
|
{
|
|
156
283
|
"aria-hidden": "true",
|
|
157
284
|
focusable: "false",
|
|
158
|
-
className:
|
|
285
|
+
className: e ?? "w-4 h-4 text-red-600 dark:text-red-400 flex-shrink-0",
|
|
159
286
|
fill: "none",
|
|
160
287
|
viewBox: "0 0 24 24",
|
|
161
288
|
stroke: "currentColor",
|
|
162
289
|
strokeWidth: 2,
|
|
163
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ t(
|
|
164
291
|
"path",
|
|
165
292
|
{
|
|
166
293
|
strokeLinecap: "round",
|
|
@@ -169,36 +296,36 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
169
296
|
}
|
|
170
297
|
)
|
|
171
298
|
}
|
|
172
|
-
),
|
|
299
|
+
), it = {
|
|
173
300
|
info: "border-app-border bg-app-card text-app-text",
|
|
174
301
|
success: "border-emerald-500/40 bg-emerald-500/10 text-emerald-800 dark:text-emerald-300",
|
|
175
302
|
warning: "border-amber-500/50 bg-amber-400/15 text-amber-900 dark:text-amber-200",
|
|
176
303
|
danger: "border-red-500/40 bg-red-500/10 text-red-800 dark:text-red-300"
|
|
177
|
-
},
|
|
304
|
+
}, mr = ({ tone: e = "info", title: r, onClose: a, icon: n, className: s = "", children: l }) => /* @__PURE__ */ f(
|
|
178
305
|
"div",
|
|
179
306
|
{
|
|
180
|
-
role:
|
|
181
|
-
className: `flex items-start gap-3 border px-4 py-3 text-sm ${
|
|
307
|
+
role: e === "danger" || e === "warning" ? "alert" : "status",
|
|
308
|
+
className: `flex items-start gap-3 border px-4 py-3 text-sm ${it[e]} ${s}`,
|
|
182
309
|
children: [
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
r && /* @__PURE__ */
|
|
186
|
-
l && /* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ t("span", { className: "mt-0.5 shrink-0", children: n ?? /* @__PURE__ */ t(ot, { className: "h-4 w-4" }) }),
|
|
311
|
+
/* @__PURE__ */ f("div", { className: "min-w-0 flex-1", children: [
|
|
312
|
+
r && /* @__PURE__ */ t("div", { className: "font-semibold", children: r }),
|
|
313
|
+
l && /* @__PURE__ */ t("div", { className: r ? "mt-0.5 opacity-90" : "", children: l })
|
|
187
314
|
] }),
|
|
188
|
-
a && /* @__PURE__ */
|
|
315
|
+
a && /* @__PURE__ */ t(
|
|
189
316
|
"button",
|
|
190
317
|
{
|
|
191
318
|
type: "button",
|
|
192
319
|
onClick: a,
|
|
193
320
|
"aria-label": "Dismiss",
|
|
194
|
-
className: "shrink-0 opacity-70 transition hover:opacity-100",
|
|
195
|
-
children: /* @__PURE__ */
|
|
321
|
+
className: "-m-2 shrink-0 p-2 opacity-70 transition hover:opacity-100",
|
|
322
|
+
children: /* @__PURE__ */ t(we, { className: "h-4 w-4" })
|
|
196
323
|
}
|
|
197
324
|
)
|
|
198
325
|
]
|
|
199
326
|
}
|
|
200
|
-
),
|
|
201
|
-
} }),
|
|
327
|
+
), We = Xe({ activeTheme: "dark", toggleTheme: () => {
|
|
328
|
+
} }), ct = () => Je(We), dt = (e) => `flex h-9 w-9 items-center justify-center border transition hover:bg-app-card/80 ${e ? "border-app-strong bg-app-card/80" : "border-transparent hover:border-app-border"}`, pt = () => /* @__PURE__ */ t(
|
|
202
329
|
"svg",
|
|
203
330
|
{
|
|
204
331
|
"aria-hidden": "true",
|
|
@@ -208,9 +335,9 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
208
335
|
fill: "none",
|
|
209
336
|
stroke: "currentColor",
|
|
210
337
|
strokeWidth: "1.8",
|
|
211
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12.79A9 9 0 1111.21 3a7 7 0 009.79 9.79z" })
|
|
212
339
|
}
|
|
213
|
-
),
|
|
340
|
+
), ut = () => /* @__PURE__ */ f(
|
|
214
341
|
"svg",
|
|
215
342
|
{
|
|
216
343
|
"aria-hidden": "true",
|
|
@@ -221,8 +348,8 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
221
348
|
stroke: "currentColor",
|
|
222
349
|
strokeWidth: "1.8",
|
|
223
350
|
children: [
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "4" }),
|
|
352
|
+
/* @__PURE__ */ t(
|
|
226
353
|
"path",
|
|
227
354
|
{
|
|
228
355
|
strokeLinecap: "round",
|
|
@@ -231,127 +358,132 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
231
358
|
)
|
|
232
359
|
]
|
|
233
360
|
}
|
|
234
|
-
),
|
|
235
|
-
const { activeTheme: r, toggleTheme: a } =
|
|
236
|
-
return
|
|
237
|
-
},
|
|
238
|
-
brand:
|
|
361
|
+
), ze = ({ variant: e = "button" }) => {
|
|
362
|
+
const { activeTheme: r, toggleTheme: a } = ct(), n = r === "dark", s = `Switch to ${n ? "light" : "dark"} theme`, l = n ? /* @__PURE__ */ t(pt, {}) : /* @__PURE__ */ t(ut, {});
|
|
363
|
+
return e === "toolbar" ? /* @__PURE__ */ t(Oe, { text: s, children: /* @__PURE__ */ t("button", { type: "button", onClick: a, "aria-label": s, className: dt(!1), children: l }) }) : /* @__PURE__ */ t(H, { onClick: a, tooltip: s, "aria-label": s, variant: "secondary", children: l });
|
|
364
|
+
}, ht = (e) => `flex min-h-9 items-center px-2.5 py-1.5 text-xs font-semibold uppercase tracking-widest transition sm:px-3 ${e ? "bg-app-card text-app-text" : "text-app-muted hover:text-app-text"}`, fr = ({
|
|
365
|
+
brand: e,
|
|
239
366
|
logo: r,
|
|
240
367
|
brandHref: a = "/",
|
|
241
368
|
links: n = [],
|
|
242
369
|
actions: s,
|
|
243
370
|
themeToggle: l = !0,
|
|
244
371
|
hideBrandOnMobile: o = !1,
|
|
245
|
-
linkComponent:
|
|
246
|
-
linkProp:
|
|
372
|
+
linkComponent: i = "a",
|
|
373
|
+
linkProp: c = "href",
|
|
247
374
|
maxWidth: u = "max-w-5xl"
|
|
248
|
-
}) => /* @__PURE__ */
|
|
249
|
-
/* @__PURE__ */
|
|
375
|
+
}) => /* @__PURE__ */ t("header", { className: "sticky top-0 z-40 border-b border-app-border bg-app-bg/95 backdrop-blur", children: /* @__PURE__ */ f("div", { className: `mx-auto flex h-14 w-full ${u} items-center justify-between gap-3 px-4`, children: [
|
|
376
|
+
/* @__PURE__ */ f(i, { [c]: a, className: "flex min-h-9 shrink-0 items-center gap-2 text-app-text", children: [
|
|
250
377
|
r,
|
|
251
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ t("span", { className: `text-base font-bold tracking-tight ${o ? "hidden sm:inline" : ""}`, children: e })
|
|
252
379
|
] }),
|
|
253
|
-
n.length > 0 && /* @__PURE__ */
|
|
254
|
-
|
|
380
|
+
n.length > 0 && /* @__PURE__ */ t("nav", { "aria-label": "Main", className: "flex min-w-0 items-center gap-1 overflow-x-auto", children: n.map(({ href: b, label: d, active: p = !1, ...m }) => /* @__PURE__ */ t(
|
|
381
|
+
i,
|
|
255
382
|
{
|
|
256
|
-
[
|
|
257
|
-
"aria-current":
|
|
258
|
-
className:
|
|
259
|
-
...
|
|
383
|
+
[c]: b,
|
|
384
|
+
"aria-current": p ? "page" : void 0,
|
|
385
|
+
className: ht(p),
|
|
386
|
+
...m,
|
|
260
387
|
children: d
|
|
261
388
|
},
|
|
262
|
-
|
|
389
|
+
b
|
|
263
390
|
)) }),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
l && /* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ f("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
392
|
+
l && /* @__PURE__ */ t(ze, { variant: "toolbar" }),
|
|
266
393
|
s
|
|
267
394
|
] })
|
|
268
|
-
] }) }),
|
|
269
|
-
|
|
395
|
+
] }) }), mt = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])', ie = (e, r) => {
|
|
396
|
+
P(() => {
|
|
270
397
|
const a = r.current;
|
|
271
|
-
if (!
|
|
272
|
-
const n = document.activeElement, s = () => [...a.querySelectorAll(
|
|
398
|
+
if (!e || !a) return;
|
|
399
|
+
const n = document.activeElement, s = () => [...a.querySelectorAll(mt)];
|
|
273
400
|
(a.querySelector("[data-autofocus]") || s()[0] || a).focus();
|
|
274
401
|
const l = (o) => {
|
|
275
402
|
if (o.key !== "Tab") return;
|
|
276
|
-
const
|
|
277
|
-
if (!
|
|
403
|
+
const i = s();
|
|
404
|
+
if (!i.length) {
|
|
278
405
|
o.preventDefault();
|
|
279
406
|
return;
|
|
280
407
|
}
|
|
281
|
-
const
|
|
282
|
-
o.shiftKey && document.activeElement ===
|
|
408
|
+
const c = i[0], u = i[i.length - 1];
|
|
409
|
+
o.shiftKey && document.activeElement === c ? (o.preventDefault(), u.focus()) : !o.shiftKey && document.activeElement === u && (o.preventDefault(), c.focus());
|
|
283
410
|
};
|
|
284
411
|
return a.addEventListener("keydown", l), () => {
|
|
285
412
|
a.removeEventListener("keydown", l), n != null && n.isConnected && n.focus();
|
|
286
413
|
};
|
|
287
|
-
}, [
|
|
288
|
-
},
|
|
289
|
-
|
|
290
|
-
if (!
|
|
414
|
+
}, [e, r]);
|
|
415
|
+
}, ye = (e, r) => {
|
|
416
|
+
P(() => {
|
|
417
|
+
if (!e) return;
|
|
291
418
|
const a = (n) => {
|
|
292
419
|
n.key === "Escape" && r();
|
|
293
420
|
};
|
|
294
421
|
return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
|
|
295
|
-
}, [
|
|
296
|
-
},
|
|
297
|
-
const c =
|
|
298
|
-
return
|
|
299
|
-
if (!
|
|
300
|
-
const
|
|
422
|
+
}, [e, r]);
|
|
423
|
+
}, ft = { right: "right-0 border-l", left: "left-0 border-r" }, bt = ({ open: e, onClose: r, title: a, side: n = "right", width: s = "max-w-md", padded: l = !0, footer: o, children: i }) => {
|
|
424
|
+
const c = A(null), u = O();
|
|
425
|
+
return ye(e, r), ie(e, c), P(() => {
|
|
426
|
+
if (!e) return;
|
|
427
|
+
const b = document.body.style.overflow;
|
|
301
428
|
return document.body.style.overflow = "hidden", () => {
|
|
302
|
-
document.body.style.overflow =
|
|
429
|
+
document.body.style.overflow = b;
|
|
303
430
|
};
|
|
304
|
-
}, [
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
431
|
+
}, [e]), e ? ae(
|
|
432
|
+
/* @__PURE__ */ f("div", { className: "fixed inset-0 z-[var(--xd-z-modal,80)]", children: [
|
|
433
|
+
/* @__PURE__ */ t("div", { "aria-hidden": "true", className: "absolute inset-0 bg-black/30 backdrop-blur-sm", onClick: r }),
|
|
434
|
+
/* @__PURE__ */ f(
|
|
308
435
|
"aside",
|
|
309
436
|
{
|
|
310
437
|
ref: c,
|
|
311
438
|
role: "dialog",
|
|
312
439
|
"aria-modal": "true",
|
|
313
|
-
"aria-labelledby":
|
|
440
|
+
"aria-labelledby": u,
|
|
314
441
|
tabIndex: -1,
|
|
315
|
-
className: `absolute inset-y-0 flex w-full flex-col border-app-border bg-app-card shadow-2xl ${
|
|
442
|
+
className: `absolute inset-y-0 flex w-full flex-col border-app-border bg-app-card shadow-2xl ${ft[n]} ${s}`,
|
|
316
443
|
children: [
|
|
317
|
-
/* @__PURE__ */
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ f("div", { className: "flex shrink-0 items-center justify-between border-b border-app-border px-6 py-4", children: [
|
|
445
|
+
/* @__PURE__ */ t("h2", { id: u, className: "text-sm font-semibold uppercase tracking-widest text-app-soft", children: a }),
|
|
446
|
+
/* @__PURE__ */ t(H, { onClick: r, tooltip: "Close", "aria-label": "Close", variant: "secondary", children: /* @__PURE__ */ t(we, {}) })
|
|
320
447
|
] }),
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
|
|
448
|
+
/* @__PURE__ */ t("div", { className: `min-h-0 flex-1 ${l ? "overflow-y-auto p-6" : "flex flex-col"}`, children: i }),
|
|
449
|
+
o && /* @__PURE__ */ t("div", { className: "flex shrink-0 flex-wrap items-center justify-end gap-3 border-t border-app-border px-6 py-4", children: o })
|
|
323
450
|
]
|
|
324
451
|
}
|
|
325
452
|
)
|
|
326
453
|
] }),
|
|
327
454
|
document.body
|
|
328
455
|
) : null;
|
|
329
|
-
},
|
|
456
|
+
}, xt = ({ className: e }) => /* @__PURE__ */ t(
|
|
330
457
|
"svg",
|
|
331
458
|
{
|
|
332
459
|
"aria-hidden": "true",
|
|
333
460
|
focusable: "false",
|
|
334
|
-
className:
|
|
461
|
+
className: e ?? "h-5 w-5",
|
|
335
462
|
viewBox: "0 0 24 24",
|
|
336
463
|
fill: "none",
|
|
337
464
|
stroke: "currentColor",
|
|
338
465
|
strokeWidth: "2",
|
|
339
|
-
children: /* @__PURE__ */
|
|
466
|
+
children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" })
|
|
340
467
|
}
|
|
341
|
-
),
|
|
342
|
-
const [l, o] =
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
468
|
+
), br = ({ header: e, sidebar: r, sidebarTitle: a = "Menu", children: n, className: s = "" }) => {
|
|
469
|
+
const [l, o] = D(!1), i = () => o(!1);
|
|
470
|
+
P(() => {
|
|
471
|
+
const u = window.matchMedia("(min-width: 768px)"), b = (d) => d.matches && o(!1);
|
|
472
|
+
return u.addEventListener("change", b), () => u.removeEventListener("change", b);
|
|
473
|
+
}, []);
|
|
474
|
+
const c = typeof r == "function" ? r(i) : r;
|
|
475
|
+
return /* @__PURE__ */ f("div", { className: `relative flex h-screen flex-col overflow-hidden bg-app-bg text-app-text ${s}`, children: [
|
|
476
|
+
/* @__PURE__ */ f("header", { className: "flex shrink-0 items-center gap-3 border-b border-app-border bg-app-card px-4 py-2", children: [
|
|
477
|
+
r && /* @__PURE__ */ t("span", { className: "md:hidden", children: /* @__PURE__ */ t(H, { variant: "secondary", "aria-label": "Open menu", onClick: () => o(!0), children: /* @__PURE__ */ t(xt, {}) }) }),
|
|
478
|
+
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: e })
|
|
347
479
|
] }),
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
r && /* @__PURE__ */
|
|
350
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ f("div", { className: "flex min-h-0 flex-1", children: [
|
|
481
|
+
r && /* @__PURE__ */ t("aside", { className: "hidden shrink-0 md:block", children: c }),
|
|
482
|
+
/* @__PURE__ */ t("main", { className: "relative min-w-0 flex-1 overflow-y-auto p-4 sm:p-6", children: n })
|
|
351
483
|
] }),
|
|
352
|
-
r && /* @__PURE__ */
|
|
484
|
+
r && /* @__PURE__ */ t(bt, { open: l, onClose: i, title: a, side: "left", width: "max-w-xs", padded: !1, children: /* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col [&>nav]:min-h-0 [&>nav]:w-full [&>nav]:flex-1 [&>nav]:border-r-0", children: typeof r == "function" ? r(i) : r }) })
|
|
353
485
|
] });
|
|
354
|
-
},
|
|
486
|
+
}, $e = [
|
|
355
487
|
"rgb(var(--color-app-strong))",
|
|
356
488
|
"#3b82f6",
|
|
357
489
|
"#10b981",
|
|
@@ -360,84 +492,84 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
360
492
|
"#8b5cf6",
|
|
361
493
|
"#06b6d4",
|
|
362
494
|
"#ec4899"
|
|
363
|
-
],
|
|
364
|
-
const n = Math.min(0,
|
|
365
|
-
for (let
|
|
366
|
-
return { min: u, max:
|
|
367
|
-
},
|
|
368
|
-
const
|
|
369
|
-
return
|
|
370
|
-
const n =
|
|
495
|
+
], ce = (e, r) => e.color ?? $e[r % $e.length], qe = (e, r, a = 5) => {
|
|
496
|
+
const n = Math.min(0, e), s = r <= n ? n + 1 : r, l = (s - n) / (a - 1), o = 10 ** Math.floor(Math.log10(l)), i = l / o, c = (i <= 1 ? 1 : i <= 2 ? 2 : i <= 5 ? 5 : 10) * o, u = Math.floor(n / c) * c, b = Math.ceil(s / c) * c, d = [];
|
|
497
|
+
for (let p = u; p <= b + c / 2; p += c) d.push(Number(p.toPrecision(12)));
|
|
498
|
+
return { min: u, max: b, ticks: d };
|
|
499
|
+
}, gt = (e) => new Intl.NumberFormat(void 0, { notation: "compact", maximumFractionDigits: 1 }).format(e), vt = 600, _ = { top: 12, right: 16, bottom: 28, left: 44 }, Ke = () => {
|
|
500
|
+
const e = A(null), [r, a] = D(vt);
|
|
501
|
+
return P(() => {
|
|
502
|
+
const n = e.current;
|
|
371
503
|
if (!n || typeof ResizeObserver > "u") return;
|
|
372
504
|
const s = new ResizeObserver(([l]) => {
|
|
373
505
|
const o = Math.round(l.contentRect.width);
|
|
374
506
|
o > 0 && a(o);
|
|
375
507
|
});
|
|
376
508
|
return s.observe(n), () => s.disconnect();
|
|
377
|
-
}, []), [
|
|
378
|
-
},
|
|
379
|
-
/* @__PURE__ */
|
|
509
|
+
}, []), [e, r];
|
|
510
|
+
}, ke = ({ items: e }) => /* @__PURE__ */ t("ul", { className: "m-0 mt-2 flex list-none flex-wrap justify-center gap-x-4 gap-y-1 p-0 text-xs text-app-muted", children: e.map((r) => /* @__PURE__ */ f("li", { className: "flex items-center gap-1.5", children: [
|
|
511
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", className: "inline-block h-2.5 w-2.5", style: { background: r.color } }),
|
|
380
512
|
r.name
|
|
381
|
-
] }, r.name)) }),
|
|
382
|
-
const
|
|
383
|
-
return /* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
513
|
+
] }, r.name)) }), _e = ({ width: e, height: r, scale: a, labels: n, xPositions: s, label: l, children: o, legend: i }) => {
|
|
514
|
+
const c = r - _.bottom, u = c - _.top, b = (d) => _.top + u * (1 - (d - a.min) / (a.max - a.min));
|
|
515
|
+
return /* @__PURE__ */ f("figure", { className: "m-0", children: [
|
|
516
|
+
/* @__PURE__ */ f(
|
|
385
517
|
"svg",
|
|
386
518
|
{
|
|
387
519
|
role: "img",
|
|
388
520
|
"aria-label": l,
|
|
389
|
-
width:
|
|
521
|
+
width: e,
|
|
390
522
|
height: r,
|
|
391
|
-
viewBox: `0 0 ${
|
|
523
|
+
viewBox: `0 0 ${e} ${r}`,
|
|
392
524
|
className: "block max-w-full text-app-muted",
|
|
393
525
|
fontFamily: "inherit",
|
|
394
526
|
children: [
|
|
395
|
-
a.ticks.map((d) => /* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
527
|
+
a.ticks.map((d) => /* @__PURE__ */ f("g", { children: [
|
|
528
|
+
/* @__PURE__ */ t(
|
|
397
529
|
"line",
|
|
398
530
|
{
|
|
399
|
-
x1:
|
|
400
|
-
x2:
|
|
401
|
-
y1:
|
|
402
|
-
y2:
|
|
531
|
+
x1: _.left,
|
|
532
|
+
x2: e - _.right,
|
|
533
|
+
y1: b(d),
|
|
534
|
+
y2: b(d),
|
|
403
535
|
stroke: "rgb(var(--color-app-border))",
|
|
404
536
|
strokeWidth: "1",
|
|
405
537
|
strokeDasharray: d === a.min ? void 0 : "3 3"
|
|
406
538
|
}
|
|
407
539
|
),
|
|
408
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ t(
|
|
409
541
|
"text",
|
|
410
542
|
{
|
|
411
|
-
x:
|
|
412
|
-
y:
|
|
543
|
+
x: _.left - 6,
|
|
544
|
+
y: b(d),
|
|
413
545
|
textAnchor: "end",
|
|
414
546
|
dominantBaseline: "middle",
|
|
415
547
|
fontSize: "11",
|
|
416
548
|
fill: "currentColor",
|
|
417
|
-
children:
|
|
549
|
+
children: gt(d)
|
|
418
550
|
}
|
|
419
551
|
)
|
|
420
552
|
] }, d)),
|
|
421
|
-
n.map((d,
|
|
553
|
+
n.map((d, p) => /* @__PURE__ */ t(
|
|
422
554
|
"text",
|
|
423
555
|
{
|
|
424
|
-
x: s[
|
|
425
|
-
y:
|
|
556
|
+
x: s[p],
|
|
557
|
+
y: c + 16,
|
|
426
558
|
textAnchor: "middle",
|
|
427
559
|
fontSize: "11",
|
|
428
560
|
fill: "currentColor",
|
|
429
561
|
children: d
|
|
430
562
|
},
|
|
431
|
-
`${d}-${
|
|
563
|
+
`${d}-${p}`
|
|
432
564
|
)),
|
|
433
|
-
o(
|
|
565
|
+
o(b)
|
|
434
566
|
]
|
|
435
567
|
}
|
|
436
568
|
),
|
|
437
|
-
|
|
569
|
+
i
|
|
438
570
|
] });
|
|
439
|
-
},
|
|
440
|
-
labels:
|
|
571
|
+
}, Ue = (e) => e.map((r, a) => ({ name: r.name, color: ce(r, a) })), wt = ({
|
|
572
|
+
labels: e,
|
|
441
573
|
series: r,
|
|
442
574
|
height: a = 300,
|
|
443
575
|
area: n = !1,
|
|
@@ -445,50 +577,50 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
445
577
|
legend: l = !0,
|
|
446
578
|
className: o = ""
|
|
447
579
|
}) => {
|
|
448
|
-
const [
|
|
449
|
-
return /* @__PURE__ */
|
|
450
|
-
|
|
580
|
+
const [i, c] = Ke(), u = r.flatMap((h) => h.values), b = qe(Math.min(...u), Math.max(...u)), d = _.left, p = c - _.right, m = (h) => e.length === 1 ? (d + p) / 2 : d + (p - d) * h / (e.length - 1), g = e.map((h, x) => m(x));
|
|
581
|
+
return /* @__PURE__ */ t("div", { ref: i, className: o, children: /* @__PURE__ */ t(
|
|
582
|
+
_e,
|
|
451
583
|
{
|
|
452
|
-
width:
|
|
584
|
+
width: c,
|
|
453
585
|
height: a,
|
|
454
|
-
scale:
|
|
455
|
-
labels:
|
|
456
|
-
xPositions:
|
|
586
|
+
scale: b,
|
|
587
|
+
labels: e,
|
|
588
|
+
xPositions: g,
|
|
457
589
|
label: s,
|
|
458
|
-
legend: l && r.length > 1 ? /* @__PURE__ */
|
|
459
|
-
children: (
|
|
460
|
-
const
|
|
461
|
-
return r.map((
|
|
462
|
-
const
|
|
463
|
-
return /* @__PURE__ */
|
|
464
|
-
n && /* @__PURE__ */
|
|
590
|
+
legend: l && r.length > 1 ? /* @__PURE__ */ t(ke, { items: Ue(r) }) : null,
|
|
591
|
+
children: (h) => {
|
|
592
|
+
const x = h(Math.max(b.min, 0));
|
|
593
|
+
return r.map((v, N) => {
|
|
594
|
+
const M = ce(v, N), y = v.values.map((w, C) => `${m(C)},${h(w)}`);
|
|
595
|
+
return /* @__PURE__ */ f("g", { children: [
|
|
596
|
+
n && /* @__PURE__ */ t(
|
|
465
597
|
"polygon",
|
|
466
598
|
{
|
|
467
|
-
points: `${
|
|
468
|
-
fill:
|
|
599
|
+
points: `${m(0)},${x} ${y.join(" ")} ${m(v.values.length - 1)},${x}`,
|
|
600
|
+
fill: M,
|
|
469
601
|
opacity: "0.18"
|
|
470
602
|
}
|
|
471
603
|
),
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
|
|
474
|
-
] },
|
|
604
|
+
/* @__PURE__ */ t("polyline", { points: y.join(" "), fill: "none", stroke: M, strokeWidth: "2", strokeLinejoin: "round" }),
|
|
605
|
+
v.values.map((w, C) => /* @__PURE__ */ t("circle", { cx: m(C), cy: h(w), r: "3.5", fill: M, children: /* @__PURE__ */ t("title", { children: `${v.name}, ${e[C]}: ${w}` }) }, C))
|
|
606
|
+
] }, v.name);
|
|
475
607
|
});
|
|
476
608
|
}
|
|
477
609
|
}
|
|
478
610
|
) });
|
|
479
|
-
},
|
|
480
|
-
const [s, l] =
|
|
481
|
-
return /* @__PURE__ */
|
|
611
|
+
}, xr = ({ label: e = "Area chart", ...r }) => /* @__PURE__ */ t(wt, { area: !0, label: e, ...r }), yt = { sm: "h-6 w-6 text-[10px]", md: "h-9 w-9 text-xs", lg: "h-14 w-14 text-base" }, kt = (e) => (e ?? "").split(/\s+/).filter(Boolean).slice(0, 2).map((r) => r[0].toUpperCase()).join(""), gr = ({ src: e, name: r, size: a = "md", className: n = "" }) => {
|
|
612
|
+
const [s, l] = D(!1), o = e && !s;
|
|
613
|
+
return /* @__PURE__ */ t(
|
|
482
614
|
"span",
|
|
483
615
|
{
|
|
484
616
|
role: "img",
|
|
485
617
|
"aria-label": r,
|
|
486
|
-
className: `inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full border border-app-border bg-app-bg font-semibold uppercase tracking-wider text-app-soft ${
|
|
487
|
-
children: o ? /* @__PURE__ */
|
|
618
|
+
className: `inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full border border-app-border bg-app-bg font-semibold uppercase tracking-wider text-app-soft ${yt[a]} ${n}`,
|
|
619
|
+
children: o ? /* @__PURE__ */ t("img", { src: e, alt: "", className: "h-full w-full object-cover", onError: () => l(!0) }) : kt(r) || "?"
|
|
488
620
|
}
|
|
489
621
|
);
|
|
490
|
-
},
|
|
491
|
-
labels:
|
|
622
|
+
}, vr = ({
|
|
623
|
+
labels: e,
|
|
492
624
|
series: r,
|
|
493
625
|
height: a = 300,
|
|
494
626
|
stacked: n = !1,
|
|
@@ -496,285 +628,301 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
496
628
|
legend: l = !0,
|
|
497
629
|
className: o = ""
|
|
498
630
|
}) => {
|
|
499
|
-
const [
|
|
500
|
-
return /* @__PURE__ */
|
|
501
|
-
|
|
631
|
+
const [i, c] = Ke(), u = e.map((M, y) => r.reduce((w, C) => w + C.values[y], 0)), b = Math.max(...n ? u : r.flatMap((M) => M.values)), d = n ? 0 : Math.min(...r.flatMap((M) => M.values)), p = qe(d, b), m = _.left, h = (c - _.right - _.left) / e.length, x = h * 0.7, v = n ? x : x / r.length, N = e.map((M, y) => m + h * y + h / 2);
|
|
632
|
+
return /* @__PURE__ */ t("div", { ref: i, className: o, children: /* @__PURE__ */ t(
|
|
633
|
+
_e,
|
|
502
634
|
{
|
|
503
|
-
width:
|
|
635
|
+
width: c,
|
|
504
636
|
height: a,
|
|
505
|
-
scale:
|
|
506
|
-
labels:
|
|
507
|
-
xPositions:
|
|
637
|
+
scale: p,
|
|
638
|
+
labels: e,
|
|
639
|
+
xPositions: N,
|
|
508
640
|
label: s,
|
|
509
|
-
legend: l && r.length > 1 ? /* @__PURE__ */
|
|
510
|
-
children: (
|
|
511
|
-
const
|
|
512
|
-
return
|
|
513
|
-
const
|
|
514
|
-
let
|
|
515
|
-
return /* @__PURE__ */
|
|
516
|
-
const
|
|
517
|
-
let
|
|
518
|
-
const
|
|
519
|
-
return n && (
|
|
641
|
+
legend: l && r.length > 1 ? /* @__PURE__ */ t(ke, { items: Ue(r) }) : null,
|
|
642
|
+
children: (M) => {
|
|
643
|
+
const y = M(Math.max(p.min, 0));
|
|
644
|
+
return e.map((w, C) => {
|
|
645
|
+
const T = m + h * C + (h - x) / 2;
|
|
646
|
+
let L = y;
|
|
647
|
+
return /* @__PURE__ */ t("g", { children: r.map((I, j) => {
|
|
648
|
+
const B = I.values[C], z = M(B), q = Math.abs(y - z);
|
|
649
|
+
let k = Math.min(z, y);
|
|
650
|
+
const $ = T + (n ? 0 : v * j);
|
|
651
|
+
return n && (k = L - q, L = k), /* @__PURE__ */ t(
|
|
520
652
|
"rect",
|
|
521
653
|
{
|
|
522
|
-
x:
|
|
523
|
-
y:
|
|
524
|
-
width: Math.max(
|
|
525
|
-
height:
|
|
526
|
-
fill:
|
|
527
|
-
children: /* @__PURE__ */
|
|
654
|
+
x: $ + 1,
|
|
655
|
+
y: k,
|
|
656
|
+
width: Math.max(v - 2, 1),
|
|
657
|
+
height: q,
|
|
658
|
+
fill: ce(I, j),
|
|
659
|
+
children: /* @__PURE__ */ t("title", { children: `${I.name}, ${w}: ${B}` })
|
|
528
660
|
},
|
|
529
|
-
|
|
661
|
+
I.name
|
|
530
662
|
);
|
|
531
|
-
}) }, `${
|
|
663
|
+
}) }, `${w}-${C}`);
|
|
532
664
|
});
|
|
533
665
|
}
|
|
534
666
|
}
|
|
535
667
|
) });
|
|
536
|
-
},
|
|
537
|
-
const o = l ===
|
|
538
|
-
return /* @__PURE__ */
|
|
539
|
-
o || !s.href ? /* @__PURE__ */
|
|
540
|
-
!o && /* @__PURE__ */
|
|
668
|
+
}, wr = ({ as: e = "p", className: r = "", children: a, ...n }) => /* @__PURE__ */ t(e, { className: `m-0 text-sm text-app-text ${r}`, ...n, children: a }), yr = ({ items: e, linkComponent: r = "a", linkProp: a = "href", className: n = "" }) => /* @__PURE__ */ t("nav", { "aria-label": "Breadcrumb", className: n, children: /* @__PURE__ */ t("ol", { className: "m-0 flex list-none flex-wrap items-center gap-2 p-0 text-xs font-semibold uppercase tracking-widest", children: e.map((s, l) => {
|
|
669
|
+
const o = l === e.length - 1;
|
|
670
|
+
return /* @__PURE__ */ f("li", { className: "flex items-center gap-2", children: [
|
|
671
|
+
o || !s.href ? /* @__PURE__ */ t("span", { "aria-current": o ? "page" : void 0, className: o ? "text-app-text" : "text-app-muted", children: s.label }) : /* @__PURE__ */ t(r, { [a]: s.href, className: "text-app-muted transition hover:text-app-text", children: s.label }),
|
|
672
|
+
!o && /* @__PURE__ */ t("span", { "aria-hidden": "true", className: "text-app-border", children: "/" })
|
|
541
673
|
] }, `${s.label}-${l}`);
|
|
542
|
-
}) }) }),
|
|
543
|
-
const a = new Date(
|
|
544
|
-
return new Date(a.getFullYear(), a.getMonth(), Math.min(
|
|
545
|
-
},
|
|
546
|
-
const a = new Date(
|
|
674
|
+
}) }) }), Me = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Y = (e, r) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + r), pe = (e, r) => {
|
|
675
|
+
const a = new Date(e.getFullYear(), e.getMonth() + r, 1), n = new Date(a.getFullYear(), a.getMonth() + 1, 0).getDate();
|
|
676
|
+
return new Date(a.getFullYear(), a.getMonth(), Math.min(e.getDate(), n));
|
|
677
|
+
}, ee = (e, r) => !!e && !!r && e.getTime() === r.getTime(), te = (e, r) => e.getTime() < r.getTime(), Nt = (e, r, a) => !!r && te(e, r) || !!a && te(a, e), $t = (e, r = 0) => {
|
|
678
|
+
const a = new Date(e.getFullYear(), e.getMonth(), 1), n = (a.getDay() - r + 7) % 7, s = Y(a, -n), l = [];
|
|
547
679
|
for (let o = 0; o < 6; o++) {
|
|
548
|
-
const
|
|
549
|
-
if (o >= 4 &&
|
|
550
|
-
l.push(
|
|
680
|
+
const i = Array.from({ length: 7 }, (c, u) => Y(s, o * 7 + u));
|
|
681
|
+
if (o >= 4 && i[0].getMonth() !== e.getMonth()) break;
|
|
682
|
+
l.push(i);
|
|
551
683
|
}
|
|
552
684
|
return l;
|
|
553
|
-
},
|
|
554
|
-
const s = new Date(2023, 0, 1 + (
|
|
685
|
+
}, Mt = (e = 0, r) => Array.from({ length: 7 }, (a, n) => {
|
|
686
|
+
const s = new Date(2023, 0, 1 + (e + n) % 7);
|
|
555
687
|
return new Intl.DateTimeFormat(r, { weekday: "short" }).format(s);
|
|
556
|
-
}),
|
|
557
|
-
const u =
|
|
558
|
-
|
|
559
|
-
var
|
|
560
|
-
|
|
688
|
+
}), Lt = (e, r) => new Intl.DateTimeFormat(r, { month: "long", year: "numeric" }).format(e), be = (e, r) => e ? new Intl.DateTimeFormat(r, { year: "numeric", month: "short", day: "numeric" }).format(e) : "", Le = "min-h-8 min-w-8 border border-app-border bg-app-bg px-2 py-1 text-xs font-semibold text-app-text transition hover:border-app-strong disabled:cursor-not-allowed disabled:opacity-50", Ge = ({ value: e, onChange: r, rangeStart: a, rangeEnd: n, min: s, max: l, weekStartsOn: o = 0, locale: i, className: c = "" }) => {
|
|
689
|
+
const u = Me(/* @__PURE__ */ new Date()), b = e ?? a ?? u, [d, p] = D(Me(b)), [m, g] = D(new Date(b.getFullYear(), b.getMonth(), 1)), h = A(null), x = A(!1);
|
|
690
|
+
P(() => {
|
|
691
|
+
var T, L;
|
|
692
|
+
x.current && (x.current = !1, (L = (T = h.current) == null ? void 0 : T.querySelector('button[tabindex="0"]')) == null || L.focus());
|
|
561
693
|
});
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
},
|
|
565
|
-
const
|
|
566
|
-
ArrowLeft:
|
|
567
|
-
ArrowRight:
|
|
568
|
-
ArrowUp:
|
|
569
|
-
ArrowDown:
|
|
570
|
-
PageUp:
|
|
571
|
-
PageDown:
|
|
572
|
-
Home:
|
|
573
|
-
End:
|
|
694
|
+
const v = (T) => {
|
|
695
|
+
x.current = !0, p(T), (T.getMonth() !== m.getMonth() || T.getFullYear() !== m.getFullYear()) && g(new Date(T.getFullYear(), T.getMonth(), 1));
|
|
696
|
+
}, N = (T) => {
|
|
697
|
+
const L = (d.getDay() - o + 7) % 7, I = {
|
|
698
|
+
ArrowLeft: Y(d, -1),
|
|
699
|
+
ArrowRight: Y(d, 1),
|
|
700
|
+
ArrowUp: Y(d, -7),
|
|
701
|
+
ArrowDown: Y(d, 7),
|
|
702
|
+
PageUp: pe(d, -1),
|
|
703
|
+
PageDown: pe(d, 1),
|
|
704
|
+
Home: Y(d, -L),
|
|
705
|
+
End: Y(d, 6 - L)
|
|
574
706
|
};
|
|
575
|
-
|
|
576
|
-
},
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
}, [
|
|
580
|
-
return /* @__PURE__ */
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */
|
|
583
|
-
/* @__PURE__ */
|
|
584
|
-
/* @__PURE__ */
|
|
707
|
+
I[T.key] && (T.preventDefault(), v(I[T.key]));
|
|
708
|
+
}, M = (T) => {
|
|
709
|
+
const L = pe(m, T);
|
|
710
|
+
g(L), p(new Date(L.getFullYear(), L.getMonth(), Math.min(d.getDate(), 28)));
|
|
711
|
+
}, [y, w] = a && n && te(n, a) ? [n, a] : [a, n], C = $t(m, o);
|
|
712
|
+
return /* @__PURE__ */ f("div", { className: `inline-block border border-app-border bg-app-card p-3 text-app-text ${c}`, children: [
|
|
713
|
+
/* @__PURE__ */ f("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
714
|
+
/* @__PURE__ */ t("button", { type: "button", className: Le, "aria-label": "Previous month", onClick: () => M(-1), children: "‹" }),
|
|
715
|
+
/* @__PURE__ */ t("div", { "aria-live": "polite", className: "text-xs font-semibold uppercase tracking-widest", children: Lt(m, i) }),
|
|
716
|
+
/* @__PURE__ */ t("button", { type: "button", className: Le, "aria-label": "Next month", onClick: () => M(1), children: "›" })
|
|
585
717
|
] }),
|
|
586
|
-
/* @__PURE__ */
|
|
587
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ f("table", { ref: h, role: "grid", onKeyDown: N, className: "border-collapse", children: [
|
|
719
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: Mt(o, i).map((T) => /* @__PURE__ */ t(
|
|
588
720
|
"th",
|
|
589
721
|
{
|
|
590
722
|
scope: "col",
|
|
591
|
-
className: "h-8 w-
|
|
592
|
-
children:
|
|
723
|
+
className: "h-8 w-7 text-[10px] min-[360px]:w-8 sm:w-9 font-semibold uppercase tracking-widest text-app-muted",
|
|
724
|
+
children: T.slice(0, 2)
|
|
593
725
|
},
|
|
594
|
-
|
|
726
|
+
T
|
|
595
727
|
)) }) }),
|
|
596
|
-
/* @__PURE__ */
|
|
597
|
-
const
|
|
598
|
-
let
|
|
599
|
-
return
|
|
728
|
+
/* @__PURE__ */ t("tbody", { children: C.map((T) => /* @__PURE__ */ t("tr", { children: T.map((L) => {
|
|
729
|
+
const I = ee(L, e) || ee(L, y) || ee(L, w), j = y && w && !te(L, y) && !te(w, L), B = L.getMonth() !== m.getMonth(), z = Nt(L, s, l);
|
|
730
|
+
let q = "text-app-text hover:bg-app-bg";
|
|
731
|
+
return I ? q = "bg-app-strong text-app-bg" : j ? q = "bg-app-soft/20 text-app-text" : B && (q = "text-app-muted hover:bg-app-bg"), /* @__PURE__ */ t("td", { role: "gridcell", "aria-selected": I, className: "p-0", children: /* @__PURE__ */ t(
|
|
600
732
|
"button",
|
|
601
733
|
{
|
|
602
734
|
type: "button",
|
|
603
|
-
tabIndex:
|
|
735
|
+
tabIndex: ee(L, d) ? 0 : -1,
|
|
604
736
|
disabled: z,
|
|
605
|
-
"aria-label":
|
|
606
|
-
"aria-current":
|
|
737
|
+
"aria-label": L.toDateString(),
|
|
738
|
+
"aria-current": ee(L, u) ? "date" : void 0,
|
|
607
739
|
onClick: () => {
|
|
608
|
-
|
|
740
|
+
p(L), r == null || r(L);
|
|
609
741
|
},
|
|
610
|
-
className: `h-
|
|
611
|
-
children:
|
|
742
|
+
className: `h-8 w-7 text-xs transition min-[360px]:w-8 sm:h-9 sm:w-9 disabled:cursor-not-allowed disabled:opacity-30 ${q} ${ee(L, u) && !I ? "font-bold underline underline-offset-2" : ""}`,
|
|
743
|
+
children: L.getDate()
|
|
612
744
|
}
|
|
613
|
-
) },
|
|
614
|
-
}) },
|
|
745
|
+
) }, L.getTime());
|
|
746
|
+
}) }, T[0].getTime())) })
|
|
615
747
|
] })
|
|
616
748
|
] });
|
|
617
|
-
},
|
|
618
|
-
(
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
|
|
621
|
-
r && /* @__PURE__ */
|
|
749
|
+
}, kr = ({ title: e, subtitle: r, actions: a, footer: n, padded: s = !0, className: l = "", children: o }) => /* @__PURE__ */ f("section", { className: `flex flex-col border border-app-border bg-app-card ${l}`, children: [
|
|
750
|
+
(e || a) && /* @__PURE__ */ f("header", { className: "flex items-center justify-between gap-3 border-b border-app-border px-5 py-3", children: [
|
|
751
|
+
/* @__PURE__ */ f("div", { className: "min-w-0", children: [
|
|
752
|
+
e && /* @__PURE__ */ t("h3", { className: "m-0 text-sm font-semibold uppercase tracking-widest text-app-text", children: e }),
|
|
753
|
+
r && /* @__PURE__ */ t("p", { className: "m-0 mt-0.5 text-xs text-app-muted", children: r })
|
|
622
754
|
] }),
|
|
623
|
-
a && /* @__PURE__ */
|
|
755
|
+
a && /* @__PURE__ */ t("div", { className: "flex shrink-0 items-center gap-2", children: a })
|
|
624
756
|
] }),
|
|
625
|
-
/* @__PURE__ */
|
|
626
|
-
n && /* @__PURE__ */
|
|
627
|
-
] }),
|
|
628
|
-
children:
|
|
757
|
+
/* @__PURE__ */ t("div", { className: `flex-1 text-sm text-app-text ${s ? "p-5" : ""}`, children: o }),
|
|
758
|
+
n && /* @__PURE__ */ t("footer", { className: "border-t border-app-border px-5 py-3 text-sm", children: n })
|
|
759
|
+
] }), Ce = "absolute top-1/2 z-10 -translate-y-1/2 border border-app-border bg-app-card/90 px-3 py-2 text-app-text transition hover:border-app-strong disabled:cursor-not-allowed disabled:opacity-40", Nr = ({
|
|
760
|
+
children: e,
|
|
629
761
|
index: r,
|
|
630
762
|
defaultIndex: a = 0,
|
|
631
763
|
onIndexChange: n,
|
|
632
764
|
autoPlay: s = 0,
|
|
633
765
|
loop: l = !0,
|
|
634
766
|
label: o = "Carousel",
|
|
635
|
-
className:
|
|
767
|
+
className: i = ""
|
|
636
768
|
}) => {
|
|
637
|
-
const
|
|
638
|
-
if (!
|
|
639
|
-
let
|
|
640
|
-
l ?
|
|
769
|
+
const c = et.toArray(e), [u, b] = D(a), [d, p] = D(!1), m = r ?? u, g = (h) => {
|
|
770
|
+
if (!c.length) return;
|
|
771
|
+
let x = h;
|
|
772
|
+
l ? x = (h + c.length) % c.length : x = Math.min(Math.max(h, 0), c.length - 1), r === void 0 && b(x), n == null || n(x);
|
|
641
773
|
};
|
|
642
|
-
return
|
|
643
|
-
if (!s || d ||
|
|
644
|
-
const
|
|
645
|
-
return () => clearTimeout(
|
|
646
|
-
}, [s, d,
|
|
774
|
+
return P(() => {
|
|
775
|
+
if (!s || d || c.length < 2) return;
|
|
776
|
+
const h = setTimeout(() => g(m + 1), s);
|
|
777
|
+
return () => clearTimeout(h);
|
|
778
|
+
}, [s, d, m, c.length]), /* @__PURE__ */ f(
|
|
647
779
|
"div",
|
|
648
780
|
{
|
|
649
781
|
role: "region",
|
|
650
782
|
"aria-roledescription": "carousel",
|
|
651
783
|
"aria-label": o,
|
|
652
|
-
className: `relative ${
|
|
653
|
-
onMouseEnter: () =>
|
|
654
|
-
onMouseLeave: () =>
|
|
655
|
-
onFocus: () =>
|
|
656
|
-
onBlur: () =>
|
|
657
|
-
onKeyDown: (
|
|
658
|
-
|
|
784
|
+
className: `relative ${i}`,
|
|
785
|
+
onMouseEnter: () => p(!0),
|
|
786
|
+
onMouseLeave: () => p(!1),
|
|
787
|
+
onFocus: () => p(!0),
|
|
788
|
+
onBlur: () => p(!1),
|
|
789
|
+
onKeyDown: (h) => {
|
|
790
|
+
h.key === "ArrowLeft" ? g(m - 1) : h.key === "ArrowRight" && g(m + 1);
|
|
659
791
|
},
|
|
660
792
|
children: [
|
|
661
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ t("div", { className: "overflow-hidden border border-app-border bg-app-card", children: /* @__PURE__ */ t(
|
|
662
794
|
"div",
|
|
663
795
|
{
|
|
664
796
|
className: "flex transition-transform duration-300 ease-out",
|
|
665
|
-
style: { transform: `translateX(-${
|
|
797
|
+
style: { transform: `translateX(-${m * 100}%)` },
|
|
666
798
|
"aria-live": s && !d ? "off" : "polite",
|
|
667
|
-
children:
|
|
799
|
+
children: c.map((h, x) => /* @__PURE__ */ t(
|
|
668
800
|
"div",
|
|
669
801
|
{
|
|
670
802
|
role: "group",
|
|
671
803
|
"aria-roledescription": "slide",
|
|
672
|
-
"aria-label": `${
|
|
673
|
-
"aria-hidden":
|
|
674
|
-
ref: (
|
|
675
|
-
|
|
804
|
+
"aria-label": `${x + 1} of ${c.length}`,
|
|
805
|
+
"aria-hidden": x !== m,
|
|
806
|
+
ref: (v) => {
|
|
807
|
+
v && (x === m ? v.removeAttribute("inert") : v.setAttribute("inert", ""));
|
|
676
808
|
},
|
|
677
809
|
className: "w-full shrink-0",
|
|
678
|
-
children:
|
|
810
|
+
children: h
|
|
679
811
|
},
|
|
680
|
-
|
|
812
|
+
x
|
|
681
813
|
))
|
|
682
814
|
}
|
|
683
815
|
) }),
|
|
684
|
-
|
|
685
|
-
/* @__PURE__ */
|
|
816
|
+
c.length > 1 && /* @__PURE__ */ f(re, { children: [
|
|
817
|
+
/* @__PURE__ */ t(
|
|
686
818
|
"button",
|
|
687
819
|
{
|
|
688
820
|
type: "button",
|
|
689
821
|
"aria-label": "Previous slide",
|
|
690
|
-
className: `${
|
|
691
|
-
disabled: !l &&
|
|
692
|
-
onClick: () =>
|
|
822
|
+
className: `${Ce} left-2`,
|
|
823
|
+
disabled: !l && m === 0,
|
|
824
|
+
onClick: () => g(m - 1),
|
|
693
825
|
children: "‹"
|
|
694
826
|
}
|
|
695
827
|
),
|
|
696
|
-
/* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ t(
|
|
697
829
|
"button",
|
|
698
830
|
{
|
|
699
831
|
type: "button",
|
|
700
832
|
"aria-label": "Next slide",
|
|
701
|
-
className: `${
|
|
702
|
-
disabled: !l &&
|
|
703
|
-
onClick: () =>
|
|
833
|
+
className: `${Ce} right-2`,
|
|
834
|
+
disabled: !l && m === c.length - 1,
|
|
835
|
+
onClick: () => g(m + 1),
|
|
704
836
|
children: "›"
|
|
705
837
|
}
|
|
706
838
|
),
|
|
707
|
-
/* @__PURE__ */
|
|
839
|
+
/* @__PURE__ */ t("div", { className: "mt-2 flex justify-center gap-1.5", children: c.map((h, x) => /* @__PURE__ */ t(
|
|
708
840
|
"button",
|
|
709
841
|
{
|
|
710
842
|
type: "button",
|
|
711
|
-
"aria-label": `Go to slide ${
|
|
712
|
-
"aria-current":
|
|
713
|
-
onClick: () => x
|
|
714
|
-
className:
|
|
843
|
+
"aria-label": `Go to slide ${x + 1}`,
|
|
844
|
+
"aria-current": x === m,
|
|
845
|
+
onClick: () => g(x),
|
|
846
|
+
className: "flex h-6 w-6 items-center justify-center",
|
|
847
|
+
children: /* @__PURE__ */ t(
|
|
848
|
+
"span",
|
|
849
|
+
{
|
|
850
|
+
className: `h-2 w-2 border border-app-strong transition ${x === m ? "bg-app-strong" : "bg-transparent"}`
|
|
851
|
+
}
|
|
852
|
+
)
|
|
715
853
|
},
|
|
716
|
-
|
|
854
|
+
x
|
|
717
855
|
)) })
|
|
718
856
|
] })
|
|
719
857
|
]
|
|
720
858
|
}
|
|
721
859
|
);
|
|
722
|
-
},
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}, [n])
|
|
860
|
+
}, Te = ({ label: e, checked: r, onChange: a, indeterminate: n = !1, disabled: s = !1, className: l = "", ...o }) => {
|
|
861
|
+
const i = O(), c = A(null);
|
|
862
|
+
P(() => {
|
|
863
|
+
c.current && (c.current.indeterminate = n);
|
|
864
|
+
}, [n]);
|
|
865
|
+
const u = r || n;
|
|
866
|
+
return /* @__PURE__ */ f(
|
|
727
867
|
"label",
|
|
728
868
|
{
|
|
729
|
-
htmlFor:
|
|
730
|
-
className: `inline-flex items-center gap-2 align-middle text-sm leading-none text-app-text ${s ? "cursor-not-allowed opacity-50" : "cursor-pointer"} ${l}`,
|
|
869
|
+
htmlFor: i,
|
|
870
|
+
className: `inline-flex min-h-8 items-center gap-2 align-middle text-sm leading-none text-app-text ${s ? "cursor-not-allowed opacity-50" : "cursor-pointer"} ${l}`,
|
|
731
871
|
children: [
|
|
732
|
-
/* @__PURE__ */
|
|
872
|
+
/* @__PURE__ */ t(
|
|
733
873
|
"input",
|
|
734
874
|
{
|
|
735
|
-
ref:
|
|
736
|
-
id:
|
|
875
|
+
ref: c,
|
|
876
|
+
id: i,
|
|
737
877
|
type: "checkbox",
|
|
738
878
|
checked: r,
|
|
739
879
|
disabled: s,
|
|
740
|
-
onChange: (
|
|
741
|
-
className: "
|
|
880
|
+
onChange: (b) => a == null ? void 0 : a(b.target.checked),
|
|
881
|
+
className: "peer sr-only",
|
|
742
882
|
...o
|
|
743
883
|
}
|
|
744
884
|
),
|
|
745
|
-
t
|
|
885
|
+
/* @__PURE__ */ t(
|
|
886
|
+
"span",
|
|
887
|
+
{
|
|
888
|
+
"aria-hidden": "true",
|
|
889
|
+
className: `flex h-4 w-4 shrink-0 items-center justify-center border transition peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-app-strong ${u ? "border-app-strong bg-app-strong text-app-bg" : "border-app-border bg-app-bg"}`,
|
|
890
|
+
children: n ? /* @__PURE__ */ t("svg", { viewBox: "0 0 16 16", className: "h-3 w-3", fill: "none", stroke: "currentColor", strokeWidth: "2.2", children: /* @__PURE__ */ t("path", { d: "M3.5 8h9" }) }) : r && /* @__PURE__ */ t("svg", { viewBox: "0 0 16 16", className: "h-3 w-3", fill: "none", stroke: "currentColor", strokeWidth: "2.2", children: /* @__PURE__ */ t("path", { strokeLinecap: "square", strokeLinejoin: "miter", d: "M3 8.5l3.2 3.2L13 4.8" }) })
|
|
891
|
+
}
|
|
892
|
+
),
|
|
893
|
+
e
|
|
746
894
|
]
|
|
747
895
|
}
|
|
748
896
|
);
|
|
749
|
-
},
|
|
750
|
-
open:
|
|
897
|
+
}, $r = ({
|
|
898
|
+
open: e,
|
|
751
899
|
onClose: r,
|
|
752
900
|
commands: a,
|
|
753
901
|
placeholder: n = "Type a command…",
|
|
754
902
|
empty: s = "No matching commands"
|
|
755
903
|
}) => {
|
|
756
|
-
const [l, o] =
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
}, [
|
|
760
|
-
const
|
|
761
|
-
const
|
|
762
|
-
return [...new Set(
|
|
904
|
+
const [l, o] = D(""), [i, c] = D(0), u = A(null), b = A(null), d = O();
|
|
905
|
+
ye(e, r), ie(e, u), P(() => {
|
|
906
|
+
e && (o(""), c(0));
|
|
907
|
+
}, [e]);
|
|
908
|
+
const p = je(() => {
|
|
909
|
+
const h = l.trim().toLowerCase(), x = h ? a.filter((N) => `${N.label} ${N.description ?? ""} ${N.group ?? ""}`.toLowerCase().includes(h)) : a;
|
|
910
|
+
return [...new Set(x.map((N) => N.group))].flatMap((N) => x.filter((M) => M.group === N));
|
|
763
911
|
}, [a, l]);
|
|
764
|
-
if (
|
|
765
|
-
var
|
|
766
|
-
(
|
|
767
|
-
}, [
|
|
768
|
-
const
|
|
769
|
-
var
|
|
770
|
-
|
|
771
|
-
},
|
|
772
|
-
|
|
912
|
+
if (P(() => {
|
|
913
|
+
var h, x, v;
|
|
914
|
+
(v = (x = (h = b.current) == null ? void 0 : h.querySelector('[aria-selected="true"]')) == null ? void 0 : x.scrollIntoView) == null || v.call(x, { block: "nearest" });
|
|
915
|
+
}, [i, p]), !e) return null;
|
|
916
|
+
const m = (h) => {
|
|
917
|
+
var x;
|
|
918
|
+
h && (r(), (x = h.onSelect) == null || x.call(h));
|
|
919
|
+
}, g = (h) => {
|
|
920
|
+
h.key === "ArrowDown" ? (h.preventDefault(), c((x) => p.length ? (x + 1) % p.length : 0)) : h.key === "ArrowUp" ? (h.preventDefault(), c((x) => p.length ? (x - 1 + p.length) % p.length : 0)) : h.key === "Enter" && (h.preventDefault(), m(p[i]));
|
|
773
921
|
};
|
|
774
|
-
return
|
|
775
|
-
/* @__PURE__ */
|
|
776
|
-
/* @__PURE__ */
|
|
777
|
-
/* @__PURE__ */
|
|
922
|
+
return ae(
|
|
923
|
+
/* @__PURE__ */ f("div", { className: "fixed inset-0 z-[var(--xd-z-modal,80)] flex items-start justify-center px-4 pt-[15vh]", children: [
|
|
924
|
+
/* @__PURE__ */ t("div", { "aria-hidden": "true", className: "absolute inset-0 bg-black/30 backdrop-blur-sm", onClick: r }),
|
|
925
|
+
/* @__PURE__ */ f(
|
|
778
926
|
"div",
|
|
779
927
|
{
|
|
780
928
|
ref: u,
|
|
@@ -784,65 +932,65 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
784
932
|
tabIndex: -1,
|
|
785
933
|
className: "relative z-10 flex max-h-[60vh] w-full max-w-xl flex-col border border-app-border bg-app-card shadow-2xl",
|
|
786
934
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ t(
|
|
788
936
|
"input",
|
|
789
937
|
{
|
|
790
938
|
"data-autofocus": !0,
|
|
791
939
|
role: "combobox",
|
|
792
940
|
"aria-expanded": "true",
|
|
793
941
|
"aria-controls": d,
|
|
794
|
-
"aria-activedescendant":
|
|
942
|
+
"aria-activedescendant": p[i] ? `${d}-${p[i].key}` : void 0,
|
|
795
943
|
"aria-autocomplete": "list",
|
|
796
944
|
value: l,
|
|
797
|
-
onChange: (
|
|
798
|
-
o(
|
|
945
|
+
onChange: (h) => {
|
|
946
|
+
o(h.target.value), c(0);
|
|
799
947
|
},
|
|
800
|
-
onKeyDown:
|
|
948
|
+
onKeyDown: g,
|
|
801
949
|
placeholder: n,
|
|
802
950
|
"aria-label": "Search commands",
|
|
803
951
|
className: "w-full border-b border-app-border bg-transparent px-4 py-3 text-sm text-app-text outline-none placeholder:text-app-muted"
|
|
804
952
|
}
|
|
805
953
|
),
|
|
806
|
-
/* @__PURE__ */
|
|
954
|
+
/* @__PURE__ */ f(
|
|
807
955
|
"ul",
|
|
808
956
|
{
|
|
809
957
|
id: d,
|
|
810
|
-
ref:
|
|
958
|
+
ref: b,
|
|
811
959
|
role: "listbox",
|
|
812
960
|
"aria-label": "Commands",
|
|
813
961
|
className: "m-0 flex-1 list-none overflow-y-auto p-0",
|
|
814
962
|
children: [
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
var
|
|
818
|
-
const
|
|
819
|
-
return /* @__PURE__ */
|
|
820
|
-
|
|
821
|
-
/* @__PURE__ */
|
|
963
|
+
p.length === 0 && /* @__PURE__ */ t("li", { className: "px-4 py-6 text-center text-sm text-app-muted", children: s }),
|
|
964
|
+
p.map((h, x) => {
|
|
965
|
+
var N;
|
|
966
|
+
const v = h.group && h.group !== ((N = p[x - 1]) == null ? void 0 : N.group);
|
|
967
|
+
return /* @__PURE__ */ f("li", { role: "presentation", children: [
|
|
968
|
+
v && /* @__PURE__ */ t("div", { className: "px-4 pb-1 pt-3 text-[10px] font-semibold uppercase tracking-widest text-app-muted", children: h.group }),
|
|
969
|
+
/* @__PURE__ */ f(
|
|
822
970
|
"div",
|
|
823
971
|
{
|
|
824
|
-
id: `${d}-${
|
|
972
|
+
id: `${d}-${h.key}`,
|
|
825
973
|
role: "option",
|
|
826
|
-
"aria-selected":
|
|
827
|
-
onMouseMove: () =>
|
|
828
|
-
onClick: () =>
|
|
829
|
-
className: `flex cursor-pointer items-center justify-between gap-3 px-4 py-2.5 text-sm ${
|
|
974
|
+
"aria-selected": x === i,
|
|
975
|
+
onMouseMove: () => c(x),
|
|
976
|
+
onClick: () => m(h),
|
|
977
|
+
className: `flex cursor-pointer items-center justify-between gap-3 px-4 py-2.5 text-sm ${x === i ? "bg-app-strong text-app-bg" : "text-app-text"}`,
|
|
830
978
|
children: [
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
|
|
979
|
+
/* @__PURE__ */ f("span", { className: "min-w-0", children: [
|
|
980
|
+
/* @__PURE__ */ t("span", { className: "block truncate", children: h.label }),
|
|
981
|
+
h.description && /* @__PURE__ */ t("span", { className: `block truncate text-xs ${x === i ? "opacity-80" : "text-app-muted"}`, children: h.description })
|
|
834
982
|
] }),
|
|
835
|
-
|
|
983
|
+
h.shortcut && /* @__PURE__ */ t(
|
|
836
984
|
"kbd",
|
|
837
985
|
{
|
|
838
|
-
className: `shrink-0 border px-1.5 py-0.5 text-[10px] ${
|
|
839
|
-
children:
|
|
986
|
+
className: `shrink-0 border px-1.5 py-0.5 text-[10px] ${x === i ? "border-app-bg/40" : "border-app-border text-app-muted"}`,
|
|
987
|
+
children: h.shortcut
|
|
840
988
|
}
|
|
841
989
|
)
|
|
842
990
|
]
|
|
843
991
|
}
|
|
844
992
|
)
|
|
845
|
-
] },
|
|
993
|
+
] }, h.key);
|
|
846
994
|
})
|
|
847
995
|
]
|
|
848
996
|
}
|
|
@@ -853,7 +1001,7 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
853
1001
|
] }),
|
|
854
1002
|
document.body
|
|
855
1003
|
);
|
|
856
|
-
},
|
|
1004
|
+
}, He = "xedonium-theme-override", xe = {
|
|
857
1005
|
light: {
|
|
858
1006
|
outer: "#d8d8d8",
|
|
859
1007
|
bladeA: "#f5f5f5",
|
|
@@ -872,153 +1020,153 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
872
1020
|
ring: "#b5b5b5",
|
|
873
1021
|
ringOpacity: "0.85"
|
|
874
1022
|
}
|
|
875
|
-
},
|
|
876
|
-
const [n, s] =
|
|
877
|
-
|
|
1023
|
+
}, Ct = 450, De = () => typeof document > "u" ? "light" : document.documentElement.getAttribute("data-theme") === "dark" ? "dark" : "light", Ye = ({ size: e = 64, theme: r, label: a }) => {
|
|
1024
|
+
const [n, s] = D(() => r || De()), l = A(null);
|
|
1025
|
+
P(() => {
|
|
878
1026
|
if (r) {
|
|
879
1027
|
s(r);
|
|
880
1028
|
return;
|
|
881
1029
|
}
|
|
882
|
-
const
|
|
883
|
-
return
|
|
884
|
-
}, [r]),
|
|
885
|
-
let
|
|
886
|
-
const
|
|
887
|
-
var
|
|
888
|
-
const
|
|
889
|
-
|
|
1030
|
+
const i = document.documentElement, c = () => s(De()), u = new MutationObserver(c);
|
|
1031
|
+
return c(), u.observe(i, { attributes: !0, attributeFilter: ["data-theme"] }), () => u.disconnect();
|
|
1032
|
+
}, [r]), P(() => {
|
|
1033
|
+
let i = 0, c = null, u;
|
|
1034
|
+
const b = (d) => {
|
|
1035
|
+
var m;
|
|
1036
|
+
const p = c === null ? 0 : (d - c) / 1e3;
|
|
1037
|
+
c = d, i = (i + Ct * p) % 360, (m = l.current) == null || m.setAttribute("transform", `rotate(${i} 32 32)`), u = requestAnimationFrame(b);
|
|
890
1038
|
};
|
|
891
|
-
return u = requestAnimationFrame(
|
|
1039
|
+
return u = requestAnimationFrame(b), () => cancelAnimationFrame(u);
|
|
892
1040
|
}, []);
|
|
893
|
-
const o =
|
|
894
|
-
return /* @__PURE__ */
|
|
1041
|
+
const o = xe[n] || xe.light;
|
|
1042
|
+
return /* @__PURE__ */ f(
|
|
895
1043
|
"svg",
|
|
896
1044
|
{
|
|
897
|
-
width:
|
|
898
|
-
height:
|
|
1045
|
+
width: e,
|
|
1046
|
+
height: e,
|
|
899
1047
|
viewBox: "0 0 64 64",
|
|
900
1048
|
xmlns: "http://www.w3.org/2000/svg",
|
|
901
1049
|
focusable: "false",
|
|
902
1050
|
...a ? { role: "img", "aria-label": a } : { "aria-hidden": !0 },
|
|
903
1051
|
children: [
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
/* @__PURE__ */
|
|
906
|
-
/* @__PURE__ */
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ t("circle", { cx: "32", cy: "32", r: "30", fill: o.outer }),
|
|
1053
|
+
/* @__PURE__ */ f("g", { ref: l, children: [
|
|
1054
|
+
/* @__PURE__ */ t("path", { d: "M32 32 C32 18, 42 14, 45 10 C49 5, 52 6, 50 12 C48 18, 38 20, 32 32 Z", fill: o.bladeA }),
|
|
1055
|
+
/* @__PURE__ */ t("path", { d: "M32 32 C46 32, 50 42, 54 45 C59 49, 58 52, 52 50 C46 48, 44 38, 32 32 Z", fill: o.bladeB }),
|
|
1056
|
+
/* @__PURE__ */ t("path", { d: "M32 32 C32 46, 22 50, 19 54 C15 59, 12 58, 14 52 C16 46, 26 44, 32 32 Z", fill: o.bladeA }),
|
|
1057
|
+
/* @__PURE__ */ t("path", { d: "M32 32 C18 32, 14 22, 10 19 C5 15, 6 12, 12 14 C18 16, 20 26, 32 32 Z", fill: o.bladeB })
|
|
910
1058
|
] }),
|
|
911
|
-
/* @__PURE__ */
|
|
912
|
-
/* @__PURE__ */
|
|
913
|
-
/* @__PURE__ */
|
|
1059
|
+
/* @__PURE__ */ t("circle", { cx: "32", cy: "32", r: "5", fill: o.hubOuter }),
|
|
1060
|
+
/* @__PURE__ */ t("circle", { cx: "32", cy: "32", r: "3", fill: o.hubInner }),
|
|
1061
|
+
/* @__PURE__ */ t("circle", { cx: "32", cy: "32", r: "30", fill: "none", stroke: o.ring, strokeWidth: "5", opacity: "0.85" })
|
|
914
1062
|
]
|
|
915
1063
|
}
|
|
916
1064
|
);
|
|
917
|
-
},
|
|
1065
|
+
}, Tt = {
|
|
918
1066
|
default: { dot: "bg-app-soft", title: "text-app-soft" },
|
|
919
1067
|
danger: { dot: "bg-red-500", title: "text-red-700 dark:text-red-400" }
|
|
920
|
-
},
|
|
921
|
-
open:
|
|
1068
|
+
}, Dt = ({
|
|
1069
|
+
open: e,
|
|
922
1070
|
onClose: r,
|
|
923
1071
|
title: a,
|
|
924
1072
|
tone: n = "default",
|
|
925
1073
|
busy: s = !1,
|
|
926
1074
|
dismissible: l = !0,
|
|
927
1075
|
role: o = "dialog",
|
|
928
|
-
describedBy:
|
|
929
|
-
maxWidth:
|
|
1076
|
+
describedBy: i,
|
|
1077
|
+
maxWidth: c = "max-w-lg",
|
|
930
1078
|
className: u = "",
|
|
931
|
-
as:
|
|
1079
|
+
as: b = "div",
|
|
932
1080
|
footer: d,
|
|
933
|
-
children:
|
|
934
|
-
...
|
|
1081
|
+
children: p,
|
|
1082
|
+
...m
|
|
935
1083
|
}) => {
|
|
936
|
-
const
|
|
937
|
-
|
|
938
|
-
|
|
1084
|
+
const g = A(null), h = O(), x = A(r);
|
|
1085
|
+
P(() => {
|
|
1086
|
+
x.current = r;
|
|
939
1087
|
});
|
|
940
|
-
const
|
|
941
|
-
!s && l &&
|
|
1088
|
+
const v = Fe(() => {
|
|
1089
|
+
!s && l && x.current();
|
|
942
1090
|
}, [s, l]);
|
|
943
|
-
if (
|
|
944
|
-
const { dot:
|
|
945
|
-
return
|
|
946
|
-
/* @__PURE__ */
|
|
947
|
-
/* @__PURE__ */
|
|
948
|
-
/* @__PURE__ */
|
|
949
|
-
|
|
1091
|
+
if (ye(e, v), ie(e, g), !e) return null;
|
|
1092
|
+
const { dot: N, title: M } = Tt[n];
|
|
1093
|
+
return ae(
|
|
1094
|
+
/* @__PURE__ */ f("div", { className: "fixed inset-0 z-[var(--xd-z-modal,80)] flex items-center justify-center px-4", children: [
|
|
1095
|
+
/* @__PURE__ */ t("div", { "aria-hidden": "true", className: "absolute inset-0 bg-black/30 backdrop-blur-sm", onClick: v }),
|
|
1096
|
+
/* @__PURE__ */ f(
|
|
1097
|
+
b,
|
|
950
1098
|
{
|
|
951
|
-
ref:
|
|
1099
|
+
ref: g,
|
|
952
1100
|
role: o,
|
|
953
1101
|
"aria-modal": "true",
|
|
954
|
-
"aria-labelledby":
|
|
955
|
-
"aria-describedby":
|
|
1102
|
+
"aria-labelledby": h,
|
|
1103
|
+
"aria-describedby": i,
|
|
956
1104
|
"aria-busy": s || void 0,
|
|
957
1105
|
tabIndex: -1,
|
|
958
|
-
className: `relative z-10 flex max-h-[90vh] w-full min-w-0 flex-col border border-app-border bg-app-card shadow-2xl ${
|
|
959
|
-
...
|
|
1106
|
+
className: `relative z-10 flex max-h-[90vh] w-full min-w-0 flex-col border border-app-border bg-app-card shadow-2xl ${c} ${u}`,
|
|
1107
|
+
...m,
|
|
960
1108
|
children: [
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
/* @__PURE__ */
|
|
963
|
-
/* @__PURE__ */
|
|
964
|
-
/* @__PURE__ */
|
|
1109
|
+
/* @__PURE__ */ f("div", { className: "flex shrink-0 items-center justify-between border-b border-app-border px-6 pb-5 pt-6", children: [
|
|
1110
|
+
/* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
1111
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", className: `inline-block h-2 w-2 rounded-full ${N}` }),
|
|
1112
|
+
/* @__PURE__ */ t("h2", { id: h, className: `text-sm font-semibold uppercase tracking-widest ${M}`, children: a })
|
|
965
1113
|
] }),
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
|
|
1114
|
+
/* @__PURE__ */ t(
|
|
1115
|
+
H,
|
|
968
1116
|
{
|
|
969
|
-
onClick: () => !s &&
|
|
1117
|
+
onClick: () => !s && x.current(),
|
|
970
1118
|
disabled: s,
|
|
971
1119
|
tooltip: "Close dialog",
|
|
972
1120
|
"aria-label": "Close dialog",
|
|
973
1121
|
variant: "secondary",
|
|
974
|
-
children: /* @__PURE__ */
|
|
1122
|
+
children: /* @__PURE__ */ t(we, {})
|
|
975
1123
|
}
|
|
976
1124
|
)
|
|
977
1125
|
] }),
|
|
978
|
-
/* @__PURE__ */
|
|
979
|
-
d && /* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto", children: p }),
|
|
1127
|
+
d && /* @__PURE__ */ t("div", { className: "flex shrink-0 flex-wrap items-center justify-end gap-3 border-t border-app-border px-6 pb-6 pt-4", children: d })
|
|
980
1128
|
]
|
|
981
1129
|
}
|
|
982
1130
|
)
|
|
983
1131
|
] }),
|
|
984
1132
|
document.body
|
|
985
1133
|
);
|
|
986
|
-
},
|
|
987
|
-
open:
|
|
1134
|
+
}, Mr = ({
|
|
1135
|
+
open: e,
|
|
988
1136
|
onClose: r,
|
|
989
1137
|
onConfirm: a,
|
|
990
1138
|
title: n,
|
|
991
1139
|
tone: s = "default",
|
|
992
1140
|
busy: l = !1,
|
|
993
1141
|
confirmLabel: o = "Confirm",
|
|
994
|
-
busyLabel:
|
|
995
|
-
cancelLabel:
|
|
1142
|
+
busyLabel: i,
|
|
1143
|
+
cancelLabel: c = "Cancel",
|
|
996
1144
|
error: u,
|
|
997
|
-
children:
|
|
998
|
-
}) => /* @__PURE__ */
|
|
999
|
-
|
|
1145
|
+
children: b
|
|
1146
|
+
}) => /* @__PURE__ */ t(
|
|
1147
|
+
Dt,
|
|
1000
1148
|
{
|
|
1001
|
-
open:
|
|
1149
|
+
open: e,
|
|
1002
1150
|
onClose: r,
|
|
1003
1151
|
busy: l,
|
|
1004
1152
|
title: n,
|
|
1005
1153
|
tone: s,
|
|
1006
1154
|
role: s === "danger" ? "alertdialog" : "dialog",
|
|
1007
1155
|
maxWidth: "max-w-md",
|
|
1008
|
-
footer: /* @__PURE__ */
|
|
1009
|
-
/* @__PURE__ */
|
|
1010
|
-
/* @__PURE__ */
|
|
1011
|
-
/* @__PURE__ */
|
|
1156
|
+
footer: /* @__PURE__ */ f(re, { children: [
|
|
1157
|
+
/* @__PURE__ */ t(H, { onClick: r, disabled: l, variant: "secondary", "data-autofocus": !0, children: c }),
|
|
1158
|
+
/* @__PURE__ */ t(H, { onClick: a, disabled: l, variant: s === "danger" ? "danger" : "default", children: l ? /* @__PURE__ */ f("span", { className: "flex items-center gap-1", children: [
|
|
1159
|
+
/* @__PURE__ */ t(Ye, { size: 16 }),
|
|
1012
1160
|
" ",
|
|
1013
|
-
|
|
1161
|
+
i || o
|
|
1014
1162
|
] }) : o })
|
|
1015
1163
|
] }),
|
|
1016
|
-
children: /* @__PURE__ */
|
|
1017
|
-
|
|
1018
|
-
u && /* @__PURE__ */
|
|
1164
|
+
children: /* @__PURE__ */ f("div", { className: "flex flex-col gap-3 px-6 py-5 text-sm text-app-text", children: [
|
|
1165
|
+
b,
|
|
1166
|
+
u && /* @__PURE__ */ t("p", { role: "alert", className: "text-red-700 dark:text-red-400", children: u })
|
|
1019
1167
|
] })
|
|
1020
1168
|
}
|
|
1021
|
-
),
|
|
1169
|
+
), Lr = ({ maxWidth: e = "max-w-5xl", className: r = "", as: a = "div", children: n, ...s }) => /* @__PURE__ */ t(a, { className: `mx-auto w-full px-4 sm:px-6 ${e} ${r}`, ...s, children: n }), At = {
|
|
1022
1170
|
1: "grid-cols-1",
|
|
1023
1171
|
2: "grid-cols-2",
|
|
1024
1172
|
3: "grid-cols-3",
|
|
@@ -1026,7 +1174,7 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
1026
1174
|
5: "grid-cols-5",
|
|
1027
1175
|
6: "grid-cols-6",
|
|
1028
1176
|
12: "grid-cols-12"
|
|
1029
|
-
},
|
|
1177
|
+
}, Et = {
|
|
1030
1178
|
1: "grid-cols-1",
|
|
1031
1179
|
2: "grid-cols-1 sm:grid-cols-2",
|
|
1032
1180
|
3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
|
|
@@ -1034,360 +1182,365 @@ const pe = 6, Q = 8, Le = ({ text: t, children: r, className: a = "" }) => {
|
|
|
1034
1182
|
5: "grid-cols-1 sm:grid-cols-3 lg:grid-cols-5",
|
|
1035
1183
|
6: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-6",
|
|
1036
1184
|
12: "grid-cols-4 sm:grid-cols-6 lg:grid-cols-12"
|
|
1037
|
-
},
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1185
|
+
}, It = { 0: "gap-0", 1: "gap-1", 2: "gap-2", 3: "gap-3", 4: "gap-4", 6: "gap-6", 8: "gap-8" }, Ae = ({ cols: e = 2, gap: r = 4, responsive: a = !0, className: n = "", as: s = "div", children: l, ...o }) => /* @__PURE__ */ t(s, { className: `grid ${(a ? Et : At)[e]} ${It[r]} ${n}`, ...o, children: l }), U = ({ as: e, htmlFor: r, className: a = "", children: n, ...s }) => {
|
|
1186
|
+
const l = e ?? (r ? "label" : "span");
|
|
1187
|
+
return /* @__PURE__ */ t(
|
|
1188
|
+
l,
|
|
1189
|
+
{
|
|
1190
|
+
htmlFor: l === "label" ? r : void 0,
|
|
1191
|
+
className: `text-xs font-semibold uppercase tracking-widest text-app-muted ${a}`,
|
|
1192
|
+
...s,
|
|
1193
|
+
children: n
|
|
1194
|
+
}
|
|
1195
|
+
);
|
|
1196
|
+
}, St = ({ title: e, subtitle: r, children: a }) => /* @__PURE__ */ f("div", { className: "mb-6 flex flex-wrap items-end justify-between gap-3", children: [
|
|
1197
|
+
/* @__PURE__ */ f("div", { children: [
|
|
1198
|
+
/* @__PURE__ */ t("h1", { className: "text-2xl font-bold tracking-tight text-app-text sm:text-3xl", children: e }),
|
|
1199
|
+
r && /* @__PURE__ */ t(U, { as: "p", className: "mt-0.5", children: r })
|
|
1041
1200
|
] }),
|
|
1042
|
-
a && /* @__PURE__ */
|
|
1043
|
-
] }),
|
|
1201
|
+
a && /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: a })
|
|
1202
|
+
] }), Pt = {
|
|
1044
1203
|
up: "text-emerald-700 dark:text-emerald-400",
|
|
1045
1204
|
down: "text-red-700 dark:text-red-400",
|
|
1046
1205
|
flat: "text-app-muted"
|
|
1047
|
-
},
|
|
1048
|
-
/* @__PURE__ */
|
|
1049
|
-
/* @__PURE__ */
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
a && /* @__PURE__ */
|
|
1052
|
-
/* @__PURE__ */
|
|
1206
|
+
}, Rt = ({ label: e, value: r, delta: a, trend: n = "flat", hint: s, className: l = "" }) => /* @__PURE__ */ f("div", { className: `flex flex-col gap-1 border border-app-border bg-app-card p-4 ${l}`, children: [
|
|
1207
|
+
/* @__PURE__ */ t(U, { children: e }),
|
|
1208
|
+
/* @__PURE__ */ f("div", { className: "flex items-baseline gap-2", children: [
|
|
1209
|
+
/* @__PURE__ */ t("span", { className: "text-2xl font-bold tracking-tight text-app-text", children: r }),
|
|
1210
|
+
a && /* @__PURE__ */ f("span", { className: `text-xs font-semibold ${Pt[n]}`, children: [
|
|
1211
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: n === "up" ? "▲ " : n === "down" ? "▼ " : "" }),
|
|
1053
1212
|
a
|
|
1054
1213
|
] })
|
|
1055
1214
|
] }),
|
|
1056
|
-
s && /* @__PURE__ */
|
|
1057
|
-
] }),
|
|
1058
|
-
|
|
1059
|
-
n.length > 0 && /* @__PURE__ */
|
|
1060
|
-
l && /* @__PURE__ */
|
|
1061
|
-
] }),
|
|
1215
|
+
s && /* @__PURE__ */ t("span", { className: "text-xs text-app-muted", children: s })
|
|
1216
|
+
] }), Cr = ({ title: e, subtitle: r, actions: a, stats: n = [], columns: s = 2, children: l }) => /* @__PURE__ */ f("div", { className: "flex flex-col gap-6", children: [
|
|
1217
|
+
e && /* @__PURE__ */ t(St, { title: e, subtitle: r, children: a }),
|
|
1218
|
+
n.length > 0 && /* @__PURE__ */ t(Ae, { cols: Math.min(n.length, 4), gap: 4, children: n.map((o) => /* @__PURE__ */ t(Rt, { ...o }, o.label)) }),
|
|
1219
|
+
l && /* @__PURE__ */ t(Ae, { cols: s, gap: 4, children: l })
|
|
1220
|
+
] }), se = (e = !1) => `w-full bg-app-bg border px-3 py-2 text-sm text-app-text placeholder:text-app-muted outline-none transition focus:ring-2 focus:ring-app-strong focus:border-app-strong disabled:cursor-not-allowed disabled:opacity-50 ${e ? "border-red-500" : "border-app-border"}`, Ze = tt(({ value: e, onChange: r, invalid: a = !1, type: n = "text", className: s = "", ...l }, o) => /* @__PURE__ */ t(
|
|
1062
1221
|
"input",
|
|
1063
1222
|
{
|
|
1064
1223
|
ref: o,
|
|
1065
1224
|
type: n,
|
|
1066
1225
|
"aria-invalid": a || void 0,
|
|
1067
|
-
className: `${
|
|
1068
|
-
value:
|
|
1069
|
-
onChange: (
|
|
1226
|
+
className: `${se(a)} ${s}`,
|
|
1227
|
+
value: e,
|
|
1228
|
+
onChange: (i) => r == null ? void 0 : r(i.target.value),
|
|
1070
1229
|
...l
|
|
1071
1230
|
}
|
|
1072
1231
|
));
|
|
1073
|
-
|
|
1074
|
-
const
|
|
1232
|
+
Ze.displayName = "Input";
|
|
1233
|
+
const jt = (e, r, a) => {
|
|
1075
1234
|
const n = /* @__PURE__ */ new Set([1, r]);
|
|
1076
|
-
for (let o =
|
|
1077
|
-
const s = [...n].sort((o,
|
|
1078
|
-
return s.forEach((o,
|
|
1079
|
-
|
|
1235
|
+
for (let o = e - a; o <= e + a; o++) o > 1 && o < r && n.add(o);
|
|
1236
|
+
const s = [...n].sort((o, i) => o - i), l = [];
|
|
1237
|
+
return s.forEach((o, i) => {
|
|
1238
|
+
i > 0 && o - s[i - 1] > 1 && l.push(null), l.push(o);
|
|
1080
1239
|
}), l;
|
|
1081
|
-
},
|
|
1082
|
-
/* @__PURE__ */
|
|
1083
|
-
|
|
1084
|
-
(l, o) => l === null ? /* @__PURE__ */
|
|
1240
|
+
}, ue = (e = !1) => `min-h-9 min-w-9 border px-2 py-1.5 text-xs font-semibold tracking-widest transition disabled:cursor-not-allowed disabled:opacity-50 ${e ? "border-app-strong bg-app-strong text-app-bg" : "border-app-border bg-app-bg text-app-text hover:border-app-strong"}`, Ft = ({ page: e, pageCount: r, onChange: a, siblings: n = 1, className: s = "" }) => /* @__PURE__ */ t("nav", { "aria-label": "Pagination", className: s, children: /* @__PURE__ */ f("ul", { className: "m-0 flex list-none flex-wrap items-center gap-1 p-0", children: [
|
|
1241
|
+
/* @__PURE__ */ t("li", { children: /* @__PURE__ */ t("button", { type: "button", className: ue(), disabled: e <= 1, onClick: () => a(e - 1), children: "Prev" }) }),
|
|
1242
|
+
jt(e, r, n).map(
|
|
1243
|
+
(l, o) => l === null ? /* @__PURE__ */ t("li", { "aria-hidden": "true", className: "px-1 text-app-muted", children: "…" }, `gap-${o}`) : /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
1085
1244
|
"button",
|
|
1086
1245
|
{
|
|
1087
1246
|
type: "button",
|
|
1088
|
-
className:
|
|
1089
|
-
"aria-current": l ===
|
|
1247
|
+
className: ue(l === e),
|
|
1248
|
+
"aria-current": l === e ? "page" : void 0,
|
|
1090
1249
|
"aria-label": `Page ${l}`,
|
|
1091
1250
|
onClick: () => a(l),
|
|
1092
1251
|
children: l
|
|
1093
1252
|
}
|
|
1094
1253
|
) }, l)
|
|
1095
1254
|
),
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
] }) }),
|
|
1098
|
-
columns:
|
|
1255
|
+
/* @__PURE__ */ t("li", { children: /* @__PURE__ */ t("button", { type: "button", className: ue(), disabled: e >= r, onClick: () => a(e + 1), children: "Next" }) })
|
|
1256
|
+
] }) }), Ee = { left: "text-left", center: "text-center", right: "text-right" }, Bt = (e, r) => e == null ? r == null ? 0 : 1 : r == null ? -1 : typeof e == "number" && typeof r == "number" ? e - r : String(e).localeCompare(String(r), void 0, { numeric: !0, sensitivity: "base" }), Tr = ({
|
|
1257
|
+
columns: e,
|
|
1099
1258
|
rows: r,
|
|
1100
1259
|
rowKey: a = "id",
|
|
1101
1260
|
pageSize: n = 10,
|
|
1102
1261
|
searchable: s = !1,
|
|
1103
1262
|
selectable: l = !1,
|
|
1104
1263
|
selected: o,
|
|
1105
|
-
onSelectionChange:
|
|
1106
|
-
empty:
|
|
1264
|
+
onSelectionChange: i,
|
|
1265
|
+
empty: c = "No results",
|
|
1107
1266
|
caption: u,
|
|
1108
|
-
className:
|
|
1267
|
+
className: b = ""
|
|
1109
1268
|
}) => {
|
|
1110
|
-
const [d,
|
|
1111
|
-
const
|
|
1112
|
-
let
|
|
1113
|
-
(
|
|
1114
|
-
(
|
|
1269
|
+
const [d, p] = D(null), [m, g] = D(""), [h, x] = D(1), [v, N] = D([]), M = o ?? v, y = (k, $) => $.accessor ? $.accessor(k) : k[$.key], w = je(() => {
|
|
1270
|
+
const k = m.trim().toLowerCase();
|
|
1271
|
+
let $ = k ? r.filter(
|
|
1272
|
+
(R) => e.some(
|
|
1273
|
+
(F) => String(y(R, F) ?? "").toLowerCase().includes(k)
|
|
1115
1274
|
)
|
|
1116
1275
|
) : r;
|
|
1117
1276
|
if (d) {
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
(
|
|
1277
|
+
const R = e.find((F) => F.key === d.key);
|
|
1278
|
+
$ = [...$].sort(
|
|
1279
|
+
(F, E) => Bt(y(F, R), y(E, R)) * (d.dir === "asc" ? 1 : -1)
|
|
1121
1280
|
);
|
|
1122
1281
|
}
|
|
1123
|
-
return
|
|
1124
|
-
}, [r,
|
|
1125
|
-
o === void 0 &&
|
|
1126
|
-
},
|
|
1127
|
-
|
|
1128
|
-
(
|
|
1282
|
+
return $;
|
|
1283
|
+
}, [r, e, m, d]), C = Math.max(1, Math.ceil(w.length / n)), T = Math.min(h, C), L = w.slice((T - 1) * n, T * n), I = (k) => {
|
|
1284
|
+
o === void 0 && N(k), i == null || i(k);
|
|
1285
|
+
}, j = L.map((k) => k[a]), B = j.length > 0 && j.every((k) => M.includes(k)), z = j.some((k) => M.includes(k)), q = (k) => {
|
|
1286
|
+
x(1), p(
|
|
1287
|
+
($) => ($ == null ? void 0 : $.key) !== k.key ? { key: k.key, dir: "asc" } : $.dir === "asc" ? { key: k.key, dir: "desc" } : null
|
|
1129
1288
|
);
|
|
1130
1289
|
};
|
|
1131
|
-
return /* @__PURE__ */
|
|
1132
|
-
s && /* @__PURE__ */
|
|
1133
|
-
|
|
1290
|
+
return /* @__PURE__ */ f("div", { className: `flex flex-col gap-3 ${b}`, children: [
|
|
1291
|
+
s && /* @__PURE__ */ t("div", { className: "max-w-xs", children: /* @__PURE__ */ t(
|
|
1292
|
+
Ze,
|
|
1134
1293
|
{
|
|
1135
|
-
value:
|
|
1136
|
-
onChange: (
|
|
1137
|
-
|
|
1294
|
+
value: m,
|
|
1295
|
+
onChange: (k) => {
|
|
1296
|
+
g(k), x(1);
|
|
1138
1297
|
},
|
|
1139
1298
|
placeholder: "Search…",
|
|
1140
1299
|
"aria-label": "Search rows",
|
|
1141
1300
|
type: "search"
|
|
1142
1301
|
}
|
|
1143
1302
|
) }),
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
u && /* @__PURE__ */
|
|
1146
|
-
/* @__PURE__ */
|
|
1147
|
-
l && /* @__PURE__ */
|
|
1148
|
-
|
|
1303
|
+
/* @__PURE__ */ t("div", { className: "overflow-x-auto border border-app-border", children: /* @__PURE__ */ f("table", { className: "w-full border-collapse bg-app-card text-sm text-app-text", children: [
|
|
1304
|
+
u && /* @__PURE__ */ t("caption", { className: "sr-only", children: u }),
|
|
1305
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ f("tr", { className: "border-b border-app-border bg-app-bg", children: [
|
|
1306
|
+
l && /* @__PURE__ */ t("th", { scope: "col", className: "w-10 px-4 py-2.5", children: /* @__PURE__ */ t(
|
|
1307
|
+
Te,
|
|
1149
1308
|
{
|
|
1150
1309
|
"aria-label": "Select all rows on this page",
|
|
1151
|
-
checked:
|
|
1152
|
-
indeterminate: !
|
|
1153
|
-
onChange: (
|
|
1154
|
-
|
|
1310
|
+
checked: B,
|
|
1311
|
+
indeterminate: !B && z,
|
|
1312
|
+
onChange: (k) => I(
|
|
1313
|
+
k ? [.../* @__PURE__ */ new Set([...M, ...j])] : M.filter(($) => !j.includes($))
|
|
1155
1314
|
)
|
|
1156
1315
|
}
|
|
1157
1316
|
) }),
|
|
1158
|
-
|
|
1159
|
-
const
|
|
1160
|
-
return /* @__PURE__ */
|
|
1317
|
+
e.map((k) => {
|
|
1318
|
+
const $ = (d == null ? void 0 : d.key) === k.key;
|
|
1319
|
+
return /* @__PURE__ */ t(
|
|
1161
1320
|
"th",
|
|
1162
1321
|
{
|
|
1163
1322
|
scope: "col",
|
|
1164
|
-
"aria-sort":
|
|
1165
|
-
className: `px-4 py-2.5 text-xs font-semibold uppercase tracking-widest text-app-muted ${
|
|
1166
|
-
children:
|
|
1323
|
+
"aria-sort": $ ? d.dir === "asc" ? "ascending" : "descending" : k.sortable ? "none" : void 0,
|
|
1324
|
+
className: `px-4 py-2.5 text-xs font-semibold uppercase tracking-widest text-app-muted ${Ee[k.align ?? "left"]}`,
|
|
1325
|
+
children: k.sortable ? /* @__PURE__ */ f(
|
|
1167
1326
|
"button",
|
|
1168
1327
|
{
|
|
1169
1328
|
type: "button",
|
|
1170
|
-
onClick: () =>
|
|
1171
|
-
className: "inline-flex items-center gap-1 uppercase tracking-widest transition hover:text-app-text",
|
|
1329
|
+
onClick: () => q(k),
|
|
1330
|
+
className: "-my-2 inline-flex min-h-8 items-center gap-1 uppercase tracking-widest transition hover:text-app-text",
|
|
1172
1331
|
children: [
|
|
1173
|
-
|
|
1174
|
-
/* @__PURE__ */
|
|
1332
|
+
k.header,
|
|
1333
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: $ ? d.dir === "asc" ? "↑" : "↓" : "↕" })
|
|
1175
1334
|
]
|
|
1176
1335
|
}
|
|
1177
|
-
) :
|
|
1336
|
+
) : k.header
|
|
1178
1337
|
},
|
|
1179
|
-
|
|
1338
|
+
k.key
|
|
1180
1339
|
);
|
|
1181
1340
|
})
|
|
1182
1341
|
] }) }),
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
const
|
|
1185
|
-
return /* @__PURE__ */
|
|
1342
|
+
/* @__PURE__ */ t("tbody", { children: L.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: e.length + (l ? 1 : 0), className: "px-4 py-6 text-center text-app-muted", children: c }) }) : L.map((k) => {
|
|
1343
|
+
const $ = k[a], R = M.includes($);
|
|
1344
|
+
return /* @__PURE__ */ f(
|
|
1186
1345
|
"tr",
|
|
1187
1346
|
{
|
|
1188
|
-
"aria-selected": l ?
|
|
1189
|
-
className: `border-b border-app-border last:border-b-0 hover:bg-app-bg ${
|
|
1347
|
+
"aria-selected": l ? R : void 0,
|
|
1348
|
+
className: `border-b border-app-border last:border-b-0 hover:bg-app-bg ${R ? "bg-app-soft/10" : ""}`,
|
|
1190
1349
|
children: [
|
|
1191
|
-
l && /* @__PURE__ */
|
|
1192
|
-
|
|
1350
|
+
l && /* @__PURE__ */ t("td", { className: "px-4 py-2.5", children: /* @__PURE__ */ t(
|
|
1351
|
+
Te,
|
|
1193
1352
|
{
|
|
1194
|
-
"aria-label": `Select row ${
|
|
1195
|
-
checked:
|
|
1196
|
-
onChange: (
|
|
1353
|
+
"aria-label": `Select row ${$}`,
|
|
1354
|
+
checked: R,
|
|
1355
|
+
onChange: (F) => I(F ? [...M, $] : M.filter((E) => E !== $))
|
|
1197
1356
|
}
|
|
1198
1357
|
) }),
|
|
1199
|
-
|
|
1358
|
+
e.map((F) => /* @__PURE__ */ t("td", { className: `px-4 py-2.5 ${Ee[F.align ?? "left"]}`, children: F.render ? F.render(k) : k[F.key] }, F.key))
|
|
1200
1359
|
]
|
|
1201
1360
|
},
|
|
1202
|
-
|
|
1361
|
+
$
|
|
1203
1362
|
);
|
|
1204
1363
|
}) })
|
|
1205
1364
|
] }) }),
|
|
1206
|
-
/* @__PURE__ */
|
|
1207
|
-
/* @__PURE__ */
|
|
1208
|
-
|
|
1365
|
+
/* @__PURE__ */ f("div", { className: "flex flex-wrap items-center justify-between gap-3 text-xs text-app-muted", children: [
|
|
1366
|
+
/* @__PURE__ */ f("span", { "aria-live": "polite", children: [
|
|
1367
|
+
w.length,
|
|
1209
1368
|
" ",
|
|
1210
|
-
|
|
1211
|
-
l &&
|
|
1369
|
+
w.length === 1 ? "row" : "rows",
|
|
1370
|
+
l && M.length > 0 ? `, ${M.length} selected` : ""
|
|
1212
1371
|
] }),
|
|
1213
|
-
|
|
1372
|
+
C > 1 && /* @__PURE__ */ t(Ft, { page: T, pageCount: C, onChange: x })
|
|
1214
1373
|
] })
|
|
1215
1374
|
] });
|
|
1216
|
-
},
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
(c = r.current) != null && c.contains(o.target) || n.current("outside");
|
|
1225
|
-
}, l = (o) => {
|
|
1226
|
-
o.key === "Escape" && n.current("escape");
|
|
1227
|
-
};
|
|
1228
|
-
return document.addEventListener("mousedown", s), document.addEventListener("keydown", l), () => {
|
|
1229
|
-
document.removeEventListener("mousedown", s), document.removeEventListener("keydown", l);
|
|
1230
|
-
};
|
|
1231
|
-
}, [t, r]);
|
|
1232
|
-
}, cr = ({ label: t, value: r, onChange: a, min: n, max: s, placeholder: l = "Select date", error: o, locale: c, weekStartsOn: i }) => {
|
|
1233
|
-
const [u, m] = k(!1), d = E(null), f = S(), b = `${f}-error`;
|
|
1234
|
-
return de(u, d, (x) => {
|
|
1235
|
-
var p, g;
|
|
1236
|
-
m(!1), x === "escape" && ((g = (p = d.current) == null ? void 0 : p.querySelector("button")) == null || g.focus());
|
|
1237
|
-
}), /* @__PURE__ */ h("div", { ref: d, className: "relative flex flex-col gap-1", children: [
|
|
1238
|
-
t && /* @__PURE__ */ e("label", { htmlFor: f, className: "text-xs font-semibold uppercase tracking-widest text-app-muted", children: t }),
|
|
1239
|
-
/* @__PURE__ */ e(
|
|
1375
|
+
}, Dr = ({ label: e, value: r, onChange: a, min: n, max: s, placeholder: l = "Select date", error: o, locale: i, weekStartsOn: c }) => {
|
|
1376
|
+
const [u, b] = D(!1), d = A(null), p = A(null), m = A(null), g = O(), h = `${g}-error`;
|
|
1377
|
+
return V(u, [d, m], (x) => {
|
|
1378
|
+
var v, N;
|
|
1379
|
+
b(!1), x === "escape" && ((N = (v = d.current) == null ? void 0 : v.querySelector("button")) == null || N.focus());
|
|
1380
|
+
}), /* @__PURE__ */ f("div", { ref: d, className: "relative flex flex-col gap-1", children: [
|
|
1381
|
+
e && /* @__PURE__ */ t(U, { htmlFor: g, children: e }),
|
|
1382
|
+
/* @__PURE__ */ t(
|
|
1240
1383
|
"button",
|
|
1241
1384
|
{
|
|
1242
|
-
|
|
1385
|
+
ref: p,
|
|
1386
|
+
id: g,
|
|
1243
1387
|
type: "button",
|
|
1244
1388
|
"aria-haspopup": "dialog",
|
|
1245
1389
|
"aria-expanded": u,
|
|
1246
1390
|
"aria-invalid": !!o,
|
|
1247
|
-
"aria-describedby": o ?
|
|
1248
|
-
onClick: () =>
|
|
1249
|
-
className: `${
|
|
1250
|
-
children: r ?
|
|
1391
|
+
"aria-describedby": o ? h : void 0,
|
|
1392
|
+
onClick: () => b((x) => !x),
|
|
1393
|
+
className: `${se(!!o)} text-left ${r ? "" : "text-app-muted"}`,
|
|
1394
|
+
children: r ? be(r, i) : l
|
|
1251
1395
|
}
|
|
1252
1396
|
),
|
|
1253
|
-
|
|
1254
|
-
|
|
1397
|
+
/* @__PURE__ */ t(
|
|
1398
|
+
X,
|
|
1255
1399
|
{
|
|
1400
|
+
open: u,
|
|
1401
|
+
anchorRef: p,
|
|
1402
|
+
panelRef: m,
|
|
1403
|
+
placement: "bottom-start",
|
|
1256
1404
|
role: "dialog",
|
|
1257
1405
|
"aria-label": "Choose date",
|
|
1258
|
-
className: "
|
|
1259
|
-
children: /* @__PURE__ */
|
|
1260
|
-
|
|
1406
|
+
className: "shadow-xl",
|
|
1407
|
+
children: /* @__PURE__ */ t(
|
|
1408
|
+
Ge,
|
|
1261
1409
|
{
|
|
1262
1410
|
value: r,
|
|
1263
1411
|
min: n,
|
|
1264
1412
|
max: s,
|
|
1265
|
-
locale:
|
|
1266
|
-
weekStartsOn:
|
|
1413
|
+
locale: i,
|
|
1414
|
+
weekStartsOn: c,
|
|
1267
1415
|
onChange: (x) => {
|
|
1268
|
-
var
|
|
1269
|
-
a == null || a(x),
|
|
1416
|
+
var v, N;
|
|
1417
|
+
a == null || a(x), b(!1), (N = (v = d.current) == null ? void 0 : v.querySelector("button")) == null || N.focus();
|
|
1270
1418
|
}
|
|
1271
1419
|
}
|
|
1272
1420
|
)
|
|
1273
1421
|
}
|
|
1274
1422
|
),
|
|
1275
|
-
o && /* @__PURE__ */
|
|
1423
|
+
o && /* @__PURE__ */ t("span", { id: h, className: "text-xs text-red-700 dark:text-red-400", children: o })
|
|
1276
1424
|
] });
|
|
1277
|
-
},
|
|
1278
|
-
label:
|
|
1425
|
+
}, Ar = ({
|
|
1426
|
+
label: e,
|
|
1279
1427
|
value: r,
|
|
1280
1428
|
onChange: a,
|
|
1281
1429
|
min: n,
|
|
1282
1430
|
max: s,
|
|
1283
1431
|
placeholder: l = "Select range",
|
|
1284
1432
|
error: o,
|
|
1285
|
-
locale:
|
|
1286
|
-
weekStartsOn:
|
|
1433
|
+
locale: i,
|
|
1434
|
+
weekStartsOn: c
|
|
1287
1435
|
}) => {
|
|
1288
|
-
const [u,
|
|
1289
|
-
|
|
1436
|
+
const [u, b] = D(!1), [d, p] = D(null), m = A(null), g = A(null), h = A(null), x = O(), v = `${x}-error`, N = () => {
|
|
1437
|
+
b(!1), p(null);
|
|
1290
1438
|
};
|
|
1291
|
-
|
|
1292
|
-
var
|
|
1293
|
-
|
|
1439
|
+
V(u, [m, h], (w) => {
|
|
1440
|
+
var C, T;
|
|
1441
|
+
N(), w === "escape" && ((T = (C = m.current) == null ? void 0 : C.querySelector("button")) == null || T.focus());
|
|
1294
1442
|
});
|
|
1295
|
-
const
|
|
1296
|
-
var L,
|
|
1443
|
+
const M = (w) => {
|
|
1444
|
+
var L, I;
|
|
1297
1445
|
if (!d) {
|
|
1298
|
-
|
|
1446
|
+
p(w), a == null || a({ start: w, end: null });
|
|
1299
1447
|
return;
|
|
1300
1448
|
}
|
|
1301
|
-
const [
|
|
1302
|
-
a == null || a({ start:
|
|
1303
|
-
},
|
|
1304
|
-
return /* @__PURE__ */
|
|
1305
|
-
|
|
1306
|
-
/* @__PURE__ */
|
|
1449
|
+
const [C, T] = te(w, d) ? [w, d] : [d, w];
|
|
1450
|
+
a == null || a({ start: C, end: T }), N(), (I = (L = m.current) == null ? void 0 : L.querySelector("button")) == null || I.focus();
|
|
1451
|
+
}, y = r != null && r.start ? `${be(r.start, i)} – ${r.end ? be(r.end, i) : "…"}` : "";
|
|
1452
|
+
return /* @__PURE__ */ f("div", { ref: m, className: "relative flex flex-col gap-1", children: [
|
|
1453
|
+
e && /* @__PURE__ */ t(U, { htmlFor: x, children: e }),
|
|
1454
|
+
/* @__PURE__ */ t(
|
|
1307
1455
|
"button",
|
|
1308
1456
|
{
|
|
1457
|
+
ref: g,
|
|
1309
1458
|
id: x,
|
|
1310
1459
|
type: "button",
|
|
1311
1460
|
"aria-haspopup": "dialog",
|
|
1312
1461
|
"aria-expanded": u,
|
|
1313
1462
|
"aria-invalid": !!o,
|
|
1314
|
-
"aria-describedby": o ?
|
|
1315
|
-
onClick: () => u ?
|
|
1316
|
-
className: `${
|
|
1317
|
-
children:
|
|
1463
|
+
"aria-describedby": o ? v : void 0,
|
|
1464
|
+
onClick: () => u ? N() : b(!0),
|
|
1465
|
+
className: `${se(!!o)} text-left ${y ? "" : "text-app-muted"}`,
|
|
1466
|
+
children: y || l
|
|
1318
1467
|
}
|
|
1319
1468
|
),
|
|
1320
|
-
|
|
1321
|
-
|
|
1469
|
+
/* @__PURE__ */ t(
|
|
1470
|
+
X,
|
|
1322
1471
|
{
|
|
1472
|
+
open: u,
|
|
1473
|
+
anchorRef: g,
|
|
1474
|
+
panelRef: h,
|
|
1475
|
+
placement: "bottom-start",
|
|
1323
1476
|
role: "dialog",
|
|
1324
1477
|
"aria-label": "Choose date range",
|
|
1325
|
-
className: "
|
|
1326
|
-
children: /* @__PURE__ */
|
|
1327
|
-
|
|
1478
|
+
className: "shadow-xl",
|
|
1479
|
+
children: /* @__PURE__ */ t(
|
|
1480
|
+
Ge,
|
|
1328
1481
|
{
|
|
1329
1482
|
rangeStart: d ?? (r == null ? void 0 : r.start),
|
|
1330
1483
|
rangeEnd: d ? null : r == null ? void 0 : r.end,
|
|
1331
1484
|
min: n,
|
|
1332
1485
|
max: s,
|
|
1333
|
-
locale:
|
|
1334
|
-
weekStartsOn:
|
|
1335
|
-
onChange:
|
|
1486
|
+
locale: i,
|
|
1487
|
+
weekStartsOn: c,
|
|
1488
|
+
onChange: M
|
|
1336
1489
|
}
|
|
1337
1490
|
)
|
|
1338
1491
|
}
|
|
1339
1492
|
),
|
|
1340
|
-
o && /* @__PURE__ */
|
|
1493
|
+
o && /* @__PURE__ */ t("span", { id: v, className: "text-xs text-red-700 dark:text-red-400", children: o })
|
|
1341
1494
|
] });
|
|
1342
|
-
},
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
] }) : /* @__PURE__ */
|
|
1347
|
-
label:
|
|
1495
|
+
}, Er = ({ orientation: e = "horizontal", label: r, className: a = "" }) => e === "vertical" ? /* @__PURE__ */ t("div", { role: "separator", "aria-orientation": "vertical", className: `w-px self-stretch bg-app-border ${a}` }) : r ? /* @__PURE__ */ f("div", { role: "separator", className: `flex items-center gap-3 ${a}`, children: [
|
|
1496
|
+
/* @__PURE__ */ t("span", { className: "h-px flex-1 bg-app-border" }),
|
|
1497
|
+
/* @__PURE__ */ t(U, { children: r }),
|
|
1498
|
+
/* @__PURE__ */ t("span", { className: "h-px flex-1 bg-app-border" })
|
|
1499
|
+
] }) : /* @__PURE__ */ t("hr", { className: `border-0 border-t border-app-border ${a}` }), Ir = ({
|
|
1500
|
+
label: e,
|
|
1348
1501
|
value: r,
|
|
1349
1502
|
onChange: a,
|
|
1350
1503
|
placeholder: n,
|
|
1351
1504
|
error: s,
|
|
1352
1505
|
type: l = "text",
|
|
1353
1506
|
autoComplete: o = "off",
|
|
1354
|
-
required:
|
|
1355
|
-
...
|
|
1507
|
+
required: i = !0,
|
|
1508
|
+
...c
|
|
1356
1509
|
}) => {
|
|
1357
|
-
const u =
|
|
1358
|
-
return /* @__PURE__ */
|
|
1359
|
-
/* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */
|
|
1510
|
+
const u = O(), b = `${u}-error`;
|
|
1511
|
+
return /* @__PURE__ */ f("div", { className: "flex flex-col gap-1", children: [
|
|
1512
|
+
/* @__PURE__ */ t(U, { htmlFor: u, children: e }),
|
|
1513
|
+
/* @__PURE__ */ t(
|
|
1361
1514
|
"input",
|
|
1362
1515
|
{
|
|
1363
1516
|
id: u,
|
|
1364
1517
|
type: l,
|
|
1365
1518
|
autoComplete: o,
|
|
1366
|
-
"aria-required":
|
|
1519
|
+
"aria-required": i,
|
|
1367
1520
|
"aria-invalid": !!s,
|
|
1368
|
-
"aria-describedby": s ?
|
|
1521
|
+
"aria-describedby": s ? b : void 0,
|
|
1369
1522
|
className: `bg-app-bg border px-3 py-2 text-sm text-app-text placeholder:text-app-muted outline-none transition focus:ring-2 focus:ring-app-strong focus:border-app-strong ${s ? "border-red-500" : "border-app-border"}`,
|
|
1370
1523
|
placeholder: n,
|
|
1371
1524
|
value: r,
|
|
1372
1525
|
onChange: (d) => a(d.target.value),
|
|
1373
|
-
...
|
|
1526
|
+
...c
|
|
1374
1527
|
}
|
|
1375
1528
|
),
|
|
1376
|
-
s && /* @__PURE__ */
|
|
1529
|
+
s && /* @__PURE__ */ t("span", { id: b, className: "text-xs text-red-700 dark:text-red-400", children: s })
|
|
1377
1530
|
] });
|
|
1378
|
-
},
|
|
1379
|
-
label:
|
|
1531
|
+
}, Sr = ({
|
|
1532
|
+
label: e = "Choose files or drop them here",
|
|
1380
1533
|
accept: r,
|
|
1381
1534
|
multiple: a = !1,
|
|
1382
1535
|
onChange: n,
|
|
1383
1536
|
disabled: s = !1
|
|
1384
1537
|
}) => {
|
|
1385
|
-
const l =
|
|
1386
|
-
const
|
|
1387
|
-
|
|
1538
|
+
const l = O(), [o, i] = D([]), [c, u] = D(!1), b = (d) => {
|
|
1539
|
+
const p = [...d];
|
|
1540
|
+
i(p), n == null || n(p);
|
|
1388
1541
|
};
|
|
1389
|
-
return /* @__PURE__ */
|
|
1390
|
-
/* @__PURE__ */
|
|
1542
|
+
return /* @__PURE__ */ f("div", { className: "flex flex-col gap-2", children: [
|
|
1543
|
+
/* @__PURE__ */ f(
|
|
1391
1544
|
"label",
|
|
1392
1545
|
{
|
|
1393
1546
|
htmlFor: l,
|
|
@@ -1396,12 +1549,12 @@ const yt = (t, r, a) => {
|
|
|
1396
1549
|
},
|
|
1397
1550
|
onDragLeave: () => u(!1),
|
|
1398
1551
|
onDrop: (d) => {
|
|
1399
|
-
d.preventDefault(), u(!1), s ||
|
|
1552
|
+
d.preventDefault(), u(!1), s || b(a ? d.dataTransfer.files : [d.dataTransfer.files[0]].filter(Boolean));
|
|
1400
1553
|
},
|
|
1401
|
-
className: `flex flex-col items-center justify-center gap-1 border border-dashed px-4 py-8 text-center text-sm text-app-muted transition focus-within:ring-2 focus-within:ring-app-strong ${
|
|
1554
|
+
className: `flex flex-col items-center justify-center gap-1 border border-dashed px-4 py-8 text-center text-sm text-app-muted transition focus-within:ring-2 focus-within:ring-app-strong ${c ? "border-app-strong bg-app-soft/10" : "border-app-border bg-app-bg"} ${s ? "cursor-not-allowed opacity-50" : "cursor-pointer hover:border-app-strong"}`,
|
|
1402
1555
|
children: [
|
|
1403
|
-
|
|
1404
|
-
/* @__PURE__ */
|
|
1556
|
+
e,
|
|
1557
|
+
/* @__PURE__ */ t(
|
|
1405
1558
|
"input",
|
|
1406
1559
|
{
|
|
1407
1560
|
id: l,
|
|
@@ -1410,50 +1563,50 @@ const yt = (t, r, a) => {
|
|
|
1410
1563
|
multiple: a,
|
|
1411
1564
|
disabled: s,
|
|
1412
1565
|
className: "sr-only",
|
|
1413
|
-
onChange: (d) =>
|
|
1566
|
+
onChange: (d) => b(d.target.files)
|
|
1414
1567
|
}
|
|
1415
1568
|
)
|
|
1416
1569
|
]
|
|
1417
1570
|
}
|
|
1418
1571
|
),
|
|
1419
|
-
o.length > 0 && /* @__PURE__ */
|
|
1572
|
+
o.length > 0 && /* @__PURE__ */ t("ul", { className: "m-0 list-none p-0 text-xs text-app-soft", children: o.map((d) => /* @__PURE__ */ t("li", { children: d.name }, `${d.name}-${d.size}`)) })
|
|
1420
1573
|
] });
|
|
1421
|
-
},
|
|
1574
|
+
}, Ot = { 0: "gap-0", 1: "gap-1", 2: "gap-2", 3: "gap-3", 4: "gap-4", 6: "gap-6", 8: "gap-8" }, Wt = { row: "flex-row", column: "flex-col" }, zt = {
|
|
1422
1575
|
start: "items-start",
|
|
1423
1576
|
center: "items-center",
|
|
1424
1577
|
end: "items-end",
|
|
1425
1578
|
stretch: "items-stretch",
|
|
1426
1579
|
baseline: "items-baseline"
|
|
1427
|
-
},
|
|
1580
|
+
}, qt = {
|
|
1428
1581
|
start: "justify-start",
|
|
1429
1582
|
center: "justify-center",
|
|
1430
1583
|
end: "justify-end",
|
|
1431
1584
|
between: "justify-between",
|
|
1432
1585
|
around: "justify-around"
|
|
1433
|
-
},
|
|
1434
|
-
direction:
|
|
1586
|
+
}, Kt = ({
|
|
1587
|
+
direction: e = "row",
|
|
1435
1588
|
gap: r = 3,
|
|
1436
1589
|
align: a,
|
|
1437
1590
|
justify: n,
|
|
1438
1591
|
wrap: s = !1,
|
|
1439
1592
|
inline: l = !1,
|
|
1440
1593
|
className: o = "",
|
|
1441
|
-
as:
|
|
1442
|
-
children:
|
|
1594
|
+
as: i = "div",
|
|
1595
|
+
children: c,
|
|
1443
1596
|
...u
|
|
1444
|
-
}) => /* @__PURE__ */
|
|
1445
|
-
|
|
1597
|
+
}) => /* @__PURE__ */ t(
|
|
1598
|
+
i,
|
|
1446
1599
|
{
|
|
1447
|
-
className: `${l ? "inline-flex" : "flex"} ${
|
|
1600
|
+
className: `${l ? "inline-flex" : "flex"} ${Wt[e]} ${Ot[r]} ${a ? zt[a] : ""} ${n ? qt[n] : ""} ${s ? "flex-wrap" : ""} ${o}`,
|
|
1448
1601
|
...u,
|
|
1449
|
-
children:
|
|
1602
|
+
children: c
|
|
1450
1603
|
}
|
|
1451
|
-
),
|
|
1452
|
-
const s =
|
|
1453
|
-
return
|
|
1454
|
-
},
|
|
1455
|
-
const [
|
|
1456
|
-
return
|
|
1604
|
+
), Pr = ({ active: e = !0, className: r = "", children: a, ...n }) => {
|
|
1605
|
+
const s = A(null);
|
|
1606
|
+
return ie(e, s), /* @__PURE__ */ t("div", { ref: s, tabIndex: -1, className: r, ...n, children: a });
|
|
1607
|
+
}, Rr = ({ as: e = "p", className: r = "", children: a, ...n }) => /* @__PURE__ */ t(e, { className: `m-0 text-xs text-app-muted ${r}`, ...n, children: a }), _t = { square: "aspect-square", video: "aspect-video", photo: "aspect-[4/3]" }, jr = ({ src: e, alt: r, ratio: a, fit: n = "cover", fallback: s = "Image unavailable", className: l = "", ...o }) => {
|
|
1608
|
+
const [i, c] = D(!1), u = `${a ? _t[a] : ""} ${l}`;
|
|
1609
|
+
return i ? /* @__PURE__ */ t(
|
|
1457
1610
|
"div",
|
|
1458
1611
|
{
|
|
1459
1612
|
role: "img",
|
|
@@ -1461,27 +1614,27 @@ const yt = (t, r, a) => {
|
|
|
1461
1614
|
className: `flex items-center justify-center border border-app-border bg-app-bg p-4 text-xs text-app-muted ${u}`,
|
|
1462
1615
|
children: s
|
|
1463
1616
|
}
|
|
1464
|
-
) : /* @__PURE__ */
|
|
1617
|
+
) : /* @__PURE__ */ t(
|
|
1465
1618
|
"img",
|
|
1466
1619
|
{
|
|
1467
|
-
src:
|
|
1620
|
+
src: e,
|
|
1468
1621
|
alt: r,
|
|
1469
1622
|
loading: "lazy",
|
|
1470
|
-
onError: () =>
|
|
1623
|
+
onError: () => c(!0),
|
|
1471
1624
|
className: `block w-full ${n === "contain" ? "object-contain" : "object-cover"} ${u}`,
|
|
1472
1625
|
...o
|
|
1473
1626
|
}
|
|
1474
1627
|
);
|
|
1475
|
-
},
|
|
1476
|
-
const s = /* @__PURE__ */
|
|
1477
|
-
n.leading && /* @__PURE__ */
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
n.secondary && /* @__PURE__ */
|
|
1628
|
+
}, Fr = ({ items: e, divided: r = !0, className: a = "" }) => /* @__PURE__ */ t("ul", { className: `m-0 list-none border border-app-border bg-app-card p-0 ${a}`, children: e.map((n) => {
|
|
1629
|
+
const s = /* @__PURE__ */ f(re, { children: [
|
|
1630
|
+
n.leading && /* @__PURE__ */ t("span", { className: "shrink-0", children: n.leading }),
|
|
1631
|
+
/* @__PURE__ */ f("span", { className: "min-w-0 flex-1 text-left", children: [
|
|
1632
|
+
/* @__PURE__ */ t("span", { className: "block truncate text-sm text-app-text", children: n.primary }),
|
|
1633
|
+
n.secondary && /* @__PURE__ */ t("span", { className: "block truncate text-xs text-app-muted", children: n.secondary })
|
|
1481
1634
|
] }),
|
|
1482
|
-
n.trailing && /* @__PURE__ */
|
|
1635
|
+
n.trailing && /* @__PURE__ */ t("span", { className: "shrink-0 text-xs text-app-muted", children: n.trailing })
|
|
1483
1636
|
] });
|
|
1484
|
-
return /* @__PURE__ */
|
|
1637
|
+
return /* @__PURE__ */ t("li", { className: r ? "border-b border-app-border last:border-b-0" : "", children: n.onClick ? /* @__PURE__ */ t(
|
|
1485
1638
|
"button",
|
|
1486
1639
|
{
|
|
1487
1640
|
type: "button",
|
|
@@ -1489,9 +1642,9 @@ const yt = (t, r, a) => {
|
|
|
1489
1642
|
className: "flex w-full items-center gap-3 px-4 py-3 transition hover:bg-app-bg",
|
|
1490
1643
|
children: s
|
|
1491
1644
|
}
|
|
1492
|
-
) : /* @__PURE__ */
|
|
1493
|
-
}) }),
|
|
1494
|
-
children:
|
|
1645
|
+
) : /* @__PURE__ */ t("div", { className: "flex items-center gap-3 px-4 py-3", children: s }) }, n.key);
|
|
1646
|
+
}) }), Ut = ({
|
|
1647
|
+
children: e,
|
|
1495
1648
|
maxWidth: r = "max-w-5xl",
|
|
1496
1649
|
centerContent: a = !1,
|
|
1497
1650
|
themeToggle: n = !1,
|
|
@@ -1499,51 +1652,39 @@ const yt = (t, r, a) => {
|
|
|
1499
1652
|
innerClassName: l = ""
|
|
1500
1653
|
}) => {
|
|
1501
1654
|
const o = a ? "flex flex-1 items-center justify-center" : "";
|
|
1502
|
-
return /* @__PURE__ */
|
|
1503
|
-
n && /* @__PURE__ */
|
|
1504
|
-
/* @__PURE__ */
|
|
1655
|
+
return /* @__PURE__ */ f("main", { className: `relative flex flex-1 flex-col bg-app-bg px-4 py-8 sm:py-10 ${s}`, children: [
|
|
1656
|
+
n && /* @__PURE__ */ t("div", { className: "absolute right-4 top-4", children: /* @__PURE__ */ t(ze, {}) }),
|
|
1657
|
+
/* @__PURE__ */ t("div", { className: `mx-auto w-full ${r} ${o} ${l}`, children: e })
|
|
1505
1658
|
] });
|
|
1506
|
-
},
|
|
1507
|
-
brand:
|
|
1659
|
+
}, Br = () => /* @__PURE__ */ t(Ut, { maxWidth: "max-w-sm", centerContent: !0, children: /* @__PURE__ */ t(Ye, { label: "Loading" }) }), Or = ({
|
|
1660
|
+
brand: e,
|
|
1508
1661
|
links: r = [],
|
|
1509
1662
|
actions: a,
|
|
1510
1663
|
linkComponent: n = "a",
|
|
1511
1664
|
linkProp: s = "href",
|
|
1512
1665
|
label: l = "Main",
|
|
1513
1666
|
className: o = ""
|
|
1514
|
-
}) => /* @__PURE__ */
|
|
1667
|
+
}) => /* @__PURE__ */ f(
|
|
1515
1668
|
"nav",
|
|
1516
1669
|
{
|
|
1517
1670
|
"aria-label": l,
|
|
1518
1671
|
className: `flex flex-wrap items-center gap-x-6 gap-y-2 border-b border-app-border bg-app-card px-4 py-3 ${o}`,
|
|
1519
1672
|
children: [
|
|
1520
|
-
|
|
1521
|
-
/* @__PURE__ */
|
|
1673
|
+
e && /* @__PURE__ */ t("div", { className: "text-sm font-bold tracking-tight text-app-text", children: e }),
|
|
1674
|
+
/* @__PURE__ */ t("ul", { className: "m-0 flex flex-1 list-none flex-wrap items-center gap-1 p-0", children: r.map(({ href: i, label: c, active: u, ...b }) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
|
|
1522
1675
|
n,
|
|
1523
1676
|
{
|
|
1524
|
-
[s]:
|
|
1677
|
+
[s]: i,
|
|
1525
1678
|
"aria-current": u ? "page" : void 0,
|
|
1526
1679
|
className: `px-2.5 py-1.5 text-xs font-semibold uppercase tracking-widest transition ${u ? "bg-app-strong text-app-bg" : "text-app-muted hover:text-app-text"}`,
|
|
1527
|
-
...
|
|
1528
|
-
children:
|
|
1680
|
+
...b,
|
|
1681
|
+
children: c
|
|
1529
1682
|
}
|
|
1530
|
-
) },
|
|
1531
|
-
a && /* @__PURE__ */
|
|
1683
|
+
) }, c)) }),
|
|
1684
|
+
a && /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: a })
|
|
1532
1685
|
]
|
|
1533
1686
|
}
|
|
1534
|
-
),
|
|
1535
|
-
const [n, s] = k(!1);
|
|
1536
|
-
return Ne(() => {
|
|
1537
|
-
if (!t) {
|
|
1538
|
-
s(!1);
|
|
1539
|
-
return;
|
|
1540
|
-
}
|
|
1541
|
-
const l = r.current;
|
|
1542
|
-
if (!l) return;
|
|
1543
|
-
const o = l.getBoundingClientRect(), c = document.documentElement.clientWidth, i = a === "end" ? o.left < ye : o.right > c - ye;
|
|
1544
|
-
s(i);
|
|
1545
|
-
}, [t, r, a]), n ? a === "end" ? "start" : "end" : a;
|
|
1546
|
-
}, Tt = () => /* @__PURE__ */ e(
|
|
1687
|
+
), Gt = () => /* @__PURE__ */ t(
|
|
1547
1688
|
"svg",
|
|
1548
1689
|
{
|
|
1549
1690
|
"aria-hidden": "true",
|
|
@@ -1553,7 +1694,7 @@ const yt = (t, r, a) => {
|
|
|
1553
1694
|
fill: "none",
|
|
1554
1695
|
stroke: "currentColor",
|
|
1555
1696
|
strokeWidth: "1.8",
|
|
1556
|
-
children: /* @__PURE__ */
|
|
1697
|
+
children: /* @__PURE__ */ t(
|
|
1557
1698
|
"path",
|
|
1558
1699
|
{
|
|
1559
1700
|
strokeLinecap: "round",
|
|
@@ -1562,8 +1703,8 @@ const yt = (t, r, a) => {
|
|
|
1562
1703
|
}
|
|
1563
1704
|
)
|
|
1564
1705
|
}
|
|
1565
|
-
),
|
|
1566
|
-
notifications:
|
|
1706
|
+
), Wr = ({
|
|
1707
|
+
notifications: e,
|
|
1567
1708
|
onSelect: r,
|
|
1568
1709
|
onMarkRead: a,
|
|
1569
1710
|
onMarkAllRead: n,
|
|
@@ -1571,46 +1712,49 @@ const yt = (t, r, a) => {
|
|
|
1571
1712
|
empty: l = "You are all caught up",
|
|
1572
1713
|
align: o = "end"
|
|
1573
1714
|
}) => {
|
|
1574
|
-
const [
|
|
1575
|
-
return
|
|
1576
|
-
var
|
|
1577
|
-
|
|
1578
|
-
}), /* @__PURE__ */
|
|
1579
|
-
/* @__PURE__ */
|
|
1580
|
-
|
|
1715
|
+
const [i, c] = D(!1), u = A(null), b = A(null), d = O(), p = e.filter((m) => !m.read).length;
|
|
1716
|
+
return V(i, [u, b], (m) => {
|
|
1717
|
+
var g, h;
|
|
1718
|
+
c(!1), m === "escape" && ((h = (g = u.current) == null ? void 0 : g.querySelector("button")) == null || h.focus());
|
|
1719
|
+
}), /* @__PURE__ */ f("div", { ref: u, className: "relative inline-block", children: [
|
|
1720
|
+
/* @__PURE__ */ t(
|
|
1721
|
+
H,
|
|
1581
1722
|
{
|
|
1582
1723
|
variant: "secondary",
|
|
1583
|
-
"aria-label":
|
|
1724
|
+
"aria-label": p ? `Notifications, ${p} unread` : "Notifications",
|
|
1584
1725
|
"aria-haspopup": "dialog",
|
|
1585
|
-
"aria-expanded":
|
|
1586
|
-
"aria-controls":
|
|
1587
|
-
onClick: () =>
|
|
1588
|
-
children: /* @__PURE__ */
|
|
1589
|
-
/* @__PURE__ */
|
|
1590
|
-
|
|
1726
|
+
"aria-expanded": i,
|
|
1727
|
+
"aria-controls": i ? d : void 0,
|
|
1728
|
+
onClick: () => c((m) => !m),
|
|
1729
|
+
children: /* @__PURE__ */ f("span", { className: "relative inline-flex", children: [
|
|
1730
|
+
/* @__PURE__ */ t(Gt, {}),
|
|
1731
|
+
p > 0 && /* @__PURE__ */ t(
|
|
1591
1732
|
"span",
|
|
1592
1733
|
{
|
|
1593
1734
|
"aria-hidden": "true",
|
|
1594
1735
|
className: "absolute -right-2 -top-2 min-w-[1rem] bg-red-500 px-1 text-center text-[10px] font-bold leading-4 text-white",
|
|
1595
|
-
children:
|
|
1736
|
+
children: p > 9 ? "9+" : p
|
|
1596
1737
|
}
|
|
1597
1738
|
)
|
|
1598
1739
|
] })
|
|
1599
1740
|
}
|
|
1600
1741
|
),
|
|
1601
|
-
|
|
1602
|
-
|
|
1742
|
+
/* @__PURE__ */ f(
|
|
1743
|
+
X,
|
|
1603
1744
|
{
|
|
1604
|
-
|
|
1605
|
-
|
|
1745
|
+
open: i,
|
|
1746
|
+
anchorRef: u,
|
|
1747
|
+
panelRef: b,
|
|
1748
|
+
placement: `bottom-${o}`,
|
|
1749
|
+
id: d,
|
|
1606
1750
|
role: "dialog",
|
|
1607
1751
|
"aria-label": "Notifications",
|
|
1608
|
-
className:
|
|
1752
|
+
className: "flex max-h-96 w-80 max-w-[calc(100vw-1rem)] flex-col border border-app-border bg-app-card shadow-xl",
|
|
1609
1753
|
children: [
|
|
1610
|
-
/* @__PURE__ */
|
|
1611
|
-
/* @__PURE__ */
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
n &&
|
|
1754
|
+
/* @__PURE__ */ f("div", { className: "flex items-center justify-between gap-2 border-b border-app-border px-4 py-2.5", children: [
|
|
1755
|
+
/* @__PURE__ */ t("span", { className: "text-xs font-semibold uppercase tracking-widest text-app-text", children: "Notifications" }),
|
|
1756
|
+
/* @__PURE__ */ f("span", { className: "flex gap-3 text-xs", children: [
|
|
1757
|
+
n && p > 0 && /* @__PURE__ */ t(
|
|
1614
1758
|
"button",
|
|
1615
1759
|
{
|
|
1616
1760
|
type: "button",
|
|
@@ -1619,7 +1763,7 @@ const yt = (t, r, a) => {
|
|
|
1619
1763
|
children: "Mark all read"
|
|
1620
1764
|
}
|
|
1621
1765
|
),
|
|
1622
|
-
s &&
|
|
1766
|
+
s && e.length > 0 && /* @__PURE__ */ t(
|
|
1623
1767
|
"button",
|
|
1624
1768
|
{
|
|
1625
1769
|
type: "button",
|
|
@@ -1630,76 +1774,76 @@ const yt = (t, r, a) => {
|
|
|
1630
1774
|
)
|
|
1631
1775
|
] })
|
|
1632
1776
|
] }),
|
|
1633
|
-
|
|
1777
|
+
e.length === 0 ? /* @__PURE__ */ t("p", { className: "m-0 px-4 py-8 text-center text-sm text-app-muted", children: l }) : /* @__PURE__ */ t("ul", { className: "m-0 flex-1 list-none overflow-y-auto p-0", children: e.map((m) => /* @__PURE__ */ t("li", { className: "border-b border-app-border last:border-b-0", children: /* @__PURE__ */ f(
|
|
1634
1778
|
"button",
|
|
1635
1779
|
{
|
|
1636
1780
|
type: "button",
|
|
1637
1781
|
onClick: () => {
|
|
1638
|
-
|
|
1782
|
+
m.read || a == null || a(m.id), r == null || r(m);
|
|
1639
1783
|
},
|
|
1640
1784
|
className: "flex w-full items-start gap-3 px-4 py-3 text-left transition hover:bg-app-bg",
|
|
1641
1785
|
children: [
|
|
1642
|
-
/* @__PURE__ */
|
|
1786
|
+
/* @__PURE__ */ t(
|
|
1643
1787
|
"span",
|
|
1644
1788
|
{
|
|
1645
1789
|
"aria-hidden": "true",
|
|
1646
|
-
className: `mt-1.5 h-2 w-2 shrink-0 ${
|
|
1790
|
+
className: `mt-1.5 h-2 w-2 shrink-0 ${m.read ? "bg-transparent" : "bg-red-500"}`
|
|
1647
1791
|
}
|
|
1648
1792
|
),
|
|
1649
|
-
/* @__PURE__ */
|
|
1650
|
-
/* @__PURE__ */
|
|
1651
|
-
|
|
1652
|
-
|
|
1793
|
+
/* @__PURE__ */ f("span", { className: "min-w-0 flex-1", children: [
|
|
1794
|
+
/* @__PURE__ */ t("span", { className: `block text-sm text-app-text ${m.read ? "" : "font-semibold"}`, children: m.title }),
|
|
1795
|
+
m.body && /* @__PURE__ */ t("span", { className: "block text-xs text-app-muted", children: m.body }),
|
|
1796
|
+
m.time && /* @__PURE__ */ t("span", { className: "mt-0.5 block text-[10px] uppercase tracking-widest text-app-muted", children: m.time })
|
|
1653
1797
|
] }),
|
|
1654
|
-
!
|
|
1798
|
+
!m.read && /* @__PURE__ */ t("span", { className: "sr-only", children: "Unread" })
|
|
1655
1799
|
]
|
|
1656
1800
|
}
|
|
1657
|
-
) },
|
|
1801
|
+
) }, m.id)) })
|
|
1658
1802
|
]
|
|
1659
1803
|
}
|
|
1660
1804
|
)
|
|
1661
1805
|
] });
|
|
1662
|
-
},
|
|
1663
|
-
if (r -
|
|
1664
|
-
const
|
|
1665
|
-
return `${
|
|
1806
|
+
}, zr = ({ as: e = "h1", className: r = "", children: a, ...n }) => /* @__PURE__ */ t(e, { className: `m-0 text-2xl font-bold tracking-tight text-app-text sm:text-3xl ${r}`, ...n, children: a }), Z = 240, Q = 100, oe = (e, r) => [Z / 2 + r * Math.sin(e), Z / 2 - r * Math.cos(e)], ge = (e, r, a) => {
|
|
1807
|
+
if (r - e >= Math.PI * 2 - 1e-6) {
|
|
1808
|
+
const p = e + Math.PI;
|
|
1809
|
+
return `${ge(e, p, a)} ${ge(p, e + Math.PI * 2 - 1e-4, a)}`;
|
|
1666
1810
|
}
|
|
1667
|
-
const n = r -
|
|
1668
|
-
if (!a) return `M${
|
|
1669
|
-
const [
|
|
1670
|
-
return `M${s},${l} A${
|
|
1671
|
-
},
|
|
1672
|
-
const l =
|
|
1811
|
+
const n = r - e > Math.PI ? 1 : 0, [s, l] = oe(e, Q), [o, i] = oe(r, Q);
|
|
1812
|
+
if (!a) return `M${Z / 2},${Z / 2} L${s},${l} A${Q},${Q} 0 ${n} 1 ${o},${i} Z`;
|
|
1813
|
+
const [c, u] = oe(r, a), [b, d] = oe(e, a);
|
|
1814
|
+
return `M${s},${l} A${Q},${Q} 0 ${n} 1 ${o},${i} L${c},${u} A${a},${a} 0 ${n} 0 ${b},${d} Z`;
|
|
1815
|
+
}, qr = ({ data: e, donut: r = !1, center: a, label: n = "Pie chart", className: s = "" }) => {
|
|
1816
|
+
const l = e.reduce((c, u) => c + u.value, 0);
|
|
1673
1817
|
let o = 0;
|
|
1674
|
-
const
|
|
1675
|
-
const
|
|
1676
|
-
return o +=
|
|
1818
|
+
const i = e.filter((c) => c.value > 0).map((c, u) => {
|
|
1819
|
+
const b = o;
|
|
1820
|
+
return o += c.value / l * Math.PI * 2, { ...c, start: b, end: o, color: ce(c, u) };
|
|
1677
1821
|
});
|
|
1678
|
-
return /* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1822
|
+
return /* @__PURE__ */ f("figure", { className: `m-0 ${s}`, children: [
|
|
1823
|
+
/* @__PURE__ */ f(
|
|
1680
1824
|
"svg",
|
|
1681
1825
|
{
|
|
1682
1826
|
role: "img",
|
|
1683
1827
|
"aria-label": n,
|
|
1684
|
-
viewBox: `0 0 ${
|
|
1828
|
+
viewBox: `0 0 ${Z} ${Z}`,
|
|
1685
1829
|
className: "mx-auto block h-auto w-full max-w-xs",
|
|
1686
1830
|
children: [
|
|
1687
|
-
|
|
1831
|
+
i.map((c) => /* @__PURE__ */ t(
|
|
1688
1832
|
"path",
|
|
1689
1833
|
{
|
|
1690
|
-
d:
|
|
1691
|
-
fill:
|
|
1834
|
+
d: ge(c.start, c.end, r ? Q * 0.6 : 0),
|
|
1835
|
+
fill: c.color,
|
|
1692
1836
|
stroke: "rgb(var(--color-app-card))",
|
|
1693
1837
|
strokeWidth: "2",
|
|
1694
|
-
children: /* @__PURE__ */
|
|
1838
|
+
children: /* @__PURE__ */ t("title", { children: `${c.label}: ${c.value} (${Math.round(c.value / l * 100)}%)` })
|
|
1695
1839
|
},
|
|
1696
|
-
|
|
1840
|
+
c.label
|
|
1697
1841
|
)),
|
|
1698
|
-
r && a && /* @__PURE__ */
|
|
1842
|
+
r && a && /* @__PURE__ */ t(
|
|
1699
1843
|
"text",
|
|
1700
1844
|
{
|
|
1701
|
-
x:
|
|
1702
|
-
y:
|
|
1845
|
+
x: Z / 2,
|
|
1846
|
+
y: Z / 2,
|
|
1703
1847
|
textAnchor: "middle",
|
|
1704
1848
|
dominantBaseline: "middle",
|
|
1705
1849
|
fontSize: "20",
|
|
@@ -1711,58 +1855,52 @@ const yt = (t, r, a) => {
|
|
|
1711
1855
|
]
|
|
1712
1856
|
}
|
|
1713
1857
|
),
|
|
1714
|
-
/* @__PURE__ */
|
|
1858
|
+
/* @__PURE__ */ t(ke, { items: i.map((c) => ({ name: c.label, color: c.color })) })
|
|
1715
1859
|
] });
|
|
1716
|
-
},
|
|
1717
|
-
const [
|
|
1718
|
-
return
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
var p, g;
|
|
1725
|
-
x.key === "Escape" && (c(!1), (g = (p = i.current) == null ? void 0 : p.querySelector("button")) == null || g.focus());
|
|
1726
|
-
};
|
|
1727
|
-
return document.addEventListener("mousedown", f), document.addEventListener("keydown", b), () => {
|
|
1728
|
-
document.removeEventListener("mousedown", f), document.removeEventListener("keydown", b);
|
|
1729
|
-
};
|
|
1730
|
-
}, [o]), /* @__PURE__ */ h("div", { ref: i, className: "relative inline-block", children: [
|
|
1731
|
-
/* @__PURE__ */ e(
|
|
1732
|
-
R,
|
|
1860
|
+
}, Kr = ({ trigger: e, label: r, variant: a = "secondary", align: n = "start", placement: s, className: l = "", children: o }) => {
|
|
1861
|
+
const [i, c] = D(!1), u = A(null), b = A(null), d = O();
|
|
1862
|
+
return V(i, [u, b], (p) => {
|
|
1863
|
+
var m, g;
|
|
1864
|
+
c(!1), p === "escape" && ((g = (m = u.current) == null ? void 0 : m.querySelector("button")) == null || g.focus());
|
|
1865
|
+
}), /* @__PURE__ */ f("div", { ref: u, className: "relative inline-block", children: [
|
|
1866
|
+
/* @__PURE__ */ t(
|
|
1867
|
+
H,
|
|
1733
1868
|
{
|
|
1734
1869
|
variant: a,
|
|
1735
1870
|
"aria-label": r,
|
|
1736
1871
|
"aria-haspopup": "dialog",
|
|
1737
|
-
"aria-expanded":
|
|
1738
|
-
"aria-controls":
|
|
1739
|
-
onClick: () => c((
|
|
1740
|
-
children:
|
|
1872
|
+
"aria-expanded": i,
|
|
1873
|
+
"aria-controls": i ? d : void 0,
|
|
1874
|
+
onClick: () => c((p) => !p),
|
|
1875
|
+
children: e
|
|
1741
1876
|
}
|
|
1742
1877
|
),
|
|
1743
|
-
|
|
1744
|
-
|
|
1878
|
+
/* @__PURE__ */ t(
|
|
1879
|
+
X,
|
|
1745
1880
|
{
|
|
1746
|
-
|
|
1881
|
+
open: i,
|
|
1882
|
+
anchorRef: u,
|
|
1883
|
+
panelRef: b,
|
|
1884
|
+
placement: s ?? `bottom-${n}`,
|
|
1747
1885
|
id: d,
|
|
1748
1886
|
role: "dialog",
|
|
1749
1887
|
"aria-label": r,
|
|
1750
|
-
className: `
|
|
1751
|
-
children:
|
|
1888
|
+
className: `min-w-[12rem] max-w-[calc(100vw-1rem)] border border-app-border bg-app-card p-4 text-sm text-app-text shadow-xl ${l}`,
|
|
1889
|
+
children: o
|
|
1752
1890
|
}
|
|
1753
1891
|
)
|
|
1754
1892
|
] });
|
|
1755
|
-
},
|
|
1756
|
-
const s =
|
|
1757
|
-
return /* @__PURE__ */
|
|
1758
|
-
(r || a && !s) && /* @__PURE__ */
|
|
1759
|
-
/* @__PURE__ */
|
|
1760
|
-
a && !s && /* @__PURE__ */
|
|
1893
|
+
}, _r = ({ children: e, container: r }) => ae(e, r ?? document.body), Ur = ({ value: e, label: r, showValue: a = !1, className: n = "" }) => {
|
|
1894
|
+
const s = e === void 0, l = s ? 0 : Math.min(100, Math.max(0, e));
|
|
1895
|
+
return /* @__PURE__ */ f("div", { className: `flex flex-col gap-1 ${n}`, children: [
|
|
1896
|
+
(r || a && !s) && /* @__PURE__ */ f("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1897
|
+
/* @__PURE__ */ t(U, { children: r }),
|
|
1898
|
+
a && !s && /* @__PURE__ */ f("span", { className: "text-xs font-semibold uppercase tracking-widest text-app-text", children: [
|
|
1761
1899
|
Math.round(l),
|
|
1762
1900
|
"%"
|
|
1763
1901
|
] })
|
|
1764
1902
|
] }),
|
|
1765
|
-
/* @__PURE__ */
|
|
1903
|
+
/* @__PURE__ */ t(
|
|
1766
1904
|
"div",
|
|
1767
1905
|
{
|
|
1768
1906
|
role: "progressbar",
|
|
@@ -1771,11 +1909,11 @@ const yt = (t, r, a) => {
|
|
|
1771
1909
|
"aria-valuemax": 100,
|
|
1772
1910
|
"aria-valuenow": s ? void 0 : Math.round(l),
|
|
1773
1911
|
className: "relative h-1.5 w-full overflow-hidden bg-app-border",
|
|
1774
|
-
children: s ? /* @__PURE__ */
|
|
1912
|
+
children: s ? /* @__PURE__ */ t("div", { className: "absolute inset-y-0 w-2/5 animate-indeterminate bg-app-strong" }) : /* @__PURE__ */ t("div", { className: "h-full bg-app-strong transition-all", style: { width: `${l}%` } })
|
|
1775
1913
|
}
|
|
1776
1914
|
)
|
|
1777
1915
|
] });
|
|
1778
|
-
},
|
|
1916
|
+
}, Ht = `
|
|
1779
1917
|
@keyframes rs-blink {
|
|
1780
1918
|
0%,45% { fill:rgb(var(--color-app-card)); filter:drop-shadow(0 0 0 transparent); }
|
|
1781
1919
|
50%,55% { fill:#00e676; filter:drop-shadow(0 0 6px #00e676); }
|
|
@@ -1808,25 +1946,25 @@ const yt = (t, r, a) => {
|
|
|
1808
1946
|
.rs-fan-hub { fill:rgb(var(--color-app-soft)); }
|
|
1809
1947
|
.rs-fan-ring { fill:none; stroke:rgb(var(--color-app-border)); stroke-width:1.5; }
|
|
1810
1948
|
.rs-glow { animation: rs-glow-pulse 3s infinite ease-in-out; }
|
|
1811
|
-
`,
|
|
1812
|
-
const
|
|
1813
|
-
return
|
|
1949
|
+
`, Yt = 720, Zt = 540, Gr = () => {
|
|
1950
|
+
const e = A(null), r = A(null);
|
|
1951
|
+
return P(() => {
|
|
1814
1952
|
if (!document.getElementById("rack-server-styles")) {
|
|
1815
|
-
const
|
|
1816
|
-
|
|
1953
|
+
const c = document.createElement("style");
|
|
1954
|
+
c.id = "rack-server-styles", c.textContent = Ht, document.head.appendChild(c);
|
|
1817
1955
|
}
|
|
1818
1956
|
let a = 0, n = 0, s, l = null;
|
|
1819
|
-
const o = performance.now(),
|
|
1820
|
-
var
|
|
1821
|
-
const u = l === null ? 0 : (
|
|
1822
|
-
l =
|
|
1823
|
-
const
|
|
1824
|
-
a = (a + d * d * d *
|
|
1957
|
+
const o = performance.now(), i = (c) => {
|
|
1958
|
+
var m, g;
|
|
1959
|
+
const u = l === null ? 0 : (c - l) / 1e3;
|
|
1960
|
+
l = c;
|
|
1961
|
+
const b = (c - o) / 1e3, d = Math.min(b / 3, 1), p = Math.min(b / 5, 1);
|
|
1962
|
+
a = (a + d * d * d * Yt * u) % 360, n = (n + p * p * p * Zt * u) % 360, (m = e.current) == null || m.setAttribute("transform", `rotate(${a} 222 100)`), (g = r.current) == null || g.setAttribute("transform", `rotate(${n} 222 163)`), s = requestAnimationFrame(i);
|
|
1825
1963
|
};
|
|
1826
|
-
return s = requestAnimationFrame(
|
|
1964
|
+
return s = requestAnimationFrame(i), () => {
|
|
1827
1965
|
cancelAnimationFrame(s);
|
|
1828
1966
|
};
|
|
1829
|
-
}, []), /* @__PURE__ */
|
|
1967
|
+
}, []), /* @__PURE__ */ f(
|
|
1830
1968
|
"svg",
|
|
1831
1969
|
{
|
|
1832
1970
|
width: "300",
|
|
@@ -1836,25 +1974,25 @@ const yt = (t, r, a) => {
|
|
|
1836
1974
|
"aria-hidden": "true",
|
|
1837
1975
|
focusable: "false",
|
|
1838
1976
|
children: [
|
|
1839
|
-
/* @__PURE__ */
|
|
1840
|
-
/* @__PURE__ */
|
|
1841
|
-
/* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
1843
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ f("defs", { children: [
|
|
1978
|
+
/* @__PURE__ */ f("linearGradient", { id: "rs-sg", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
1979
|
+
/* @__PURE__ */ t("stop", { offset: "0%", stopColor: "rgb(var(--color-app-strong))", stopOpacity: "0" }),
|
|
1980
|
+
/* @__PURE__ */ t("stop", { offset: "50%", stopColor: "rgb(var(--color-app-strong))", stopOpacity: "0.3" }),
|
|
1981
|
+
/* @__PURE__ */ t("stop", { offset: "100%", stopColor: "rgb(var(--color-app-strong))", stopOpacity: "0" })
|
|
1844
1982
|
] }),
|
|
1845
|
-
/* @__PURE__ */
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */
|
|
1983
|
+
/* @__PURE__ */ f("linearGradient", { id: "rs-pg", x1: "0", y1: "0", x2: "1", y2: "0", children: [
|
|
1984
|
+
/* @__PURE__ */ t("stop", { offset: "0%", stopColor: "#00e676" }),
|
|
1985
|
+
/* @__PURE__ */ t("stop", { offset: "100%", stopColor: "rgb(var(--color-app-strong))" })
|
|
1848
1986
|
] }),
|
|
1849
|
-
/* @__PURE__ */
|
|
1850
|
-
/* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
1987
|
+
/* @__PURE__ */ f("radialGradient", { id: "rs-ag", cx: "50%", cy: "50%", r: "50%", children: [
|
|
1988
|
+
/* @__PURE__ */ t("stop", { offset: "0%", stopColor: "rgb(var(--color-app-strong))", stopOpacity: "0.15" }),
|
|
1989
|
+
/* @__PURE__ */ t("stop", { offset: "100%", stopColor: "rgb(var(--color-app-strong))", stopOpacity: "0" })
|
|
1852
1990
|
] }),
|
|
1853
|
-
/* @__PURE__ */
|
|
1991
|
+
/* @__PURE__ */ t("clipPath", { id: "rs-rc", children: /* @__PURE__ */ t("rect", { x: "30", y: "55", width: "240", height: "190" }) })
|
|
1854
1992
|
] }),
|
|
1855
|
-
/* @__PURE__ */
|
|
1856
|
-
/* @__PURE__ */
|
|
1857
|
-
/* @__PURE__ */
|
|
1993
|
+
/* @__PURE__ */ t("ellipse", { cx: "150", cy: "150", rx: "130", ry: "110", fill: "url(#rs-ag)", className: "rs-glow" }),
|
|
1994
|
+
/* @__PURE__ */ t("rect", { x: "30", y: "50", width: "240", height: "190", className: "rs-chassis" }),
|
|
1995
|
+
/* @__PURE__ */ t(
|
|
1858
1996
|
"circle",
|
|
1859
1997
|
{
|
|
1860
1998
|
cx: "40",
|
|
@@ -1865,7 +2003,7 @@ const yt = (t, r, a) => {
|
|
|
1865
2003
|
strokeWidth: "1"
|
|
1866
2004
|
}
|
|
1867
2005
|
),
|
|
1868
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ t(
|
|
1869
2007
|
"circle",
|
|
1870
2008
|
{
|
|
1871
2009
|
cx: "260",
|
|
@@ -1876,7 +2014,7 @@ const yt = (t, r, a) => {
|
|
|
1876
2014
|
strokeWidth: "1"
|
|
1877
2015
|
}
|
|
1878
2016
|
),
|
|
1879
|
-
/* @__PURE__ */
|
|
2017
|
+
/* @__PURE__ */ t(
|
|
1880
2018
|
"circle",
|
|
1881
2019
|
{
|
|
1882
2020
|
cx: "40",
|
|
@@ -1887,7 +2025,7 @@ const yt = (t, r, a) => {
|
|
|
1887
2025
|
strokeWidth: "1"
|
|
1888
2026
|
}
|
|
1889
2027
|
),
|
|
1890
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ t(
|
|
1891
2029
|
"circle",
|
|
1892
2030
|
{
|
|
1893
2031
|
cx: "260",
|
|
@@ -1898,50 +2036,50 @@ const yt = (t, r, a) => {
|
|
|
1898
2036
|
strokeWidth: "1"
|
|
1899
2037
|
}
|
|
1900
2038
|
),
|
|
1901
|
-
/* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
/* @__PURE__ */
|
|
1904
|
-
/* @__PURE__ */
|
|
1905
|
-
/* @__PURE__ */
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
/* @__PURE__ */
|
|
1908
|
-
/* @__PURE__ */
|
|
1909
|
-
/* @__PURE__ */
|
|
1910
|
-
/* @__PURE__ */
|
|
1911
|
-
/* @__PURE__ */
|
|
1912
|
-
/* @__PURE__ */
|
|
1913
|
-
/* @__PURE__ */
|
|
1914
|
-
/* @__PURE__ */
|
|
2039
|
+
/* @__PURE__ */ t("rect", { x: "42", y: "72", width: "216", height: "56", className: "rs-rack" }),
|
|
2040
|
+
/* @__PURE__ */ t("rect", { x: "52", y: "79", width: "130", height: "8", className: "rs-slotline" }),
|
|
2041
|
+
/* @__PURE__ */ t("rect", { x: "52", y: "91", width: "130", height: "8", className: "rs-slotline" }),
|
|
2042
|
+
/* @__PURE__ */ t("rect", { x: "52", y: "103", width: "130", height: "8", className: "rs-slotline" }),
|
|
2043
|
+
/* @__PURE__ */ t("rect", { x: "52", y: "115", width: "80", height: "8", className: "rs-slotline" }),
|
|
2044
|
+
/* @__PURE__ */ t("circle", { cx: "60", cy: "83", r: "2.5", className: "rs-led-g rs-lg1" }),
|
|
2045
|
+
/* @__PURE__ */ t("circle", { cx: "60", cy: "95", r: "2.5", className: "rs-led-g rs-lg2" }),
|
|
2046
|
+
/* @__PURE__ */ t("circle", { cx: "60", cy: "107", r: "2.5", className: "rs-led-b rs-lb1" }),
|
|
2047
|
+
/* @__PURE__ */ t("circle", { cx: "60", cy: "119", r: "2.5", className: "rs-led-g rs-lg3" }),
|
|
2048
|
+
/* @__PURE__ */ t("circle", { cx: "222", cy: "100", r: "20", fill: "rgb(var(--color-app-bg))" }),
|
|
2049
|
+
/* @__PURE__ */ f("g", { ref: e, children: [
|
|
2050
|
+
/* @__PURE__ */ t("path", { d: "M222 80 Q230 100 222 120 Q214 100 222 80", className: "rs-fan-blade" }),
|
|
2051
|
+
/* @__PURE__ */ t("path", { d: "M202 100 Q222 108 242 100 Q222 92 202 100", className: "rs-fan-blade" }),
|
|
2052
|
+
/* @__PURE__ */ t("circle", { cx: "222", cy: "100", r: "2.5", className: "rs-fan-hub" })
|
|
1915
2053
|
] }),
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
/* @__PURE__ */
|
|
1918
|
-
/* @__PURE__ */
|
|
1919
|
-
/* @__PURE__ */
|
|
1920
|
-
/* @__PURE__ */
|
|
1921
|
-
/* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
/* @__PURE__ */
|
|
1924
|
-
/* @__PURE__ */
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
/* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
1928
|
-
/* @__PURE__ */
|
|
1929
|
-
/* @__PURE__ */
|
|
1930
|
-
/* @__PURE__ */
|
|
2054
|
+
/* @__PURE__ */ t("circle", { cx: "222", cy: "100", r: "20", className: "rs-fan-ring" }),
|
|
2055
|
+
/* @__PURE__ */ t("rect", { x: "42", y: "136", width: "216", height: "56", className: "rs-rack" }),
|
|
2056
|
+
/* @__PURE__ */ t("rect", { x: "52", y: "143", width: "130", height: "8", className: "rs-slotline" }),
|
|
2057
|
+
/* @__PURE__ */ t("rect", { x: "52", y: "155", width: "130", height: "8", className: "rs-slotline" }),
|
|
2058
|
+
/* @__PURE__ */ t("rect", { x: "52", y: "167", width: "130", height: "8", className: "rs-slotline" }),
|
|
2059
|
+
/* @__PURE__ */ t("rect", { x: "52", y: "179", width: "80", height: "8", className: "rs-slotline" }),
|
|
2060
|
+
/* @__PURE__ */ t("circle", { cx: "60", cy: "147", r: "2.5", className: "rs-led-g rs-lg2" }),
|
|
2061
|
+
/* @__PURE__ */ t("circle", { cx: "60", cy: "159", r: "2.5", className: "rs-led-b rs-lb2" }),
|
|
2062
|
+
/* @__PURE__ */ t("circle", { cx: "60", cy: "171", r: "2.5", className: "rs-led-g rs-lg4" }),
|
|
2063
|
+
/* @__PURE__ */ t("circle", { cx: "60", cy: "183", r: "2.5", className: "rs-led-g rs-lg1" }),
|
|
2064
|
+
/* @__PURE__ */ t("circle", { cx: "222", cy: "163", r: "20", fill: "rgb(var(--color-app-bg))" }),
|
|
2065
|
+
/* @__PURE__ */ f("g", { ref: r, children: [
|
|
2066
|
+
/* @__PURE__ */ t("path", { d: "M222 143 Q230 163 222 183 Q214 163 222 143", className: "rs-fan-blade" }),
|
|
2067
|
+
/* @__PURE__ */ t("path", { d: "M202 163 Q222 171 242 163 Q222 155 202 163", className: "rs-fan-blade" }),
|
|
2068
|
+
/* @__PURE__ */ t("circle", { cx: "222", cy: "163", r: "2.5", className: "rs-fan-hub" })
|
|
1931
2069
|
] }),
|
|
1932
|
-
/* @__PURE__ */
|
|
2070
|
+
/* @__PURE__ */ t("circle", { cx: "222", cy: "163", r: "20", className: "rs-fan-ring" })
|
|
1933
2071
|
]
|
|
1934
2072
|
}
|
|
1935
2073
|
);
|
|
1936
|
-
},
|
|
1937
|
-
const s =
|
|
1938
|
-
return /* @__PURE__ */
|
|
2074
|
+
}, Qt = ({ label: e, className: r = "", disabled: a = !1, ...n }) => {
|
|
2075
|
+
const s = O();
|
|
2076
|
+
return /* @__PURE__ */ f(
|
|
1939
2077
|
"label",
|
|
1940
2078
|
{
|
|
1941
2079
|
htmlFor: s,
|
|
1942
|
-
className: `inline-flex items-center gap-2 text-sm text-app-text ${a ? "cursor-not-allowed opacity-50" : "cursor-pointer"} ${r}`,
|
|
2080
|
+
className: `inline-flex min-h-8 items-center gap-2 text-sm text-app-text ${a ? "cursor-not-allowed opacity-50" : "cursor-pointer"} ${r}`,
|
|
1943
2081
|
children: [
|
|
1944
|
-
/* @__PURE__ */
|
|
2082
|
+
/* @__PURE__ */ t(
|
|
1945
2083
|
"input",
|
|
1946
2084
|
{
|
|
1947
2085
|
id: s,
|
|
@@ -1951,130 +2089,248 @@ const yt = (t, r, a) => {
|
|
|
1951
2089
|
...n
|
|
1952
2090
|
}
|
|
1953
2091
|
),
|
|
1954
|
-
|
|
2092
|
+
e
|
|
1955
2093
|
]
|
|
1956
2094
|
}
|
|
1957
2095
|
);
|
|
1958
|
-
},
|
|
1959
|
-
const o =
|
|
1960
|
-
return /* @__PURE__ */
|
|
1961
|
-
|
|
1962
|
-
/* @__PURE__ */
|
|
1963
|
-
|
|
2096
|
+
}, Hr = ({ label: e, name: r, value: a, onChange: n, options: s, direction: l = "column" }) => {
|
|
2097
|
+
const o = O();
|
|
2098
|
+
return /* @__PURE__ */ f("fieldset", { className: "flex flex-col gap-2 border-0 p-0", children: [
|
|
2099
|
+
e && /* @__PURE__ */ t(U, { as: "legend", className: "mb-1", children: e }),
|
|
2100
|
+
/* @__PURE__ */ t("div", { className: `flex gap-3 ${l === "row" ? "flex-row flex-wrap" : "flex-col"}`, children: s.map((i) => /* @__PURE__ */ t(
|
|
2101
|
+
Qt,
|
|
1964
2102
|
{
|
|
1965
2103
|
name: r ?? o,
|
|
1966
|
-
value:
|
|
1967
|
-
label:
|
|
1968
|
-
disabled:
|
|
1969
|
-
checked: a ===
|
|
1970
|
-
onChange: () => n == null ? void 0 : n(
|
|
2104
|
+
value: i.value,
|
|
2105
|
+
label: i.label,
|
|
2106
|
+
disabled: i.disabled,
|
|
2107
|
+
checked: a === i.value,
|
|
2108
|
+
onChange: () => n == null ? void 0 : n(i.value)
|
|
1971
2109
|
},
|
|
1972
|
-
|
|
2110
|
+
i.value
|
|
1973
2111
|
)) })
|
|
1974
2112
|
] });
|
|
1975
|
-
},
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
2113
|
+
}, Vt = ({ open: e }) => /* @__PURE__ */ t(
|
|
2114
|
+
"svg",
|
|
2115
|
+
{
|
|
2116
|
+
"aria-hidden": "true",
|
|
2117
|
+
focusable: "false",
|
|
2118
|
+
viewBox: "0 0 24 24",
|
|
2119
|
+
fill: "none",
|
|
2120
|
+
stroke: "currentColor",
|
|
2121
|
+
strokeWidth: "2",
|
|
2122
|
+
className: `h-4 w-4 shrink-0 text-app-muted transition-transform ${e ? "rotate-180" : ""}`,
|
|
2123
|
+
children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 9l6 6 6-6" })
|
|
2124
|
+
}
|
|
2125
|
+
), Xt = () => /* @__PURE__ */ t(
|
|
2126
|
+
"svg",
|
|
2127
|
+
{
|
|
2128
|
+
"aria-hidden": "true",
|
|
2129
|
+
focusable: "false",
|
|
2130
|
+
viewBox: "0 0 24 24",
|
|
2131
|
+
fill: "none",
|
|
2132
|
+
stroke: "currentColor",
|
|
2133
|
+
strokeWidth: "2.5",
|
|
2134
|
+
className: "h-4 w-4 shrink-0",
|
|
2135
|
+
children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
2136
|
+
}
|
|
2137
|
+
), Yr = ({
|
|
2138
|
+
label: e,
|
|
2139
|
+
value: r,
|
|
2140
|
+
onChange: a,
|
|
2141
|
+
options: n,
|
|
2142
|
+
placeholder: s,
|
|
2143
|
+
error: l,
|
|
2144
|
+
disabled: o = !1,
|
|
2145
|
+
name: i,
|
|
2146
|
+
className: c = "",
|
|
2147
|
+
...u
|
|
2148
|
+
}) => {
|
|
2149
|
+
const b = O(), d = `${b}-label`, p = `${b}-list`, m = `${b}-error`, g = A(null), h = A(null), x = A(null), v = A({ text: "", timer: null }), [N, M] = D(!1), [y, w] = D(-1), C = n.findIndex((k) => k.value === r), T = n[C], L = n.map((k, $) => k.disabled ? -1 : $).filter((k) => k >= 0);
|
|
2150
|
+
V(N, [g, x], (k) => {
|
|
2151
|
+
var $;
|
|
2152
|
+
M(!1), k === "escape" && (($ = h.current) == null || $.focus());
|
|
2153
|
+
}), P(() => {
|
|
2154
|
+
var k, $, R;
|
|
2155
|
+
N && ((R = ($ = (k = x.current) == null ? void 0 : k.querySelector('[data-active="true"]')) == null ? void 0 : $.scrollIntoView) == null || R.call($, { block: "nearest" }));
|
|
2156
|
+
}, [N, y]);
|
|
2157
|
+
const I = () => {
|
|
2158
|
+
o || (w(C >= 0 && !n[C].disabled ? C : L[0] ?? -1), M(!0));
|
|
2159
|
+
}, j = (k) => {
|
|
2160
|
+
var R;
|
|
2161
|
+
const $ = n[k];
|
|
2162
|
+
!$ || $.disabled || (a == null || a($.value), M(!1), (R = h.current) == null || R.focus());
|
|
2163
|
+
}, B = (k) => {
|
|
2164
|
+
if (!L.length) return;
|
|
2165
|
+
const $ = L.indexOf(y), R = L[Math.min(Math.max($ + k, 0), L.length - 1)];
|
|
2166
|
+
w(R);
|
|
2167
|
+
}, z = (k) => {
|
|
2168
|
+
const $ = v.current;
|
|
2169
|
+
clearTimeout($.timer), $.text += k.toLowerCase(), $.timer = setTimeout(() => $.text = "", 600);
|
|
2170
|
+
const R = L.indexOf(y), E = [...L.slice(R + 1), ...L.slice(0, R + 1)].find((S) => String(n[S].label).toLowerCase().startsWith($.text));
|
|
2171
|
+
E !== void 0 && (N ? w(E) : a == null || a(n[E].value));
|
|
2172
|
+
}, q = (k) => {
|
|
2173
|
+
if (o) return;
|
|
2174
|
+
const { key: $ } = k;
|
|
2175
|
+
if (!N) {
|
|
2176
|
+
["ArrowDown", "ArrowUp", "Enter", " "].includes($) ? (k.preventDefault(), I()) : $.length === 1 && !k.ctrlKey && !k.metaKey && !k.altKey && z($);
|
|
2177
|
+
return;
|
|
2178
|
+
}
|
|
2179
|
+
if ($ === "ArrowDown") B(1);
|
|
2180
|
+
else if ($ === "ArrowUp") B(-1);
|
|
2181
|
+
else if ($ === "Home") w(L[0] ?? -1);
|
|
2182
|
+
else if ($ === "End") w(L[L.length - 1] ?? -1);
|
|
2183
|
+
else if ($ === "Enter" || $ === " ") j(y);
|
|
2184
|
+
else if ($ === "Tab") M(!1);
|
|
2185
|
+
else if ($.length === 1 && !k.ctrlKey && !k.metaKey && !k.altKey) z($);
|
|
2186
|
+
else return;
|
|
2187
|
+
$ !== "Tab" && k.preventDefault();
|
|
2188
|
+
};
|
|
2189
|
+
return /* @__PURE__ */ f("div", { ref: g, className: "relative flex flex-col gap-1", children: [
|
|
2190
|
+
e && /* @__PURE__ */ t(U, { id: d, htmlFor: b, children: e }),
|
|
2191
|
+
/* @__PURE__ */ f(
|
|
2192
|
+
"button",
|
|
1981
2193
|
{
|
|
1982
|
-
|
|
2194
|
+
ref: h,
|
|
2195
|
+
id: b,
|
|
2196
|
+
type: "button",
|
|
2197
|
+
role: "combobox",
|
|
2198
|
+
disabled: o,
|
|
2199
|
+
"aria-haspopup": "listbox",
|
|
2200
|
+
"aria-expanded": N,
|
|
2201
|
+
"aria-controls": N ? p : void 0,
|
|
2202
|
+
"aria-activedescendant": N && y >= 0 ? `${b}-opt-${y}` : void 0,
|
|
2203
|
+
"aria-labelledby": e ? `${d} ${b}` : void 0,
|
|
1983
2204
|
"aria-invalid": !!l,
|
|
1984
|
-
"aria-describedby": l ?
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
...
|
|
2205
|
+
"aria-describedby": l ? m : void 0,
|
|
2206
|
+
onClick: () => N ? M(!1) : I(),
|
|
2207
|
+
onKeyDown: q,
|
|
2208
|
+
className: `${se(!!l)} flex items-center justify-between gap-2 text-left ${c}`,
|
|
2209
|
+
...u,
|
|
1989
2210
|
children: [
|
|
1990
|
-
|
|
1991
|
-
|
|
2211
|
+
/* @__PURE__ */ t("span", { className: `min-w-0 flex-1 truncate ${T ? "" : "text-app-muted"}`, children: T ? T.label : s ?? " " }),
|
|
2212
|
+
/* @__PURE__ */ t(Vt, { open: N })
|
|
1992
2213
|
]
|
|
1993
2214
|
}
|
|
1994
2215
|
),
|
|
1995
|
-
|
|
2216
|
+
i && /* @__PURE__ */ t("input", { type: "hidden", name: i, value: r ?? "" }),
|
|
2217
|
+
/* @__PURE__ */ t(
|
|
2218
|
+
X,
|
|
2219
|
+
{
|
|
2220
|
+
open: N,
|
|
2221
|
+
anchorRef: h,
|
|
2222
|
+
panelRef: x,
|
|
2223
|
+
placement: "bottom-start",
|
|
2224
|
+
matchWidth: !0,
|
|
2225
|
+
gap: 2,
|
|
2226
|
+
className: "max-h-60 max-w-[calc(100vw-1rem)] overflow-y-auto border border-app-border bg-app-card shadow-xl",
|
|
2227
|
+
children: /* @__PURE__ */ t("ul", { id: p, role: "listbox", "aria-labelledby": e ? d : void 0, className: "m-0 list-none p-0", children: n.map((k, $) => {
|
|
2228
|
+
const R = $ === C, F = $ === y;
|
|
2229
|
+
return /* @__PURE__ */ f(
|
|
2230
|
+
"li",
|
|
2231
|
+
{
|
|
2232
|
+
id: `${b}-opt-${$}`,
|
|
2233
|
+
role: "option",
|
|
2234
|
+
"aria-selected": R,
|
|
2235
|
+
"aria-disabled": k.disabled || void 0,
|
|
2236
|
+
"data-active": F,
|
|
2237
|
+
onMouseDown: (E) => E.preventDefault(),
|
|
2238
|
+
onMouseMove: () => !k.disabled && w($),
|
|
2239
|
+
onClick: () => j($),
|
|
2240
|
+
className: `flex items-center justify-between gap-2 px-3 py-2 text-sm ${k.disabled ? "cursor-not-allowed text-app-muted opacity-50" : F ? "cursor-pointer bg-app-strong text-app-bg" : "cursor-pointer text-app-text"} ${R ? "font-semibold" : ""}`,
|
|
2241
|
+
children: [
|
|
2242
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 truncate", children: k.label }),
|
|
2243
|
+
R && /* @__PURE__ */ t(Xt, {})
|
|
2244
|
+
]
|
|
2245
|
+
},
|
|
2246
|
+
k.value
|
|
2247
|
+
);
|
|
2248
|
+
}) })
|
|
2249
|
+
}
|
|
2250
|
+
),
|
|
2251
|
+
l && /* @__PURE__ */ t("span", { id: m, className: "text-xs text-red-700 dark:text-red-400", children: l })
|
|
1996
2252
|
] });
|
|
1997
|
-
},
|
|
1998
|
-
items:
|
|
2253
|
+
}, Zr = ({
|
|
2254
|
+
items: e,
|
|
1999
2255
|
activeKey: r,
|
|
2000
2256
|
onSelect: a,
|
|
2001
2257
|
header: n,
|
|
2002
2258
|
footer: s,
|
|
2003
2259
|
collapsed: l = !1,
|
|
2004
2260
|
linkComponent: o = "a",
|
|
2005
|
-
linkProp:
|
|
2006
|
-
label:
|
|
2261
|
+
linkProp: i = "href",
|
|
2262
|
+
label: c = "Sidebar",
|
|
2007
2263
|
className: u = ""
|
|
2008
2264
|
}) => {
|
|
2009
|
-
const
|
|
2010
|
-
var
|
|
2011
|
-
const
|
|
2012
|
-
d.icon && /* @__PURE__ */
|
|
2013
|
-
!l && /* @__PURE__ */
|
|
2014
|
-
!l && d.badge != null && /* @__PURE__ */
|
|
2015
|
-
] }),
|
|
2016
|
-
var
|
|
2017
|
-
(
|
|
2018
|
-
},
|
|
2019
|
-
return /* @__PURE__ */
|
|
2020
|
-
d.href && !
|
|
2265
|
+
const b = (d, p = 0) => {
|
|
2266
|
+
var M;
|
|
2267
|
+
const m = d.key === r, g = /* @__PURE__ */ f(re, { children: [
|
|
2268
|
+
d.icon && /* @__PURE__ */ t("span", { className: "shrink-0 [&>svg]:h-4 [&>svg]:w-4", children: d.icon }),
|
|
2269
|
+
!l && /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-left", children: d.label }),
|
|
2270
|
+
!l && d.badge != null && /* @__PURE__ */ t("span", { className: "bg-app-strong px-1.5 text-[10px] font-semibold text-app-bg", children: d.badge })
|
|
2271
|
+
] }), h = `flex w-full items-center gap-3 py-2 text-xs font-semibold uppercase tracking-widest transition ${m ? "bg-app-strong text-app-bg" : "text-app-muted hover:bg-app-bg hover:text-app-text"} ${l ? "justify-center px-2" : "pr-3"}`, x = l ? void 0 : { paddingLeft: `${0.75 + p * 1}rem` }, v = () => {
|
|
2272
|
+
var y;
|
|
2273
|
+
(y = d.onClick) == null || y.call(d), a == null || a(d.key);
|
|
2274
|
+
}, N = !!((M = d.children) != null && M.length);
|
|
2275
|
+
return /* @__PURE__ */ f("li", { children: [
|
|
2276
|
+
d.href && !N ? /* @__PURE__ */ t(
|
|
2021
2277
|
o,
|
|
2022
2278
|
{
|
|
2023
|
-
[
|
|
2024
|
-
"aria-current":
|
|
2279
|
+
[i]: d.href,
|
|
2280
|
+
"aria-current": m ? "page" : void 0,
|
|
2025
2281
|
"aria-label": l ? d.label : void 0,
|
|
2026
2282
|
title: l ? d.label : void 0,
|
|
2027
|
-
onClick:
|
|
2028
|
-
className:
|
|
2029
|
-
style:
|
|
2030
|
-
children:
|
|
2283
|
+
onClick: v,
|
|
2284
|
+
className: h,
|
|
2285
|
+
style: x,
|
|
2286
|
+
children: g
|
|
2031
2287
|
}
|
|
2032
|
-
) : /* @__PURE__ */
|
|
2288
|
+
) : /* @__PURE__ */ t(
|
|
2033
2289
|
"button",
|
|
2034
2290
|
{
|
|
2035
2291
|
type: "button",
|
|
2036
|
-
"aria-current":
|
|
2292
|
+
"aria-current": m ? "page" : void 0,
|
|
2037
2293
|
"aria-label": l ? d.label : void 0,
|
|
2038
2294
|
title: l ? d.label : void 0,
|
|
2039
|
-
onClick:
|
|
2040
|
-
className:
|
|
2041
|
-
style:
|
|
2042
|
-
children:
|
|
2295
|
+
onClick: v,
|
|
2296
|
+
className: h,
|
|
2297
|
+
style: x,
|
|
2298
|
+
children: g
|
|
2043
2299
|
}
|
|
2044
2300
|
),
|
|
2045
|
-
|
|
2301
|
+
N && !l && /* @__PURE__ */ t("ul", { className: "m-0 list-none p-0", children: d.children.map((y) => b(y, p + 1)) })
|
|
2046
2302
|
] }, d.key);
|
|
2047
2303
|
};
|
|
2048
|
-
return /* @__PURE__ */
|
|
2304
|
+
return /* @__PURE__ */ f(
|
|
2049
2305
|
"nav",
|
|
2050
2306
|
{
|
|
2051
|
-
"aria-label":
|
|
2307
|
+
"aria-label": c,
|
|
2052
2308
|
className: `flex h-full flex-col border-r border-app-border bg-app-card ${l ? "w-14" : "w-60"} ${u}`,
|
|
2053
2309
|
children: [
|
|
2054
|
-
n && /* @__PURE__ */
|
|
2055
|
-
/* @__PURE__ */
|
|
2056
|
-
s && /* @__PURE__ */
|
|
2310
|
+
n && /* @__PURE__ */ t("div", { className: "shrink-0 border-b border-app-border px-3 py-3", children: n }),
|
|
2311
|
+
/* @__PURE__ */ t("ul", { className: "m-0 flex-1 list-none overflow-y-auto p-0 py-2", children: e.map((d) => b(d)) }),
|
|
2312
|
+
s && /* @__PURE__ */ t("div", { className: "shrink-0 border-t border-app-border px-3 py-3", children: s })
|
|
2057
2313
|
]
|
|
2058
2314
|
}
|
|
2059
2315
|
);
|
|
2060
|
-
},
|
|
2061
|
-
label:
|
|
2316
|
+
}, Qr = ({ lines: e, circle: r = !1, className: a = "h-4 w-full" }) => e ? /* @__PURE__ */ t("div", { "aria-hidden": "true", className: "flex flex-col gap-2", children: Array.from({ length: e }, (n, s) => /* @__PURE__ */ t("div", { className: `h-3 animate-pulse bg-app-border ${s === e - 1 ? "w-2/3" : "w-full"}` }, s)) }) : /* @__PURE__ */ t("div", { "aria-hidden": "true", className: `animate-pulse bg-app-border ${r ? "rounded-full" : ""} ${a}` }), Vr = ({
|
|
2317
|
+
label: e,
|
|
2062
2318
|
value: r,
|
|
2063
2319
|
onChange: a,
|
|
2064
2320
|
min: n = 0,
|
|
2065
2321
|
max: s = 100,
|
|
2066
2322
|
step: l = 1,
|
|
2067
2323
|
showValue: o = !0,
|
|
2068
|
-
className:
|
|
2069
|
-
...
|
|
2324
|
+
className: i = "",
|
|
2325
|
+
...c
|
|
2070
2326
|
}) => {
|
|
2071
|
-
const u =
|
|
2072
|
-
return /* @__PURE__ */
|
|
2073
|
-
(
|
|
2074
|
-
/* @__PURE__ */
|
|
2075
|
-
o && /* @__PURE__ */
|
|
2327
|
+
const u = O(), b = s - n, d = b > 0 ? Math.min(100, Math.max(0, (r - n) / b * 100)) : 0;
|
|
2328
|
+
return /* @__PURE__ */ f("div", { className: `flex flex-col gap-1 ${i}`, children: [
|
|
2329
|
+
(e || o) && /* @__PURE__ */ f("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2330
|
+
e ? /* @__PURE__ */ t(U, { htmlFor: u, children: e }) : /* @__PURE__ */ t("span", {}),
|
|
2331
|
+
o && /* @__PURE__ */ t("span", { className: "text-xs font-semibold uppercase tracking-widest text-app-text", children: r })
|
|
2076
2332
|
] }),
|
|
2077
|
-
/* @__PURE__ */
|
|
2333
|
+
/* @__PURE__ */ t(
|
|
2078
2334
|
"input",
|
|
2079
2335
|
{
|
|
2080
2336
|
id: u,
|
|
@@ -2083,92 +2339,93 @@ const yt = (t, r, a) => {
|
|
|
2083
2339
|
max: s,
|
|
2084
2340
|
step: l,
|
|
2085
2341
|
value: r,
|
|
2086
|
-
onChange: (
|
|
2087
|
-
|
|
2088
|
-
|
|
2342
|
+
onChange: (p) => a == null ? void 0 : a(Number(p.target.value)),
|
|
2343
|
+
style: { "--xd-fill": `${d}%` },
|
|
2344
|
+
className: "xd-slider w-full",
|
|
2345
|
+
...c
|
|
2089
2346
|
}
|
|
2090
2347
|
)
|
|
2091
2348
|
] });
|
|
2092
|
-
},
|
|
2093
|
-
const n = [...
|
|
2349
|
+
}, Jt = (e, r, a) => {
|
|
2350
|
+
const n = [...e], [s] = n.splice(r, 1);
|
|
2094
2351
|
return n.splice(a, 0, s), n;
|
|
2095
|
-
},
|
|
2096
|
-
const [l, o] =
|
|
2097
|
-
|
|
2352
|
+
}, Xr = ({ items: e, onChange: r, renderItem: a, label: n = "Sortable list", className: s = "" }) => {
|
|
2353
|
+
const [l, o] = D(null), [i, c] = D(null), [u, b] = D(""), d = (p, m) => {
|
|
2354
|
+
p === m || m < 0 || m >= e.length || r(Jt(e, p, m));
|
|
2098
2355
|
};
|
|
2099
|
-
return /* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
2356
|
+
return /* @__PURE__ */ f(re, { children: [
|
|
2357
|
+
/* @__PURE__ */ t("ul", { "aria-label": n, className: `m-0 list-none border border-app-border bg-app-card p-0 ${s}`, children: e.map((p, m) => /* @__PURE__ */ f(
|
|
2101
2358
|
"li",
|
|
2102
2359
|
{
|
|
2103
2360
|
draggable: !0,
|
|
2104
|
-
onDragStart: (
|
|
2105
|
-
o(
|
|
2361
|
+
onDragStart: (g) => {
|
|
2362
|
+
o(p.key), g.dataTransfer.effectAllowed = "move", g.dataTransfer.setData("text/plain", String(p.key));
|
|
2106
2363
|
},
|
|
2107
|
-
onDragOver: (
|
|
2108
|
-
|
|
2364
|
+
onDragOver: (g) => {
|
|
2365
|
+
g.preventDefault(), p.key !== i && c(p.key);
|
|
2109
2366
|
},
|
|
2110
|
-
onDrop: (
|
|
2111
|
-
|
|
2112
|
-
const
|
|
2113
|
-
d(
|
|
2367
|
+
onDrop: (g) => {
|
|
2368
|
+
g.preventDefault();
|
|
2369
|
+
const h = e.findIndex((x) => x.key === l);
|
|
2370
|
+
d(h, m), o(null), c(null);
|
|
2114
2371
|
},
|
|
2115
2372
|
onDragEnd: () => {
|
|
2116
|
-
o(null),
|
|
2373
|
+
o(null), c(null);
|
|
2117
2374
|
},
|
|
2118
|
-
className: `flex items-center gap-3 border-b border-app-border px-3 py-2.5 last:border-b-0 ${l ===
|
|
2375
|
+
className: `flex items-center gap-3 border-b border-app-border px-3 py-2.5 last:border-b-0 ${l === p.key ? "opacity-40" : ""} ${i === p.key && l !== p.key ? "bg-app-soft/20" : ""}`,
|
|
2119
2376
|
children: [
|
|
2120
|
-
/* @__PURE__ */
|
|
2377
|
+
/* @__PURE__ */ t(
|
|
2121
2378
|
"button",
|
|
2122
2379
|
{
|
|
2123
2380
|
type: "button",
|
|
2124
|
-
"aria-label": `Reorder ${
|
|
2125
|
-
onKeyDown: (
|
|
2126
|
-
const
|
|
2127
|
-
if (
|
|
2128
|
-
|
|
2129
|
-
const
|
|
2130
|
-
d(
|
|
2381
|
+
"aria-label": `Reorder ${p.label ?? p.key}. Use up and down arrow keys.`,
|
|
2382
|
+
onKeyDown: (g) => {
|
|
2383
|
+
const h = g.key === "ArrowUp" ? m - 1 : g.key === "ArrowDown" ? m + 1 : null;
|
|
2384
|
+
if (h === null || h < 0 || h >= e.length) return;
|
|
2385
|
+
g.preventDefault();
|
|
2386
|
+
const x = g.currentTarget;
|
|
2387
|
+
d(m, h), b(`${p.label ?? p.key} moved to position ${h + 1} of ${e.length}`), requestAnimationFrame(() => x.focus());
|
|
2131
2388
|
},
|
|
2132
|
-
className: "cursor-grab select-none px-
|
|
2133
|
-
children: /* @__PURE__ */
|
|
2389
|
+
className: "-my-2 cursor-grab select-none px-2 py-2 text-app-muted transition hover:text-app-text active:cursor-grabbing",
|
|
2390
|
+
children: /* @__PURE__ */ t("span", { "aria-hidden": "true", children: "⋮⋮" })
|
|
2134
2391
|
}
|
|
2135
2392
|
),
|
|
2136
|
-
/* @__PURE__ */
|
|
2393
|
+
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1 text-sm text-app-text", children: a(p, m) })
|
|
2137
2394
|
]
|
|
2138
2395
|
},
|
|
2139
|
-
|
|
2396
|
+
p.key
|
|
2140
2397
|
)) }),
|
|
2141
|
-
/* @__PURE__ */
|
|
2398
|
+
/* @__PURE__ */ t("div", { role: "status", "aria-live": "polite", className: "sr-only", children: u })
|
|
2142
2399
|
] });
|
|
2143
|
-
},
|
|
2400
|
+
}, Jr = ({ direction: e = "column", gap: r = 4, ...a }) => /* @__PURE__ */ t(Kt, { direction: e, gap: r, ...a }), er = ({ className: e }) => /* @__PURE__ */ t(
|
|
2144
2401
|
"svg",
|
|
2145
2402
|
{
|
|
2146
2403
|
"aria-hidden": "true",
|
|
2147
2404
|
focusable: "false",
|
|
2148
|
-
className:
|
|
2405
|
+
className: e ?? "w-4 h-4 flex-shrink-0 text-emerald-600 dark:text-emerald-400",
|
|
2149
2406
|
viewBox: "0 0 24 24",
|
|
2150
2407
|
fill: "none",
|
|
2151
2408
|
stroke: "currentColor",
|
|
2152
2409
|
strokeWidth: "2.5",
|
|
2153
|
-
children: /* @__PURE__ */
|
|
2410
|
+
children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
2154
2411
|
}
|
|
2155
|
-
),
|
|
2412
|
+
), ea = ({ steps: e, current: r = 0, className: a = "" }) => /* @__PURE__ */ t("ol", { className: `m-0 flex list-none flex-col gap-4 p-0 sm:flex-row sm:gap-0 ${a}`, children: e.map((n, s) => {
|
|
2156
2413
|
const l = s < r, o = s === r;
|
|
2157
|
-
return /* @__PURE__ */
|
|
2414
|
+
return /* @__PURE__ */ f(
|
|
2158
2415
|
"li",
|
|
2159
2416
|
{
|
|
2160
2417
|
"aria-current": o ? "step" : void 0,
|
|
2161
2418
|
className: "flex flex-1 items-start gap-3 sm:flex-col sm:gap-2",
|
|
2162
2419
|
children: [
|
|
2163
|
-
/* @__PURE__ */
|
|
2164
|
-
/* @__PURE__ */
|
|
2420
|
+
/* @__PURE__ */ f("div", { className: "flex items-center sm:w-full", children: [
|
|
2421
|
+
/* @__PURE__ */ t(
|
|
2165
2422
|
"span",
|
|
2166
2423
|
{
|
|
2167
2424
|
className: `flex h-7 w-7 shrink-0 items-center justify-center border text-xs font-semibold ${l ? "border-app-strong bg-app-strong text-app-bg" : o ? "border-app-strong text-app-text" : "border-app-border text-app-muted"}`,
|
|
2168
|
-
children: l ? /* @__PURE__ */
|
|
2425
|
+
children: l ? /* @__PURE__ */ t(er, { className: "h-4 w-4" }) : s + 1
|
|
2169
2426
|
}
|
|
2170
2427
|
),
|
|
2171
|
-
s <
|
|
2428
|
+
s < e.length - 1 && /* @__PURE__ */ t(
|
|
2172
2429
|
"span",
|
|
2173
2430
|
{
|
|
2174
2431
|
"aria-hidden": "true",
|
|
@@ -2176,40 +2433,40 @@ const yt = (t, r, a) => {
|
|
|
2176
2433
|
}
|
|
2177
2434
|
)
|
|
2178
2435
|
] }),
|
|
2179
|
-
/* @__PURE__ */
|
|
2180
|
-
/* @__PURE__ */
|
|
2436
|
+
/* @__PURE__ */ f("div", { className: "pr-2", children: [
|
|
2437
|
+
/* @__PURE__ */ t(
|
|
2181
2438
|
"div",
|
|
2182
2439
|
{
|
|
2183
2440
|
className: `text-xs font-semibold uppercase tracking-widest ${o || l ? "text-app-text" : "text-app-muted"}`,
|
|
2184
2441
|
children: n.label
|
|
2185
2442
|
}
|
|
2186
2443
|
),
|
|
2187
|
-
n.description && /* @__PURE__ */
|
|
2444
|
+
n.description && /* @__PURE__ */ t("div", { className: "mt-0.5 text-xs text-app-muted", children: n.description })
|
|
2188
2445
|
] })
|
|
2189
2446
|
]
|
|
2190
2447
|
},
|
|
2191
2448
|
n.label
|
|
2192
2449
|
);
|
|
2193
|
-
}) }),
|
|
2450
|
+
}) }), ta = ({ checked: e, onChange: r, label: a, disabled: n = !1, className: s = "", ...l }) => /* @__PURE__ */ f(
|
|
2194
2451
|
"button",
|
|
2195
2452
|
{
|
|
2196
2453
|
type: "button",
|
|
2197
2454
|
role: "switch",
|
|
2198
|
-
"aria-checked":
|
|
2455
|
+
"aria-checked": e,
|
|
2199
2456
|
disabled: n,
|
|
2200
|
-
onClick: () => r == null ? void 0 : r(!
|
|
2201
|
-
className: `inline-flex items-center gap-2 text-sm text-app-text disabled:cursor-not-allowed disabled:opacity-50 ${s}`,
|
|
2457
|
+
onClick: () => r == null ? void 0 : r(!e),
|
|
2458
|
+
className: `inline-flex min-h-8 items-center gap-2 text-sm text-app-text disabled:cursor-not-allowed disabled:opacity-50 ${s}`,
|
|
2202
2459
|
...l,
|
|
2203
2460
|
children: [
|
|
2204
|
-
/* @__PURE__ */
|
|
2461
|
+
/* @__PURE__ */ t(
|
|
2205
2462
|
"span",
|
|
2206
2463
|
{
|
|
2207
2464
|
"aria-hidden": "true",
|
|
2208
|
-
className: `relative inline-block h-5 w-9 shrink-0 border transition ${
|
|
2209
|
-
children: /* @__PURE__ */
|
|
2465
|
+
className: `relative inline-block h-5 w-9 shrink-0 border transition ${e ? "border-app-strong bg-app-strong" : "border-app-border bg-app-bg"}`,
|
|
2466
|
+
children: /* @__PURE__ */ t(
|
|
2210
2467
|
"span",
|
|
2211
2468
|
{
|
|
2212
|
-
className: `absolute top-0.5 h-3.5 w-3.5 transition-all ${
|
|
2469
|
+
className: `absolute top-0.5 h-3.5 w-3.5 transition-all ${e ? "left-[1.1rem] bg-app-bg" : "left-0.5 bg-app-muted"}`
|
|
2213
2470
|
}
|
|
2214
2471
|
)
|
|
2215
2472
|
}
|
|
@@ -2217,350 +2474,521 @@ const yt = (t, r, a) => {
|
|
|
2217
2474
|
a
|
|
2218
2475
|
]
|
|
2219
2476
|
}
|
|
2220
|
-
),
|
|
2221
|
-
s && /* @__PURE__ */
|
|
2222
|
-
/* @__PURE__ */
|
|
2477
|
+
), Ie = { left: "text-left", center: "text-center", right: "text-right" }, ra = ({ columns: e, rows: r, rowKey: a = "id", empty: n = "No data", caption: s, className: l = "" }) => /* @__PURE__ */ t("div", { className: `overflow-x-auto border border-app-border ${l}`, children: /* @__PURE__ */ f("table", { className: "w-full border-collapse bg-app-card text-sm text-app-text", children: [
|
|
2478
|
+
s && /* @__PURE__ */ t("caption", { className: "sr-only", children: s }),
|
|
2479
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-app-border bg-app-bg", children: e.map((o) => /* @__PURE__ */ t(
|
|
2223
2480
|
"th",
|
|
2224
2481
|
{
|
|
2225
2482
|
scope: "col",
|
|
2226
|
-
className: `px-4 py-2.5 text-xs font-semibold uppercase tracking-widest text-app-muted ${
|
|
2483
|
+
className: `px-4 py-2.5 text-xs font-semibold uppercase tracking-widest text-app-muted ${Ie[o.align ?? "left"]}`,
|
|
2227
2484
|
children: o.header
|
|
2228
2485
|
},
|
|
2229
2486
|
o.key
|
|
2230
2487
|
)) }) }),
|
|
2231
|
-
/* @__PURE__ */
|
|
2232
|
-
] }) }),
|
|
2233
|
-
var
|
|
2234
|
-
const l =
|
|
2235
|
-
r === void 0 &&
|
|
2236
|
-
}, d =
|
|
2237
|
-
var
|
|
2238
|
-
const
|
|
2239
|
-
let
|
|
2240
|
-
|
|
2241
|
-
},
|
|
2242
|
-
return /* @__PURE__ */
|
|
2243
|
-
/* @__PURE__ */
|
|
2488
|
+
/* @__PURE__ */ t("tbody", { children: r.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: e.length, className: "px-4 py-6 text-center text-app-muted", children: n }) }) : r.map((o) => /* @__PURE__ */ t("tr", { className: "border-b border-app-border last:border-b-0 hover:bg-app-bg", children: e.map((i) => /* @__PURE__ */ t("td", { className: `px-4 py-2.5 ${Ie[i.align ?? "left"]}`, children: i.render ? i.render(o) : o[i.key] }, i.key)) }, o[a])) })
|
|
2489
|
+
] }) }), aa = ({ items: e, value: r, defaultValue: a, onChange: n, className: s = "" }) => {
|
|
2490
|
+
var g;
|
|
2491
|
+
const l = O(), [o, i] = D(a ?? ((g = e[0]) == null ? void 0 : g.key)), c = r ?? o, u = A({}), b = (h) => {
|
|
2492
|
+
r === void 0 && i(h), n == null || n(h);
|
|
2493
|
+
}, d = e.filter((h) => !h.disabled), p = (h) => {
|
|
2494
|
+
var N;
|
|
2495
|
+
const x = d.findIndex((M) => M.key === c);
|
|
2496
|
+
let v;
|
|
2497
|
+
h.key === "ArrowRight" ? v = d[(x + 1) % d.length] : h.key === "ArrowLeft" ? v = d[(x - 1 + d.length) % d.length] : h.key === "Home" ? v = d[0] : h.key === "End" && (v = d[d.length - 1]), v && (h.preventDefault(), b(v.key), (N = u.current[v.key]) == null || N.focus());
|
|
2498
|
+
}, m = e.find((h) => h.key === c);
|
|
2499
|
+
return /* @__PURE__ */ f("div", { className: s, children: [
|
|
2500
|
+
/* @__PURE__ */ t(
|
|
2244
2501
|
"div",
|
|
2245
2502
|
{
|
|
2246
2503
|
role: "tablist",
|
|
2247
|
-
onKeyDown:
|
|
2504
|
+
onKeyDown: p,
|
|
2248
2505
|
className: "flex overflow-x-auto overflow-y-hidden shadow-[inset_0_-1px_0_rgb(var(--color-app-border))]",
|
|
2249
|
-
children:
|
|
2250
|
-
const
|
|
2251
|
-
return /* @__PURE__ */
|
|
2506
|
+
children: e.map((h) => {
|
|
2507
|
+
const x = h.key === c;
|
|
2508
|
+
return /* @__PURE__ */ t(
|
|
2252
2509
|
"button",
|
|
2253
2510
|
{
|
|
2254
|
-
ref: (
|
|
2255
|
-
id: `${l}-tab-${
|
|
2511
|
+
ref: (v) => u.current[h.key] = v,
|
|
2512
|
+
id: `${l}-tab-${h.key}`,
|
|
2256
2513
|
type: "button",
|
|
2257
2514
|
role: "tab",
|
|
2258
|
-
"aria-selected":
|
|
2259
|
-
"aria-controls": `${l}-panel-${
|
|
2260
|
-
tabIndex:
|
|
2261
|
-
disabled:
|
|
2262
|
-
onClick: () =>
|
|
2263
|
-
className: `whitespace-nowrap border-b-2 px-4 py-2 text-xs font-semibold uppercase tracking-widest transition disabled:cursor-not-allowed disabled:opacity-50 ${
|
|
2264
|
-
children:
|
|
2515
|
+
"aria-selected": x,
|
|
2516
|
+
"aria-controls": `${l}-panel-${h.key}`,
|
|
2517
|
+
tabIndex: x ? 0 : -1,
|
|
2518
|
+
disabled: h.disabled,
|
|
2519
|
+
onClick: () => b(h.key),
|
|
2520
|
+
className: `whitespace-nowrap border-b-2 px-4 py-2 text-xs font-semibold uppercase tracking-widest transition disabled:cursor-not-allowed disabled:opacity-50 ${x ? "border-app-strong text-app-text" : "border-transparent text-app-muted hover:text-app-text"}`,
|
|
2521
|
+
children: h.label
|
|
2265
2522
|
},
|
|
2266
|
-
|
|
2523
|
+
h.key
|
|
2267
2524
|
);
|
|
2268
2525
|
})
|
|
2269
2526
|
}
|
|
2270
2527
|
),
|
|
2271
|
-
(
|
|
2528
|
+
(m == null ? void 0 : m.content) !== void 0 && /* @__PURE__ */ t(
|
|
2272
2529
|
"div",
|
|
2273
2530
|
{
|
|
2274
2531
|
role: "tabpanel",
|
|
2275
|
-
id: `${l}-panel-${
|
|
2276
|
-
"aria-labelledby": `${l}-tab-${
|
|
2532
|
+
id: `${l}-panel-${m.key}`,
|
|
2533
|
+
"aria-labelledby": `${l}-tab-${m.key}`,
|
|
2277
2534
|
tabIndex: 0,
|
|
2278
2535
|
className: "pt-4",
|
|
2279
|
-
children:
|
|
2536
|
+
children: m.content
|
|
2280
2537
|
}
|
|
2281
2538
|
)
|
|
2282
2539
|
] });
|
|
2283
|
-
},
|
|
2540
|
+
}, na = ({ href: e, linkComponent: r = "a", linkProp: a = "href", className: n = "", children: s, ...l }) => /* @__PURE__ */ t(
|
|
2541
|
+
r,
|
|
2542
|
+
{
|
|
2543
|
+
[a]: e,
|
|
2544
|
+
className: `text-app-text underline underline-offset-2 transition hover:text-app-strong ${n}`,
|
|
2545
|
+
...l,
|
|
2546
|
+
children: s
|
|
2547
|
+
}
|
|
2548
|
+
), tr = {
|
|
2284
2549
|
default: "bg-app-strong",
|
|
2285
2550
|
success: "bg-emerald-500",
|
|
2286
2551
|
warning: "bg-amber-400",
|
|
2287
2552
|
danger: "bg-red-500"
|
|
2288
|
-
},
|
|
2289
|
-
n <
|
|
2290
|
-
/* @__PURE__ */
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
/* @__PURE__ */
|
|
2293
|
-
/* @__PURE__ */
|
|
2294
|
-
a.time && /* @__PURE__ */
|
|
2553
|
+
}, la = ({ items: e, className: r = "" }) => /* @__PURE__ */ t("ol", { className: `m-0 list-none p-0 ${r}`, children: e.map((a, n) => /* @__PURE__ */ f("li", { className: "relative flex gap-4 pb-6 last:pb-0", children: [
|
|
2554
|
+
n < e.length - 1 && /* @__PURE__ */ t("span", { "aria-hidden": "true", className: "absolute left-[0.3rem] top-4 bottom-0 w-px bg-app-border" }),
|
|
2555
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", className: `relative mt-1.5 h-2.5 w-2.5 shrink-0 ${tr[a.tone ?? "default"]}` }),
|
|
2556
|
+
/* @__PURE__ */ f("div", { className: "min-w-0 flex-1", children: [
|
|
2557
|
+
/* @__PURE__ */ f("div", { className: "flex flex-wrap items-baseline justify-between gap-x-3", children: [
|
|
2558
|
+
/* @__PURE__ */ t("span", { className: "text-sm font-semibold text-app-text", children: a.title }),
|
|
2559
|
+
a.time && /* @__PURE__ */ t("time", { className: "text-xs text-app-muted", children: a.time })
|
|
2295
2560
|
] }),
|
|
2296
|
-
a.description && /* @__PURE__ */
|
|
2561
|
+
a.description && /* @__PURE__ */ t("p", { className: "m-0 mt-0.5 text-sm text-app-muted", children: a.description })
|
|
2297
2562
|
] })
|
|
2298
|
-
] }, a.key)) }),
|
|
2299
|
-
const
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2563
|
+
] }, a.key)) }), G = (e) => String(e).padStart(2, "0"), he = (e) => {
|
|
2564
|
+
const r = /^(\d{1,2}):(\d{2})/.exec(e ?? "");
|
|
2565
|
+
if (!r) return null;
|
|
2566
|
+
const a = Number(r[1]), n = Number(r[2]);
|
|
2567
|
+
return a < 24 && n < 60 ? { hour: a, minute: n } : null;
|
|
2568
|
+
}, Se = ({ hour: e, minute: r }) => e * 60 + r, rr = () => /* @__PURE__ */ f(
|
|
2569
|
+
"svg",
|
|
2570
|
+
{
|
|
2571
|
+
"aria-hidden": "true",
|
|
2572
|
+
focusable: "false",
|
|
2573
|
+
viewBox: "0 0 24 24",
|
|
2574
|
+
fill: "none",
|
|
2575
|
+
stroke: "currentColor",
|
|
2576
|
+
strokeWidth: "2",
|
|
2577
|
+
className: "h-4 w-4 shrink-0 text-app-muted",
|
|
2578
|
+
children: [
|
|
2579
|
+
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "9" }),
|
|
2580
|
+
/* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 7v5l3 2" })
|
|
2581
|
+
]
|
|
2582
|
+
}
|
|
2583
|
+
), me = ({ label: e, options: r, selected: a, onPick: n, columnRef: s }) => /* @__PURE__ */ t(
|
|
2584
|
+
"div",
|
|
2585
|
+
{
|
|
2586
|
+
ref: s,
|
|
2587
|
+
role: "listbox",
|
|
2588
|
+
"aria-label": e,
|
|
2589
|
+
className: "flex max-h-56 w-14 flex-col overflow-y-auto border-r border-app-border last:border-r-0",
|
|
2590
|
+
children: r.map((l) => {
|
|
2591
|
+
const o = l.value === a;
|
|
2592
|
+
return /* @__PURE__ */ t(
|
|
2593
|
+
"button",
|
|
2594
|
+
{
|
|
2595
|
+
type: "button",
|
|
2596
|
+
role: "option",
|
|
2597
|
+
"aria-selected": o,
|
|
2598
|
+
disabled: l.disabled,
|
|
2599
|
+
"data-selected": o,
|
|
2600
|
+
tabIndex: o || a === null && l.first ? 0 : -1,
|
|
2601
|
+
onClick: () => n(l.value),
|
|
2602
|
+
onKeyDown: (i) => {
|
|
2603
|
+
const c = [...i.currentTarget.parentElement.querySelectorAll("button:not(:disabled)")], u = c.indexOf(i.currentTarget), b = i.key === "ArrowDown" ? 1 : i.key === "ArrowUp" ? -1 : 0;
|
|
2604
|
+
if (b) {
|
|
2605
|
+
i.preventDefault();
|
|
2606
|
+
const d = c[Math.min(Math.max(u + b, 0), c.length - 1)];
|
|
2607
|
+
d == null || d.focus(), d == null || d.click();
|
|
2608
|
+
} else if (i.key === "ArrowLeft" || i.key === "ArrowRight") {
|
|
2609
|
+
const d = [...i.currentTarget.closest("[data-columns]").querySelectorAll("[role=listbox]")], p = d[d.indexOf(i.currentTarget.parentElement) + (i.key === "ArrowRight" ? 1 : -1)], m = (p == null ? void 0 : p.querySelector('[data-selected="true"]')) ?? (p == null ? void 0 : p.querySelector("button:not(:disabled)"));
|
|
2610
|
+
m && (i.preventDefault(), m.focus());
|
|
2611
|
+
}
|
|
2612
|
+
},
|
|
2613
|
+
className: `px-3 py-2 text-center text-sm tabular-nums transition disabled:cursor-not-allowed disabled:opacity-30 ${o ? "bg-app-strong font-semibold text-app-bg" : "text-app-text hover:bg-app-bg"}`,
|
|
2614
|
+
children: l.label
|
|
2615
|
+
},
|
|
2616
|
+
l.value
|
|
2617
|
+
);
|
|
2618
|
+
})
|
|
2619
|
+
}
|
|
2620
|
+
), sa = ({
|
|
2621
|
+
label: e,
|
|
2622
|
+
value: r,
|
|
2623
|
+
onChange: a,
|
|
2624
|
+
step: n = 900,
|
|
2625
|
+
min: s,
|
|
2626
|
+
max: l,
|
|
2627
|
+
hour12: o = !1,
|
|
2628
|
+
placeholder: i = "Select time",
|
|
2629
|
+
error: c,
|
|
2630
|
+
disabled: u = !1,
|
|
2631
|
+
className: b = "",
|
|
2632
|
+
...d
|
|
2633
|
+
}) => {
|
|
2634
|
+
const p = O(), m = `${p}-error`, g = A(null), h = A(null), x = A(null), v = A(null), [N, M] = D(!1), y = he(r), w = Math.max(1, Math.round(n / 60)), C = Array.from({ length: Math.ceil(60 / w) }, (E, S) => S * w), T = he(s), L = he(l), I = (E, S) => {
|
|
2635
|
+
const W = E * 60 + S;
|
|
2636
|
+
return (!T || W >= Se(T)) && (!L || W <= Se(L));
|
|
2637
|
+
};
|
|
2638
|
+
V(N, [g, x], (E) => {
|
|
2639
|
+
var S;
|
|
2640
|
+
M(!1), E === "escape" && ((S = h.current) == null || S.focus());
|
|
2641
|
+
}), P(() => {
|
|
2642
|
+
var W, ne;
|
|
2643
|
+
const E = x.current;
|
|
2644
|
+
if (!N || !E) return;
|
|
2645
|
+
E.querySelectorAll("[role=listbox]").forEach((le) => {
|
|
2646
|
+
const de = le.querySelector('[data-selected="true"]');
|
|
2647
|
+
de && (le.scrollTop = de.offsetTop - le.clientHeight / 2 + de.offsetHeight / 2);
|
|
2648
|
+
});
|
|
2649
|
+
const S = ((W = v.current) == null ? void 0 : W.querySelector('[data-selected="true"]')) ?? ((ne = v.current) == null ? void 0 : ne.querySelector("button:not(:disabled)"));
|
|
2650
|
+
S == null || S.focus({ preventScroll: !0 });
|
|
2651
|
+
}, [N]);
|
|
2652
|
+
const j = (E, S) => a == null ? void 0 : a(`${G(E)}:${G(S)}`), B = (E) => {
|
|
2653
|
+
const S = C.find((W) => W === (y == null ? void 0 : y.minute) && I(E, W)) ?? C.find((W) => I(E, W)) ?? 0;
|
|
2654
|
+
j(E, S);
|
|
2655
|
+
}, z = (E) => j((y == null ? void 0 : y.hour) ?? (T ? T.hour : 0), E), q = (E) => {
|
|
2656
|
+
const S = (y == null ? void 0 : y.hour) ?? 0;
|
|
2657
|
+
j(E ? S % 12 + 12 : S % 12, (y == null ? void 0 : y.minute) ?? 0);
|
|
2658
|
+
}, k = ((y == null ? void 0 : y.hour) ?? 0) >= 12, $ = o ? Array.from({ length: 12 }, (E, S) => {
|
|
2659
|
+
const W = S === 0 ? 12 : S, ne = S % 12 + (k ? 12 : 0);
|
|
2660
|
+
return {
|
|
2661
|
+
value: ne,
|
|
2662
|
+
label: G(W),
|
|
2663
|
+
first: S === 0,
|
|
2664
|
+
disabled: !C.some((le) => I(ne, le))
|
|
2665
|
+
};
|
|
2666
|
+
}) : Array.from({ length: 24 }, (E, S) => ({
|
|
2667
|
+
value: S,
|
|
2668
|
+
label: G(S),
|
|
2669
|
+
first: S === 0,
|
|
2670
|
+
disabled: !C.some((W) => I(S, W))
|
|
2671
|
+
})), R = C.map((E, S) => ({
|
|
2672
|
+
value: E,
|
|
2673
|
+
label: G(E),
|
|
2674
|
+
first: S === 0,
|
|
2675
|
+
disabled: !I((y == null ? void 0 : y.hour) ?? (T ? T.hour : 0), E)
|
|
2676
|
+
})), F = y ? o ? `${G(y.hour % 12 === 0 ? 12 : y.hour % 12)}:${G(y.minute)} ${k ? "PM" : "AM"}` : `${G(y.hour)}:${G(y.minute)}` : "";
|
|
2677
|
+
return /* @__PURE__ */ f("div", { ref: g, className: "relative flex flex-col gap-1", children: [
|
|
2678
|
+
e && /* @__PURE__ */ t(U, { htmlFor: p, children: e }),
|
|
2679
|
+
/* @__PURE__ */ f(
|
|
2680
|
+
"button",
|
|
2304
2681
|
{
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
"aria-invalid": !!
|
|
2312
|
-
"aria-describedby":
|
|
2313
|
-
|
|
2314
|
-
className:
|
|
2315
|
-
...
|
|
2682
|
+
ref: h,
|
|
2683
|
+
id: p,
|
|
2684
|
+
type: "button",
|
|
2685
|
+
disabled: u,
|
|
2686
|
+
"aria-haspopup": "dialog",
|
|
2687
|
+
"aria-expanded": N,
|
|
2688
|
+
"aria-invalid": !!c,
|
|
2689
|
+
"aria-describedby": c ? m : void 0,
|
|
2690
|
+
onClick: () => M((E) => !E),
|
|
2691
|
+
className: `${se(!!c)} flex items-center justify-between gap-2 text-left ${b}`,
|
|
2692
|
+
...d,
|
|
2693
|
+
children: [
|
|
2694
|
+
/* @__PURE__ */ t("span", { className: F ? "tabular-nums" : "text-app-muted", children: F || i }),
|
|
2695
|
+
/* @__PURE__ */ t(rr, {})
|
|
2696
|
+
]
|
|
2697
|
+
}
|
|
2698
|
+
),
|
|
2699
|
+
/* @__PURE__ */ t(
|
|
2700
|
+
X,
|
|
2701
|
+
{
|
|
2702
|
+
open: N,
|
|
2703
|
+
anchorRef: h,
|
|
2704
|
+
panelRef: x,
|
|
2705
|
+
placement: "bottom-start",
|
|
2706
|
+
role: "dialog",
|
|
2707
|
+
"aria-label": "Choose time",
|
|
2708
|
+
className: "border border-app-border bg-app-card shadow-xl",
|
|
2709
|
+
children: /* @__PURE__ */ f("div", { "data-columns": !0, className: "flex", children: [
|
|
2710
|
+
/* @__PURE__ */ t(
|
|
2711
|
+
me,
|
|
2712
|
+
{
|
|
2713
|
+
label: "Hours",
|
|
2714
|
+
options: $,
|
|
2715
|
+
selected: y ? y.hour : null,
|
|
2716
|
+
onPick: B,
|
|
2717
|
+
columnRef: v
|
|
2718
|
+
}
|
|
2719
|
+
),
|
|
2720
|
+
/* @__PURE__ */ t(me, { label: "Minutes", options: R, selected: y ? y.minute : null, onPick: z }),
|
|
2721
|
+
o && /* @__PURE__ */ t(
|
|
2722
|
+
me,
|
|
2723
|
+
{
|
|
2724
|
+
label: "AM or PM",
|
|
2725
|
+
options: [
|
|
2726
|
+
{ value: "AM", label: "AM", first: !0 },
|
|
2727
|
+
{ value: "PM", label: "PM" }
|
|
2728
|
+
],
|
|
2729
|
+
selected: y ? k ? "PM" : "AM" : null,
|
|
2730
|
+
onPick: (E) => q(E === "PM")
|
|
2731
|
+
}
|
|
2732
|
+
)
|
|
2733
|
+
] })
|
|
2316
2734
|
}
|
|
2317
2735
|
),
|
|
2318
|
-
|
|
2736
|
+
c && /* @__PURE__ */ t("span", { id: m, className: "text-xs text-red-700 dark:text-red-400", children: c })
|
|
2319
2737
|
] });
|
|
2320
|
-
},
|
|
2321
|
-
const { toast: r } =
|
|
2322
|
-
return /* @__PURE__ */
|
|
2738
|
+
}, oa = (e) => {
|
|
2739
|
+
const { toast: r } = e;
|
|
2740
|
+
return /* @__PURE__ */ t(
|
|
2323
2741
|
"div",
|
|
2324
2742
|
{
|
|
2325
2743
|
role: "status",
|
|
2326
2744
|
"aria-live": "polite",
|
|
2327
2745
|
"aria-atomic": "true",
|
|
2328
2746
|
className: "fixed bottom-5 right-5 z-[var(--xd-z-toast,90)]",
|
|
2329
|
-
children: r && /* @__PURE__ */
|
|
2747
|
+
children: r && /* @__PURE__ */ f(
|
|
2330
2748
|
"div",
|
|
2331
2749
|
{
|
|
2332
2750
|
className: `max-w-sm px-4 py-3 text-sm font-semibold shadow-xl ${r.type === "error" ? "bg-red-700 text-white" : "bg-emerald-700 text-white"}`,
|
|
2333
2751
|
children: [
|
|
2334
2752
|
r.msg,
|
|
2335
|
-
r.link && /* @__PURE__ */
|
|
2753
|
+
r.link && /* @__PURE__ */ f(re, { children: [
|
|
2336
2754
|
" ",
|
|
2337
|
-
/* @__PURE__ */
|
|
2755
|
+
/* @__PURE__ */ t("a", { href: r.link.href, target: "_blank", rel: "noreferrer", className: "underline underline-offset-2", children: r.link.label })
|
|
2338
2756
|
] })
|
|
2339
2757
|
]
|
|
2340
2758
|
}
|
|
2341
2759
|
)
|
|
2342
2760
|
}
|
|
2343
2761
|
);
|
|
2344
|
-
},
|
|
2762
|
+
}, Qe = (e, r, a = 0, n = null, s = []) => (e.forEach((l) => {
|
|
2345
2763
|
var o;
|
|
2346
|
-
s.push({ node: l, depth: a, parent: n }), (o = l.children) != null && o.length && r.includes(l.key) &&
|
|
2347
|
-
}), s),
|
|
2348
|
-
nodes:
|
|
2764
|
+
s.push({ node: l, depth: a, parent: n }), (o = l.children) != null && o.length && r.includes(l.key) && Qe(l.children, r, a + 1, l.key, s);
|
|
2765
|
+
}), s), ia = ({
|
|
2766
|
+
nodes: e,
|
|
2349
2767
|
selected: r,
|
|
2350
2768
|
onSelect: a,
|
|
2351
2769
|
defaultExpanded: n = [],
|
|
2352
2770
|
expanded: s,
|
|
2353
2771
|
onExpandedChange: l,
|
|
2354
2772
|
label: o = "Tree",
|
|
2355
|
-
className:
|
|
2773
|
+
className: i = ""
|
|
2356
2774
|
}) => {
|
|
2357
|
-
var
|
|
2358
|
-
const [
|
|
2359
|
-
s === void 0 && u(
|
|
2360
|
-
},
|
|
2361
|
-
|
|
2362
|
-
var
|
|
2363
|
-
return (
|
|
2775
|
+
var y;
|
|
2776
|
+
const [c, u] = D(n), b = s ?? c, [d, p] = D(null), m = (w) => {
|
|
2777
|
+
s === void 0 && u(w), l == null || l(w);
|
|
2778
|
+
}, g = (w) => m(b.includes(w) ? b.filter((C) => C !== w) : [...b, w]), h = Qe(e, b), x = h.some((w) => w.node.key === d) ? d : (y = h[0]) == null ? void 0 : y.node.key, v = (w) => {
|
|
2779
|
+
p(w), requestAnimationFrame(() => {
|
|
2780
|
+
var C;
|
|
2781
|
+
return (C = document.getElementById(`${N}-${w}`)) == null ? void 0 : C.focus();
|
|
2364
2782
|
});
|
|
2365
|
-
},
|
|
2366
|
-
var
|
|
2367
|
-
const { node:
|
|
2368
|
-
switch (
|
|
2783
|
+
}, N = `tree-${o.replace(/\W+/g, "-")}`, M = (w, C) => {
|
|
2784
|
+
var B;
|
|
2785
|
+
const { node: T, parent: L } = h[C], I = !!((B = T.children) != null && B.length), j = b.includes(T.key);
|
|
2786
|
+
switch (w.key) {
|
|
2369
2787
|
case "ArrowDown":
|
|
2370
|
-
|
|
2788
|
+
h[C + 1] && v(h[C + 1].node.key);
|
|
2371
2789
|
break;
|
|
2372
2790
|
case "ArrowUp":
|
|
2373
|
-
|
|
2791
|
+
h[C - 1] && v(h[C - 1].node.key);
|
|
2374
2792
|
break;
|
|
2375
2793
|
case "ArrowRight":
|
|
2376
|
-
|
|
2794
|
+
I && !j ? g(T.key) : I && v(T.children[0].key);
|
|
2377
2795
|
break;
|
|
2378
2796
|
case "ArrowLeft":
|
|
2379
|
-
|
|
2797
|
+
I && j ? g(T.key) : L !== null && v(L);
|
|
2380
2798
|
break;
|
|
2381
2799
|
case "Home":
|
|
2382
|
-
|
|
2800
|
+
v(h[0].node.key);
|
|
2383
2801
|
break;
|
|
2384
2802
|
case "End":
|
|
2385
|
-
|
|
2803
|
+
v(h[h.length - 1].node.key);
|
|
2386
2804
|
break;
|
|
2387
2805
|
case "Enter":
|
|
2388
2806
|
case " ":
|
|
2389
|
-
a == null || a(
|
|
2807
|
+
a == null || a(T.key);
|
|
2390
2808
|
break;
|
|
2391
2809
|
default:
|
|
2392
2810
|
return;
|
|
2393
2811
|
}
|
|
2394
|
-
|
|
2812
|
+
w.preventDefault();
|
|
2395
2813
|
};
|
|
2396
|
-
return /* @__PURE__ */
|
|
2397
|
-
var
|
|
2398
|
-
const
|
|
2399
|
-
return /* @__PURE__ */
|
|
2814
|
+
return /* @__PURE__ */ t("ul", { role: "tree", "aria-label": o, className: `m-0 list-none p-0 text-sm text-app-text ${i}`, children: h.map(({ node: w, depth: C }, T) => {
|
|
2815
|
+
var B;
|
|
2816
|
+
const L = !!((B = w.children) != null && B.length), I = b.includes(w.key), j = r === w.key;
|
|
2817
|
+
return /* @__PURE__ */ t(
|
|
2400
2818
|
"li",
|
|
2401
2819
|
{
|
|
2402
|
-
id: `${
|
|
2820
|
+
id: `${N}-${w.key}`,
|
|
2403
2821
|
role: "treeitem",
|
|
2404
|
-
"aria-level":
|
|
2405
|
-
"aria-expanded":
|
|
2406
|
-
"aria-selected":
|
|
2407
|
-
tabIndex:
|
|
2408
|
-
onKeyDown: (z) =>
|
|
2409
|
-
onFocus: () =>
|
|
2822
|
+
"aria-level": C + 1,
|
|
2823
|
+
"aria-expanded": L ? I : void 0,
|
|
2824
|
+
"aria-selected": j,
|
|
2825
|
+
tabIndex: w.key === x ? 0 : -1,
|
|
2826
|
+
onKeyDown: (z) => M(z, T),
|
|
2827
|
+
onFocus: () => p(w.key),
|
|
2410
2828
|
className: "list-none outline-none",
|
|
2411
|
-
children: /* @__PURE__ */
|
|
2829
|
+
children: /* @__PURE__ */ f(
|
|
2412
2830
|
"div",
|
|
2413
2831
|
{
|
|
2414
|
-
style: { paddingLeft: `${
|
|
2415
|
-
className: `flex cursor-pointer items-center gap-1 py-1.5 pr-3 transition hover:bg-app-bg ${
|
|
2832
|
+
style: { paddingLeft: `${C * 1.25 + 0.5}rem` },
|
|
2833
|
+
className: `flex cursor-pointer items-center gap-1 py-1.5 pr-3 transition hover:bg-app-bg ${j ? "bg-app-soft/20 font-semibold" : ""}`,
|
|
2416
2834
|
onClick: () => {
|
|
2417
|
-
a == null || a(
|
|
2835
|
+
a == null || a(w.key), L && g(w.key);
|
|
2418
2836
|
},
|
|
2419
2837
|
children: [
|
|
2420
|
-
/* @__PURE__ */
|
|
2421
|
-
|
|
2838
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", className: "flex h-5 w-5 shrink-0 items-center justify-center text-app-muted", children: L && /* @__PURE__ */ t(
|
|
2839
|
+
"svg",
|
|
2840
|
+
{
|
|
2841
|
+
viewBox: "0 0 24 24",
|
|
2842
|
+
fill: "none",
|
|
2843
|
+
stroke: "currentColor",
|
|
2844
|
+
strokeWidth: "2.5",
|
|
2845
|
+
className: `h-4 w-4 transition-transform ${I ? "rotate-90" : ""}`,
|
|
2846
|
+
children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" })
|
|
2847
|
+
}
|
|
2848
|
+
) }),
|
|
2849
|
+
w.label
|
|
2422
2850
|
]
|
|
2423
2851
|
}
|
|
2424
2852
|
)
|
|
2425
2853
|
},
|
|
2426
|
-
|
|
2854
|
+
w.key
|
|
2427
2855
|
);
|
|
2428
2856
|
}) });
|
|
2429
|
-
},
|
|
2430
|
-
if (!Number.isFinite(
|
|
2431
|
-
const r = Math.floor(
|
|
2857
|
+
}, Pe = (e) => {
|
|
2858
|
+
if (!Number.isFinite(e)) return "0:00";
|
|
2859
|
+
const r = Math.floor(e / 60), a = Math.floor(e % 60);
|
|
2432
2860
|
return `${r}:${String(a).padStart(2, "0")}`;
|
|
2433
|
-
},
|
|
2434
|
-
const
|
|
2435
|
-
|
|
2436
|
-
const
|
|
2437
|
-
return document.addEventListener("fullscreenchange",
|
|
2861
|
+
}, fe = "min-h-9 px-2 py-1 text-xs font-semibold uppercase tracking-widest text-app-text transition hover:bg-app-bg focus-visible:outline-offset-[-2px]", ca = ({ src: e, poster: r, title: a = "Video", ratio: n = "video", className: s = "", children: l, ...o }) => {
|
|
2862
|
+
const i = A(null), c = A(null), [u, b] = D(!1), [d, p] = D(0), [m, g] = D(0), [h, x] = D(!1), [v, N] = D(!1);
|
|
2863
|
+
P(() => {
|
|
2864
|
+
const w = () => N(document.fullscreenElement === c.current);
|
|
2865
|
+
return document.addEventListener("fullscreenchange", w), () => document.removeEventListener("fullscreenchange", w);
|
|
2438
2866
|
}, []);
|
|
2439
|
-
const
|
|
2440
|
-
const
|
|
2441
|
-
|
|
2442
|
-
}) :
|
|
2443
|
-
},
|
|
2444
|
-
var
|
|
2445
|
-
document.fullscreenElement ? document.exitFullscreen() : (
|
|
2867
|
+
const M = () => {
|
|
2868
|
+
const w = i.current;
|
|
2869
|
+
w.paused ? w.play().catch(() => {
|
|
2870
|
+
}) : w.pause();
|
|
2871
|
+
}, y = () => {
|
|
2872
|
+
var w, C;
|
|
2873
|
+
document.fullscreenElement ? document.exitFullscreen() : (C = (w = c.current) == null ? void 0 : w.requestFullscreen) == null || C.call(w);
|
|
2446
2874
|
};
|
|
2447
|
-
return /* @__PURE__ */
|
|
2448
|
-
/* @__PURE__ */
|
|
2875
|
+
return /* @__PURE__ */ f("div", { ref: c, className: `flex flex-col border border-app-border bg-app-card ${s}`, children: [
|
|
2876
|
+
/* @__PURE__ */ t(
|
|
2449
2877
|
"video",
|
|
2450
2878
|
{
|
|
2451
|
-
ref:
|
|
2452
|
-
src:
|
|
2879
|
+
ref: i,
|
|
2880
|
+
src: e,
|
|
2453
2881
|
poster: r,
|
|
2454
2882
|
title: a,
|
|
2455
|
-
muted:
|
|
2883
|
+
muted: h,
|
|
2456
2884
|
playsInline: !0,
|
|
2457
2885
|
preload: "metadata",
|
|
2458
|
-
className: `block w-full bg-black ${n === "video" ? "aspect-video" : ""} ${
|
|
2459
|
-
onClick:
|
|
2460
|
-
onPlay: () =>
|
|
2461
|
-
onPause: () =>
|
|
2462
|
-
onTimeUpdate: (
|
|
2463
|
-
onLoadedMetadata: (
|
|
2886
|
+
className: `block w-full bg-black ${n === "video" ? "aspect-video" : ""} ${v ? "flex-1" : ""}`,
|
|
2887
|
+
onClick: M,
|
|
2888
|
+
onPlay: () => b(!0),
|
|
2889
|
+
onPause: () => b(!1),
|
|
2890
|
+
onTimeUpdate: (w) => p(w.currentTarget.currentTime),
|
|
2891
|
+
onLoadedMetadata: (w) => g(w.currentTarget.duration),
|
|
2464
2892
|
...o,
|
|
2465
2893
|
children: l
|
|
2466
2894
|
}
|
|
2467
2895
|
),
|
|
2468
|
-
/* @__PURE__ */
|
|
2896
|
+
/* @__PURE__ */ f(
|
|
2469
2897
|
"div",
|
|
2470
2898
|
{
|
|
2471
2899
|
role: "group",
|
|
2472
2900
|
"aria-label": `${a} controls`,
|
|
2473
2901
|
className: "flex items-center gap-1 border-t border-app-border px-1 py-1",
|
|
2474
2902
|
children: [
|
|
2475
|
-
/* @__PURE__ */
|
|
2476
|
-
/* @__PURE__ */
|
|
2477
|
-
/* @__PURE__ */
|
|
2903
|
+
/* @__PURE__ */ t("button", { type: "button", className: fe, onClick: M, "aria-label": u ? "Pause" : "Play", children: u ? "Pause" : "Play" }),
|
|
2904
|
+
/* @__PURE__ */ t("span", { className: "w-10 text-center text-xs tabular-nums text-app-muted", children: Pe(d) }),
|
|
2905
|
+
/* @__PURE__ */ t(
|
|
2478
2906
|
"input",
|
|
2479
2907
|
{
|
|
2480
2908
|
type: "range",
|
|
2481
2909
|
"aria-label": "Seek",
|
|
2482
2910
|
min: 0,
|
|
2483
|
-
max:
|
|
2911
|
+
max: m || 0,
|
|
2484
2912
|
step: "any",
|
|
2485
|
-
value: Math.min(d,
|
|
2486
|
-
onChange: (
|
|
2487
|
-
|
|
2913
|
+
value: Math.min(d, m || 0),
|
|
2914
|
+
onChange: (w) => {
|
|
2915
|
+
i.current.currentTime = Number(w.target.value), p(Number(w.target.value));
|
|
2488
2916
|
},
|
|
2489
2917
|
className: "min-w-0 flex-1 cursor-pointer accent-[rgb(var(--color-app-strong))]"
|
|
2490
2918
|
}
|
|
2491
2919
|
),
|
|
2492
|
-
/* @__PURE__ */
|
|
2493
|
-
/* @__PURE__ */
|
|
2494
|
-
/* @__PURE__ */
|
|
2920
|
+
/* @__PURE__ */ t("span", { className: "w-10 text-center text-xs tabular-nums text-app-muted", children: Pe(m) }),
|
|
2921
|
+
/* @__PURE__ */ t("button", { type: "button", className: fe, "aria-pressed": h, onClick: () => x((w) => !w), children: h ? "Unmute" : "Mute" }),
|
|
2922
|
+
/* @__PURE__ */ t("button", { type: "button", className: fe, onClick: y, children: v ? "Exit" : "Full" })
|
|
2495
2923
|
]
|
|
2496
2924
|
}
|
|
2497
2925
|
)
|
|
2498
2926
|
] });
|
|
2499
|
-
},
|
|
2500
|
-
items:
|
|
2927
|
+
}, da = ({
|
|
2928
|
+
items: e,
|
|
2501
2929
|
itemHeight: r,
|
|
2502
2930
|
height: a = 320,
|
|
2503
2931
|
overscan: n = 4,
|
|
2504
2932
|
renderItem: s,
|
|
2505
2933
|
getKey: l,
|
|
2506
2934
|
label: o = "List",
|
|
2507
|
-
className:
|
|
2935
|
+
className: i = ""
|
|
2508
2936
|
}) => {
|
|
2509
|
-
const [
|
|
2510
|
-
return /* @__PURE__ */
|
|
2937
|
+
const [c, u] = D(0), b = Math.max(0, Math.floor(c / r) - n), d = Math.min(e.length, Math.ceil((c + a) / r) + n);
|
|
2938
|
+
return /* @__PURE__ */ t(
|
|
2511
2939
|
"div",
|
|
2512
2940
|
{
|
|
2513
2941
|
role: "list",
|
|
2514
2942
|
"aria-label": o,
|
|
2515
|
-
"aria-rowcount":
|
|
2943
|
+
"aria-rowcount": e.length,
|
|
2516
2944
|
tabIndex: 0,
|
|
2517
|
-
onScroll: (
|
|
2945
|
+
onScroll: (p) => u(p.currentTarget.scrollTop),
|
|
2518
2946
|
style: { height: a },
|
|
2519
|
-
className: `overflow-y-auto border border-app-border bg-app-card ${
|
|
2520
|
-
children: /* @__PURE__ */
|
|
2521
|
-
const
|
|
2522
|
-
return /* @__PURE__ */
|
|
2947
|
+
className: `overflow-y-auto border border-app-border bg-app-card ${i}`,
|
|
2948
|
+
children: /* @__PURE__ */ t("div", { style: { height: e.length * r, position: "relative" }, children: e.slice(b, d).map((p, m) => {
|
|
2949
|
+
const g = b + m;
|
|
2950
|
+
return /* @__PURE__ */ t(
|
|
2523
2951
|
"div",
|
|
2524
2952
|
{
|
|
2525
2953
|
role: "listitem",
|
|
2526
|
-
"aria-posinset":
|
|
2527
|
-
"aria-setsize":
|
|
2528
|
-
style: { position: "absolute", top:
|
|
2954
|
+
"aria-posinset": g + 1,
|
|
2955
|
+
"aria-setsize": e.length,
|
|
2956
|
+
style: { position: "absolute", top: g * r, height: r, left: 0, right: 0 },
|
|
2529
2957
|
className: "flex items-center border-b border-app-border px-4 text-sm text-app-text",
|
|
2530
|
-
children: s(
|
|
2958
|
+
children: s(p, g)
|
|
2531
2959
|
},
|
|
2532
|
-
l ? l(
|
|
2960
|
+
l ? l(p, g) : g
|
|
2533
2961
|
);
|
|
2534
2962
|
}) })
|
|
2535
2963
|
}
|
|
2536
2964
|
);
|
|
2537
|
-
},
|
|
2965
|
+
}, pa = ({ className: e }) => /* @__PURE__ */ f(
|
|
2538
2966
|
"svg",
|
|
2539
2967
|
{
|
|
2540
2968
|
"aria-hidden": "true",
|
|
2541
2969
|
focusable: "false",
|
|
2542
|
-
className:
|
|
2970
|
+
className: e ?? "w-3.5 h-3.5",
|
|
2543
2971
|
viewBox: "0 0 24 24",
|
|
2544
2972
|
fill: "none",
|
|
2545
2973
|
stroke: "currentColor",
|
|
2546
2974
|
strokeWidth: "2",
|
|
2547
2975
|
children: [
|
|
2548
|
-
/* @__PURE__ */
|
|
2549
|
-
/* @__PURE__ */
|
|
2976
|
+
/* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 12H5" }),
|
|
2977
|
+
/* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 5l-7 7 7 7" })
|
|
2550
2978
|
]
|
|
2551
2979
|
}
|
|
2552
|
-
),
|
|
2980
|
+
), ua = ({ className: e }) => /* @__PURE__ */ f(
|
|
2553
2981
|
"svg",
|
|
2554
2982
|
{
|
|
2555
2983
|
"aria-hidden": "true",
|
|
2556
2984
|
focusable: "false",
|
|
2557
|
-
className:
|
|
2985
|
+
className: e ?? "w-4 h-4",
|
|
2558
2986
|
fill: "none",
|
|
2559
2987
|
viewBox: "0 0 24 24",
|
|
2560
2988
|
stroke: "currentColor",
|
|
2561
2989
|
strokeWidth: 2,
|
|
2562
2990
|
children: [
|
|
2563
|
-
/* @__PURE__ */
|
|
2991
|
+
/* @__PURE__ */ t(
|
|
2564
2992
|
"path",
|
|
2565
2993
|
{
|
|
2566
2994
|
strokeLinecap: "round",
|
|
@@ -2568,20 +2996,20 @@ const yt = (t, r, a) => {
|
|
|
2568
2996
|
d: "M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"
|
|
2569
2997
|
}
|
|
2570
2998
|
),
|
|
2571
|
-
/* @__PURE__ */
|
|
2999
|
+
/* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" })
|
|
2572
3000
|
]
|
|
2573
3001
|
}
|
|
2574
|
-
),
|
|
3002
|
+
), ha = ({ className: e }) => /* @__PURE__ */ t(
|
|
2575
3003
|
"svg",
|
|
2576
3004
|
{
|
|
2577
3005
|
"aria-hidden": "true",
|
|
2578
3006
|
focusable: "false",
|
|
2579
|
-
className:
|
|
3007
|
+
className: e ?? "w-4 h-4",
|
|
2580
3008
|
fill: "none",
|
|
2581
3009
|
viewBox: "0 0 24 24",
|
|
2582
3010
|
stroke: "currentColor",
|
|
2583
3011
|
strokeWidth: 2,
|
|
2584
|
-
children: /* @__PURE__ */
|
|
3012
|
+
children: /* @__PURE__ */ t(
|
|
2585
3013
|
"path",
|
|
2586
3014
|
{
|
|
2587
3015
|
strokeLinecap: "round",
|
|
@@ -2590,34 +3018,34 @@ const yt = (t, r, a) => {
|
|
|
2590
3018
|
}
|
|
2591
3019
|
)
|
|
2592
3020
|
}
|
|
2593
|
-
),
|
|
3021
|
+
), ma = ({ className: e }) => /* @__PURE__ */ f(
|
|
2594
3022
|
"svg",
|
|
2595
3023
|
{
|
|
2596
3024
|
"aria-hidden": "true",
|
|
2597
3025
|
focusable: "false",
|
|
2598
|
-
className:
|
|
3026
|
+
className: e ?? "h-5 w-5",
|
|
2599
3027
|
viewBox: "0 0 24 24",
|
|
2600
3028
|
fill: "none",
|
|
2601
3029
|
stroke: "currentColor",
|
|
2602
3030
|
strokeWidth: "2",
|
|
2603
3031
|
children: [
|
|
2604
|
-
/* @__PURE__ */
|
|
2605
|
-
/* @__PURE__ */
|
|
2606
|
-
/* @__PURE__ */
|
|
2607
|
-
/* @__PURE__ */
|
|
3032
|
+
/* @__PURE__ */ t("rect", { x: "3", y: "3", width: "7", height: "7", rx: "1" }),
|
|
3033
|
+
/* @__PURE__ */ t("rect", { x: "14", y: "3", width: "7", height: "7", rx: "1" }),
|
|
3034
|
+
/* @__PURE__ */ t("rect", { x: "3", y: "14", width: "7", height: "7", rx: "1" }),
|
|
3035
|
+
/* @__PURE__ */ t("rect", { x: "14", y: "14", width: "7", height: "7", rx: "1" })
|
|
2608
3036
|
]
|
|
2609
3037
|
}
|
|
2610
|
-
),
|
|
3038
|
+
), fa = ({ className: e }) => /* @__PURE__ */ t(
|
|
2611
3039
|
"svg",
|
|
2612
3040
|
{
|
|
2613
3041
|
"aria-hidden": "true",
|
|
2614
3042
|
focusable: "false",
|
|
2615
|
-
className:
|
|
3043
|
+
className: e ?? "w-4 h-4",
|
|
2616
3044
|
fill: "none",
|
|
2617
3045
|
viewBox: "0 0 24 24",
|
|
2618
3046
|
stroke: "currentColor",
|
|
2619
3047
|
strokeWidth: 2,
|
|
2620
|
-
children: /* @__PURE__ */
|
|
3048
|
+
children: /* @__PURE__ */ t(
|
|
2621
3049
|
"path",
|
|
2622
3050
|
{
|
|
2623
3051
|
strokeLinecap: "round",
|
|
@@ -2626,17 +3054,17 @@ const yt = (t, r, a) => {
|
|
|
2626
3054
|
}
|
|
2627
3055
|
)
|
|
2628
3056
|
}
|
|
2629
|
-
),
|
|
3057
|
+
), ba = ({ className: e }) => /* @__PURE__ */ t(
|
|
2630
3058
|
"svg",
|
|
2631
3059
|
{
|
|
2632
3060
|
"aria-hidden": "true",
|
|
2633
3061
|
focusable: "false",
|
|
2634
|
-
className:
|
|
3062
|
+
className: e ?? "w-4 h-4",
|
|
2635
3063
|
fill: "none",
|
|
2636
3064
|
viewBox: "0 0 24 24",
|
|
2637
3065
|
stroke: "currentColor",
|
|
2638
3066
|
strokeWidth: 2,
|
|
2639
|
-
children: /* @__PURE__ */
|
|
3067
|
+
children: /* @__PURE__ */ t(
|
|
2640
3068
|
"path",
|
|
2641
3069
|
{
|
|
2642
3070
|
strokeLinecap: "round",
|
|
@@ -2645,17 +3073,17 @@ const yt = (t, r, a) => {
|
|
|
2645
3073
|
}
|
|
2646
3074
|
)
|
|
2647
3075
|
}
|
|
2648
|
-
),
|
|
3076
|
+
), xa = ({ className: e }) => /* @__PURE__ */ t(
|
|
2649
3077
|
"svg",
|
|
2650
3078
|
{
|
|
2651
3079
|
"aria-hidden": "true",
|
|
2652
3080
|
focusable: "false",
|
|
2653
|
-
className:
|
|
3081
|
+
className: e ?? "h-5 w-5 text-app-soft",
|
|
2654
3082
|
viewBox: "0 0 24 24",
|
|
2655
3083
|
fill: "none",
|
|
2656
3084
|
stroke: "currentColor",
|
|
2657
3085
|
strokeWidth: 1.5,
|
|
2658
|
-
children: /* @__PURE__ */
|
|
3086
|
+
children: /* @__PURE__ */ t(
|
|
2659
3087
|
"path",
|
|
2660
3088
|
{
|
|
2661
3089
|
strokeLinecap: "round",
|
|
@@ -2664,33 +3092,33 @@ const yt = (t, r, a) => {
|
|
|
2664
3092
|
}
|
|
2665
3093
|
)
|
|
2666
3094
|
}
|
|
2667
|
-
),
|
|
3095
|
+
), ga = ({ className: e }) => /* @__PURE__ */ f(
|
|
2668
3096
|
"svg",
|
|
2669
3097
|
{
|
|
2670
3098
|
"aria-hidden": "true",
|
|
2671
3099
|
focusable: "false",
|
|
2672
|
-
className:
|
|
3100
|
+
className: e ?? "w-3.5 h-3.5",
|
|
2673
3101
|
viewBox: "0 0 24 24",
|
|
2674
3102
|
fill: "none",
|
|
2675
3103
|
stroke: "currentColor",
|
|
2676
3104
|
strokeWidth: "2",
|
|
2677
3105
|
children: [
|
|
2678
|
-
/* @__PURE__ */
|
|
2679
|
-
/* @__PURE__ */
|
|
3106
|
+
/* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12a9 9 0 11-2.63-6.36" }),
|
|
3107
|
+
/* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 3v6h-6" })
|
|
2680
3108
|
]
|
|
2681
3109
|
}
|
|
2682
|
-
),
|
|
3110
|
+
), va = ({ className: e }) => /* @__PURE__ */ f(
|
|
2683
3111
|
"svg",
|
|
2684
3112
|
{
|
|
2685
3113
|
"aria-hidden": "true",
|
|
2686
3114
|
focusable: "false",
|
|
2687
|
-
className:
|
|
3115
|
+
className: e ?? "h-4 w-4",
|
|
2688
3116
|
fill: "none",
|
|
2689
3117
|
viewBox: "0 0 24 24",
|
|
2690
3118
|
stroke: "currentColor",
|
|
2691
3119
|
strokeWidth: 2,
|
|
2692
3120
|
children: [
|
|
2693
|
-
/* @__PURE__ */
|
|
3121
|
+
/* @__PURE__ */ t(
|
|
2694
3122
|
"path",
|
|
2695
3123
|
{
|
|
2696
3124
|
strokeLinecap: "round",
|
|
@@ -2698,20 +3126,20 @@ const yt = (t, r, a) => {
|
|
|
2698
3126
|
d: "M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 010 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 010-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28z"
|
|
2699
3127
|
}
|
|
2700
3128
|
),
|
|
2701
|
-
/* @__PURE__ */
|
|
3129
|
+
/* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" })
|
|
2702
3130
|
]
|
|
2703
3131
|
}
|
|
2704
|
-
),
|
|
3132
|
+
), wa = ({ className: e }) => /* @__PURE__ */ t(
|
|
2705
3133
|
"svg",
|
|
2706
3134
|
{
|
|
2707
3135
|
"aria-hidden": "true",
|
|
2708
3136
|
focusable: "false",
|
|
2709
|
-
className:
|
|
3137
|
+
className: e ?? "h-7 w-7 text-app-soft",
|
|
2710
3138
|
fill: "none",
|
|
2711
3139
|
viewBox: "0 0 24 24",
|
|
2712
3140
|
stroke: "currentColor",
|
|
2713
3141
|
strokeWidth: 1.5,
|
|
2714
|
-
children: /* @__PURE__ */
|
|
3142
|
+
children: /* @__PURE__ */ t(
|
|
2715
3143
|
"path",
|
|
2716
3144
|
{
|
|
2717
3145
|
strokeLinecap: "round",
|
|
@@ -2720,48 +3148,60 @@ const yt = (t, r, a) => {
|
|
|
2720
3148
|
}
|
|
2721
3149
|
)
|
|
2722
3150
|
}
|
|
2723
|
-
),
|
|
2724
|
-
|
|
2725
|
-
document.title = [
|
|
2726
|
-
}, [
|
|
2727
|
-
},
|
|
2728
|
-
const
|
|
2729
|
-
return
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
3151
|
+
), ya = (e, r = "") => {
|
|
3152
|
+
P(() => {
|
|
3153
|
+
document.title = [e, r].filter(Boolean).join(" · ");
|
|
3154
|
+
}, [e, r]);
|
|
3155
|
+
}, Re = 8, ka = (e, r, a) => {
|
|
3156
|
+
const [n, s] = D(!1);
|
|
3157
|
+
return ve(() => {
|
|
3158
|
+
if (!e) {
|
|
3159
|
+
s(!1);
|
|
3160
|
+
return;
|
|
3161
|
+
}
|
|
3162
|
+
const l = r.current;
|
|
3163
|
+
if (!l) return;
|
|
3164
|
+
const o = l.getBoundingClientRect(), i = document.documentElement.clientWidth, c = a === "end" ? o.left < Re : o.right > i - Re;
|
|
3165
|
+
s(c);
|
|
3166
|
+
}, [e, r, a]), n ? a === "end" ? "start" : "end" : a;
|
|
3167
|
+
}, ar = () => typeof navigator < "u" && /Mac|iPhone|iPad/.test(navigator.platform), nr = (e, r) => {
|
|
3168
|
+
const a = e.toLowerCase().split("+"), n = a.pop(), s = new Set(a), l = ar(), o = s.has("ctrl") || s.has("mod") && !l, i = s.has("meta") || s.has("mod") && l;
|
|
3169
|
+
return r.key.toLowerCase() === n && r.ctrlKey === o && r.metaKey === i && r.altKey === s.has("alt") && r.shiftKey === s.has("shift");
|
|
3170
|
+
}, lr = (e) => e instanceof HTMLElement && (e.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)), Na = (e, r = !0) => {
|
|
3171
|
+
const a = A(e);
|
|
3172
|
+
P(() => {
|
|
3173
|
+
a.current = e;
|
|
3174
|
+
}), P(() => {
|
|
2735
3175
|
if (!r) return;
|
|
2736
3176
|
const n = (s) => {
|
|
2737
3177
|
for (const [l, o] of Object.entries(a.current))
|
|
2738
|
-
if (!(!
|
|
3178
|
+
if (!(!nr(l, s) || !/\b(mod|ctrl|alt|meta)\+/i.test(l) && lr(s.target))) {
|
|
2739
3179
|
s.preventDefault(), o(s);
|
|
2740
3180
|
return;
|
|
2741
3181
|
}
|
|
2742
3182
|
};
|
|
2743
3183
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
2744
3184
|
}, [r]);
|
|
2745
|
-
},
|
|
2746
|
-
|
|
2747
|
-
if (!
|
|
3185
|
+
}, $a = (e) => {
|
|
3186
|
+
P(() => {
|
|
3187
|
+
if (!e) return;
|
|
2748
3188
|
const r = (a) => {
|
|
2749
3189
|
a.preventDefault(), a.returnValue = "";
|
|
2750
3190
|
};
|
|
2751
3191
|
return window.addEventListener("beforeunload", r), () => window.removeEventListener("beforeunload", r);
|
|
2752
|
-
}, [
|
|
2753
|
-
},
|
|
2754
|
-
const [r, a] =
|
|
2755
|
-
|
|
2756
|
-
const s =
|
|
2757
|
-
(l, o = "success", { link:
|
|
2758
|
-
clearTimeout(n.current), a({ msg: l, type: o, link:
|
|
3192
|
+
}, [e]);
|
|
3193
|
+
}, Ma = (e = 3e3) => {
|
|
3194
|
+
const [r, a] = D(null), n = A(null);
|
|
3195
|
+
P(() => () => clearTimeout(n.current), []);
|
|
3196
|
+
const s = Fe(
|
|
3197
|
+
(l, o = "success", { link: i, duration: c = e } = {}) => {
|
|
3198
|
+
clearTimeout(n.current), a({ msg: l, type: o, link: i }), n.current = setTimeout(() => a(null), c);
|
|
2759
3199
|
},
|
|
2760
|
-
[
|
|
3200
|
+
[e]
|
|
2761
3201
|
);
|
|
2762
3202
|
return { toast: r, showToast: s };
|
|
2763
|
-
},
|
|
2764
|
-
const a =
|
|
3203
|
+
}, sr = (e, r = "") => {
|
|
3204
|
+
const a = xe[e], n = `
|
|
2765
3205
|
<svg width="64" height="64" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
|
|
2766
3206
|
<title>${r}</title>
|
|
2767
3207
|
<circle cx="32" cy="32" r="30" fill="${a.outer}"/>
|
|
@@ -2775,128 +3215,133 @@ const yt = (t, r, a) => {
|
|
|
2775
3215
|
</svg>
|
|
2776
3216
|
`;
|
|
2777
3217
|
return `data:image/svg+xml,${encodeURIComponent(n)}`;
|
|
2778
|
-
},
|
|
3218
|
+
}, or = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", ir = (e = He) => {
|
|
2779
3219
|
if (typeof window > "u") return null;
|
|
2780
3220
|
try {
|
|
2781
|
-
const r = window.localStorage.getItem(
|
|
3221
|
+
const r = window.localStorage.getItem(e);
|
|
2782
3222
|
if (r === "light" || r === "dark") return r;
|
|
2783
3223
|
} catch {
|
|
2784
3224
|
}
|
|
2785
3225
|
return null;
|
|
2786
|
-
},
|
|
2787
|
-
const [n, s] =
|
|
2788
|
-
return
|
|
3226
|
+
}, cr = ({ storageKey: e = He, favicon: r = !0, faviconTitle: a = "" } = {}) => {
|
|
3227
|
+
const [n, s] = D(or), [l, o] = D(() => ir(e)), i = l || n;
|
|
3228
|
+
return P(() => {
|
|
2789
3229
|
if (typeof window > "u") return;
|
|
2790
|
-
const u = window.matchMedia("(prefers-color-scheme: dark)"),
|
|
2791
|
-
return u.addEventListener("change",
|
|
2792
|
-
}, []),
|
|
3230
|
+
const u = window.matchMedia("(prefers-color-scheme: dark)"), b = (d) => s(d.matches ? "dark" : "light");
|
|
3231
|
+
return u.addEventListener("change", b), () => u.removeEventListener("change", b);
|
|
3232
|
+
}, []), P(() => {
|
|
2793
3233
|
try {
|
|
2794
|
-
l ? window.localStorage.setItem(
|
|
3234
|
+
l ? window.localStorage.setItem(e, l) : window.localStorage.removeItem(e);
|
|
2795
3235
|
} catch {
|
|
2796
3236
|
}
|
|
2797
|
-
}, [l,
|
|
2798
|
-
if (document.documentElement.setAttribute("data-theme",
|
|
2799
|
-
|
|
2800
|
-
u
|
|
2801
|
-
}, [
|
|
2802
|
-
},
|
|
2803
|
-
const s =
|
|
2804
|
-
return /* @__PURE__ */
|
|
3237
|
+
}, [l, e]), P(() => {
|
|
3238
|
+
if (document.documentElement.setAttribute("data-theme", i), !r) return;
|
|
3239
|
+
let u = document.getElementById("app-favicon") || document.querySelector("link[rel~='icon']");
|
|
3240
|
+
u || (u = document.createElement("link"), u.id = "app-favicon", u.rel = "icon", document.head.appendChild(u)), u.setAttribute("type", "image/svg+xml"), u.setAttribute("href", sr(i, a));
|
|
3241
|
+
}, [i, r, a]), { activeTheme: i, toggleTheme: () => o((u) => (u || n) === "dark" ? "light" : "dark") };
|
|
3242
|
+
}, La = ({ children: e, storageKey: r, favicon: a = !1, faviconTitle: n }) => {
|
|
3243
|
+
const s = cr({ storageKey: r, favicon: a, faviconTitle: n });
|
|
3244
|
+
return /* @__PURE__ */ t(We.Provider, { value: s, children: e });
|
|
2805
3245
|
};
|
|
2806
3246
|
export {
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
3247
|
+
hr as ActionMenu,
|
|
3248
|
+
mr as Alert,
|
|
3249
|
+
fr as AppBar,
|
|
3250
|
+
br as AppShell,
|
|
3251
|
+
xr as AreaChart,
|
|
3252
|
+
pa as ArrowLeftIcon,
|
|
3253
|
+
gr as Avatar,
|
|
3254
|
+
vr as BarChart,
|
|
3255
|
+
wr as BodyText,
|
|
3256
|
+
yr as Breadcrumb,
|
|
3257
|
+
H as Button,
|
|
3258
|
+
Ge as Calendar,
|
|
3259
|
+
kr as Card,
|
|
3260
|
+
Nr as Carousel,
|
|
3261
|
+
er as CheckIcon,
|
|
3262
|
+
Te as Checkbox,
|
|
3263
|
+
we as CloseIcon,
|
|
3264
|
+
$r as CommandPalette,
|
|
3265
|
+
Mr as ConfirmDialog,
|
|
3266
|
+
Lr as Container,
|
|
3267
|
+
He as DEFAULT_THEME_STORAGE_KEY,
|
|
3268
|
+
Cr as Dashboard,
|
|
3269
|
+
Tr as DataGrid,
|
|
3270
|
+
Dr as DatePicker,
|
|
3271
|
+
Ar as DateRangePicker,
|
|
3272
|
+
Er as Divider,
|
|
3273
|
+
bt as Drawer,
|
|
3274
|
+
ua as EyeIcon,
|
|
3275
|
+
ha as EyeOffIcon,
|
|
3276
|
+
Ye as FanFavicon,
|
|
3277
|
+
Ir as Field,
|
|
3278
|
+
Sr as FileUpload,
|
|
3279
|
+
Kt as Flex,
|
|
3280
|
+
Pr as FocusTrap,
|
|
3281
|
+
Ae as Grid,
|
|
3282
|
+
ma as GridIcon,
|
|
3283
|
+
Rr as HelperText,
|
|
3284
|
+
fa as HomeIcon,
|
|
3285
|
+
jr as Image,
|
|
3286
|
+
ot as InfoIcon,
|
|
3287
|
+
Ze as Input,
|
|
3288
|
+
U as Label,
|
|
3289
|
+
wt as LineChart,
|
|
3290
|
+
Fr as List,
|
|
3291
|
+
Br as LoadingScreen,
|
|
3292
|
+
ba as LogoutIcon,
|
|
3293
|
+
xt as MenuIcon,
|
|
3294
|
+
Dt as Modal,
|
|
3295
|
+
Or as Navbar,
|
|
3296
|
+
Wr as NotificationCenter,
|
|
3297
|
+
St as PageHeader,
|
|
3298
|
+
Ut as PageLayout,
|
|
3299
|
+
zr as PageTitle,
|
|
3300
|
+
Ft as Pagination,
|
|
3301
|
+
xa as PencilIcon,
|
|
3302
|
+
qr as PieChart,
|
|
3303
|
+
Kr as Popover,
|
|
3304
|
+
_r as Portal,
|
|
3305
|
+
Ur as Progress,
|
|
3306
|
+
Gr as RackServer,
|
|
3307
|
+
Qt as Radio,
|
|
3308
|
+
Hr as RadioGroup,
|
|
3309
|
+
ga as RefreshIcon,
|
|
3310
|
+
Yr as Select,
|
|
3311
|
+
va as SettingsIcon,
|
|
3312
|
+
wa as ShieldIcon,
|
|
3313
|
+
Zr as Sidebar,
|
|
3314
|
+
Qr as Skeleton,
|
|
3315
|
+
Vr as Slider,
|
|
3316
|
+
Xr as SortableList,
|
|
3317
|
+
Jr as Stack,
|
|
3318
|
+
Rt as StatCard,
|
|
3319
|
+
ea as Stepper,
|
|
3320
|
+
ta as Switch,
|
|
3321
|
+
xe as THEME_FAVICON_COLORS,
|
|
3322
|
+
ra as Table,
|
|
3323
|
+
aa as Tabs,
|
|
3324
|
+
na as TextLink,
|
|
3325
|
+
We as ThemeContext,
|
|
3326
|
+
La as ThemeProvider,
|
|
3327
|
+
ze as ThemeToggle,
|
|
3328
|
+
sa as TimePicker,
|
|
3329
|
+
la as Timeline,
|
|
3330
|
+
oa as Toast,
|
|
3331
|
+
Oe as Tooltip,
|
|
3332
|
+
ia as Tree,
|
|
3333
|
+
ca as Video,
|
|
3334
|
+
da as VirtualList,
|
|
3335
|
+
sr as buildFaviconHref,
|
|
3336
|
+
dt as toolbarButtonClass,
|
|
3337
|
+
cr as useAppTheme,
|
|
3338
|
+
ie as useDialogFocus,
|
|
3339
|
+
V as useDismissable,
|
|
3340
|
+
ya as useDocumentTitle,
|
|
3341
|
+
ye as useEscapeKey,
|
|
3342
|
+
ka as useFlipAlign,
|
|
3343
|
+
Na as useKeyboardShortcuts,
|
|
3344
|
+
$a as useLeaveWarning,
|
|
3345
|
+
ct as useTheme,
|
|
3346
|
+
Ma as useTimedToast
|
|
2902
3347
|
};
|