@luokuiai/lumen-ui 1.0.0-alpha.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.
Files changed (70) hide show
  1. package/dist/index.js +4572 -0
  2. package/dist/index.js.map +1 -0
  3. package/dist/lumen-ui.css +1 -0
  4. package/dist/theme-contract.js +74 -0
  5. package/dist/theme-contract.js.map +1 -0
  6. package/dist/types/components/Avatar.d.ts +14 -0
  7. package/dist/types/components/Avatar.d.ts.map +1 -0
  8. package/dist/types/components/Badge.d.ts +14 -0
  9. package/dist/types/components/Badge.d.ts.map +1 -0
  10. package/dist/types/components/Button.d.ts +11 -0
  11. package/dist/types/components/Button.d.ts.map +1 -0
  12. package/dist/types/components/Checkbox.d.ts +13 -0
  13. package/dist/types/components/Checkbox.d.ts.map +1 -0
  14. package/dist/types/components/ConfirmDialog.d.ts +19 -0
  15. package/dist/types/components/ConfirmDialog.d.ts.map +1 -0
  16. package/dist/types/components/DatePicker.d.ts +35 -0
  17. package/dist/types/components/DatePicker.d.ts.map +1 -0
  18. package/dist/types/components/DateTimePicker.d.ts +16 -0
  19. package/dist/types/components/DateTimePicker.d.ts.map +1 -0
  20. package/dist/types/components/Drawer.d.ts +17 -0
  21. package/dist/types/components/Drawer.d.ts.map +1 -0
  22. package/dist/types/components/DropdownMenu.d.ts +24 -0
  23. package/dist/types/components/DropdownMenu.d.ts.map +1 -0
  24. package/dist/types/components/FileUpload.d.ts +27 -0
  25. package/dist/types/components/FileUpload.d.ts.map +1 -0
  26. package/dist/types/components/FormField.d.ts +23 -0
  27. package/dist/types/components/FormField.d.ts.map +1 -0
  28. package/dist/types/components/Input.d.ts +11 -0
  29. package/dist/types/components/Input.d.ts.map +1 -0
  30. package/dist/types/components/Modal.d.ts +15 -0
  31. package/dist/types/components/Modal.d.ts.map +1 -0
  32. package/dist/types/components/Pagination.d.ts +18 -0
  33. package/dist/types/components/Pagination.d.ts.map +1 -0
  34. package/dist/types/components/Radio.d.ts +12 -0
  35. package/dist/types/components/Radio.d.ts.map +1 -0
  36. package/dist/types/components/SegmentedControl.d.ts +16 -0
  37. package/dist/types/components/SegmentedControl.d.ts.map +1 -0
  38. package/dist/types/components/Select.d.ts +87 -0
  39. package/dist/types/components/Select.d.ts.map +1 -0
  40. package/dist/types/components/Switch.d.ts +12 -0
  41. package/dist/types/components/Switch.d.ts.map +1 -0
  42. package/dist/types/components/Tabs.d.ts +23 -0
  43. package/dist/types/components/Tabs.d.ts.map +1 -0
  44. package/dist/types/components/Textarea.d.ts +10 -0
  45. package/dist/types/components/Textarea.d.ts.map +1 -0
  46. package/dist/types/components/TimePicker.d.ts +14 -0
  47. package/dist/types/components/TimePicker.d.ts.map +1 -0
  48. package/dist/types/components/TimeSelector.d.ts +18 -0
  49. package/dist/types/components/TimeSelector.d.ts.map +1 -0
  50. package/dist/types/components/Timeline.d.ts +23 -0
  51. package/dist/types/components/Timeline.d.ts.map +1 -0
  52. package/dist/types/components/Toast.d.ts +14 -0
  53. package/dist/types/components/Toast.d.ts.map +1 -0
  54. package/dist/types/components/Tooltip.d.ts +31 -0
  55. package/dist/types/components/Tooltip.d.ts.map +1 -0
  56. package/dist/types/components/TreeSelect.d.ts +30 -0
  57. package/dist/types/components/TreeSelect.d.ts.map +1 -0
  58. package/dist/types/components/classNames.d.ts +2 -0
  59. package/dist/types/components/classNames.d.ts.map +1 -0
  60. package/dist/types/components/designTokens.d.ts +165 -0
  61. package/dist/types/components/designTokens.d.ts.map +1 -0
  62. package/dist/types/components/dropdownMotion.d.ts +2 -0
  63. package/dist/types/components/dropdownMotion.d.ts.map +1 -0
  64. package/dist/types/components/tooltip-positions.d.ts +33 -0
  65. package/dist/types/components/tooltip-positions.d.ts.map +1 -0
  66. package/dist/types/index.d.ts +28 -0
  67. package/dist/types/index.d.ts.map +1 -0
  68. package/dist/types/theme-contract.d.ts +9 -0
  69. package/dist/types/theme-contract.d.ts.map +1 -0
  70. package/package.json +51 -0
package/dist/index.js ADDED
@@ -0,0 +1,4572 @@
1
+ import { lumenThemeAttributes as co, lumenThemeVariables as io } from "./theme-contract.js";
2
+ import Ge, { useState as R, useRef as re, useId as tr, useEffect as X, useCallback as S, useMemo as fe, useLayoutEffect as Er, cloneElement as lt } from "react";
3
+ import { User as at, Minus as ct, Check as Vr, Loader2 as it, Calendar as Gr, ChevronLeft as Pe, ChevronRight as Me, Clock as qr, LoaderCircle as jr, UploadCloud as Ar, FileText as ut, X as ir, ChevronDown as rr, Search as Kr, Circle as dt, AlertCircle as $r, Info as mt, CheckCircle2 as xt } from "lucide-react";
4
+ import { createPortal as Re } from "react-dom";
5
+ import { createRoot as ft } from "react-dom/client";
6
+ var ar = { exports: {} }, Je = {};
7
+ /**
8
+ * @license React
9
+ * react-jsx-runtime.production.js
10
+ *
11
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+ var Mr;
17
+ function pt() {
18
+ if (Mr) return Je;
19
+ Mr = 1;
20
+ var r = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
21
+ function o(n, l, s) {
22
+ var d = null;
23
+ if (s !== void 0 && (d = "" + s), l.key !== void 0 && (d = "" + l.key), "key" in l) {
24
+ s = {};
25
+ for (var f in l)
26
+ f !== "key" && (s[f] = l[f]);
27
+ } else s = l;
28
+ return l = s.ref, {
29
+ $$typeof: r,
30
+ type: n,
31
+ key: d,
32
+ ref: l !== void 0 ? l : null,
33
+ props: s
34
+ };
35
+ }
36
+ return Je.Fragment = t, Je.jsx = o, Je.jsxs = o, Je;
37
+ }
38
+ var Qe = {};
39
+ /**
40
+ * @license React
41
+ * react-jsx-runtime.development.js
42
+ *
43
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE file in the root directory of this source tree.
47
+ */
48
+ var Rr;
49
+ function ht() {
50
+ return Rr || (Rr = 1, process.env.NODE_ENV !== "production" && (function() {
51
+ function r(i) {
52
+ if (i == null) return null;
53
+ if (typeof i == "function")
54
+ return i.$$typeof === J ? null : i.displayName || i.name || null;
55
+ if (typeof i == "string") return i;
56
+ switch (i) {
57
+ case j:
58
+ return "Fragment";
59
+ case h:
60
+ return "Profiler";
61
+ case F:
62
+ return "StrictMode";
63
+ case V:
64
+ return "Suspense";
65
+ case W:
66
+ return "SuspenseList";
67
+ case w:
68
+ return "Activity";
69
+ }
70
+ if (typeof i == "object")
71
+ switch (typeof i.tag == "number" && console.error(
72
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
73
+ ), i.$$typeof) {
74
+ case D:
75
+ return "Portal";
76
+ case C:
77
+ return i.displayName || "Context";
78
+ case A:
79
+ return (i._context.displayName || "Context") + ".Consumer";
80
+ case $:
81
+ var T = i.render;
82
+ return i = i.displayName, i || (i = T.displayName || T.name || "", i = i !== "" ? "ForwardRef(" + i + ")" : "ForwardRef"), i;
83
+ case k:
84
+ return T = i.displayName || null, T !== null ? T : r(i.type) || "Memo";
85
+ case H:
86
+ T = i._payload, i = i._init;
87
+ try {
88
+ return r(i(T));
89
+ } catch {
90
+ }
91
+ }
92
+ return null;
93
+ }
94
+ function t(i) {
95
+ return "" + i;
96
+ }
97
+ function o(i) {
98
+ try {
99
+ t(i);
100
+ var T = !1;
101
+ } catch {
102
+ T = !0;
103
+ }
104
+ if (T) {
105
+ T = console;
106
+ var N = T.error, _ = typeof Symbol == "function" && Symbol.toStringTag && i[Symbol.toStringTag] || i.constructor.name || "Object";
107
+ return N.call(
108
+ T,
109
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
110
+ _
111
+ ), t(i);
112
+ }
113
+ }
114
+ function n(i) {
115
+ if (i === j) return "<>";
116
+ if (typeof i == "object" && i !== null && i.$$typeof === H)
117
+ return "<...>";
118
+ try {
119
+ var T = r(i);
120
+ return T ? "<" + T + ">" : "<...>";
121
+ } catch {
122
+ return "<...>";
123
+ }
124
+ }
125
+ function l() {
126
+ var i = Q.A;
127
+ return i === null ? null : i.getOwner();
128
+ }
129
+ function s() {
130
+ return Error("react-stack-top-frame");
131
+ }
132
+ function d(i) {
133
+ if (E.call(i, "key")) {
134
+ var T = Object.getOwnPropertyDescriptor(i, "key").get;
135
+ if (T && T.isReactWarning) return !1;
136
+ }
137
+ return i.key !== void 0;
138
+ }
139
+ function f(i, T) {
140
+ function N() {
141
+ z || (z = !0, console.error(
142
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
143
+ T
144
+ ));
145
+ }
146
+ N.isReactWarning = !0, Object.defineProperty(i, "key", {
147
+ get: N,
148
+ configurable: !0
149
+ });
150
+ }
151
+ function u() {
152
+ var i = r(this.type);
153
+ return K[i] || (K[i] = !0, console.error(
154
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
155
+ )), i = this.props.ref, i !== void 0 ? i : null;
156
+ }
157
+ function x(i, T, N, _, se, ae) {
158
+ var P = N.ref;
159
+ return i = {
160
+ $$typeof: I,
161
+ type: i,
162
+ key: T,
163
+ props: N,
164
+ _owner: _
165
+ }, (P !== void 0 ? P : null) !== null ? Object.defineProperty(i, "ref", {
166
+ enumerable: !1,
167
+ get: u
168
+ }) : Object.defineProperty(i, "ref", { enumerable: !1, value: null }), i._store = {}, Object.defineProperty(i._store, "validated", {
169
+ configurable: !1,
170
+ enumerable: !1,
171
+ writable: !0,
172
+ value: 0
173
+ }), Object.defineProperty(i, "_debugInfo", {
174
+ configurable: !1,
175
+ enumerable: !1,
176
+ writable: !0,
177
+ value: null
178
+ }), Object.defineProperty(i, "_debugStack", {
179
+ configurable: !1,
180
+ enumerable: !1,
181
+ writable: !0,
182
+ value: se
183
+ }), Object.defineProperty(i, "_debugTask", {
184
+ configurable: !1,
185
+ enumerable: !1,
186
+ writable: !0,
187
+ value: ae
188
+ }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
189
+ }
190
+ function c(i, T, N, _, se, ae) {
191
+ var P = T.children;
192
+ if (P !== void 0)
193
+ if (_)
194
+ if (M(P)) {
195
+ for (_ = 0; _ < P.length; _++)
196
+ a(P[_]);
197
+ Object.freeze && Object.freeze(P);
198
+ } else
199
+ console.error(
200
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
201
+ );
202
+ else a(P);
203
+ if (E.call(T, "key")) {
204
+ P = r(i);
205
+ var ie = Object.keys(T).filter(function(ee) {
206
+ return ee !== "key";
207
+ });
208
+ _ = 0 < ie.length ? "{key: someKey, " + ie.join(": ..., ") + ": ...}" : "{key: someKey}", oe[P + _] || (ie = 0 < ie.length ? "{" + ie.join(": ..., ") + ": ...}" : "{}", console.error(
209
+ `A props object containing a "key" prop is being spread into JSX:
210
+ let props = %s;
211
+ <%s {...props} />
212
+ React keys must be passed directly to JSX without using spread:
213
+ let props = %s;
214
+ <%s key={someKey} {...props} />`,
215
+ _,
216
+ P,
217
+ ie,
218
+ P
219
+ ), oe[P + _] = !0);
220
+ }
221
+ if (P = null, N !== void 0 && (o(N), P = "" + N), d(T) && (o(T.key), P = "" + T.key), "key" in T) {
222
+ N = {};
223
+ for (var Z in T)
224
+ Z !== "key" && (N[Z] = T[Z]);
225
+ } else N = T;
226
+ return P && f(
227
+ N,
228
+ typeof i == "function" ? i.displayName || i.name || "Unknown" : i
229
+ ), x(
230
+ i,
231
+ P,
232
+ N,
233
+ l(),
234
+ se,
235
+ ae
236
+ );
237
+ }
238
+ function a(i) {
239
+ m(i) ? i._store && (i._store.validated = 1) : typeof i == "object" && i !== null && i.$$typeof === H && (i._payload.status === "fulfilled" ? m(i._payload.value) && i._payload.value._store && (i._payload.value._store.validated = 1) : i._store && (i._store.validated = 1));
240
+ }
241
+ function m(i) {
242
+ return typeof i == "object" && i !== null && i.$$typeof === I;
243
+ }
244
+ var p = Ge, I = Symbol.for("react.transitional.element"), D = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), F = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), C = Symbol.for("react.context"), $ = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), W = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), H = Symbol.for("react.lazy"), w = Symbol.for("react.activity"), J = Symbol.for("react.client.reference"), Q = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, E = Object.prototype.hasOwnProperty, M = Array.isArray, Y = console.createTask ? console.createTask : function() {
245
+ return null;
246
+ };
247
+ p = {
248
+ react_stack_bottom_frame: function(i) {
249
+ return i();
250
+ }
251
+ };
252
+ var z, K = {}, U = p.react_stack_bottom_frame.bind(
253
+ p,
254
+ s
255
+ )(), le = Y(n(s)), oe = {};
256
+ Qe.Fragment = j, Qe.jsx = function(i, T, N) {
257
+ var _ = 1e4 > Q.recentlyCreatedOwnerStacks++;
258
+ return c(
259
+ i,
260
+ T,
261
+ N,
262
+ !1,
263
+ _ ? Error("react-stack-top-frame") : U,
264
+ _ ? Y(n(i)) : le
265
+ );
266
+ }, Qe.jsxs = function(i, T, N) {
267
+ var _ = 1e4 > Q.recentlyCreatedOwnerStacks++;
268
+ return c(
269
+ i,
270
+ T,
271
+ N,
272
+ !0,
273
+ _ ? Error("react-stack-top-frame") : U,
274
+ _ ? Y(n(i)) : le
275
+ );
276
+ };
277
+ })()), Qe;
278
+ }
279
+ var Ir;
280
+ function vt() {
281
+ return Ir || (Ir = 1, process.env.NODE_ENV === "production" ? ar.exports = pt() : ar.exports = ht()), ar.exports;
282
+ }
283
+ var e = vt();
284
+ const v = (...r) => r.filter(Boolean).join(" "), Se = {
285
+ control: "rounded-[var(--lumen-radius-control)]",
286
+ button: "rounded-[var(--lumen-radius-control)]",
287
+ icon: "rounded-[var(--lumen-radius-icon)]",
288
+ card: "rounded-[var(--lumen-radius-card)]"
289
+ }, bt = {
290
+ sm: "h-[var(--lumen-control-height-sm)] px-3 text-[12px]",
291
+ md: "h-[var(--lumen-control-height-md)] px-4 text-[13px]",
292
+ lg: "h-[var(--lumen-control-height-lg)] px-5 text-[14px]"
293
+ }, gt = {
294
+ sm: "h-8 w-8",
295
+ md: "h-9 w-9",
296
+ lg: "h-10 w-10"
297
+ }, wt = {
298
+ primary: "border border-transparent bg-[var(--lumen-color-primary)] text-[var(--lumen-color-on-primary)] shadow-sm shadow-[var(--lumen-color-primary)]/20 hover:bg-[var(--lumen-color-primary-hover)]",
299
+ secondary: "border border-transparent bg-[var(--lumen-color-primary-soft)] text-[var(--lumen-color-primary)] hover:bg-[var(--lumen-color-primary-soft-hover)]",
300
+ accent: "border border-[var(--lumen-color-info-border)] bg-[var(--lumen-color-primary-soft)] text-[var(--lumen-color-primary-hover)] hover:border-[var(--lumen-color-info-border)] hover:bg-[var(--lumen-color-primary-soft-hover)]",
301
+ outline: "border border-[var(--lumen-color-border-strong)] bg-[var(--lumen-color-surface)] text-[var(--lumen-color-text-secondary)] hover:border-[var(--lumen-color-info-border)] hover:bg-[var(--lumen-color-surface-hover)] hover:text-[var(--lumen-color-primary)]",
302
+ ghost: "border border-transparent bg-transparent text-[var(--lumen-color-text-muted)] hover:bg-[var(--lumen-color-surface-muted)] hover:text-[var(--lumen-color-text)]",
303
+ destructive: "border border-transparent bg-[var(--lumen-color-danger)] text-[var(--lumen-color-on-primary)] shadow-sm shadow-[var(--lumen-color-danger)]/20 hover:bg-[var(--lumen-color-danger-hover)]"
304
+ }, yt = "inline-flex shrink-0 items-center justify-center gap-1.5 font-medium transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--lumen-color-primary)]/20 disabled:cursor-not-allowed disabled:opacity-50", Ce = ({
305
+ variant: r = "primary",
306
+ size: t = "md",
307
+ iconOnly: o = !1,
308
+ className: n
309
+ }) => v(
310
+ yt,
311
+ Se.button,
312
+ wt[r],
313
+ o ? gt[t] : bt[t],
314
+ n
315
+ );
316
+ Ce({ variant: "ghost", size: "sm", iconOnly: !0 }), Ce({ variant: "ghost", size: "md", iconOnly: !0 }), Ce({ variant: "outline", size: "sm" }), Ce({ variant: "outline", size: "md" }), Ce({ variant: "secondary", size: "sm" }), Ce({ variant: "destructive", size: "sm" });
317
+ const jt = {
318
+ default: {
319
+ container: "bg-[var(--lumen-color-surface)] px-1",
320
+ base: "group relative inline-flex min-h-[44px] items-center justify-center gap-2 whitespace-nowrap px-3 py-3 text-[13px] font-medium transition-colors duration-200 after:absolute after:bottom-[-1px] after:left-2 after:right-2 after:h-[2px] after:origin-center after:scale-x-0 after:rounded-full after:bg-[var(--lumen-color-primary)] after:opacity-0 after:transition-all after:duration-150 after:ease-out",
321
+ active: "text-[var(--lumen-color-primary)] after:scale-x-100 after:opacity-100",
322
+ inactive: "text-[var(--lumen-color-text-muted)] hover:text-[var(--lumen-color-primary)]",
323
+ iconBase: "",
324
+ iconActive: "text-[var(--lumen-color-primary)]",
325
+ iconInactive: "text-[var(--lumen-color-text-placeholder)] group-hover:text-[var(--lumen-color-primary)]",
326
+ badgeBase: "inline-flex min-w-[24px] items-center justify-center rounded-full px-1.5 py-0.5 text-[11px] font-semibold transition-all",
327
+ badgeActive: "bg-[var(--lumen-color-primary-soft-hover)] text-[var(--lumen-color-primary)]",
328
+ badgeInactive: "bg-[var(--lumen-color-surface-muted)] text-[var(--lumen-color-text-muted)]"
329
+ },
330
+ pill: {
331
+ container: "rounded-[16px] border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface-subtle)] px-5 py-4 shadow-[0_6px_18px_var(--lumen-color-shadow)]",
332
+ base: "group inline-flex items-center gap-2 rounded-full border px-4 py-2 text-[13px] transition-all",
333
+ active: "border-[var(--lumen-color-primary)] bg-[var(--lumen-color-primary-soft)] text-[var(--lumen-color-primary)]",
334
+ inactive: "border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] text-[var(--lumen-color-text-muted)] hover:border-[var(--lumen-color-border-hover)] hover:text-[var(--lumen-color-primary)]",
335
+ iconBase: "",
336
+ iconActive: "",
337
+ iconInactive: "",
338
+ badgeBase: "inline-flex min-w-[28px] items-center justify-center rounded-full px-2 py-0.5 text-[11px] font-semibold transition-all",
339
+ badgeActive: "bg-[var(--lumen-color-surface)] text-[var(--lumen-color-primary)]",
340
+ badgeInactive: "bg-[var(--lumen-color-surface-muted)] text-[var(--lumen-color-text-muted)]"
341
+ },
342
+ card: {
343
+ container: "rounded-[12px] border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] px-4 py-4 shadow-sm",
344
+ base: "group inline-flex min-h-[46px] items-center gap-2.5 rounded-[8px] border px-4 py-2 text-[14px] font-medium tracking-[0.01em] transition-all duration-200",
345
+ active: "border-[var(--lumen-color-info-border)] bg-[linear-gradient(180deg,var(--lumen-color-info-soft)_0%,var(--lumen-color-surface)_100%)] text-[var(--lumen-color-primary-active)] shadow-[0_8px_18px_var(--lumen-color-focus-ring)]",
346
+ inactive: "border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface-subtle)] text-[var(--lumen-color-text-muted)] hover:border-[var(--lumen-color-info-border)] hover:bg-[var(--lumen-color-surface)] hover:text-[var(--lumen-color-primary-active)]",
347
+ iconBase: "inline-flex h-7 w-7 items-center justify-center rounded-[6px] border transition-colors duration-200",
348
+ iconActive: "border-[var(--lumen-color-info-border)] bg-[var(--lumen-color-primary-soft-hover)] text-[var(--lumen-color-primary)]",
349
+ iconInactive: "border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] text-[var(--lumen-color-text-placeholder)] group-hover:border-[var(--lumen-color-info-border)] group-hover:text-[var(--lumen-color-primary)]",
350
+ badgeBase: "inline-flex min-w-[30px] items-center justify-center rounded-[6px] px-2 py-0.5 text-[12px] font-semibold transition-all duration-200",
351
+ badgeActive: "bg-[var(--lumen-color-primary)] text-[var(--lumen-color-on-primary)] shadow-[0_6px_12px_var(--lumen-color-focus-ring)]",
352
+ badgeInactive: "bg-[var(--lumen-color-surface-muted)] text-[var(--lumen-color-text-muted)]"
353
+ }
354
+ }, Nt = {
355
+ sm: "h-8 w-8 text-[11px]",
356
+ md: "h-10 w-10 text-[13px]",
357
+ lg: "h-12 w-12 text-[16px]"
358
+ }, kt = {
359
+ sm: 14,
360
+ md: 17,
361
+ lg: 20
362
+ }, Et = (r) => {
363
+ const t = r.trim().split(/\s+/).filter(Boolean);
364
+ return t.length === 0 ? "" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : `${t[0][0]}${t.at(-1)[0]}`.toUpperCase();
365
+ }, Tt = Ge.forwardRef(
366
+ ({
367
+ src: r,
368
+ alt: t,
369
+ name: o,
370
+ fallback: n,
371
+ size: l = "md",
372
+ shape: s = "circle",
373
+ imageProps: d,
374
+ className: f,
375
+ role: u = "img",
376
+ "aria-label": x,
377
+ ...c
378
+ }, a) => {
379
+ const [m, p] = R(null), I = !!(r && m !== r), {
380
+ className: D,
381
+ onError: j,
382
+ ...F
383
+ } = d ?? {}, h = o ? Et(o) : "";
384
+ return /* @__PURE__ */ e.jsx(
385
+ "span",
386
+ {
387
+ ref: a,
388
+ role: u,
389
+ "aria-label": x ?? t ?? o ?? "Avatar",
390
+ className: v(
391
+ "relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface-muted)] font-medium text-[var(--lumen-color-text-muted)]",
392
+ Nt[l],
393
+ s === "circle" ? "rounded-full" : Se.icon,
394
+ f
395
+ ),
396
+ ...c,
397
+ children: I ? /* @__PURE__ */ e.jsx(
398
+ "img",
399
+ {
400
+ ...F,
401
+ src: r,
402
+ alt: "",
403
+ "aria-hidden": "true",
404
+ draggable: !1,
405
+ className: v("h-full w-full object-cover", D),
406
+ onError: (A) => {
407
+ p(r ?? null), j == null || j(A);
408
+ }
409
+ }
410
+ ) : n ?? (h || /* @__PURE__ */ e.jsx(at, { size: kt[l], "aria-hidden": "true" }))
411
+ }
412
+ );
413
+ }
414
+ );
415
+ Tt.displayName = "Avatar";
416
+ const _t = {
417
+ sm: "px-2 py-0.5 text-[11px]",
418
+ md: "px-2.5 py-1 text-[12px]",
419
+ lg: "px-3 py-1.5 text-[13px]"
420
+ }, St = {
421
+ pill: "rounded-full",
422
+ square: "rounded-[4px]"
423
+ };
424
+ function Yn({
425
+ children: r,
426
+ variant: t = "default",
427
+ size: o = "md",
428
+ shape: n = "pill",
429
+ className: l
430
+ }) {
431
+ return /* @__PURE__ */ e.jsx(
432
+ "span",
433
+ {
434
+ className: v(
435
+ "app-badge inline-flex items-center whitespace-nowrap",
436
+ _t[o],
437
+ St[n],
438
+ t === "outline" && "border",
439
+ l
440
+ ),
441
+ children: r
442
+ }
443
+ );
444
+ }
445
+ const Be = ({
446
+ children: r,
447
+ variant: t = "primary",
448
+ size: o = "md",
449
+ icon: n,
450
+ iconOnly: l = !1,
451
+ className: s = "",
452
+ ...d
453
+ }) => /* @__PURE__ */ e.jsxs(
454
+ "button",
455
+ {
456
+ className: Ce({ variant: t, size: o, iconOnly: l, className: s }),
457
+ ...d,
458
+ children: [
459
+ n && /* @__PURE__ */ e.jsx("span", { className: "shrink-0", children: n }),
460
+ !l && r
461
+ ]
462
+ }
463
+ ), Bn = ({
464
+ size: r = "sm",
465
+ checked: t,
466
+ defaultChecked: o = !1,
467
+ disabled: n = !1,
468
+ indeterminate: l = !1,
469
+ label: s,
470
+ description: d,
471
+ onChange: f,
472
+ className: u,
473
+ id: x,
474
+ ...c
475
+ }) => {
476
+ const a = re(null), m = tr(), p = x ?? m, I = `${p}-label`, D = `${p}-description`, j = typeof t == "boolean", [F, h] = R(o), A = j ? t : F, C = r === "sm", $ = !!d, V = c["aria-label"];
477
+ X(() => {
478
+ a.current && (a.current.indeterminate = l);
479
+ }, [l, A]);
480
+ const W = (H) => {
481
+ if (n) return;
482
+ const w = H.target.checked;
483
+ j || h(w), f == null || f(w);
484
+ }, k = l || A;
485
+ return /* @__PURE__ */ e.jsxs(
486
+ "label",
487
+ {
488
+ htmlFor: p,
489
+ className: v(
490
+ "inline-flex gap-3",
491
+ $ ? "items-start" : "items-center",
492
+ C && "gap-2",
493
+ n ? "cursor-not-allowed opacity-55" : "cursor-pointer",
494
+ u
495
+ ),
496
+ children: [
497
+ /* @__PURE__ */ e.jsxs(
498
+ "span",
499
+ {
500
+ className: v(
501
+ "relative inline-flex shrink-0 items-center justify-center",
502
+ $ && "mt-0.5",
503
+ C ? "h-4 w-4" : "h-5 w-5"
504
+ ),
505
+ children: [
506
+ /* @__PURE__ */ e.jsx(
507
+ "input",
508
+ {
509
+ ...c,
510
+ ref: a,
511
+ id: p,
512
+ type: "checkbox",
513
+ checked: A,
514
+ disabled: n,
515
+ "aria-labelledby": !V && s ? I : void 0,
516
+ "aria-describedby": d ? D : void 0,
517
+ "aria-label": V ?? (typeof s == "string" ? s : void 0),
518
+ "aria-checked": l ? "mixed" : A,
519
+ className: "peer sr-only",
520
+ onChange: W
521
+ }
522
+ ),
523
+ /* @__PURE__ */ e.jsx(
524
+ "span",
525
+ {
526
+ "aria-hidden": "true",
527
+ className: v(
528
+ "flex items-center justify-center border transition-all",
529
+ C ? "h-4 w-4 rounded-[4px]" : "h-5 w-5 rounded-[5px]",
530
+ k ? "border-[var(--lumen-color-primary)] bg-[var(--lumen-color-primary)] text-[var(--lumen-color-on-primary)] shadow-[0_8px_18px_var(--lumen-color-focus-ring)]" : "border-[var(--lumen-color-border-hover)] bg-[var(--lumen-color-surface)] text-transparent",
531
+ !n && "peer-focus-visible:ring-2 peer-focus-visible:ring-[var(--lumen-color-info-border)]/70 peer-focus-visible:ring-offset-2",
532
+ !n && !k && "hover:border-[var(--lumen-color-info-border)] hover:bg-[var(--lumen-color-surface-hover)]"
533
+ ),
534
+ children: l ? /* @__PURE__ */ e.jsx(ct, { size: C ? 11 : 13, strokeWidth: 3 }) : /* @__PURE__ */ e.jsx(Vr, { size: C ? 11 : 13, strokeWidth: 3 })
535
+ }
536
+ )
537
+ ]
538
+ }
539
+ ),
540
+ (s || d) && /* @__PURE__ */ e.jsxs("span", { className: "min-w-0", children: [
541
+ s ? /* @__PURE__ */ e.jsx(
542
+ "span",
543
+ {
544
+ id: I,
545
+ className: v(
546
+ "block font-normal",
547
+ k ? "text-[var(--lumen-color-text)]" : "text-[var(--lumen-color-text-muted)]",
548
+ "text-[13px] leading-5"
549
+ ),
550
+ children: s
551
+ }
552
+ ) : null,
553
+ d ? /* @__PURE__ */ e.jsx(
554
+ "span",
555
+ {
556
+ id: D,
557
+ className: v(
558
+ "mt-0.5 block text-[var(--lumen-color-text-muted)]",
559
+ C ? "text-[11px] leading-4.5" : "text-[12px] leading-5"
560
+ ),
561
+ children: d
562
+ }
563
+ ) : null
564
+ ] })
565
+ ]
566
+ }
567
+ );
568
+ }, At = "fixed inset-0 z-[100] flex items-center justify-center overflow-y-auto overscroll-contain bg-[var(--lumen-color-overlay)] p-3 backdrop-blur-sm mobile:items-end pad:p-4 l:p-5 xl:p-6", $t = ({
569
+ open: r,
570
+ onRequestClose: t,
571
+ onExited: o,
572
+ children: n,
573
+ modalId: l,
574
+ overlayId: s,
575
+ overlayClassName: d = "",
576
+ panelClassName: f = "",
577
+ closeOnOverlayClick: u = !0
578
+ }) => {
579
+ const [x, c] = R(r), [a, m] = R(!1), [p, I] = R(n), D = a || x && !r;
580
+ X(() => {
581
+ r ? (c(!0), m(!1), I(n)) : x && m(!0);
582
+ }, [n, x, r]), X(() => {
583
+ r && n != null && I(n);
584
+ }, [n, r]);
585
+ const j = S(
586
+ (h) => {
587
+ h.target !== h.currentTarget || !a || (c(!1), m(!1), I(null), o == null || o());
588
+ },
589
+ [a, o]
590
+ );
591
+ if (!x || typeof document > "u") return null;
592
+ const F = D ? p : n;
593
+ return Re(
594
+ /* @__PURE__ */ e.jsx(
595
+ "div",
596
+ {
597
+ "data-modal-overlay": s || l,
598
+ "data-lumen-motion": !0,
599
+ className: `${At} ${D ? "animate-[lumen-page-fade-out_150ms_ease-in_forwards]" : "animate-[lumen-page-fade-in_200ms_ease-out]"} ${d}`.trim(),
600
+ onClick: u ? t : void 0,
601
+ onAnimationEnd: j,
602
+ children: /* @__PURE__ */ e.jsx(
603
+ "div",
604
+ {
605
+ "data-modal": l,
606
+ "data-lumen-motion": !0,
607
+ className: `max-h-[calc(100dvh-1.5rem)] max-w-full ${D ? "animate-[lumen-modal-out_150ms_ease-in_forwards]" : "animate-[lumen-modal-in_200ms_ease-out]"} ${f}`.trim(),
608
+ onClick: (h) => h.stopPropagation(),
609
+ children: F
610
+ }
611
+ )
612
+ }
613
+ ),
614
+ document.body
615
+ );
616
+ }, Un = ({
617
+ open: r,
618
+ title: t,
619
+ message: o,
620
+ confirmText: n = "确认",
621
+ confirmVariant: l = "primary",
622
+ cancelText: s = "取消",
623
+ confirmDisabled: d = !1,
624
+ confirmLoading: f = !1,
625
+ cancelDisabled: u = !1,
626
+ closeOnOverlayClick: x = !0,
627
+ onConfirm: c,
628
+ onCancel: a
629
+ }) => /* @__PURE__ */ e.jsx(
630
+ $t,
631
+ {
632
+ open: r,
633
+ onRequestClose: a,
634
+ modalId: "confirm-dialog",
635
+ overlayId: "confirm-dialog-overlay",
636
+ closeOnOverlayClick: x,
637
+ panelClassName: "w-full max-w-[420px] rounded-[12px] border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] p-4 shadow-[0_24px_70px_var(--lumen-color-shadow)] pad:p-5 l:p-6",
638
+ children: /* @__PURE__ */ e.jsxs("div", { role: "dialog", "aria-label": t, children: [
639
+ /* @__PURE__ */ e.jsx("div", { className: "text-[18px] font-semibold text-[var(--lumen-color-text)]", children: t }),
640
+ /* @__PURE__ */ e.jsx("div", { className: "mt-3 text-[14px] leading-6 text-[var(--lumen-color-text-secondary)]", children: o }),
641
+ /* @__PURE__ */ e.jsxs("div", { className: "mt-5 flex flex-col-reverse gap-2.5 pad:mt-6 pad:flex-row pad:items-center pad:justify-end", children: [
642
+ /* @__PURE__ */ e.jsx(
643
+ Be,
644
+ {
645
+ disabled: u,
646
+ variant: "outline",
647
+ type: "button",
648
+ onClick: a,
649
+ children: s
650
+ }
651
+ ),
652
+ /* @__PURE__ */ e.jsxs(
653
+ Be,
654
+ {
655
+ "aria-busy": f,
656
+ disabled: d || f,
657
+ type: "button",
658
+ variant: l,
659
+ onClick: c,
660
+ children: [
661
+ f && /* @__PURE__ */ e.jsx(it, { "aria-hidden": "true", className: "animate-spin", size: 14 }),
662
+ n
663
+ ]
664
+ }
665
+ )
666
+ ] })
667
+ ] })
668
+ }
669
+ ), Mt = ["日", "一", "二", "三", "四", "五", "六"], Nr = [
670
+ "1月",
671
+ "2月",
672
+ "3月",
673
+ "4月",
674
+ "5月",
675
+ "6月",
676
+ "7月",
677
+ "8月",
678
+ "9月",
679
+ "10月",
680
+ "11月",
681
+ "12月"
682
+ ], Ie = 20, Rt = 2, It = 1, Dt = 320, Le = 8, Ae = (r) => String(r).padStart(2, "0"), fr = (r, t) => new Date(r, t + 1, 0).getDate(), zt = (r, t) => new Date(r, t, 1).getDay(), Ct = (r, t, o) => {
683
+ if (!r) return "";
684
+ const n = r.split("-").map(Number);
685
+ return o ? o.replace("YYYY", String(n[0])).replace("MM", String(n[1]).padStart(2, "0")).replace("M", String(n[1])).replace("DD", n[2] ? String(n[2]).padStart(2, "0") : "").replace("D", n[2] ? String(n[2]) : "") : t === "year-month" ? `${n[0]}年${n[1]}月` : `${n[0]}年${n[1]}月${n[2]}日`;
686
+ }, Dr = (r) => {
687
+ if (!r) return null;
688
+ const t = r.split("-").map(Number), o = t[0], n = t[1];
689
+ return o === void 0 || n === void 0 ? null : {
690
+ year: o,
691
+ month: n - 1,
692
+ day: t[2] ?? null
693
+ };
694
+ }, zr = (r, t) => r < t ? -1 : r > t ? 1 : 0, Fe = (r) => Math.floor(r / Ie) * Ie, Pt = {
695
+ sm: {
696
+ trigger: "h-[32px] px-2.5 text-[12px]",
697
+ cell: "h-8 w-8 text-[12px]",
698
+ header: "text-[13px]",
699
+ footer: "text-[12px]",
700
+ dropdown: "p-3",
701
+ icon: 14
702
+ },
703
+ md: {
704
+ trigger: "h-[36px] px-3 text-[13px]",
705
+ cell: "h-9 w-9 text-[13px]",
706
+ header: "text-[15px]",
707
+ footer: "text-[13px]",
708
+ dropdown: "p-4",
709
+ icon: 16
710
+ },
711
+ lg: {
712
+ trigger: "h-[40px] px-3.5 text-[14px]",
713
+ cell: "h-10 w-10 text-[14px]",
714
+ header: "text-[16px]",
715
+ footer: "text-[14px]",
716
+ dropdown: "p-5",
717
+ icon: 18
718
+ }
719
+ }, Vn = ({
720
+ value: r,
721
+ onChange: t,
722
+ placeholder: o = "请选择日期",
723
+ triggerAriaLabel: n,
724
+ className: l,
725
+ mode: s = "year-month-day",
726
+ size: d = "md",
727
+ disabled: f = !1,
728
+ clearable: u = !0,
729
+ showToday: x = !0,
730
+ format: c,
731
+ minDate: a,
732
+ maxDate: m
733
+ }) => {
734
+ const [p, I] = R(!1), [D, j] = R(!1), F = re(null), h = re(null), A = Pt[d], [C, $] = R(
735
+ null
736
+ ), [V, W] = R(!1), [k, H] = R(!1), [w, J] = R(0), [Q, E] = R("day"), [M, Y] = R(0), [z, K] = R({
737
+ position: "fixed",
738
+ zIndex: 9999
739
+ }), [U, le] = R("down"), oe = re(null), i = re(null), T = S(() => {
740
+ var Sr;
741
+ if (!oe.current) return;
742
+ const y = oe.current.getBoundingClientRect(), pe = window.innerWidth, be = Math.min(
743
+ Dt,
744
+ Math.max(0, pe - Le * 2)
745
+ ), Te = s === "year-month-day" ? 392 : 304, ze = ((Sr = i.current) == null ? void 0 : Sr.offsetHeight) || Te, we = 6, Oe = window.innerHeight - y.bottom < ze, xr = Oe ? Math.max(Le, y.top - ze - we) : y.bottom + we, nt = y.left + be > pe - Le ? y.right - be : y.left, ot = Math.max(
746
+ Le,
747
+ pe - be - Le
748
+ ), st = Math.min(
749
+ Math.max(Le, nt),
750
+ ot
751
+ );
752
+ le(Oe ? "up" : "down"), K({
753
+ position: "fixed",
754
+ left: st,
755
+ top: xr,
756
+ width: be,
757
+ zIndex: 9999
758
+ });
759
+ }, [s]), N = fe(() => Dr(r), [r]), _ = fe(() => {
760
+ const y = /* @__PURE__ */ new Date();
761
+ return { year: y.getFullYear(), month: y.getMonth(), day: y.getDate() };
762
+ }, []), se = fe(() => `${_.year}-${Ae(_.month + 1)}-${Ae(_.day)}`, [_]), ae = fe(
763
+ () => Fe(_.year),
764
+ [_.year]
765
+ ), P = fe(
766
+ () => ae - Ie * Rt,
767
+ [ae]
768
+ ), ie = fe(
769
+ () => ae + Ie * It,
770
+ [ae]
771
+ ), Z = fe(() => a ? Math.min(
772
+ P,
773
+ Fe(Number(a.substring(0, 4)))
774
+ ) : P, [P, a]), ee = fe(() => m ? Math.max(
775
+ ie,
776
+ Fe(Number(m.substring(0, 4)))
777
+ ) : ie, [ie, m]), [ce, de] = R((N == null ? void 0 : N.year) ?? _.year), [te, ve] = R((N == null ? void 0 : N.month) ?? _.month);
778
+ X(() => {
779
+ N && (de(N.year), ve(N.month));
780
+ }, [N]);
781
+ const je = S(() => {
782
+ h.current && clearTimeout(h.current), j(!0), h.current = setTimeout(() => {
783
+ I(!1), j(!1);
784
+ }, 120);
785
+ }, []), ye = S(() => {
786
+ h.current && clearTimeout(h.current), I(!1), j(!1);
787
+ }, []);
788
+ X(() => {
789
+ if (p) {
790
+ E("day"), H(!1), N ? (de(N.year), ve(N.month)) : (de(_.year), ve(_.month));
791
+ const y = Fe(
792
+ (N == null ? void 0 : N.year) ?? _.year
793
+ );
794
+ Y(y), J(y), T();
795
+ }
796
+ }, [p]), X(() => {
797
+ if (p)
798
+ return T(), window.addEventListener("scroll", T, !0), window.addEventListener("resize", T), () => {
799
+ window.removeEventListener("scroll", T, !0), window.removeEventListener("resize", T);
800
+ };
801
+ }, [p, T]), X(() => {
802
+ if (!p) return;
803
+ const y = window.requestAnimationFrame(() => {
804
+ T();
805
+ });
806
+ if (!i.current || typeof ResizeObserver > "u")
807
+ return () => {
808
+ window.cancelAnimationFrame(y);
809
+ };
810
+ const pe = new ResizeObserver(() => {
811
+ T();
812
+ });
813
+ return pe.observe(i.current), () => {
814
+ window.cancelAnimationFrame(y), pe.disconnect();
815
+ };
816
+ }, [p, T, Q, k]), X(() => () => {
817
+ h.current && clearTimeout(h.current);
818
+ }, []), X(() => {
819
+ if (!p) return;
820
+ const y = (pe) => {
821
+ var ze;
822
+ const be = pe.target;
823
+ if ((ze = F.current) != null && ze.contains(be)) return;
824
+ const Te = document.querySelector("[data-date-picker-portal]");
825
+ Te != null && Te.contains(be) || je();
826
+ };
827
+ return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
828
+ }, [p, je]);
829
+ const L = S(
830
+ (y) => {
831
+ if (!a && !m) return !1;
832
+ const pe = y.length > 7 ? y : y + "-01", be = a ? a.length === 7 ? a + "-01" : a : null, Te = m ? m.length === 7 ? m + "-31" : m : null;
833
+ return !!(be && pe < be || Te && pe > Te);
834
+ },
835
+ [a, m]
836
+ ), me = S(
837
+ (y, pe) => {
838
+ const be = `${y}-${Ae(pe + 1)}`;
839
+ return !!(a && be < a.substring(0, 7) || m && be > m.substring(0, 7));
840
+ },
841
+ [a, m]
842
+ ), q = S(
843
+ (y) => !!(a && y < Number(a.substring(0, 4)) || m && y > Number(m.substring(0, 4))),
844
+ [a, m]
845
+ ), g = S((y) => {
846
+ $(y), W(!0);
847
+ }, []), G = S(() => {
848
+ $(null), W(!1);
849
+ }, []), ne = fe(() => {
850
+ if (!a) return !0;
851
+ const y = te === 0 ? 11 : te - 1, pe = te === 0 ? ce - 1 : ce;
852
+ return !me(pe, y) || zr(
853
+ `${pe}-${Ae(y + 1)}`,
854
+ a.substring(0, 7)
855
+ ) >= 0;
856
+ }, [ce, te, a, me]), he = fe(() => {
857
+ if (!m) return !0;
858
+ const y = te === 11 ? 0 : te + 1, pe = te === 11 ? ce + 1 : ce;
859
+ return !me(pe, y) || zr(
860
+ `${pe}-${Ae(y + 1)}`,
861
+ m.substring(0, 7)
862
+ ) <= 0;
863
+ }, [ce, te, m, me]), Ne = w > Z, ke = w < ee, Ee = M > Z, b = M < ee, O = S(() => {
864
+ V || (te === 0 ? (ve(11), de((y) => y - 1)) : ve((y) => y - 1), g("right"));
865
+ }, [te, V, g]), B = S(() => {
866
+ V || (te === 11 ? (ve(0), de((y) => y + 1)) : ve((y) => y + 1), g("left"));
867
+ }, [te, V, g]), xe = S(() => {
868
+ de((y) => y - 1), g("right");
869
+ }, [g]), ue = S(() => {
870
+ de((y) => y + 1), g("left");
871
+ }, [g]), nr = S(() => {
872
+ J(
873
+ (y) => Math.max(Z, y - Ie)
874
+ );
875
+ }, [Z]), or = S(() => {
876
+ J(
877
+ (y) => Math.min(ee, y + Ie)
878
+ );
879
+ }, [ee]), ur = S(() => {
880
+ Y(
881
+ (y) => Math.max(Z, y - Ie)
882
+ );
883
+ }, [Z]), sr = S(() => {
884
+ Y(
885
+ (y) => Math.min(ee, y + Ie)
886
+ );
887
+ }, [ee]), De = S(
888
+ (y) => {
889
+ L(y) || (t(y), ye());
890
+ },
891
+ [t, L, ye]
892
+ ), qe = S(
893
+ (y, pe) => {
894
+ const be = `${y}-${Ae(pe + 1)}`;
895
+ a && be < a.substring(0, 7) || m && be > m.substring(0, 7) || (t(be), ye());
896
+ },
897
+ [t, a, m, ye]
898
+ ), dr = S(
899
+ (y) => {
900
+ q(y) || (de(y), J(Fe(y)), H(!1));
901
+ },
902
+ [q]
903
+ ), mr = S(
904
+ (y) => {
905
+ q(y) || (de(y), Y(Fe(y)), E("month"));
906
+ },
907
+ [q]
908
+ ), lr = S((y) => {
909
+ ve(y), E("day");
910
+ }, []), Ke = fe(() => Ct(r, s, c), [r, s, c]), rt = fe(() => {
911
+ const y = fr(ce, te), pe = zt(ce, te), be = te === 0 ? fr(ce - 1, 11) : fr(ce, te - 1), Te = [];
912
+ for (let we = pe - 1; we >= 0; we--) {
913
+ const Xe = be - we, Oe = te === 0 ? 11 : te - 1, xr = te === 0 ? ce - 1 : ce;
914
+ Te.push({
915
+ day: Xe,
916
+ current: !1,
917
+ dateStr: `${xr}-${Ae(Oe + 1)}-${Ae(Xe)}`
918
+ });
919
+ }
920
+ for (let we = 1; we <= y; we++)
921
+ Te.push({
922
+ day: we,
923
+ current: !0,
924
+ dateStr: `${ce}-${Ae(te + 1)}-${Ae(we)}`
925
+ });
926
+ const ze = 42 - Te.length;
927
+ for (let we = 1; we <= ze; we++) {
928
+ const Xe = te === 11 ? 0 : te + 1, Oe = te === 11 ? ce + 1 : ce;
929
+ Te.push({
930
+ day: we,
931
+ current: !1,
932
+ dateStr: `${Oe}-${Ae(Xe + 1)}-${Ae(we)}`
933
+ });
934
+ }
935
+ return Te;
936
+ }, [ce, te]), tt = fe(() => {
937
+ if (s !== "year-month" || !r) return null;
938
+ const y = Dr(r);
939
+ return y ? { year: y.year, month: y.month } : null;
940
+ }, [r, s]);
941
+ return /* @__PURE__ */ e.jsxs("div", { ref: F, className: v("relative", l), children: [
942
+ /* @__PURE__ */ e.jsxs(
943
+ "button",
944
+ {
945
+ ref: oe,
946
+ type: "button",
947
+ "aria-label": n,
948
+ disabled: f,
949
+ onClick: () => {
950
+ f || (p ? je() : (I(!0), j(!1)));
951
+ },
952
+ className: v(
953
+ `flex w-full items-center border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] outline-none transition-all ${Se.control}`,
954
+ "hover:border-[var(--lumen-color-border-hover)] focus:border-[var(--lumen-color-primary)]",
955
+ p && !D && "border-[var(--lumen-color-primary)] ring-1 ring-[var(--lumen-color-primary)]/10",
956
+ A.trigger,
957
+ f && "cursor-not-allowed opacity-50"
958
+ ),
959
+ children: [
960
+ Ke ? /* @__PURE__ */ e.jsx("span", { className: "text-[var(--lumen-color-text)]", children: Ke }) : /* @__PURE__ */ e.jsx("span", { className: "text-[var(--lumen-color-text-placeholder)]", children: o }),
961
+ /* @__PURE__ */ e.jsx(
962
+ Gr,
963
+ {
964
+ size: A.icon,
965
+ className: "ml-auto shrink-0 text-[var(--lumen-color-text-placeholder)]"
966
+ }
967
+ )
968
+ ]
969
+ }
970
+ ),
971
+ p && Re(
972
+ /* @__PURE__ */ e.jsx(
973
+ "div",
974
+ {
975
+ ref: i,
976
+ "data-date-picker-portal": !0,
977
+ className: "rounded-[12px] border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] shadow-xl",
978
+ style: {
979
+ ...z,
980
+ animation: D ? U === "up" ? "lumen-dropdown-out-up 0.12s ease-in forwards" : "lumen-dropdown-out 0.12s ease-in forwards" : U === "up" ? "lumen-dropdown-in-up 0.12s ease-out" : "lumen-dropdown-in 0.12s ease-out",
981
+ transformOrigin: U === "up" ? "bottom" : "top"
982
+ },
983
+ children: s === "year-month-day" ? /* @__PURE__ */ e.jsx(
984
+ Ot,
985
+ {
986
+ tokens: A,
987
+ viewYear: ce,
988
+ viewMonth: te,
989
+ days: rt,
990
+ value: r,
991
+ todayStr: se,
992
+ todayDate: _,
993
+ slideDirection: C,
994
+ dayView: Q,
995
+ dayYearPickerStart: M,
996
+ canGoPrevDayYearRange: Ee,
997
+ canGoNextDayYearRange: b,
998
+ selectDate: De,
999
+ prevDayYearRange: ur,
1000
+ nextDayYearRange: sr,
1001
+ prevMonth: O,
1002
+ nextMonth: B,
1003
+ onAnimationEnd: G,
1004
+ showToday: x,
1005
+ clearable: u,
1006
+ onClear: () => {
1007
+ t(""), je();
1008
+ },
1009
+ onSelectToday: () => De(se),
1010
+ isDateDisabled: L,
1011
+ canGoPrevMonth: ne,
1012
+ canGoNextMonth: he,
1013
+ setDayView: E,
1014
+ selectYearInDayMode: mr,
1015
+ selectMonthInDayMode: lr,
1016
+ prevYear: xe,
1017
+ nextYear: ue,
1018
+ isYearDisabled: q,
1019
+ isMonthDisabled: me
1020
+ }
1021
+ ) : /* @__PURE__ */ e.jsx(
1022
+ Lt,
1023
+ {
1024
+ tokens: A,
1025
+ viewYear: ce,
1026
+ showYearPicker: k,
1027
+ yearPickerStart: w,
1028
+ canGoPrevYearRange: Ne,
1029
+ canGoNextYearRange: ke,
1030
+ selectedMonth: tt,
1031
+ todayDate: _,
1032
+ slideDirection: C,
1033
+ selectMonth: qe,
1034
+ selectYear: dr,
1035
+ prevYear: xe,
1036
+ nextYear: ue,
1037
+ prevYearRange: nr,
1038
+ nextYearRange: or,
1039
+ setShowYearPicker: H,
1040
+ onAnimationEnd: G,
1041
+ showToday: x,
1042
+ clearable: u,
1043
+ onClear: () => {
1044
+ t(""), je();
1045
+ },
1046
+ onSelectToday: () => qe(_.year, _.month),
1047
+ isMonthDisabled: me,
1048
+ isYearDisabled: q
1049
+ }
1050
+ )
1051
+ }
1052
+ ),
1053
+ document.body
1054
+ )
1055
+ ] });
1056
+ }, Ot = ({
1057
+ tokens: r,
1058
+ viewYear: t,
1059
+ viewMonth: o,
1060
+ days: n,
1061
+ value: l,
1062
+ todayStr: s,
1063
+ todayDate: d,
1064
+ slideDirection: f,
1065
+ dayView: u,
1066
+ dayYearPickerStart: x,
1067
+ canGoPrevDayYearRange: c,
1068
+ canGoNextDayYearRange: a,
1069
+ selectDate: m,
1070
+ prevDayYearRange: p,
1071
+ nextDayYearRange: I,
1072
+ prevMonth: D,
1073
+ nextMonth: j,
1074
+ onAnimationEnd: F,
1075
+ showToday: h,
1076
+ clearable: A,
1077
+ onClear: C,
1078
+ onSelectToday: $,
1079
+ isDateDisabled: V,
1080
+ canGoPrevMonth: W,
1081
+ canGoNextMonth: k,
1082
+ setDayView: H,
1083
+ selectYearInDayMode: w,
1084
+ selectMonthInDayMode: J,
1085
+ prevYear: Q,
1086
+ nextYear: E,
1087
+ isYearDisabled: M,
1088
+ isMonthDisabled: Y
1089
+ }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1090
+ /* @__PURE__ */ e.jsx("div", { className: v(r.dropdown, "pb-0"), children: u === "year" ? (
1091
+ /* ─── 年份选择器 ────────────────────────── */
1092
+ /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1093
+ /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
1094
+ /* @__PURE__ */ e.jsx(
1095
+ "button",
1096
+ {
1097
+ type: "button",
1098
+ disabled: !c,
1099
+ onClick: p,
1100
+ className: v(
1101
+ "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors",
1102
+ c ? "hover:bg-[var(--lumen-color-surface-muted)]" : "cursor-not-allowed opacity-40"
1103
+ ),
1104
+ children: /* @__PURE__ */ e.jsx(Pe, { size: 18 })
1105
+ }
1106
+ ),
1107
+ /* @__PURE__ */ e.jsxs("span", { className: v(r.header, "font-semibold text-[var(--lumen-color-text)]"), children: [
1108
+ x,
1109
+ " - ",
1110
+ x + 19
1111
+ ] }),
1112
+ /* @__PURE__ */ e.jsx(
1113
+ "button",
1114
+ {
1115
+ type: "button",
1116
+ disabled: !a,
1117
+ onClick: I,
1118
+ className: v(
1119
+ "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors",
1120
+ a ? "hover:bg-[var(--lumen-color-surface-muted)]" : "cursor-not-allowed opacity-40"
1121
+ ),
1122
+ children: /* @__PURE__ */ e.jsx(Me, { size: 18 })
1123
+ }
1124
+ )
1125
+ ] }),
1126
+ /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-5 gap-1 text-center", children: Array.from({ length: 20 }, (z, K) => x + K).map(
1127
+ (z) => {
1128
+ const K = M(z), U = z === d.year, le = z === t;
1129
+ return /* @__PURE__ */ e.jsx(
1130
+ "button",
1131
+ {
1132
+ type: "button",
1133
+ disabled: K,
1134
+ onClick: () => w(z),
1135
+ className: v(
1136
+ "mx-auto flex h-10 w-full items-center justify-center rounded-full text-[13px] transition-all",
1137
+ le && "bg-[var(--lumen-color-primary)] font-medium text-[var(--lumen-color-on-primary)] shadow-sm",
1138
+ !le && U && "font-semibold text-[var(--lumen-color-primary)]",
1139
+ !le && !U && !K && "text-[var(--lumen-color-text-secondary)] hover:bg-[var(--lumen-color-primary-soft)]",
1140
+ K && "cursor-not-allowed text-[var(--lumen-color-border-hover)]"
1141
+ ),
1142
+ children: z
1143
+ },
1144
+ z
1145
+ );
1146
+ }
1147
+ ) })
1148
+ ] })
1149
+ ) : u === "month" ? (
1150
+ /* ─── 月份选择器 ────────────────────────── */
1151
+ /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1152
+ /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
1153
+ /* @__PURE__ */ e.jsx(
1154
+ "button",
1155
+ {
1156
+ type: "button",
1157
+ onClick: Q,
1158
+ className: "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors hover:bg-[var(--lumen-color-surface-muted)]",
1159
+ children: /* @__PURE__ */ e.jsx(Pe, { size: 18 })
1160
+ }
1161
+ ),
1162
+ /* @__PURE__ */ e.jsxs(
1163
+ "button",
1164
+ {
1165
+ type: "button",
1166
+ onClick: () => H("year"),
1167
+ className: v(
1168
+ r.header,
1169
+ "font-semibold text-[var(--lumen-color-text)] hover:text-[var(--lumen-color-primary)] transition-colors"
1170
+ ),
1171
+ children: [
1172
+ t,
1173
+ "年"
1174
+ ]
1175
+ }
1176
+ ),
1177
+ /* @__PURE__ */ e.jsx(
1178
+ "button",
1179
+ {
1180
+ type: "button",
1181
+ onClick: E,
1182
+ className: "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors hover:bg-[var(--lumen-color-surface-muted)]",
1183
+ children: /* @__PURE__ */ e.jsx(Me, { size: 18 })
1184
+ }
1185
+ )
1186
+ ] }),
1187
+ /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 gap-2", children: Nr.map((z, K) => {
1188
+ const U = t === d.year && K === d.month, le = t === d.year && K === o, oe = Y(t, K);
1189
+ return /* @__PURE__ */ e.jsxs(
1190
+ "button",
1191
+ {
1192
+ type: "button",
1193
+ disabled: oe,
1194
+ onClick: () => J(K),
1195
+ className: v(
1196
+ "relative flex h-10 items-center justify-center rounded-full text-[13px] transition-all",
1197
+ le && "bg-[var(--lumen-color-primary)] font-medium text-[var(--lumen-color-on-primary)] shadow-sm",
1198
+ !le && U && "font-semibold text-[var(--lumen-color-primary)]",
1199
+ !le && !U && !oe && "text-[var(--lumen-color-text-secondary)] hover:bg-[var(--lumen-color-primary-soft)] hover:text-[var(--lumen-color-primary)]",
1200
+ oe && "cursor-not-allowed text-[var(--lumen-color-border-hover)]"
1201
+ ),
1202
+ children: [
1203
+ z,
1204
+ U && !le && /* @__PURE__ */ e.jsx("span", { className: "absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full bg-[var(--lumen-color-primary)]" })
1205
+ ]
1206
+ },
1207
+ K
1208
+ );
1209
+ }) })
1210
+ ] })
1211
+ ) : (
1212
+ /* ─── 日期选择器(默认视图) ────────────── */
1213
+ /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1214
+ /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
1215
+ /* @__PURE__ */ e.jsx(
1216
+ "button",
1217
+ {
1218
+ type: "button",
1219
+ onClick: D,
1220
+ disabled: !W,
1221
+ className: "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors hover:bg-[var(--lumen-color-surface-muted)] disabled:cursor-not-allowed disabled:opacity-30",
1222
+ children: /* @__PURE__ */ e.jsx(Pe, { size: 18 })
1223
+ }
1224
+ ),
1225
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
1226
+ /* @__PURE__ */ e.jsxs(
1227
+ "button",
1228
+ {
1229
+ type: "button",
1230
+ onClick: () => H("year"),
1231
+ className: v(
1232
+ r.header,
1233
+ "font-semibold text-[var(--lumen-color-text)] hover:text-[var(--lumen-color-primary)] transition-colors"
1234
+ ),
1235
+ children: [
1236
+ t,
1237
+ "年"
1238
+ ]
1239
+ }
1240
+ ),
1241
+ /* @__PURE__ */ e.jsx(
1242
+ "button",
1243
+ {
1244
+ type: "button",
1245
+ onClick: () => H("month"),
1246
+ className: v(
1247
+ r.header,
1248
+ "font-semibold text-[var(--lumen-color-text)] hover:text-[var(--lumen-color-primary)] transition-colors"
1249
+ ),
1250
+ children: Nr[o]
1251
+ }
1252
+ )
1253
+ ] }),
1254
+ /* @__PURE__ */ e.jsx(
1255
+ "button",
1256
+ {
1257
+ type: "button",
1258
+ onClick: j,
1259
+ disabled: !k,
1260
+ className: "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors hover:bg-[var(--lumen-color-surface-muted)] disabled:cursor-not-allowed disabled:opacity-30",
1261
+ children: /* @__PURE__ */ e.jsx(Me, { size: 18 })
1262
+ }
1263
+ )
1264
+ ] }),
1265
+ /* @__PURE__ */ e.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ e.jsxs(
1266
+ "div",
1267
+ {
1268
+ onAnimationEnd: F,
1269
+ style: f === "left" ? { animation: "calendarSlideLeft 0.2s ease-out" } : f === "right" ? { animation: "calendarSlideRight 0.2s ease-out" } : void 0,
1270
+ children: [
1271
+ /* @__PURE__ */ e.jsx("div", { className: "mb-1 grid grid-cols-7 text-center", children: Mt.map((z) => /* @__PURE__ */ e.jsx(
1272
+ "div",
1273
+ {
1274
+ className: "py-1.5 text-[12px] font-medium text-[var(--lumen-color-text-placeholder)]",
1275
+ children: z
1276
+ },
1277
+ z
1278
+ )) }),
1279
+ /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-7 text-center", children: n.map((z, K) => {
1280
+ const U = z.dateStr === l, le = z.dateStr === s, oe = z.current && V(z.dateStr);
1281
+ return /* @__PURE__ */ e.jsxs(
1282
+ "button",
1283
+ {
1284
+ type: "button",
1285
+ onClick: () => m(z.dateStr),
1286
+ className: v(
1287
+ "relative mx-auto flex items-center justify-center rounded-full transition-all",
1288
+ r.cell,
1289
+ !z.current && "text-[var(--lumen-color-border-hover)]",
1290
+ oe && "pointer-events-none text-[var(--lumen-color-border-hover)]",
1291
+ z.current && !U && !oe && "text-[var(--lumen-color-text-secondary)] hover:bg-[var(--lumen-color-primary-soft)] hover:text-[var(--lumen-color-primary)]",
1292
+ U && "bg-[var(--lumen-color-primary)] text-[var(--lumen-color-on-primary)] font-medium shadow-sm",
1293
+ le && !U && !oe && "font-semibold text-[var(--lumen-color-primary)]"
1294
+ ),
1295
+ children: [
1296
+ z.day,
1297
+ le && !U && /* @__PURE__ */ e.jsx("span", { className: "absolute bottom-0.5 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full bg-[var(--lumen-color-primary)]" })
1298
+ ]
1299
+ },
1300
+ K
1301
+ );
1302
+ }) })
1303
+ ]
1304
+ }
1305
+ ) })
1306
+ ] })
1307
+ ) }),
1308
+ (h || A && l) && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between border-t border-[var(--lumen-color-surface-muted)] px-4 py-3", children: [
1309
+ h && /* @__PURE__ */ e.jsx(
1310
+ "button",
1311
+ {
1312
+ type: "button",
1313
+ onClick: $,
1314
+ className: v(
1315
+ r.footer,
1316
+ "font-medium text-[var(--lumen-color-primary)] hover:text-[var(--lumen-color-primary-active)] transition-colors"
1317
+ ),
1318
+ children: "今天"
1319
+ }
1320
+ ),
1321
+ A && l && /* @__PURE__ */ e.jsx(
1322
+ "button",
1323
+ {
1324
+ type: "button",
1325
+ onClick: C,
1326
+ className: v(
1327
+ r.footer,
1328
+ "text-[var(--lumen-color-text-placeholder)] hover:text-[var(--lumen-color-text-muted)] transition-colors ml-auto"
1329
+ ),
1330
+ children: "清除"
1331
+ }
1332
+ )
1333
+ ] })
1334
+ ] }), Lt = ({
1335
+ tokens: r,
1336
+ viewYear: t,
1337
+ showYearPicker: o,
1338
+ yearPickerStart: n,
1339
+ canGoPrevYearRange: l,
1340
+ canGoNextYearRange: s,
1341
+ selectedMonth: d,
1342
+ todayDate: f,
1343
+ slideDirection: u,
1344
+ selectMonth: x,
1345
+ selectYear: c,
1346
+ prevYear: a,
1347
+ nextYear: m,
1348
+ prevYearRange: p,
1349
+ nextYearRange: I,
1350
+ setShowYearPicker: D,
1351
+ onAnimationEnd: j,
1352
+ showToday: F,
1353
+ clearable: h,
1354
+ onClear: A,
1355
+ onSelectToday: C,
1356
+ isMonthDisabled: $,
1357
+ isYearDisabled: V
1358
+ }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1359
+ /* @__PURE__ */ e.jsx("div", { className: v(r.dropdown, "pb-0"), children: o ? (
1360
+ // ─── 年份选择器 ──────────────────────────
1361
+ /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1362
+ /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
1363
+ /* @__PURE__ */ e.jsx(
1364
+ "button",
1365
+ {
1366
+ type: "button",
1367
+ disabled: !l,
1368
+ onClick: p,
1369
+ className: v(
1370
+ "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors",
1371
+ l ? "hover:bg-[var(--lumen-color-surface-muted)]" : "cursor-not-allowed opacity-40"
1372
+ ),
1373
+ children: /* @__PURE__ */ e.jsx(Pe, { size: 18 })
1374
+ }
1375
+ ),
1376
+ /* @__PURE__ */ e.jsxs("span", { className: v(r.header, "font-semibold text-[var(--lumen-color-text)]"), children: [
1377
+ n,
1378
+ " - ",
1379
+ n + 19
1380
+ ] }),
1381
+ /* @__PURE__ */ e.jsx(
1382
+ "button",
1383
+ {
1384
+ type: "button",
1385
+ disabled: !s,
1386
+ onClick: I,
1387
+ className: v(
1388
+ "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors",
1389
+ s ? "hover:bg-[var(--lumen-color-surface-muted)]" : "cursor-not-allowed opacity-40"
1390
+ ),
1391
+ children: /* @__PURE__ */ e.jsx(Me, { size: 18 })
1392
+ }
1393
+ )
1394
+ ] }),
1395
+ /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-5 gap-1 text-center", children: Array.from({ length: 20 }, (W, k) => n + k).map(
1396
+ (W) => {
1397
+ const k = V(W), H = W === f.year, w = W === t;
1398
+ return /* @__PURE__ */ e.jsx(
1399
+ "button",
1400
+ {
1401
+ type: "button",
1402
+ disabled: k,
1403
+ onClick: () => c(W),
1404
+ className: v(
1405
+ "mx-auto flex h-10 w-full items-center justify-center rounded-full text-[13px] transition-all",
1406
+ w && "bg-[var(--lumen-color-primary)] font-medium text-[var(--lumen-color-on-primary)] shadow-sm",
1407
+ !w && H && "font-semibold text-[var(--lumen-color-primary)]",
1408
+ !w && !H && !k && "text-[var(--lumen-color-text-secondary)] hover:bg-[var(--lumen-color-primary-soft)]",
1409
+ k && "cursor-not-allowed text-[var(--lumen-color-border-hover)]"
1410
+ ),
1411
+ children: W
1412
+ },
1413
+ W
1414
+ );
1415
+ }
1416
+ ) })
1417
+ ] })
1418
+ ) : (
1419
+ // ─── 月份选择器 ──────────────────────────
1420
+ /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1421
+ /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
1422
+ /* @__PURE__ */ e.jsx(
1423
+ "button",
1424
+ {
1425
+ type: "button",
1426
+ onClick: a,
1427
+ className: "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors hover:bg-[var(--lumen-color-surface-muted)]",
1428
+ children: /* @__PURE__ */ e.jsx(Pe, { size: 18 })
1429
+ }
1430
+ ),
1431
+ /* @__PURE__ */ e.jsxs(
1432
+ "button",
1433
+ {
1434
+ type: "button",
1435
+ onClick: () => D(!0),
1436
+ className: v(
1437
+ r.header,
1438
+ "font-semibold text-[var(--lumen-color-text)] hover:text-[var(--lumen-color-primary)] transition-colors"
1439
+ ),
1440
+ children: [
1441
+ t,
1442
+ "年"
1443
+ ]
1444
+ }
1445
+ ),
1446
+ /* @__PURE__ */ e.jsx(
1447
+ "button",
1448
+ {
1449
+ type: "button",
1450
+ onClick: m,
1451
+ className: "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors hover:bg-[var(--lumen-color-surface-muted)]",
1452
+ children: /* @__PURE__ */ e.jsx(Me, { size: 18 })
1453
+ }
1454
+ )
1455
+ ] }),
1456
+ /* @__PURE__ */ e.jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ e.jsx(
1457
+ "div",
1458
+ {
1459
+ onAnimationEnd: j,
1460
+ style: u === "left" ? { animation: "calendarSlideLeft 0.2s ease-out" } : u === "right" ? { animation: "calendarSlideRight 0.2s ease-out" } : void 0,
1461
+ children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-4 gap-2", children: Nr.map((W, k) => {
1462
+ const H = (d == null ? void 0 : d.year) === t && (d == null ? void 0 : d.month) === k, w = t === f.year && k === f.month, J = $(t, k);
1463
+ return /* @__PURE__ */ e.jsxs(
1464
+ "button",
1465
+ {
1466
+ type: "button",
1467
+ disabled: J,
1468
+ onClick: () => x(t, k),
1469
+ className: v(
1470
+ "relative flex h-10 items-center justify-center rounded-full text-[13px] transition-all",
1471
+ H && "bg-[var(--lumen-color-primary)] font-medium text-[var(--lumen-color-on-primary)] shadow-sm",
1472
+ !H && w && "font-semibold text-[var(--lumen-color-primary)]",
1473
+ !H && !w && !J && "text-[var(--lumen-color-text-secondary)] hover:bg-[var(--lumen-color-primary-soft)] hover:text-[var(--lumen-color-primary)]",
1474
+ J && "cursor-not-allowed text-[var(--lumen-color-border-hover)]"
1475
+ ),
1476
+ children: [
1477
+ W,
1478
+ w && !H && /* @__PURE__ */ e.jsx("span", { className: "absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full bg-[var(--lumen-color-primary)]" })
1479
+ ]
1480
+ },
1481
+ k
1482
+ );
1483
+ }) })
1484
+ }
1485
+ ) })
1486
+ ] })
1487
+ ) }),
1488
+ (F || h && d) && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between border-t border-[var(--lumen-color-surface-muted)] px-4 py-3", children: [
1489
+ F && /* @__PURE__ */ e.jsx(
1490
+ "button",
1491
+ {
1492
+ type: "button",
1493
+ onClick: C,
1494
+ className: v(
1495
+ r.footer,
1496
+ "font-medium text-[var(--lumen-color-primary)] hover:text-[var(--lumen-color-primary-active)] transition-colors"
1497
+ ),
1498
+ children: "今天"
1499
+ }
1500
+ ),
1501
+ h && d && /* @__PURE__ */ e.jsx(
1502
+ "button",
1503
+ {
1504
+ type: "button",
1505
+ onClick: A,
1506
+ className: v(
1507
+ r.footer,
1508
+ "text-[var(--lumen-color-text-placeholder)] hover:text-[var(--lumen-color-text-muted)] transition-colors ml-auto"
1509
+ ),
1510
+ children: "清除"
1511
+ }
1512
+ )
1513
+ ] })
1514
+ ] }), Ft = (r) => String(r).padStart(2, "0"), pr = (r, t = 1) => {
1515
+ const o = [];
1516
+ for (let n = 0; n < r; n += t)
1517
+ o.push(Ft(n));
1518
+ return o;
1519
+ }, hr = ({
1520
+ title: r,
1521
+ values: t,
1522
+ selected: o,
1523
+ onSelect: n,
1524
+ isDisabled: l
1525
+ }) => /* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1 border-l border-[var(--lumen-color-surface-muted)] first:border-l-0", children: [
1526
+ /* @__PURE__ */ e.jsx("div", { className: "border-b border-[var(--lumen-color-surface-muted)] px-2 py-2 text-center text-[12px] font-medium text-[var(--lumen-color-text-muted)]", children: r }),
1527
+ /* @__PURE__ */ e.jsx(
1528
+ "div",
1529
+ {
1530
+ "data-time-selector-column": !0,
1531
+ "data-date-time-picker-time-column": !0,
1532
+ className: "date-time-picker-time-column time-selector-column max-h-[266px] overflow-y-auto p-1",
1533
+ children: t.map((s) => {
1534
+ const d = (l == null ? void 0 : l(s)) ?? !1;
1535
+ return /* @__PURE__ */ e.jsx(
1536
+ "button",
1537
+ {
1538
+ type: "button",
1539
+ "aria-label": `${r}${s}`,
1540
+ "aria-current": o === s ? "time" : void 0,
1541
+ "data-selected": o === s ? "true" : void 0,
1542
+ disabled: d,
1543
+ onClick: () => n(s),
1544
+ className: v(
1545
+ "block w-full rounded-[6px] px-2 py-1.5 text-center text-[13px] transition-colors",
1546
+ o === s ? "bg-[var(--lumen-color-primary)] font-medium text-[var(--lumen-color-on-primary)]" : "text-[var(--lumen-color-text-secondary)] hover:bg-[var(--lumen-color-primary-soft)] hover:text-[var(--lumen-color-primary)]",
1547
+ d && "cursor-not-allowed text-[var(--lumen-color-border-hover)] hover:bg-transparent hover:text-[var(--lumen-color-border-hover)]"
1548
+ ),
1549
+ children: s
1550
+ },
1551
+ s
1552
+ );
1553
+ })
1554
+ }
1555
+ )
1556
+ ] }), Xr = ({
1557
+ hour: r,
1558
+ minute: t,
1559
+ second: o = "00",
1560
+ onHourChange: n,
1561
+ onMinuteChange: l,
1562
+ onSecondChange: s,
1563
+ precision: d = "minute",
1564
+ minuteStep: f = 1,
1565
+ isHourDisabled: u,
1566
+ isMinuteDisabled: x,
1567
+ isSecondDisabled: c,
1568
+ className: a
1569
+ }) => {
1570
+ const m = re(null), p = fe(() => pr(24), []), I = fe(() => pr(60, f), [f]), D = fe(() => pr(60), []);
1571
+ return X(() => {
1572
+ const j = window.requestAnimationFrame(() => {
1573
+ var F;
1574
+ (F = m.current) == null || F.querySelectorAll("[data-time-selector-column]").forEach((h) => {
1575
+ const A = h.querySelector(
1576
+ '[data-selected="true"]'
1577
+ );
1578
+ if (!A) return;
1579
+ const C = Math.max(
1580
+ 0,
1581
+ A.offsetTop - h.clientHeight / 2 + A.offsetHeight / 2
1582
+ );
1583
+ typeof h.scrollTo == "function" ? h.scrollTo({ top: C }) : h.scrollTop = C;
1584
+ });
1585
+ });
1586
+ return () => window.cancelAnimationFrame(j);
1587
+ }, []), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1588
+ /* @__PURE__ */ e.jsx("style", { children: `
1589
+ .time-selector-column { scrollbar-width: none; }
1590
+ .time-selector-column::-webkit-scrollbar { width: 0; }
1591
+ .time-selector-column:hover,
1592
+ .time-selector-column:focus-within {
1593
+ scrollbar-width: thin;
1594
+ scrollbar-color: var(--lumen-color-border-hover) transparent;
1595
+ }
1596
+ .time-selector-column:hover::-webkit-scrollbar,
1597
+ .time-selector-column:focus-within::-webkit-scrollbar { width: 6px; }
1598
+ .time-selector-column::-webkit-scrollbar-thumb {
1599
+ border-radius: 999px;
1600
+ background: var(--lumen-color-border-hover);
1601
+ }
1602
+ .time-selector-column::-webkit-scrollbar-track { background: transparent; }
1603
+ ` }),
1604
+ /* @__PURE__ */ e.jsxs(
1605
+ "div",
1606
+ {
1607
+ ref: m,
1608
+ className: v(
1609
+ "grid",
1610
+ d === "minute" ? "grid-cols-2" : "grid-cols-3",
1611
+ a
1612
+ ),
1613
+ children: [
1614
+ /* @__PURE__ */ e.jsx(
1615
+ hr,
1616
+ {
1617
+ title: "时",
1618
+ values: p,
1619
+ selected: r,
1620
+ onSelect: n,
1621
+ isDisabled: u
1622
+ }
1623
+ ),
1624
+ /* @__PURE__ */ e.jsx(
1625
+ hr,
1626
+ {
1627
+ title: "分",
1628
+ values: I,
1629
+ selected: t,
1630
+ onSelect: l,
1631
+ isDisabled: x
1632
+ }
1633
+ ),
1634
+ d === "second" ? /* @__PURE__ */ e.jsx(
1635
+ hr,
1636
+ {
1637
+ title: "秒",
1638
+ values: D,
1639
+ selected: o,
1640
+ onSelect: s ?? (() => {
1641
+ }),
1642
+ isDisabled: c
1643
+ }
1644
+ ) : null
1645
+ ]
1646
+ }
1647
+ )
1648
+ ] });
1649
+ }, Wt = ["日", "一", "二", "三", "四", "五", "六"], Ht = [
1650
+ "1月",
1651
+ "2月",
1652
+ "3月",
1653
+ "4月",
1654
+ "5月",
1655
+ "6月",
1656
+ "7月",
1657
+ "8月",
1658
+ "9月",
1659
+ "10月",
1660
+ "11月",
1661
+ "12月"
1662
+ ], ge = (r) => String(r).padStart(2, "0"), vr = (r) => `${r.getFullYear()}-${ge(r.getMonth() + 1)}-${ge(r.getDate())}`, Jr = (r, t, o, n) => `${r} ${t}:${o}:${n}`, Yt = (r, t, o, n, l) => l === "minute" ? `${r} ${t}:${o}` : Jr(r, t, o, n), cr = (r) => {
1663
+ const t = r.trim().replace("T", " ").match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{2}):(\d{2})(?::(\d{2}))?)?$/);
1664
+ return t ? {
1665
+ date: t[1],
1666
+ hour: t[2] ?? "09",
1667
+ minute: t[3] ?? "00",
1668
+ second: t[4] ?? "00"
1669
+ } : null;
1670
+ }, kr = (r, t, o, n) => {
1671
+ const l = r.match(/^(\d{4})-(\d{2})-(\d{2})$/);
1672
+ if (!l)
1673
+ return null;
1674
+ const s = new Date(
1675
+ Number(l[1]),
1676
+ Number(l[2]) - 1,
1677
+ Number(l[3]),
1678
+ Number(t),
1679
+ Number(o),
1680
+ Number(n)
1681
+ ).getTime();
1682
+ return Number.isNaN(s) ? null : s;
1683
+ }, Bt = (r) => {
1684
+ if (!r)
1685
+ return null;
1686
+ const t = cr(r);
1687
+ return t ? kr(
1688
+ t.date,
1689
+ t.hour,
1690
+ t.minute,
1691
+ t.second
1692
+ ) : null;
1693
+ }, Cr = (r, t) => new Date(r, t + 1, 0).getDate(), Ut = (r, t) => {
1694
+ const o = new Date(r, t, 1).getDay(), n = Cr(r, t), l = t === 0 ? 11 : t - 1, s = t === 0 ? r - 1 : r, d = Cr(s, l), f = [];
1695
+ for (let c = o - 1; c >= 0; c -= 1) {
1696
+ const a = d - c;
1697
+ f.push({
1698
+ date: `${s}-${ge(l + 1)}-${ge(a)}`,
1699
+ day: a,
1700
+ current: !1
1701
+ });
1702
+ }
1703
+ for (let c = 1; c <= n; c += 1)
1704
+ f.push({
1705
+ date: `${r}-${ge(t + 1)}-${ge(c)}`,
1706
+ day: c,
1707
+ current: !0
1708
+ });
1709
+ const u = t === 11 ? 0 : t + 1, x = t === 11 ? r + 1 : r;
1710
+ for (; f.length < 42; ) {
1711
+ const c = f.length - o - n + 1;
1712
+ f.push({
1713
+ date: `${x}-${ge(u + 1)}-${ge(c)}`,
1714
+ day: c,
1715
+ current: !1
1716
+ });
1717
+ }
1718
+ return f;
1719
+ }, Vt = 560, Gt = 374, br = 6, qt = 120, Gn = ({
1720
+ value: r,
1721
+ onChange: t,
1722
+ label: o,
1723
+ disabled: n = !1,
1724
+ className: l,
1725
+ minuteStep: s = 1,
1726
+ placeholder: d = "请选择日期时间",
1727
+ precision: f = "second",
1728
+ minDate: u,
1729
+ minDateTime: x,
1730
+ defaultToNow: c = !1
1731
+ }) => {
1732
+ var q;
1733
+ const a = fe(() => cr(r), [r]), m = fe(() => /* @__PURE__ */ new Date(), []), p = (a == null ? void 0 : a.date) ?? vr(m), I = Number(p.slice(0, 4)), D = Number(p.slice(5, 7)) - 1, [j, F] = R(!1), [h, A] = R(I), [C, $] = R(D), [V, W] = R(p), [k, H] = R(
1734
+ (a == null ? void 0 : a.hour) ?? (c ? ge(m.getHours()) : "09")
1735
+ ), [w, J] = R(
1736
+ (a == null ? void 0 : a.minute) ?? (c ? ge(m.getMinutes()) : "00")
1737
+ ), [Q, E] = R(
1738
+ (a == null ? void 0 : a.second) ?? (c ? ge(m.getSeconds()) : "00")
1739
+ ), [M, Y] = R("down"), [z, K] = R(!1), U = re(null), le = re(null), oe = re(null), i = re(null), T = re(r), [N, _] = R({
1740
+ position: "fixed",
1741
+ zIndex: 9999
1742
+ }), se = fe(
1743
+ () => Ut(h, C),
1744
+ [C, h]
1745
+ ), ae = u ?? ((q = cr(x ?? "")) == null ? void 0 : q.date) ?? null, P = Bt(x), ie = a ? Yt(
1746
+ a.date,
1747
+ a.hour,
1748
+ a.minute,
1749
+ a.second,
1750
+ f
1751
+ ) : "", Z = S(() => {
1752
+ const g = cr(r), G = c ? /* @__PURE__ */ new Date() : m, ne = (g == null ? void 0 : g.date) ?? vr(G);
1753
+ W(ne), H(
1754
+ (g == null ? void 0 : g.hour) ?? (c ? ge(G.getHours()) : "09")
1755
+ ), J(
1756
+ (g == null ? void 0 : g.minute) ?? (c ? ge(G.getMinutes()) : "00")
1757
+ ), E(
1758
+ (g == null ? void 0 : g.second) ?? (c ? ge(G.getSeconds()) : "00")
1759
+ ), A(Number(ne.slice(0, 4))), $(Number(ne.slice(5, 7)) - 1), T.current = r;
1760
+ }, [c, m, r]);
1761
+ X(() => {
1762
+ j && T.current !== r && Z();
1763
+ }, [j, Z, r]);
1764
+ const ee = S(() => {
1765
+ var b, O;
1766
+ const g = (b = le.current) == null ? void 0 : b.getBoundingClientRect();
1767
+ if (!g)
1768
+ return;
1769
+ const G = ((O = oe.current) == null ? void 0 : O.offsetHeight) || Gt, ne = Math.min(Vt, Math.max(0, window.innerWidth - 16)), Ne = window.innerHeight - g.bottom < G + br, ke = Ne ? Math.max(8, g.top - G - br) : g.bottom + br, Ee = Math.min(
1770
+ Math.max(8, g.left),
1771
+ Math.max(8, window.innerWidth - ne - 8)
1772
+ );
1773
+ Y(Ne ? "up" : "down"), _({
1774
+ position: "fixed",
1775
+ left: Ee,
1776
+ top: ke,
1777
+ width: ne,
1778
+ maxHeight: "calc(100dvh - 16px)",
1779
+ zIndex: 9999
1780
+ });
1781
+ }, []), ce = () => {
1782
+ i.current && clearTimeout(i.current), K(!1), Z(), ee(), F(!0);
1783
+ }, de = S(() => {
1784
+ i.current && clearTimeout(i.current), K(!0), i.current = setTimeout(() => {
1785
+ F(!1), K(!1);
1786
+ }, qt);
1787
+ }, []), te = S(() => {
1788
+ i.current && clearTimeout(i.current), F(!1), K(!1);
1789
+ }, []);
1790
+ X(() => {
1791
+ if (j)
1792
+ return ee(), window.addEventListener("resize", ee), window.addEventListener("scroll", ee, !0), () => {
1793
+ window.removeEventListener("resize", ee), window.removeEventListener("scroll", ee, !0);
1794
+ };
1795
+ }, [j, ee]), X(() => {
1796
+ if (!j)
1797
+ return;
1798
+ const g = window.requestAnimationFrame(ee);
1799
+ if (!oe.current || typeof ResizeObserver > "u")
1800
+ return () => window.cancelAnimationFrame(g);
1801
+ const G = new ResizeObserver(ee);
1802
+ return G.observe(oe.current), () => {
1803
+ window.cancelAnimationFrame(g), G.disconnect();
1804
+ };
1805
+ }, [j, f, ee]), X(() => () => {
1806
+ i.current && clearTimeout(i.current);
1807
+ }, []), X(() => {
1808
+ if (!j)
1809
+ return;
1810
+ const g = (G) => {
1811
+ var he, Ne;
1812
+ const ne = G.target;
1813
+ (he = U.current) != null && he.contains(ne) || (Ne = oe.current) != null && Ne.contains(ne) || de();
1814
+ };
1815
+ return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
1816
+ }, [de, j]);
1817
+ const ve = (g) => {
1818
+ const G = new Date(h, C + g, 1);
1819
+ A(G.getFullYear()), $(G.getMonth());
1820
+ }, je = (g) => ae != null && g < ae, ye = (g, G, ne) => {
1821
+ if (P == null)
1822
+ return !1;
1823
+ const he = kr(g, G, ne, "00");
1824
+ return he != null && he < P;
1825
+ }, L = () => {
1826
+ const g = kr(
1827
+ V,
1828
+ k,
1829
+ w,
1830
+ f === "minute" ? "00" : Q
1831
+ );
1832
+ P != null && g != null && g < P || (t(
1833
+ Jr(
1834
+ V,
1835
+ k,
1836
+ w,
1837
+ f === "minute" ? "00" : Q
1838
+ )
1839
+ ), te());
1840
+ }, me = () => {
1841
+ const g = /* @__PURE__ */ new Date();
1842
+ W(vr(g));
1843
+ const G = ge(g.getHours()), ne = ge(g.getMinutes()), he = ge(g.getSeconds());
1844
+ H(G), J(ne), E(he), A(g.getFullYear()), $(g.getMonth());
1845
+ };
1846
+ return /* @__PURE__ */ e.jsxs("div", { ref: U, className: v("relative", l), children: [
1847
+ /* @__PURE__ */ e.jsx(
1848
+ "input",
1849
+ {
1850
+ "aria-label": `${o}值`,
1851
+ className: "sr-only",
1852
+ value: r,
1853
+ onChange: (g) => t(g.target.value),
1854
+ disabled: n,
1855
+ tabIndex: -1
1856
+ }
1857
+ ),
1858
+ /* @__PURE__ */ e.jsxs(
1859
+ "button",
1860
+ {
1861
+ type: "button",
1862
+ ref: le,
1863
+ "aria-label": o,
1864
+ disabled: n,
1865
+ onClick: () => {
1866
+ n || (j ? de() : ce());
1867
+ },
1868
+ className: v(
1869
+ "flex h-[40px] w-full items-center gap-2 border bg-[var(--lumen-color-surface)] px-3.5 text-left text-[13px] outline-none transition-all",
1870
+ Se.control,
1871
+ n ? "cursor-not-allowed border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface-muted)] text-[var(--lumen-color-text-placeholder)]" : j ? "border-[var(--lumen-color-primary)] ring-1 ring-[var(--lumen-color-primary)]/10" : "border-[var(--lumen-color-border)] hover:border-[var(--lumen-color-border-hover)]"
1872
+ ),
1873
+ children: [
1874
+ /* @__PURE__ */ e.jsx(Gr, { size: 16, className: "shrink-0 text-[var(--lumen-color-text-placeholder)]" }),
1875
+ /* @__PURE__ */ e.jsx(
1876
+ "span",
1877
+ {
1878
+ className: v(
1879
+ "min-w-0 flex-1 truncate",
1880
+ ie ? "text-[var(--lumen-color-text)]" : "text-[var(--lumen-color-text-placeholder)]"
1881
+ ),
1882
+ children: ie || d
1883
+ }
1884
+ ),
1885
+ /* @__PURE__ */ e.jsx(qr, { size: 16, className: "shrink-0 text-[var(--lumen-color-text-placeholder)]" })
1886
+ ]
1887
+ }
1888
+ ),
1889
+ j ? Re(
1890
+ /* @__PURE__ */ e.jsxs(
1891
+ "div",
1892
+ {
1893
+ ref: oe,
1894
+ "data-date-time-picker-panel": !0,
1895
+ className: "overflow-x-hidden overflow-y-auto rounded-[8px] border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] shadow-[0_18px_46px_var(--lumen-color-shadow)]",
1896
+ style: {
1897
+ ...N,
1898
+ animation: z ? M === "up" ? "lumen-dropdown-out-up 0.12s ease-in forwards" : "lumen-dropdown-out 0.12s ease-in forwards" : M === "up" ? "lumen-dropdown-in-up 0.12s ease-out" : "lumen-dropdown-in 0.12s ease-out",
1899
+ transformOrigin: M === "up" ? "bottom" : "top"
1900
+ },
1901
+ children: [
1902
+ /* @__PURE__ */ e.jsxs(
1903
+ "div",
1904
+ {
1905
+ className: v(
1906
+ "grid grid-cols-1",
1907
+ f === "minute" ? "pad:grid-cols-[minmax(0,1fr)_148px]" : "pad:grid-cols-[minmax(0,1fr)_210px]"
1908
+ ),
1909
+ children: [
1910
+ /* @__PURE__ */ e.jsxs("div", { className: "p-4", children: [
1911
+ /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
1912
+ /* @__PURE__ */ e.jsx(
1913
+ "button",
1914
+ {
1915
+ type: "button",
1916
+ onClick: () => ve(-1),
1917
+ className: "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] hover:bg-[var(--lumen-color-surface-muted)]",
1918
+ children: /* @__PURE__ */ e.jsx(Pe, { size: 18 })
1919
+ }
1920
+ ),
1921
+ /* @__PURE__ */ e.jsxs("div", { className: "text-[14px] font-semibold text-[var(--lumen-color-text)]", children: [
1922
+ h,
1923
+ "年",
1924
+ Ht[C]
1925
+ ] }),
1926
+ /* @__PURE__ */ e.jsx(
1927
+ "button",
1928
+ {
1929
+ type: "button",
1930
+ onClick: () => ve(1),
1931
+ className: "flex h-8 w-8 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] hover:bg-[var(--lumen-color-surface-muted)]",
1932
+ children: /* @__PURE__ */ e.jsx(Me, { size: 18 })
1933
+ }
1934
+ )
1935
+ ] }),
1936
+ /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-7 text-center text-[12px] font-medium text-[var(--lumen-color-text-placeholder)]", children: Wt.map((g) => /* @__PURE__ */ e.jsx("div", { className: "py-1.5", children: g }, g)) }),
1937
+ /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-7 text-center", children: se.map((g) => {
1938
+ const G = g.date === V, ne = je(g.date);
1939
+ return /* @__PURE__ */ e.jsx(
1940
+ "button",
1941
+ {
1942
+ type: "button",
1943
+ "aria-label": `选择日期 ${g.date}`,
1944
+ disabled: ne,
1945
+ onClick: () => W(g.date),
1946
+ className: v(
1947
+ "mx-auto my-0.5 flex h-8 w-8 items-center justify-center rounded-full text-[13px] transition-all",
1948
+ !g.current && "text-[var(--lumen-color-border-hover)]",
1949
+ ne && "cursor-not-allowed text-[var(--lumen-color-border-hover)] hover:bg-transparent hover:text-[var(--lumen-color-border-hover)]",
1950
+ g.current && !G && !ne && "text-[var(--lumen-color-text-secondary)] hover:bg-[var(--lumen-color-primary-soft)] hover:text-[var(--lumen-color-primary)]",
1951
+ G && "bg-[var(--lumen-color-primary)] font-medium text-[var(--lumen-color-on-primary)] shadow-sm"
1952
+ ),
1953
+ children: g.day
1954
+ },
1955
+ g.date
1956
+ );
1957
+ }) })
1958
+ ] }),
1959
+ /* @__PURE__ */ e.jsx(
1960
+ Xr,
1961
+ {
1962
+ hour: k,
1963
+ minute: w,
1964
+ second: Q,
1965
+ onHourChange: H,
1966
+ onMinuteChange: J,
1967
+ onSecondChange: E,
1968
+ precision: f,
1969
+ minuteStep: s,
1970
+ isHourDisabled: (g) => ye(V, g, "59"),
1971
+ isMinuteDisabled: (g) => ye(V, k, g),
1972
+ className: "border-t border-[var(--lumen-color-surface-muted)] pad:border-l pad:border-t-0"
1973
+ }
1974
+ )
1975
+ ]
1976
+ }
1977
+ ),
1978
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-[var(--lumen-color-surface-muted)] px-3 py-3 pad:px-4", children: [
1979
+ /* @__PURE__ */ e.jsx(
1980
+ "button",
1981
+ {
1982
+ type: "button",
1983
+ onClick: () => {
1984
+ t(""), de();
1985
+ },
1986
+ className: "text-[13px] text-[var(--lumen-color-text-placeholder)] transition-colors hover:text-[var(--lumen-color-text-muted)]",
1987
+ children: "清除"
1988
+ }
1989
+ ),
1990
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1991
+ /* @__PURE__ */ e.jsx(
1992
+ "button",
1993
+ {
1994
+ type: "button",
1995
+ onClick: me,
1996
+ className: "text-[13px] font-medium text-[var(--lumen-color-primary)] transition-colors hover:text-[var(--lumen-color-primary-active)]",
1997
+ children: "此刻"
1998
+ }
1999
+ ),
2000
+ /* @__PURE__ */ e.jsx(Be, { type: "button", size: "sm", onClick: L, children: "确定" })
2001
+ ] })
2002
+ ] })
2003
+ ]
2004
+ }
2005
+ ),
2006
+ document.body
2007
+ ) : null
2008
+ ] });
2009
+ }, Kt = "fixed inset-0 z-[100] flex items-stretch justify-end overflow-hidden bg-[var(--lumen-color-overlay)] backdrop-blur-[2px]", Pr = (r) => Object.fromEntries(
2010
+ Object.entries(r ?? {}).map(([t, o]) => [`data-${t}`, o])
2011
+ ), qn = ({
2012
+ open: r,
2013
+ onRequestClose: t,
2014
+ onExited: o,
2015
+ children: n,
2016
+ drawerId: l,
2017
+ overlayId: s,
2018
+ overlayClassName: d = "",
2019
+ panelClassName: f = "",
2020
+ closeOnOverlayClick: u = !0,
2021
+ overlayDataAttributes: x,
2022
+ panelDataAttributes: c
2023
+ }) => {
2024
+ const [a, m] = R(r), [p, I] = R(!1), [D, j] = R(n);
2025
+ X(() => {
2026
+ r ? (m(!0), I(!1), j(n)) : a && I(!0);
2027
+ }, [n, a, r]), X(() => {
2028
+ r && n != null && j(n);
2029
+ }, [n, r]);
2030
+ const F = S(
2031
+ (A) => {
2032
+ A.target !== A.currentTarget || !p || (m(!1), I(!1), j(null), o == null || o());
2033
+ },
2034
+ [p, o]
2035
+ );
2036
+ if (!a || typeof document > "u") return null;
2037
+ const h = p ? D : n;
2038
+ return Re(
2039
+ /* @__PURE__ */ e.jsx(
2040
+ "div",
2041
+ {
2042
+ "data-drawer-overlay": s || l,
2043
+ "data-lumen-motion": !0,
2044
+ className: `${Kt} ${p ? "animate-[lumen-page-fade-out_150ms_ease-in_forwards]" : "animate-[lumen-page-fade-in_200ms_ease-out]"} ${d}`.trim(),
2045
+ onClick: u ? t : void 0,
2046
+ onAnimationEnd: F,
2047
+ ...Pr(x),
2048
+ children: /* @__PURE__ */ e.jsx(
2049
+ "aside",
2050
+ {
2051
+ "data-drawer": l,
2052
+ "data-lumen-motion": !0,
2053
+ className: `h-full max-w-full overflow-y-auto ${p ? "animate-[lumen-drawer-out_250ms_ease-in_forwards]" : "animate-[lumen-drawer-in_300ms_ease-out]"} ${f}`.trim(),
2054
+ onClick: (A) => A.stopPropagation(),
2055
+ ...Pr(c),
2056
+ children: h
2057
+ }
2058
+ )
2059
+ }
2060
+ ),
2061
+ document.body
2062
+ );
2063
+ }, Xt = 120, Jt = 16, gr = "intelliconf-dropdown-menu-open", Kn = ({
2064
+ trigger: r,
2065
+ children: t,
2066
+ className: o,
2067
+ menuClassName: n,
2068
+ align: l = "right",
2069
+ closeDelayMs: s = Xt,
2070
+ menuMode: d = !1,
2071
+ onOpenChange: f
2072
+ }) => {
2073
+ const u = tr(), [x, c] = R("closed"), [a, m] = R({
2074
+ left: -9999,
2075
+ position: "fixed",
2076
+ right: "auto",
2077
+ top: -9999
2078
+ }), p = re(null), I = re(null), D = re(null), j = re(null), F = re(null), h = x !== "closed", A = x === "opening" || x === "open", C = S(() => {
2079
+ p.current && (clearTimeout(p.current), p.current = null);
2080
+ }, []), $ = S(() => {
2081
+ I.current && (clearTimeout(I.current), I.current = null);
2082
+ }, []), V = S(() => {
2083
+ var E, M;
2084
+ if (C(), $(), d) {
2085
+ const Y = document.activeElement;
2086
+ F.current = Y instanceof HTMLElement && ((E = D.current) != null && E.contains(Y)) ? Y : ((M = D.current) == null ? void 0 : M.querySelector(
2087
+ 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
2088
+ )) ?? null;
2089
+ }
2090
+ c("opening"), f == null || f(!0), window.dispatchEvent(new CustomEvent(gr, { detail: u }));
2091
+ }, [C, $, u, d, f]), W = S(() => {
2092
+ C(), $(), c("closed"), f == null || f(!1);
2093
+ }, [C, $, f]), k = S(() => {
2094
+ var E;
2095
+ C(), $(), c("closing"), f == null || f(!1), d && ((E = F.current) == null || E.focus()), p.current = setTimeout(() => {
2096
+ c("closed"), p.current = null;
2097
+ }, s);
2098
+ }, [
2099
+ C,
2100
+ $,
2101
+ s,
2102
+ d,
2103
+ f
2104
+ ]), H = S(() => {
2105
+ if (A) {
2106
+ k();
2107
+ return;
2108
+ }
2109
+ V();
2110
+ }, [k, A, V]), w = S(
2111
+ () => {
2112
+ var E;
2113
+ return Array.from(
2114
+ ((E = j.current) == null ? void 0 : E.querySelectorAll('[role="menuitem"]')) ?? []
2115
+ ).filter(
2116
+ (M) => !M.hasAttribute("disabled") && M.getAttribute("aria-disabled") !== "true"
2117
+ );
2118
+ },
2119
+ []
2120
+ ), J = S(
2121
+ (E) => {
2122
+ var K;
2123
+ if (!d) return;
2124
+ if (E.key === "Escape") {
2125
+ E.preventDefault(), E.stopPropagation(), k();
2126
+ return;
2127
+ }
2128
+ const M = w();
2129
+ if (M.length === 0) return;
2130
+ const Y = M.indexOf(
2131
+ document.activeElement
2132
+ );
2133
+ let z = null;
2134
+ switch (E.key) {
2135
+ case "ArrowDown":
2136
+ z = Y < 0 ? 0 : (Y + 1) % M.length;
2137
+ break;
2138
+ case "ArrowUp":
2139
+ z = Y < 0 ? M.length - 1 : (Y - 1 + M.length) % M.length;
2140
+ break;
2141
+ case "Home":
2142
+ z = 0;
2143
+ break;
2144
+ case "End":
2145
+ z = M.length - 1;
2146
+ break;
2147
+ default:
2148
+ return;
2149
+ }
2150
+ E.preventDefault(), (K = M[z]) == null || K.focus();
2151
+ },
2152
+ [k, w, d]
2153
+ ), Q = S(() => {
2154
+ var se, ae;
2155
+ if (!D.current) return;
2156
+ const E = D.current.getBoundingClientRect(), M = ((se = j.current) == null ? void 0 : se.offsetWidth) ?? 200, Y = ((ae = j.current) == null ? void 0 : ae.offsetHeight) ?? 200, z = window.innerWidth, K = window.innerHeight, U = 8, le = 8, oe = Math.min(
2157
+ M,
2158
+ Math.max(0, z - U * 2)
2159
+ ), i = l === "right" ? E.right - oe : E.left, T = Math.max(
2160
+ U,
2161
+ z - oe - U
2162
+ ), N = Math.min(
2163
+ Math.max(U, i),
2164
+ T
2165
+ );
2166
+ let _ = E.bottom + le;
2167
+ if (_ + Y > K - U) {
2168
+ const P = E.top - le - Y;
2169
+ _ = P >= U ? P : Math.max(U, K - Y - U);
2170
+ }
2171
+ m({
2172
+ left: N,
2173
+ position: "fixed",
2174
+ right: "auto",
2175
+ top: _,
2176
+ maxWidth: `calc(100vw - ${U * 2}px)`
2177
+ });
2178
+ }, [l]);
2179
+ return X(() => {
2180
+ const E = (M) => {
2181
+ const Y = M.detail;
2182
+ Y && Y !== u && W();
2183
+ };
2184
+ return window.addEventListener(gr, E), () => {
2185
+ window.removeEventListener(gr, E);
2186
+ };
2187
+ }, [W, u]), X(() => {
2188
+ if (!h) return;
2189
+ const E = (Y) => {
2190
+ j.current && j.current.contains(Y.target) || D.current && !D.current.contains(Y.target) && k();
2191
+ }, M = (Y) => {
2192
+ Y.key === "Escape" && k();
2193
+ };
2194
+ return document.addEventListener("mousedown", E), document.addEventListener("keydown", M), () => {
2195
+ document.removeEventListener("mousedown", E), document.removeEventListener("keydown", M);
2196
+ };
2197
+ }, [k, h]), Er(() => {
2198
+ var E;
2199
+ h && (Q(), d && x === "opening" && ((E = w()[0]) == null || E.focus()));
2200
+ }, [w, d, h, x, Q]), X(() => {
2201
+ if (!(!h || x !== "opening"))
2202
+ return I.current = setTimeout(() => {
2203
+ c("open"), I.current = null;
2204
+ }, Jt), () => {
2205
+ $();
2206
+ };
2207
+ }, [h, x, $]), X(() => {
2208
+ if (h)
2209
+ return window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), () => {
2210
+ window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
2211
+ };
2212
+ }, [h, Q]), X(() => () => {
2213
+ C(), $();
2214
+ }, [C, $]), /* @__PURE__ */ e.jsxs("div", { ref: D, className: v("relative", o), children: [
2215
+ r({
2216
+ open: A,
2217
+ menuId: u,
2218
+ close: k,
2219
+ toggle: H
2220
+ }),
2221
+ h && Re(
2222
+ /* @__PURE__ */ e.jsx(
2223
+ "div",
2224
+ {
2225
+ id: u,
2226
+ role: d ? "menu" : void 0,
2227
+ "aria-orientation": d ? "vertical" : void 0,
2228
+ "data-testid": "dropdown-menu",
2229
+ "data-state": x,
2230
+ ref: j,
2231
+ onKeyDown: d ? J : void 0,
2232
+ style: a,
2233
+ className: "z-50",
2234
+ children: /* @__PURE__ */ e.jsx(
2235
+ "div",
2236
+ {
2237
+ className: v(
2238
+ "rounded-[var(--lumen-radius-icon)] border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] py-1 shadow-[0_4px_16px_var(--lumen-color-shadow)]",
2239
+ l === "right" ? "origin-top-right" : "origin-top-left",
2240
+ d && "min-w-max whitespace-nowrap [&_svg]:shrink-0",
2241
+ n
2242
+ ),
2243
+ style: {
2244
+ animation: x === "closing" ? "dropdownMenuOutUp 0.12s ease-in forwards" : "dropdownMenuInDown 0.12s ease-out"
2245
+ },
2246
+ children: typeof t == "function" ? t({ open: A, close: k }) : t
2247
+ }
2248
+ )
2249
+ }
2250
+ ),
2251
+ document.body
2252
+ )
2253
+ ] });
2254
+ }, Or = (r) => r < 1024 ? `${r} B` : r < 1024 * 1024 ? `${(r / 1024).toFixed(1)} KB` : r < 1024 * 1024 * 1024 ? `${(r / 1024 / 1024).toFixed(1)} MB` : `${(r / 1024 / 1024 / 1024).toFixed(1)} GB`, Ze = (r) => `${r.name}:${r.size}:${r.lastModified}`, Qt = (r, t) => {
2255
+ if (!t) return !0;
2256
+ const o = r.name.toLowerCase(), n = r.type.toLowerCase();
2257
+ return t.split(",").map((l) => l.trim().toLowerCase()).filter(Boolean).some((l) => l.startsWith(".") ? o.endsWith(l) : l.endsWith("/*") ? n.startsWith(l.slice(0, -1)) : n === l);
2258
+ }, Zt = Ge.forwardRef(
2259
+ ({
2260
+ value: r,
2261
+ onChange: t,
2262
+ accept: o,
2263
+ multiple: n = !1,
2264
+ maxFiles: l,
2265
+ maxSize: s,
2266
+ validateFile: d,
2267
+ onReject: f,
2268
+ disabled: u = !1,
2269
+ density: x = "default",
2270
+ hint: c,
2271
+ showFileList: a = !0,
2272
+ uploading: m = !1,
2273
+ progress: p,
2274
+ inputAriaLabel: I = "文件上传",
2275
+ className: D,
2276
+ ...j
2277
+ }, F) => {
2278
+ const [h, A] = R(!1), C = re(null), $ = x === "compact", V = n ? l ?? Number.POSITIVE_INFINITY : 1, W = (w) => {
2279
+ if (u || m || w.length === 0) return;
2280
+ const J = new Set(r.map(Ze)), Q = [], E = [];
2281
+ for (const M of w) {
2282
+ if (!Qt(M, o)) {
2283
+ E.push({ file: M, reason: "type", message: "文件格式不受支持" });
2284
+ continue;
2285
+ }
2286
+ if (s !== void 0 && M.size > s) {
2287
+ E.push({
2288
+ file: M,
2289
+ reason: "size",
2290
+ message: `文件大小不能超过 ${Or(s)}`
2291
+ });
2292
+ continue;
2293
+ }
2294
+ const Y = d == null ? void 0 : d(M);
2295
+ if (Y) {
2296
+ E.push({ file: M, reason: "custom", message: Y });
2297
+ continue;
2298
+ }
2299
+ const z = Ze(M);
2300
+ if (!J.has(z)) {
2301
+ if ((n ? r.length : 0) + Q.length >= V) {
2302
+ E.push({
2303
+ file: M,
2304
+ reason: "limit",
2305
+ message: `最多选择 ${V} 个文件`
2306
+ });
2307
+ continue;
2308
+ }
2309
+ J.add(z), Q.push(M);
2310
+ }
2311
+ }
2312
+ Q.length > 0 && t(n ? [...r, ...Q] : Q.slice(0, 1)), E.length > 0 && (f == null || f(E));
2313
+ }, k = (w) => {
2314
+ const J = Ze(w);
2315
+ t(r.filter((Q) => Ze(Q) !== J));
2316
+ }, H = p === void 0 ? void 0 : Math.min(100, Math.max(0, p));
2317
+ return /* @__PURE__ */ e.jsxs(
2318
+ "div",
2319
+ {
2320
+ ref: F,
2321
+ className: v("flex w-full min-w-0 flex-col", $ ? "gap-2" : "gap-4", D),
2322
+ ...j,
2323
+ children: [
2324
+ /* @__PURE__ */ e.jsx(
2325
+ "button",
2326
+ {
2327
+ type: "button",
2328
+ disabled: u || m,
2329
+ "aria-label": I,
2330
+ onClick: () => {
2331
+ var w;
2332
+ return (w = C.current) == null ? void 0 : w.click();
2333
+ },
2334
+ onDragEnter: (w) => {
2335
+ w.preventDefault(), !u && !m && A(!0);
2336
+ },
2337
+ onDragOver: (w) => w.preventDefault(),
2338
+ onDragLeave: (w) => {
2339
+ w.currentTarget.contains(w.relatedTarget) || A(!1);
2340
+ },
2341
+ onDrop: (w) => {
2342
+ w.preventDefault(), A(!1), W(Array.from(w.dataTransfer.files));
2343
+ },
2344
+ className: v(
2345
+ "relative w-full min-w-0 border-dashed text-[var(--lumen-color-text-muted)] transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--lumen-color-primary)]/20 disabled:cursor-not-allowed disabled:opacity-60",
2346
+ $ ? "min-h-11 rounded-[7px] border px-3" : "rounded-[var(--lumen-radius-card)] border-2 px-6 py-6",
2347
+ h ? "border-[var(--lumen-color-primary)] bg-[var(--lumen-color-primary-soft)] text-[var(--lumen-color-primary)]" : "border-[var(--lumen-color-border-hover)] bg-[var(--lumen-color-surface-muted)] hover:border-[var(--lumen-color-info-border)] hover:bg-[var(--lumen-color-surface-hover)] hover:text-[var(--lumen-color-primary)]"
2348
+ ),
2349
+ children: $ ? /* @__PURE__ */ e.jsxs("span", { className: "flex min-h-11 items-center justify-center gap-2 text-[12px]", children: [
2350
+ m ? /* @__PURE__ */ e.jsx(jr, { size: 16, className: "shrink-0 animate-spin" }) : /* @__PURE__ */ e.jsx(Ar, { size: 16, className: "shrink-0" }),
2351
+ /* @__PURE__ */ e.jsxs("span", { className: "min-w-0 text-left", children: [
2352
+ /* @__PURE__ */ e.jsx("span", { className: "block truncate", children: m ? "正在上传文件" : h ? "释放文件以上传" : "拖拽文件到此处,或点击上传" }),
2353
+ c ? /* @__PURE__ */ e.jsx("span", { className: "mt-0.5 block text-[11px] font-normal text-[var(--lumen-color-text-placeholder)]", children: c }) : null
2354
+ ] })
2355
+ ] }) : /* @__PURE__ */ e.jsxs("span", { className: "flex flex-col items-center", children: [
2356
+ /* @__PURE__ */ e.jsx(
2357
+ "span",
2358
+ {
2359
+ className: v(
2360
+ "flex h-11 w-11 items-center justify-center rounded-full bg-[var(--lumen-color-surface)] text-[var(--lumen-color-text-placeholder)] transition-all duration-200",
2361
+ h && "scale-110 bg-[var(--lumen-color-primary-soft)] text-[var(--lumen-color-primary)]"
2362
+ ),
2363
+ children: m ? /* @__PURE__ */ e.jsx(jr, { size: 20, className: "animate-spin" }) : /* @__PURE__ */ e.jsx(Ar, { size: 20 })
2364
+ }
2365
+ ),
2366
+ /* @__PURE__ */ e.jsx("span", { className: "mt-3 text-[14px] font-medium text-[var(--lumen-color-text-secondary)]", children: m ? "正在上传文件" : h ? "释放文件以上传" : "拖拽文件到此处,或点击选择文件" }),
2367
+ c ? /* @__PURE__ */ e.jsx("span", { className: "mt-1.5 text-[12px] text-[var(--lumen-color-text-placeholder)]", children: c }) : null
2368
+ ] })
2369
+ }
2370
+ ),
2371
+ /* @__PURE__ */ e.jsx(
2372
+ "input",
2373
+ {
2374
+ ref: C,
2375
+ type: "file",
2376
+ multiple: n,
2377
+ accept: o,
2378
+ disabled: u || m,
2379
+ className: "hidden",
2380
+ "aria-hidden": "true",
2381
+ tabIndex: -1,
2382
+ onChange: (w) => {
2383
+ W(Array.from(w.target.files ?? [])), w.target.value = "";
2384
+ }
2385
+ }
2386
+ ),
2387
+ m && H !== void 0 ? /* @__PURE__ */ e.jsx(
2388
+ "div",
2389
+ {
2390
+ className: "h-1.5 w-full overflow-hidden rounded-full bg-[var(--lumen-color-border)]",
2391
+ role: "progressbar",
2392
+ "aria-label": "上传进度",
2393
+ "aria-valuemin": 0,
2394
+ "aria-valuemax": 100,
2395
+ "aria-valuenow": Math.round(H),
2396
+ children: /* @__PURE__ */ e.jsx(
2397
+ "div",
2398
+ {
2399
+ className: "h-full rounded-full bg-[var(--lumen-color-primary)] transition-[width] duration-200",
2400
+ style: { width: `${H}%` }
2401
+ }
2402
+ )
2403
+ }
2404
+ ) : null,
2405
+ a && r.length > 0 ? /* @__PURE__ */ e.jsx("div", { className: v("border-t border-[var(--lumen-color-border)] pt-2", $ ? "space-y-1.5" : "space-y-2"), children: r.map((w) => /* @__PURE__ */ e.jsxs(
2406
+ "div",
2407
+ {
2408
+ className: v(
2409
+ "flex min-w-0 items-center gap-3 border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] px-3",
2410
+ $ ? "min-h-10 rounded-[7px] py-1.5" : `${Se.icon} min-h-12 py-2`
2411
+ ),
2412
+ children: [
2413
+ /* @__PURE__ */ e.jsx("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-[6px] bg-[var(--lumen-color-primary-soft)] text-[var(--lumen-color-primary)]", children: /* @__PURE__ */ e.jsx(ut, { size: 16 }) }),
2414
+ /* @__PURE__ */ e.jsxs("span", { className: "min-w-0 flex-1 text-left", children: [
2415
+ /* @__PURE__ */ e.jsx("span", { className: "block truncate text-[13px] font-medium text-[var(--lumen-color-text)]", children: w.name }),
2416
+ /* @__PURE__ */ e.jsx("span", { className: "mt-0.5 block text-[11px] text-[var(--lumen-color-text-placeholder)]", children: Or(w.size) })
2417
+ ] }),
2418
+ /* @__PURE__ */ e.jsx(
2419
+ "button",
2420
+ {
2421
+ type: "button",
2422
+ disabled: u || m,
2423
+ "aria-label": `移除 ${w.name}`,
2424
+ onClick: () => k(w),
2425
+ className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[var(--lumen-color-text-placeholder)] transition-colors hover:bg-[var(--lumen-color-surface-muted)] hover:text-[var(--lumen-color-danger)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--lumen-color-primary)]/20 disabled:cursor-not-allowed disabled:opacity-45",
2426
+ children: /* @__PURE__ */ e.jsx(ir, { size: 14 })
2427
+ }
2428
+ )
2429
+ ]
2430
+ },
2431
+ Ze(w)
2432
+ )) }) : null
2433
+ ]
2434
+ }
2435
+ );
2436
+ }
2437
+ );
2438
+ Zt.displayName = "FileUpload";
2439
+ const en = {
2440
+ sm: {
2441
+ root: "space-y-1",
2442
+ label: "text-[12px]",
2443
+ error: "text-[11px]"
2444
+ },
2445
+ md: {
2446
+ root: "space-y-1.5",
2447
+ label: "text-[13px]",
2448
+ error: "text-[12px]"
2449
+ },
2450
+ lg: {
2451
+ root: "space-y-2",
2452
+ label: "text-[14px]",
2453
+ error: "text-[12px]"
2454
+ }
2455
+ }, Xn = ({
2456
+ label: r,
2457
+ required: t = !1,
2458
+ error: o,
2459
+ children: n,
2460
+ size: l = "md",
2461
+ className: s,
2462
+ labelClassName: d,
2463
+ contentClassName: f,
2464
+ errorClassName: u,
2465
+ inputId: x
2466
+ }) => {
2467
+ const c = tr(), a = o ? `${c}-error` : void 0, m = !!o, p = {
2468
+ id: x,
2469
+ required: t,
2470
+ invalid: m,
2471
+ "aria-invalid": m || void 0,
2472
+ "aria-describedby": a
2473
+ }, I = en[l];
2474
+ return /* @__PURE__ */ e.jsxs("div", { className: v(I.root, s), children: [
2475
+ /* @__PURE__ */ e.jsxs(
2476
+ "label",
2477
+ {
2478
+ htmlFor: x,
2479
+ className: v(
2480
+ "block font-medium text-[var(--lumen-color-text-secondary)]",
2481
+ I.label,
2482
+ d
2483
+ ),
2484
+ children: [
2485
+ /* @__PURE__ */ e.jsx("span", { children: r }),
2486
+ /* @__PURE__ */ e.jsx(
2487
+ "span",
2488
+ {
2489
+ "aria-hidden": !t,
2490
+ className: v(
2491
+ "ml-1 inline-block w-[0.5em] align-middle text-[var(--lumen-color-danger)]",
2492
+ t ? "opacity-100" : "opacity-0"
2493
+ ),
2494
+ children: t ? "*" : ""
2495
+ }
2496
+ )
2497
+ ]
2498
+ }
2499
+ ),
2500
+ /* @__PURE__ */ e.jsx("div", { className: f, children: typeof n == "function" ? n(p) : n }),
2501
+ o && /* @__PURE__ */ e.jsx("p", { id: a, className: v("text-[var(--lumen-color-danger)]", I.error, u), children: o })
2502
+ ] });
2503
+ }, rn = {
2504
+ sm: "h-[32px] px-2.5 text-[12px]",
2505
+ md: "h-[36px] px-3 text-[13px]",
2506
+ lg: "h-[40px] px-3.5 text-[14px]"
2507
+ }, tn = {
2508
+ sm: "h-[32px] px-2.5 text-[12px]",
2509
+ md: "h-[36px] px-3 text-[13px]",
2510
+ lg: "h-[40px] px-3.5 text-[14px]"
2511
+ }, nn = "w-full border bg-[var(--lumen-color-surface)] text-[var(--lumen-color-text)] outline-none transition-all placeholder:text-[var(--lumen-color-text-placeholder)] disabled:cursor-not-allowed disabled:bg-[var(--lumen-color-surface-muted)] disabled:text-[var(--lumen-color-text-placeholder)] disabled:opacity-100", on = (r) => r ? "border-[var(--lumen-color-danger)] focus:border-[var(--lumen-color-danger)] focus:ring-2 focus:ring-[var(--lumen-color-danger)]/10" : "border-[var(--lumen-color-border-strong)] hover:border-[var(--lumen-color-border-hover)] focus:border-[var(--lumen-color-primary)] focus:ring-2 focus:ring-[var(--lumen-color-primary)]/10", sn = (r) => r ? "border-[var(--lumen-color-danger)] focus-within:border-[var(--lumen-color-danger)] focus-within:ring-2 focus-within:ring-[var(--lumen-color-danger)]/10" : "border-[var(--lumen-color-border-strong)] hover:border-[var(--lumen-color-border-hover)] focus-within:border-[var(--lumen-color-primary)] focus-within:ring-2 focus-within:ring-[var(--lumen-color-primary)]/10", ln = Ge.forwardRef(
2512
+ ({
2513
+ size: r = "lg",
2514
+ invalid: t = !1,
2515
+ prefix: o,
2516
+ suffix: n,
2517
+ className: l,
2518
+ inputClassName: s,
2519
+ disabled: d,
2520
+ ...f
2521
+ }, u) => o || n ? /* @__PURE__ */ e.jsxs(
2522
+ "div",
2523
+ {
2524
+ className: v(
2525
+ "flex w-full items-center gap-2 border bg-[var(--lumen-color-surface)] text-[var(--lumen-color-text)] outline-none transition-all",
2526
+ Se.control,
2527
+ tn[r],
2528
+ d ? "cursor-not-allowed border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface-muted)] text-[var(--lumen-color-text-placeholder)]" : sn(t),
2529
+ l
2530
+ ),
2531
+ children: [
2532
+ o && /* @__PURE__ */ e.jsx("span", { className: "flex shrink-0 items-center text-[var(--lumen-color-text-placeholder)]", children: o }),
2533
+ /* @__PURE__ */ e.jsx(
2534
+ "input",
2535
+ {
2536
+ ref: u,
2537
+ disabled: d,
2538
+ className: v(
2539
+ "min-w-0 flex-1 border-0 bg-transparent p-0 text-inherit outline-none placeholder:text-[var(--lumen-color-text-placeholder)] disabled:cursor-not-allowed",
2540
+ s
2541
+ ),
2542
+ ...f,
2543
+ autoComplete: "off"
2544
+ }
2545
+ ),
2546
+ n && /* @__PURE__ */ e.jsx("span", { className: "flex shrink-0 items-center text-[var(--lumen-color-text-placeholder)]", children: n })
2547
+ ]
2548
+ }
2549
+ ) : /* @__PURE__ */ e.jsx(
2550
+ "input",
2551
+ {
2552
+ ref: u,
2553
+ disabled: d,
2554
+ className: v(
2555
+ nn,
2556
+ Se.control,
2557
+ rn[r],
2558
+ on(t),
2559
+ l
2560
+ ),
2561
+ ...f,
2562
+ autoComplete: "off"
2563
+ }
2564
+ )
2565
+ );
2566
+ ln.displayName = "Input";
2567
+ function Qr(r, t = "left") {
2568
+ return `${t === "right" ? "right" : "left"} ${r ? "bottom" : "top"}`;
2569
+ }
2570
+ const an = 120, cn = {
2571
+ sm: "min-h-[32px] px-3 text-[12px]",
2572
+ md: "min-h-[36px] px-3 text-[13px]",
2573
+ lg: "min-h-[40px] px-3.5 text-[14px]"
2574
+ }, un = ({
2575
+ options: r,
2576
+ mode: t = "single",
2577
+ searchable: o = !1,
2578
+ placeholder: n = "请选择",
2579
+ disabled: l = !1,
2580
+ value: s,
2581
+ multipleTriggerDisplay: d = "chips",
2582
+ multipleCountLabel: f = (w) => `已选择 ${w} 项`,
2583
+ onChange: u,
2584
+ size: x = "md",
2585
+ className: c,
2586
+ triggerClassName: a,
2587
+ radius: m,
2588
+ onBeforeOpen: p,
2589
+ searchPlaceholder: I = "搜索...",
2590
+ emptyText: D = "无匹配选项",
2591
+ filterOptions: j = !0,
2592
+ loadingText: F = "加载中...",
2593
+ loading: h = !1,
2594
+ searchValue: A,
2595
+ onSearchChange: C,
2596
+ onOpenChange: $,
2597
+ renderTrigger: V,
2598
+ renderOption: W,
2599
+ optionClassName: k,
2600
+ "aria-label": H
2601
+ }) => {
2602
+ const [w, J] = R(!1), [Q, E] = R(!1), [M, Y] = R(!1), [z, K] = R(!1), [U, le] = R(""), [oe, i] = R(-1), [T, N] = R({
2603
+ position: "fixed",
2604
+ top: 0,
2605
+ left: 0,
2606
+ zIndex: 9999
2607
+ }), _ = re(null), se = re(null), ae = re(null), P = re(null), ie = A ?? U, Z = fe(() => t === "multiple" ? Array.isArray(s) ? s : [] : s == null ? [] : [s], [t, s]), ee = fe(() => {
2608
+ if (!j || !ie) return r;
2609
+ const b = ie.toLowerCase();
2610
+ return r.filter((O) => O.label.toLowerCase().includes(b));
2611
+ }, [j, r, ie]), ce = S(
2612
+ (b) => {
2613
+ A === void 0 && le(b), C == null || C(b);
2614
+ },
2615
+ [C, A]
2616
+ ), de = S(() => {
2617
+ var lr, Ke;
2618
+ if (!_.current) return;
2619
+ const b = _.current.getBoundingClientRect(), O = 240 + (o ? 58 : 0) + (t === "multiple" && Z.length > 0 ? 46 : 0) + 12, B = ((lr = ae.current) == null ? void 0 : lr.offsetHeight) || O, xe = 6, ue = 8, or = window.innerHeight - b.bottom < B, ur = or ? Math.max(ue, b.top - B - xe) : Math.min(window.innerHeight - ue, b.bottom + xe), sr = Math.max(0, window.innerWidth - ue * 2), De = Math.min(b.width, sr), qe = Math.max(
2620
+ De,
2621
+ Math.min(sr, 480)
2622
+ ), dr = Math.min(
2623
+ qe,
2624
+ Math.max(De, ((Ke = ae.current) == null ? void 0 : Ke.offsetWidth) || De)
2625
+ ), mr = Math.min(
2626
+ Math.max(ue, b.left),
2627
+ Math.max(ue, window.innerWidth - dr - ue)
2628
+ );
2629
+ K(or), N({
2630
+ position: "fixed",
2631
+ top: ur,
2632
+ left: mr,
2633
+ width: "max-content",
2634
+ minWidth: De,
2635
+ maxWidth: qe,
2636
+ zIndex: 9999
2637
+ });
2638
+ }, [t, o, Z.length]), te = S(() => {
2639
+ P.current && clearTimeout(P.current), E(!0), P.current = setTimeout(() => {
2640
+ J(!1), E(!1), ce(""), i(-1), $ == null || $(!1);
2641
+ }, an);
2642
+ }, [$, ce]), ve = S(() => {
2643
+ P.current && clearTimeout(P.current), J(!1), E(!1), ce(""), i(-1), $ == null || $(!1);
2644
+ }, [$, ce]), je = S(async () => {
2645
+ if (P.current && clearTimeout(P.current), p) {
2646
+ Y(!0);
2647
+ try {
2648
+ await p();
2649
+ } finally {
2650
+ Y(!1);
2651
+ }
2652
+ }
2653
+ J(!0), E(!1), ce(""), i(-1), $ == null || $(!0);
2654
+ }, [p, $, ce]), ye = S(
2655
+ (b) => {
2656
+ if (t === "single")
2657
+ u(b), ve();
2658
+ else {
2659
+ const O = Z.includes(b);
2660
+ u(O ? Z.filter((B) => B !== b) : [...Z, b]);
2661
+ }
2662
+ },
2663
+ [t, u, Z, ve]
2664
+ ), L = S(
2665
+ (b, O) => {
2666
+ O.stopPropagation(), u(Z.filter((B) => B !== b));
2667
+ },
2668
+ [u, Z]
2669
+ ), me = S(() => {
2670
+ u([]), le("");
2671
+ }, [u]);
2672
+ X(() => {
2673
+ if (!w) return;
2674
+ const b = (O) => {
2675
+ var xe, ue;
2676
+ const B = O.target;
2677
+ (xe = _.current) != null && xe.contains(B) || (ue = ae.current) != null && ue.contains(B) || te();
2678
+ };
2679
+ return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
2680
+ }, [w, te]), X(() => {
2681
+ w && o && se.current && se.current.focus();
2682
+ }, [w, o]), X(() => {
2683
+ if (w)
2684
+ return de(), window.addEventListener("scroll", de, !0), window.addEventListener("resize", de), () => {
2685
+ window.removeEventListener("scroll", de, !0), window.removeEventListener("resize", de);
2686
+ };
2687
+ }, [w, de]), X(() => {
2688
+ if (!w) return;
2689
+ const b = window.requestAnimationFrame(() => {
2690
+ de();
2691
+ });
2692
+ if (!ae.current || typeof ResizeObserver > "u")
2693
+ return () => {
2694
+ window.cancelAnimationFrame(b);
2695
+ };
2696
+ const O = new ResizeObserver(() => {
2697
+ de();
2698
+ });
2699
+ return O.observe(ae.current), () => {
2700
+ window.cancelAnimationFrame(b), O.disconnect();
2701
+ };
2702
+ }, [
2703
+ w,
2704
+ de,
2705
+ ee.length,
2706
+ o,
2707
+ Z.length
2708
+ ]), X(() => {
2709
+ i(-1);
2710
+ }, [ee]), X(() => () => {
2711
+ P.current && clearTimeout(P.current);
2712
+ }, []);
2713
+ const q = S(
2714
+ (b) => {
2715
+ if (!w) {
2716
+ (b.key === "Enter" || b.key === " ") && (b.preventDefault(), je());
2717
+ return;
2718
+ }
2719
+ switch (b.key) {
2720
+ case "Escape":
2721
+ ve();
2722
+ break;
2723
+ case "Enter":
2724
+ if (b.preventDefault(), oe >= 0 && oe < ee.length) {
2725
+ const O = ee[oe];
2726
+ O && !O.disabled && ye(O.value);
2727
+ }
2728
+ break;
2729
+ case "ArrowDown":
2730
+ b.preventDefault(), i((O) => {
2731
+ var xe;
2732
+ let B = O + 1;
2733
+ for (; B < ee.length && ((xe = ee[B]) != null && xe.disabled); )
2734
+ B++;
2735
+ return B >= ee.length ? O : B;
2736
+ });
2737
+ break;
2738
+ case "ArrowUp":
2739
+ b.preventDefault(), i((O) => {
2740
+ var xe;
2741
+ let B = O - 1;
2742
+ for (; B >= 0 && ((xe = ee[B]) != null && xe.disabled); ) B--;
2743
+ return B < 0 ? O : B;
2744
+ });
2745
+ break;
2746
+ }
2747
+ },
2748
+ [
2749
+ w,
2750
+ oe,
2751
+ ee,
2752
+ ye,
2753
+ ve,
2754
+ je
2755
+ ]
2756
+ ), g = S(
2757
+ (b) => r.find((O) => O.value === b),
2758
+ [r]
2759
+ ), G = () => {
2760
+ if (V)
2761
+ return V(
2762
+ Z.map((B) => g(B)).filter(Boolean)
2763
+ );
2764
+ if (Z.length === 0)
2765
+ return /* @__PURE__ */ e.jsx("span", { className: "min-w-0 flex-1 truncate text-[var(--lumen-color-text-placeholder)]", children: n });
2766
+ const b = Z[0], O = b === void 0 ? void 0 : g(b);
2767
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
2768
+ (O == null ? void 0 : O.icon) && /* @__PURE__ */ e.jsx("span", { className: "shrink-0", children: O.icon }),
2769
+ /* @__PURE__ */ e.jsx("span", { className: "truncate text-[var(--lumen-color-text)]", children: O == null ? void 0 : O.label })
2770
+ ] });
2771
+ }, ne = () => d === "placeholder" ? /* @__PURE__ */ e.jsx("div", { className: "flex min-w-0 flex-1 py-1", children: /* @__PURE__ */ e.jsx("span", { className: "truncate text-[var(--lumen-color-text-placeholder)]", children: n }) }) : d === "count" ? /* @__PURE__ */ e.jsx("div", { className: "flex min-w-0 flex-1 py-1", children: Z.length > 0 ? /* @__PURE__ */ e.jsx("span", { className: "truncate text-[var(--lumen-color-text)]", children: f(Z.length) }) : /* @__PURE__ */ e.jsx("span", { className: "text-[var(--lumen-color-text-placeholder)]", children: n }) }) : /* @__PURE__ */ e.jsx("div", { className: "flex min-w-0 flex-1 flex-wrap gap-1.5 py-1", children: Z.length > 0 ? Z.map((b) => {
2772
+ const O = g(b);
2773
+ return /* @__PURE__ */ e.jsxs(
2774
+ "span",
2775
+ {
2776
+ className: "inline-flex items-center gap-1 rounded-[6px] bg-[var(--lumen-color-primary-soft)] px-2 py-0.5 text-[13px] text-[var(--lumen-color-primary)]",
2777
+ children: [
2778
+ (O == null ? void 0 : O.label) ?? String(b),
2779
+ /* @__PURE__ */ e.jsx(
2780
+ ir,
2781
+ {
2782
+ size: 12,
2783
+ className: "cursor-pointer text-[var(--lumen-color-primary)]/60 hover:text-[var(--lumen-color-primary)]",
2784
+ onClick: (B) => L(b, B)
2785
+ }
2786
+ )
2787
+ ]
2788
+ },
2789
+ String(b)
2790
+ );
2791
+ }) : /* @__PURE__ */ e.jsx("span", { className: "text-[var(--lumen-color-text-placeholder)]", children: n }) }), he = () => /* @__PURE__ */ e.jsx("div", { className: "border-b border-[var(--lumen-color-surface-muted)] p-2.5", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 rounded-[8px] bg-[var(--lumen-color-surface-muted)] px-3 py-2", children: [
2792
+ /* @__PURE__ */ e.jsx(Kr, { size: 14, className: "shrink-0 text-[var(--lumen-color-text-placeholder)]" }),
2793
+ /* @__PURE__ */ e.jsx(
2794
+ "input",
2795
+ {
2796
+ ref: se,
2797
+ className: "w-full bg-transparent text-[13px] text-[var(--lumen-color-text)] outline-none placeholder:text-[var(--lumen-color-text-placeholder)]",
2798
+ placeholder: I,
2799
+ value: ie,
2800
+ onChange: (b) => ce(b.target.value)
2801
+ }
2802
+ )
2803
+ ] }) }), Ne = (b, O) => {
2804
+ const B = Z.includes(b.value), xe = O === oe, ue = {
2805
+ selected: B,
2806
+ highlighted: xe,
2807
+ disabled: !!b.disabled,
2808
+ index: O
2809
+ };
2810
+ return t === "multiple" ? /* @__PURE__ */ e.jsx(
2811
+ "button",
2812
+ {
2813
+ type: "button",
2814
+ disabled: b.disabled,
2815
+ onClick: () => !b.disabled && ye(b.value),
2816
+ onMouseEnter: () => !b.disabled && i(O),
2817
+ className: v(
2818
+ W ? "block w-full text-left transition-all" : "flex w-full items-center gap-2.5 rounded-[8px] px-3 py-2.5 text-left text-[13px] transition-colors",
2819
+ b.disabled && "cursor-not-allowed opacity-40",
2820
+ !W && (B ? "bg-[var(--lumen-color-primary-soft)] text-[var(--lumen-color-primary)]" : "text-[var(--lumen-color-text-secondary)] hover:bg-[var(--lumen-color-surface-muted)]"),
2821
+ !W && xe && !b.disabled && !B && "bg-[var(--lumen-color-surface-muted)]",
2822
+ k == null ? void 0 : k(b, ue)
2823
+ ),
2824
+ children: W ? W(b, ue) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2825
+ /* @__PURE__ */ e.jsx(
2826
+ "div",
2827
+ {
2828
+ className: v(
2829
+ "flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[4px] border transition-colors",
2830
+ B ? "border-[var(--lumen-color-primary)] bg-[var(--lumen-color-primary)]" : "border-[var(--lumen-color-border-strong)]"
2831
+ ),
2832
+ children: B && /* @__PURE__ */ e.jsx(Vr, { size: 12, className: "text-[var(--lumen-color-on-primary)]" })
2833
+ }
2834
+ ),
2835
+ b.icon && /* @__PURE__ */ e.jsx("span", { className: "shrink-0", children: b.icon }),
2836
+ /* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
2837
+ /* @__PURE__ */ e.jsx("div", { className: "leading-5", children: b.label }),
2838
+ b.description && /* @__PURE__ */ e.jsx("div", { className: "text-[12px] text-[var(--lumen-color-text-placeholder)]", children: b.description })
2839
+ ] })
2840
+ ] })
2841
+ },
2842
+ String(b.value)
2843
+ ) : /* @__PURE__ */ e.jsx(
2844
+ "button",
2845
+ {
2846
+ type: "button",
2847
+ disabled: b.disabled,
2848
+ onClick: () => !b.disabled && ye(b.value),
2849
+ onMouseEnter: () => !b.disabled && i(O),
2850
+ className: v(
2851
+ W ? "block w-full text-left transition-all" : "flex w-full items-center gap-2 rounded-[8px] pl-3 pr-2 py-2.5 text-left text-[13px] transition-colors",
2852
+ b.disabled && "cursor-not-allowed opacity-40",
2853
+ !W && (B ? "bg-[var(--lumen-color-primary-soft)] font-medium text-[var(--lumen-color-primary)]" : "text-[var(--lumen-color-text-secondary)] hover:bg-[var(--lumen-color-surface-muted)]"),
2854
+ !W && xe && !b.disabled && !B && "bg-[var(--lumen-color-surface-muted)]",
2855
+ k == null ? void 0 : k(b, ue)
2856
+ ),
2857
+ children: W ? W(b, ue) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2858
+ b.icon && /* @__PURE__ */ e.jsx("span", { className: "shrink-0", children: b.icon }),
2859
+ /* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
2860
+ /* @__PURE__ */ e.jsx("div", { className: "leading-5", children: b.label }),
2861
+ b.description && /* @__PURE__ */ e.jsx("div", { className: "text-[12px] text-[var(--lumen-color-text-placeholder)]", children: b.description })
2862
+ ] })
2863
+ ] })
2864
+ },
2865
+ String(b.value)
2866
+ );
2867
+ }, ke = () => /* @__PURE__ */ e.jsx("div", { className: "px-3 py-4 text-center text-[13px] text-[var(--lumen-color-text-placeholder)]", children: D }), Ee = () => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between border-t border-[var(--lumen-color-surface-muted)] px-3 py-2.5", children: [
2868
+ /* @__PURE__ */ e.jsxs("span", { className: "text-[12px] text-[var(--lumen-color-text-placeholder)]", children: [
2869
+ "已选 ",
2870
+ Z.length,
2871
+ " 项"
2872
+ ] }),
2873
+ /* @__PURE__ */ e.jsx(
2874
+ "button",
2875
+ {
2876
+ type: "button",
2877
+ onClick: me,
2878
+ className: "text-[12px] text-[var(--lumen-color-text-placeholder)] transition-colors hover:text-[var(--lumen-color-text-muted)]",
2879
+ children: "清空"
2880
+ }
2881
+ )
2882
+ ] });
2883
+ return /* @__PURE__ */ e.jsxs(
2884
+ "div",
2885
+ {
2886
+ ref: _,
2887
+ className: v("relative", c),
2888
+ onKeyDown: q,
2889
+ children: [
2890
+ /* @__PURE__ */ e.jsxs(
2891
+ "button",
2892
+ {
2893
+ type: "button",
2894
+ "data-testid": "select-trigger",
2895
+ "aria-label": H,
2896
+ "aria-expanded": w,
2897
+ "aria-haspopup": "listbox",
2898
+ disabled: l,
2899
+ onClick: () => {
2900
+ l || M || (w ? te() : je());
2901
+ },
2902
+ className: v(
2903
+ "flex w-full items-center gap-2 border bg-[var(--lumen-color-surface)] text-left outline-none transition-all",
2904
+ m ?? Se.control,
2905
+ cn[x],
2906
+ l || M ? "cursor-not-allowed border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface-muted)] opacity-50" : w ? "border-[var(--lumen-color-primary)] ring-1 ring-[var(--lumen-color-primary)]/10" : "border-[var(--lumen-color-border)] hover:border-[var(--lumen-color-border-hover)]",
2907
+ a
2908
+ ),
2909
+ children: [
2910
+ t === "multiple" ? ne() : G(),
2911
+ h || M ? /* @__PURE__ */ e.jsx(
2912
+ jr,
2913
+ {
2914
+ size: 16,
2915
+ className: "shrink-0 animate-spin text-[var(--lumen-color-text-placeholder)]"
2916
+ }
2917
+ ) : /* @__PURE__ */ e.jsx(
2918
+ rr,
2919
+ {
2920
+ size: 16,
2921
+ className: v(
2922
+ "shrink-0 text-[var(--lumen-color-text-placeholder)] transition-transform duration-200",
2923
+ w && "rotate-180"
2924
+ )
2925
+ }
2926
+ )
2927
+ ]
2928
+ }
2929
+ ),
2930
+ w && Re(
2931
+ /* @__PURE__ */ e.jsxs(
2932
+ "div",
2933
+ {
2934
+ ref: ae,
2935
+ "data-testid": "select-dropdown",
2936
+ className: v(
2937
+ Se.card,
2938
+ "border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] shadow-[0_8px_30px_var(--lumen-color-shadow)]"
2939
+ ),
2940
+ style: {
2941
+ ...T,
2942
+ animation: Q ? z ? "lumen-dropdown-out-up 0.12s ease-in forwards" : "lumen-dropdown-out 0.12s ease-in forwards" : z ? "lumen-dropdown-in-up 0.12s ease-out" : "lumen-dropdown-in 0.12s ease-out",
2943
+ transformOrigin: Qr(z)
2944
+ },
2945
+ children: [
2946
+ o && he(),
2947
+ /* @__PURE__ */ e.jsx("div", { className: "max-h-[252px] overflow-y-auto p-1.5", children: h ? /* @__PURE__ */ e.jsx("div", { className: "px-3 py-4 text-center text-[13px] text-[var(--lumen-color-text-placeholder)]", children: F }) : ee.length === 0 ? ke() : ee.map((b, O) => {
2948
+ var ue;
2949
+ const B = (ue = ee[O - 1]) == null ? void 0 : ue.group, xe = b.group && b.group !== B;
2950
+ return /* @__PURE__ */ e.jsxs(Ge.Fragment, { children: [
2951
+ xe && /* @__PURE__ */ e.jsx("div", { className: "px-3 pb-1 pt-2 text-[11px] font-medium text-[var(--lumen-color-text-placeholder)]", children: b.group }),
2952
+ Ne(b, O)
2953
+ ] }, String(b.value));
2954
+ }) }),
2955
+ t === "multiple" && Z.length > 0 && Ee()
2956
+ ]
2957
+ }
2958
+ ),
2959
+ document.body
2960
+ )
2961
+ ]
2962
+ }
2963
+ );
2964
+ }, dn = (r, t) => {
2965
+ if (t <= 5)
2966
+ return Array.from({ length: t }, (s, d) => d + 1);
2967
+ const o = [1], n = Math.max(2, r - 1), l = Math.min(t - 1, r + 1);
2968
+ n > 2 && o.push("ellipsis-left");
2969
+ for (let s = n; s <= l; s += 1)
2970
+ o.push(s);
2971
+ return l < t - 1 && o.push("ellipsis-right"), o.push(t), o;
2972
+ }, Jn = ({
2973
+ currentPage: r,
2974
+ totalPages: t,
2975
+ totalItems: o,
2976
+ onPageChange: n,
2977
+ variant: l = "default",
2978
+ loading: s = !1,
2979
+ itemLabel: d = "条",
2980
+ hideOnSinglePage: f,
2981
+ pageSize: u,
2982
+ pageSizeOptions: x,
2983
+ onPageSizeChange: c,
2984
+ className: a = ""
2985
+ }) => {
2986
+ const m = Math.max(1, t), p = Math.min(Math.max(1, r), m), I = fe(
2987
+ () => Array.from(new Set((x ?? []).filter((h) => h > 0))).sort(
2988
+ (h, A) => h - A
2989
+ ),
2990
+ [x]
2991
+ ), D = typeof u == "number" && typeof c == "function" && I.length > 0, j = fe(
2992
+ () => dn(p, m),
2993
+ [p, m]
2994
+ );
2995
+ return (f ?? l === "compact") && t <= 1 ? null : l === "compact" ? /* @__PURE__ */ e.jsxs(
2996
+ "div",
2997
+ {
2998
+ className: v(
2999
+ "flex shrink-0 flex-col gap-2 border-t border-[var(--lumen-color-border)] px-3 py-2 text-xs text-[var(--lumen-color-text-muted)] pad:flex-row pad:items-center pad:justify-between pad:py-1.5",
3000
+ a
3001
+ ),
3002
+ children: [
3003
+ /* @__PURE__ */ e.jsxs("span", { children: [
3004
+ "共 ",
3005
+ o,
3006
+ " ",
3007
+ d,
3008
+ " · 第 ",
3009
+ p,
3010
+ " / ",
3011
+ m,
3012
+ " 页"
3013
+ ] }),
3014
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
3015
+ /* @__PURE__ */ e.jsx(
3016
+ Be,
3017
+ {
3018
+ disabled: p <= 1 || s,
3019
+ onClick: () => n(p - 1),
3020
+ size: "sm",
3021
+ type: "button",
3022
+ variant: "secondary",
3023
+ children: "上一页"
3024
+ }
3025
+ ),
3026
+ /* @__PURE__ */ e.jsx(
3027
+ Be,
3028
+ {
3029
+ disabled: p >= m || s,
3030
+ onClick: () => n(p + 1),
3031
+ size: "sm",
3032
+ type: "button",
3033
+ variant: "secondary",
3034
+ children: "下一页"
3035
+ }
3036
+ )
3037
+ ] })
3038
+ ]
3039
+ }
3040
+ ) : /* @__PURE__ */ e.jsxs(
3041
+ "div",
3042
+ {
3043
+ className: v(
3044
+ "flex flex-col gap-3 border-t border-[var(--lumen-color-surface-muted)] bg-[var(--lumen-color-surface-subtle)] px-3 py-3 pad:px-4 l:flex-row l:items-center l:justify-between xl:px-5 xl:py-4",
3045
+ a
3046
+ ),
3047
+ children: [
3048
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
3049
+ /* @__PURE__ */ e.jsxs("span", { className: "text-[12px] text-[var(--lumen-color-text-muted)]", children: [
3050
+ "共 ",
3051
+ o,
3052
+ " 条"
3053
+ ] }),
3054
+ /* @__PURE__ */ e.jsxs("span", { className: "text-[12px] text-[var(--lumen-color-text-muted)]", children: [
3055
+ "第 ",
3056
+ p,
3057
+ " / ",
3058
+ m,
3059
+ " 页"
3060
+ ] }),
3061
+ D ? /* @__PURE__ */ e.jsx("div", { className: "w-[108px]", children: /* @__PURE__ */ e.jsx(
3062
+ un,
3063
+ {
3064
+ options: I.map((h) => ({
3065
+ label: `${h}条/页`,
3066
+ value: h
3067
+ })),
3068
+ value: u,
3069
+ onChange: (h) => c(Number(h)),
3070
+ disabled: s,
3071
+ size: "sm",
3072
+ className: "w-full",
3073
+ radius: "rounded-[8px]"
3074
+ }
3075
+ ) }) : null
3076
+ ] }),
3077
+ /* @__PURE__ */ e.jsxs("div", { className: "flex max-w-full flex-wrap items-center gap-0.5 overflow-x-auto", children: [
3078
+ /* @__PURE__ */ e.jsx(
3079
+ "button",
3080
+ {
3081
+ type: "button",
3082
+ "aria-label": "上一页",
3083
+ onClick: () => n(p - 1),
3084
+ disabled: p <= 1 || s,
3085
+ className: "flex h-[28px] w-[28px] items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors hover:bg-[var(--lumen-color-primary-soft)] disabled:cursor-not-allowed disabled:opacity-30",
3086
+ children: /* @__PURE__ */ e.jsx(Pe, { size: 14 })
3087
+ }
3088
+ ),
3089
+ j.map(
3090
+ (h) => typeof h == "number" ? /* @__PURE__ */ e.jsx(
3091
+ "button",
3092
+ {
3093
+ type: "button",
3094
+ onClick: () => n(h),
3095
+ disabled: s,
3096
+ "aria-current": h === p ? "page" : void 0,
3097
+ className: v(
3098
+ "h-[28px] w-[28px] rounded-[6px] text-[12px] transition-colors",
3099
+ h === p ? "bg-[var(--lumen-color-primary)] font-medium text-[var(--lumen-color-on-primary)]" : "text-[var(--lumen-color-text-muted)] hover:bg-[var(--lumen-color-primary-soft)]"
3100
+ ),
3101
+ children: h
3102
+ },
3103
+ h
3104
+ ) : /* @__PURE__ */ e.jsx(
3105
+ "span",
3106
+ {
3107
+ className: "flex h-[28px] w-[28px] items-center justify-center text-[12px] text-[var(--lumen-color-text-placeholder)]",
3108
+ children: "..."
3109
+ },
3110
+ h
3111
+ )
3112
+ ),
3113
+ /* @__PURE__ */ e.jsx(
3114
+ "button",
3115
+ {
3116
+ type: "button",
3117
+ "aria-label": "下一页",
3118
+ onClick: () => n(p + 1),
3119
+ disabled: p >= m || s,
3120
+ className: "flex h-[28px] w-[28px] items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors hover:bg-[var(--lumen-color-primary-soft)] disabled:cursor-not-allowed disabled:opacity-30",
3121
+ children: /* @__PURE__ */ e.jsx(Me, { size: 14 })
3122
+ }
3123
+ )
3124
+ ] })
3125
+ ]
3126
+ }
3127
+ );
3128
+ }, Qn = ({
3129
+ size: r = "sm",
3130
+ checked: t,
3131
+ defaultChecked: o = !1,
3132
+ disabled: n = !1,
3133
+ label: l,
3134
+ description: s,
3135
+ onChange: d,
3136
+ className: f,
3137
+ id: u,
3138
+ ...x
3139
+ }) => {
3140
+ const c = tr(), a = u ?? c, m = `${a}-label`, p = `${a}-description`, I = typeof t == "boolean", [D, j] = R(o), F = I ? t : D, h = r === "sm", A = !!s, C = ($) => {
3141
+ if (n) return;
3142
+ const V = $.target.checked;
3143
+ I || j(V), d == null || d(V);
3144
+ };
3145
+ return /* @__PURE__ */ e.jsxs(
3146
+ "label",
3147
+ {
3148
+ htmlFor: a,
3149
+ className: v(
3150
+ "inline-flex gap-3",
3151
+ A ? "items-start" : "items-center",
3152
+ h && "gap-2",
3153
+ n ? "cursor-not-allowed opacity-55" : "cursor-pointer",
3154
+ f
3155
+ ),
3156
+ children: [
3157
+ /* @__PURE__ */ e.jsxs(
3158
+ "span",
3159
+ {
3160
+ className: v(
3161
+ "relative inline-flex shrink-0 items-center justify-center",
3162
+ A && "mt-0.5",
3163
+ h ? "h-4 w-4" : "h-5 w-5"
3164
+ ),
3165
+ children: [
3166
+ /* @__PURE__ */ e.jsx(
3167
+ "input",
3168
+ {
3169
+ ...x,
3170
+ id: a,
3171
+ type: "radio",
3172
+ checked: F,
3173
+ disabled: n,
3174
+ "aria-labelledby": l ? m : void 0,
3175
+ "aria-describedby": s ? p : void 0,
3176
+ "aria-label": typeof l == "string" ? l : x["aria-label"],
3177
+ className: "peer sr-only",
3178
+ onChange: C
3179
+ }
3180
+ ),
3181
+ /* @__PURE__ */ e.jsx(
3182
+ "span",
3183
+ {
3184
+ "aria-hidden": "true",
3185
+ className: v(
3186
+ "flex items-center justify-center rounded-full border transition-all",
3187
+ h ? "h-4 w-4" : "h-5 w-5",
3188
+ F ? "border-[var(--lumen-color-primary)] bg-[var(--lumen-color-surface)] text-[var(--lumen-color-primary)] shadow-[0_8px_18px_var(--lumen-color-focus-ring)]" : "border-[var(--lumen-color-border-hover)] bg-[var(--lumen-color-surface)] text-transparent",
3189
+ !n && "peer-focus-visible:ring-2 peer-focus-visible:ring-[var(--lumen-color-info-border)]/70 peer-focus-visible:ring-offset-2",
3190
+ !n && !F && "hover:border-[var(--lumen-color-info-border)] hover:bg-[var(--lumen-color-surface-hover)]"
3191
+ ),
3192
+ children: /* @__PURE__ */ e.jsx(
3193
+ dt,
3194
+ {
3195
+ size: h ? 8 : 10,
3196
+ className: F ? "fill-current text-current" : "text-transparent"
3197
+ }
3198
+ )
3199
+ }
3200
+ )
3201
+ ]
3202
+ }
3203
+ ),
3204
+ (l || s) && /* @__PURE__ */ e.jsxs("span", { className: "min-w-0", children: [
3205
+ l ? /* @__PURE__ */ e.jsx(
3206
+ "span",
3207
+ {
3208
+ id: m,
3209
+ className: v(
3210
+ "block font-normal",
3211
+ F ? "text-[var(--lumen-color-text)]" : "text-[var(--lumen-color-text-muted)]",
3212
+ "text-[13px] leading-5"
3213
+ ),
3214
+ children: l
3215
+ }
3216
+ ) : null,
3217
+ s ? /* @__PURE__ */ e.jsx(
3218
+ "span",
3219
+ {
3220
+ id: p,
3221
+ className: v(
3222
+ "mt-0.5 block text-[var(--lumen-color-text-muted)]",
3223
+ h ? "text-[11px] leading-4.5" : "text-[12px] leading-5"
3224
+ ),
3225
+ children: s
3226
+ }
3227
+ ) : null
3228
+ ] })
3229
+ ]
3230
+ }
3231
+ );
3232
+ }, mn = {
3233
+ sm: "h-7 px-3 text-[12px]",
3234
+ md: "h-8 px-3.5 text-[13px]"
3235
+ }, Zn = ({
3236
+ value: r,
3237
+ options: t,
3238
+ onChange: o,
3239
+ size: n = "sm",
3240
+ fullWidth: l = !1,
3241
+ className: s,
3242
+ role: d = "group",
3243
+ ...f
3244
+ }) => /* @__PURE__ */ e.jsx(
3245
+ "div",
3246
+ {
3247
+ role: d,
3248
+ className: v(
3249
+ "inline-flex max-w-full gap-1 border border-[var(--lumen-color-border)]/80 bg-[var(--lumen-color-surface-glass)] p-1 backdrop-blur-[5px]",
3250
+ Se.control,
3251
+ l && "flex w-full",
3252
+ s
3253
+ ),
3254
+ ...f,
3255
+ children: t.map((u) => {
3256
+ const x = u.value === r;
3257
+ return /* @__PURE__ */ e.jsx(
3258
+ "button",
3259
+ {
3260
+ type: "button",
3261
+ "aria-pressed": x,
3262
+ disabled: u.disabled,
3263
+ onClick: () => o(u.value),
3264
+ className: v(
3265
+ "inline-flex min-w-0 items-center justify-center whitespace-nowrap rounded-[5px] font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--lumen-color-primary)]/20 disabled:cursor-not-allowed disabled:opacity-45",
3266
+ mn[n],
3267
+ l && "flex-1",
3268
+ x ? "bg-[var(--lumen-color-primary)] text-[var(--lumen-color-on-primary)]" : "text-[var(--lumen-color-text-muted)] hover:bg-[var(--lumen-color-surface-muted)] hover:text-[var(--lumen-color-text)]"
3269
+ ),
3270
+ children: u.label
3271
+ },
3272
+ u.value
3273
+ );
3274
+ })
3275
+ }
3276
+ ), eo = ({
3277
+ size: r = "md",
3278
+ checked: t,
3279
+ defaultChecked: o = !1,
3280
+ disabled: n = !1,
3281
+ label: l,
3282
+ description: s,
3283
+ onChange: d,
3284
+ className: f,
3285
+ id: u,
3286
+ ...x
3287
+ }) => {
3288
+ const c = tr(), a = u ?? c, m = `${a}-label`, p = `${a}-description`, I = typeof t == "boolean", [D, j] = R(o), F = I ? t : D, h = r === "sm", A = (C) => {
3289
+ if (n) return;
3290
+ const $ = C.target.checked;
3291
+ I || j($), d == null || d($);
3292
+ };
3293
+ return /* @__PURE__ */ e.jsxs(
3294
+ "label",
3295
+ {
3296
+ htmlFor: a,
3297
+ className: v(
3298
+ "inline-flex items-center gap-3",
3299
+ n ? "cursor-not-allowed opacity-55" : "cursor-pointer",
3300
+ f
3301
+ ),
3302
+ children: [
3303
+ (l || s) && /* @__PURE__ */ e.jsxs("span", { className: "min-w-0", children: [
3304
+ l ? /* @__PURE__ */ e.jsx("span", { id: m, className: "block text-[14px] font-medium text-[var(--lumen-color-text)]", children: l }) : null,
3305
+ s ? /* @__PURE__ */ e.jsx("span", { id: p, className: "mt-0.5 block text-[12px] leading-5 text-[var(--lumen-color-text-muted)]", children: s }) : null
3306
+ ] }),
3307
+ /* @__PURE__ */ e.jsxs(
3308
+ "span",
3309
+ {
3310
+ className: v(
3311
+ "relative inline-flex shrink-0 items-center",
3312
+ h ? "h-4 w-7" : "h-6 w-11"
3313
+ ),
3314
+ "data-switch-track": !0,
3315
+ "data-checked": F ? "true" : "false",
3316
+ children: [
3317
+ /* @__PURE__ */ e.jsx(
3318
+ "input",
3319
+ {
3320
+ ...x,
3321
+ id: a,
3322
+ type: "checkbox",
3323
+ role: "switch",
3324
+ checked: F,
3325
+ disabled: n,
3326
+ "aria-labelledby": l ? m : void 0,
3327
+ "aria-describedby": s ? p : void 0,
3328
+ "aria-label": typeof l == "string" ? l : x["aria-label"],
3329
+ className: "peer sr-only",
3330
+ onChange: A
3331
+ }
3332
+ ),
3333
+ /* @__PURE__ */ e.jsx(
3334
+ "span",
3335
+ {
3336
+ "aria-hidden": "true",
3337
+ className: v(
3338
+ "absolute inset-0 rounded-full transition-colors duration-200 ease-out",
3339
+ F ? "bg-[var(--lumen-color-primary)] shadow-[0_10px_24px_var(--lumen-color-focus-ring)]" : "bg-[var(--lumen-color-border-hover)]",
3340
+ !n && "peer-focus-visible:ring-2 peer-focus-visible:ring-[var(--lumen-color-info-border)]/70 peer-focus-visible:ring-offset-2"
3341
+ )
3342
+ }
3343
+ ),
3344
+ /* @__PURE__ */ e.jsx(
3345
+ "span",
3346
+ {
3347
+ "aria-hidden": "true",
3348
+ "data-switch-knob": !0,
3349
+ className: v(
3350
+ "absolute top-1/2 -translate-y-1/2 rounded-full border border-[var(--lumen-color-surface)]/80 bg-[var(--lumen-color-surface)] shadow-[0_2px_8px_var(--lumen-color-shadow)] transition-transform duration-200 ease-out",
3351
+ h ? "left-[2px] h-3 w-3" : "left-[2px] h-5 w-5",
3352
+ F ? h ? "translate-x-3" : "translate-x-5" : "translate-x-0"
3353
+ )
3354
+ }
3355
+ )
3356
+ ]
3357
+ }
3358
+ )
3359
+ ]
3360
+ }
3361
+ );
3362
+ }, ro = ({
3363
+ value: r,
3364
+ options: t,
3365
+ onChange: o,
3366
+ variant: n = "default",
3367
+ className: l = "",
3368
+ gridClassName: s,
3369
+ itemClassName: d = "",
3370
+ aside: f
3371
+ }) => {
3372
+ const u = jt[n], x = s ?? (n === "card" ? "grid grid-cols-1 gap-2 pad:grid-cols-2 l:grid-cols-3 xl:grid-cols-4 xxl:grid-cols-5 xxxl:grid-cols-6" : "flex items-center gap-2 overflow-x-auto");
3373
+ return /* @__PURE__ */ e.jsx("div", { "data-ui": "tabs-surface", className: v(u.container, l), children: /* @__PURE__ */ e.jsxs("div", { className: v("flex flex-col gap-3 pad:gap-4 l:flex-row l:items-center l:justify-between"), children: [
3374
+ /* @__PURE__ */ e.jsx(
3375
+ "div",
3376
+ {
3377
+ role: "tablist",
3378
+ "data-testid": "tabs-grid",
3379
+ className: v(x, f ? "min-w-0 flex-1" : ""),
3380
+ children: t.map((c) => {
3381
+ const a = c.value === r, m = c.icon;
3382
+ return /* @__PURE__ */ e.jsxs(
3383
+ "button",
3384
+ {
3385
+ role: "tab",
3386
+ type: "button",
3387
+ "aria-selected": a,
3388
+ "aria-disabled": c.disabled || void 0,
3389
+ disabled: c.disabled,
3390
+ onClick: () => {
3391
+ c.disabled || o(c.value);
3392
+ },
3393
+ className: v(
3394
+ u.base,
3395
+ a ? u.active : u.inactive,
3396
+ c.disabled ? "cursor-not-allowed opacity-45 hover:translate-y-0" : "",
3397
+ d
3398
+ ),
3399
+ children: [
3400
+ m ? u.iconBase ? /* @__PURE__ */ e.jsx("span", { className: v(u.iconBase, a ? u.iconActive : u.iconInactive), children: /* @__PURE__ */ e.jsx(m, { size: 16, className: "shrink-0", strokeWidth: 2.2 }) }) : /* @__PURE__ */ e.jsx(m, { size: 14, className: "shrink-0" }) : null,
3401
+ /* @__PURE__ */ e.jsx("span", { className: u.iconBase ? "leading-none" : void 0, children: c.label }),
3402
+ c.count !== void 0 && c.count !== null ? /* @__PURE__ */ e.jsx(
3403
+ "span",
3404
+ {
3405
+ className: v(
3406
+ u.badgeBase,
3407
+ a ? u.badgeActive : u.badgeInactive
3408
+ ),
3409
+ children: c.count
3410
+ }
3411
+ ) : null
3412
+ ]
3413
+ },
3414
+ c.value
3415
+ );
3416
+ })
3417
+ }
3418
+ ),
3419
+ f ? /* @__PURE__ */ e.jsx("div", { className: "min-w-0 l:shrink-0", children: f }) : null
3420
+ ] }) });
3421
+ }, xn = {
3422
+ sm: "px-2.5 py-2 text-[12px] leading-5",
3423
+ md: "px-3 py-2.5 text-[13px] leading-5",
3424
+ lg: "px-3.5 py-3 text-[14px] leading-6"
3425
+ }, fn = {
3426
+ none: "resize-none",
3427
+ vertical: "resize-y"
3428
+ }, pn = (r) => r ? "border-[var(--lumen-color-danger)] focus:border-[var(--lumen-color-danger)] focus:ring-2 focus:ring-[var(--lumen-color-danger)]/10" : "border-[var(--lumen-color-border-strong)] hover:border-[var(--lumen-color-border-hover)] focus:border-[var(--lumen-color-primary)] focus:ring-2 focus:ring-[var(--lumen-color-primary)]/10", hn = Ge.forwardRef(
3429
+ ({
3430
+ size: r = "lg",
3431
+ resize: t = "vertical",
3432
+ invalid: o = !1,
3433
+ className: n,
3434
+ disabled: l,
3435
+ ...s
3436
+ }, d) => /* @__PURE__ */ e.jsx(
3437
+ "textarea",
3438
+ {
3439
+ ref: d,
3440
+ disabled: l,
3441
+ className: v(
3442
+ "w-full border bg-[var(--lumen-color-surface)] text-[var(--lumen-color-text)] outline-none transition-all placeholder:text-[var(--lumen-color-text-placeholder)] disabled:cursor-not-allowed disabled:bg-[var(--lumen-color-surface-muted)] disabled:text-[var(--lumen-color-text-placeholder)] disabled:opacity-100",
3443
+ Se.control,
3444
+ xn[r],
3445
+ fn[t],
3446
+ pn(o),
3447
+ n
3448
+ ),
3449
+ ...s,
3450
+ autoComplete: "off"
3451
+ }
3452
+ )
3453
+ );
3454
+ hn.displayName = "Textarea";
3455
+ const vn = /^((?:[01]\d|2[0-3])):([0-5]\d)(?::([0-5]\d))?$/, bn = 220, gn = 326, wr = 6, wn = 120, yr = (r) => String(r).padStart(2, "0"), Tr = (r) => {
3456
+ const t = r.match(vn);
3457
+ return t ? { hour: t[1], minute: t[2], second: t[3] ?? "00" } : null;
3458
+ }, Lr = (r) => Tr(r) ?? { hour: "09", minute: "00", second: "00" }, Fr = (r) => {
3459
+ const t = r ? Tr(r) : null;
3460
+ return t ? Number(t.hour) * 3600 + Number(t.minute) * 60 + Number(t.second) : null;
3461
+ }, to = ({
3462
+ value: r,
3463
+ onChange: t,
3464
+ placeholder: o = "请选择时间",
3465
+ className: n,
3466
+ size: l = "md",
3467
+ precision: s = "minute",
3468
+ minuteStep: d = 1,
3469
+ minExclusiveTime: f,
3470
+ disabled: u = !1
3471
+ }) => {
3472
+ const x = Lr(r), [c, a] = R(x.hour), [m, p] = R(x.minute), [I, D] = R(x.second), [j, F] = R(!1), [h, A] = R(!1), [C, $] = R("down"), V = re(null), W = re(null), k = re(null), H = re(null), [w, J] = R({
3473
+ position: "fixed",
3474
+ zIndex: 9999
3475
+ }), Q = s === "second" ? `${c}:${m}:${I}` : `${c}:${m}`, E = Fr(f), M = Fr(Q), Y = E !== null && M !== null && M <= E, z = S(() => {
3476
+ var P, ie;
3477
+ const N = (P = W.current) == null ? void 0 : P.getBoundingClientRect();
3478
+ if (!N) return;
3479
+ const _ = ((ie = k.current) == null ? void 0 : ie.offsetHeight) || gn, se = Math.min(bn, Math.max(0, window.innerWidth - 16)), ae = window.innerHeight - N.bottom < _ + wr;
3480
+ $(ae ? "up" : "down"), J({
3481
+ position: "fixed",
3482
+ left: Math.min(
3483
+ Math.max(8, N.left),
3484
+ Math.max(8, window.innerWidth - se - 8)
3485
+ ),
3486
+ top: ae ? Math.max(8, N.top - _ - wr) : N.bottom + wr,
3487
+ width: se,
3488
+ maxHeight: "calc(100dvh - 16px)",
3489
+ zIndex: 9999
3490
+ });
3491
+ }, []), K = S(() => {
3492
+ H.current && clearTimeout(H.current), F(!1), A(!1);
3493
+ }, []), U = S(() => {
3494
+ H.current && clearTimeout(H.current), A(!0), H.current = setTimeout(
3495
+ K,
3496
+ wn
3497
+ );
3498
+ }, [K]), le = () => {
3499
+ const N = Lr(r);
3500
+ a(N.hour), p(N.minute), D(N.second), A(!1), z(), F(!0);
3501
+ };
3502
+ X(() => {
3503
+ if (!j) return;
3504
+ z();
3505
+ const N = (_) => {
3506
+ var ae, P;
3507
+ const se = _.target;
3508
+ (ae = V.current) != null && ae.contains(se) || (P = k.current) != null && P.contains(se) || U();
3509
+ };
3510
+ return window.addEventListener("resize", z), window.addEventListener("scroll", z, !0), document.addEventListener("mousedown", N), () => {
3511
+ window.removeEventListener("resize", z), window.removeEventListener("scroll", z, !0), document.removeEventListener("mousedown", N);
3512
+ };
3513
+ }, [U, j, z]), X(
3514
+ () => () => {
3515
+ H.current && clearTimeout(H.current);
3516
+ },
3517
+ []
3518
+ );
3519
+ const oe = () => {
3520
+ const N = /* @__PURE__ */ new Date();
3521
+ a(yr(N.getHours())), p(yr(N.getMinutes())), D(yr(N.getSeconds()));
3522
+ }, i = Tr(r), T = i ? s === "second" ? `${i.hour}:${i.minute}:${i.second}` : `${i.hour}:${i.minute}` : "";
3523
+ return /* @__PURE__ */ e.jsxs("div", { ref: V, className: v("relative", n), children: [
3524
+ /* @__PURE__ */ e.jsxs(
3525
+ "button",
3526
+ {
3527
+ ref: W,
3528
+ type: "button",
3529
+ disabled: u,
3530
+ "aria-label": o,
3531
+ onClick: () => j ? U() : le(),
3532
+ className: v(
3533
+ "flex w-full items-center border border-[var(--lumen-color-border-strong)] bg-[var(--lumen-color-surface)] outline-none transition-all hover:border-[var(--lumen-color-border-hover)] focus:border-[var(--lumen-color-primary)] focus:ring-2 focus:ring-[var(--lumen-color-primary)]/10",
3534
+ Se.control,
3535
+ l === "md" ? "h-[36px] px-3 text-[13px]" : "h-[40px] px-3.5 text-[14px]",
3536
+ u && "cursor-not-allowed bg-[var(--lumen-color-surface-muted)] opacity-60"
3537
+ ),
3538
+ children: [
3539
+ /* @__PURE__ */ e.jsx(qr, { size: 15, className: "mr-2 shrink-0 text-[var(--lumen-color-text-placeholder)]" }),
3540
+ /* @__PURE__ */ e.jsx(
3541
+ "span",
3542
+ {
3543
+ className: v(
3544
+ "min-w-0 flex-1 truncate whitespace-nowrap text-left",
3545
+ T ? "text-[var(--lumen-color-text)]" : "text-[var(--lumen-color-text-placeholder)]"
3546
+ ),
3547
+ children: T || o
3548
+ }
3549
+ ),
3550
+ /* @__PURE__ */ e.jsx(
3551
+ rr,
3552
+ {
3553
+ size: 15,
3554
+ className: v(
3555
+ "ml-auto shrink-0 text-[var(--lumen-color-text-placeholder)] transition-transform",
3556
+ j && !h && "rotate-180"
3557
+ )
3558
+ }
3559
+ )
3560
+ ]
3561
+ }
3562
+ ),
3563
+ j ? Re(
3564
+ /* @__PURE__ */ e.jsxs(
3565
+ "div",
3566
+ {
3567
+ ref: k,
3568
+ "data-time-picker-panel": !0,
3569
+ className: "overflow-x-hidden overflow-y-auto rounded-[8px] border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] shadow-[0_18px_46px_var(--lumen-color-shadow)]",
3570
+ style: {
3571
+ ...w,
3572
+ animation: h ? C === "up" ? "lumen-dropdown-out-up 0.12s ease-in forwards" : "lumen-dropdown-out 0.12s ease-in forwards" : C === "up" ? "lumen-dropdown-in-up 0.12s ease-out" : "lumen-dropdown-in 0.12s ease-out",
3573
+ transformOrigin: C === "up" ? "bottom" : "top"
3574
+ },
3575
+ children: [
3576
+ /* @__PURE__ */ e.jsx(
3577
+ Xr,
3578
+ {
3579
+ hour: c,
3580
+ minute: m,
3581
+ second: I,
3582
+ onHourChange: a,
3583
+ onMinuteChange: p,
3584
+ onSecondChange: D,
3585
+ precision: s,
3586
+ minuteStep: d
3587
+ }
3588
+ ),
3589
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between border-t border-[var(--lumen-color-surface-muted)] px-3 py-2.5", children: [
3590
+ /* @__PURE__ */ e.jsx(
3591
+ "button",
3592
+ {
3593
+ type: "button",
3594
+ onClick: () => {
3595
+ t(""), K();
3596
+ },
3597
+ className: "text-[12px] text-[var(--lumen-color-text-placeholder)] hover:text-[var(--lumen-color-text-muted)]",
3598
+ children: "清除"
3599
+ }
3600
+ ),
3601
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
3602
+ /* @__PURE__ */ e.jsx(
3603
+ "button",
3604
+ {
3605
+ type: "button",
3606
+ onClick: oe,
3607
+ className: "text-[12px] font-medium text-[var(--lumen-color-primary)]",
3608
+ children: "此刻"
3609
+ }
3610
+ ),
3611
+ /* @__PURE__ */ e.jsx(
3612
+ Be,
3613
+ {
3614
+ type: "button",
3615
+ size: "sm",
3616
+ disabled: Y,
3617
+ onClick: () => {
3618
+ t(Q), K();
3619
+ },
3620
+ children: "确定"
3621
+ }
3622
+ )
3623
+ ] })
3624
+ ] })
3625
+ ]
3626
+ }
3627
+ ),
3628
+ document.body
3629
+ ) : null
3630
+ ] });
3631
+ }, yn = {
3632
+ success: {
3633
+ dot: "border-[var(--lumen-color-success)] bg-[var(--lumen-color-surface)]",
3634
+ line: "bg-[var(--lumen-color-success-border)]",
3635
+ badge: "bg-[var(--lumen-color-success-soft)] text-[var(--lumen-color-success-text)]"
3636
+ },
3637
+ warning: {
3638
+ dot: "border-[var(--lumen-color-warning)] bg-[var(--lumen-color-surface)]",
3639
+ line: "bg-[var(--lumen-color-warning-border)]",
3640
+ badge: "bg-[var(--lumen-color-warning-soft)] text-[var(--lumen-color-warning-text)]"
3641
+ },
3642
+ error: {
3643
+ dot: "border-[var(--lumen-color-danger)] bg-[var(--lumen-color-surface)]",
3644
+ line: "bg-[var(--lumen-color-danger-border)]",
3645
+ badge: "bg-[var(--lumen-color-danger-soft)] text-[var(--lumen-color-danger-text)]"
3646
+ },
3647
+ default: {
3648
+ dot: "border-[var(--lumen-color-primary)] bg-[var(--lumen-color-surface)]",
3649
+ line: "bg-[var(--lumen-color-info-border)]",
3650
+ badge: "bg-[var(--lumen-color-info-soft)] text-[var(--lumen-color-info-text)]"
3651
+ }
3652
+ }, no = ({
3653
+ items: r,
3654
+ onItemClick: t,
3655
+ emptyText: o = "暂无记录",
3656
+ maxItems: n
3657
+ }) => {
3658
+ const [l, s] = R(/* @__PURE__ */ new Set()), d = n ? r.slice(0, n) : r, f = (u) => {
3659
+ s((x) => {
3660
+ const c = new Set(x);
3661
+ return c.has(u) ? c.delete(u) : c.add(u), c;
3662
+ });
3663
+ };
3664
+ return r.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
3665
+ /* @__PURE__ */ e.jsx("div", { className: "rounded-full bg-[var(--lumen-color-surface-muted)] p-4", children: /* @__PURE__ */ e.jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "var(--lumen-color-text-placeholder)", strokeWidth: "1.5", children: [
3666
+ /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "12", r: "3" }),
3667
+ /* @__PURE__ */ e.jsx("path", { d: "M12 1v4M12 19v4M4.22 4.22l2.83 2.83M16.95 16.95l2.83 2.83M1 12h4M19 12h4M4.22 19.78l2.83-2.83M16.95 7.05l2.83-2.83" })
3668
+ ] }) }),
3669
+ /* @__PURE__ */ e.jsx("p", { className: "mt-3 text-[13px] text-[var(--lumen-color-text-placeholder)]", children: o })
3670
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
3671
+ d.map((u, x) => {
3672
+ const c = yn[u.type || "default"], a = l.has(u.id), m = u.beforeValue || u.afterValue || u.description;
3673
+ return /* @__PURE__ */ e.jsxs(
3674
+ "div",
3675
+ {
3676
+ className: `relative flex gap-3 pb-4 pad:gap-4 ${x === d.length - 1, ""}`,
3677
+ children: [
3678
+ /* @__PURE__ */ e.jsxs("div", { className: "relative flex flex-col items-center", children: [
3679
+ /* @__PURE__ */ e.jsx("div", { className: `relative z-10 mt-1 h-[14px] w-[14px] rounded-full border-2 ${c.dot} shrink-0` }),
3680
+ x < d.length - 1 && /* @__PURE__ */ e.jsx("div", { className: `absolute top-[18px] bottom-[-16px] w-px ${c.line}` })
3681
+ ] }),
3682
+ /* @__PURE__ */ e.jsxs(
3683
+ "div",
3684
+ {
3685
+ className: `min-w-0 flex-1 rounded-[12px] border border-[var(--lumen-color-surface-muted)] bg-[var(--lumen-color-surface)] p-3 transition-shadow hover:shadow-sm pad:p-4 ${t ? "cursor-pointer" : ""}`,
3686
+ onClick: () => t == null ? void 0 : t(u.id),
3687
+ children: [
3688
+ /* @__PURE__ */ e.jsx("div", { className: "flex items-start justify-between gap-3", children: /* @__PURE__ */ e.jsxs("div", { className: "flex-1", children: [
3689
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
3690
+ /* @__PURE__ */ e.jsx("span", { className: `inline-flex rounded-full px-2 py-0.5 text-[11px] font-medium ${c.badge}`, children: u.title }),
3691
+ m && /* @__PURE__ */ e.jsxs(
3692
+ "button",
3693
+ {
3694
+ type: "button",
3695
+ onClick: (p) => {
3696
+ p.stopPropagation(), f(u.id);
3697
+ },
3698
+ className: "inline-flex items-center gap-0.5 text-[11px] text-[var(--lumen-color-text-placeholder)] hover:text-[var(--lumen-color-text-muted)]",
3699
+ children: [
3700
+ a ? /* @__PURE__ */ e.jsx(rr, { size: 12 }) : /* @__PURE__ */ e.jsx(Me, { size: 12 }),
3701
+ "详情"
3702
+ ]
3703
+ }
3704
+ )
3705
+ ] }),
3706
+ /* @__PURE__ */ e.jsx("p", { className: "mt-2 text-[12px] text-[var(--lumen-color-text-muted)]", children: u.date })
3707
+ ] }) }),
3708
+ u.meta && u.meta.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "mt-3 flex flex-wrap gap-3 border-t border-[var(--lumen-color-surface-muted)] pt-3", children: u.meta.map((p) => /* @__PURE__ */ e.jsxs("div", { children: [
3709
+ /* @__PURE__ */ e.jsx("span", { className: "text-[11px] text-[var(--lumen-color-text-placeholder)]", children: p.label }),
3710
+ /* @__PURE__ */ e.jsx("span", { className: "ml-1.5 text-[12px] font-medium text-[var(--lumen-color-text-secondary)]", children: p.value })
3711
+ ] }, p.label)) }),
3712
+ a && m && /* @__PURE__ */ e.jsxs("div", { className: "mt-3 space-y-2 border-t border-[var(--lumen-color-surface-muted)] pt-3", children: [
3713
+ u.description && /* @__PURE__ */ e.jsx("p", { className: "text-[12px] leading-6 text-[var(--lumen-color-text-muted)]", children: u.description }),
3714
+ u.beforeValue && u.afterValue && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 gap-2 pad:grid-cols-2 pad:gap-3", children: [
3715
+ /* @__PURE__ */ e.jsxs("div", { className: "rounded-[6px] bg-[var(--lumen-color-danger-soft)] px-3 py-2", children: [
3716
+ /* @__PURE__ */ e.jsx("div", { className: "text-[10px] text-[var(--lumen-color-danger)]", children: "变更前" }),
3717
+ /* @__PURE__ */ e.jsx("div", { className: "mt-0.5 text-[12px] text-[var(--lumen-color-danger-text)] line-through", children: u.beforeValue })
3718
+ ] }),
3719
+ /* @__PURE__ */ e.jsxs("div", { className: "rounded-[6px] bg-[var(--lumen-color-success-soft)] px-3 py-2", children: [
3720
+ /* @__PURE__ */ e.jsx("div", { className: "text-[10px] text-[var(--lumen-color-success)]", children: "变更后" }),
3721
+ /* @__PURE__ */ e.jsx("div", { className: "mt-0.5 text-[12px] text-[var(--lumen-color-success-text)]", children: u.afterValue })
3722
+ ] })
3723
+ ] })
3724
+ ] })
3725
+ ]
3726
+ }
3727
+ )
3728
+ ]
3729
+ },
3730
+ u.id
3731
+ );
3732
+ }),
3733
+ n && r.length > n && /* @__PURE__ */ e.jsxs("p", { className: "pl-[30px] text-[12px] text-[var(--lumen-color-text-placeholder)]", children: [
3734
+ "还有 ",
3735
+ r.length - n,
3736
+ " 条记录"
3737
+ ] })
3738
+ ] });
3739
+ }, jn = 2600, Wr = "global-toast-root", Nn = {
3740
+ success: {
3741
+ icon: xt,
3742
+ iconWrap: "bg-[var(--lumen-color-success-soft)] text-[var(--lumen-color-success)]",
3743
+ title: "操作成功"
3744
+ },
3745
+ info: {
3746
+ icon: mt,
3747
+ iconWrap: "bg-[var(--lumen-color-info-soft)] text-[var(--lumen-color-primary)]",
3748
+ title: "提示"
3749
+ },
3750
+ warning: {
3751
+ icon: $r,
3752
+ iconWrap: "bg-[var(--lumen-color-warning-soft)] text-[var(--lumen-color-warning)]",
3753
+ title: "请注意"
3754
+ },
3755
+ error: {
3756
+ icon: $r,
3757
+ iconWrap: "bg-[var(--lumen-color-danger-soft)] text-[var(--lumen-color-danger-hover)]",
3758
+ title: "操作失败"
3759
+ }
3760
+ };
3761
+ let $e = null, _e = null;
3762
+ const Ue = /* @__PURE__ */ new Set(), _r = [], er = /* @__PURE__ */ new Set(), kn = () => `toast-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`, Zr = (r) => `${r.type}:${r.message}`, Hr = (r) => {
3763
+ if (Ue.size === 0 && r) {
3764
+ _r.push(r);
3765
+ return;
3766
+ }
3767
+ Ue.forEach((t) => t(r));
3768
+ }, En = () => {
3769
+ if (typeof document > "u" || (_e && !document.body.contains(_e) && ($e == null || $e.unmount(), $e = null, _e = null, Ue.clear()), $e && _e)) return;
3770
+ const r = document.getElementById(Wr);
3771
+ _e = r || document.createElement("div"), _e.id = Wr, r || document.body.appendChild(_e), $e = ft(_e), $e.render(/* @__PURE__ */ e.jsx(_n, {}));
3772
+ }, Tn = (r) => (Ue.add(r), _r.splice(0).forEach((t) => r(t)), () => {
3773
+ Ue.delete(r);
3774
+ }), _n = () => {
3775
+ const [r, t] = R([]), o = re(/* @__PURE__ */ new Map()), n = S((x) => {
3776
+ const c = o.current.get(x);
3777
+ (c == null ? void 0 : c.timeoutId) != null && typeof window < "u" && window.clearTimeout(c.timeoutId), o.current.delete(x);
3778
+ }, []), l = S((x) => {
3779
+ typeof window > "u" || (n(x), t(
3780
+ (c) => c.map((a) => a.id === x ? { ...a, closing: !0 } : a)
3781
+ ));
3782
+ }, [n]), s = S((x, c) => {
3783
+ if (typeof window > "u") return;
3784
+ const a = window.setTimeout(() => l(x), c);
3785
+ o.current.set(x, {
3786
+ timeoutId: a,
3787
+ remaining: c,
3788
+ startedAt: Date.now()
3789
+ });
3790
+ }, [l]), d = S((x) => {
3791
+ const c = o.current.get(x);
3792
+ !c || c.timeoutId == null || typeof window > "u" || (window.clearTimeout(c.timeoutId), c.remaining = Math.max(0, c.remaining - (Date.now() - c.startedAt)), c.timeoutId = null);
3793
+ }, []), f = S((x) => {
3794
+ const c = o.current.get(x);
3795
+ !c || c.timeoutId != null || s(x, c.remaining);
3796
+ }, [s]), u = S((x) => {
3797
+ n(x), t((c) => {
3798
+ const a = c.find((m) => m.id === x);
3799
+ return a && er.delete(Zr(a)), c.filter((m) => m.id !== x);
3800
+ });
3801
+ }, [n]);
3802
+ return X(() => {
3803
+ const x = o.current, c = Tn((a) => {
3804
+ if (!a) {
3805
+ x.forEach((m) => {
3806
+ m.timeoutId != null && window.clearTimeout(m.timeoutId);
3807
+ }), x.clear(), er.clear(), t([]);
3808
+ return;
3809
+ }
3810
+ t((m) => [...m, { ...a, closing: !1 }]), s(a.id, a.duration);
3811
+ });
3812
+ return () => {
3813
+ c(), x.forEach((a) => {
3814
+ a.timeoutId != null && window.clearTimeout(a.timeoutId);
3815
+ }), x.clear();
3816
+ };
3817
+ }, [s]), r.length === 0 ? null : /* @__PURE__ */ e.jsx(
3818
+ "div",
3819
+ {
3820
+ className: "pointer-events-none fixed inset-x-3 top-3 z-[120] flex flex-col items-stretch gap-2 pad:inset-x-auto pad:right-4 pad:top-4 pad:w-[min(420px,calc(100vw-2rem))] pad:items-end pad:gap-3 xl:right-6 xl:top-6",
3821
+ "data-toast-container": !0,
3822
+ children: r.map((x) => /* @__PURE__ */ e.jsx(
3823
+ Sn,
3824
+ {
3825
+ item: x,
3826
+ onClose: () => l(x.id),
3827
+ onExited: () => u(x.id),
3828
+ onPause: () => d(x.id),
3829
+ onResume: () => f(x.id)
3830
+ },
3831
+ x.id
3832
+ ))
3833
+ }
3834
+ );
3835
+ }, Sn = ({ item: r, onClose: t, onExited: o, onPause: n, onResume: l }) => {
3836
+ const s = Nn[r.type], d = s.icon;
3837
+ return /* @__PURE__ */ e.jsxs(
3838
+ "div",
3839
+ {
3840
+ className: `pointer-events-auto relative flex w-full min-w-0 max-w-[420px] items-start gap-2.5 overflow-hidden rounded-[10px] bg-[var(--lumen-color-surface-glass)] px-3 py-3 shadow-[0_14px_32px_var(--lumen-color-shadow),0_4px_10px_var(--lumen-color-shadow)] ring-1 ring-white/70 backdrop-blur-[5px] backdrop-saturate-125 pad:gap-3 pad:px-4 ${r.closing ? "animate-[lumen-toast-out_160ms_ease-in_forwards]" : "animate-[lumen-toast-in_180ms_ease-out]"}`,
3841
+ "data-toast-id": r.id,
3842
+ onAnimationEnd: () => {
3843
+ r.closing && o();
3844
+ },
3845
+ onMouseEnter: n,
3846
+ onMouseLeave: l,
3847
+ role: "status",
3848
+ "aria-live": "polite",
3849
+ children: [
3850
+ /* @__PURE__ */ e.jsx("div", { className: `mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full ring-1 ring-white/70 ${s.iconWrap}`, children: /* @__PURE__ */ e.jsx(d, { size: 16 }) }),
3851
+ /* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
3852
+ /* @__PURE__ */ e.jsx("div", { className: "text-[14px] font-medium text-[var(--lumen-color-text-strong)]", children: s.title }),
3853
+ /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-[14px] leading-6 text-[var(--lumen-color-text-muted)]", children: r.message })
3854
+ ] }),
3855
+ /* @__PURE__ */ e.jsx(
3856
+ "button",
3857
+ {
3858
+ type: "button",
3859
+ onClick: t,
3860
+ className: "relative isolate flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-full text-[var(--lumen-color-text-placeholder)] transition-colors after:pointer-events-none after:absolute after:inset-0 after:rounded-full after:bg-current after:opacity-0 after:transition-opacity hover:text-[var(--lumen-color-text-secondary)] hover:after:opacity-[0.08] active:after:opacity-[0.14] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--lumen-color-primary)]/20",
3861
+ "aria-label": "关闭消息提示",
3862
+ children: /* @__PURE__ */ e.jsx(ir, { size: 14 })
3863
+ }
3864
+ )
3865
+ ]
3866
+ }
3867
+ );
3868
+ };
3869
+ class He {
3870
+ static show(t, o = "info", n = {}) {
3871
+ const l = Zr({ message: t, type: o });
3872
+ er.has(l) || (er.add(l), En(), Hr({
3873
+ id: kn(),
3874
+ message: t,
3875
+ type: o,
3876
+ duration: n.duration ?? jn
3877
+ }));
3878
+ }
3879
+ static success(t, o) {
3880
+ He.show(t, "success", o);
3881
+ }
3882
+ static info(t, o) {
3883
+ He.show(t, "info", o);
3884
+ }
3885
+ static warning(t, o) {
3886
+ He.show(t, "warning", o);
3887
+ }
3888
+ static error(t, o) {
3889
+ He.show(t, "error", o);
3890
+ }
3891
+ static clear() {
3892
+ _r.splice(0), er.clear(), Hr(null);
3893
+ }
3894
+ static resetForTests() {
3895
+ He.clear(), Ue.clear(), $e == null || $e.unmount(), _e != null && _e.parentNode && _e.parentNode.removeChild(_e), $e = null, _e = null;
3896
+ }
3897
+ }
3898
+ const We = 6, An = "var(--lumen-color-tooltip)", $n = {
3899
+ top: "bottom",
3900
+ bottom: "top",
3901
+ left: "right",
3902
+ right: "left"
3903
+ };
3904
+ function Mn(r, t, o, n) {
3905
+ switch (t) {
3906
+ case "top":
3907
+ return r.top - o;
3908
+ case "bottom":
3909
+ return n.height - r.bottom - o;
3910
+ case "left":
3911
+ return r.left - o;
3912
+ case "right":
3913
+ return n.width - r.right - o;
3914
+ }
3915
+ }
3916
+ function Yr(r, t, o, n, l, s) {
3917
+ const d = o === "top" || o === "bottom" ? t.height + n : t.width + n;
3918
+ return Mn(r, o, l, s) >= d;
3919
+ }
3920
+ function Rn(r, t) {
3921
+ const o = `${We}px solid transparent`, n = `${We}px solid ${An}`;
3922
+ switch (r) {
3923
+ case "top":
3924
+ return {
3925
+ position: "absolute",
3926
+ bottom: -We,
3927
+ left: t,
3928
+ transform: "translateX(-50%)",
3929
+ width: 0,
3930
+ height: 0,
3931
+ borderLeft: o,
3932
+ borderRight: o,
3933
+ borderTop: n
3934
+ };
3935
+ case "bottom":
3936
+ return {
3937
+ position: "absolute",
3938
+ top: -We,
3939
+ left: t,
3940
+ transform: "translateX(-50%)",
3941
+ width: 0,
3942
+ height: 0,
3943
+ borderLeft: o,
3944
+ borderRight: o,
3945
+ borderBottom: n
3946
+ };
3947
+ case "left":
3948
+ return {
3949
+ position: "absolute",
3950
+ right: -We,
3951
+ top: t,
3952
+ transform: "translateY(-50%)",
3953
+ width: 0,
3954
+ height: 0,
3955
+ borderTop: o,
3956
+ borderBottom: o,
3957
+ borderLeft: n
3958
+ };
3959
+ case "right":
3960
+ return {
3961
+ position: "absolute",
3962
+ left: -We,
3963
+ top: t,
3964
+ transform: "translateY(-50%)",
3965
+ width: 0,
3966
+ height: 0,
3967
+ borderTop: o,
3968
+ borderBottom: o,
3969
+ borderRight: n
3970
+ };
3971
+ }
3972
+ }
3973
+ function In(r, t, o, n, l = 8, s = typeof window < "u" ? { width: window.innerWidth, height: window.innerHeight } : { width: 1024, height: 768 }) {
3974
+ let d = o;
3975
+ if (!Yr(r, t, o, n, l, s)) {
3976
+ const D = $n[o];
3977
+ Yr(r, t, D, n, l, s) && (d = D);
3978
+ }
3979
+ const { width: f, height: u } = t, x = r.left + r.width / 2, c = r.top + r.height / 2;
3980
+ let a, m, p;
3981
+ switch (d) {
3982
+ case "top":
3983
+ a = x - f / 2, m = r.top - u - n, p = x - a;
3984
+ break;
3985
+ case "bottom":
3986
+ a = x - f / 2, m = r.bottom + n, p = x - a;
3987
+ break;
3988
+ case "left":
3989
+ a = r.left - f - n, m = c - u / 2, p = c - m;
3990
+ break;
3991
+ case "right":
3992
+ a = r.right + n, m = c - u / 2, p = c - m;
3993
+ break;
3994
+ }
3995
+ if (d === "top" || d === "bottom") {
3996
+ if (a < l)
3997
+ p += a - l, a = l;
3998
+ else if (a + f > s.width - l) {
3999
+ const D = a + f - (s.width - l);
4000
+ p -= D, a -= D;
4001
+ }
4002
+ }
4003
+ if (d === "left" || d === "right") {
4004
+ if (m < l)
4005
+ p += m - l, m = l;
4006
+ else if (m + u > s.height - l) {
4007
+ const D = m + u - (s.height - l);
4008
+ p -= D, m -= D;
4009
+ }
4010
+ }
4011
+ const I = Rn(d, p);
4012
+ return { x: a, y: m, actualPlacement: d, arrowStyle: I };
4013
+ }
4014
+ function Dn(...r) {
4015
+ return (t) => {
4016
+ r.forEach((o) => {
4017
+ typeof o == "function" ? o(t) : o && typeof o == "object" && (o.current = t);
4018
+ });
4019
+ };
4020
+ }
4021
+ function zn(r) {
4022
+ switch (r) {
4023
+ case "top":
4024
+ return "origin-bottom";
4025
+ case "bottom":
4026
+ return "origin-top";
4027
+ case "left":
4028
+ return "origin-right";
4029
+ case "right":
4030
+ return "origin-left";
4031
+ }
4032
+ }
4033
+ const oo = ({
4034
+ content: r,
4035
+ children: t,
4036
+ placement: o = "top",
4037
+ showDelay: n = 350,
4038
+ hideDelay: l = 0,
4039
+ disabled: s = !1,
4040
+ className: d,
4041
+ offset: f = 8,
4042
+ showArrow: u = !0
4043
+ }) => {
4044
+ const [x, c] = R("hidden"), [a, m] = R({
4045
+ position: "fixed",
4046
+ pointerEvents: "none"
4047
+ }), [p, I] = R(o), [D, j] = R({}), F = re(null), h = re(null), A = re(void 0), C = re(void 0), $ = re(void 0), V = S(() => {
4048
+ clearTimeout(A.current), clearTimeout(C.current), A.current = void 0, C.current = void 0;
4049
+ }, []), W = S(() => {
4050
+ const M = F.current, Y = h.current;
4051
+ if (!M || !Y) return;
4052
+ const z = M.getBoundingClientRect(), K = {
4053
+ width: Y.offsetWidth,
4054
+ height: Y.offsetHeight
4055
+ }, U = In(z, K, o, f);
4056
+ m({
4057
+ position: "fixed",
4058
+ left: U.x,
4059
+ top: U.y,
4060
+ zIndex: 1200,
4061
+ pointerEvents: "none"
4062
+ }), I(U.actualPlacement), j(U.arrowStyle);
4063
+ }, [o, f]), k = S(() => {
4064
+ s || (V(), A.current = setTimeout(() => {
4065
+ c("entering");
4066
+ }, n));
4067
+ }, [s, n, V]), H = S(() => {
4068
+ V(), C.current = setTimeout(() => {
4069
+ c("exiting");
4070
+ }, l);
4071
+ }, [l, V]), w = S(() => {
4072
+ V(), $.current !== void 0 && (cancelAnimationFrame($.current), $.current = void 0), c("hidden");
4073
+ }, [V]);
4074
+ Er(() => {
4075
+ x === "entering" && (W(), $.current = requestAnimationFrame(() => {
4076
+ $.current = requestAnimationFrame(() => {
4077
+ c("visible");
4078
+ });
4079
+ }));
4080
+ }, [x, W]), X(() => {
4081
+ if (x === "exiting") {
4082
+ const M = setTimeout(() => c("hidden"), 150);
4083
+ return () => clearTimeout(M);
4084
+ }
4085
+ }, [x]), X(() => (window.addEventListener("scroll", w, {
4086
+ capture: !0,
4087
+ passive: !0
4088
+ }), () => {
4089
+ window.removeEventListener("scroll", w, !0);
4090
+ }), [w]), X(() => {
4091
+ if (x !== "visible" && x !== "entering") return;
4092
+ const M = () => W();
4093
+ return window.addEventListener("resize", M, { passive: !0 }), () => {
4094
+ window.removeEventListener("resize", M);
4095
+ };
4096
+ }, [x, W]), X(() => () => {
4097
+ V(), $.current !== void 0 && cancelAnimationFrame($.current);
4098
+ }, [V]);
4099
+ const J = S(() => k(), [k]), Q = S(() => H(), [H]), E = x !== "hidden" ? /* @__PURE__ */ e.jsxs(
4100
+ "div",
4101
+ {
4102
+ ref: h,
4103
+ className: v(
4104
+ "bg-[var(--lumen-color-tooltip)]/90 text-[var(--lumen-color-on-primary)] text-[12px] px-3 py-1.5 rounded-md shadow-xl whitespace-nowrap",
4105
+ zn(p),
4106
+ "transition-[opacity,transform] duration-150 ease-out",
4107
+ x === "visible" ? "opacity-100 scale-100" : "opacity-0 scale-95",
4108
+ d
4109
+ ),
4110
+ style: a,
4111
+ role: "tooltip",
4112
+ children: [
4113
+ r,
4114
+ u && /* @__PURE__ */ e.jsx("div", { style: D })
4115
+ ]
4116
+ }
4117
+ ) : null;
4118
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
4119
+ lt(t, {
4120
+ ref: Dn(t.ref, F),
4121
+ onPointerEnter: J,
4122
+ onPointerLeave: Q
4123
+ }),
4124
+ E && Re(E, document.body)
4125
+ ] });
4126
+ }, Cn = 120;
4127
+ function Br(r, t) {
4128
+ return typeof r == "object" && r !== null ? {
4129
+ ...r,
4130
+ children: t
4131
+ } : r;
4132
+ }
4133
+ function et(r, t, o, n) {
4134
+ const l = t.trim().toLowerCase();
4135
+ return l ? r.map((s) => {
4136
+ const d = o(s).toLowerCase(), f = Ve(s, n), u = et(
4137
+ f,
4138
+ l,
4139
+ o,
4140
+ n
4141
+ ), x = d.includes(l);
4142
+ return !x && u.length === 0 ? null : x ? Br(s, f) : Br(s, u);
4143
+ }).filter((s) => s !== null) : r;
4144
+ }
4145
+ const Pn = {
4146
+ sm: "min-h-[32px] px-3 text-[12px]",
4147
+ md: "min-h-[36px] px-3 text-[13px]",
4148
+ lg: "min-h-[40px] px-3.5 text-[14px]"
4149
+ };
4150
+ function Ve(r, t) {
4151
+ return t ? t(r) ?? [] : typeof r == "object" && r !== null && "children" in r && Array.isArray(r.children) ? r.children ?? [] : [];
4152
+ }
4153
+ function Ye(r, t, o, n, l) {
4154
+ for (const s of r) {
4155
+ if (o(s) === t)
4156
+ return s;
4157
+ n(s);
4158
+ const d = Ve(s, l);
4159
+ if (d.length > 0) {
4160
+ const f = Ye(
4161
+ d,
4162
+ t,
4163
+ o,
4164
+ n,
4165
+ l
4166
+ );
4167
+ if (f)
4168
+ return f;
4169
+ }
4170
+ }
4171
+ return null;
4172
+ }
4173
+ function On(r, t, o, n) {
4174
+ const l = /* @__PURE__ */ new Set(), s = (f) => {
4175
+ Ve(f, n).forEach((u) => {
4176
+ l.add(o(u)), s(u);
4177
+ });
4178
+ }, d = (f, u) => {
4179
+ for (const x of f) {
4180
+ const c = o(x);
4181
+ if (c === t)
4182
+ return u.forEach((a) => l.add(a)), s(x), !0;
4183
+ if (d(Ve(x, n), [...u, c]))
4184
+ return !0;
4185
+ }
4186
+ return !1;
4187
+ };
4188
+ return d(r, []), l;
4189
+ }
4190
+ function Ur(r, t, o, n = 1) {
4191
+ const l = [], s = (d, f) => {
4192
+ f >= n || d.forEach((u) => {
4193
+ const x = Ve(u, o);
4194
+ x.length !== 0 && (l.push(t(u)), s(x, f + 1));
4195
+ });
4196
+ };
4197
+ return s(r, 0), l;
4198
+ }
4199
+ const so = ({
4200
+ nodes: r,
4201
+ value: t,
4202
+ onChange: o,
4203
+ values: n,
4204
+ lockedValues: l = [],
4205
+ onMultiChange: s,
4206
+ multiple: d = !1,
4207
+ exclusiveHierarchySelection: f = !1,
4208
+ searchable: u = !1,
4209
+ expandSearchResults: x = !1,
4210
+ searchPlaceholder: c = "搜索组织节点",
4211
+ getValue: a,
4212
+ getLabel: m,
4213
+ getChildren: p,
4214
+ isNodeSelectable: I,
4215
+ renderPrefix: D,
4216
+ defaultExpandedDepth: j = 1,
4217
+ placeholder: F = "请选择",
4218
+ disabled: h = !1,
4219
+ loading: A = !1,
4220
+ emptyText: C = "无可选节点",
4221
+ className: $,
4222
+ size: V = "md"
4223
+ }) => {
4224
+ const W = fe(() => new Set(l), [l]), [k, H] = R(!1), [w, J] = R(!1), [Q, E] = R(!1), [M, Y] = R(!1), [z, K] = R(
4225
+ Ur(r, a, p, j)
4226
+ ), [U, le] = R(""), [oe, i] = R({
4227
+ position: "fixed",
4228
+ top: 0,
4229
+ left: 0,
4230
+ zIndex: 9999
4231
+ }), T = re(null), N = re(null), _ = re(null), se = S(() => {
4232
+ var B, xe;
4233
+ if (!T.current)
4234
+ return;
4235
+ const L = T.current.getBoundingClientRect(), q = ((B = N.current) == null ? void 0 : B.offsetHeight) || 280, g = 6, G = 8, ne = window.innerHeight - L.bottom < q, he = ne ? Math.max(G, L.top - q - g) : Math.min(window.innerHeight - G, L.bottom + g), Ne = Math.max(0, window.innerWidth - G * 2), ke = Math.min(L.width, Ne), Ee = Math.min(Math.max(ke, ke * 2.8), Ne, 480), b = Math.max(
4236
+ ke,
4237
+ Math.min(
4238
+ Ee,
4239
+ Math.max(ke, ((xe = N.current) == null ? void 0 : xe.offsetWidth) || ke)
4240
+ )
4241
+ ), O = Math.min(
4242
+ Math.max(G, L.left),
4243
+ Math.max(G, window.innerWidth - b - G)
4244
+ );
4245
+ Y(ne), i({
4246
+ position: "fixed",
4247
+ top: he,
4248
+ left: O,
4249
+ width: "max-content",
4250
+ minWidth: ke,
4251
+ maxWidth: Ee,
4252
+ zIndex: 9999
4253
+ }), E(!0);
4254
+ }, []), ae = t == null ? null : Ye(r, t, a, m, p), P = d ? n ?? [] : [], ie = re(P);
4255
+ ie.current = P;
4256
+ const Z = P.map(
4257
+ (L) => Ye(r, L, a, m, p)
4258
+ ).filter((L) => L !== null), ee = et(
4259
+ r,
4260
+ u ? U : "",
4261
+ m,
4262
+ p
4263
+ ), ce = x && u && U.trim().length > 0;
4264
+ X(() => {
4265
+ K(
4266
+ Ur(
4267
+ r,
4268
+ a,
4269
+ p,
4270
+ j
4271
+ )
4272
+ );
4273
+ }, [j, r]), X(() => () => {
4274
+ _.current && clearTimeout(_.current);
4275
+ }, []), X(() => {
4276
+ if (!k) {
4277
+ E(!1);
4278
+ return;
4279
+ }
4280
+ const L = (me) => {
4281
+ var g, G;
4282
+ const q = me.target;
4283
+ (g = T.current) != null && g.contains(q) || (G = N.current) != null && G.contains(q) || (_.current && clearTimeout(_.current), J(!0), _.current = setTimeout(() => {
4284
+ H(!1), J(!1);
4285
+ }, 120));
4286
+ };
4287
+ return document.addEventListener("mousedown", L), () => document.removeEventListener("mousedown", L);
4288
+ }, [k]), Er(() => {
4289
+ if (!k)
4290
+ return;
4291
+ se();
4292
+ const L = window.requestAnimationFrame(se);
4293
+ return window.addEventListener("scroll", se, !0), window.addEventListener("resize", se), () => {
4294
+ window.cancelAnimationFrame(L), window.removeEventListener("scroll", se, !0), window.removeEventListener("resize", se);
4295
+ };
4296
+ }, [k, r, A, se]), X(() => {
4297
+ k || le("");
4298
+ }, [k]);
4299
+ const de = () => {
4300
+ _.current && clearTimeout(_.current), J(!0), _.current = setTimeout(() => {
4301
+ H(!1), J(!1);
4302
+ }, Cn);
4303
+ }, te = () => {
4304
+ _.current && clearTimeout(_.current), H(!1), J(!1);
4305
+ }, ve = () => {
4306
+ _.current && clearTimeout(_.current), E(!1), se(), H(!0), J(!1);
4307
+ }, je = (L) => {
4308
+ K(
4309
+ (me) => me.includes(L) ? me.filter((q) => q !== L) : [...me, L]
4310
+ );
4311
+ }, ye = (L, me) => {
4312
+ const q = a(L), g = Ve(L, p), G = g.length > 0, ne = ce || z.includes(q), he = (I == null ? void 0 : I(L)) ?? !0, Ne = !he && G, ke = d ? P.includes(q) : t === q;
4313
+ return /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
4314
+ /* @__PURE__ */ e.jsxs(
4315
+ "div",
4316
+ {
4317
+ className: v(
4318
+ "flex items-center rounded-[8px] px-2 py-1.5 text-[13px] transition-colors",
4319
+ ke ? "bg-[var(--lumen-color-primary-soft)] font-medium text-[var(--lumen-color-primary)]" : he || Ne ? "text-[var(--lumen-color-text-secondary)] hover:bg-[var(--lumen-color-surface-muted)]" : "text-[var(--lumen-color-text-placeholder)]"
4320
+ ),
4321
+ style: { paddingLeft: `${me * 16 + 8}px` },
4322
+ children: [
4323
+ G ? /* @__PURE__ */ e.jsx(
4324
+ "button",
4325
+ {
4326
+ type: "button",
4327
+ "data-testid": `tree-select-expand-${q}`,
4328
+ className: "mr-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-[6px] text-[var(--lumen-color-text-muted)] transition-colors hover:bg-[var(--lumen-color-surface-muted)] hover:text-[var(--lumen-color-text-secondary)]",
4329
+ onClick: (Ee) => {
4330
+ Ee.stopPropagation(), je(q);
4331
+ },
4332
+ children: ne ? /* @__PURE__ */ e.jsx(rr, { size: 14 }) : /* @__PURE__ */ e.jsx(Me, { size: 14 })
4333
+ }
4334
+ ) : /* @__PURE__ */ e.jsx("span", { className: "mr-1 w-[18px] shrink-0" }),
4335
+ /* @__PURE__ */ e.jsxs(
4336
+ "button",
4337
+ {
4338
+ type: "button",
4339
+ "data-testid": `tree-select-option-${q}`,
4340
+ "aria-disabled": !he,
4341
+ className: v(
4342
+ "flex min-w-0 flex-1 items-center gap-2 bg-transparent text-left text-inherit",
4343
+ he ? "cursor-pointer" : "cursor-default"
4344
+ ),
4345
+ onClick: (Ee) => {
4346
+ if (!he) {
4347
+ G && !ne && (Ee.stopPropagation(), je(q));
4348
+ return;
4349
+ }
4350
+ if (d) {
4351
+ const b = ie.current, O = b.includes(q);
4352
+ if (O && W.has(q))
4353
+ return;
4354
+ let B = b.filter(
4355
+ (ue) => ue !== q
4356
+ );
4357
+ if (!O) {
4358
+ if (f) {
4359
+ const ue = On(
4360
+ r,
4361
+ q,
4362
+ a,
4363
+ p
4364
+ );
4365
+ B = B.filter(
4366
+ (nr) => !ue.has(nr)
4367
+ );
4368
+ }
4369
+ B.push(q);
4370
+ }
4371
+ const xe = B.map(
4372
+ (ue) => Ye(
4373
+ r,
4374
+ ue,
4375
+ a,
4376
+ m,
4377
+ p
4378
+ )
4379
+ ).filter((ue) => ue !== null);
4380
+ ie.current = B, s == null || s(B, xe);
4381
+ return;
4382
+ }
4383
+ o(q, L), te();
4384
+ },
4385
+ children: [
4386
+ D == null ? void 0 : D(L),
4387
+ /* @__PURE__ */ e.jsx("span", { className: "truncate", children: m(L) })
4388
+ ]
4389
+ }
4390
+ )
4391
+ ]
4392
+ }
4393
+ ),
4394
+ G && ne && /* @__PURE__ */ e.jsx("div", { className: "space-y-1", children: g.map((Ee) => ye(Ee, me + 1)) })
4395
+ ] }, q);
4396
+ };
4397
+ return /* @__PURE__ */ e.jsxs(
4398
+ "div",
4399
+ {
4400
+ ref: T,
4401
+ className: v("relative", $),
4402
+ onKeyDown: (L) => {
4403
+ if (!h) {
4404
+ if (!k && (L.key === "Enter" || L.key === " ")) {
4405
+ L.preventDefault(), ve();
4406
+ return;
4407
+ }
4408
+ k && L.key === "Escape" && (L.preventDefault(), te());
4409
+ }
4410
+ },
4411
+ children: [
4412
+ /* @__PURE__ */ e.jsxs(
4413
+ "button",
4414
+ {
4415
+ type: "button",
4416
+ "data-testid": "tree-select-trigger",
4417
+ disabled: h,
4418
+ onClick: () => {
4419
+ if (!h) {
4420
+ if (k) {
4421
+ de();
4422
+ return;
4423
+ }
4424
+ ve();
4425
+ }
4426
+ },
4427
+ className: v(
4428
+ "flex w-full items-center gap-2 border bg-[var(--lumen-color-surface)] text-left outline-none transition-all",
4429
+ Se.control,
4430
+ Pn[V],
4431
+ h ? "cursor-not-allowed border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface-muted)] opacity-50" : k ? "border-[var(--lumen-color-primary)] ring-1 ring-[var(--lumen-color-primary)]/10" : "border-[var(--lumen-color-border)] hover:border-[var(--lumen-color-border-hover)]"
4432
+ ),
4433
+ children: [
4434
+ d ? /* @__PURE__ */ e.jsx("div", { className: "flex min-w-0 flex-1 flex-wrap gap-1.5 py-1", children: Z.length > 0 ? Z.map((L) => {
4435
+ const me = a(L);
4436
+ return /* @__PURE__ */ e.jsxs(
4437
+ "span",
4438
+ {
4439
+ className: "inline-flex items-center gap-1 rounded-[6px] bg-[var(--lumen-color-primary-soft)] px-2 py-0.5 text-[13px] text-[var(--lumen-color-primary)]",
4440
+ children: [
4441
+ m(L),
4442
+ W.has(me) ? null : /* @__PURE__ */ e.jsx(
4443
+ ir,
4444
+ {
4445
+ size: 12,
4446
+ "aria-label": `移除 ${m(L)}`,
4447
+ className: "cursor-pointer text-[var(--lumen-color-primary)]/60 hover:text-[var(--lumen-color-primary)]",
4448
+ onClick: (q) => {
4449
+ q.stopPropagation();
4450
+ const g = ie.current.filter(
4451
+ (ne) => ne !== me
4452
+ ), G = g.map(
4453
+ (ne) => Ye(
4454
+ r,
4455
+ ne,
4456
+ a,
4457
+ m,
4458
+ p
4459
+ )
4460
+ ).filter((ne) => ne !== null);
4461
+ ie.current = g, s == null || s(g, G);
4462
+ }
4463
+ }
4464
+ )
4465
+ ]
4466
+ },
4467
+ me
4468
+ );
4469
+ }) : /* @__PURE__ */ e.jsx("span", { className: "text-[var(--lumen-color-text-placeholder)]", children: F }) }) : ae ? /* @__PURE__ */ e.jsx("span", { className: "min-w-0 flex-1 truncate text-[var(--lumen-color-text)]", children: m(ae) }) : /* @__PURE__ */ e.jsx("span", { className: "min-w-0 flex-1 truncate text-[var(--lumen-color-text-placeholder)]", children: F }),
4470
+ /* @__PURE__ */ e.jsx(
4471
+ rr,
4472
+ {
4473
+ size: 16,
4474
+ className: v(
4475
+ "shrink-0 text-[var(--lumen-color-text-placeholder)] transition-transform duration-200",
4476
+ k && "rotate-180"
4477
+ )
4478
+ }
4479
+ )
4480
+ ]
4481
+ }
4482
+ ),
4483
+ k && Re(
4484
+ /* @__PURE__ */ e.jsxs(
4485
+ "div",
4486
+ {
4487
+ ref: N,
4488
+ "data-testid": "tree-select-dropdown",
4489
+ className: v(
4490
+ Se.card,
4491
+ "border border-[var(--lumen-color-border)] bg-[var(--lumen-color-surface)] shadow-[0_8px_30px_var(--lumen-color-shadow)]"
4492
+ ),
4493
+ style: {
4494
+ ...oe,
4495
+ animation: w ? M ? "lumen-dropdown-out-up 0.12s ease-in forwards" : "lumen-dropdown-out 0.12s ease-in forwards" : M ? "lumen-dropdown-in-up 0.12s ease-out" : "lumen-dropdown-in 0.12s ease-out",
4496
+ transformOrigin: Qr(M),
4497
+ visibility: Q ? void 0 : "hidden"
4498
+ },
4499
+ children: [
4500
+ u ? /* @__PURE__ */ e.jsx("div", { className: "border-b border-[var(--lumen-color-surface-muted)] p-2.5", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 rounded-[8px] bg-[var(--lumen-color-surface-muted)] px-3 py-2", children: [
4501
+ /* @__PURE__ */ e.jsx(Kr, { size: 14, className: "shrink-0 text-[var(--lumen-color-text-placeholder)]" }),
4502
+ /* @__PURE__ */ e.jsx(
4503
+ "input",
4504
+ {
4505
+ className: "w-full bg-transparent text-[13px] text-[var(--lumen-color-text)] outline-none placeholder:text-[var(--lumen-color-text-placeholder)]",
4506
+ placeholder: c,
4507
+ value: U,
4508
+ onChange: (L) => le(L.target.value),
4509
+ autoFocus: !0
4510
+ }
4511
+ )
4512
+ ] }) }) : null,
4513
+ /* @__PURE__ */ e.jsx("div", { className: "max-h-[280px] overflow-y-auto p-1.5", children: A ? /* @__PURE__ */ e.jsx("div", { className: "px-3 py-4 text-center text-[13px] text-[var(--lumen-color-text-placeholder)]", children: "加载中..." }) : ee.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "px-3 py-4 text-center text-[13px] text-[var(--lumen-color-text-placeholder)]", children: C }) : ee.map((L) => ye(L, 0)) }),
4514
+ d && P.some((L) => !W.has(L)) ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between border-t border-[var(--lumen-color-surface-muted)] px-3 py-2.5", children: [
4515
+ /* @__PURE__ */ e.jsxs("span", { className: "text-[12px] text-[var(--lumen-color-text-placeholder)]", children: [
4516
+ "已选 ",
4517
+ P.length,
4518
+ " 项"
4519
+ ] }),
4520
+ /* @__PURE__ */ e.jsx(
4521
+ "button",
4522
+ {
4523
+ type: "button",
4524
+ className: "text-[12px] text-[var(--lumen-color-text-placeholder)] transition-colors hover:text-[var(--lumen-color-text-muted)]",
4525
+ onClick: () => {
4526
+ const L = ie.current.filter((q) => W.has(q)), me = L.map((q) => Ye(r, q, a, m, p)).filter((q) => q !== null);
4527
+ ie.current = L, s == null || s(L, me);
4528
+ },
4529
+ children: "清空"
4530
+ }
4531
+ )
4532
+ ] }) : null
4533
+ ]
4534
+ }
4535
+ ),
4536
+ document.body
4537
+ )
4538
+ ]
4539
+ }
4540
+ );
4541
+ };
4542
+ export {
4543
+ Tt as Avatar,
4544
+ Yn as Badge,
4545
+ Be as Button,
4546
+ Bn as Checkbox,
4547
+ Un as ConfirmDialog,
4548
+ Vn as DatePicker,
4549
+ Gn as DateTimePicker,
4550
+ qn as Drawer,
4551
+ Kn as DropdownMenu,
4552
+ Zt as FileUpload,
4553
+ Xn as FormField,
4554
+ ln as Input,
4555
+ $t as Modal,
4556
+ Jn as Pagination,
4557
+ Qn as Radio,
4558
+ Zn as SegmentedControl,
4559
+ un as Select,
4560
+ eo as Switch,
4561
+ ro as Tabs,
4562
+ hn as Textarea,
4563
+ to as TimePicker,
4564
+ no as Timeline,
4565
+ He as Toast,
4566
+ oo as Tooltip,
4567
+ so as TreeSelect,
4568
+ Ct as formatValue,
4569
+ co as lumenThemeAttributes,
4570
+ io as lumenThemeVariables
4571
+ };
4572
+ //# sourceMappingURL=index.js.map